CN112911226B - Method, system and storage medium for automatically adding network camera - Google Patents

Method, system and storage medium for automatically adding network camera Download PDF

Info

Publication number
CN112911226B
CN112911226B CN202110068424.1A CN202110068424A CN112911226B CN 112911226 B CN112911226 B CN 112911226B CN 202110068424 A CN202110068424 A CN 202110068424A CN 112911226 B CN112911226 B CN 112911226B
Authority
CN
China
Prior art keywords
network
hard disk
disk video
current
network hard
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110068424.1A
Other languages
Chinese (zh)
Other versions
CN112911226A (en
Inventor
水新星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110068424.1A priority Critical patent/CN112911226B/en
Publication of CN112911226A publication Critical patent/CN112911226A/en
Application granted granted Critical
Publication of CN112911226B publication Critical patent/CN112911226B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/78Television signal recording using magnetic recording
    • H04N5/781Television signal recording using magnetic recording on disks or drums

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Closed-Circuit Television Systems (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The application discloses a method, a system and a storage medium for automatically adding a network camera, wherein the method is applied to a device access system, the device access system comprises the network camera and a plurality of network hard disk video recorders, and the method comprises the following steps: selecting one network hard disk video recorder from a plurality of network hard disk video recorders to be set as a host, and setting other network hard disk video recorders as slaves; obtaining response information from the network camera and the slave by using the host; generating a pairing table based on the response information by using the host, wherein the pairing table comprises the pairing relation between the network camera and the network hard disk video recorder; and the host computer is utilized to issue the pairing table to the slave computer so that the network hard disk video recorder can be added with the corresponding network video camera. By the method, the network video cameras can be automatically added to a plurality of network hard disk video recorders.

Description

Method, system and storage medium for automatically adding network camera
Technical Field
The application relates to the technical field of monitoring, in particular to a method, a system and a storage medium for automatically adding a network camera.
Background
The network cameras (IP cameras, IPC) are to be accessed into the network hard disk recorders (NVR, network Video Recorder) for storing and managing video recordings, the prior art can only search, add, set resolution or code stream size on each network hard disk recorder manually, the operation is very complicated, the network cameras are configured and managed largely depending on experience of operators, and the difficulty coefficient is greatly increased under the condition that the number of network hard disk recorders and network cameras is numerous, and the possible situations are that: 1. adding omission of part of network cameras; 2. the same network camera is added by a plurality of network hard disk video recorders; 3. the access bandwidths and decoding performances of the network camera and the network hard disk video recorder are not matched, so that the system is in fault. In addition, if the personnel who first contact the monitoring equipment are unfamiliar with access bandwidth, decoding performance and the like of the network hard disk video recorder, performance exceeding is possibly caused greatly, and a stable and reliable security monitoring system cannot be formed.
Disclosure of Invention
The application provides a method, a system and a storage medium for automatically adding network cameras, which can realize that a plurality of network hard disk video recorders automatically add network cameras.
In order to solve the technical problems, the technical scheme adopted by the application is as follows: there is provided a method of automatically adding a network camera, the method being applied to a device access system including a network camera and a plurality of network hard disk recorders, the method comprising: selecting one network hard disk video recorder from a plurality of network hard disk video recorders to be set as a host, and setting other network hard disk video recorders as slaves; obtaining response information from the network camera and the slave by using the host; generating a pairing table based on the response information by using the host, wherein the pairing table comprises the pairing relation between the network camera and the network hard disk video recorder; and the host computer is utilized to issue the pairing table to the slave computer so that the network hard disk video recorder can be added with the corresponding network video camera.
In order to solve the technical problems, another technical scheme adopted by the application is as follows: the device access system comprises a network camera and a plurality of network hard disk video recorders, wherein the network hard disk video recorders are used for selecting one network hard disk video recorder from the plurality of network hard disk video recorders to be set as a host, and other network hard disk video recorders are set as slaves; the host is used for acquiring response information from the network camera and the slave; generating a pairing table based on the response information, wherein the pairing table comprises a pairing relation between the network camera and the network hard disk video recorder; and issuing the pairing table to the slave machine so that the network hard disk video recorder adds a corresponding network camera.
In order to solve the technical problems, another technical scheme adopted by the application is as follows: there is provided a computer readable storage medium for storing a computer program which, when executed by a processor, is adapted to carry out the method of automatically adding a network camera in the above-mentioned technical solution.
Through above-mentioned scheme, the beneficial effect of this application is: firstly, selecting one network hard disk video recorder from all network hard disk video recorders as a host computer, and using the rest network hard disk video recorders as slaves; then the host computer collects information to all the slaves and the network camera; the host computer can generate a pairing relation between the network cameras and the network hard disk video recorders by utilizing the collected response information to form a pairing table and send the pairing table to the slave computer, so that the slave computer and the host computer can add corresponding network cameras according to the pairing table, the network cameras can be automatically added under the condition of a plurality of network hard disk video recorders, each network hard disk video recorder does not need to be independently operated to add the network camera, a certain network hard disk video recorder can be used for distributing resources, the realization is simple, one network video camera can only be added by one network hard disk video recorder, the omission of adding certain network video cameras does not occur, and the stability of a system is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Wherein:
fig. 1 is a schematic structural diagram of an embodiment of a device access system provided in the present application;
FIG. 2 is a flow chart of an embodiment of a method for automatically adding a webcam provided herein;
FIG. 3 is a flow chart of another embodiment of a method for automatically adding a webcam provided herein;
FIG. 4 is a flow chart of step 304 in the embodiment shown in FIG. 3;
FIG. 5 is a block diagram of the network camera and network video recorder in the embodiment shown in FIG. 3;
fig. 6 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Because the prior art only solves the problem that one network hard disk video recorder automatically adds the network video camera, the coordination resource among a plurality of network hard disk video recorders cannot be solved, and the problem to be solved by the application is as follows: when a plurality of network hard disk video recorders are arranged in the system, how to effectively allocate resources, adjust parameters and automatically complete equipment addition for all network video cameras in a local area network is realized, and a specific scheme is described below.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an embodiment of a device access system provided in the present application, where the device access system includes a webcam 11 and a plurality of network hard disk recorders (not identified in the figure).
The network hard disk video recorder is used for selecting one network hard disk video recorder from the plurality of network hard disk video recorders to be set as a host 121, and other network hard disk video recorders are set as slaves 122; specifically, the network hard disk recorder may be connected to the network camera 11 through a router (not shown), and a button is provided on the network hard disk recorder, and when the button is triggered by a user, an election operation is performed to select one from all the network hard disk recorders as the host 121.
The master 121 is connected to the slave 122 and the network camera 11, and is configured to acquire response information from the network camera 11 and the slave 122; specifically, the host 121 may broadcast information to the slave 122 and the network camera 11 within the local area network in which it is located, so that the slave 122 and the network camera 11 feedback a response message to the host 121 after receiving the information.
After receiving the response information fed back from the slave 122 and the network camera 11, the host 121 generates a pairing table based on the response information, where the pairing table includes a pairing relationship between the network camera 11 and the network hard disk recorder; the host 121 issues a pairing table to the slave 122 to enable the network hard disk recorder to add the corresponding network camera 11; specifically, the master 121 and the slave 122 may find information of the network camera 11 connected thereto according to the pairing table, thereby adding the corresponding network camera 11.
The device access system of the embodiment can be a video monitoring system, a pairing relation between all network hard disk video recorders and network video cameras in a local area network where the network hard disk video recorders are located can be established by using one network hard disk video recorder, the host can issue an automatic adding task to the host and the slave, the host and the slave complete automatic adding of the network video cameras according to the pairing table, operation on each network hard disk video recorder is not required, unified management can be achieved, and user operation is facilitated.
Referring to fig. 2, fig. 2 is a flowchart of an embodiment of a method for automatically adding a network camera, where the method is applied to an equipment access system in the above embodiment, and the equipment access system includes a network camera and a plurality of network hard disk recorders, and the method includes:
Step 21: one network hard disk video recorder is selected from the plurality of network hard disk video recorders to be set as a host, and other network hard disk video recorders are set as slaves.
The user can trigger a button on a certain network hard disk video recorder in the equipment access system to start the operation of selecting one network hard disk video recorder from all the network hard disk video recorders as a host; if it is determined that a certain network hard disk recorder in the system is a master, the remaining network hard disk recorders other than the master are slaves.
Step 22: and acquiring response information from the network camera and the slave by using the host.
After selecting the host in the system, the host may send the collected information to all the slaves and the network camera, where the collected information is used to identify the receiver (including the slaves and the network camera) and feedback response information after receiving the collected information, where the response information includes information about the slaves/network camera, such as: address, device type, serial number or device capabilities, etc.
Step 23: the host computer is used for generating a pairing table based on the response information.
After receiving the response information sent by the slave and the network camera, the host can pair the network camera with the network hard disk video recorder to generate a pairing table, wherein the pairing table comprises the pairing relation between the network camera and the network hard disk video recorder; for example, the system includes 3 network hard disk recorders and 2 network cameras, which are respectively denoted as A1-A3 and B1-B2, the network hard disk recorder A2 is a host, the idle channels of the network hard disk recorder A1 are 5, the idle channels of the network hard disk recorder A2 are 6, and the idle channels of the network hard disk recorder A3 are 4, so that the host can establish a pairing relationship between the network camera B1 and the network hard disk recorder A2 and a pairing relationship between the network camera B2 and the network hard disk recorder A1 to form a pairing table.
Step 24: and the host computer is utilized to issue the pairing table to the slave computer so that the network hard disk video recorder can be added with the corresponding network video camera.
After the host generates the pairing table, the pairing table can be sent to the slave so that the slave and the host can add corresponding network cameras by using the pairing table; for example, the pairing table includes a plurality of pieces of pairing information, and if a certain piece of pairing information is that the second channel of the network hard disk video recorder C is paired with the network camera D, after the network hard disk video recorder C receives the pairing table, the network hard disk video recorder C finds the information matched with the pairing table in the pairing table by using the name of the network hard disk video recorder C as an index value, and then adds the network camera D to the second channel of the network hard disk video recorder C.
According to the method for automatically adding the network camera, one network hard disk video recorder can be selected as a host, then the host collects information of all the slaves and the network video cameras, the host can generate a pairing table by utilizing the collected information to form a pairing relationship between the network video cameras and the network hard disk video recorders, and the established pairing table is issued to the slaves, so that the slaves and the host can add corresponding network video cameras according to the pairing table, and the automatic addition of the network video cameras by the network hard disk video recorders is realized; because a certain network hard disk video recorder can be used for distributing resources, the resource coordination among a plurality of network hard disk video recorders can be solved, one network video recorder can be added only by one network hard disk video recorder, and certain network video cameras can not be omitted from being added, so that the stability of a system is improved.
Referring to fig. 3, fig. 3 is a flowchart of another embodiment of a method for automatically adding a network camera provided in the present application, where the method is applied to the device access system in the above embodiment, and the device access system includes a network camera and a plurality of network hard disk recorders, and the method includes:
step 301: initializing all the network hard disk video recorders to enable the states of the network hard disk video recorders to be the first states.
The initial state of all the network hard disk video recorders is the first state, and a user can manually operate a switch on the network hard disk video recorders to generate an automatic adding instruction to initiate a pairing process.
Step 302: and taking the network hard disk video recorder which receives the automatic adding instruction as election initiating equipment, and setting the state of the election initiating equipment to be a second state.
The network hard disk recorder that initiates the pairing process may be referred to as an election initiating device, which may set its own state to the second state.
Step 303: and broadcasting the search packet in a preset time by using the election initiating equipment, so that the network camera and the network hard disk video recorder send response information to the election initiating equipment after receiving the search packet.
A time window period (i.e. preset time) can be set, and the network hard disk video recorder in the second state can periodically broadcast/multicast a search packet in the preset time to search, so as to obtain all equipment information in the local area network where the network hard disk video recorder is located; specifically, if a network hard disk video recorder in a second state exists in the system, the network hard disk video recorder is election initiating equipment and is a host; if there are two or more network hard disk recorders in the second state in the system, there are other network hard disk recorders in the second state besides the election initiating device.
Further, the response information comprises equipment attribute information and resource capability information, the equipment attribute information comprises equipment addresses, equipment types or serial numbers of equipment, the equipment addresses comprise addresses of network cameras and addresses of network hard disk recorders, the equipment types comprise the network cameras, the network hard disk recorders or the ball machines, and the serial numbers of the equipment comprise the serial numbers of the network cameras and the network hard disk recorders; the resource capability information includes first resource capability information corresponding to the slave, the first resource capability information including a decoding resolution capability set, a supported number of ways corresponding to the decoding resolution capability set, a maximum access bandwidth, a maximum number of access ways, or added network camera information, and second resource capability information corresponding to the network camera, the second resource capability information including a current resolution, a current code stream, a resolution capability set, and a code stream range, the resolution capability set including at least one resolution, the code stream range including at least one code stream value.
After receiving the search packet, the network hard disk video recorder in the first state changes the state of the network hard disk video recorder from the first state to a third state and sends a response message to the election initiating equipment; after receiving the search packet, the network hard disk recorder in the second state determines whether to send a response message to the election initiating device based on the own serial number and the serial number of the election initiating device, and a specific scheme will be described below.
Step 304: and recording the network hard disk video recorder in the second state as a candidate host, and selecting the host based on the number of the candidate hosts and the serial numbers of the candidate hosts.
In order to select one host in the case of two or more candidate hosts, the steps shown in fig. 4 may be adopted, which specifically include:
step 3041: and judging whether the number of the candidate hosts is larger than a preset number.
In order to select one network hard disk recorder from all network hard disk recorders as a host, the preset number may be 1, i.e., determine whether the number of candidate hosts is greater than 1.
Step 3042: if the number of the candidate hosts is larger than the preset number, selecting the candidate host with the smallest serial number from all the candidate hosts as the host.
The candidate host that received the search packet may be referred to as a current candidate host, and the current candidate host may determine whether the sequence number of the current candidate host is smaller than the sequence number of the candidate host (referred to as a sender) broadcasting the search packet; if the serial number of the current candidate host is smaller than the serial number of the sender, modifying the state of the current candidate host into a third state, and stopping broadcasting the search packet; if the serial number of the current candidate host is greater than or equal to the serial number of the sender, the current candidate host continues broadcasting the search packet; repeating the steps until the number of the candidate hosts is a preset number. When the network hard disk video recorder in the second state is detected to exist, comparing the sizes of the serial numbers, modifying the state of the network hard disk video recorder with the smaller serial number into a third state by the network hard disk video recorder with the smaller serial number, and terminating the action of broadcasting/multicasting the search packet in the preset time; and the network hard disk video recorders with larger serial numbers continue to broadcast/multicast search packets to search and receive response information until only one network hard disk video recorder with the second state is in the local area network, the state of the searched equipment is in the third state, the network hard disk video recorder with the second state is recorded as a host, and the network hard disk video recorder with the third state is recorded as a slave.
It will be appreciated that the candidate host with the largest sequence number among all candidate hosts may be selected as the host, or the candidate host with the largest remaining idle channels among all candidate hosts may be selected as the host, or the hosts may be selected according to other reasonable rules.
Step 3043: and if the number of the candidate hosts is smaller than or equal to the preset number, taking the election initiating equipment as the host.
If the number of the candidate hosts is only one, the network hard disk video recorder with the second state is indicated to be only one in the system, and the network hard disk video recorder is used as the host.
The pairing relation and the adding strategy can be formulated according to the equipment system resources and the capabilities of the network hard disk video recorder (comprising a host machine and a slave machine) and the network video camera, and the formulation principle of the pairing relation is as follows: 1) A network camera can only be added by a network hard disk video recorder and can only be added once and cannot be repeated; 2) The network video camera is preferentially distributed to the network video recorder with the resolution and the code stream size matched with the network video camera, so that after the network video camera is accessed, the network video recorder can normally display the video which is matched with the resolution of the network video camera, and the code stream size does not exceed the maximum access bandwidth of the network video recorder; 3) If the current resolution or the current code stream size of the network camera cannot be matched with the access performance and the decoding performance of the network hard disk video recorder, switching and adjusting are carried out according to the resolution capability set and the code stream range of the network camera, so that the performance matching of the two is achieved; 4) When the accessible path numbers of all the network hard disk video recorders are inconsistent with the total number of the network video cameras, recording the information of the network video recorders on idle accessible channels or unassigned network video cameras; the specific embodiments will be described below.
Step 305: and judging whether the current resolution of the current network camera is contained in the decoding resolution capability set of the current network hard disk video recorder.
It can be determined whether the current resolution of the current network camera is the same as a value in the decoding resolution set of the current network hard disk recorder.
Step 306: if the current resolution of the current network camera is contained in the decoding resolution capability set of the current network hard disk video recorder, a pairing relation between the current network camera and the current network hard disk video recorder is established and stored in a pairing table.
If the decoding resolution capability set of the current network hard disk video recorder contains the current resolution of the current network video camera, the current resolution of the current network video camera is the same as the decoding capability of the current network hard disk video recorder, and at the moment, the host establishes a pairing relation between the current network video camera and the current network hard disk video recorder and stores the pairing relation.
Further, whether to establish the pairing relation between the current network camera and the current network hard disk video recorder can be determined according to the number of supporting paths of the network camera; for example, assuming that the network video recorders are denoted as H1 and H2, and their support routes are 16 and 8, respectively, when pairing is performed, the network video camera H1 and 16 network video cameras may be paired, and the network video camera H2 and 8 network video cameras may be paired, that is, the network video cameras H1 and H2 are allocated according to the ratio of the support routes.
Step 307: and if the current resolution of the current network video camera is not contained in the decoding resolution set of the current network video recorder, selecting other network video recorders as the current network video recorder.
If the decoding resolution capability set of the current network hard disk video recorder does not contain the current resolution of the current network video camera, selecting other network hard disk video recorders to perform matching judgment, namely selecting other network hard disk video recorders as the current network hard disk video recorders, and returning to execute the step 305 until all network hard disk video recorders are traversed or the decoding resolution capability set of the current network hard disk video recorders contains the current resolution of the current network video camera.
If the decoding resolution capability sets of all the network hard disk video recorders are found to not contain the current resolution of the current network video camera after traversing all the network hard disk video recorders, that is, when the current resolution of the current network video camera is different from the resolution in the decoding resolution capability set of each network hard disk video recorder, the current resolution can be adjusted based on the resolution capability set of the current network video camera.
Further, the decoding resolution capability set comprises the maximum decoding resolution, and whether a network hard disk video recorder with an idle channel exists or not is judged; if the network hard disk video recorder with the idle channel exists, the network hard disk video recorder with the idle channel is recorded as a network hard disk video recorder to be selected, the network hard disk video recorder to be selected with the smallest difference value between the maximum decoding resolution and the current resolution in all the network hard disk video recorders to be selected is selected as the network hard disk video recorder matched with the current network video camera, the maximum decoding resolution of the network hard disk video recorder matched with the current network video camera is recorded as the preset resolution, the current resolution is adjusted to the preset resolution, and the resource adjustment information is generated.
For example, the resolution capability set includes 3 resolutions: {480p,720p,1080p }, the code stream range includes 2 code stream sizes: {512Kbps,1024Kbps }, assuming that the decoding resolution capability set of the current network hard disk video recorder is 1080P, the maximum access bandwidth of the current network video camera is 720Kbps, the current resolution is 1080P, and the current code stream is 1024Kbps, the host can adjust the current resolution of the current network video camera to 720P, and generate resource adjustment information, and because the current code stream is the same as the maximum access bandwidth, adjustment on the current code stream is not needed.
In one embodiment, when selecting a network hard disk recorder paired with a current network camera, a resolution matching policy and a code stream adjustment policy may be used as follows:
1) Resolution matching strategy
a. Grading according to the maximum decoding resolution of all network hard disk recorders, and dividing all network hard disk recorders into at least one group, for example, as shown in fig. 5, dividing all network hard disk recorders into X groups and Z groups, wherein the X groups comprise { NVR1, NVR1}, the maximum decoding resolution of the X groups is 4k, the Z groups comprise { NVR2, NVR4}, and the maximum decoding resolution of the Z groups is 1080P; it will be appreciated that the grouping may be one or more depending on the maximum decoding capability, and may be based on the particular application requirements.
b. All network cameras are divided into groups according to the maximum decodable resolution of the network hard disk recorder, for example, as shown in fig. 5, all network cameras are divided into three groups with 4K and 1080P as boundaries: group a, group B and group C.
c. Preferentially processing the packets with the lowest resolution, taking as an example in fig. 5, the network cameras of the group C are allocated to the network hard disk recorders of the group Z, and if the number of all the network cameras of the group C is more than the sum of the channels of all the network hard disk recorders of the group Z, adding the network cameras of the group C to the group X; if the number of all network cameras in the group C is smaller than the sum of the channels of all network hard disk video recorders in the group Z, the information of the network hard disk video recorders with idle channels in the group Z is recorded, so that when the number of channels in the group X is insufficient for the network cameras in the group A or the group B, the idle channels in the group Z can be used as paired equipment after the resolution of the network cameras in the group A or the group B is reduced.
d. C, sequentially and upwardly distributing network hard disk video recorders according to the sequence of the maximum decodable resolution, taking fig. 5 as an example, for the network hard disk video recorders of the X groups, firstly adding redundant network video cameras of the C groups which are not added by the Z groups and network video cameras of the B groups, if channels of the network hard disk video recorders of the X groups are remained, then downwards regulating the current resolution of the network video cameras of the A groups to 4K, and establishing a pairing relation with the remained idle channels of the network hard disk video recorders of the X groups; if the network video cameras in the partial A group are not added by the network video recorders, firstly confirming whether the network video recorders with the resolution higher than the maximum decodable resolution of the X group exist, if so, distributing according to the step c, if not, downwards confirming whether the network video recorders with the higher decoding specification have the rest free channels in the Z group, and if so, reducing the current resolution of the network video cameras in the A group to 1080P to be added to the Z group.
In summary, the network cameras are allocated in the order from bottom to top according to the current resolution of the network cameras, the network cameras are more than one to confirm whether the rest free channels exist according to the order from top to bottom, and if yes, the current resolution is reduced to allocate.
2) Code stream adjustment strategy
Acquiring the sum of current code streams of all network cameras, and recording the sum as the sum of the code streams; then judging whether the sum of the code streams is larger than the sum of the maximum access bandwidths of all the network video recorders; and if the sum of the code streams is larger than the sum of the maximum access bandwidths of all the network video recorders, adjusting the current code stream of each network video camera.
Further, the product of the current code stream of the current network camera and the sum of the maximum access bandwidth can be calculated and is recorded as a first product; calculating the product of the current total bandwidth and a preset redundancy coefficient, and recording the product as a first product, wherein the preset redundancy coefficient is used for ensuring the stability of the system and can be set according to an empirical value; judging whether the ratio of the first product to the first product is larger than the minimum value of the code stream range of the current network camera; if the ratio of the first product to the first product is larger than the minimum value of the code stream range of the current network camera, taking the minimum value of the code stream range of the current network camera as a preset code stream, and adding the preset code stream into the resource adjustment information; if the ratio of the first product to the first product is smaller than or equal to the minimum value of the code stream range of the current network camera, taking the ratio of the first product to the first product as a preset code stream, and adding the preset code stream to the resource adjustment information.
In another specific embodiment, the coding configuration parameters include a current code stream and a current resolution, and the coding information includes a maximum access path number and a maximum access bandwidth; judging whether the network hard disk video recorders with the same coding configuration parameters as the current network video cameras exist in the coding information of all the network hard disk video recorders or not; if the network hard disk video recorders with the same coding configuration parameters as the current network video cameras exist in the coding information of all the network hard disk video recorders, selecting the network hard disk video recorder with the largest idle channel, the smallest serial number or the largest serial number as the network hard disk video recorder matched with the current network video cameras, and establishing a pairing relation between the current network video cameras and the network hard disk video recorders; if the network hard disk video recorders with the same coding configuration parameters as the current network video cameras do not exist in the coding information of all the network hard disk video recorders, determining the corresponding current network hard disk video recorders to be matched based on the resolution capability set and the code stream range of the current network video cameras, selecting the network hard disk video recorder with the smallest difference value between the coding configuration parameters of the current network video cameras and the network hard disk video recorders within the capability range of the network hard disk video recorders as the network hard disk video recorder matched with the current network video cameras, namely, setting the resolution with the smallest difference value between the resolution capability set of the current network video cameras and the largest decoding resolution of the current network hard disk video cameras as the preset resolution, and generating resource adjustment information; and taking a code stream which is smaller than/equal to the maximum access bandwidth of the current network hard disk video recorder and has the smallest difference value with the maximum access bandwidth of the current network hard disk video recorder in the code stream range of the current network video camera as a preset code stream, and adding the preset code stream into resource adjustment information, wherein the resource adjustment information comprises the steps of adjusting the current resolution of the current network video camera to the preset resolution and/or adjusting the current code stream of the current network video camera to the preset code stream.
Step 308: and the host sends the pairing table to the network hard disk video recorder so that the network hard disk video recorder executes an automatic adding task based on the pairing table to finish adding the corresponding network video camera.
After generating the pairing table, the host can send the pairing table to the slave so as to enable the host and the slave to add a network camera matched with the pairing table by using the pairing table; specifically, the network hard disk video recorder comprises a plurality of channels for connecting with the network video camera; the host can judge whether the sum of the maximum access paths of all the network hard disk video recorders is the same as the number of all the network cameras; if the sum of the maximum access paths of all the network hard disk video recorders is different from the number of all the network video cameras, the fact that at least one network hard disk video recorder has residual idle channels is indicated, or at least one network video camera cannot be added by the network hard disk video recorders, for convenience of subsequent management, the host can record the number of the residual idle channels of the network hard disk video recorders or information of the network video cameras which are not allocated, wherein the information of the network video cameras which are not allocated comprises serial numbers or addresses of the network video cameras which do not establish a pairing relation with the channels of any network hard disk video recorder.
Step 309: when the resource adjustment information exists, the host computer sends the resource adjustment information to the network hard disk video recorder corresponding to the resource adjustment information, so that the network hard disk video recorder corresponding to the resource adjustment information adjusts the encoding configuration parameters of the paired network video camera.
If the host computer adjusts the encoding configuration parameters of the network camera, that is, the resource adjustment information is generated, the host computer or the slave computer can adjust the current resolution and the current code stream of the network camera paired with the host computer according to whether the resource adjustment information is carried.
Step 310: after the automatic adding task is completed, the host and the slave send adding adjustment information to the host; and the host computer counts the adding adjustment information sent by all the slaves to generate a statistic table.
The adding adjustment information comprises the state of the added network camera and adjustment record information, the adjustment record information comprises record information generated by adjusting the current resolution and the current code stream of the network camera, namely, after the host and the slave complete the automatic adding task, the online state of the added network camera and the record of the resolution and the code stream adjustment corresponding to the online state of the added network camera are returned to the host.
The host combines the addition adjustment information reported by the slave and the addition adjustment information generated by the host to generate a statistical table, and can output the statistical table for a user to review, wherein the statistical table comprises the information of the network cameras added by each network hard disk video recorder, the information of the rest idle channels of all the network hard disk video recorders or the unassigned network video cameras, and the information of the network video cameras comprises the address of the network video camera, the serial number of the network video camera, the status information of successful/failed addition or the adjustment record information. After the statistical table is generated, the host and the slave modify their own states to a first state, i.e. restore to the initial state.
According to the embodiment, the search packet is periodically broadcast/multicast by setting preset time, equipment in the local area network is checked and the state is confirmed, when a plurality of network hard disk video recorders in a second state exist in the local area network, the conflict is solved by comparing the sizes of serial numbers, and only one host computer in the local area network is ensured; the whole process can complete the deployment of the whole monitoring system by only initiating an automatic adding instruction on one network hard disk video recorder, namely, adding of all network hard disk video recorders and network cameras in a local area network where the network hard disk video recorders are located can be initiated on one network hard disk video recorder; the method can automatically match the resources, and under the condition that the equipment performance and the system resources between the network hard disk video recorder and the network camera cannot be matched, the coding configuration parameters of the network camera can be adjusted, so that the whole monitoring system can stably run, and the original manual calculation and allocation of resource allocation and system optimization are changed into automatic matching according to the equipment resources and the performances; and a log report is formed aiming at the automatic adding task and the adjustment of the coding configuration parameters of the network camera, so that the later checking and operation and maintenance are convenient.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of a computer readable storage medium provided in the present application, where the computer readable storage medium 60 is used to store a computer program 61, and the computer program 61, when executed by a processor, is used to implement the method for automatically adding a webcam in the above embodiment.
The computer readable storage medium 60 may be a server, a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, etc. various media capable of storing program codes.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing description is only exemplary embodiments of the present application and is not intended to limit the scope of the present application, and all equivalent structures or equivalent processes using the descriptions and the drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the present application.

Claims (14)

1. A method for automatically adding a network camera, which is applied to a device access system, wherein the device access system comprises the network camera and a plurality of network hard disk video recorders, the method comprising:
selecting one network hard disk video recorder from the plurality of network hard disk video recorders to be set as a host, and setting other network hard disk video recorders as slaves;
acquiring response information from the network camera and the slave by using the host;
generating a pairing table based on the response information by using the host, wherein the pairing table comprises a pairing relation between the network camera and the network hard disk video recorder;
The host computer is utilized to issue the pairing table to the slave computer, so that the network hard disk video recorder adds the corresponding network camera;
the step of generating a pairing table based on the response information by the host includes:
judging whether the current resolution of the current network camera is contained in the decoding resolution capability set of the current network hard disk video recorder;
if yes, establishing a pairing relation between the current network camera and the current network hard disk video recorder, and storing the pairing relation in the pairing table;
if not, selecting other network hard disk video recorders as the current network hard disk video recorder, and returning to the step of judging whether the current resolution of the current network video recorder is contained in the decoding resolution capability set of the current network hard disk video recorder until all network hard disk video recorders are traversed or the current resolution of the current network video recorder is contained in the decoding resolution capability set of the current network hard disk video recorder; wherein the set of decoding resolution capabilities comprises a maximum decoding resolution;
judging whether the network hard disk video recorders with idle channels exist or not when all decoding resolution capability sets of the network hard disk video recorders do not contain the current resolution of the current network video camera;
If yes, the network hard disk video recorder with the idle channel is recorded as a network hard disk video recorder to be selected, the network hard disk video recorder to be selected with the smallest difference between the maximum decoding resolution and the current resolution in all the network hard disk video recorders to be selected is selected as the network hard disk video recorder matched with the current network video camera, the maximum decoding resolution of the network hard disk video recorder matched with the current network video camera is recorded as a preset resolution, the current resolution is adjusted to the preset resolution, and resource adjustment information is generated;
the host sends the resource adjustment information to the network hard disk video recorder corresponding to the resource adjustment information, so that the network hard disk video recorder corresponding to the resource adjustment information adjusts the coding configuration parameters of the paired network video camera, wherein the coding configuration parameters comprise resolution.
2. The method for automatically adding network cameras according to claim 1, wherein the step of selecting one network hard disk recorder from the plurality of network hard disk recorders to be set as a master and the other network hard disk recorders to be set as slaves comprises:
Initializing all the network hard disk video recorders to enable the states of the network hard disk video recorders to be first states;
taking the network hard disk video recorder which receives the automatic adding instruction as election initiating equipment;
setting the state of the election initiating device to a second state;
broadcasting a search packet by using the election initiating equipment within a preset time, so that the network camera and the network hard disk video recorder send the response information to the election initiating equipment after receiving the search packet;
and recording the network hard disk video recorder in the second state as a candidate host, and selecting the host based on the number of the candidate hosts and the serial numbers of the candidate hosts.
3. The method of automatically adding a network camera according to claim 2, wherein the step of selecting the host based on the number of candidate hosts and the serial number of the candidate host comprises:
judging whether the number of the candidate hosts is larger than a preset number;
if yes, selecting the candidate host with the minimum serial number from all the candidate hosts as the host;
if not, the election initiating equipment is used as the host.
4. The method for automatically adding a network camera according to claim 3, wherein the step of selecting the candidate host having the smallest serial number from among all the candidate hosts as the host includes:
recording the candidate host which receives the search packet as a current candidate host;
the current candidate host judges whether the serial number of the current candidate host is smaller than the serial number of the candidate host broadcasting the search packet;
if yes, modifying the state of the current candidate host to be a third state, and stopping broadcasting the search packet;
if not, continuing broadcasting the search packet;
repeating the steps until the number of the candidate hosts is the preset number.
5. The method for automatically adding a network camera according to claim 2, wherein the step of the network hard disk recorder transmitting the response information to the election initiating device after receiving the search packet comprises:
and after receiving the search packet, the network hard disk video recorder in the first state changes the first state into a third state and sends the response information to the election initiating equipment.
6. The method for automatically adding a network camera according to claim 1, wherein,
the response information comprises equipment attribute information and resource capability information, the equipment attribute information comprises equipment addresses, equipment types or serial numbers of equipment, the resource capability information comprises first resource capability information corresponding to the slaves and second resource capability information corresponding to the network cameras, the first resource capability information comprises a decoding resolution capability set, a support path number, a maximum access bandwidth, a maximum access path number or added network camera information corresponding to the decoding resolution capability set, and the second resource capability information comprises current resolution, current code streams, resolution capability sets and code stream ranges.
7. The method of automatically adding a network camera according to claim 1, further comprising:
and determining whether to establish a pairing relation between the current network camera and the current network hard disk video recorder according to the supporting path number of the network camera.
8. The method of automatically adding a network camera according to claim 1, further comprising:
Acquiring the sum of current code streams of all the network cameras, and recording the sum as the sum of the code streams;
judging whether the sum of the code streams is larger than the sum of the maximum access bandwidths of all the network hard disk video recorders or not;
if yes, the current code stream of each network camera is adjusted.
9. The method of automatically adding network cameras as in claim 8, wherein said step of adjusting a current code stream of each of said network cameras comprises:
calculating the product of the sum of the current code stream of the current network camera and the maximum access bandwidth, and recording the product of the current total bandwidth and a preset redundancy coefficient calculated by first multiplication as a first product;
judging whether the ratio of the first product to the first product is larger than the minimum value of the code stream range of the current network camera;
if yes, taking the minimum value of the code stream range of the current network camera as a preset code stream, and adding the minimum value into the resource adjustment information;
if not, taking the ratio of the first product to the first product as the preset code stream, and adding the ratio to the resource adjustment information;
the resource adjustment information includes adjusting a current resolution of the current network camera to the preset resolution and/or adjusting a current code stream of the current network camera to the preset code stream.
10. The method of automatically adding a network camera according to claim 1, further comprising:
and the host sends the pairing table to the network hard disk video recorder so that the network hard disk video recorder executes an automatic adding task based on the pairing table to finish adding the corresponding network video camera.
11. The method of automatically adding a network camera according to claim 1, wherein the network hard disk recorder includes a plurality of channels to connect with the network camera, the method further comprising:
the host judges whether the sum of the maximum access paths of all the network hard disk video recorders is the same as the number of all the network cameras;
if not, the host records the number of the rest idle channels of the network hard disk video recorder or the information of the unassigned network video camera.
12. The method of automatically adding a network camera according to claim 11, further comprising:
after completing the automatic adding task, the host and the slave send adding adjustment information to the host; the added adjustment information comprises the added state and adjustment record information of the network camera, and the adjustment record information comprises record information generated by adjusting the current resolution and the current code stream of the network camera;
The host computer counts the adding adjustment information sent by all the slaves to generate a statistics table; the statistical table comprises network camera information added by each network hard disk video recorder, the rest idle channels of all the network hard disk video recorders or the information of the network cameras which are not distributed, wherein the network camera information comprises the address of the network camera, the serial number of the network camera, the status information of successful/failed addition or the adjustment record information;
after the statistical table is generated, the host and the slave modify their own states to a first state.
13. The equipment access system is characterized by comprising a network camera and a plurality of network hard disk video recorders;
the network hard disk video recorders are used for selecting one network hard disk video recorder from the plurality of network hard disk video recorders to be set as a host, and other network hard disk video recorders are set as slaves;
the host is used for acquiring response information from the slave and the network camera;
the host is further used for generating a pairing table based on the response information, wherein the pairing table comprises a pairing relation between the network camera and the network hard disk video recorder;
The host is further configured to issue the pairing table to the slave, so that the network hard disk video recorder adds the corresponding network camera;
the step of generating a pairing table based on the response information comprises the following steps: judging whether the current resolution of the current network camera is contained in the decoding resolution capability set of the current network hard disk video recorder;
if yes, establishing a pairing relation between the current network camera and the current network hard disk video recorder, and storing the pairing relation in the pairing table;
if not, selecting other network hard disk video recorders as the current network hard disk video recorder, and returning to the step of judging whether the current resolution of the current network video recorder is contained in the decoding resolution capability set of the current network hard disk video recorder until all network hard disk video recorders are traversed or the current resolution of the current network video recorder is contained in the decoding resolution capability set of the current network hard disk video recorder; wherein the set of decoding resolution capabilities comprises a maximum decoding resolution;
judging whether the network hard disk video recorders with idle channels exist or not when all decoding resolution capability sets of the network hard disk video recorders do not contain the current resolution of the current network video camera;
If yes, the network hard disk video recorder with the idle channel is recorded as a network hard disk video recorder to be selected, the network hard disk video recorder to be selected with the smallest difference between the maximum decoding resolution and the current resolution in all the network hard disk video recorders to be selected is selected as the network hard disk video recorder matched with the current network video camera, the maximum decoding resolution of the network hard disk video recorder matched with the current network video camera is recorded as a preset resolution, the current resolution is adjusted to the preset resolution, and resource adjustment information is generated;
the host sends the resource adjustment information to the network hard disk video recorder corresponding to the resource adjustment information, so that the network hard disk video recorder corresponding to the resource adjustment information adjusts the coding configuration parameters of the paired network video camera, wherein the coding configuration parameters comprise resolution.
14. A computer readable storage medium storing a computer program, characterized in that the computer program, when being executed by a processor, is adapted to carry out the method of automatically adding a webcam of any of claims 1-12.
CN202110068424.1A 2021-01-19 2021-01-19 Method, system and storage medium for automatically adding network camera Active CN112911226B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110068424.1A CN112911226B (en) 2021-01-19 2021-01-19 Method, system and storage medium for automatically adding network camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110068424.1A CN112911226B (en) 2021-01-19 2021-01-19 Method, system and storage medium for automatically adding network camera

Publications (2)

Publication Number Publication Date
CN112911226A CN112911226A (en) 2021-06-04
CN112911226B true CN112911226B (en) 2023-04-25

Family

ID=76115490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110068424.1A Active CN112911226B (en) 2021-01-19 2021-01-19 Method, system and storage medium for automatically adding network camera

Country Status (1)

Country Link
CN (1) CN112911226B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103260011A (en) * 2013-05-16 2013-08-21 杭州巨峰科技有限公司 System and method for achieving monitoring of more paths by utilization of net-harddisk video recorder
CN106231225A (en) * 2016-09-14 2016-12-14 深圳市泛海三江科技发展有限公司 A kind of network hard disk video recorder data processing method and system
CN107295315A (en) * 2017-08-15 2017-10-24 深圳市天视通电子科技有限公司 A kind of Network Personal Video Recorder system and its implementation
CN108600675A (en) * 2018-05-24 2018-09-28 普联技术有限公司 Channel way extended method, equipment, Network Personal Video Recorder and storage medium
CN110213549A (en) * 2019-07-03 2019-09-06 成都汇纳智能科技有限公司 A kind of plug-flow method and system based on libRTMP

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102882989B (en) * 2012-09-05 2016-09-14 浙江宇视科技有限公司 A kind of method and apparatus of many NVR monitoring network allocation IP address
EP2819407B1 (en) * 2013-06-27 2019-03-13 Idis Co., Ltd. System for automatic connection between NVR and IP camera
CN104506807B (en) * 2014-12-24 2018-03-06 浙江宇视科技有限公司 A kind of automatic configuration method for devices in wide area network video monitoring system
CN105959644B (en) * 2016-06-21 2019-10-18 浙江宇视科技有限公司 A kind of configuration method and device of video monitoring equipment
CN106603985A (en) * 2016-12-27 2017-04-26 天津天地伟业信息系统集成有限公司 N+M hot standby method for embedded network hard disk video recorder
CN107018360B (en) * 2017-03-24 2019-09-20 浙江大华技术股份有限公司 A kind of adding method of IPC, apparatus and system
CN108683701A (en) * 2018-04-03 2018-10-19 浙江大华技术股份有限公司 A kind of connection method and rear end equipment, IPC
CN111162926B (en) * 2018-11-08 2022-12-23 浙江宇视科技有限公司 Equipment management method and device facing user requirements

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103260011A (en) * 2013-05-16 2013-08-21 杭州巨峰科技有限公司 System and method for achieving monitoring of more paths by utilization of net-harddisk video recorder
CN106231225A (en) * 2016-09-14 2016-12-14 深圳市泛海三江科技发展有限公司 A kind of network hard disk video recorder data processing method and system
CN107295315A (en) * 2017-08-15 2017-10-24 深圳市天视通电子科技有限公司 A kind of Network Personal Video Recorder system and its implementation
CN108600675A (en) * 2018-05-24 2018-09-28 普联技术有限公司 Channel way extended method, equipment, Network Personal Video Recorder and storage medium
CN110213549A (en) * 2019-07-03 2019-09-06 成都汇纳智能科技有限公司 A kind of plug-flow method and system based on libRTMP

Also Published As

Publication number Publication date
CN112911226A (en) 2021-06-04

Similar Documents

Publication Publication Date Title
CN1767636B (en) Content distribution method, program, and information processing apparatus
US9961350B2 (en) Method and apparatus for automatic discovery of elements in a system of encoders
US7865593B2 (en) Apparatus and method for managing a network
JP5324582B2 (en) Load balancing and acceptance schedule management in request-response parallel video server
KR101089562B1 (en) P2p live streaming system for high-definition media broadcasting and the method therefor
US20140165119A1 (en) Offline download method, multimedia file download method and system thereof
EP3172864A1 (en) Management of heterogeneous client device groups
US8873402B2 (en) Service monitoring and service problem diagnosing in communications network
EP3447970B1 (en) Live broadcast system in peer-to-peer network and node management method
US8365007B2 (en) System for controlling the state of a switched digital video system and method therefor
CN101132373A (en) Method of providing qos for a flow
CN110784929B (en) Access resource allocation method, device, equipment and system
CN110300306B (en) Live stream load balancing method based on RTMP protocol
JP2014524200A (en) Method, apparatus and system for finding IPTV faults
CN109672857B (en) Information processing method and device for monitoring resources
EP3207666B1 (en) Broadcast readiness testing in distributed content delivery networks
CN108712422A (en) A kind of method and apparatus creating transcoding task
CN109951723B (en) Method, device and storage medium for adjusting root node in peer-to-peer network live broadcast system
CN112911226B (en) Method, system and storage medium for automatically adding network camera
CN111131788B (en) Monitoring resource state detection method and device and computer readable storage medium
CN110380981B (en) Flow distribution method and equipment
US8036141B2 (en) Apparatus and method for managing a network
CN114679570A (en) Video transmission method and device, storage medium and electronic device
CN108495147A (en) A kind of method and system that video resource is provided
CN114745419B (en) Method, device, equipment and storage medium for acquiring terminal MAC address

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant