NVR and IPC collaborative connection method, system and computer-readable storage medium
By selecting the master NVR and matching its capabilities within the LAN, the problem of accurately adding multiple NVRs and IPC devices is solved, fast and stable IPC connections are achieved, duplication and missed additions are avoided, and the resource utilization efficiency of the system is improved.
Patent Information
- Application Number
- CN202111527149.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-12-14
AI Technical Summary
When there are multiple NVRs in the same LAN, existing technologies cannot effectively solve the problem of accurately adding and matching multiple NVRs and IPC devices, resulting in repeated addition or missing addition.
By electing a master NVR in the local area network, obtaining the capability parameters of each slave NVR and the IPC to be matched, performing capability matching, and distributing the IPC to the slave NVR based on the matching results to complete the connection, achieving accurate pairing of NVR and IPC.
It achieves fast and stable IPC device connection in a multi-NVR environment, avoids repeated addition and missed addition, and gives full play to the performance of NVR and IPC.
Smart Images

Figure CN114222090B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of XX, and in particular to a collaborative connection method and system for an NVR and an IPC, and a computer-readable storage medium. Background Art
[0002] After entering the 21st century, with the development of network technology, the demand for storing video data through the network has increased. The monitoring system with hard disk recorder (DVR) as the core has further developed into an NVR system with network function.
[0003] An NVR (Network Video Recorder) is the storage and forwarding component of a network video surveillance system. Working in conjunction with a video encoder or network camera, the NVR performs video recording, storage, and forwarding. The core functions of an NVR are the capture, storage, management, and forwarding of network video streams. The NVR software interface, the human-computer interaction window, handles all system functions, including channel parameter settings, starting and stopping recording, video browsing, video playback, video export, and PTZ control (short for Pan / Tilt / Zoom, representing full-scale (up and down, left and right) pan / tilt movement and lens zoom and focus control), all through the user interface.
[0004] If there are a large number of IPC devices and NVRs in the same LAN, when multiple NVRs search for IPC devices in the LAN, repeated IPC additions will occur. Also, due to NVR capacity issues (for example, a 16-channel NVR can only add 16-channel IPCs), some IPCs may not be added. Summary of the Invention
[0005] The main purpose of the present invention is to provide a method, system and computer-readable storage medium for collaborative connection of NVR and IPC, aiming to solve the technical problem of how to accurately add pairing according to IPC performance and NVR performance, thereby realizing collaborative work of multiple NVRs.
[0006] To achieve the above object, the present invention provides a collaborative connection method between an NVR and an IPC, the collaborative connection method between an NVR and an IPC comprising the following steps:
[0007] When there are multiple NVRs in the same LAN, a master NVR is selected from the multiple NVRs;
[0008] Controlling the master NVR to obtain first capability parameters of each slave NVR in the local area network;
[0009] Controlling the master NVR to obtain the second capability parameter of each IPC to be matched in the local area network;
[0010] Controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter;
[0011] The master NVR is controlled to distribute the to-be-matched IPC to the slave NVR according to the result of capability matching, so as to complete the connection.
[0012] Optionally, when there are multiple NVRs in the same local area network, the step of selecting a master NVR from the multiple NVRs includes:
[0013] When there are more than one NVR in the same LAN, each NVR is set as a first-level candidate NVR to control the capability parameters broadcast by each NVR and receive the capability parameters broadcast by other NVRs;
[0014] Based on the capability parameters of the local NVR and the capability parameters received from other NVR broadcasts, control each of the first-level candidate NVRs to generate their own capability parameter ranking table;
[0015] Controlling each of the first-level candidate NVRs to determine the first-level candidate NVR in the respective capability parameter ranking table and setting it as the second-level candidate NVR;
[0016] If there is more than one secondary candidate NVR, continue to select the master NVR from the secondary candidate NVRs;
[0017] If the secondary candidate NVR is a separate NVR, directly set the secondary candidate NVR as the master NVR;
[0018] All other NVRs in the local area network except the master NVR are set as slave NVRs.
[0019] Optionally, if there is more than one secondary candidate NVR, the step of continuing to select a master NVR from the secondary candidate NVRs includes:
[0020] Controlling each of the secondary candidate NVRs to broadcast its own capability parameters, and simultaneously receiving capability parameters broadcast by other secondary candidate NVRs;
[0021] Based on the capability parameters of the local NVR and the capability parameters received from other secondary candidate NVRs, each secondary candidate NVR is controlled to generate its own capability parameter ranking table;
[0022] Controlling each of the second-level candidate NVRs to determine the second-level candidate NVR ranked first in the respective capability parameter ranking tables, and setting it as the third-level candidate NVR;
[0023] If there is more than one third-level candidate NVR, then continue to select the master NVR from the three-level candidate NVRs;
[0024] If the third-level candidate NVR is a separate NVR, directly set the third-level candidate NVR as the master NVR;
[0025] The step of setting all other NVRs in the local area network except the master NVR as slave NVRs is performed.
[0026] Optionally, after the step of setting all other NVRs in the local area network except the master NVR as slave NVRs, the method further includes:
[0027] Control the master NVR to send heartbeat packets to each of the slave NVRs;
[0028] If the heartbeat packet is normal, executing the step of controlling the master NVR to obtain the first capability parameter of each slave NVR in the local area network;
[0029] If the heartbeat packet is abnormal, reselect the master NVR.
[0030] Optionally, the step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter includes:
[0031] Controlling the master NVR to determine a first matching order for each of the slave NVRs to be matched with the IPC to be matched according to the first capability parameter, and determining a second matching order for each of the IPC to be matched with the slave NVR according to the second capability parameter;
[0032] The master NVR is controlled to preferentially match the IPC to be matched with the slave NVR with smaller capability according to the first matching order, and preferentially match the IPC to be matched with the slave NVR with smaller capability according to the second matching order.
[0033] Optionally, the step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter further includes:
[0034] Controlling the master NVR to determine whether the first capability parameter values of the slave NVRs currently being matched are all greater than the second capability parameter values of the IPCs to be matched currently being matched;
[0035] If so, the slave NVR currently being matched and the to-be-matched IPC currently being matched are matched successfully.
[0036] Optionally, after the step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter, the step further includes:
[0037] Control the master NVR to count the number of IPCs that successfully match the slave NVR;
[0038] Controlling the master NVR to compare the number of successfully connected IPCs with a preset maximum number of IPC connections of the slave NVR;
[0039] If the number of the successfully connected IPCs is equal to the preset maximum number of IPC connections of the slave NVR, the capability matching between the next slave NVR and the IPC to be matched will be automatically started.
[0040] Optionally, the step of controlling the master NVR to distribute the to-be-matched IPC to the slave NVR according to the result of capability matching so as to complete the connection includes:
[0041] Controlling the slave NVR to send an IPC allocation request to the master NVR;
[0042] The master NVR is controlled to respond to the IPC allocation request, and the IPC to be matched is distributed to the slave NVR with which the capability matching is successful.
[0043] In addition, to achieve the above-mentioned purpose, the present invention also provides a collaborative connection system of NVR and IPC, and the collaborative connection system of NVR and IPC includes: a memory, a processor, and a collaborative connection program of NVR and IPC stored in the memory and runnable on the processor, and when the collaborative connection program of NVR and IPC is executed by the processor, the steps of the collaborative connection method of NVR and IPC as described above are implemented.
[0044] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a collaborative connection program of NVR and IPC is stored. When the collaborative connection program of NVR and IPC is executed by a processor, the steps of the collaborative connection method of NVR and IPC as described above are implemented.
[0045] The present invention proposes a method, system and computer-readable storage medium for collaborative connection of an NVR and an IPC. In the collaborative connection method of an NVR and an IPC, when there are multiple NVRs in the same local area network, a master NVR is selected from the multiple NVRs; the master NVR is controlled to obtain a first capability parameter of each slave NVR in the local area network; the master NVR is controlled to obtain a second capability parameter of each to-be-matched IPC in the local area network; the master NVR is controlled to perform capability matching between the slave NVR and the to-be-matched IPC based on the first capability parameter and the second capability parameter; and the master NVR is controlled to distribute the to-be-matched IPC to the slave NVR based on the capability matching result to complete the connection. The present invention selects an NVR as the master control through the internal election mechanism of the NVR in the local area network, and accurately matches the NVR and IPC according to the decoding capability parameters of the slave and the capability of the camera IPC, thereby controlling the connection between the slave NVR and the specified IPC without the need for external PC devices, giving full play to the performance of the IPC and NVR. When there are a large number of NVRs and IPC devices in the local area network, the IPC is distributed to the corresponding NVR quickly and stably, avoiding the situation of repeated addition or omission of IPC devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention;
[0047] Figure 2 1. A flowchart of an embodiment of a method for collaboratively connecting an NVR and an IPC according to the present invention;
[0048] Figure 3 This is a schematic diagram of an application scenario in which a master NVR is selected in an embodiment of a method for collaboratively connecting an NVR and an IPC according to the present invention;
[0049] Figure 4 This is a schematic diagram of a scenario in which the master NVR obtains parameter information of each slave NVR in an embodiment of the collaborative connection method between NVRs and IPCs of the present invention;
[0050] Figure 5 This is a schematic diagram of a scenario in which the master NVR obtains parameter information of each IPC to be matched in an embodiment of the collaborative connection method between NVR and IPC of the present invention;
[0051] Figure 6 This is a schematic diagram of a scenario in which a master NVR allocates IPCs to be matched to slave NVRs in one embodiment of a collaborative connection method between NVRs and IPCs of the present invention.
[0052] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0054] like Figure 1 As shown, Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.
[0055] The terminal in the embodiment of the present invention is a NVR system composed of multiple NVR loads in a local area network.
[0056] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0057] Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. Among them, sensors include light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display screen according to the brightness of the ambient light, and the proximity sensor may turn off the display screen and / or backlight when the mobile terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; of course, the mobile terminal can also be configured with other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which will not be repeated here.
[0058] Those skilled in the art will understand that Figure 1The terminal structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0059] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a collaborative connection program between the NVR and the IPC.
[0060] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the collaborative connection program between the NVR and the IPC stored in the memory 1005 and perform the following operations:
[0061] When there are multiple NVRs in the same LAN, a master NVR is selected from the multiple NVRs;
[0062] Controlling the master NVR to obtain first capability parameters of each slave NVR in the local area network;
[0063] Controlling the master NVR to obtain the second capability parameter of each IPC to be matched in the local area network;
[0064] Controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter;
[0065] The master NVR is controlled to distribute the to-be-matched IPC to the slave NVR according to the result of capability matching, so as to complete the connection.
[0066] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0067] When there are multiple NVRs in the same local area network, the step of selecting a master NVR from the multiple NVRs includes:
[0068] When there are more than one NVR in the same LAN, each NVR is set as a first-level candidate NVR to control the capability parameters broadcast by each NVR and receive the capability parameters broadcast by other NVRs;
[0069] Based on the capability parameters of the local NVR and the capability parameters received from other NVR broadcasts, control each of the first-level candidate NVRs to generate their own capability parameter ranking table;
[0070] Controlling each of the first-level candidate NVRs to determine the first-level candidate NVR in the respective capability parameter ranking table and setting it as the second-level candidate NVR;
[0071] If there is more than one secondary candidate NVR, continue to select the master NVR from the secondary candidate NVRs;
[0072] If the secondary candidate NVR is a separate NVR, directly set the secondary candidate NVR as the master NVR;
[0073] All other NVRs in the local area network except the master NVR are set as slave NVRs.
[0074] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0075] If there is more than one secondary candidate NVR, the step of continuing to select a master NVR from the secondary candidate NVRs includes:
[0076] Controlling each of the secondary candidate NVRs to broadcast its own capability parameters, and simultaneously receiving capability parameters broadcast by other secondary candidate NVRs;
[0077] Based on the capability parameters of the local NVR and the capability parameters received from other secondary candidate NVRs, each secondary candidate NVR is controlled to generate its own capability parameter ranking table;
[0078] Controlling each of the second-level candidate NVRs to determine the second-level candidate NVR ranked first in the respective capability parameter ranking tables, and setting it as the third-level candidate NVR;
[0079] If there is more than one third-level candidate NVR, then continue to select the master NVR from the three-level candidate NVRs;
[0080] If the third-level candidate NVR is a separate NVR, directly set the third-level candidate NVR as the master NVR;
[0081] The step of setting all other NVRs in the local area network except the master NVR as slave NVRs is performed.
[0082] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0083] Control the master NVR to send heartbeat packets to each of the slave NVRs;
[0084] If the heartbeat packet is normal, executing the step of controlling the master NVR to obtain the first capability parameter of each slave NVR in the local area network;
[0085] If the heartbeat packet is abnormal, reselect the master NVR.
[0086] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0087] The step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter comprises:
[0088] Controlling the master NVR to determine a first matching order for each of the slave NVRs to be matched with the IPC to be matched according to the first capability parameter, and determining a second matching order for each of the IPC to be matched with the slave NVR according to the second capability parameter;
[0089] The master NVR is controlled to preferentially match the IPC to be matched with the slave NVR with smaller capability according to the first matching order, and preferentially match the IPC to be matched with the slave NVR with smaller capability according to the second matching order.
[0090] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0091] The step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter further includes:
[0092] The master NVR determines whether the capability parameter values of the slave NVRs currently being matched are all greater than the capability parameter values of the IPCs to be matched currently being matched;
[0093] If so, the slave NVR currently being matched and the to-be-matched IPC currently being matched are matched successfully.
[0094] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0095] Control the master NVR to count the number of IPCs that successfully match the slave NVR;
[0096] Controlling the master NVR to compare the number of successfully connected IPCs with a preset maximum number of IPC connections of the slave NVR;
[0097] If the number of the successfully connected IPCs is equal to the preset maximum number of IPC connections of the slave NVR, the capability matching between the next slave NVR and the IPC to be matched will be automatically started.
[0098] Furthermore, the processor 1001 may call the cooperative connection program between the NVR and the IPC stored in the memory 1005, and further perform the following operations:
[0099] The step of controlling the master NVR to distribute the to-be-matched IPC to the slave NVR according to the result of capability matching so as to complete the connection includes:
[0100] Controlling the slave NVR to send an IPC allocation request to the master NVR;
[0101] The master NVR is controlled to respond to the IPC allocation request, and the IPC to be matched is distributed to the slave NVR with which the capability matching is successful.
[0102] Reference Figure 2 A first embodiment of the present invention provides a collaborative connection method between an NVR and an IPC, the collaborative connection method between the NVR and the IPC comprising:
[0103] Step S10, when there are multiple NVRs in the same local area network, selecting a master NVR from the multiple NVRs;
[0104] It should be noted that in this embodiment, the execution entity is an NVR system composed of multiple NVRs (Network Video Recorders) within a local area network. To avoid duplicate, missed, and invalid additions caused by multiple NVRs randomly searching for and connecting to IPC devices, a single NVR is selected from the multiple NVRs through voting to serve as the master controller. The other NVRs serve as slaves (i.e., subordinate NVRs). The master controller guides the connection between each NVR and the IPC to be matched.
[0105] In this embodiment, step S10 includes:
[0106] When there are more than one NVR in the same LAN, each NVR is set as a first-level candidate NVR to control the capability parameters broadcast by each NVR and receive the capability parameters broadcast by other NVRs;
[0107] Based on the capability parameters of the local NVR and the capability parameters received from other NVR broadcasts, control each of the first-level candidate NVRs to generate their own capability parameter ranking table;
[0108] Controlling each of the first-level candidate NVRs to determine the first-level candidate NVR in the respective capability parameter ranking table and setting it as the second-level candidate NVR;
[0109] If the secondary candidate NVR is a separate NVR, directly set the secondary candidate NVR as the master NVR;
[0110] Set all other NVRs in the local area network except the master NVR as slave NVRs;
[0111] If there is more than one secondary candidate NVR, then the master NVR is selected from the secondary candidate NVRs, specifically:
[0112] Controlling each of the secondary candidate NVRs to broadcast its own capability parameters, and simultaneously receiving capability parameters broadcast by other secondary candidate NVRs;
[0113] Based on the capability parameters of the local NVR and the capability parameters received from other secondary candidate NVRs, each secondary candidate NVR is controlled to generate its own capability parameter ranking table;
[0114] Controlling each of the second-level candidate NVRs to determine the second-level candidate NVR ranked first in the respective capability parameter ranking tables, and setting it as the third-level candidate NVR;
[0115] If there is more than one third-level candidate NVR, then continue to select the master NVR from the three-level candidate NVRs;
[0116] If the third-level candidate NVR is a separate NVR, directly set the third-level candidate NVR as the master NVR;
[0117] The step of setting all other NVRs in the local area network except the master NVR as slave NVRs is performed.
[0118] In this embodiment, the above-mentioned implementation method of electing the master NVR is provided. Figure 3 , Figure 3 This indicates that there are three NVR devices in the NVR system, namely NVR1, NVR2, and NVR3. All three devices broadcast and actively report their decoding capabilities to other devices for comparison of capability parameters. The capability parameters include decoding capability, number of decoding channels, and CPU frequency. The decoding capability includes supported encoding formats and resolutions.
[0119] It is understood that after receiving the broadcast, each NVR can save the NVRs that received the broadcast information in a candidate list and sort them according to capability parameters and the time the broadcast information was received to select a candidate. The voting rule is that each NVR reports the first place in its candidate list, and the system obtains the candidate information based on the information reported by each NVR. If there is only one candidate, the system sets it as the master NVR, and the other NVRs are set as slaves (i.e., subordinate NVRs). If there are multiple candidates, the above broadcast information and sorting voting steps are repeated until there is only one candidate, indicating that it has the highest capability parameters. The system sets it as the master NVR and the other NVRs as subordinate NVRs.
[0120] The method further includes the following steps after setting all other NVRs in the local area network other than the master NVR as slave NVRs:
[0121] Control the master NVR to send heartbeat packets to each of the slave NVRs;
[0122] If the heartbeat packet is normal, executing the step of controlling the master NVR to obtain the first capability parameter of each slave NVR in the local area network;
[0123] If the heartbeat packet is abnormal, reselect the master NVR.
[0124] It should be noted that after the master NVR is selected, it is controlled to send heartbeat packets to each slave. If the heartbeat packet is normal, step S20 is executed. If the heartbeat packet is abnormal, the current master NVR is deemed to have failed, and the system controls each NVR device in the LAN to restart the election for master. Specifically, the master sends heartbeats in sync with the slave devices. If the master NVR fails and the other NVRs do not receive a heartbeat for more than 5 seconds, a new master is selected, ensuring that there is a master throughout the entire process.
[0125] Step S20, controlling the master NVR to obtain first capability parameters of each slave NVR in the local area network;
[0126] Reference Figure 4 , it is understandable that in order to achieve accurate matching, the system will control Figure 4 In the example, the leader NVR2 requests NVR codec parameters from each follower NVR1 and NVR3, which in turn reports the codec capabilities, maximum number of decoding paths, maximum decoding resolution, and bitrate to the leader. These parameters reported by the followers are the first capability parameters. NVR capability parameters also include the number of video channels and specific parameters such as frame rate and resolution.
[0127] Step S30, controlling the master NVR to obtain the second capability parameter of each IPC to be matched in the local area network;
[0128] It should be noted that after the system control master NVR obtains the capability of the slave in step S20, the master NVR will search for IPCs in the local area network and obtain the encoding capability of each IPC.
[0129] Reference Figure 5 , it is understandable that the system will control Figure 5 The NVR2 leader searches for each IPC and requests each IPC to report information. After receiving the request from the leader, each IPC reports its own camera encoding parameters, resolution, bit rate, etc. The parameters reported by the IPC are the second capability parameters.
[0130] Step S40: Control the master NVR to perform capability matching between the slave NVR and the IPC to be matched according to the first capability parameter and the second capability parameter;
[0131] In this embodiment, step S40 includes:
[0132] Controlling the master NVR to determine a first matching order for each of the slave NVRs to be matched with the IPC to be matched according to the first capability parameter, and determining a second matching order for each of the IPC to be matched with the slave NVR according to the second capability parameter;
[0133] Controlling the master NVR to preferentially match the IPC to be matched with the slave NVR with smaller capability according to the first matching order, and preferentially matching the IPC to be matched with the slave NVR with smaller capability according to the second matching order;
[0134] Controlling the master NVR to determine whether the first capability parameter values of the slave NVRs currently being matched are all greater than the second capability parameter values of the IPCs to be matched currently being matched;
[0135] If so, the slave NVR currently being matched and the to-be-matched IPC currently being matched are matched successfully.
[0136] It should be noted that when the master controller matches the capabilities of each slave and IPC, it will give priority to the slave and IPC with the worst performance. This is because devices with better performance are more applicable. At the same time, when performing capability matching, the capability parameters of the slave NVR must be equal to or greater than the corresponding capability parameters of the IPC. Otherwise, the decoding problem will still occur after the connection.
[0137] For example, if the resolution of one slave is 500W and the resolution of another slave is 400W, the slave with the resolution of 400W will be given priority in matching the IPC; if the resolution of one IPC is 300W and the resolution of another IPC is 400W, the slave with the resolution of 300W will be given priority in matching the IPC; if the decoding format of the slave is inconsistent with that of the IPC, the matching will not be successful; if the decoding format of the slave is consistent with that of the IPC, but the resolution of the slave is smaller than that of the IPC, the matching will not be successful; if the decoding format of the slave is consistent with that of the IPC, and the resolution of the slave is greater than or equal to that of the IPC, the matching will be successful.
[0138] In this embodiment, the steps after step S40 include:
[0139] Control the master NVR to count the number of IPCs that successfully match the slave NVR;
[0140] Controlling the master NVR to compare the number of successfully connected IPCs with a preset maximum number of IPC connections of the slave NVR;
[0141] If the number of the successfully connected IPCs is equal to the preset maximum number of IPC connections of the slave NVR, the capability matching between the next slave NVR and the IPC to be matched will be automatically started.
[0142] It can be understood that in order to ensure maximum resource utilization, when the number of IPCs successfully matched by a slave (i.e., the slave NVR) is consistent with its maximum number of channels (i.e., the preset maximum number of IPC connections), the process of matching IPC for the next slave will begin; otherwise, if the number of IPCs successfully matched by the slave is always less than its maximum number of channels, but there is no IPC in the IPC list searched by the master that can match its capabilities, the process of matching the capabilities of the next slave with the IPC to be matched will begin.
[0143] Step S50: Control the master NVR to distribute the IPC to be matched to the slave NVR according to the result of capability matching, so as to complete the connection.
[0144] In this embodiment, step S50 includes:
[0145] Controlling the slave NVR to send an IPC allocation request to the master NVR;
[0146] The master NVR is controlled to respond to the IPC allocation request, and the IPC to be matched is distributed to the slave NVR with which the capability matching is successful.
[0147] It is understandable that, referring to Figure 6, the system controls the follower NVR1 and the follower NVR3 to request the master NVR2 to allocate IPC (i.e., the IPC allocation request), and the master responds to the request and allocates the corresponding IPC according to the NVR capability. Figure 6 In the example, the master controller assigns (IPC1, IPC2, IPC3, IPC4) to NVR1 and (IPC5, IPC6, IPC7, IPC8) to NVR3. This means that the capabilities of IPC1, IPC2, IPC3, and IPC4 match those of NVR1, and the capabilities of IPC5, IPC6, IPC7, and IPC8 match those of NVR3. Once IPC1, IPC2, IPC3, and IPC4 are connected to NVR1, and IPC5, IPC6, IPC7, and IPC8 are connected to NVR3, the coordinated connections between the NVRs and IPCs in the LAN are complete.
[0148] This embodiment provides a collaborative connection method for NVRs and IPCs. This embodiment selects an NVR as the master control through the internal election mechanism of the NVR in the local area network. According to the decoding capability parameters of the slave and the capability of the camera IPC, the NVR and IPC are accurately matched, thereby achieving the purpose of controlling the connection between the slave NVR and the specified IPC. No external PC device is required, and the performance of the IPC and NVR is fully utilized. When there are a large number of NVRs and IPC devices in the local area network, the IPC is distributed to the corresponding NVR quickly and stably, avoiding the situation of repeated addition, missed addition, and invalid addition of IPC devices.
[0149] In addition, an embodiment of the present invention also proposes a computer-readable storage medium, on which a collaborative connection program for NVR and IPC is stored. When the collaborative connection program for NVR and IPC is executed by a processor, the steps of the collaborative connection method for NVR and IPC described in the above embodiments are implemented.
[0150] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0151] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0152] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0153] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A collaborative connection method between NVR and IPC, characterized in that: The collaborative connection method between the NVR and the IPC includes the following steps: When there are more than one NVR in the same LAN, each NVR is set as a first-level candidate NVR to control the capability parameters broadcast by each NVR and receive the capability parameters broadcast by other NVRs; Based on the capability parameters of the local NVR and the capability parameters received from other NVR broadcasts, control each of the first-level candidate NVRs to generate their own capability parameter ranking table; Controlling each of the first-level candidate NVRs to determine the first-level candidate NVR in the respective capability parameter ranking table and setting it as the second-level candidate NVR; If there is more than one secondary candidate NVR, then continue to select the master NVR from the secondary candidate NVRs; If the secondary candidate NVR is a separate NVR, directly set the secondary candidate NVR as the master NVR; Set all other NVRs in the local area network except the master NVR as slave NVRs; Controlling the master NVR to obtain first capability parameters of each slave NVR in the local area network; Controlling the master NVR to obtain the second capability parameter of each IPC to be matched in the local area network; Controlling the master NVR to determine a first matching order for each of the slave NVRs to be matched with the IPC to be matched according to the first capability parameter, and determining a second matching order for each of the IPC to be matched with the slave NVR according to the second capability parameter; Controlling the master NVR to preferentially match the IPC to be matched with the slave NVR with smaller capability according to the first matching order, and preferentially matching the IPC to be matched with the slave NVR with smaller capability according to the second matching order; Controlling the master NVR to distribute the to-be-matched IPC to the slave NVR according to the result of capability matching, so as to complete the connection; If there is more than one secondary candidate NVR, the step of continuing to select a master NVR from the secondary candidate NVRs includes: Controlling each of the secondary candidate NVRs to broadcast its own capability parameters, and simultaneously receiving capability parameters broadcast by other secondary candidate NVRs; Based on the capability parameters of the local NVR and the capability parameters received from other secondary candidate NVRs, each secondary candidate NVR is controlled to generate its own capability parameter ranking table; Controlling each of the second-level candidate NVRs to determine the second-level candidate NVR ranked first in the respective capability parameter ranking tables, and setting it as the third-level candidate NVR; If there is more than one third-level candidate NVR, then continue to select the master NVR from the third-level candidate NVRs; If the third-level candidate NVR is a separate NVR, directly set the third-level candidate NVR as the master NVR; The step of setting all other NVRs in the local area network except the master NVR as slave NVRs is performed.
2. The collaborative connection method of NVR and IPC according to claim 1, characterized in that: After the step of setting all other NVRs in the local area network except the master NVR as slave NVRs, the following steps are included: Control the master NVR to send heartbeat packets to each of the slave NVRs; If the heartbeat packet is normal, executing the step of controlling the master NVR to obtain the first capability parameter of each slave NVR in the local area network; If the heartbeat packet is abnormal, reselect the master NVR.
3. The collaborative connection method between NVR and IPC as claimed in claim 2, characterized in that: The step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter further includes: Controlling the master NVR to determine whether the first capability parameter values of the slave NVRs currently being matched are all greater than the second capability parameter values of the IPCs to be matched currently being matched; If so, the slave NVR currently being matched and the to-be-matched IPC currently being matched are matched successfully.
4. The collaborative connection method between NVR and IPC as claimed in claim 3, characterized in that: After the step of controlling the master NVR to perform capability matching on the slave NVR and the to-be-matched IPC according to the first capability parameter and the second capability parameter, the following steps are included: Control the master NVR to count the number of IPCs that successfully match the slave NVR; Controlling the master NVR to compare the number of successfully connected IPCs with a preset maximum number of IPC connections of the slave NVR; If the number of the successfully connected IPCs is equal to the preset maximum number of IPC connections of the slave NVR, the capability matching between the next slave NVR and the IPC to be matched will be automatically started.
5. The collaborative connection method between NVR and IPC as claimed in claim 4, characterized in that: The step of controlling the master NVR to distribute the to-be-matched IPC to the slave NVR according to the result of capability matching so as to complete the connection includes: Controlling the slave NVR to send an IPC allocation request to the master NVR; The master NVR is controlled to respond to the IPC allocation request, and the IPC to be matched is distributed to the slave NVR with which the capability matching is successful.
6. A collaborative connection system between NVR and IPC, characterized in that: The collaborative connection system of the NVR and IPC includes: a memory, a processor, and a collaborative connection program of the NVR and IPC stored in the memory and runnable on the processor. When the collaborative connection program of the NVR and IPC is executed by the processor, the steps of the collaborative connection method of the NVR and IPC as described in any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a cooperative connection program of the NVR and the IPC. When the cooperative connection program of the NVR and the IPC is executed by the processor, the steps of the cooperative connection method of the NVR and the IPC as described in any one of claims 1 to 5 are implemented.