CN112436950B - Method for discovering equipment in local area network based on UDP broadcast - Google Patents

Method for discovering equipment in local area network based on UDP broadcast Download PDF

Info

Publication number
CN112436950B
CN112436950B CN202011120735.XA CN202011120735A CN112436950B CN 112436950 B CN112436950 B CN 112436950B CN 202011120735 A CN202011120735 A CN 202011120735A CN 112436950 B CN112436950 B CN 112436950B
Authority
CN
China
Prior art keywords
ipc
information
equipment
nvr
equipment information
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
CN202011120735.XA
Other languages
Chinese (zh)
Other versions
CN112436950A (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.)
Zhongbiao Huian Information Technology Co Ltd
Original Assignee
Zhongbiao Huian Information 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 Zhongbiao Huian Information Technology Co Ltd filed Critical Zhongbiao Huian Information Technology Co Ltd
Priority to CN202011120735.XA priority Critical patent/CN112436950B/en
Publication of CN112436950A publication Critical patent/CN112436950A/en
Application granted granted Critical
Publication of CN112436950B publication Critical patent/CN112436950B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/185Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with management of multicast group membership
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1083In-session procedures
    • H04L65/1093In-session procedures by adding participants; by removing participants
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/611Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a method for discovering devices in a local area network based on UDP broadcast, which comprises the following steps: NVR sends UDP broadcast messages in a local area network, and IPC to be added in the local area network is searched through the sent UDP broadcast messages, so that the IPC in the local area network returns IPC equipment information corresponding to the IPC based on the UDP broadcast messages; the NVR receives IPC equipment information returned by the IPC, displays the received IPC equipment information, and allows a user to confirm whether the IPC corresponding to the IPC equipment information is added to an equipment management list corresponding to the NVR; the NVR receives an addition confirmation instruction triggered by a user, and adds the IPC equipment information to an equipment management list corresponding to the NVR according to the addition confirmation instruction; the method achieves the purpose of discovering the IPC equipment to be added in the local area network by using the UDP broadcast message.

Description

Method for discovering equipment in local area network based on UDP broadcast
Technical Field
The invention relates to the technical field of data processing, in particular to a method for discovering devices in a local area network based on UDP broadcast.
Background
The Network Video Recorder (NVR) has the main function of receiving a digital Video stream transmitted by an IP Camera (IPC) device through a Network, and storing and managing the received digital Video stream, thereby realizing the advantage of a distributed architecture brought by networking. In actual use, one NVR usually needs to manage multiple IPCs, and the multiple managed IPCs need to be configured one by one. The traditional configuration method is that aiming at NVR, when a plurality of IPCs for management are added manually by a technician, information such as manufacturers, IP addresses, ports, account numbers, passwords and the like corresponding to each IPC respectively needs to be input manually, the adding process is complicated, and omission of equipment information is easily caused when a plurality of IPCs are added.
Disclosure of Invention
The invention provides a method for discovering devices in a local area network based on UDP broadcast, which aims to discover IPC devices to be added in the local area network by using UDP broadcast messages, reduce the adding steps of the IPC devices and reduce the input error rate of IPC device information.
The invention provides a method for discovering devices in a local area network based on UDP broadcast, which comprises the following steps:
the network video recorder NVR sends a User Datagram Protocol (UDP) broadcast message in the local area network, and searches for IPC (Internet protocol Camera) to be added in the local area network through the sent UDP broadcast message so that the IPC in the local area network returns IPC equipment information corresponding to the IPC based on the UDP broadcast message;
the NVR receives IPC equipment information returned by the IPC, displays the received IPC equipment information, and allows a user to confirm whether the IPC corresponding to the IPC equipment information is added to an equipment management list corresponding to the NVR;
and the NVR receives an addition confirmation instruction triggered by a user, and adds the IPC equipment information to an equipment management list corresponding to the NVR according to the addition confirmation instruction.
Further, the NVR sends a UDP broadcast packet in the lan, including:
carrying NVR equipment information corresponding to the NVR in a UDP broadcast message sent by the NVR in a local area network;
wherein the NVR device information comprises: the MAC address, the IP address and the NVR device ID of the NVR.
Further, the NVR receives the device information returned by the IPC, including:
and the NVR receives the IPC self IP address, the IPC port number, the IPC MAC address and the IPC equipment number sent by the IPC.
Further, the method for discovering devices in the local area network based on the UDP broadcast further includes:
the IPC receives a UDP broadcast message which is sent by the NVR and carries the NVR equipment information, and acquires the NVR equipment information corresponding to the NVR according to the UDP broadcast message;
according to the NVR equipment information, the IPC sends own IPC equipment information to an NVR corresponding to the NVR equipment information;
wherein, the IPC equipment information comprises: IP address of IPC, IPC port number, MAC address of IPC, and IPC device number.
Further, the NVR receives IPC device information returned by the IPC, and displays the received device information, including:
and the NVR receives IPC equipment information returned by all IPCs in the local area network based on the UDP broadcast message, and displays the received IPC equipment information on a management equipment adding interface corresponding to the NVR.
Further, the NVR receives IPC device information returned by the IPC, and displays the received device information, including:
the NVR receives IPC equipment information returned by all IPCs based on the UDP broadcast message in the local area network;
judging whether the IPC is legal equipment or not according to the IPC equipment information;
if the IPC is legal equipment, storing the IPC equipment information and displaying the IPC equipment information on a management equipment adding interface corresponding to the NVR;
and if the IPC is illegal equipment, discarding the IPC equipment information.
Further, the determining whether the IPC is a legal device according to the IPC device information includes:
the NVR acquires an IPC equipment number corresponding to the IPC according to the IPC equipment information;
searching a pre-stored IPC information database according to the IPC equipment number;
if the IPC equipment number can be found in the IPC information database, judging that the IPC is legal equipment;
and if the IPC equipment number cannot be found in the IPC information database, judging the IPC is illegal equipment.
Further, the method for discovering devices in the local area network based on the UDP broadcast further includes:
acquiring IPC equipment information respectively corresponding to all IPC equipment according to all IPC equipment deployed in the local area network, and generating a corresponding IPC information database according to the IPC equipment information;
wherein, the IPC equipment information comprises: IP address of IPC, IPC port number, MAC address of IPC and IPC device number.
Further, the determining whether the IPC is a legal device according to the IPC device information includes:
and converting binary information corresponding to the IPC equipment information into decimal information, checking the converted decimal information, and judging whether the IPC corresponding to the IPC information is legal equipment or not according to the decimal IPC equipment information after the check is passed.
Further, the converting the binary information corresponding to the IPC device information into decimal information, performing information check on the converted decimal information, and after the information check is passed, judging whether the IPC corresponding to the IPC information is a legal device according to the IPC device information, including steps a1-a 4:
step a1, converting the binary information corresponding to the IPC device information into data information corresponding to decimal system, including:
Figure BDA0002731936370000041
wherein S isjData information representing conversion of jth group information in the IPC device information into decimal, Ci,jA numerical value representing the ith binary number in the jth group of information in the IPC equipment information;
step A2, converting every 8 binary numbers corresponding to the IPC equipment information into decimal information for verification, and then:
Figure BDA0002731936370000042
wherein, P represents a judgment value that every 8 binary numbers in the IPC equipment information are converted into decimal information for verification; m represents that m groups of data are contained in total, wherein each 8 binary numbers in the IPC equipment information form one group, grouping is carried out according to the sequence of the binary numbers from right to left during grouping, and when the last group is less than 8 binary numbers, 0 is supplemented at the front end of the last group until the 8 binary numbers are met; j. the design is a squareiA numerical value of the ith binary number of 8 groups of binary numbers of the check bit in the IPC equipment information;
when P is not equal to 0, the IPC equipment information does not meet the check bit information, and if the IPC equipment information is damaged and lost in the information transmission process, the IPC equipment information is obtained again and the formula and the steps are continued until the check information meets the requirement;
when P is 0, the IPC equipment information meets check bit information, and then whether the IPC is legal equipment is judged by using a formula;
step A3, after the information verification is passed, judging whether the IPC corresponding to the IPC information is legal according to the IPC equipment information, and then:
Figure BDA0002731936370000051
wherein HaThe decision value shows whether the equipment number in the IPC information is the a-th IPC equipment number in the IPC information database; biThe ith binary number value of 8 groups of binary numbers representing the IPC equipment number in the IPC information; baThe number of the A-th IPC equipment in the IPC information database is represented; delta 2]Denotes a unit impulse function, and when the value in the parentheses is 0, δ [ [ delta ] ]]The function value is 1, and when the value in the parentheses is not 0, δ [ [ delta ] ]]The function value is 0;
traversing all IPC equipment numbers in the IPC information database;
if all H areaIf the IPC equipment information is equal to 0, the IPC corresponding to the IPC equipment information is not matchedA process device;
if H is presentaAnd if the IPC equipment information is equal to 1, the IPC corresponding to the IPC equipment information is legal equipment.
Further, the NVR receives an addition confirmation instruction triggered by a user, and adds the IPC device information to the device management list corresponding to the NVR according to the addition confirmation instruction, including:
the NVR receives a confirmation adding instruction triggered by a user and authenticates the confirmation adding instruction;
when the authentication on the addition confirming instruction is passed, analyzing the addition confirming instruction to acquire the IPC equipment information to be added, which is pointed by the addition confirming instruction;
searching an equipment management list corresponding to the NVR according to the IPC equipment information to be added, and identifying whether the IPC equipment information exists in the equipment management list;
if the IPC equipment information does not exist in the equipment management list, adding the IPC equipment information into the equipment management list;
and if the IPC equipment information exists in the equipment management list, sending prompt information for repeatedly adding the IPC equipment information for a user to confirm.
Further, the NVR receives a confirmation addition instruction triggered by a user, and authenticates the confirmation addition instruction, including:
the NVR receives a confirmation adding instruction triggered by a user, and identifies the user identity triggering the confirmation adding instruction;
if the user identity is a registered legal user, the authentication of the confirmation adding instruction is passed;
and if the user identity is the visitor identity, the authentication of the confirmation adding instruction is not passed.
The invention discloses a method for discovering equipment in a local area network based on UDP broadcast, which comprises the steps of sending a UDP broadcast message in the local area network by using NVR, searching IPC to be added in the local area network through the sent UDP broadcast message, and returning IPC equipment information corresponding to the IPC by the IPC in the local area network based on the UDP broadcast message; the NVR receives IPC equipment information returned by the IPC and displays the received IPC equipment information for a user to determine whether to add the IPC corresponding to the IPC equipment information to an equipment management list corresponding to the NVR; the NVR receives an adding confirmation instruction triggered by a user, and adds the IPC equipment information to an equipment management list corresponding to the NVR according to the adding confirmation instruction; the method achieves the purpose of finding the IPC equipment to be added in the local area network by using the UDP broadcast message, reduces the steps of adding the equipment through manual input, reduces the input error rate of the IPC equipment information, prevents the possible information omission when the IPC equipment is added, and saves the labor and time cost; meanwhile, for the user side, the user experience is also improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described below by means of the accompanying drawings and examples.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a flowchart illustrating an embodiment of a method for discovering a device in a lan based on UDP broadcast according to the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The invention provides a method for discovering devices in a local area network based on UDP broadcast, aiming at NVR, IPC devices to be added in the local area network are discovered by using UDP broadcast messages, so that the adding steps of the IPC devices are reduced, and the input error rate of the IPC device information is reduced.
In the embodiment corresponding to the method for discovering the devices in the local area network based on the UDP broadcast, the NVR is: network Video Recorder, Network hard disk Recorder; the IPC is as follows: IP Camera, webcam; the UDP broadcast packet is: the method comprises the steps of sending a broadcast message based on a User Datagram Protocol.
As shown in fig. 1, fig. 1 is a flowchart illustrating an embodiment of a method for discovering devices in a local area network based on UDP broadcast according to the present invention; the method of the present invention for discovering devices in a local area network based on UDP broadcast may be implemented as steps S10-S30 described below.
And S10, the NVR sends a UDP broadcast message in the local area network, and searches the IPC to be added in the local area network through the sent UDP broadcast message, so that the IPC in the local area network returns the IPC equipment information corresponding to the IPC based on the UDP broadcast message.
In the embodiment of the invention, when the NVR sends the UDP broadcast message in the LAN, the NVR carries the self equipment information of the NVR, namely the NVR equipment information; wherein the NVR device information includes but is not limited to: and the MAC address and the IP address of the NVR, the ID of the NVR equipment, the type of the NVR equipment and other information.
After the IPC equipment in the same local area network with the NVR receives the UDP broadcast message sent by the NVR, the IPC equipment returns the corresponding IPC equipment information to the NVR. Wherein, the IPC device information corresponding to the IPC includes but is not limited to: and returning the IPC self IP address, the IPC port number, the IPC MAC address, the IPC equipment number, the IPC legal registered user name and password and the like corresponding to the IPC equipment to the NVR.
Further, in an embodiment, the IPC receives a UDP broadcast message carrying the NVR device information and sent by the NVR, and acquires the NVR device information corresponding to the NVR according to the UDP broadcast message; according to the NVR equipment information, the IPC sends own IPC equipment information to NVR corresponding to the NVR equipment information; wherein, the IPC equipment information comprises: IP address of IPC, IPC port number, MAC address of IPC and IPC device number.
In the embodiment of the invention, when the IPC sends the own IPC equipment information to the corresponding NVR, the NVR matched with the NVR equipment information is found according to the NVR equipment information carried in the UDP broadcast message sent by the NVR, and the IPC equipment information is sent to the NVR. Because there may be more than one NVR device in the same local area network, when the IPC returns the IPC device information according to the UDP broadcast message, in order to avoid the situation that an error occurs in sending the IPC device information to other NVRs, and/or avoid the situation that the IPC device information is fed back to all the NVRs in the local area network, which may cause resource waste, when the IPC returns the IPC device information of the IPC device, the corresponding NVR is found according to the NVR device information carried in the UDP broadcast message, and the IPC device information is returned to the NVR.
And S20, the NVR receives the IPC equipment information returned by the IPC, and displays the received IPC equipment information for a user to confirm whether to add the IPC corresponding to the IPC equipment information to an equipment management list corresponding to the NVR.
And sending the NVR of the UDP broadcast message, directly displaying the received IPC equipment information on a user operation interface after receiving the IPC equipment information returned by the IPC, so that a user can check and confirm whether the displayed IPC equipment information is added to an IPC equipment management list corresponding to the NVR. In the embodiment of the present invention, the IPC device information received by the NVR is the IPC device information returned by all IPC devices that receive the UDP broadcast packet in the lan.
In the embodiment of the invention, because the NVR sends the UDP broadcast message, the IPC equipment which receives the UDP broadcast message in the local area network feeds back the IPC equipment information of the IPC to the NVR. Because there may be multiple types, different uses, and different specifications of IPC devices in the local area network, and there may also be situations where information of the IPC devices returned by the IPC devices is missed or mistaken, when receiving the IPC device information returned by each IPC in the local area network, a user needs to perform manual judgment, and when possible, the user also needs to perform manual checking on the IPC device information.
And step S30, the NVR receives an addition confirmation instruction triggered by a user, and adds the IPC equipment information to an equipment management list corresponding to the NVR according to the addition confirmation instruction.
Based on the IPC equipment information displayed on the user operation interface by the NVR, a user triggers a corresponding addition confirmation instruction; and the NVR detects and receives the addition confirmation instruction triggered by the user, and automatically adds the IPC equipment information displayed on the user operation interface to an equipment management list corresponding to the NVR according to the addition confirmation instruction, so that the operation process of discovering and adding IPC equipment in the local area network by the NVR based on the UDP broadcast message is completed.
Further, in an embodiment, in the embodiment of fig. 1, "step S20, the NVR receives the IPC device information returned by the IPC, and displays the received IPC device information", which may also be implemented according to the following technical means:
the NVR receives IPC equipment information returned by all IPCs based on the UDP broadcast message in the local area network; judging whether the IPC is legal equipment or not according to the IPC equipment information; if the IPC is legal equipment, storing the IPC equipment information and displaying the IPC equipment information on a management equipment adding interface corresponding to the NVR; and if the IPC is illegal equipment, discarding the IPC equipment information.
In the embodiment of the invention, before the NVR displays the received IPC equipment information on the user operation interface corresponding to the NVR, whether the IPC is legal or not is judged according to the IPC equipment information, and whether the received IPC equipment information is displayed or not is determined according to a judgment result. The processing mode improves the intelligence and convenience of adding the IPC equipment and reduces the manual operation steps of the user.
Further, in an embodiment, the determining method for determining whether the IPC is a legal device according to the IPC device information includes, but is not limited to, the following technical methods:
the NVR acquires an IPC equipment number corresponding to the IPC according to the IPC equipment information; searching a pre-stored IPC information database according to the IPC equipment number; if the IPC equipment number can be found in the IPC information database, judging that the IPC is legal equipment; and if the IPC equipment number cannot be found in the IPC information database, judging the IPC is illegal equipment.
Further, in an embodiment, if the NVR cannot find the IPC device number in the IPC information database, sending a prompt message through the user operation interface to prompt the user that the IPC device number is not found in the IPC information database, manually determining, by the user, whether the IPC device corresponding to the IPC device number is a legal device, and further executing a corresponding operation according to a result of the manual determination by the user.
For example, if the manual judgment result triggered by the user and received by the NVR confirms that the IPC corresponding to the IPC device number is a legal device, the manual judgment result triggered by the user is received, and meanwhile, the IPC device number is added to the IPC information database for storage, and the IPC information database is updated synchronously. And if the NVR receives the manual judgment result triggered by the user and confirms that the IPC corresponding to the IPC equipment number is illegal equipment, receiving the manual judgment result triggered by the user and confirming that the IPC corresponding to the IPC equipment number is illegal equipment.
Further, in an embodiment, in order to facilitate the NVR to determine whether the IPC devices corresponding to all the IPC device information in the lan are legal devices, the method for discovering the devices in the lan based on UDP broadcast of the present invention further includes the steps of:
and acquiring IPC equipment information respectively corresponding to all IPC equipment according to all IPC equipment deployed in the local area network, and generating a corresponding IPC information database according to the IPC equipment information. Wherein, the IPC device information includes but is not limited to: IP address of IPC, IPC port number, MAC address of IPC, IPC equipment number, IPC equipment type, IPC equipment specification and other equipment information.
Further, in an embodiment, in "step S30, the NVR receives a confirmation addition instruction triggered by a user, and adds the IPC device information to the device management list corresponding to the NVR according to the confirmation addition instruction" in the embodiment of fig. 1, may also be implemented according to the following technical means:
the NVR receives a confirmation adding instruction triggered by a user and authenticates the confirmation adding instruction; and when the authentication on the addition confirming instruction is passed, analyzing the addition confirming instruction to acquire the IPC equipment information to be added, which is pointed by the addition confirming instruction.
Searching an equipment management list corresponding to the NVR according to the IPC equipment information to be added, and identifying whether the IPC equipment information exists in the equipment management list; if the IPC equipment information does not exist in the equipment management list, adding the IPC equipment information into the equipment management list; and if the IPC equipment information exists in the equipment management list, sending prompt information for repeatedly adding the IPC equipment information for a user to confirm.
Further, the NVR receives a confirmation addition instruction triggered by a user, authenticates the confirmation addition instruction, and may be implemented according to the following technical means:
the NVR receives a confirmation adding instruction triggered by a user and identifies the identity of the user triggering the confirmation adding instruction; if the user identity is a registered legal user, the authentication of the confirmation adding instruction is passed; and if the user identity is the visitor identity, the authentication of the confirmation adding instruction is not passed.
In the embodiment of the invention, when an addition confirmation instruction triggered by a user is received, the NVR judges whether the user identity triggering the addition confirmation instruction is a registered legal user. When the user identity is a registered legal user, the authentication of the confirmation adding instruction is passed; and if the user identity is the visitor identity, the authentication of the addition instruction for confirmation is not passed, and the user is prompted to execute the operation of user login or new user registration.
Further, in the embodiment of the present invention, an operation of identifying the user identity triggering the addition confirmation instruction is performed, if the user is a registered legal login user, a user right corresponding to a user name and a password of the login user is further obtained, and according to the obtained user right, whether the user right has a right to trigger the confirmation of adding the IPC device information is determined; and if the user authority has the authority of adding the IPC equipment information, confirming that an adding instruction triggered by the registered legal user is an effective adding instruction. And if the user authority does not have the authority of adding the IPC equipment information, confirming that the addition triggered by the registered legal user is an invalid addition instruction, and the NVR does not execute the operation of adding the IPC equipment information to the equipment management list. By the aid of the processing mode, safety of information addition of the IPC equipment is improved.
The invention discloses a method for discovering equipment in a local area network based on UDP broadcast, which comprises the steps of sending a UDP broadcast message in the local area network by using NVR, searching IPC to be added in the local area network through the sent UDP broadcast message, and returning IPC equipment information corresponding to the IPC by the IPC in the local area network based on the UDP broadcast message; the NVR receives IPC equipment information returned by the IPC, displays the received IPC equipment information, and allows a user to confirm whether the IPC corresponding to the IPC equipment information is added to an equipment management list corresponding to the NVR; the NVR receives an addition confirmation instruction triggered by a user, and adds the IPC equipment information to an equipment management list corresponding to the NVR according to the addition confirmation instruction; the method achieves the purpose of finding the IPC equipment to be added in the local area network by using the UDP broadcast message, reduces the steps of adding the equipment through manual input, reduces the input error rate of the IPC equipment information, prevents the possible information omission when the IPC equipment is added, and saves the labor and time cost; meanwhile, for the user side, the user experience is also improved.
Further, in an embodiment, the determining method for determining whether the IPC is a legal device according to the IPC device information includes, but is not limited to, the following technical methods:
and converting binary information corresponding to the IPC equipment information into decimal information, checking the converted decimal information, and judging whether the IPC corresponding to the IPC information is legal or not according to the decimal IPC equipment information after the check is passed.
Further, the converting the binary information corresponding to the IPC device information into decimal information, performing information check on the converted decimal information, and after the information check is passed, judging whether the IPC corresponding to the IPC information is a legal device according to the IPC device information, including steps a1-a 4:
step a1, converting the binary information corresponding to the IPC device information into data information corresponding to decimal system, including:
Figure BDA0002731936370000121
wherein S isjJ group information in the IPC equipment information is converted into decimal data information, Ci,jA numerical value representing the ith binary number in the jth group information in the IPC equipment information;
step A2, converting every 8 binary numbers corresponding to the IPC equipment information into decimal information for verification, and then:
Figure BDA0002731936370000131
wherein, P represents each 8 binary numbers of the IPC equipment information as a group of judgment values which are converted into decimal information for checking; m represents that m groups of data are contained in total, wherein each 8 binary numbers in the IPC equipment information form one group, grouping is carried out according to the sequence of the binary numbers from right to left during grouping, and when the last group is less than 8 binary numbers, 0 is supplemented at the front end of the last group until the 8 binary numbers are met; j. the design is a squareiThe second of 8 groups of binary numbers representing check bits in the IPC equipment informationThe numerical values of i binary numbers;
when P is not equal to 0, the IPC equipment information does not meet the check bit information, and if the IPC equipment information is damaged and lost in the information transmission process, the IPC equipment information is obtained again and the formula and the steps are continued until the check information meets the requirement;
when P is equal to 0, the IPC equipment information meets check bit information, and whether the IPC is legal equipment is judged by using a formula;
step A3, after the information verification is passed, judging whether the IPC corresponding to the IPC information is legal according to the IPC equipment information, and then:
Figure BDA0002731936370000132
wherein HaThe decision value shows whether the equipment number in the IPC information is the a-th IPC equipment number in the IPC information database; b isiThe ith binary number value of 8 groups of binary numbers representing the IPC equipment number in the IPC information; baThe number of the A-th IPC equipment in the IPC information database is represented; delta 2]Denotes a unit impulse function, and when the value in the parentheses is 0, δ [ [ delta ] ]]The function value is 1, and when the value in the parentheses is not 0, δ [ [ delta ] ]]The function value is 0;
traversing all IPC equipment numbers in the IPC information database;
if all H areaIf the IPC equipment information is equal to 0, the IPC corresponding to the IPC equipment information is represented as illegal equipment;
if H is presentaAnd if the IPC equipment information is equal to 1, the IPC corresponding to the IPC equipment information is legal equipment.
If the IPC is legal equipment, storing the IPC equipment information and displaying the IPC equipment information on a management equipment adding interface corresponding to the NVR; and if the IPC is illegal equipment, discarding the IPC equipment information.
The beneficial effects of the above technical scheme are: converting the IPC device information into decimal data information by using formula (1) in the step A1, wherein the aim is to convert the binary information into decimal information for facilitating subsequent verification; then, converting every 8 binary numbers of the IPC equipment information into a group of decimal information by using a formula (2) in the step A2 for verification, thereby obtaining whether the IPC equipment information is changed or damaged according to a verification result; then, judging whether the IPC is legal equipment or not by using a formula (3) in the step A3; selectively storing the IPC equipment information according to whether the IPC equipment is legal or not, and displaying the IPC equipment information on a management equipment adding interface corresponding to the NVR; the steps and the formula add the verification of the IPC equipment information, the accuracy and the reliability of the equipment are improved, and the formula is used for automatically judging whether the IPC is legal equipment, so that the automation degree of the equipment is higher, and the efficiency is higher.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (7)

1. A method for discovering devices in a local area network based on UDP broadcast, the method comprising:
the network video recorder NVR sends a User Datagram Protocol (UDP) broadcast message in a local area network, and searches for a network camera IPC to be added in the local area network through the sent UDP broadcast message so that the IPC in the local area network returns IPC equipment information corresponding to the IPC based on the UDP broadcast message;
the NVR receives IPC equipment information returned by the IPC, displays the received IPC equipment information, and allows a user to confirm whether the IPC corresponding to the IPC equipment information is added to an equipment management list corresponding to the NVR;
the NVR receives an addition confirmation instruction triggered by a user, and adds the IPC equipment information to an equipment management list corresponding to the NVR according to the addition confirmation instruction;
the NVR receives IPC equipment information returned by the IPC and displays the received equipment information, and the method comprises the following steps:
the NVR receives IPC equipment information returned by all IPCs in a local area network based on the UDP broadcast message, and displays all the received IPC equipment information on a management equipment adding interface corresponding to the NVR;
or:
the NVR receives IPC equipment information returned by all IPCs based on the UDP broadcast message in the local area network;
judging whether the IPC is legal equipment or not according to the IPC equipment information;
if the IPC is legal equipment, storing the IPC equipment information and displaying the IPC equipment information on a management equipment adding interface corresponding to the NVR;
if the IPC is illegal equipment, discarding the IPC equipment information;
wherein, the judging whether the IPC is legal equipment according to the IPC equipment information comprises the following steps:
converting binary information corresponding to the IPC equipment information into decimal information, checking the converted decimal information, and judging whether the IPC corresponding to the IPC information is legal or not according to the decimal IPC equipment information after the check is passed;
converting binary information corresponding to the IPC equipment information into decimal information, performing information verification on the converted decimal information, and judging whether the IPC corresponding to the IPC information is legal or not according to the IPC equipment information after the information verification is passed, wherein the steps of A1-A3:
step A1, converting the binary information corresponding to the IPC device information into data information corresponding to decimal system, then:
Figure FDA0003582019520000021
wherein S isjData information representing conversion of jth group information in the IPC device information into decimal, Ci,jA numerical value representing the ith binary number in the jth group information in the IPC equipment information;
step A2, converting every 8 binary numbers corresponding to the IPC equipment information into decimal information for verification, and then:
Figure FDA0003582019520000022
wherein, P represents a judgment value that every 8 binary numbers in the IPC equipment information are converted into decimal information for verification; m represents that each 8 binary numbers of the IPC equipment information are grouped into m groups of data, wherein the grouping is carried out according to the sequence of the binary numbers from right to left, and when the last group is less than 8 binary numbers, 0 is supplemented at the front end of the last group until the 8 binary numbers are met; j is a unit ofiA numerical value of the ith binary number of 8 groups of binary numbers of the check bit in the IPC equipment information;
when P is not equal to 0, the IPC equipment information does not meet the check bit information, and if the IPC equipment information is damaged and lost in the information transmission process, the IPC equipment information is obtained again and the formula and the steps are continued until the check information meets the requirement;
when P is 0, the IPC equipment information meets check bit information, and then whether the IPC is legal equipment is judged by using a formula;
step A3, after the information verification is passed, judging whether the IPC corresponding to the IPC information is legal equipment according to the IPC equipment information, if so, the following steps are performed:
Figure FDA0003582019520000031
wherein HaThe decision value shows whether the equipment number in the IPC information is the a-th IPC equipment number in the IPC information database; biThe ith binary number value of 8 groups of binary numbers representing the IPC equipment number in the IPC information; baThe number of the A-th IPC equipment in the IPC information database is represented; delta [ 2 ]]Denotes a unit impulse function, and when the value in the parentheses is 0, δ [ [ delta ] ]]The function value is 1, and when the value in the parentheses is not 0, δ [ [ delta ] ]]The function value is 0;
traversing all IPC equipment numbers in the IPC information database;
if all H areaIf the IPC equipment information is equal to 0, the IPC corresponding to the IPC equipment information is represented as illegal equipment;
if H is presentaAnd if the IPC equipment information is equal to 1, the IPC corresponding to the IPC equipment information is legal equipment.
2. The method for discovering devices in a local area network based on UDP broadcast according to claim 1, wherein the NVR sends a UDP broadcast packet in the local area network, comprising:
carrying NVR equipment information corresponding to the NVR in a UDP broadcast message sent by the NVR in a local area network; wherein the NVR device information comprises: the MAC address, the IP address and the NVR equipment ID of the NVR;
the NVR receives the equipment information returned by the IPC, and the equipment information comprises the following information:
and the NVR receives the IPC self IP address, the IPC port number, the IPC MAC address and the IPC equipment number sent by the IPC.
3. The method for discovering devices in a local area network based on UDP broadcast of claim 1, wherein the method further comprises:
the IPC receives a UDP broadcast message which is sent by the NVR and carries the NVR equipment information, and acquires the NVR equipment information corresponding to the NVR according to the UDP broadcast message;
according to the NVR equipment information, the IPC sends own IPC equipment information to an NVR corresponding to the NVR equipment information;
wherein, the IPC equipment information comprises: IP address of IPC, IPC port number, MAC address of IPC and IPC device number.
4. The method for discovering devices in a local area network based on UDP broadcast as claimed in claim 1, wherein said determining if the IPC is a valid device according to the IPC device information comprises:
the NVR acquires an IPC equipment number corresponding to the IPC according to the IPC equipment information;
searching a pre-stored IPC information database according to the IPC equipment number;
if the IPC equipment number can be found in the IPC information database, judging that the IPC is legal equipment;
and if the IPC equipment number cannot be found in the IPC information database, judging the IPC is illegal equipment.
5. The method for discovering devices in a local area network based on UDP broadcast of claim 4, wherein the method further comprises:
acquiring IPC equipment information respectively corresponding to all IPC equipment according to all IPC equipment deployed in the local area network, and generating a corresponding IPC information database according to the IPC equipment information;
wherein, the IPC equipment information comprises: IP address of IPC, IPC port number, MAC address of IPC and IPC device number.
6. The method as claimed in any one of claims 1 to 5, wherein the method for discovering devices in a local area network based on UDP broadcast, the NVR receiving a confirmation addition instruction triggered by a user, and adding the IPC device information to the device management list corresponding to the NVR according to the confirmation addition instruction includes:
the NVR receives a confirmation adding instruction triggered by a user and authenticates the confirmation adding instruction;
when the authentication on the addition confirming instruction is passed, analyzing the addition confirming instruction to acquire the IPC equipment information to be added, which is pointed by the addition confirming instruction;
searching an equipment management list corresponding to the NVR according to the IPC equipment information to be added, and identifying whether the IPC equipment information exists in the equipment management list;
if the IPC equipment information does not exist in the equipment management list, adding the IPC equipment information into the equipment management list;
and if the IPC equipment information exists in the equipment management list, sending prompt information for repeatedly adding the IPC equipment information for a user to confirm.
7. The method for discovering devices in a local area network based on UDP broadcast of claim 6, wherein the NVR receives a user triggered acknowledgement add command and authenticates the acknowledgement add command, comprising:
the NVR receives a confirmation adding instruction triggered by a user, and identifies the user identity triggering the confirmation adding instruction;
if the user identity is a registered legal user, the authentication of the confirmation adding instruction is passed;
and if the user identity is the visitor identity, the authentication of the confirmation adding instruction is not passed.
CN202011120735.XA 2020-10-19 2020-10-19 Method for discovering equipment in local area network based on UDP broadcast Active CN112436950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011120735.XA CN112436950B (en) 2020-10-19 2020-10-19 Method for discovering equipment in local area network based on UDP broadcast

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011120735.XA CN112436950B (en) 2020-10-19 2020-10-19 Method for discovering equipment in local area network based on UDP broadcast

Publications (2)

Publication Number Publication Date
CN112436950A CN112436950A (en) 2021-03-02
CN112436950B true CN112436950B (en) 2022-07-12

Family

ID=74695695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011120735.XA Active CN112436950B (en) 2020-10-19 2020-10-19 Method for discovering equipment in local area network based on UDP broadcast

Country Status (1)

Country Link
CN (1) CN112436950B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556467A (en) * 2021-07-21 2021-10-26 中国电信股份有限公司 Control method, control system, storage medium and electronic device of network camera
CN117835253A (en) * 2022-09-27 2024-04-05 比亚迪股份有限公司 Local area network communication method, electronic equipment, vehicle, system and medium
CN116567457B (en) * 2023-04-17 2024-07-23 深圳市西迪特科技股份有限公司 Method for binding ONU equipment by mobile equipment in local area network

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102427452A (en) * 2011-12-06 2012-04-25 北京星网锐捷网络技术有限公司 Synchronize (SYN) message transmitting method and device and network equipment
CN103873301A (en) * 2014-03-20 2014-06-18 浙江宇视科技有限公司 System and method for automatically finding and adding devices
CN104468781A (en) * 2014-12-05 2015-03-25 谢勇 Network device fast searching system having filtering function and method
CN105656680A (en) * 2016-01-29 2016-06-08 浙江宇视科技有限公司 Method and device for controlling web camera
CN105897309A (en) * 2015-08-17 2016-08-24 乐视致新电子科技(天津)有限公司 Intelligent device matching device and intelligent device
CN107172051A (en) * 2017-05-23 2017-09-15 南京邮电大学 A kind of method that internet of things equipment finds and managed
CN110647490A (en) * 2019-10-22 2020-01-03 深圳市康冠智能科技有限公司 Data transmission method, device, equipment and computer storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7167110B2 (en) * 2002-01-08 2007-01-23 Nec Corporation Multi-level communication system and method with error correction

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102427452A (en) * 2011-12-06 2012-04-25 北京星网锐捷网络技术有限公司 Synchronize (SYN) message transmitting method and device and network equipment
CN103873301A (en) * 2014-03-20 2014-06-18 浙江宇视科技有限公司 System and method for automatically finding and adding devices
CN104468781A (en) * 2014-12-05 2015-03-25 谢勇 Network device fast searching system having filtering function and method
CN105897309A (en) * 2015-08-17 2016-08-24 乐视致新电子科技(天津)有限公司 Intelligent device matching device and intelligent device
CN105656680A (en) * 2016-01-29 2016-06-08 浙江宇视科技有限公司 Method and device for controlling web camera
CN107172051A (en) * 2017-05-23 2017-09-15 南京邮电大学 A kind of method that internet of things equipment finds and managed
CN110647490A (en) * 2019-10-22 2020-01-03 深圳市康冠智能科技有限公司 Data transmission method, device, equipment and computer storage medium

Also Published As

Publication number Publication date
CN112436950A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
CN112436950B (en) Method for discovering equipment in local area network based on UDP broadcast
CN111131544B (en) Method for realizing NAT traversal
CN110519377B (en) Communication data transmission method and device
CN110196715A (en) A kind of code generating system and method
CN107181733A (en) A kind of login validation method and device
CN104580553A (en) Identification method and device for network address translation device
CN108833565A (en) A kind of method, apparatus of monitoring server, server and storage medium
CN107124483A (en) Domain name analytic method and server
CN107294910B (en) Login method and server
CN110602130B (en) Terminal authentication system and method, equipment terminal and authentication server
CN106453349A (en) An account number login method and apparatus
CN105323128B (en) method, device and system for accessing front-end equipment to server
CN107070719A (en) A kind of device management method and device
CN113992508A (en) Local area network automatic networking method of intelligent equipment and intelligent equipment
CN110913351A (en) Multicast control method, device, network equipment and storage medium
CN115604162A (en) Detection method of network security equipment
CN106789666B (en) Method and device for determining converted port
CN110995738B (en) Violent cracking behavior identification method and device, electronic equipment and readable storage medium
CN110838967B (en) Virtual private network connection method, server, client and storage medium
CN113162922A (en) Client data acquisition method and device, storage medium and electronic equipment
CN107864127B (en) Application program identification method and device
CN116938895B (en) Media data packet acquisition method and device, electronic equipment and storage medium
CN114915576B (en) Method and system for identifying terminal equipment at router
CN116662938B (en) Authorization method, application running method and device based on container cluster management system
CN115242678B (en) Data acquisition method and device, electronic equipment and storage medium

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