[go: up one dir, main page]

CN119342086B - Device connection method and device, storage medium and electronic device - Google Patents

Device connection method and device, storage medium and electronic device Download PDF

Info

Publication number
CN119342086B
CN119342086B CN202411870244.5A CN202411870244A CN119342086B CN 119342086 B CN119342086 B CN 119342086B CN 202411870244 A CN202411870244 A CN 202411870244A CN 119342086 B CN119342086 B CN 119342086B
Authority
CN
China
Prior art keywords
power supply
network
network power
supply device
address
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
CN202411870244.5A
Other languages
Chinese (zh)
Other versions
CN119342086A (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 CN202411870244.5A priority Critical patent/CN119342086B/en
Publication of CN119342086A publication Critical patent/CN119342086A/en
Application granted granted Critical
Publication of CN119342086B publication Critical patent/CN119342086B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/10Current supply arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2517Translation of Internet protocol [IP] addresses using port numbers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/255Maintenance or indexing of mapping tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

本申请公开了一种设备的连接方法和装置、存储介质及电子设备。其中,该方法包括:在至少一个网络供电设备包括第一网络供电设备和第二网络供电设备的情况下,生成处于同一网段下的第一网络地址和第二网络地址;在第一网络供电设备先于第二网络供电设备与后端设备建立连接的情况下,基于第一网络地址将目标端口与第一网络供电设备绑定并基于第二网络地址将空闲端口与第二网络供电设备绑定,空闲端口表示后端设备对应的多个端口中未参与数据传输的端口;基于目标端口和空闲端口拉取第一网络供电设备和第二网络供电设备的预览画面。本申请解决了后端设备与多台网络供电设备进行数据传输过程中出现的资源争夺的技术问题。

The present application discloses a device connection method and apparatus, a storage medium and an electronic device. The method includes: generating a first network address and a second network address in the same network segment when at least one network power supply device includes a first network power supply device and a second network power supply device; binding the target port to the first network power supply device based on the first network address and binding the idle port to the second network power supply device based on the second network address when the first network power supply device establishes a connection with the back-end device before the second network power supply device, wherein the idle port represents a port that does not participate in data transmission among the multiple ports corresponding to the back-end device; and pulling the preview screens of the first network power supply device and the second network power supply device based on the target port and the idle port. The present application solves the technical problem of resource contention that occurs during data transmission between the back-end device and multiple network power supply devices.

Description

Device connection method and device, storage medium and electronic device
Technical Field
The present application relates to the field of computers, and in particular, to a device connection method and apparatus, a storage medium, and an electronic device.
Background
In the related art, data transmission is often required between a back-end device (for example, a network hard disk recorder NVR, etc.) and a network power supply device deployed at a front end, where the back-end device is equipped with POE (Power over Ethernet) ports and can be used to simultaneously transmit data and supply power to the network power supply device, however, since the number of data transmission channels of each POE port of the back-end device is limited, only one front-end device can be supported, but data uploaded by multiple network power supply devices cannot be processed simultaneously, in other words, each POE port of the back-end device is limited to limited data transmission channels, only the connection requirement of a single front-end device can be effectively supported, and it is difficult to cope with the scenario that multiple network power supply devices upload data simultaneously.
In summary, there is an unavoidable technical problem of resource contention during the data transmission between the back-end device and the plurality of network power supply devices.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a device connection method and device, a storage medium and electronic equipment, which are used for at least solving the technical problem of resource contention in the process of carrying out data transmission between back-end equipment and a plurality of network power supply devices.
According to one aspect of the embodiment of the application, a connection method of equipment is provided, wherein the connection method comprises the steps of responding to connection of at least one network power supply equipment with a back-end equipment through a target port corresponding to a target switch, setting a corresponding network address for each network power supply equipment in the at least one network power supply equipment based on a dynamic host configuration protocol, generating a first network address and a second network address when the at least one network power supply equipment comprises the first network power supply equipment and the second network power supply equipment, wherein the first network address and the second network address are in the same network segment, binding the target port with the first network power supply equipment based on the first network address when the first network power supply equipment is connected with the back-end equipment in advance, and binding an idle port with the second network power supply equipment based on the second network address, wherein the idle port represents a port which does not participate in data transmission in a plurality of ports corresponding to the back-end equipment, and previewing a picture of the first network power supply equipment and the first network power supply equipment based on the target port and the idle port.
According to another aspect of the embodiment of the application, a device connecting apparatus is provided, which comprises a setting module, a generating module, and a binding module, wherein the setting module is used for responding to the connection of at least one network power supply device with a back-end device through a target port corresponding to a target switch, setting a corresponding network address for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, the generating module is used for generating a first network address and a second network address when the at least one network power supply device comprises the first network power supply device and the second network power supply device, the first network address and the second network address are in the same network segment, the binding module is used for binding the target port with the first network power supply device based on the first network address and binding an idle port with the second network power supply device based on the second network address when the first network power supply device is connected with the back-end device in advance, wherein the idle port represents a plurality of ports corresponding to the back-end device and the idle port is not participated in the transmission ports, and the binding module is used for previewing the first network power supply device and the idle port based on the first network power supply device.
Optionally, the device is configured to respond to connection of at least one network power supply device with a backend device through a target port corresponding to a target switch, set a corresponding network address for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, establish a connection between the backend device and the target switch, and allocate the target port to the target switch, create a server on the backend device according to the dynamic host configuration protocol, and manage a network address pool through the server to allocate a network address to the network power supply device requesting connection, respond to connection of the network power supply device with the backend device through the target port, negotiate with the network power supply device based on the dynamic host configuration protocol, and set a corresponding network address for the network power supply device.
Optionally, the device is configured to bind the target port with the first network power supply device based on the first network address and bind an idle port with the second network power supply device based on the second network address when the first network power supply device establishes a connection with the back-end device before the second network power supply device establishes a connection with the back-end device, generate a first mapping relationship between the first network address and the target port based on a switch self-learning algorithm when the first network power supply device establishes a connection with the back-end device, acquire the idle port when the second network power supply device establishes a connection with the back-end device, generate a second mapping relationship between the second network address and the idle port based on the switch self-learning algorithm, and store the first mapping relationship and the second mapping relationship to a record form corresponding to the back-end device so that the target port is bound with the first network power supply device and the idle port is bound with the second power supply device.
Optionally, the device is configured to obtain the idle port when the second network power supply device establishes a connection with the backend device, by initiating a broadcast search through a preset application protocol, determining an online network power supply device in a target local area network, determining a network address, a physical address and a use port corresponding to the online network power supply device, and determining the idle port based on the use port and a port set configured for the backend device.
Optionally, the device is configured to store the first mapping relationship and the second mapping relationship in a record form corresponding to the backend device, so that the target port is bound to the first network power supply device, the idle port is bound to the second network power supply device, the first mapping relationship and the second mapping relationship are stored in the record form corresponding to the backend device, traverse the record form according to a first address pair and a second address pair, bind the target port to the first address pair, and bind the idle port to the second address pair, where the first address pair includes the first network address and a first physical address having a mapping relationship, and the second address pair includes the second network address and a second physical address having a mapping relationship.
Optionally, the device is configured to respond to connection of at least one network power supply device with a backend device through a target port corresponding to a target switch, set a corresponding network address for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, receive a broadcast message initiated by the at least one network power supply device when a network port of the at least one network power supply device is inserted into a power supply network port of the backend device, establish connection between the backend device and the target switch based on the broadcast message, and allocate the target port to the target switch, determine that the at least one network power supply device is connected with the backend device, and set a corresponding network address for each network power supply device in the at least one network power supply device based on the dynamic host configuration protocol.
According to a further aspect of embodiments of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of connecting the above-mentioned devices when run.
According to yet another aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the connection method as the above device.
According to still another aspect of the embodiments of the present application, there is also provided an electronic device including a memory in which a computer program is stored, and a processor configured to execute the connection method of the device described above by the computer program.
In the embodiment of the application, in response to the connection of at least one network power supply device with a back-end device through a target port corresponding to a target switch, a corresponding network address is set for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, under the condition that the at least one network power supply device comprises a first network power supply device and a second network power supply device, a first network address and a second network address are generated under the same network segment, under the condition that the first network power supply device is connected with the back-end device before the second network power supply device, the target port is bound with the first network power supply device based on the first network address, and an idle port is bound with the second network power supply device based on the second network address, and a preview picture of the first network power supply device and the second network power supply device is pulled up based on the target port and the idle port.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a schematic illustration of an application environment for an alternative method of device connection in accordance with an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method of connecting devices according to an embodiment of the application;
FIG. 3 is a schematic diagram of an alternative method of connecting devices according to an embodiment of the application;
FIG. 4 is a flow chart of an alternative method of connecting devices according to an embodiment of the application;
FIG. 5 is a schematic device connection diagram of an alternative device connection method according to an embodiment of the application;
FIG. 6 is a schematic structural view of an alternative device connection apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of the structure of a connection product of an alternative apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural view of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The application is illustrated below with reference to examples:
According to an aspect of the embodiment of the present application, there is provided a connection method of devices, alternatively, in this embodiment, the connection method of devices described above may be applied to a hardware environment constituted by a server 101 and a terminal device 103 as shown in fig. 1. As shown in fig. 1, a server 101 is connected to a terminal device 103 via a network, and can be used to provide services to the terminal device or an application 107 installed on the terminal device, such as a video application, an instant messaging application, a browser application, an educational application, a game application, and the like. The database 105 may be provided on a server or independent of the server, and may be used to provide a data storage service for the server 101, for example, a game data storage server, where the above network may include, but is not limited to, a wired network, a wireless network, where the wired network includes a local area network, a metropolitan area network, and a wide area network, where the wireless network includes a bluetooth, WIFI, and other networks implementing wireless communication, and the terminal device 103 may be a terminal configured with an application program, and may include, but is not limited to, at least one of a Mobile phone (such as an Android Mobile phone, an iOS Mobile phone, etc.), a notebook computer, a tablet computer, a palm computer, a MID (Mobile INTERNET DEVICES, a Mobile internet device), a PAD, a desktop computer, a smart television, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a Virtual Reality (VR) terminal, an augmented Reality (Augmented Reality, an AR) terminal, a Mixed Reality (MR) terminal, etc., where the above server may be a single server, or may be a cloud server.
As shown in fig. 1, the connection method of the above-mentioned devices may be performed by an electronic device, which may be a terminal device or a server, and the connection method of the above-mentioned devices may be implemented by the terminal device or the server, respectively, or by both the terminal device and the server.
The above is merely an example, and the present embodiment is not particularly limited.
Optionally, as an optional embodiment, as shown in fig. 2, the connection method of the device includes:
S202, responding to connection of at least one network power supply device with a back-end device through a target port corresponding to a target switch, and setting a corresponding network address for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol;
Optionally, in the embodiment of the present application, the network power supply device refers to a device that receives power and transmits data through an ethernet cable, including but not limited to a POE camera, a network sensor, and the like, the target switch refers to a network device located between a back-end device and a network power supply device, and is used for implementing data forwarding between the back-end device and the network power supply device, including but not limited to a two-layer or three-layer switch, the back-end device is a device for storing and processing data, including but not limited to a network hard disk video recorder (NVR), a server, various intelligent terminal devices, and the like, and is responsible for receiving and managing data uploaded by the front-end device, the target port refers to a port on the target switch that is directly connected to the back-end device, and is used for performing data interaction with the network power supply device, and the dynamic host configuration protocol, that is DHCP, is a protocol that allows the server to dynamically allocate network configuration parameters (such as IP addresses) to a client.
In an application scenario of an IP monitoring system, when an NVR is connected to a target switch through a target port and a plurality of POE cameras (network power supply devices) are connected under the switch, a DHCP server on the NVR automatically allocates a unique IP address to each POE camera in response to the connection of the plurality of POE cameras, and in the allocation process, the NVR intelligently binds the IP address with the switch port according to the sequence of the connection of the POE cameras and the current port usage, so as to ensure that each POE camera in the plurality of POE cameras can obtain an IP address in the same network segment, thereby forming a clear device map on the NVR and realizing automatic online and data transmission.
In an exemplary embodiment, fig. 3 is a schematic diagram of an alternative connection method of devices according to an embodiment of the present application, as shown in fig. 3, including a network power supply device, a backend device, and a target switch, where 3 POE cameras are connected under the target switch as the network power supply device, and the target switch is connected to the backend device through a target port.
It should be noted that, in the embodiment of the present application, the process of obtaining the network address by the network power supply device through DHCP may be automatically triggered when the device is first accessed, or may be a periodic re-request to adapt to a change of a network environment or reconfiguration of the device, which is not limited in any way.
It should be further noted that the application of the dynamic host configuration protocol is not limited to IP address assignment, but may be extended to other network configuration parameters, such as subnet mask, default gateway, etc., so as to provide a more comprehensive automatic configuration service for the network device for the user, and the target switch may be of any type capable of supporting DHCP relay or proxy functions, so that the NVR can indirectly assign an address to the network power supply device connected thereto, and meanwhile, the ports of the backend device may include, but are not limited to, POE ports, or other network ports capable of transmitting data.
S204, generating a first network address and a second network address in the case that at least one network power supply device comprises a first network power supply device and a second network power supply device, wherein the first network address and the second network address are in the same network segment;
Optionally, in the embodiment of the present application, the at least one network power supply device refers to a plurality of network devices powered by ethernet, including but not limited to POE cameras, network phones, wireless access points, and the like, the first network power supply device and the second network power supply device represent network power supply devices accessing the backend device through the target switch, and the first network address and the second network address refer to network addresses for network communication generated by the first network power supply device and the second network power supply device, where the first network address and the second network address are located in a same network segment.
In an application scenario of the video monitoring system, it is assumed that a network hard disk recorder (a back-end device) is connected to a plurality of network power supply devices (including a first network power supply device and a second network power supply device) through a POE switch (a target switch), when the first network power supply device (such as POE camera a) accesses the POE switch, a DHCP server on the network hard disk recorder immediately responds, and a specific IP address, that is, a first network address, is allocated to the POE camera a.
Likewise, when the second network power supply device (such as POE camera B) is also connected to the same POE switch, the network hard disk video recorder continues to generate a second network address for POE camera B, which is also located in the network segment, so as to ensure that POE camera A, POE camera B can communicate with the network hard disk video recorder independently, and automatic online and data transmission can be realized without additional network configuration adjustment, including but not limited to pulling and monitoring of video data.
It should be noted that, in the embodiment of the present application, the same network segment refers to a group of IP addresses with the same network prefix, and these IP addresses may be directly communicated with each other without forwarding through an intermediate routing device, in addition, the embodiment of the present application may dynamically generate the first network address and the second network address, in other words, each time the network power supply device requests to access the backend device, a corresponding network address may be automatically allocated to the network power supply device, or may be pre-planned, including but not limited to presetting an address pool according to the access sequence or type of the device, so as to implement finer network resource management.
It should be further noted that, the above-mentioned backend device is not only used for network address allocation of the network power supply device, but also used for device status monitoring, fault diagnosis, security policy implementation, etc. of the network power supply device, and the present application is not limited in particular to the access sequence and type of the above-mentioned network power supply device.
S206, binding a target port with the first network power supply equipment based on a first network address and binding an idle port with the second network power supply equipment based on a second network address under the condition that the first network power supply equipment establishes connection with the back-end equipment before the second network power supply equipment, wherein the idle port represents a port which does not participate in data transmission in a plurality of ports corresponding to the back-end equipment;
Optionally, in the embodiment of the present application, the idle port refers to a port in the backend device that is not occupied by other devices for data transmission, and may include, but is not limited to, a POE port or other types of network ports.
In a video monitoring system, it is assumed that an NVR (back-end device) is connected to a POE switch (target switch) through a target port, when a first POE camera (as a first network power supply device) accesses the POE switch for the first time and sends a DHCP request, a DHCP server on the NVR responds to and assigns a first network address to the first POE camera, the NVR binds the target port to the network address of the first POE camera, so as to realize automatic identification of the device and directional transmission of a data stream, and then when a second POE camera (as a second network power supply device) accesses the same POE switch, the NVR automatically detects that a new device connection request is generated, and based on the second network address, the NVR binds an unoccupied idle port with the second POE camera, so as to ensure that the second device can also independently exchange data with the NVR.
It should be noted that, the port allocation and device binding policy of the back-end device may also be performed according to a specific network environment and device type, for example, when receiving multiple network power supply device connection requests at the same time, the back-end device may preferentially use a high bandwidth port to bind with a high definition network power supply device to optimize video transmission quality, and in turn allocate other network power supply devices to an idle port to bind, where in addition, the back-end device may have multiple network interfaces, and different interfaces may serve different types or functions of network power supply devices.
In other words, the connection of the back-end device before the back-end device can be adjusted according to the access time, and possibly based on the priority of the device or the network policy, so as to ensure that the important or high-demand network power supply device can obtain the service preferentially.
S208, pulling preview pictures of the first network power supply equipment and the second network power supply equipment based on the target port and the idle port.
Optionally, in an embodiment of the present application, the preview screen refers to a video stream or an image captured by the network power supply device and transmitted to the backend device.
In an extended application scenario of the home monitoring system, it is assumed that a home user has an NVR (back-end device) and is connected to a POE switch (target switch) through a target port thereof, when the user accesses an IP camera (as a first network power supply device) to the POE switch for the first time, the NVR allocates a network address to the IP camera based on DHCP, and then establishes communication with a new device through the target port, starts to pull a real-time video stream transmitted by the camera, i.e., a preview picture, and is presented on a monitoring screen connected to the NVR;
Then, in order to further expand the monitoring range, the user accesses the second IP camera (as the second network power supply device) to the same POE switch, at this time, the NVR automatically detects a new device connection, allocates a network address to the second camera based on DHCP, and then establishes a connection with the second camera by using the idle port, and starts pulling the preview screen of the second camera.
In an exemplary embodiment, fig. 4 is a flowchart of an alternative method for connecting devices according to an embodiment of the present application, where in a video monitoring application scenario, for a backend device, as shown in fig. 4:
S402, starting;
S404, the back-end equipment initiates broadcast searching through an application protocol (which can be a user-defined searching protocol or a standard onvif searching protocol, etc.);
S406, an online network power supply device (comprising the network power supply device) in the network responds;
S408, the back-end equipment stores all online equipment reply information (the information comprises physical address, network address information, ports used by streaming and other necessary information records) into a mapping table 1;
For a network powered device, as shown in fig. 4:
s410, starting the network power supply equipment, and discovering a DHCP (dynamic host configuration protocol) server;
s412, the DHCP processes of the network power supply equipment and the back-end equipment negotiate and allocate a designated network address;
S414, the similar switch self-learning algorithm automatically establishes a plurality of mapping relations < MAC, IP > (physical address, network address) and ports for binding;
s416, storing the mapping relation into a mapping table 2, wherein the mapping table 2 comprises a plurality of pairs of physical addresses and mapping relation among network addresses;
It should be noted that any of the steps S402 to S408 and any of the steps S410 to S416 may be performed synchronously, and no sequence exists, for example, the steps S402 and S410 may be performed at the same time, which is not limited in the present application.
Further, after the above mapping table 1 and mapping table 2 are obtained, the following operations may be performed as shown in fig. 4:
S418, using MAC-IP as a key value to compare mapping table 1 with mapping table 2, if the comparison is successful, the mapping table 1 is used as network power supply equipment, and the subsequent processing is carried out according to the rest information of the mapping table 2 and mapping table 1 (the hardware port, the stream pulling port and the stream pulling protocol of the network power supply equipment are used for stream pulling preview, so as to realize the automatic online function and add the stream pulling preview to the corresponding port channel);
S420, ending.
According to the embodiment of the application, in response to the connection of at least one network power supply device with a back-end device through a target port corresponding to a target switch, a corresponding network address is set for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, under the condition that the at least one network power supply device comprises a first network power supply device and a second network power supply device, a first network address and a second network address are generated under the same network segment, under the condition that the first network power supply device is connected with the back-end device before the second network power supply device, the target port is bound with the first network power supply device based on the first network address, the idle port is bound with the second network power supply device based on the second network address, and a preview picture of the first network power supply device and the second network power supply device is pulled based on the target port and the idle port.
As an alternative scheme, the method for setting a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol includes establishing a connection between the at least one network power supply device and a target switch and allocating the target port to the target switch, creating a server on the at least one network power supply device according to the dynamic host configuration protocol and managing a network address pool through the server to allocate a network address to the network power supply device requesting connection, and setting a corresponding network address for the network power supply device based on negotiation of the dynamic host configuration protocol in response to the network power supply device being connected to the at least one network power supply device through the target port.
Optionally, in the embodiment of the present application, the network address pool is an IP address set managed by a DHCP server and is used for dynamically allocating to the network power supply device requesting connection, and negotiation between the backend device and the network power supply device may be understood as an interaction process between the network power supply device and the DHCP server of the backend device, so as to obtain network configuration parameters (such as information of an IP network address, etc.) corresponding to the network power supply device.
In an application scenario of enterprise-level video monitoring deployment, a physical connection between an NVR (backend device) and a target switch is established through a network cable, a target port is set on the NVR and is used for receiving and managing cascaded network power supply devices, then a DHCP server is started on the NVR, the network address pool is created, the network address pool comprises a plurality of IP addresses prepared in advance and located in a preset network segment and used for being distributed to network power supply devices which subsequently access the NVR, when a certain network power supply device is connected to the target switch and requests data communication with the NVR through the target switch, the DHCP server on the NVR responds to the request of the network power supply device and automatically distributes an IP address to the network power supply device through negotiation, so that the network power supply device can be enabled to be connected and begin transmitting video streams.
It should be noted that, the size of the network address pool, the range of the network segment, and the access sequence and type of the device are not limited in the embodiments of the present application, and may include, but not limited to, adjusting the network environment and the requirements of a specific service scenario to achieve optimal network resource allocation and management.
In an exemplary embodiment, assuming that a retail store wishes to install POE cameras at each corner to enhance in-store monitoring, but the number of POE ports of the NVR is limited, in this service scenario, through the embodiment of the present application, the NVR may be connected to a target switch having multiple POE ports through the target port, then a DHCP service is started on the NVR, creating a network address pool containing multiple IP addresses, when the POE camera accesses any port of the switch, the DHCP server of the NVR automatically allocates the first available IP address in response to a request thereof, and binds the network address of the POE camera with the target port, and then, when more network power devices (which may be POE devices of the same type, or may be other types of devices, such as a sensor, etc.) access different ports of the switch, the NVR continuously allocates network addresses for them, so as to implement automatic online and monitoring service deployment of multiple devices.
According to the embodiment of the application, the DHCP protocol is matched with the target switch, so that the network configuration of the network power supply equipment is automatically managed by the back-end equipment, the purpose of efficiently expanding the number of the network power supply equipment at the front end under the limited port resources of the back-end equipment is achieved, and meanwhile, the independence among the network power supply equipment and the stability of network communication are ensured.
As an alternative, the method for binding the target port and the first network power supply device based on the first network address and binding the idle port and the second network power supply device based on the second network address when the first network power supply device establishes a connection with the back-end device earlier than the second network power supply device, includes generating a first mapping relationship between the first network address and the target port based on a switch self-learning algorithm when the first network power supply device establishes a connection with the back-end device, acquiring the idle port when the second network power supply device establishes a connection with the back-end device, generating a second mapping relationship between the second network address and the idle port based on the switch self-learning algorithm, and storing a record form corresponding to the back-end device in the first mapping relationship and the second mapping relationship so as to bind the target port and the first network power supply device and binding the idle port and the second power supply device.
Optionally, in the embodiment of the present application, the switch self-learning algorithm is a network management mechanism, and is used for automatically learning and recording a correspondence between a MAC address of a network device and a network port to optimize a data forwarding path, where the recording form refers to a database or a list in the back-end device, where the database or the list is used for storing a network mapping relationship.
In an exemplary deployment scenario of an intelligent traffic monitoring system (ITS), a traffic monitoring center uses an NVR as a back-end device, and is connected to a POE switch (target switch) supporting POE functions through a target port, when a first IP camera (serving as a first network power supply device) accesses the POE switch, a DHCP server on the NVR allocates a first network address to the POE switch, and at the same time, the NVR enables a switch self-learning algorithm, automatically detects and establishes a one-to-one mapping relationship between the first network address and the target port, records the one-to-one mapping relationship in a database of the NVR, and ensures smooth data communication with the first IP camera.
Then, when a second IP camera (serving as second network power supply equipment) accesses to different ports of the same POE switch, the NVR automatically detects a connection request of the equipment, selects one of the idle ports for data transmission, and distributes a second network address for the second IP camera through DHCP, and at the moment, the NVR generates and stores a mapping relation between the second network address and the idle ports by applying a switch self-learning algorithm again, so that independent communication of the second IP camera is ensured.
It should be noted that, in the embodiment of the present application, connection and address allocation between the network power supply device and the backend device may also be implemented by, but not limited to, an automation script, a network protocol (such as ARP, ICMP, etc.), and a security policy matching method.
It should be noted that, the storage and management of the first mapping relationship and the second mapping relationship are not limited to form, but may be other data structures, such as hash table or tree structure, which is not limited in any way by the present application.
According to the embodiment of the application, the mode of combining the self-learning algorithm of the switch and the DHCP protocol is adopted, so that the network mapping relation of the network power supply equipment is automatically managed and maintained by the back-end equipment, the purposes of automatic identification and high-efficiency communication in a multi-cascade equipment environment are achieved, and the complexity and cost of the network management of the back-end equipment are reduced.
The method comprises the steps of receiving a request from a second network power supply device, wherein the request comprises a request from a second network power supply device, and the request comprises a request from the second network power supply device, wherein the request comprises a request from the second network power supply device, and the request comprises a request from the second network power supply device.
Optionally, in the embodiment of the present application, the preset application protocol refers to a network protocol used for searching and managing a front-end device, including but not limited to an ONVIF protocol, a PSIA protocol, a custom search protocol, and the like, where the preset application protocol allows the back-end device to actively initiate a search request to discover and manage the front-end device in a network, the target lan may be understood as a specific network environment where the back-end device communicates with a network power supply device, such as an office, a home, a warehouse, or any network communication area with an internal network connection, the online network power supply device refers to a front-end device that is currently running in the target lan and is capable of responding to a network search request, including but not limited to a POE camera, a network sensor, and the like, the network address refers to an IP address allocated to the network power supply device, the physical address refers to an MAC address allocated to the network power supply device, the port used on the back-end device is currently communicating with a certain network power supply device, and the port set of ports refers to a network port available for data transmission owned by the back-end device.
In an application scenario of smart city public security monitoring, for example, the NVR actively initiates a broadcast search through a preset application protocol (such as ONVIF) as a back-end device to determine a network power supply device (such as a POE IP camera installed on a street or square) currently on-line in a target local area network (such as a city monitoring network).
Further, under the condition that the online network power supply equipment is determined, the NVR can continuously acquire the network address (IP address), the physical address (MAC address) and the currently-communicating use port of each online network power supply equipment, intelligently analyze and determine the idle ports based on the current use port information and the set of all available ports of the NVR, reserve the idle ports for other network power supply equipment, and ensure the smoothness of network communication and the high efficiency of equipment management.
By adopting the mode of active searching and intelligent port management of the preset application protocol, the embodiment of the application realizes the technical effect of dynamically expanding the network data communication coverage range under the condition of not interrupting the existing data communication service, achieves the purpose of intelligently and efficiently configuring and managing the network power supply equipment, and further realizes the technical effect of improving the resource utilization rate.
The method for storing the first mapping relation and the second mapping relation in the record form corresponding to the back-end device to enable the target port to be bound with the first network power supply device, and the idle port to be bound with the second network power supply device comprises the steps of storing the first mapping relation and the second mapping relation in the record form corresponding to the back-end device, traversing the record form according to a first address pair and a second address pair, binding the target port with the first address pair, and binding the idle port with the second address pair, wherein the first address pair comprises the first network address and a first physical address with the mapping relation, and the second address pair comprises the second network address and a second physical address with the mapping relation.
Optionally, in an embodiment of the present application, the first address pair and the second address pair refer to a combination of a network address and a physical address that establish a mapping relationship.
It should be noted that in the embodiment of the present application, the first mapping relationship and the second mapping relationship may be stored in a record form according to different network architectures and configurations of the backend device, for example, a distributed database is used to efficiently store and retrieve a large amount of mapping information, and the record form may be queried based on multiple traversal search algorithms, including but not limited to linear search, binary search, hash search, and the like.
In one exemplary embodiment, assuming that a school is upgrading its video monitoring system, an NVR is used as a back-end device and is connected to a POE switch (target switch) through a target port, and a plurality of POE IP cameras (network power supply devices) are cascaded under the switch, then, the NVR generates a first mapping relationship and a second mapping relationship based on a switch self-learning algorithm, in other words, saves a network address (IP) and a physical address (MAC) of each POE IP camera and switch port information connected thereto to a record form.
Further, if a new POE IP camera is accessed, the NVR traverses the record form, and searches for a first address pair and a second address pair, that is, a combination of a network address and a physical address, so as to bind the target port with the first address pair and bind the idle port with the second address pair.
According to the embodiment of the application, a mode of combining the self-learning algorithm of the switch with the recording form is adopted, so that each network power supply device is ensured to have an independent communication port, the distribution of a data transmission path and network resources is optimized, the resource conflict among devices is avoided, on the other hand, the management flow of the back-end device is simplified, and the network operation and maintenance cost is reduced.
As an alternative scheme, the response that at least one network power supply device is connected with a back-end device through a target port corresponding to a target switch, a corresponding network address is set for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, the response comprises the steps of receiving a broadcast message initiated by the at least one network power supply device when a network port of the at least one network power supply device is inserted into a power supply network port of the back-end device, establishing connection between the back-end device and the target switch based on the broadcast message, distributing the target port to the target switch, determining that the at least one network power supply device is connected with the back-end device, and setting a corresponding network address for each network power supply device in the at least one network power supply device based on the dynamic host configuration protocol.
Optionally, in the embodiment of the present application, the power supply network port refers to a port with a POE power supply function on a back-end device, and the broadcast message may be understood as a discovery request, such as DHCPdiscover message, sent by the network power supply device when the network power supply device is started or when network configuration is required.
In an exemplary embodiment, it is assumed that an NVR is used as a back-end device, a POE switch (target switch) is connected through a power supply network port, and multiple POE IP cameras are cascaded under the switch to be used as network power supply devices, when any POE IP camera accesses to a POE port of the switch, a broadcast message (such as DHCPdiscover) will be automatically sent, after receiving these messages, a DHCP server on the NVR immediately responds, and based on the broadcast message, a connection between the NVR and the target switch is established, and at the same time, a target port is allocated to the switch, and for the NVR, a unique network address may also be allocated to each POE IP camera accessed through a DHCP protocol.
It should be noted that, in the embodiment of the present application, the allocation policy of the network address may include, but is not limited to, dynamic allocation, static allocation, or hybrid allocation.
According to the embodiment of the application, the dynamic host configuration protocol is combined with the switch self-learning algorithm, so that the network address of the network power supply equipment is automatically identified and configured by the back-end equipment, and the utilization rate of network resources is effectively improved.
In an exemplary embodiment, the method and the device can be applied to an application environment of a back-end device cascading POE front-end device, can solve the technical problem that POE devices (the network power supply devices) cannot be automatically online and can normally outflow at the same time, and can also receive data transmitted by a plurality of POE devices under a network hard disk video recorder with a single POE port.
Taking a network hard disk video recorder NVR as an example of a back-end device, fig. 5 is a device connection schematic diagram of an alternative device connection method according to an embodiment of the present application, as shown in fig. 5, the network hard disk video recorder may be provided with a plurality of common main network ports and POE network ports, where the network hard disk video recorder may be directly connected with a network camera through the common main network ports, and after the network hard disk video recorder receives an add request of a device, connection with the network camera is established to obtain a monitoring picture of the network camera, and furthermore, the network hard disk video recorder may also automatically add a POE camera (the above network power supply device) through the POE network ports to perform a monitoring service.
It should be noted that, in the related art, if the network hard disk video recorder needs to obtain video pictures of 3 POE cameras at the same time, 3 POE ports need to be provided by itself to access 3 POE cameras, that is, under the condition that no POE ports are added, the network hard disk video recorder cannot meet the requirement that a plurality of POE cameras automatically access services, even if an application scenario is as shown in fig. 3, a switch is set to cascade 3 POE cameras, the existing related art also only receives video pictures transmitted by one POE camera corresponding to the POE1 port by judging which POE camera is firstly broadcast, searching and replying to be on line and marking as the POE1 port, and resource contention inevitably occurs between the 3 POE cameras.
In other words, in the prior art, a POE device under a POE network card of a back-end device is searched by using an ARP (address resolution protocol) broadcast packet, then, a designated network address is set to a designated POE camera through ARP, whether the network address is connected or not can be judged through a ping instruction, if the network address is connected, the self-learning is considered to be successful, the pair of IP address and MAC address is recorded, one POE camera is accessed to a POE network port of a network hard disk video recorder, the pair of IP address and MAC address is bound to a port of the POE, and if another POE camera is accessed to another POE network port, a corresponding pair of IP address and MAC address is obtained in the same way and bound to a port of another POE.
Further, because different POE cameras are bound with different POE ports, the number of local video channels converted into the network hard disk video recorder by the corresponding POE ports can be multiple, however, if the device crosses the switch to perform data communication once and passes the window period, the ARP distribution IP mechanism will fail, in general, in the prior art, only one POE port of the back-end device can store the camera information of one POE, only one POE port can return one IP address and MAC information, which cannot meet the service requirement of the application layer.
In view of this technical problem, the present application proposes a way of using DHCP to allocate a network address and automatically gradually building a frame exchange table (the above-mentioned recording table) based on a self-learning algorithm of a switch, so as to solve the technical problem that a network power supply device cannot be simultaneously on line in the case that a back-end device cascades the network power supply device, and in addition, for a back-end device without multiple POE ports, one gateway device (the above-mentioned target switch) may be cascade-connected through one POE port, and multiple network power supply devices are downloaded and mounted by the gateway device, specifically:
S1, when a POE camera network port is inserted into a network hard disk video recorder POE network port, waiting for the POE camera to initiate a DHCP broadcast message (in the stages of DHCP discovery (DHCPDISCOVER), providing (DHCPOFFER), requesting (DHCPREQUEST) and confirming (DHCPACK)), searching a DHCP server, namely a DHCP server end of the network hard disk video recorder, and allocating an IP address to the POE camera for replying by the network hard disk video recorder, and waiting for the POE camera to respond to successfully set the IP address;
S2, for a switch cascaded by POE network ports of the network hard disk video recorder, the IP address and the MAC address of the POE camera can be obtained in a message with successful IP address setting, the MAC-IP pair is bound to the POE port, and if another POE camera is accessed to the switch, the information of the port switch of the same POE for MAC and IP discovery can be obtained and also bound to the POE port.
S3, because the first POE camera and the second POE camera are both bound with the same POE port, the corresponding POE port is converted into a local video channel C1 of the network hard disk video recorder, the local video channel C1 can be added to the POE camera on line first and recorded as POE1-1, the POE camera on line later can search and determine a channel corresponding to an idle port (not POE port and POE port can be both) to add a pull stream service number POE1-2, the pull stream preview service is carried out under different channels under the cascade condition, the technical problem that the network cameras of different network segments can not be automatically added in time through other schemes is solved, and the network port positioning range corresponding to the POE camera is primarily narrowed according to the number POE1-1 and the like.
It should be noted that, aiming at the technical problems that the back-end device and the camera are in the same local area network but different in network segments, even if the operation such as stream pulling and configuration acquisition is not possible, the embodiment of the application can solve the problems by controlling the network address of the camera to be modified to be in the same network segment with the POE network port, thereby realizing the operations such as automatic addition, stream pulling and configuration acquisition preview.
It will be appreciated that in the specific embodiments of the present application, related data such as user information is involved, and when the above embodiments of the present application are applied to specific products or technologies, user permissions or consents need to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
According to another aspect of the embodiment of the present application, there is also provided a connection device for implementing the connection method of the device. As shown in fig. 6, the apparatus includes:
A setting module 602, configured to set, in response to the at least one network power supply device being connected to the backend device through a target port corresponding to the target switch, a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol;
A generating module 604, configured to generate a first network address and a second network address in a case where the at least one network power supply device includes a first network power supply device and a second network power supply device, where the first network address and the second network address are in a same network segment;
a binding module 606, configured to bind, when the first network power supply device establishes a connection with the back-end device before the second network power supply device, the target port with the first network power supply device based on the first network address, and bind, based on the second network address, the idle port with the second network power supply device, where the idle port represents a port that does not participate in data transmission in a plurality of ports corresponding to the back-end device;
and a pulling module 608, configured to pull the preview frames of the first network power supply device and the second network power supply device based on the target port and the idle port.
As an alternative, the device is used for responding that at least one network power supply device is connected with the back-end device through a target port corresponding to a target switch, setting a corresponding network address for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, establishing connection between the back-end device and the target switch, distributing the target port for the target switch, creating a server on the back-end device according to the dynamic host configuration protocol, managing a network address pool through the server to distribute network addresses to the network power supply devices requesting connection, responding that the network power supply device is connected with the back-end device through the target port, negotiating with the network power supply device based on the dynamic host configuration protocol, and setting the corresponding network addresses for the network power supply devices.
As an alternative scheme, the device is used for binding a target port with first network power supply equipment based on a first network address and binding an idle port with second network power supply equipment based on a second network address when the first network power supply equipment is connected with the back-end equipment before the second network power supply equipment is connected with the back-end equipment, generating a first mapping relation between the first network address and the target port based on a switch self-learning algorithm when the first network power supply equipment is connected with the back-end equipment, acquiring the idle port when the second network power supply equipment is connected with the back-end equipment, generating a second mapping relation between the second network address and the idle port based on the switch self-learning algorithm, and storing the first mapping relation and the second mapping relation in a record form corresponding to the back-end equipment so that the target port is bound with the first network power supply equipment and the idle port is bound with the second network power supply equipment.
The device is used for acquiring the idle port under the condition that the second network power supply equipment and the back-end equipment are connected, and the idle port is determined based on the use port and a port set configured for the back-end equipment.
The device is used for storing a first mapping relation and a second mapping relation to a record form corresponding to the back-end device so that the target port is bound with the first network power supply device, the idle port is bound with the second network power supply device, the first mapping relation and the second mapping relation are stored to the record form corresponding to the back-end device, traversing is carried out on the record form according to a first address pair and a second address pair, the target port is bound with the first address pair, and the idle port is bound with the second address pair, wherein the first address pair comprises a first network address and a first physical address with the mapping relation, and the second address pair comprises a second network address and a second physical address with the mapping relation.
As an alternative scheme, the device is used for responding to the fact that at least one network power supply device is connected with the back-end device through a target port corresponding to the target switch, setting a corresponding network address for each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol, receiving a broadcast message initiated by the at least one network power supply device when a network port of the at least one network power supply device is inserted into a power supply network port of the back-end device, establishing connection between the back-end device and the target switch based on the broadcast message, distributing the target port for the target switch, and determining that the at least one network power supply device is connected with the back-end device, and setting the corresponding network address for each network power supply device in the at least one network power supply device based on the dynamic host configuration protocol.
In the present embodiment, the term "module" or "unit" refers to a computer program or a part of a computer program having a predetermined function and working together with other relevant parts to achieve a predetermined object, and may be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Also, a processor (or multiple processors or memories) may be used to implement one or more modules or units. Furthermore, each module or unit may be part of an overall module or unit that incorporates the functionality of the module or unit.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
Fig. 7 schematically shows a block diagram of a computer system of an electronic device for implementing an embodiment of the application.
It should be noted that, the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a central processing unit 701 (Central Processing Unit, CPU) which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory 702 (ROM) or a program loaded from a storage section 708 into a random access Memory 703 (Random Access Memory, RAM). In the random access memory 703, various programs and data necessary for the system operation are also stored. The central processing unit 701, the read only memory 702, and the random access memory 703 are connected to each other via a bus 704. An Input/Output interface 705 (i.e., an I/O interface) is also connected to bus 704.
Connected to the input/output interface 705 are an input section 706 including a keyboard, a mouse, and the like, an output section 707 including a Cathode Ray Tube (CRT), a Liquid crystal display (Liquid CRYSTAL DISPLAY, LCD), and the like, and a speaker, and the like, a storage section 708 including a hard disk, and the like, and a communication section 709 including a network interface card such as a local area network card, a modem, and the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the input/output interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, the processes described in the various method flowcharts may be implemented as computer software programs according to embodiments of the application. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The computer programs, when executed by the central processor 701, perform the various functions defined in the system of the present application.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. When executed by the central processor 701, performs the various functions provided by embodiments of the present application.
According to still another aspect of the embodiment of the present application, there is also provided an electronic device for implementing the connection method of the device, which may be the terminal device or the server shown in fig. 1. The present embodiment is described taking the electronic device as a terminal device as an example. As shown in fig. 8, the electronic device comprises a memory 802 and a processor 804, the memory 802 having stored therein a computer program, the processor 804 being arranged to perform the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the method in the embodiments of the present application by a computer program.
Alternatively, it will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 8 is merely illustrative, and that fig. 8 is not intended to limit the configuration of the electronic device described above. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
The memory 802 may be used to store software programs and modules, such as program instructions/modules corresponding to the connection method and apparatus of the device in the embodiment of the present application, and the processor 804 executes the software programs and modules stored in the memory 802, thereby performing various functional applications and data processing, that is, implementing the connection method of the device. Memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 802 may further include memory remotely located relative to processor 804, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 802 may be used to store, but is not limited to, information such as video pictures of the network power supply device. As an example, as shown in fig. 8, the memory 802 may include, but is not limited to, a setting module 602, a binding module 604, a generating module 606, and a pulling module 608 in a connection device including the apparatus. In addition, other module units in the connection device of the above apparatus may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 806 is used to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission means 806 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices and routers via a network cable to communicate with the internet or a local area network. In one example, the transmission device 806 is a Radio Frequency (RF) module for communicating wirelessly with the internet.
The electronic device further includes a display 808 for displaying a video picture of the network power supply device, and a connection bus 810 for connecting the respective module parts in the electronic device.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the plurality of nodes through a network communication. The nodes may form a peer-to-peer network, and any type of computing device, such as a server, a terminal, etc., may become a node in the blockchain system by joining the peer-to-peer network.
According to an aspect of the present application, there is provided a computer-readable storage medium, from which a processor of an electronic device reads the computer instructions, which the processor executes, so that the electronic device performs a method of connecting devices provided in various alternative implementations of the connection aspect of the devices described above.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a program for executing the method in the embodiments of the present application.
Alternatively, in this embodiment, all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing the terminal device related hardware, and the program may be stored in a computer readable storage medium, where the storage medium may include a flash disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied essentially or partly in the form of a software product or all or part of the technical solution, which is stored in a storage medium, comprising several instructions for causing one or more electronic devices to perform all or part of the steps of the method described in the various embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed application program may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
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 on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (7)

1. A method of connecting devices, comprising:
In response to at least one network power supply device being connected with a back-end device through a target port corresponding to a target switch, automatically identifying and configuring a network address corresponding to each of the at least one network power supply device based on a dynamic host configuration protocol, wherein the at least one network power supply device is configured to simultaneously implement data transmission and online through the target port;
generating a first network address and a second network address in a case that the at least one network power supply device includes a first network power supply device and a second network power supply device, wherein the first network address and the second network address are in a same network segment as the target port, and the first network power supply device and the second network power supply device are the network power supply devices which are in a same local area network as the backend device but are different in network segment;
Binding the target port with the first network power supply equipment based on the first network address under the condition that the first network power supply equipment establishes connection with the back-end equipment before the second network power supply equipment, and binding an idle port with the second network power supply equipment based on the second network address, wherein under the condition that the priority of the first network power supply equipment is higher than that of the second network power supply equipment, the first network power supply equipment is determined to establish connection with the back-end equipment before the second network power supply equipment, and the idle port represents a port which does not participate in data transmission in a plurality of ports corresponding to the back-end equipment;
Pulling preview pictures of the first network power supply equipment and the second network power supply equipment based on the target port and the idle port;
The method comprises the steps of binding a target port with first network power supply equipment based on a first network address and binding an idle port with second network power supply equipment based on a second network address when the first network power supply equipment is connected with the back-end equipment before the second network power supply equipment is connected with the back-end equipment, generating a first mapping relation between the first network address and the target port based on a switch self-learning algorithm when the first network power supply equipment is connected with the back-end equipment, acquiring the idle port when the second network power supply equipment is connected with the back-end equipment, generating a second mapping relation between the second network address and the idle port based on the switch self-learning algorithm, and storing the first mapping relation and the second mapping relation into a record form corresponding to the back-end equipment so as to bind the target port with the first network power supply equipment and the idle port with the second network power supply equipment;
The method comprises the steps of receiving a request from a back-end device, wherein the request comprises a first network power supply device, a second network power supply device, a network address, a physical address and a port used by the first network power supply device, and acquiring the idle port under the condition that the second network power supply device and the back-end device are connected;
The method comprises the steps of storing the first mapping relation and the second mapping relation to a record form corresponding to the back-end equipment, so that the target port is bound with the first network power supply equipment, storing the first mapping relation and the second mapping relation to the record form corresponding to the back-end equipment, traversing the record form according to a first address pair and a second address pair, binding the target port with the first address pair, and binding the idle port with the second address pair, wherein the first address pair comprises the first network address and a first physical address with the mapping relation, and the second address pair comprises the second network address and a second physical address with the mapping relation.
2. The method of claim 1, wherein the setting a corresponding network address for each of the at least one network power device based on a dynamic host configuration protocol in response to the at least one network power device being connected to the backend device through a corresponding destination port of the destination switch comprises:
establishing connection between the back-end equipment and the target switch, and distributing the target port for the target switch;
Creating a server on the back-end equipment according to the dynamic host configuration protocol, and managing a network address pool through the server so as to distribute network addresses to the network power supply equipment requesting connection;
and responding to the network power supply equipment to be connected with the back-end equipment through the target port, negotiating with the network power supply equipment based on the dynamic host configuration protocol, and setting a corresponding network address for the network power supply equipment.
3. The method of claim 1, wherein the setting a corresponding network address for each of the at least one network power device based on a dynamic host configuration protocol in response to the at least one network power device being connected to the backend device through a corresponding destination port of the destination switch comprises:
Receiving a broadcast message initiated by the at least one network power supply device under the condition that the network port of the at least one network power supply device is inserted into the power supply network port of the back-end device;
establishing connection between the back-end equipment and the target switch based on the broadcast message, distributing the target port to the target switch, and determining that the at least one network power supply equipment is connected with the back-end equipment;
and setting a corresponding network address for each of the at least one network power supply device based on the dynamic host configuration protocol.
4. A device for connecting equipment, comprising:
a setting module, configured to automatically identify and configure a network address corresponding to each of at least one network power supply device based on a dynamic host configuration protocol in response to the at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, where the at least one network power supply device is configured to simultaneously implement data transmission and online through the target port;
a generation module configured to generate a first network address and a second network address in a case where the at least one network power supply device includes a first network power supply device and a second network power supply device, where the first network address and the second network address are in a same network segment as the target port, and the first network power supply device and the second network power supply device are the network power supply devices that are in a same local area network as the backend device but are different in network segment;
A binding module, configured to bind, when the first network power supply device establishes a connection with the backend device before the second network power supply device, the target port with the first network power supply device based on the first network address, and bind, when the first network power supply device has a higher priority than the second network power supply device, an idle port with the second network power supply device, where the first network power supply device establishes a connection with the backend device before the second network power supply device, and the idle port indicates a port that does not participate in data transmission among a plurality of ports corresponding to the backend device;
a pulling module, configured to pull preview frames of the first network power supply device and the second network power supply device based on the target port and the idle port;
The binding module is further used for generating a first mapping relation between the first network address and the target port based on a switch self-learning algorithm under the condition that the first network power supply equipment and the back-end equipment are connected, acquiring the idle port, and generating a second mapping relation between the second network address and the idle port based on the switch self-learning algorithm under the condition that the second network power supply equipment and the back-end equipment are connected;
The device is also used for acquiring the idle port under the condition that the second network power supply equipment and the back-end equipment are connected, wherein the broadcast search is initiated through a preset application protocol, and the online network power supply equipment in a target local area network is determined;
The device is further used for storing the first mapping relation and the second mapping relation to a record form corresponding to the back-end device so that the target port is bound with the first network power supply device, the idle port is bound with the second network power supply device, the first mapping relation and the second mapping relation are stored to the record form corresponding to the back-end device, traversing is conducted in the record form according to a first address pair and a second address pair, the target port is bound with the first address pair, the idle port is bound with the second address pair, the first address pair comprises the first network address and a first physical address with the mapping relation, and the second address pair comprises the second network address and a second physical address with the mapping relation.
5. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored computer program, wherein the computer program is executable by an electronic device to perform the method of any one of claims 1 to 3.
6. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method as claimed in any one of claims 1 to 3.
7. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of the claims 1 to 3 by means of the computer program.
CN202411870244.5A 2024-12-18 2024-12-18 Device connection method and device, storage medium and electronic device Active CN119342086B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411870244.5A CN119342086B (en) 2024-12-18 2024-12-18 Device connection method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411870244.5A CN119342086B (en) 2024-12-18 2024-12-18 Device connection method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN119342086A CN119342086A (en) 2025-01-21
CN119342086B true CN119342086B (en) 2025-05-16

Family

ID=94267846

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411870244.5A Active CN119342086B (en) 2024-12-18 2024-12-18 Device connection method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN119342086B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117896495A (en) * 2023-12-28 2024-04-16 深圳市天视通技术有限公司 Transmission configuration method and system of network camera, electronic equipment and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112910986B (en) * 2021-01-28 2022-07-08 浙江大华技术股份有限公司 Network video recorder channel management method and network video recorder
CN113573023B (en) * 2021-07-27 2022-12-20 长视科技股份有限公司 Camera network distribution method and device, computer equipment and storage medium
US12170644B2 (en) * 2022-02-23 2024-12-17 Cisco Technology, Inc. Binding flows to unique addresses or ports
CN115801709B (en) * 2023-01-20 2023-05-23 苏州浪潮智能科技有限公司 Method and device for managing route MAC address, electronic equipment and storage medium
CN116684277B (en) * 2023-06-30 2025-09-02 苏州浪潮智能科技有限公司 Method and device for determining corresponding relationship between network card and gateway
CN117915048A (en) * 2024-01-18 2024-04-19 深圳市锐明技术股份有限公司 Equipment management method and device, vehicle-mounted terminal equipment and storage medium
CN118250159A (en) * 2024-01-23 2024-06-25 北京捷杰西科技股份有限公司 Automatic mapping method for multiple network interface devices of same network segment in Linux environment
CN118842875A (en) * 2024-06-21 2024-10-25 杭州萤石软件有限公司 Network communication method, network video recorder and intelligent monitoring system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117896495A (en) * 2023-12-28 2024-04-16 深圳市天视通技术有限公司 Transmission configuration method and system of network camera, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN119342086A (en) 2025-01-21

Similar Documents

Publication Publication Date Title
US9847967B2 (en) DHCP proxy in a subscriber environment
US8099517B2 (en) Assigning priority to network traffic at customer premises
US9300627B2 (en) System and method for automatic routing of dynamic host configuration protocol (DHCP) traffic
US8125993B2 (en) Network element having a DHCP lease timer
US11343224B2 (en) Method for renewing IP address and apparatus
CN107666419B (en) Virtual broadband access method, controller and system
CN102882989B (en) A kind of method and apparatus of many NVR monitoring network allocation IP address
CN104601959A (en) Video monitoring system and method for rapidly accessing web camera
KR100657316B1 (en) A fast handover method in DHCPv4, handover apparatus thereof and recording medium thereof
CN107241454B (en) A kind of method, apparatus that realizing address administration, aaa server and SDN controller
JP2018530256A (en) User migration
CN106878480B (en) DHCP service process sharing method and device
JP2003229856A (en) Communication equipment and communication control method
JP5424007B2 (en) Method for providing information, home gateway and home network system
CN112689029A (en) Method, device and equipment for acquiring IP address of group user
CN105979202B (en) Data transmission method and device
EP3706373B1 (en) Establishing a vxlan between a wireless access point and a node
CN104104749B (en) The distribution method and device of a kind of tunnel IP address
CN106878481B (en) Method, device and system for acquiring Internet Protocol (IP) address
EP3048756B1 (en) Management method and apparatus for dynamic host configuration protocol server and relay
CN119342086B (en) Device connection method and device, storage medium and electronic device
CN102130788B (en) Method, device and system for configuring monitoring terminal
US20130086259A1 (en) Method for acquiring an ip address and network access device
CN111163463A (en) Method, device, equipment and storage medium for accessing wireless equipment to router
CN107124307B (en) Management VLAN (virtual local area network) switching method and device

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