Network camera searching method and device, storage medium and electronic equipment
Searching and operating self-developed network cameras within the LAN through the WS-Discovery protocol solves the cumbersome problem of self-developed device searches in the existing technology and improves device access efficiency and user experience.
Patent Information
- Application Number
- CN202411109862.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-10-25
AI Technical Summary
The existing network camera search method cannot realize automated search of self-developed equipment of enterprises, resulting in users having to manually query IP addresses and other information, which is a cumbersome process, low efficiency and poor user experience.
It uses device detection messages based on the Network Service Dynamic Discovery Protocol (WS-Discovery) to detect and search self-developed network cameras in the LAN through broadcast, realize automatic device detection, and perform device operations through unicast and multicast.
It realizes automated search and operation of self-developed network cameras, improves device access efficiency, improves user experience, and simplifies the operation process.
Smart Images

Figure CN118842883A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network device search, and in particular to a network camera search method and device, a storage medium and an electronic device. Background Art
[0002] IP CAMERA (IPC) is a new generation of camera that combines traditional cameras with network technology, and is also commonly called IPC equipment. IP cameras have been widely used in various fields such as video surveillance. In the application scenario of IP cameras, when you need to access an IP camera, you first need to search for the device to obtain the IP address and other information of the device to be accessed, and then access the device.
[0003] Currently, the main way to search for network cameras is to use the device management tools provided by the device manufacturers to search for devices. The network camera manufacturers will design corresponding device management tools for the network cameras they provide, so that users can search for the network cameras of the manufacturer through the device management tools and then access the devices.
[0004] In actual application scenarios, enterprises often need to use multiple network cameras to meet business needs. In addition to using network cameras from third-party manufacturers, enterprises are gradually starting to use self-developed network cameras. When users need to modify network parameters and other operations when accessing the enterprise's self-developed network cameras, the existing device search method cannot realize automatic search of multiple self-developed devices. Users need to manually query the IP address and other information of each self-developed network camera. The process is very cumbersome, resulting in low device access efficiency and poor user experience. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method for searching network cameras to solve the problem that the existing device search method cannot perform automatic search for network cameras developed by the enterprise itself, and manual query of the information of each self-developed network camera is required, which is a cumbersome process, low efficiency, and poor user experience.
[0006] The embodiment of the present invention also provides a network camera search device to ensure the actual implementation and application of the above method.
[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0008] A method for searching a network camera, comprising:
[0009] When a search instruction for searching devices for each deployed network camera is received, a device detection message corresponding to the search instruction is determined; each network camera includes a plurality of first network cameras; the first network cameras are network cameras of non-third-party manufacturers; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network;
[0010] Sending the device detection message to each of the first network cameras by broadcasting, and receiving response information returned by each of the first network cameras;
[0011] The response information returned by each of the first network cameras is parsed to obtain device data corresponding to each of the first network cameras.
[0012] In the above method, optionally, determining the device detection message corresponding to the search instruction includes:
[0013] Get the network card information corresponding to each preset network card;
[0014] Get local gateway information;
[0015] Based on the network card information corresponding to each of the preset network cards and the local gateway information, determining a target network card from each of the preset network cards;
[0016] Based on the network card information corresponding to the target network card and the User Datagram Protocol (UDP), a broadcast message corresponding to the search instruction is generated, and the broadcast message is used as the device detection message.
[0017] In the above method, optionally, the sending of the device detection message to each of the first network cameras by broadcasting includes:
[0018] Based on the network card information corresponding to the target network card, create a socket object for sending a message;
[0019] Based on the socket object for sending messages, the device detection message is sent to a preset router, and the device detection message is broadcast to each of the first network cameras in the local area network through the router.
[0020] The above method may optionally further include:
[0021] When a first operation instruction is received, a first target network camera corresponding to the first operation instruction is determined in each of the first network cameras; the first operation instruction is an instruction for operating a single network camera in each of the first network cameras;
[0022] Generate a first operation request based on the device data corresponding to the first target network camera and the first operation instruction;
[0023] The first operation request is sent to the first target network camera in a unicast manner, so as to perform the operation corresponding to the first operation instruction on the first target network camera.
[0024] The above method may optionally further include:
[0025] When receiving a second operation instruction, determining each second target network camera corresponding to the second operation instruction in each of the first network cameras; the second operation instruction is an instruction for performing a batch operation on a plurality of network cameras in each of the first network cameras;
[0026] Generate a second operation request based on the device data corresponding to each of the second target network cameras and the second operation instruction;
[0027] The second operation request is sent to each of the second target network cameras by multicasting, so as to perform the operation corresponding to the second operation instruction on each of the second target network cameras.
[0028] In the above method, optionally, each of the deployed network cameras further includes a plurality of second network cameras, and the second network cameras are network cameras of a third-party manufacturer;
[0029] The network camera search method further includes:
[0030] Loading a pre-built dynamic plug-in library; the dynamic plug-in library includes a dynamic plug-in corresponding to each second network camera, and the dynamic plug-in corresponding to each second network camera encapsulates a software development kit SDK corresponding to the second network camera;
[0031] Calling each of the dynamic plug-ins to perform device search, and receiving a response message returned by each of the second network cameras through each of the dynamic plug-ins;
[0032] The response message returned by each of the second network cameras is parsed to obtain device data corresponding to each of the second network cameras.
[0033] The above method may optionally further include:
[0034] When receiving a third operation instruction, determining a network camera set corresponding to the third operation instruction in each of the second network cameras; the network camera set includes at least one third target network camera;
[0035] Based on the device data corresponding to each of the third target network cameras and the third operation instruction, generate a third operation request corresponding to each of the third target network cameras;
[0036] For each of the third target network cameras, the third operation request corresponding to the third target network camera is sent to the SDK corresponding to the third target network camera through the dynamic plug-in corresponding to the third target network camera, so as to perform the operation corresponding to the third operation instruction on the third target network camera.
[0037] A search device for a network camera, comprising:
[0038] A determination unit, configured to, when receiving a search instruction for performing a device search on each deployed network camera, determine a device detection message corresponding to the search instruction; each network camera includes a plurality of first network cameras; the first network cameras are network cameras of non-third-party manufacturers; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network;
[0039] A broadcast unit, configured to send the device detection message to each of the first network cameras by broadcasting, and receive response information returned by each of the first network cameras;
[0040] The parsing unit is used to parse the response information returned by each of the first network cameras to obtain device data corresponding to each of the first network cameras.
[0041] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned network camera search method.
[0042] An electronic device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the above-mentioned network camera search method.
[0043] A network camera search method based on the above-mentioned embodiment of the present invention includes: when receiving a search instruction for searching for devices of each deployed network camera, determining a device detection message corresponding to the search instruction; each network camera includes multiple first network cameras; the first network camera is a network camera of a non-third-party manufacturer; sending a device detection message to each first network camera by broadcasting, and receiving a response message returned by each first network camera; parsing the response message returned by each first network camera to obtain the device data corresponding to each first network camera. Applying the method provided by the embodiment of the present invention, for self-developed IPC devices (i.e., IPC devices of non-third-party manufacturers), each IPC device is pre-connected to the local area network. When it is necessary to search for devices of each self-developed IPC device that has been deployed, the device search can be performed by broadcasting a device detection message, thereby obtaining the device data of each IPC device. During the device search process, users can use a unified tool to search for devices of each self-developed IPC device that has been deployed, realize automatic detection of self-developed devices, and the operation process is convenient, which is conducive to improving device access efficiency and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 A method flow chart of a network camera search method provided by an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of a message transmission implementation process provided by an embodiment of the present invention;
[0047] Figure 3 A topology diagram of a communication network for a network camera of a non-third-party manufacturer provided in an embodiment of the present invention;
[0048] Figure 4 A schematic diagram of a device search process of a network camera of a non-third-party manufacturer provided by an embodiment of the present invention;
[0049] Figure 5 A schematic diagram of a device management process for a network camera of a third-party manufacturer provided by an embodiment of the present invention;
[0050] Figure 6 A schematic diagram of the structure of a search device for a network camera provided by an embodiment of the present invention;
[0051] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0054] The embodiment of the present invention provides a method for searching a network camera. The method can be applied to a device search tool. The execution subject can be a device processor that deploys the device search tool. The method flow chart of the method is as follows: Figure 1 As shown, including:
[0055] S101: when receiving a search instruction for searching devices for each deployed network camera, determining a device detection message corresponding to the search instruction; each network camera includes a plurality of first network cameras; the first network cameras are network cameras of non-third-party manufacturers; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network;
[0056] The method provided in the embodiment of the present invention can be used to manage each deployed network camera (IPC device), and each deployed IPC device includes multiple first network cameras. The first network camera refers to an IPC device that is not a third-party manufacturer, that is, an IPC device whose technical architecture the staff has mastered, usually an IPC device developed by the enterprise itself. In the method provided in the embodiment of the present invention, each first network camera can be connected to the local area network based on the Web Services Dynamic Discovery (WS-Discovery) protocol.
[0057] In the method provided by the embodiment of the present invention, when the processor receives a search instruction for performing a device search on each network camera, a device detection message can be constructed based on the search instruction and the broadcast mechanism of the WS-Discovery protocol. The device detection message is used to detect network camera devices within the local area network. The device detection message can specifically include data such as the broadcast address, device detection request data, source IP address and port number.
[0058] S102: Sending the device detection message to each of the first network cameras by broadcasting, and receiving response information returned by each of the first network cameras;
[0059] In the method provided by the embodiment of the present invention, the processor can send the device detection message to each first network camera in the local area network by broadcasting. When the first network camera receives the device detection message, it will generate response information based on its IP address, Mac address, gateway information, subnet mask, device model, device name, device version, running time and other device data according to the predetermined protocol mechanism, respond to the device detection message, and return its response information to the processor through the local area network. The processor can obtain the response information returned by each first network camera by monitoring the message in the local area network.
[0060] S103: Parse the response information returned by each of the first network cameras to obtain device data corresponding to each of the first network cameras.
[0061] In the method provided by the embodiment of the present invention, the processor can parse the response information returned by each first network camera in a predetermined parsing manner, and obtain device data such as the IP address and Mac address of the network camera from the response information returned by each first network camera.
[0062] Based on the method provided by the embodiment of the present invention, when a search instruction for performing a device search on each network camera is received, a device detection message corresponding to the search instruction is determined; each network camera includes multiple first network cameras; the first network camera is a network camera of a non-third-party manufacturer; the device detection message is sent to each first network camera by broadcasting, and the response information returned by each first network camera is received; the response information returned by each first network camera is parsed to obtain the device data corresponding to each first network camera. Applying the method provided by the embodiment of the present invention, for self-developed IPC devices (i.e., IPC devices of non-third-party manufacturers), each IPC device is pre-connected to the local area network. When it is necessary to perform a device search on each self-developed IPC device that has been deployed, the device search can be performed by broadcasting a device detection message, thereby obtaining the device data of each IPC device. During the device search process, users can use a unified tool to perform a device search on each self-developed IPC device that has been deployed, and realize the automatic detection of self-developed devices. The operation process is convenient, which is conducive to improving device access efficiency and improving user experience.
[0063] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of determining the device detection message corresponding to the search instruction mentioned in step S101 includes:
[0064] Get the network card information corresponding to each preset network card;
[0065] Get local gateway information;
[0066] In the method provided by an embodiment of the present invention, the processor can obtain the network card information of each network card (i.e., the preset network card) deployed in the current terminal from the network configuration information of the current terminal (i.e., the terminal device equipped with the device search tool), and obtain the gateway information of the local machine (i.e., the current terminal) therefrom.
[0067] Based on the network card information corresponding to each of the preset network cards and the local gateway information, determining a target network card from each of the preset network cards;
[0068] In the method provided by the embodiment of the present invention, the processor can obtain the IP address, Mac address and other address data of each preset network card from the network card information of each preset network card, and match the network card based on the address data of each preset network card and the local gateway information, so as to determine the network card currently used by the current terminal to access the network among each preset network card, and use the network card as the target network card.
[0069] Based on the network card information corresponding to the target network card and the User Datagram Protocol (UDP), a broadcast message corresponding to the search instruction is generated, and the broadcast message is used as the device detection message.
[0070] In the method provided by an embodiment of the present invention, the processor can obtain the address data of the current terminal, such as the IP address, Mac address, port number, etc., from the network card information corresponding to the target network card, and based on the address data of the current terminal, generate a broadcast message corresponding to the search instruction through the User Datagram Protocol (UDP), that is, a broadcast message for detecting the device, and use the broadcast message as a device detection message.
[0071] On the basis of the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process of sending the device detection message to each of the first network cameras by broadcasting mentioned in step S102 includes:
[0072] Based on the network card information corresponding to the target network card, create a socket object for sending a message;
[0073] In the method provided by the embodiment of the present invention, the processor can obtain address data such as the port number of the current terminal from the network card information corresponding to the target network card, and create a socket object for sending messages based on the address data of the current terminal.
[0074] Based on the socket object for sending messages, the device detection message is sent to a preset router, and the device detection message is broadcast to each of the first network cameras in the local area network through the router.
[0075] In the method provided by the embodiment of the present invention, the send() function is used to write the device detection message into the socket object used to send the message, so that the device detection message is sent to the router through the socket object. Since the device detection message is a broadcast message, the router will broadcast the device detection message to each first network camera in the local area network.
[0076] It is understandable that the processor will also create a socket object for receiving messages, bind the socket object to the address data of the current terminal, monitor the messages transmitted in the local area network through the socket object, and filter the messages in the local area network to obtain the messages sent to the current terminal.
[0077] In order to better illustrate the method provided by the embodiment of the present invention, the device search process of the first network camera in the method provided by the embodiment of the present invention is briefly described below. Figure 2 The topology of the communication network between the device search tool and each first network camera can be as follows: Figure 3 As shown, the process of searching for devices for each first network camera can be as follows: Figure 4In the method provided by the embodiment of the present invention, the processor can obtain all network card information and the local gateway of the current terminal, obtain the IP addresses, Mac addresses and other data of all network cards according to the network card information, and use the local gateway and the IP addresses and other data of each network card to determine the network card currently used by the terminal, and create a socket object for sending messages and a socket object for receiving messages based on the currently used network card. Based on the socket object for sending messages, the send() function can be applied to broadcast the device detection message of the current terminal to each first network camera (for example Figure 4 Device A, device B and device C shown in the figure), based on the socket object for monitoring messages, apply the receive() function to monitor the data packets sent to the IP address of the current terminal to receive the response messages sent by each first network camera to the device search tool.
[0078] exist Figure 1 On the basis of the method shown, the method provided in the embodiment of the present invention further includes:
[0079] When a first operation instruction is received, a first target network camera corresponding to the first operation instruction is determined in each of the first network cameras; the first operation instruction is an instruction for operating a single network camera in each of the first network cameras;
[0080] In the method provided by the embodiment of the present invention, after completing the device search process of the network camera, the user can select the network camera that currently needs to perform certain operations through the front end, and send instructions to operate the network camera, such as modifying the network parameters of the network camera, or restarting the network camera.
[0081] In the method provided by the embodiment of the present invention, when the processor receives an instruction to operate a single network camera in the first network camera (i.e., the so-called first operation instruction), the first operation instruction can be parsed to obtain the operation device, operation type, operation data and other information corresponding to the operation instruction. The operation device refers to the network camera indicated in the operation instruction that needs to perform the corresponding operation. The operation type refers to the type of operation to be performed, such as network parameter modification, device restart, etc. The operation data refers to the parameters associated with the operation, such as the operation of network parameter modification, and its operation data can be the modified network parameters. The processor can use the operation device indicated in the operation instruction, i.e., the first network camera to be operated, as the first target network camera.
[0082] Generate a first operation request based on the device data corresponding to the first target network camera and the first operation instruction;
[0083] In the method provided by an embodiment of the present invention, the processor can obtain information such as the IP address from the device data corresponding to the first target network camera, and based on the information such as the IP address of the first target network camera, the operation type and operation data indicated by the first operation instruction, create an operation request for instructing the first target network camera to perform the corresponding operation, and use the operation request as the first operation request.
[0084] The first operation request is sent to the first target network camera in a unicast manner, so as to perform the operation corresponding to the first operation instruction on the first target network camera.
[0085] In the method provided by the embodiment of the present invention, the processor may send the first operation request to the first target network camera based on the unicast mechanism of the WS-Discovery protocol, so as to perform a corresponding operation on the first target network camera.
[0086] exist Figure 1 On the basis of the method shown, the method provided in the embodiment of the present invention further includes:
[0087] When receiving a second operation instruction, determining each second target network camera corresponding to the second operation instruction in each of the first network cameras; the second operation instruction is an instruction for performing a batch operation on a plurality of network cameras in each of the first network cameras;
[0088] In the method provided by the embodiment of the present invention, after completing the device search process of the network cameras, the user can perform batch operations on the network cameras through the front end. The user can select each network camera that currently needs to perform certain operations and send instructions for batch operations on each network camera, that is, perform the same operation on multiple network cameras at the same time, such as batch operations for modifying network parameters of network cameras, and batch operations for restarting network cameras.
[0089] In the method provided by the embodiment of the present invention, when the processor receives an instruction to operate multiple network cameras in the first network camera (i.e., the so-called second operation instruction), the second operation instruction can be parsed to obtain information such as each operation device, operation type, operation data, etc. corresponding to the operation instruction, and each operation device indicated in the operation instruction, that is, each first network camera that needs to perform the operation, is used as each second target network camera.
[0090] Generate a second operation request based on the device data corresponding to each of the second target network cameras and the second operation instruction;
[0091] In the method provided by the embodiment of the present invention, the processor can determine the multicast address corresponding to each second target network camera based on the device data of each second target network camera, create an operation request for instructing the second target network camera to perform the corresponding operation based on the multicast address and the operation type and operation data indicated by the second operation instruction, and use the operation request as the second operation request.
[0092] It can be understood that in the embodiment of the present invention, the device is operated by multicasting, so each second target network camera corresponding to the second operation instruction is added with a multicast address.
[0093] The second operation request is sent to each of the second target network cameras by multicasting, so as to perform the operation corresponding to the second operation instruction on each of the second target network cameras.
[0094] In the method provided by the embodiment of the present invention, the processor may send the second operation request to each second target network camera by multicast based on the multicast mechanism of the WS-Discovery protocol, so as to perform a corresponding operation on each second target network camera.
[0095] It should be noted that when a user performs batch operations on multiple first network cameras, if the first network cameras to be operated are not added to the multicast address, the operation requests can also be sent to the corresponding first network cameras in a unicast manner.
[0096] exist Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, each of the deployed network cameras further includes a plurality of second network cameras, and the second network cameras are network cameras of a third-party manufacturer. The network camera search method provided by the embodiment of the present invention further includes:
[0097] Loading a pre-built dynamic plug-in library; the dynamic plug-in library includes a dynamic plug-in corresponding to each second network camera, and the dynamic plug-in corresponding to each second network camera encapsulates a software development kit SDK corresponding to the second network camera;
[0098] In the method provided by the embodiment of the present invention, in addition to multiple first network cameras, each deployed network camera also includes multiple second network cameras, and the second network camera refers to an IPC device of a third-party manufacturer. For the IPC device of the third-party manufacturer, the software development kit (Software Development Kit, SDK) provided by the third-party manufacturer for the IPC device is pre-packaged in the form of a plug-in. Specifically, the QTPlugin plug-in technology can be used to package the SDK provided by the third-party manufacturer as a dynamic plug-in. The SDK provided by the third-party manufacturer for the IPC device integrates various device management functions about the IPC device, such as device search, device network parameter modification and other functions. In the specific implementation process, a dynamic plug-in can be constructed for one SDK, thereby encapsulating the SDK involved in each second network camera into each dynamic plug-in, building a plug-in library based on each dynamic plug-in, defining a unified interface for each dynamic plug-in, and by calling the corresponding functional interface, the SDK encapsulated by each dynamic plug-in can perform the corresponding function. It should be noted that when there are multiple second network cameras using the same SDK, only one dynamic plug-in can be constructed for the SDK, and the second network cameras using the same SDK correspond to the same dynamic plug-in.
[0099] In the method provided by the embodiment of the present invention, during the device search process, the processor may load a pre-built dynamic plug-in library, which contains various dynamic plug-ins that encapsulate the SDK corresponding to each second network camera.
[0100] Calling each of the dynamic plug-ins to perform device search, and receiving a response message returned by each of the second network cameras through each of the dynamic plug-ins;
[0101] In the method provided by the embodiment of the present invention, the processor can call the pre-set plug-in interface, call the device search function of the SDK encapsulated by each dynamic plug-in, and call each dynamic plug-in to perform a device search for the corresponding second network camera. The SDK encapsulated in each dynamic plug-in can send a device search request to the corresponding second network camera in response to the plug-in call operation. When the second network camera receives the device search request sent by its corresponding SDK, it can generate a response message in a predetermined data format based on its IP address, Mac address and other device data, and return it to the SDK. When the SDK obtains the response message returned by the second network camera, it can return the response message to the processor through its corresponding dynamic plug-in.
[0102] The response message returned by each of the second network cameras is parsed to obtain device data corresponding to each of the second network cameras.
[0103] In the method provided by the embodiment of the present invention, the processor can parse the response message returned by each second network camera according to a predetermined parsing method, and obtain the device data such as the IP address and Mac address of the second network camera from the response message returned by each second network camera.
[0104] Based on the method provided in the embodiment of the present invention, when IPC devices from different sources are deployed, for IPC devices from third-party manufacturers, the SDK provided by the corresponding third-party manufacturer for the IPC device is pre-packaged as a plug-in, and a dynamic plug-in of the packaged SDK is deployed. During the device search process, for IPC devices from third-party manufacturers, device search can be implemented by calling the dynamic plug-in and using the SDK corresponding to the IPC device to obtain device data for each IPC device. During the device search process, users can use a unified tool to search for IPC devices from different sources. On the basis of realizing device search for self-developed devices, IPC devices from different third-party manufacturers can also be uniformly detected. The operation process is convenient, which is conducive to improving device access efficiency and further improving user experience.
[0105] On the basis of the method provided in the above embodiment, the method provided in the embodiment of the present invention further includes:
[0106] When receiving a third operation instruction, determining a network camera set corresponding to the third operation instruction in each of the second network cameras; the network camera set includes at least one third target network camera;
[0107] In the method provided by the embodiment of the present invention, when the processor receives an instruction to operate a single network camera or multiple network cameras in the second network camera (i.e., the so-called third operation instruction), the third operation instruction can be parsed to obtain information such as the operation device, operation type, and operation data corresponding to the operation instruction, and the operation device indicated in the operation instruction to be operated, i.e., the second network camera to be operated, is used as the third target network camera, thereby obtaining the network camera set corresponding to the third operation instruction. The number of third target network cameras in the network camera set is determined by the number of operation devices indicated in the third operation instruction. If the third operation instruction is an instruction to perform an operation on a single second network camera, the network camera set only includes one third target network camera. If the third operation instruction is an instruction to perform a batch operation on multiple second network cameras, the network camera set includes multiple third target network cameras.
[0108] Based on the device data corresponding to each of the third target network cameras and the third operation instruction, generate a third operation request corresponding to each of the third target network cameras;
[0109] In the method provided by an embodiment of the present invention, the processor can generate, for each third target network camera, an operation request for instructing the third target network camera to perform a corresponding operation based on information such as the IP address in the corresponding device data, and information on the operation type and operation data indicated by the third operation instruction, and use the operation request as the third operation request corresponding to the third target network camera.
[0110] For each of the third target network cameras, the third operation request corresponding to the third target network camera is sent to the SDK corresponding to the third target network camera through the dynamic plug-in corresponding to the third target network camera, so as to perform the operation corresponding to the third operation instruction on the third target network camera.
[0111] In the method provided in an embodiment of the present invention, the processor can call the corresponding plug-in interface, and send the third operation request corresponding to each third target network camera to the SDK corresponding to the third target network camera through the dynamic plug-in corresponding to each third target network camera, so as to trigger the SDK to control the third target network camera to perform the corresponding operation.
[0112] To better illustrate the method provided by the embodiment of the present invention, please refer to Figure 5 , Figure 5 The schematic diagram of the process of device management for the second network camera is shown. Figure 5 The third-party device in the term "third-party device" refers to the second network camera, the plug-in refers to the dynamic plug-in corresponding to the second network camera, and the third-party SDK refers to the SDK corresponding to the second network camera. The device management of the second network camera includes operations such as searching for devices on the second network camera and modifying network parameters of the device. When searching for or operating the second network device, the device search tool can call each plug-in by calling the plug-in interface, send messages to the corresponding SDK through the plug-in, search for devices on the second network camera or perform operations through the SDK, and receive information returned by the second network camera through the SDK through the plug-in.
[0113] On the basis of the method provided in the above embodiment, the method provided in the embodiment of the present invention further includes:
[0114] The device data corresponding to each of the network cameras is displayed in the front-end interface.
[0115] In the method provided by the embodiment of the present invention, the processor can display the device data of each network camera in the front-end interface according to a predetermined display method, that is, display the device data of each first network camera and each second network camera, and the displayed device data may include the device name, device model, device IP address, subnet mask, gateway, Mac address, device manufacturer, etc. The front-end page can also provide a device filtering function, for example, the device data of the network camera to be displayed can be filtered by content such as device manufacturer, IP address or device model.
[0116] In order to better illustrate the method provided by the embodiment of the present invention, based on the methods provided by the previous embodiments and in combination with actual application scenarios, the embodiment of the present invention provides another method for searching network cameras, which can be applied to device search tools. In the method provided by the embodiment of the present invention, for self-developed IPC devices, a custom UDP broadcast method is used to implement device search, and the device can be operated through broadcast, unicast and multicast. For IPC devices from third-party manufacturers, the device tool SDK provided by the third-party manufacturer is encapsulated in the form of QT Plugin to implement device search and device modification and other operations.
[0117] In the method provided in the embodiment of the present invention, regarding the self-developed IPC device, each IPC device is connected to the local area network based on the WS-Discovery standard, and the communication network topology between the device search tool and the self-developed IPC device can be as follows: Figure 3 As shown, the device search process can be as follows Figure 4 As shown in FIG. 1 , the communication process between the device search tool and the IPC device of the third-party manufacturer can be as follows: Figure 5 As shown. In the embodiment of the present invention, QT Plugin plug-in technology is used to encapsulate the SDK provided by the third-party manufacturer for the IPC device into a dynamic plug-in, and a unified interface is defined for each plug-in. The specific functions are implemented by the plug-in encapsulated SDK. The device search tool can integrate the SDKs of multiple third-party manufacturers and call the unified interface to implement functions such as device search. When other IPC devices from other third-party manufacturers are newly added, their SDKs are encapsulated as plug-ins according to the predetermined plug-in interface, and device search and management can be implemented based on the encapsulated dynamic plug-in.
[0118] The device search process provided by the embodiment of the present invention mainly includes:
[0119] Connect the terminal equipped with the device search tool and each self-developed IPC device to the local area network respectively. For self-developed IPC devices, the terminal equipped with the device search tool broadcasts the device detection message to the IPC device through the router. The IPC device can send a response message containing a UDP data packet to the router to return the device-related information in response, so that the terminal can monitor and parse it. Specifically, Figure 2 As shown, the terminal can create different socket objects by determining the currently used network card to send messages and listen to messages in the network, and then receive the response information and device-related data of each IPC device, and display the relevant data of each IPC device on the front end. For IPC devices from third-party manufacturers, the terminal calls the dynamic plug-in corresponding to each IPC device through the pre-deployed plug-in interface, implements device search through the SDK encapsulated in the dynamic plug-in, obtains the response information returned by the IPC device through the corresponding SDK, parses the response information to obtain device-related data, and displays the device-related data on the front end.
[0120] In the method provided by the embodiment of the present invention, the device parameters of the specified device can be modified based on the device search tool, such as modifying the Mac address and the like. In response to the parameter modification operation, the device search tool can send a modification request carrying the modified device parameters to the target device. If the target device is a self-developed IPC device, the modification request can be sent to the target device by unicast or multicast. After receiving the modification request, the target device modifies the parameters, and after the modification is completed, a UDP packet is sent to the device search tool so that the device search tool can monitor and parse it. If the target device is an IPC device from a third-party manufacturer, the device search tool can send the modification request to the SDK in the corresponding dynamic plug-in by calling the plug-in interface, instruct the target device to modify the parameters through the corresponding SDK, and receive a response message after the target device modifies the parameters through the SDK.
[0121] In addition, the device search tool provided in the embodiment of the present invention also supports one-key restart of each device and one-key transfer to the interface for function configuration of the device, so as to realize the function configuration of different application requirements of the user for the IPC device. The device search tool also supports batch modification of network parameters of devices, etc.
[0122] Based on the method provided by the embodiment of the present invention, the search and configuration requirements of self-developed IPC devices can be solved, and the SDKs of IPC devices from multiple third-party manufacturers are integrated, which is conducive to users to conduct unified device search and management of IPC devices from different sources, improve the convenience of IPC device management, and improve user experience. In addition, the method provided by the embodiment of the present invention can be applied to different system platforms, and the device search tool can be deployed on Windows, Mac or Linux systems to achieve cross-platform use.
[0123] and Figure 1 Corresponding to the network camera search method shown in FIG. 1 , an embodiment of the present invention further provides a network camera search device for searching Figure 1 The specific implementation of the method shown in is shown in the structural diagram Figure 6 As shown, including:
[0124] The determination unit 201 is used to determine the device detection message corresponding to the search instruction when receiving a search instruction for performing device search on each deployed network camera; each network camera includes a plurality of first network cameras; the first network camera is a network camera of a non-third-party manufacturer; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network;
[0125] A broadcast unit 202, configured to send the device detection message to each of the first network cameras by broadcasting, and receive response information returned by each of the first network cameras;
[0126] The parsing unit 203 is used to parse the response information returned by each of the first network cameras to obtain device data corresponding to each of the first network cameras.
[0127] By using the device provided by the embodiment of the present invention, for self-developed IPC devices (i.e., IPC devices not from third-party manufacturers), each IPC device is pre-connected to the local area network. When it is necessary to perform a device search on each self-developed IPC device that has been deployed, the device search can be performed by broadcasting a device detection message to obtain the device data of each IPC device. During the device search process, users can use a unified tool to perform a device search on each self-developed IPC device that has been deployed, thereby realizing automated detection of self-developed devices. The operation process is convenient, which is conducive to improving device access efficiency and user experience.
[0128] exist Figure 6 Based on the device shown, the device provided by the embodiment of the present invention can be further expanded into multiple units. The function of each unit can refer to the description of each embodiment provided in the above-mentioned method for searching for network cameras, and no further examples will be given here.
[0129] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned network camera search method.
[0130] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 7 As shown, it specifically includes a memory 301 and one or more instructions 302, wherein the one or more instructions 302 are stored in the memory 301 and are configured to be executed by one or more processors 303 to perform the following operations:
[0131] When a search instruction for searching devices for each deployed network camera is received, a device detection message corresponding to the search instruction is determined; each network camera includes a plurality of first network cameras; the first network cameras are network cameras of non-third-party manufacturers; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network;
[0132] Sending the device detection message to each of the first network cameras by broadcasting, and receiving response information returned by each of the first network cameras;
[0133] The response information returned by each of the first network cameras is parsed to obtain device data corresponding to each of the first network cameras.
[0134] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0135] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0136] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for searching a network camera, characterized in that: include: When receiving a search instruction for performing a device search on each deployed network camera, determining a device detection message corresponding to the search instruction; The network cameras include a plurality of first network cameras; the first network cameras are network cameras not from a third-party manufacturer; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network; Sending the device detection message to each of the first network cameras by broadcasting, and receiving response information returned by each of the first network cameras; The response information returned by each of the first network cameras is parsed to obtain device data corresponding to each of the first network cameras.
2. The method for searching a network camera according to claim 1, characterized in that: The determining of the device detection message corresponding to the search instruction includes: Get the network card information corresponding to each preset network card; Get local gateway information; Based on the network card information corresponding to each of the preset network cards and the local gateway information, determining a target network card from each of the preset network cards; Based on the network card information corresponding to the target network card and the User Datagram Protocol (UDP), a broadcast message corresponding to the search instruction is generated, and the broadcast message is used as the device detection message.
3. The method for searching a network camera according to claim 2, characterized in that: The sending of the device detection message to each of the first network cameras by broadcasting includes: Based on the network card information corresponding to the target network card, create a socket object for sending a message; Based on the socket object for sending messages, the device detection message is sent to a preset router, and the device detection message is broadcasted to each of the first network cameras in the local area network through the router.
4. The method for searching a network camera according to claim 1, characterized in that: Also includes: When a first operation instruction is received, determining a first target network camera corresponding to the first operation instruction among the first network cameras; The first operation instruction is an instruction for operating a single network camera among the first network cameras; Generate a first operation request based on the device data corresponding to the first target network camera and the first operation instruction; The first operation request is sent to the first target network camera in a unicast manner, so as to perform the operation corresponding to the first operation instruction on the first target network camera.
5. The method for searching a network camera according to claim 1, characterized in that: Also includes: When receiving a second operation instruction, determining, among the first network cameras, respective second target network cameras corresponding to the second operation instruction; The second operation instruction is an instruction for performing a batch operation on a plurality of network cameras in each of the first network cameras; Generate a second operation request based on the device data corresponding to each of the second target network cameras and the second operation instruction; The second operation request is sent to each of the second target network cameras by multicasting, so as to perform the operation corresponding to the second operation instruction on each of the second target network cameras.
6. The method for searching a network camera according to claim 1, characterized in that: The deployed network cameras further include a plurality of second network cameras, where the second network cameras are network cameras of a third-party manufacturer; The network camera search method further includes: Loading a pre-built dynamic plug-in library; the dynamic plug-in library includes a dynamic plug-in corresponding to each second network camera, and the dynamic plug-in corresponding to each second network camera encapsulates a software development kit SDK corresponding to the second network camera; Calling each of the dynamic plug-ins to perform device search, and receiving a response message returned by each of the second network cameras through each of the dynamic plug-ins; The response message returned by each of the second network cameras is parsed to obtain device data corresponding to each of the second network cameras.
7. The method for searching a network camera according to claim 6, characterized in that: Also includes: When a third operation instruction is received, determining a network camera set corresponding to the third operation instruction in each of the second network cameras; The network camera set includes at least one third target network camera; Based on the device data corresponding to each of the third target network cameras and the third operation instruction, generate a third operation request corresponding to each of the third target network cameras; For each of the third target network cameras, the third operation request corresponding to the third target network camera is sent to the SDK corresponding to the third target network camera through the dynamic plug-in corresponding to the third target network camera, so as to perform the operation corresponding to the third operation instruction on the third target network camera.
8. A network camera search device, characterized in that: include: A determination unit, configured to, when receiving a search instruction for performing a device search on each deployed network camera, determine a device detection message corresponding to the search instruction; each network camera includes a plurality of first network cameras; the first network cameras are network cameras of non-third-party manufacturers; the device detection message is a detection message constructed based on a network service dynamic discovery protocol, and the detection message is used to perform device detection on each network camera in a local area network; A broadcast unit, configured to send the device detection message to each of the first network cameras by broadcasting, and receive response information returned by each of the first network cameras; The parsing unit is used to parse the response information returned by each of the first network cameras to obtain device data corresponding to each of the first network cameras.
9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the network camera search method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The system comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the network camera search method as claimed in any one of claims 1 to 7.
Citation Information
Cited By
ONVIF search optimization method and system based on default IP and terminal
CN121567678A
