Device connection method and device, storage medium and electronic device

Through the DHCP protocol and switch self-learning algorithm, network addresses are set for multiple network power supply devices and bound ports, solving the problem of limited POE ports of back-end devices, realizing automatic online and data transmission between multiple devices, avoiding resource competition.

CN119342086BActive Publication Date: 2025-05-16ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411870244.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-05-16
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Each POE port of the backend device is limited by a limited data transmission channel, which can only effectively support the connection requirements of a single front-end device, making it difficult to cope with the scenario where multiple network powered devices upload data at the same time, resulting in resource competition.

Method used

The network address is set for each network power supply device through Dynamic Host Configuration Protocol (DHCP), and the switch self-learning algorithm is used to bind the target port and the idle port, so as to realize the automatic identification and configuration of multiple network power supply devices, and flexibly utilize the idle ports of the backend device.

Benefits of technology

It realizes automatic online, preview and data transmission of multiple network powered devices at the same time, solving the problem of resource competition and ensuring that each device communicates independently and stably with the back-end device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342086B_ABST
    Figure CN119342086B_ABST
Patent Text Reader

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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method and apparatus for connecting devices, a storage medium, and an electronic device. Background Art

[0002] In the related art, data transmission is often required between back-end devices (for example, network video recorders (NVRs), etc.) and network power supply devices deployed at the front end. The back-end devices are equipped with POE (Power over Ethernet) ports, which can be used to simultaneously transmit data and power the network power supply devices. However, since the number of data transmission channels of each POE port of the back-end device is limited, it can only support the connection of one front-end device, and cannot process data uploaded by multiple network power supply devices at the same time. In other words, each POE port of the back-end device is limited by limited data transmission channels and can only effectively support the connection requirements of a single front-end device. It is difficult to cope with the scenario where multiple network power supply devices upload data at the same time.

[0003] In summary, in the process of data transmission between the back-end device and multiple network power supply devices, there is an inevitable technical problem of resource competition.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a device connection method and apparatus, a storage medium, and an electronic device to at least solve the technical problem of resource contention that occurs during data transmission between a back-end device and multiple network power supply devices.

[0006] According to one aspect of an embodiment of the present application, a device connection method is provided, comprising: in response to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch, setting a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol; 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, generating a first network address and a second network address, wherein the first network address and the second network address are in the same network segment; in a case where the first network power supply device establishes a connection with the back-end device before the second network power supply device, binding the target port to the first network power supply device based on the first network address, and binding an idle port to the second network power supply device based on the second network address, wherein the idle port represents a port that does not participate in data transmission among a plurality of ports corresponding to the back-end device; and pulling 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.

[0007] According to another aspect of an embodiment of the present application, a device connection apparatus is also provided, including: a setting module, used to 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 in response to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch; a generation module, used to generate a first network address and a second network address when 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 the same network segment; a binding module, used to bind the target port to the first network power supply device based on the first network address when the first network power supply device establishes a connection with the back-end device before the second network power supply device, and to bind an idle port to the second network power supply device based on the second network address, wherein the idle port represents a port that does not participate in data transmission among the multiple ports corresponding to the back-end device; a pulling module, used to pull 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.

[0008] Optionally, the device is used to set a corresponding network address for each of the at least one network power supply device based on the dynamic host configuration protocol in response to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch in the following manner: establishing a connection between the back-end device and the target switch, and allocating the target port to the target switch; creating a server on the back-end device in accordance with the dynamic host configuration protocol, and managing a network address pool through the server to allocate network addresses to network power supply devices requesting connection; in response to the network power supply device being connected to the back-end device through the target port, negotiating with the network power supply device based on the dynamic host configuration protocol to set a corresponding network address for the network power supply device.

[0009] Optionally, the device is used to bind the target port to the first network power supply device based on the first network address, and bind 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 establishes a connection with the back-end device in the following manner: when the first 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 second network power supply device establishes a connection with the back-end device, obtain the idle port; generate a second mapping relationship between the second network address and the idle port based on the switch self-learning algorithm; and save 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 to the first network power supply device, and the idle port is bound to the second network power supply device.

[0010] Optionally, the device is used to obtain the free port when the second network power supply device establishes a connection with the back-end device in the following manner: initiating a broadcast search through a preset application protocol to determine an online network power supply device in a target local area network; determining the network address, physical address and used port corresponding to the online network power supply device; and determining the free port based on the used port and the port set configured for the back-end device.

[0011] Optionally, the device is used to save the first mapping relationship and the second mapping relationship to a record form corresponding to the back-end device in the following manner so that the target port is bound to the first network power supply device, and the idle port is bound to the second network power supply device: save the first mapping relationship and the second mapping relationship to the record form corresponding to the back-end device; traverse the record form according to the first address pair and the second address pair, bind the target port to the first address pair, and bind the idle port to the second address pair, wherein the first address pair includes the first network address and the first physical address having a mapping relationship, and the second address pair includes the second network address and the second physical address having a mapping relationship.

[0012] Optionally, the device is used to respond to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch, and to set a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol in the following manner: when 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, receive a broadcast message initiated by the at least one network power supply device; establish a connection between the back-end device and the target switch based on the broadcast message, and allocate the target port to the target switch to determine that the at least one network power supply device is connected to the back-end device; and set a corresponding network address for each of the at least one network power supply device based on the dynamic host configuration protocol.

[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned device connection method when running.

[0014] According to another aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a 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 of the above device.

[0015] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the device connection method through the computer program.

[0016] In an embodiment of the present application, in response to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch, a corresponding network address is set for each of the at least one network power supply device based on a dynamic host configuration protocol; in a case where at least one network power supply device includes a first network power supply device and a second network power supply device, a first network address and a second network address in the same network segment are generated; in a case where the first network power supply device establishes a connection with the back-end device before the second network power supply device, the target port is bound to the first network power supply device based on the first network address, and the idle port is bound to the second network power supply device based on the second network address; based on the target port and the idle port, a first network address and a second network address are generated; in a case where the first network power supply device establishes a connection with the back-end device before the second network power supply device, the first network address and the idle port are bound to the second network power supply device based on the first ... a first network address and a second network address are generated; in a case where the first network power supply device The preview screen method of the first network power supply device and the second network power supply device, by intelligently allocating the network address corresponding to the back-end device and flexibly utilizing its idle port, not only realizes the automatic identification and configuration of multiple front-end deployed network power supply devices, but also ensures that each network power supply device can independently and stably communicate with the NVR. Furthermore, while realizing the integration of data transmission and power supply between the back-end device and each network power supply device, there is no need for resource competition between the various network power supply devices. Therefore, the technical effect of multiple network power supply devices being able to automatically go online, preview and transmit data at the same time is achieved, thereby solving the technical problem of resource competition arising from data transmission between the back-end device and multiple network power supply devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a schematic diagram of an application environment of an optional device connection method according to an embodiment of the present application;

[0019] Figure 2 is a flow chart of an optional device connection method according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an optional device connection method according to an embodiment of the present application;

[0021] Figure 4 is a flow chart of an optional device connection method according to an embodiment of the present application;

[0022] Figure 5 This is a schematic diagram of device connection according to an optional device connection method of an embodiment of the present application;

[0023] Figure 6is a schematic structural diagram of a connection device of an optional device according to an embodiment of the present application;

[0024] Figure 7 is a schematic structural diagram of a connection product of an optional device according to an embodiment of the present application;

[0025] Figure 8 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] The present application is described below in conjunction with embodiments:

[0029] According to one aspect of an embodiment of the present application, a method for connecting a device is provided. Optionally, in this embodiment, the method for connecting the device can be applied to: Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal device 103 via a network, and can be used to provide services for the terminal device or an application 107 installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 may be set up on the server or independently of the server to provide data storage services for the server 101, for example, a game data storage server. The above-mentioned network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The terminal device 103 may be a terminal configured with an application, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (Virtual Reality, VR for short) terminal, an augmented reality (Augmented Reality, AR for short) terminal, a mixed reality (Mixed Reality, MR for short) terminal and other computer devices. The above-mentioned server may be a single server, or a server cluster consisting of multiple servers, or a cloud server.

[0030] Combination Figure 1 As shown, the connection method of the above-mentioned device can be executed by an electronic device, which can be a terminal device or a server. The connection method of the above-mentioned device can be implemented by the terminal device or the server respectively, or by the terminal device and the server together.

[0031] The above is only an example and is not specifically limited in this embodiment.

[0032] Optionally, as an optional implementation, as Figure 2 As shown, the connection method of the above device includes:

[0033] S202, in response to at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, setting a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol;

[0034] Optionally, in an embodiment of the present application, the above-mentioned network power supply device refers to a device that receives power and transmits data through an Ethernet cable, including but not limited to POE cameras, network sensors, etc.; the above-mentioned target switch refers to a network device located between the back-end device and the network power supply device, which is used to realize data forwarding between the back-end device and the network power supply device, including but not limited to a layer 2 or layer 3 switch; the above-mentioned back-end device is a device for data storage and processing, including but not limited to a network video recorder (NVR), a server, various intelligent terminal devices, etc., which are responsible for receiving and managing data uploaded by the front-end device; the above-mentioned target port refers to the port on the target switch that is directly connected to the back-end device, which is used to interact with the above-mentioned network power supply device for data; the above-mentioned dynamic host configuration protocol, namely DHCP, is a protocol that allows a server to dynamically allocate network configuration parameters (such as IP addresses) to a client.

[0035] For example, in the application scenario of the IP monitoring system, when an NVR is connected to a target switch through a target port and multiple POE cameras (network power supply devices) are connected to the switch, the DHCP server on the NVR responds to the access of these multiple POE cameras and automatically allocates a unique IP address to each POE camera. During the allocation process, the NVR intelligently binds the IP address to the switch port according to the order in which the POE cameras are connected and the current port usage, ensuring that each of the multiple POE cameras can obtain an IP address in the same network segment, thereby forming a clear device mapping on the NVR and realizing automatic online and data transmission.

[0036] In an exemplary embodiment, Figure 3 is a schematic diagram of an optional device connection method according to an embodiment of the present application, such as Figure 3 As shown, it includes a network power supply device, a back-end device and a target switch. Three POE cameras are connected to the target switch as the above-mentioned network power supply device. The target switch and the back-end device are connected through a target port.

[0037] It should be noted that in the embodiment of the present application, the process of the above-mentioned network power supply device obtaining the network address through DHCP can be automatically triggered when the device is first connected, or it can be re-requested regularly to adapt to changes in the network environment or reconfiguration of the device. The present application does not impose any limitations on this.

[0038] It should also be noted that the application of the above-mentioned dynamic host configuration protocol is not limited to IP address allocation, but can also be extended to other network configuration parameters, such as subnet mask, default gateway, etc., thereby providing users with more comprehensive network equipment automatic configuration services, and the above-mentioned target switch can be any type that can support DHCP relay or proxy functions, so that the NVR can indirectly allocate addresses for the network power supply devices connected thereto. At the same time, the ports of the back-end equipment can include but are not limited to POE ports, or other network ports that can transmit data.

[0039] S204, generating a first network address and a second network address when 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 the same network segment;

[0040] Optionally, in an embodiment of the present application, the at least one network power supply device refers to multiple network devices powered by Ethernet, including but not limited to POE cameras, Internet phones, wireless access points, etc.; the first network power supply device and the second network power supply device represent network power supply devices connected to the back-end device through the target switch; the first network address and the second network address refer to network addresses generated for the first network power supply device and the second network power supply device for network communication, and the first network address and the second network address are located in the same network segment.

[0041] For example, in the application scenario of a video surveillance system, it is assumed that a network hard disk recorder (backend device) is connected to multiple network power supply devices (including a first network power supply device and a second network power supply device) through a POE switch (target switch). When the first network power supply device (such as POE camera A) is connected to the POE switch, the DHCP server on the network hard disk recorder immediately responds and assigns a specific IP address to POE camera A, namely, the first network address.

[0042] Similarly, when the second network power supply device (such as POE camera B) is also connected to the same POE switch, the network hard disk recorder continues to generate a second network address for POE camera B based on the DHCP protocol, which is also located in the network segment, ensuring that POE camera A and POE camera B can communicate with the network hard disk recorder independently, and automatic online and data transmission can be achieved without additional network configuration adjustments, including but not limited to video data pulling and monitoring.

[0043] It should be noted that, in the embodiments of the present application, the same network segment refers to a group of IP addresses with the same network prefix, and these IP addresses can communicate directly with each other without being forwarded by an intermediate routing device; in addition, the embodiments of the present application can dynamically generate a first network address and a second network address. In other words, each time a network power supply device requests access to a back-end device, a corresponding network address can be automatically assigned to the network power supply device, or it can be pre-planned, including but not limited to pre-setting an address pool based on the access order or type of the device, so as to achieve more refined network resource management.

[0044] It should also be noted that the above-mentioned back-end equipment is not only used for network address allocation of network power supply equipment, but can also be used for equipment status monitoring, fault diagnosis, security policy implementation, etc. of network power supply equipment. This application does not make any specific limitations on the access order and type of the above-mentioned network power supply equipment.

[0045] S206, in the case where the first network power supply device establishes a connection with the backend device before the 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, wherein the idle port refers to a port that does not participate in data transmission among the multiple ports corresponding to the backend device;

[0046] Optionally, in an embodiment of the present application, the above-mentioned idle port refers to a port in the above-mentioned back-end 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.

[0047] For example, in a video surveillance system, it is assumed that the NVR (backend device) is connected to a POE switch (target switch) through a target port. When the first POE camera (as the first network power supply device) is connected to the POE switch for the first time and sends a DHCP request, the DHCP server on the NVR responds and assigns it a first network address. The NVR binds the target port to the network address of the first POE camera to achieve automatic device identification and directional transmission of data streams. Then, when the second POE camera (as the second network power supply device) is connected to the same POE switch, the NVR automatically detects a new device connection request. Based on the second network address, the NVR binds the currently unoccupied idle port to the second POE camera to ensure that the second device can also independently communicate data with the NVR.

[0048] It should be noted that the port allocation and device binding strategy of the above-mentioned back-end devices can also be carried out according to the specific network environment and device type. For example, when receiving connection requests from multiple network power supply devices at the same time, the above-mentioned back-end device can give priority to using high-bandwidth ports and high-definition network power supply devices for binding to optimize video transmission quality, and then allocate other network power supply devices to idle ports for binding; in addition, the back-end device can have multiple network interfaces, and different interfaces can serve network power supply devices of different types or functions.

[0049] In other words, the "priority" connection of the back-end device can be based on the order of access time, and may also be adjusted based on the device priority or network policy to ensure that important or high-demand network power supply devices can get priority service.

[0050] S208: Pull preview images of the first network power supply device and the second network power supply device based on the target port and the idle port.

[0051] Optionally, in an embodiment of the present application, the preview screen refers to a video stream or image captured by the network power supply device and transmitted to the back-end device.

[0052] For example, in the application scenario of home monitoring system expansion, it is assumed that the home user already has an NVR (backend device) and is connected to a POE switch (target switch) through its target port. When the user first connects an IP camera (as the first network power supply device) to the POE switch, the NVR assigns a network address to the IP camera based on DHCP, then establishes communication with the new device through the target port, and starts to pull the real-time video stream transmitted by the camera, that is, the preview screen, and presents it on the monitoring screen connected to the NVR;

[0053] Then, in order to further expand the monitoring range, the user connects the second IP camera (as the second network power supply device) to the same POE switch. At this time, the NVR automatically detects the new device connection, and after assigning a network address to the second camera based on DHCP, it uses the free port to establish a connection with the second camera and also starts to pull its preview screen.

[0054] In an exemplary embodiment, Figure 4 is a flow chart of an optional device connection method according to an embodiment of the present application. In a video surveillance application scenario, for a backend device, such as Figure 4 As shown:

[0055] S402, start;

[0056] S404, the backend device initiates a broadcast search through an application protocol (which may be a user-defined search protocol or a standard onvif search protocol, etc.);

[0057] S406, the online network power supply device (including the network power supply device) in the network responds;

[0058] S408, the backend device stores all online device reply information (including physical address, network address information, port used for pulling streams and other necessary information records) in mapping table 1;

[0059] For network power supply equipment, such as Figure 4 As shown:

[0060] S410, the network power supply device starts and finds a DHCP (Dynamic Host Configuration Protocol) server;

[0061] S412, the network power supply device negotiates with the DHCP process of the back-end device to allocate a specified network address;

[0062] S414, similar to the switch self-learning algorithm, automatically establishes multiple mapping relationships<MAC,IP> Bind between (physical address, network address) and port;

[0063] S416, storing the mapping relationship in mapping table 2, where mapping table 2 includes mapping relationships between multiple pairs of physical addresses and network addresses;

[0064] It should be noted that any step in the above steps S402 to S408 and any step in the above steps S410 to S416 can be executed simultaneously without any order of precedence. For example, step S402 and step S410 can be executed at the same time, and this application does not limit this.

[0065] Furthermore, after obtaining the above mapping table 1 and mapping table 2, Figure 4 Perform the following operations as shown:

[0066] S418, using MAC-IP as a key value to compare mapping table 1 with mapping table 2. If the comparison is successful, it is a network power supply device, and subsequent processing is performed according to the remaining information of mapping table 1 and mapping table 2 (the hardware port, stream pulling port and stream pulling protocol of the network power supply device are used to preview the stream pulling, realize the automatic online function, and add it to the corresponding port channel);

[0067] S420, end.

[0068] Through the embodiments of the present application, in response to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch, a corresponding network address is set for each of the at least one network power supply device based on a dynamic host configuration protocol; in a case where at least one network power supply device includes a first network power supply device and a second network power supply device, a first network address and a second network address in the same network segment are generated; in a case where the first network power supply device establishes a connection with the back-end device before the second network power supply device, the target port is bound to the first network power supply device based on the first network address, and the idle port is bound to the second network power supply device based on the second network address; based on the target port and the idle port, the first network address is pulled By intelligently allocating the network addresses corresponding to the back-end devices and flexibly utilizing their idle ports, it not only realizes the automatic identification and configuration of multiple front-end deployed network power supply devices, but also ensures that each network power supply device can achieve independent and stable communication with the NVR. Furthermore, while realizing the integration of data transmission and power supply between the back-end devices and each network power supply device, there is no need for resource competition between the network power supply devices. Thus, the technical effect of multiple network power supply devices being able to automatically go online, preview and transmit data at the same time is achieved, thereby solving the technical problem of resource competition occurring in the process of data transmission between the back-end devices and multiple network power supply devices.

[0069] As an optional solution, in response to at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, 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 backend device and the target switch, and allocating the target port to the target switch; creating a server on the backend device in accordance with the dynamic host configuration protocol, and managing a network address pool through the server to allocate network addresses to network power supply devices requesting connection; in response to the network power supply device being connected to the backend device through the target port, negotiating with the network power supply device based on the dynamic host configuration protocol to set a corresponding network address for the network power supply device.

[0070] Optionally, in an embodiment of the present application, the above-mentioned network address pool is a set of IP addresses managed by a DHCP server, which is used to dynamically allocate to network power supply devices requesting connection; the negotiation between the back-end device and the network power supply device can be understood as an interactive process between the network power supply device and the DHCP server of the back-end device to obtain the network configuration parameters corresponding to the network power supply device (for example, IP network address and other information).

[0071] Exemplarily, in an application scenario of enterprise-level video surveillance deployment, a physical connection is established between the NVR (backend device) and the target switch through a network cable, and a target port is set on the NVR to receive and manage cascaded network power supply devices. Next, a DHCP server is started on the NVR to create the above-mentioned network address pool, which includes several pre-prepared IP addresses. These IP addresses are all located in a pre-configured network segment and are used to be allocated to network power supply devices that are subsequently connected to the NVR. When a network power supply device is connected to the target switch and requests to communicate data 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 allocates an IP address to the network power supply device through negotiation, thereby ensuring that the network power supply device can go online and start transmitting video streams.

[0072] It should be noted that the embodiments of the present application do not limit the size of the above-mentioned network address pool, the scope of the network segment, and the access order and type of the equipment, and can include but are not limited to adjustments based on the needs of specific business scenarios and the network environment to achieve optimal network resource allocation and management.

[0073] In an exemplary embodiment, suppose a retail store wants to install POE cameras in various corners to enhance in-store monitoring, but the number of POE ports of the NVR is limited. In this business scenario, through the embodiment of the present application, the NVR can be connected to a target switch with multiple POE ports through the target port, and then the DHCP service is started on the NVR to create a network address pool containing multiple IP addresses. When the POE camera is connected to any port of the switch, the DHCP server of the NVR responds to its request, automatically assigns the first available IP address, and binds the network address of the POE camera to the target port. Subsequently, when the second, third, and other network power supply devices (which can be POE devices of the same type or other types of devices, such as sensors, etc.) are connected to different ports of the switch, the NVR continues to assign network addresses to them, thereby realizing automatic online and monitoring service deployment of multiple devices.

[0074] Through the embodiments of the present application, the DHCP protocol is used in conjunction with the target switch to realize the automatic management of the network configuration of the network power supply device by the back-end device, thereby achieving the purpose of efficiently expanding the number of front-end network power supply devices under limited back-end device port resources, while also ensuring the independence of each network power supply device and the stability of network communication.

[0075] As an optional solution, in the case where the first network power supply device establishes a connection with the above-mentioned back-end device before the second network power supply device establishes a connection with the above-mentioned back-end device, the above-mentioned target port is bound to the above-mentioned first network power supply device based on the above-mentioned first network address, and the above-mentioned idle port is bound to the above-mentioned second network power supply device based on the above-mentioned second network address, including: in the case where the above-mentioned first network power supply device establishes a connection with the above-mentioned back-end device, a first mapping relationship between the above-mentioned first network address and the above-mentioned target port is generated based on the switch self-learning algorithm; in the case where the above-mentioned second network power supply device establishes a connection with the above-mentioned back-end device, the above-mentioned idle port is obtained; based on the above-mentioned switch self-learning algorithm, a second mapping relationship between the above-mentioned second network address and the above-mentioned idle port is generated; and the above-mentioned first mapping relationship and the above-mentioned second mapping relationship are saved in the record form corresponding to the above-mentioned back-end device, so that the above-mentioned target port is bound to the above-mentioned first network power supply device, and the above-mentioned idle port is bound to the above-mentioned second network power supply device.

[0076] Optionally, in an embodiment of the present application, the above-mentioned switch self-learning algorithm is a network management mechanism used to automatically learn and record the correspondence between the MAC address of the network device and the network port to optimize the data forwarding path; the above-mentioned record form refers to a database or list inside the back-end device for storing network mapping relationships.

[0077] For example, in the deployment scenario of the intelligent traffic monitoring system (ITS), the traffic monitoring center uses an NVR as a backend device, which is connected to a POE switch (target switch) that supports the POE function through a target port. When the first IP camera (as the first network power supply device) is connected to the POE switch, the DHCP server on the NVR assigns it a first network address; at the same time, the NVR enables the switch self-learning algorithm, automatically detects and establishes a one-to-one mapping relationship between the first network address and the target port, and records it in the NVR's database to ensure smooth data communication with the first IP camera.

[0078] Then, when the second IP camera (as the second network power supply device) is connected to a different port of the same POE switch, the NVR automatically detects the connection request of the device, selects one from the free ports for data transmission, and assigns it a second network address through DHCP. At this time, the NVR again uses the switch self-learning algorithm to generate and save the mapping relationship between the second network address and the free port to ensure the independent communication of the second IP camera.

[0079] It should be noted that in the embodiments of the present application, the connection and address allocation between the network power supply device and the back-end device can also be achieved through methods including but not limited to automated scripts, network protocols (such as ARP, ICMP, etc.) and security policy coordination.

[0080] It should also be noted that the storage and management of the above-mentioned first mapping relationship and second mapping relationship are not limited to the form of a table, but can also be other data structures, such as a hash table or a tree structure, and this application does not impose any limitation on this.

[0081] Through the embodiments of the present application, a switch self-learning algorithm is combined with the DHCP protocol to realize automatic management and maintenance of the network mapping relationship of the network power supply equipment by the back-end equipment, thereby achieving the purpose of automatic identification and efficient communication in a multi-cascade device environment, while reducing the complexity and cost of the back-end equipment network management.

[0082] As an optional solution, when the second network power supply device establishes a connection with the back-end device, the idle port is obtained, including: initiating a broadcast search through a preset application protocol to determine the online network power supply device in the target local area network; determining the network address, physical address and used port corresponding to the online network power supply device; and determining the idle port based on the used port and the port set configured for the back-end device.

[0083] Optionally, in an embodiment of the present application, the above-mentioned preset application protocol refers to a network protocol used for front-end device search and management, including but not limited to ONVIF protocol, PSIA protocol, customized search protocol, etc. The preset application protocol allows the above-mentioned back-end device to actively initiate search requests to discover and manage front-end devices in the network; the above-mentioned target LAN can be understood as a specific network environment in which the back-end device communicates with the network power supply device, such as an office, home, warehouse or any network communication area with an internal network connection; the above-mentioned online network power supply device refers to a front-end device that is currently running in the target LAN and can respond to network search requests, including but not limited to POE cameras, network sensors, etc.; the above-mentioned network address refers to the IP address assigned to the network power supply device; the above-mentioned physical address refers to the MAC address assigned to the network power supply device; the above-mentioned use port refers to the port on the back-end device that is currently communicating data with a certain network power supply device; the above-mentioned port set refers to the network port owned by the back-end device that can be used for data transmission.

[0084] For example, in the application scenario of smart city public security monitoring, NVR, as a backend device, actively initiates a broadcast search through a preset application protocol (such as ONVIF) to determine the network power supply devices currently online (such as POE IP cameras installed in streets and squares) in the target local area network (such as a city monitoring network).

[0085] Furthermore, when the above-mentioned online network power supply devices are determined, the NVR can continue to obtain the network address (IP address), physical address (MAC address) and the port they are currently communicating with for each online network power supply device, and based on the current port information and the set of all available ports of the NVR, intelligently analyze and determine the free ports, and reserve the free ports for other network power supply devices, thereby ensuring the smoothness of network communication and the efficiency of equipment management.

[0086] Through the embodiments of the present application, by adopting the method of active search of preset application protocols and intelligent port management, the technical effect of dynamically expanding the network data communication coverage range is achieved without interrupting the existing data communication services, and the purpose of intelligently and efficiently configuring and managing network power supply equipment is achieved, thereby achieving the technical effect of improving resource utilization.

[0087] As an optional scheme, the above-mentioned first mapping relationship and the above-mentioned second mapping relationship are saved to the record form corresponding to the above-mentioned back-end device so that the above-mentioned target port is bound to the above-mentioned first network power supply device, and the above-mentioned idle port is bound to the above-mentioned second network power supply device, including: saving the above-mentioned first mapping relationship and the above-mentioned second mapping relationship to the above-mentioned record form corresponding to the above-mentioned back-end device; traversing the above-mentioned record form according to the first address pair and the second address pair, binding the above-mentioned target port to the above-mentioned first address pair, and binding the above-mentioned idle port to the above-mentioned second address pair, wherein the above-mentioned first address pair includes the above-mentioned first network address and the first physical address having a mapping relationship, and the above-mentioned second address pair includes the above-mentioned second network address and the second physical address having a mapping relationship.

[0088] 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.

[0089] It should be noted that in the embodiments of the present application, the first mapping relationship and the second mapping relationship can be saved in the record form according to different network architectures and the configuration of the back-end equipment, for example, a distributed database is used to efficiently store and retrieve a large amount of mapping information, etc.; the record form can also be queried based on a variety of traversal retrieval algorithms, including but not limited to linear search, binary search or hash search, etc., which is not limited in the present application.

[0090] In an exemplary embodiment, suppose a school is upgrading its video surveillance system and uses an NVR as a backend device, which is connected to a POE switch (target switch) through a target port. Multiple 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 the switch self-learning algorithm. In other words, the network address (IP) and physical address (MAC) of each POE IP camera and the switch port information to which it is connected are saved in a record form.

[0091] Furthermore, if a new POE IP camera is connected, the NVR will traverse the record table to find the first address pair and the second address pair, that is, the combination of the network address and the physical address, and then bind the target port to the first address pair and the idle port to the second address pair.

[0092] Through the embodiment of the present application, a switch self-learning algorithm is combined with a record form to ensure that each network power supply device has an independent communication port, optimize the data transmission path and the allocation of network resources, and avoid resource conflicts between devices; on the other hand, it also simplifies the management process of back-end equipment and reduces network operation and maintenance costs.

[0093] As an optional solution, in response to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch, a corresponding network address is set for each of the at least one network power supply device based on a dynamic host configuration protocol, including: when 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, receiving a broadcast message initiated by the at least one network power supply device; establishing a connection between the back-end device and the target switch based on the broadcast message, and allocating the target port to the target switch, and determining that the at least one network power supply device is connected to the back-end device; and setting a corresponding network address for each of the at least one network power supply device based on the dynamic host configuration protocol.

[0094] Optionally, in an embodiment of the present application, the above-mentioned power supply network port refers to a port on the back-end device with POE power supply function; the above-mentioned broadcast message can be understood as a discovery request sent by the above-mentioned network power supply device when it starts or when network configuration is required, such as a DHCPdiscover message.

[0095] For example, assume that NVR is used as a backend device and is connected to a POE switch (target switch) through the power supply network port. Multiple POE IP cameras are cascaded under the switch as network power supply devices. When any POE IP camera is connected to the POE port of the switch, it will automatically send a broadcast message (such as DHCPdiscover). After receiving these messages, the DHCP server on the NVR will respond immediately, establish a connection between the NVR and the target switch based on the broadcast message, and allocate a target port to the switch. For the NVR, a unique network address can also be assigned to each connected POE IP camera through the DHCP protocol.

[0096] It should be noted that the network address allocation strategy in the embodiments of the present application may include but is not limited to dynamic allocation, static allocation or mixed allocation, and the present application does not limit this.

[0097] Through the embodiments of the present application, the dynamic host configuration protocol is combined with the switch self-learning algorithm to realize the automatic identification and configuration of the network address of the network power supply device by the back-end device, thereby effectively improving the utilization rate of network resources.

[0098] In an exemplary embodiment, the present application can be applied to an application environment where a back-end device is cascaded with a POE front-end device, and can solve the technical problem that the POE device (the above-mentioned network power supply device) cannot automatically go online and can output data normally at the same time. In addition, it can also realize the reception of data transmitted by multiple POE devices under a network hard disk recorder with a single POE port.

[0099] For example, taking the backend device as a network video recorder NVR, Figure 5 is a schematic diagram of device connection according to an optional device connection method of an embodiment of the present application, such as Figure 5 As shown, the network hard disk video recorder can be provided with several ordinary main network ports and POE network ports, wherein the network hard disk video recorder can be directly connected to the network camera through the ordinary main network port. When the network hard disk video recorder receives the device adding request, it will establish a connection with the network camera to obtain the monitoring screen of the network camera; furthermore, the network hard disk video recorder can also automatically add the POE camera (the above-mentioned network power supply device) through the POE network port for monitoring services.

[0100] It should be noted that in the relevant technology, if the network hard disk recorder needs to obtain the video images of three POE cameras at the same time, it needs to provide three POE network ports to access the three POE cameras. That is, without adding POE network ports, the network hard disk recorder cannot meet the automatic access service of multiple POE cameras. Figure 3As shown, although a switch is set up to cascade three POE cameras, the existing related technology only determines which POE camera is online and marked as POE1 port by judging which one broadcasts first, and then receives the video image transmitted by a POE camera corresponding to the POE1 port. It is inevitable that there is a resource competition between the three POE cameras.

[0101] In other words, the existing technology uses ARP (Address Resolution Protocol) broadcast packets to search for the POE device under the POE network card of the back-end device, and then sets the specified network address for the specified POE camera through ARP. The ping command can be used to determine whether the network address is connected. If it is connected, it is considered that the self-learning is successful, and the pair of IP address and MAC address is recorded; for the network hard disk recorder, the POE network port is connected to a POE camera, and the pair of IP address and MAC address is bound to the POE port. If there is another POE camera connected to another POE network port, the corresponding pair of IP address and MAC address is obtained in the same way and bound to the other POE port.

[0102] Furthermore, since different POE cameras are bound to different POE ports, there can be multiple local video channel numbers converted from the corresponding POE ports to the network hard disk recorder. However, once the device communicates data across switches and the window period has passed, the ARP IP allocation mechanism will face failure. In general, in the prior art, one POE port of the back-end device can only store the camera information of one POE, and one POE port can only return one IP address and MAC information, which cannot meet the business needs of the application layer.

[0103] Considering this technical problem, the present application proposes to use DHCP to allocate network addresses and to automatically and gradually establish a frame exchange table (the above-mentioned record form) based on the switch self-learning algorithm, so as to solve the technical problem that the network power supply device cannot be online at the same time when the back-end device is cascaded with the network power supply device. In addition, for the back-end device without multiple POE ports, a gateway device (the above-mentioned target switch) can be cascaded through one POE port, and multiple network power supply devices can be mounted under the gateway device, specifically:

[0104] S1, when the POE camera network port is inserted into the POE network port of the network hard disk video recorder, wait for the POE camera to initiate a DHCP broadcast message (in the DHCP discovery (DHCPDISCOVER), offer (DHCPOFFER), request (DHCPREQUEST) and confirmation (DHCPACK) stages), find the DHCP server, that is, the DHCP server of the network hard disk video recorder, the network hard disk video recorder will assign an IP address to the POE camera for reply, and wait for the POE camera to respond that the IP address is set successfully;

[0105] S2, for a switch cascaded to the POE network port of the network hard disk recorder, the IP address and MAC address of the POE camera can be obtained in the message of successful IP address setting, and this pair of mac-ip is bound to the POE port; if there is another POE camera connected to the switch, similarly, the information of the MAC and IP discovery can be obtained, and the information of the switch on the same POE port is also bound to the POE port.

[0106] S3, since the first and second POE cameras are bound to the same POE port, there is only one local video channel C1 of the corresponding POE port converted into the network hard disk recorder. The POE camera that comes online first can be added to C1 and recorded as POE1-1. The POE camera that comes online later can search and determine an idle port (non-POE port or POE port) and add the corresponding channel to the streaming service number POE1-2, which satisfies the streaming preview service under different channels in the case of cascading. In addition, it can also solve the technical problem that network cameras in different network segments cannot stream even if they are automatically added through other solutions in time. The positioning range of the network port corresponding to the POE camera is initially narrowed according to the number POE1-1.

[0107] It should be noted that the technical problem that the back-end device and the camera are in the same LAN but in different network segments, and even if they are added, they cannot pull the stream, obtain the configuration and other operations can be solved through the embodiments of the present application by controlling the network address of the camera to be in the same network segment as the POE network port, thereby realizing automatic addition, pulling the stream, previewing the configuration and obtaining and other operations.

[0108] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0109] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0110] According to another aspect of the embodiments of the present application, a device for connecting devices for implementing the above-mentioned device connection method is also provided. Figure 6 As shown, the device comprises:

[0111] A setting module 602, configured to set a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol in response to at least one network power supply device being connected to a backend device via a target port corresponding to a target switch;

[0112] A generating module 604, configured to generate a first network address and a second network address when 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 the same network segment;

[0113] A binding module 606 is used to bind the target port to the first network power supply device based on the first network address, and to bind 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 backend device before the second network power supply device does, wherein the idle port refers to a port that does not participate in data transmission among the multiple ports corresponding to the backend device;

[0114] The pulling module 608 is used to pull the preview images of the first network power supply device and the second network power supply device based on the target port and the idle port.

[0115] As an optional solution, the above-mentioned device is used to set a corresponding network address for each network power supply device in at least one network power supply device based on the dynamic host configuration protocol in response to at least one network power supply device being connected to the back-end device through the target port corresponding to the target switch in the following manner: establishing a connection between the back-end device and the target switch, and allocating a target port to the target switch; creating a server on the back-end device in accordance with the dynamic host configuration protocol, and managing the network address pool through the server to allocate network addresses to network power supply devices requesting connection; in response to the network power supply device being connected to the back-end device through the target port, negotiating with the network power supply device based on the dynamic host configuration protocol to set a corresponding network address for the network power supply device.

[0116] As an optional solution, the above-mentioned device is used to bind the target port to the first network power supply device based on the first network address, and bind 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 establishes a connection with the back-end device in the following manner: when the first 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 the switch self-learning algorithm; when the second network power supply device establishes a connection with the back-end device, obtain the idle port; generate a second mapping relationship between the second network address and the idle port based on the switch self-learning algorithm; save the first mapping relationship and the second mapping relationship to the record form corresponding to the back-end device, so that the target port is bound to the first network power supply device, and the idle port is bound to the second network power supply device.

[0117] As an optional solution, the above-mentioned device is used to obtain a free port when the second network power supply device establishes a connection with the back-end device in the following manner: initiating a broadcast search through a preset application protocol to determine the online network power supply device in the target local area network; determining the network address, physical address and used port corresponding to the online network power supply device; and determining the free port based on the used port and the port set configured for the back-end device.

[0118] As an optional solution, the above-mentioned device is used to save the first mapping relationship and the second mapping relationship to a record form corresponding to the back-end device in the following manner, so that the target port is bound to the first network power supply device, and the idle port is bound to the second network power supply device: save the first mapping relationship and the second mapping relationship to a record form corresponding to the back-end device; traverse the record form according to the first address pair and the second address pair, bind the target port to the first address pair, and bind the idle port to the second address pair, wherein the first address pair includes a first network address and a first physical address having a mapping relationship, and the second address pair includes a second network address and a second physical address having a mapping relationship.

[0119] As an optional solution, the above-mentioned device is used to respond to at least one network power supply device being connected to a back-end device through a target port corresponding to a target switch in the following manner, and to 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: when the network port of at least one network power supply device is inserted into the power supply network port of the back-end device, receive a broadcast message initiated by at least one network power supply device; establish a connection between the back-end device and the target switch based on the broadcast message, and allocate a target port to the target switch to determine that at least one network power supply device is connected to the back-end 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.

[0120] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0121] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0122] According to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program.

[0123] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0124] Figure 7 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.

[0125] It should be noted that Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0126] like Figure 7 As shown, the computer system 700 includes a central processing unit 701 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 702 (ROM) or the program loaded from the storage part 708 to the random access memory 703 (RAM). Various programs and data required for system operation are also stored in the random access memory 703. The central processing unit 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. The input / output interface 705 (Input / Output interface, i.e., I / O interface) is also connected to the bus 704.

[0127] The following components are connected to the input / output interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A 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, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0128] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processor 701, various functions defined in the system of the present application are executed.

[0129] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processor 701, various functions provided by the embodiment of the present application are performed.

[0130] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned device connection method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Figure 8 As shown, the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps in any of the above method embodiments through the computer program.

[0131] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0132] Optionally, in this embodiment, the above-mentioned processor can be configured to execute the methods in each embodiment of the present application through a computer program.

[0133] Alternatively, a person skilled in the art may understand that: Figure 8 The structure shown is for illustration only. Figure 8 The structure of the electronic device is not limited. Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations are shown.

[0134] Among them, the memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the device connection method and the device in the embodiment of the present application. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, realizing the above-mentioned device connection method. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 802 may further include a memory remotely located relative to the processor 804, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 802 can be specifically, but not limited to, used to store information such as video images of the above-mentioned network power supply equipment. As an example, such as Figure 8 As shown, the memory 802 may include, but is not limited to, the setting module 602, binding module 604, generating module 606, and pulling module 608 in the connection device of the device. In addition, it may also include, but is not limited to, other module units in the connection device of the device, which will not be repeated in this example.

[0135] Optionally, the transmission device 806 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0136] In addition, the electronic device further includes: a display 808 for displaying the video image of the network power supply device; and a connection bus 810 for connecting various module components in the electronic device.

[0137] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer network, and any form of computing device, such as a server, terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0138] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the device connection method provided in various optional implementations of the connection aspects of the above-mentioned devices.

[0139] Optionally, in this embodiment, the above-mentioned computer-readable storage medium can be configured to store data for executing the methods in various embodiments of the present application.

[0140] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0141] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0142] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for one or more electronic devices to execute all or part of the steps of the methods described in each embodiment of the present application.

[0143] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0144] In the several embodiments provided in the present application, it should be understood that the disclosed application can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.

[0146] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0147] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A device connection method, characterized in that: include: In response to at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, automatically identifying and configuring a network address corresponding to each network power supply device in 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 access through the target port; In the case where the at least one network power supply device includes a first network power supply device and a second network power supply device, generating a first network address and a second network address, wherein the first network address and the second network address are in the same network segment as the target port, and the first network power supply device and the second network power supply device are network power supply devices in the same local area network as the backend device but in different network segments; In the case where the first network power supply device establishes a connection with the backend device before the second network power supply device, the target port is bound to the first network power supply device based on the first network address, and the idle port is bound to the second network power supply device based on the second network address, wherein, in the case where the priority of the first network power supply device is higher than the priority of the second network power supply device, it is determined that the first network power supply device establishes a connection with the backend device before the second network power supply device, and the idle port represents a port that does not participate in data transmission among the multiple ports corresponding to the backend device; Pulling preview images of the first network power supply device and the second network power supply device based on the target port and the idle port; In the case where 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, the target port is bound to the first network power supply device based on the first network address, and the idle port is bound to the second network power supply device based on the second network address, including: in the case where the first network power supply device establishes a connection with the back-end device, a first mapping relationship between the first network address and the target port is generated based on a switch self-learning algorithm; in the case where the second network power supply device establishes a connection with the back-end device, the idle port is obtained, and a second mapping relationship between the second network address and the idle port is generated based on the switch self-learning algorithm; the first mapping relationship and the second mapping relationship are saved in a record form corresponding to the back-end device, so that the target port is bound to the first network power supply device, and the idle port is bound to the second network power supply device; The step of obtaining the idle port when the second network power supply device is connected to the back-end device includes: initiating a broadcast search through a preset application protocol to determine an online network power supply device in a target local area network; determining a network address, a physical address and a used port corresponding to the online network power supply device; and determining the idle port based on the used port and a port set configured for the back-end device. The method of saving 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 to the first network power supply device and the idle port is bound to the second network power supply device includes: saving the first mapping relationship and the second mapping relationship to the record form corresponding to the back-end device; traversing the record form according to the first address pair and the second address pair, binding the target port to the first address pair, and binding the idle port to the second address pair, wherein the first address pair includes the first network address and the first physical address having a mapping relationship, and the second address pair includes the second network address and the second physical address having a mapping relationship.

2. The method according to claim 1, characterized in that In response to at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, 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 backend device and the target switch, and allocating the target port to the target switch; Creating a server on the backend device according to the dynamic host configuration protocol, and managing a network address pool through the server to allocate a network address to a network power supply device requesting a connection; In response to the network power supply device being connected to the backend device through the target port, a corresponding network address is set for the network power supply device through negotiation with the network power supply device based on the dynamic host configuration protocol.

3. The method according to claim 1, characterized in that In response to at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, setting a corresponding network address for each of the at least one network power supply device based on a dynamic host configuration protocol includes: When 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, receiving a broadcast message initiated by the at least one network power supply device; Establishing a connection between the backend device and the target switch based on the broadcast message, allocating the target port to the target switch, and determining that the at least one network power supply device is connected to the backend device; A corresponding network address is set for each of the at least one network power supply device based on the dynamic host configuration protocol.

4. A device connecting device, characterized in that: include: A setting module, configured to automatically identify and configure a network address corresponding to each network power supply device in the at least one network power supply device based on a dynamic host configuration protocol in response to at least one network power supply device being connected to a backend device through a target port corresponding to a target switch, wherein the at least one network power supply device is configured to simultaneously implement data transmission and online access through the target port; A generating module, configured to generate a first network address and a second network address when 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 the same network segment as the target port, and the first network power supply device and the second network power supply device are network power supply devices in the same local area network as the back-end device but in different network segments; A binding module, configured to bind the target port to the first network power supply device based on the first network address, and to bind 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 does, wherein when the priority of the first network power supply device is higher than the priority of the second network power supply device, it is determined that the first network power supply device establishes a connection with the back-end device before the second network power supply device does, and the idle port represents a port that does not participate in data transmission among the multiple ports corresponding to the back-end device; A pulling module, used for pulling the preview images 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 also used to: when the first network power supply device is connected to the back-end device, generate a first mapping relationship between the first network address and the target port based on the switch self-learning algorithm; when the second network power supply device is connected to the back-end device, obtain the idle port, and generate a second mapping relationship between the second network address and the idle port based on the switch self-learning algorithm; save the first mapping relationship and the second mapping relationship to the record form corresponding to the back-end device, so that the target port is bound to the first network power supply device, and the idle port is bound to the second network power supply device; The device is also used to obtain the idle port when the second network power supply device is connected to the back-end device: initiate a broadcast search through a preset application protocol to determine an online network power supply device in a target local area network; determine the network address, physical address and used port corresponding to the online network power supply device; determine the idle port based on the used port and the port set configured for the back-end device; The device is also used to save 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 to the first network power supply device, and the idle port is bound to the second network power supply device: save the first mapping relationship and the second mapping relationship to the record form corresponding to the back-end device; traverse the record form according to the first address pair and the second address pair, bind the target port to the first address pair, and bind the idle port to the second address pair, wherein the first address pair includes the first network address and the first physical address having a mapping relationship, and the second address pair includes the second network address and the second physical address having a mapping relationship.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein the computer program can be executed by an electronic device to perform the method described in any one of claims 1 to 3.

6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 3 are implemented.

7. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 3 through the computer program.

Citation Information

Patent Citations

  • Network camera transmission configuration method and system, electronic equipment and storage medium

    CN117896495A