Equipment upgrading method, device and equipment
Through the Equipment Management Platform (DMP), the site equipment is analyzed in physical topology and master-sub-device relationship, and the equipment aggregation chain is generated, and the upgrade current limiting strategy is determined based on bandwidth threshold and service bandwidth consumption, which solves the stability and efficiency problems in the batch upgrade of equipment in large-scale system integration projects, and realizes intelligent current limiting upgrade.
Patent Information
- Application Number
- CN202411986854.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In large-scale system integration projects, unified batch remote firmware upgrades are required to perform a large number of camera front-end equipment, back-end NVR equipment and VA equipment. It is difficult for the existing technology to effectively manage and optimize the upgrade process, especially when ensuring business stability.
Through the device management platform (DMP), the equipment aggregation chain is generated for each site's equipment aggregation chain, and the service bandwidth consumption and bandwidth threshold are used to determine the available bandwidth for upgrading, and the upgrade current limiting strategy is formulated based on the device aggregation chain to achieve intelligent current limiting upgrades.
It improves the rationality of upgraded current limit in the Equipment Management Platform (DMP) scenario, ensures that intelligent current limit upgrades are achieved while ensuring normal business stability, and improves the efficiency and reliability of equipment upgrades.
Smart Images

Figure CN119420710B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things platforms, and in particular to a device upgrading method, apparatus and equipment. Background Art
[0002] In many large-scale system integration projects, it is necessary to provide a device management platform (DMP) that can be used for large-scale camera front-end devices (such as IPC (Internet Protocol Camera)), back-end NVR (Network Video Recorder) devices, VA (Video Analytics) and other device types, and a unified batch remote firmware upgrade is required. Summary of the invention
[0003] In view of this, the present application provides a device upgrading method, apparatus and equipment.
[0004] According to a first aspect of an embodiment of the present application, there is provided a device upgrading method, comprising:
[0005] For any site managed by the device management platform, determine the subordinate devices of the site and determine the physical topology of each subordinate device of the site;
[0006] According to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device, a device aggregation chain of the site is generated; wherein multiple sub-devices of the router connected to the site through the same master device belong to the same device aggregation chain;
[0007] Determine the service bandwidth consumption of the site, and determine the upgrade available bandwidth of the site according to the service bandwidth consumption of the site and the bandwidth threshold of the site;
[0008] Determine the upgrade current limiting strategy for each subordinate device of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site;
[0009] According to the upgrade current limiting strategy, each subordinate device of the site is upgraded.
[0010] According to a second aspect of an embodiment of the present application, there is provided a device upgrading apparatus, comprising:
[0011] A first determining unit is configured to determine, for any site managed by the device management platform, subordinate devices of the site and determine a physical topology of each subordinate device of the site;
[0012] The generating unit is configured to generate a device aggregation chain of the site according to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device; wherein multiple sub-devices of the router connected to the site through the same master device belong to the same device aggregation chain;
[0013] A second determining unit is configured to determine the service bandwidth consumption of the site, and determine the upgrade available bandwidth of the site according to the service bandwidth consumption of the site and the bandwidth threshold of the site;
[0014] The third determining unit is configured to determine an upgrade current limiting strategy for each subordinate device of the site according to the upgrade available bandwidth of the site and the device aggregation chain of the site;
[0015] The upgrading unit is configured to upgrade each subordinate device of the site according to the upgrading current limiting strategy.
[0016] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0017] Memory, used to store computer programs;
[0018] The processor is used to implement the method provided in the first aspect when executing the program stored in the memory.
[0019] According to a fourth aspect of an embodiment of the present application, a non-temporary computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the method provided in the first aspect is implemented.
[0020] The device upgrade method of the embodiment of the present application, for any site managed by the device management platform, on the one hand, determines the subordinate devices of the site and determines the physical topology of each subordinate device of the site, and generates the device aggregation chain of the site based on the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device; on the other hand, determines the service bandwidth consumption of the site, and determines the upgrade available bandwidth of the site based on the service bandwidth consumption of the site and the bandwidth threshold of the site, and then, can determine the upgrade flow limiting strategy of each subordinate device of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site, and upgrade each subordinate device of the site based on the determined upgrade flow limiting strategy. Compared with the traditional device upgrade solution with central flow limiting, the rationality of the DMP scenario upgrade flow limiting is improved by performing device upgrade flow limiting on the site. In addition, by combining the bandwidth threshold and service bandwidth consumption of each site, the available bandwidth for upgrading of each site is determined, and the flow limiting upgrade strategy is generated and executed in combination with the device aggregation chain of the site, thereby realizing intelligent flow limiting upgrade while ensuring normal business stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flow chart of a device upgrading method provided in an embodiment of the present application;
[0022] Figure 2 It is a flow chart of a device intelligent current limiting upgrade method provided in an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a site instance provided in an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of channel aggregation provided by an embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of an upgrade package download provided in an embodiment of the present application;
[0026] Figure 6 It is a schematic diagram of data reading based on a token bucket provided in an embodiment of the present application;
[0027] Figure 7 It is a structural schematic diagram of a device upgrading apparatus provided in an embodiment of the present application;
[0028] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0030] It should be noted that the serial numbers of the steps in the embodiments of the present application do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0031] See also Figure 1 , is a flow chart of a device upgrade method provided in an embodiment of the present application, wherein the device upgrade method can be applied to a device management platform (DMP), such as Figure 1 As shown, the device upgrade method may include the following steps:
[0032] Step S100: For any site managed by the device management platform, determine the subordinate devices of the site, and determine the physical topology of each subordinate device of the site.
[0033] In the embodiment of the present application, the DMP can manage the devices in the form of sites.
[0034] Exemplarily, the devices under the same site may include front-end devices (such as IPC), back-end devices (such as NVR), VA, switches, routers and other devices.
[0035] Exemplarily, the sites managed by the DMP may include sites of various scene types, such as indoor scenes of HDB housing, outdoor scenes of HDB housing, street scenes, subway station scenes, or highway ramp scenes.
[0036] Exemplarily, DMP can automatically discover devices (which may be referred to as site subordinate devices) within a site LAN through protocols such as device discovery protocol, device search protocol, multicast protocol, or NETMAP (high performance network packet I / O (input / output) framework) protocol.
[0037] Exemplarily, DMP can determine the physical topology of each subordinate device of the site through the SNMP protocol (Simple Network Management Protocol), the LLDP (Link Layer Discovery Protocol) protocol, and the MAC (Media Access Control) address learning table.
[0038] For example, DMP can obtain the interface information of switches and routers (including interface status, description, and MAC address) through the SNMP protocol; obtain the physical connection information between the device and its neighbors from the neighbor table of the device through the LLDP protocol; and further confirm the connection location of the device through the MAC address learning table of the switch. By summarizing the data obtained through the SNMP protocol, LLDP protocol, and MAC address learning table, a physical topology map can be constructed.
[0039] For example, interface information can be obtained through SNMP, and neighbor device information can be obtained in combination with the LLDP protocol to build connections between switches, routers, and hosts; the physical port mapping relationship of the device can be further confirmed through the MAC address learning table and LLDP protocol data.
[0040] It should be noted that if the topology obtained through the protocol is incomplete, you can manually edit and add topological nodes and topological relationships.
[0041] In addition, for NVR devices, you can obtain the sub-device IPC list through the NVR interface to determine the topological relationship between the NVR and the IPC.
[0042] Step S110: Generate a device aggregation chain for the site based on the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device; wherein multiple sub-devices of the router connected to the site through the same master device belong to the same device aggregation chain.
[0043] In an embodiment of the present application, it is taken into account that in an actual scenario, there may be a scenario in which multiple sub-devices are connected to a router through the same main device. For example, multiple IPCs are connected to a router through the same NVR. In the process of upgrading the multiple IPCs, it is not necessary to send upgrade packages to the multiple IPCs separately. Instead, the upgrade package can be sent to the NVR, and the NVR sends the upgrade packages to each IPC connected to the NVR through an internal connection.
[0044] That is, multiple IPCs connected to the router through the same NVR do not need to be sent upgrade packages separately by DMP.
[0045] Based on this, the device aggregation chain of the site can be generated according to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device.
[0046] Exemplarily, multiple sub-devices of the router connected to the site through the same main device belong to the same device aggregation chain.
[0047] Step S120: Determine the service bandwidth consumption of the site, and determine the upgrade available bandwidth of the site based on the service bandwidth consumption of the site and the bandwidth threshold of the site.
[0048] In the embodiment of the present application, in order to reduce the impact of equipment upgrade on normal services, it is necessary to determine the available bandwidth for equipment upgrade based on the bandwidth consumed by the normal services of the site.
[0049] Accordingly, during the batch upgrade of equipment, for any site, the service bandwidth consumption of the site can also be determined, and based on the service bandwidth consumption of the site and the bandwidth threshold of the site, the upgrade available bandwidth of the site can be determined.
[0050] In one example, determining the upgrade available bandwidth of the site based on the service bandwidth consumption of the site and the bandwidth threshold of the site can be implemented in the following manner:
[0051] P=M*X%-W
[0052] Among them, P is the available bandwidth for upgrading, M is the bandwidth threshold, X% is the available bandwidth ratio (the remaining bandwidth can be used to cope with special situations such as network fluctuations), and W is the site service bandwidth consumption.
[0053] Step S130: Determine the upgrade current limiting strategy for each subordinate device of the site according to the upgrade available bandwidth of the site and the device aggregation chain of the site.
[0054] In an embodiment of the present application, when the device aggregation chain of the site and the available upgrade bandwidth of the site are determined in the above manner, the available upgrade bandwidth of the site can be allocated according to the number of device aggregation chains of the site, thereby determining the upgrade current limiting strategy of each subordinate device of the site.
[0055] Exemplarily, for multiple different devices in the same device aggregation chain, their upgrade current limiting strategies may be the same.
[0056] Step S140: upgrade each subordinate device of the site according to the determined upgrade current limiting strategy.
[0057] In the embodiment of the present application, when the upgrade current limiting strategy of each subordinate device of the site is determined in the above manner, each subordinate device of the site can be upgraded according to the determined upgrade current limiting strategy.
[0058] It can be seen that in Figure 1In the method flow shown, for any site managed by the device management platform, on the one hand, the subordinate devices of the site are determined, and the physical topology of each subordinate device of the site is determined. According to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device, the device aggregation chain of the site is generated; on the other hand, the service bandwidth consumption of the site is determined, and the upgrade available bandwidth of the site is determined according to the service bandwidth consumption of the site and the bandwidth threshold of the site. Then, the upgrade flow limiting strategy of each subordinate device of the site can be determined according to the upgrade available bandwidth of the site and the device aggregation chain of the site, and the subordinate devices of the site are upgraded according to the determined upgrade flow limiting strategy. Compared with the traditional device upgrade solution with central flow limiting, the rationality of the DMP scenario upgrade flow limiting is improved by performing device upgrade flow limiting for the site. In addition, by combining the bandwidth threshold and service bandwidth consumption of each site, the upgrade available bandwidth of each site is determined, and the flow limiting upgrade strategy is generated and executed in combination with the device aggregation chain of the site, thereby realizing intelligent flow limiting upgrade while ensuring normal business stability.
[0059] In some embodiments, the above-mentioned generation of the device aggregation chain of the site based on the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device may include:
[0060] When it is determined that there are multiple sub-devices connected to the router of the site through the same master device according to the physical topology of the subordinate devices of the site and the master-sub-device relationship between the subordinate devices, it is determined that the multiple sub-devices and the master device belong to the same device aggregation chain;
[0061] For the same device aggregation chain, when it is determined that the same sub-device in the device aggregation chain is connected to the main device through multiple channels, multiple channels connecting the same sub-device to the main device are aggregated into one aggregation channel.
[0062] Exemplarily, for any site, in the process of generating a site device aggregation chain, it is possible to determine whether there are multiple sub-devices connected to the site's router through the same master device based on the physical topology of the subordinate devices under the site and the master-sub-device relationship between the subordinate devices.
[0063] In the case where it is determined that there are multiple sub-devices connected to the router of the site through the same main device, it can be determined that the multiple sub-devices and the main device belong to the same device aggregation chain.
[0064] For example, in the case where multiple IPCs are connected to a router of a site through the same NVR, the multiple IPCs and the NVR belong to the same device aggregation chain.
[0065] Exemplarily, devices respectively connected to different ports of the router may belong to different device aggregation chains.
[0066] Exemplarily, for the same device aggregation chain, it can also be determined whether there is a same sub-device connected to the main device through multiple channels.
[0067] For example, for a multi-target IPC, it can be connected to the NVR through multiple channels.
[0068] When it is determined that the same sub-device is connected to the main device through multiple channels, the multiple channels of the same sub-device connected to the main device can be aggregated into one aggregated channel. Furthermore, when the main device sends an upgrade package to the sub-device, it can aggregate the multiple channels into one aggregated channel and send one upgrade package.
[0069] In some embodiments, the determining of the service bandwidth consumption of the site may include:
[0070] In the case where the router of the site supports the collection of bandwidth consumption by a protocol, the service bandwidth consumption of the router is collected by specifying a bandwidth information collection protocol, and the collected service bandwidth consumption is determined as the service bandwidth consumption of the site;
[0071] In the case that the router of the site does not support the protocol collection bandwidth consumption, the service set of the site is determined according to the preset service type of each subordinate device of the site, and the service bandwidth consumption of the site is determined according to the service set of the site.
[0072] Exemplarily, for any site, in the process of determining the service bandwidth consumption of the site, it can be determined whether the router of the site supports the protocol to collect bandwidth consumption.
[0073] For example, router bandwidth consumption is collected through SNMP protocol or private protocol.
[0074] If the router of the site supports collecting bandwidth consumption by protocol, the service bandwidth consumption of the router can be collected by specifying a bandwidth information collection protocol (such as SNMP protocol or private protocol), and the collected service bandwidth consumption is determined as the service bandwidth consumption of the site.
[0075] When the router of the site does not support protocol collection bandwidth consumption, the service set of the site can be determined according to the preset service types of the subordinate devices of the site, and the service bandwidth consumption of the site can be determined according to the service set of the site.
[0076] Exemplarily, for any site, the preset service type and data volume of each subordinate device of the site may be obtained to determine the service set of the site, and the site service bandwidth consumption may be determined based on the service set of the site.
[0077] For example, the service bandwidth consumption of the site may be determined based on the service set of the site and a predetermined mapping table between different service sets and service bandwidth consumption.
[0078] In some embodiments, the above-mentioned determination of the upgrade current limiting strategy of each subordinate device of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site may include:
[0079] Determine the upgrade current limiting strategy of each device aggregation chain at the site according to the upgrade available bandwidth of the site, the number of device aggregation chains at the site, and the upgrade bandwidth allocation strategy of the site;
[0080] For any device aggregation chain, the upgrade current limiting strategy of each device in the device aggregation chain is determined according to the upgrade current limiting strategy of the device aggregation chain.
[0081] Exemplarily, when determining the available bandwidth for upgrading a site and the device aggregation chains of the site, the upgrade current limiting strategy for each device aggregation chain of the site can be determined based on the available bandwidth for upgrading the site, the number of device aggregation chains of the site, and the upgrade bandwidth allocation strategy of the site.
[0082] Taking the upgrade bandwidth allocation strategy as an equal sharing strategy as an example, the upgrade available bandwidth of the site can be evenly allocated to each device aggregation chain.
[0083] For example, suppose site 1 has 1 NVR, 5 IPCs (connected to the NVR), and 1 VA. The NVR and the 5 IPCs belong to the same device aggregation chain, and the VA belongs to another device aggregation chain. The upgrade current limiting strategy can be: send 2 upgrade packages to the NVR and VA, and the download rate of each upgrade package is P / 2; where P is the available bandwidth for the upgrade.
[0084] Assume that site 2 has 1 NVR, 5 IPCs (1 connected to the router alone, 4 connected to the NVR), and 1 VA. The NVR and the 4 IPCs connected to the NVR belong to the same device aggregation chain, the IPC connected to the router alone belongs to another device aggregation chain, and the VA belongs to another device aggregation chain. The upgrade current limiting strategy can be: send 3 upgrade packages to the NVR, 1 IPC (the IPC connected to the router alone), and VA, and the download rate of each upgrade package is P / 3.
[0085] It should be noted that in the embodiment of the present application, the upgrade bandwidth allocation strategy of the site is not limited to the equal sharing strategy, but can also include allocating different weights or priorities to different device aggregation chains according to device type, service type, etc., and allocating upgrade available bandwidth to different device aggregation chains based on the weight or priority of the device aggregation chain.
[0086] Exemplarily, for any device aggregation chain, the upgrade current limiting strategy of each device in the device aggregation chain can be determined according to the upgrade current limiting strategy of the device aggregation chain.
[0087] In an example, determining the upgrade current limiting strategy of each device in the device aggregation chain according to the upgrade current limiting strategy of the device aggregation chain may include:
[0088] For a device aggregation chain including a master device and multiple sub-devices,
[0089] In the case where the device aggregation chain is single-channel current limiting, the upgraded current limiting strategy of the device aggregation chain is determined as the upgraded current limiting strategy of each device in the device aggregation chain;
[0090] In the case where the device aggregation chain is multi-channel current limiting, the upgrade current limiting strategy for each device in the device aggregation chain is determined based on the upgrade current limiting strategy of the device aggregation chain, the upgrade package type corresponding to each device in the device aggregation chain, and the number of upgrade package types corresponding to the device aggregation chain.
[0091] Exemplarily, for a device aggregation chain including a main device and sub-devices, the upgraded current limiting strategy of each device in the device aggregation chain can be determined based on the upgraded current limiting strategy of the device aggregation chain and whether the device aggregation chain adopts single-path current limiting or multi-path current limiting.
[0092] Exemplarily, the device aggregation chain can be configured according to demand using single-channel current limiting or multi-channel current limiting.
[0093] Exemplarily, the device aggregation chains at the same site can be uniformly configured to adopt a single-channel route, or uniformly configured to adopt multi-channel current limiting; or, different device aggregation chains at the same site can independently configure single-channel current limiting or multi-channel current limiting.
[0094] Exemplarily, for a device aggregation chain including a main device and sub-devices, when the device aggregation chain is single-channel current limiting, the upgraded current limiting strategy of the device aggregation chain is determined as the upgraded current limiting strategy of each device in the device aggregation chain.
[0095] Exemplarily, the upgrade current limiting policy of a device may include a maximum download rate of an upgrade package of the device.
[0096] For example, if the upgrade flow limiting strategy of a device aggregation chain is a maximum speed limit of 2M / s, the maximum download rate during the upgrade package download process of each device in the device aggregation chain is 2M / s, and the upgrade package of one device is downloaded at a time (that is, the upgrade packages of multiple devices are not downloaded at the same time).
[0097] Exemplarily, for a device aggregation chain including a main device and sub-devices, when the device aggregation chain is multi-channel current limiting, the upgrade package type corresponding to each device in the device aggregation chain can be determined, and the number of upgrade package types corresponding to the device aggregation chain can be determined. Furthermore, based on the upgrade current limiting strategy of the device aggregation chain, the upgrade package type corresponding to each device in the device aggregation chain, and the number of upgrade package types corresponding to the device aggregation chain, the upgrade current limiting strategy for each device in the device aggregation chain can be determined.
[0098] For example, assuming that the number of upgrade package types corresponding to the device aggregation chain is K (K ≥ 2), the device aggregation chain can be subject to K-way current limiting (one type of upgrade package corresponds to one way of current limiting), and the upgrade current limiting strategy corresponding to each type of upgrade package can be determined separately.
[0099] Exemplarily, in the case of multi-channel current limiting, an equal distribution strategy or a priority strategy can be adopted to determine the specific current limiting strategy for each channel.
[0100] For example, the priority can be determined based on business importance, real-time requirements, etc.
[0101] For example, assuming that a device aggregation chain corresponds to four types of upgrade packages, and the device aggregation chain adopts a multi-channel current limiting equalization strategy, and the upgrade current limiting strategy is a maximum speed limit of 2M / s, then for any type of upgrade package, the download speed limit is 0.5M / s. Accordingly, the upgrade current limiting strategy of each device in the device aggregation chain is a maximum speed limit of 0.5M / s.
[0102] In some embodiments, the above-mentioned upgrading of each subordinate device of the site according to the upgraded current limiting strategy may include:
[0103] According to the upgrade flow limiting strategy, determine the maximum download rate of the upgrade package of each subordinate device of the site;
[0104] For any subordinate device of the site, when receiving an upgrade package download request sent by the device, the rate at which the upgrade package file is read from the disk to the memory is controlled according to the device's maximum upgrade package download rate, as well as the rate at which the upgrade package file is written from the memory to the kernel buffer, and the data in the kernel buffer is sent to the subordinate device.
[0105] Exemplarily, the maximum rate at which the upgrade package of each subordinate device of the site is downloaded may be determined according to the upgrade current limiting strategy of each subordinate device of the site.
[0106] During the batch upgrade process, DMP can send upgrade signaling to the corresponding devices.
[0107] Exemplarily, for any device aggregation chain, the DMP may send an upgrade signaling to the device connected to the router in the device aggregation chain.
[0108] For example, if multiple IPCs are connected to a router via an NVR, the DMP can send upgrade signaling to the NVR.
[0109] Exemplarily, the upgrade signaling may include upgrade package download address information, such as a URL (Uniform Resource Locator) for downloading the upgrade package.
[0110] When the device receives the upgrade signaling sent by the DMP, it can register with the DMP, and when the registration is successful, it can download the upgrade package according to the upgrade package download address information.
[0111] For any subordinate device at any site, when DMP receives a download request for an upgrade package for the device, it can control the rate at which the upgrade package file is read from the disk into the memory and the rate at which the upgrade package file is written from the memory to the kernel buffer based on the maximum rate at which the upgrade package is downloaded for the device, and send the data in the kernel buffer to the subordinate device.
[0112] Exemplarily, DMP may implement read rate control by using a token bucket when reading the upgrade package file from the disk to the memory, and its specific implementation may be described below in conjunction with a specific example.
[0113] Exemplarily, when DMP writes the upgrade package file from the memory to the kernel buffer, the write rate may be determined according to the write time and the amount of written data.
[0114] When the writing rate exceeds the maximum download rate of the upgrade package, the download rate of the upgrade package can be controlled by pausing writing.
[0115] In some embodiments, the above-mentioned upgrading of each subordinate device of the site according to the upgraded current limiting strategy may include:
[0116] When it is determined that the upgrade current limiting policy update conditions are met, the upgrade current limiting policy is updated, and each subordinate device of the site is upgraded according to the updated upgrade current limiting policy;
[0117] Among them, the conditions for updating the upgraded current limiting strategy include one or more of the following:
[0118] The current upgrade flow limiting strategy expires, the preset upgrade flow limiting strategy update cycle is reached, or the service set of the site changes.
[0119] Exemplarily, in order to make the upgraded current limiting strategy more suitable for actual scenarios and optimize the current limiting effect, the upgraded current limiting strategy can be updated as needed.
[0120] Exemplarily, for the upgraded current limiting strategy determined in the above manner, an expiration time can be set for it, or a refresh period can be set, and when the current upgraded current limiting strategy expires, or when the preset upgraded current limiting strategy update period is reached, it is determined that the upgraded current limiting strategy update conditions are met and the upgraded current limiting strategy is updated.
[0121] In addition, when the service set of a site changes, it can also be determined whether the upgraded current limiting strategy is met.
[0122] For example, the DMP can determine that the service set of a site has changed when it detects an instruction to modify the service configuration of the site. Alternatively, the DMP can provide an operation status management center that can automatically query the real-time status and records of service operations, determine which devices at the current site are performing which service operations, and thereby determine whether the service set of the site has changed.
[0123] Exemplarily, when it is determined that the update conditions of the upgraded current limiting policy are met, the upgraded current limiting policy may be updated, and each subordinate device of the site may be upgraded according to the updated upgraded current limiting policy.
[0124] The implementation method of DMP updating the upgraded current limiting policy can refer to the implementation method of determining the upgraded current limiting policy described above, and its specific implementation is not described here in detail.
[0125] In order to enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, the technical solutions provided in the embodiments of the present application are described below with reference to specific examples.
[0126] In this embodiment, considering that the central server bandwidth of the DMP in the DMP scenario is sufficient, but the downlink bandwidth of the routers of each site managed by the DMP is limited, the traditional central flow limiting solution is not applicable to the DMP scenario.
[0127] Taking the above problems into consideration, in this embodiment, by constructing a site model, discovering site equipment and topology, building a site equipment aggregation chain, and determining the site service bandwidth consumption, the available upgrade bandwidth of the site is determined in combination with the bandwidth threshold and service bandwidth consumption. Finally, based on the equipment aggregation chain, the available upgrade bandwidth of each device is determined, and a current limiting upgrade strategy is generated and executed to achieve the purpose of intelligent current limiting upgrade.
[0128] Combine the following Figure 2 The implementation process of the equipment intelligent current limiting upgrade solution provided in the embodiment of the present application is explained.
[0129] 1. Establish a site model: The site model is a digital facility model that mainly describes the properties of the site and its self-description, including key attributes such as site type and site bandwidth threshold.
[0130] Exemplarily, sites of the same type correspond to the same service sets.
[0131] 2. Fill in site instances: Automatically generate site management forms according to site attributes, and manually enter or batch import site instances.
[0132] 3. Discover the subordinate devices of the site: For any site instance, the devices in the local area network of the site (i.e. the subordinate devices of the site) can be automatically discovered and automatically added to the site through protocols such as device discovery protocol, device search protocol, multicast protocol or NETMAP protocol.
[0133] 4. Establish the physical topology of the site's subordinate equipment: Calculate the physical topology of the site's subordinate equipment through the SNMP protocol, LLDP protocol, and MAC address learning table.
[0134] For example, if the topology obtained through the protocol is incomplete, the topological nodes and relationships can be manually edited and added.
[0135] Exemplarily, for an NVR device, a sub-device IPC list may be obtained through an NVR interface to determine a topological relationship between the NVR and the IPC.
[0136] For example, the site topology diagram may be as follows: Figure 3 shown.
[0137] 5. Obtain the latest version of the site current limiting upgrade policy: The system sets a regular refresh cycle to refresh the site upgrade current limiting policy.
[0138] Exemplarily, when a change in a site service set is detected, a current limiting upgrade policy update may be triggered.
[0139] Exemplarily, when the current limit upgrade policy expires, the update of the current limit upgrade policy can be triggered.
[0140] 6. Generate a site device aggregation chain: If you need to generate a current limiting upgrade strategy, you can generate a site device aggregation chain based on the site physical topology and the relationship between the master and child devices.
[0141] Exemplarily, the device aggregation chain may be used to determine the upgrade available bandwidth of each subordinate device of the site.
[0142] Exemplarily, the need to generate a current limiting upgrade strategy may include: generating a current limiting upgrade strategy for the first time or satisfying a current limiting upgrade strategy update condition.
[0143] Exemplarily, in the process of generating a site device aggregation chain, it can be determined whether there are multiple sub-devices connected to the site's router through the same master device based on the physical topology of the subordinate devices of the site and the master-sub-device relationship between the subordinate devices.
[0144] In the case where it is determined that there are multiple sub-devices connected to the router of the site through the same main device, it can be determined that the multiple sub-devices and the main device belong to the same device aggregation chain.
[0145] For example, when multiple IPCs are connected to a router through the same NVR, the multiple IPCs and the NVR belong to the same device aggregation chain.
[0146] During the upgrade process, the upgrade package of the IPC can be sent to the NVR, and the NVR will upgrade the firmware of the IPC. That is, there is no need to send the upgrade package to each IPC in turn, but the upgrade packages of multiple IPCs can be aggregated through the NVR.
[0147] For the same device aggregation chain, when it is determined that the same sub-device in the device aggregation chain is connected to the main device through multiple channels, multiple channels connecting the same sub-device to the main device are aggregated into one aggregation channel.
[0148] For example, for a multi-target IPC, it has multiple channels that are mapped to NVR channels separately. These multi-target channels need to be aggregated into one IPC. Only one IPC upgrade package needs to be sent, and there is no need to send an upgrade package to each channel of the multi-target IPC. Therefore, multiple channels corresponding to the multi-target IPC can be aggregated.
[0149] like Figure 4 As shown, IPC2 is a binocular camera, and channel 1 and channel 2 of IPC2 are connected to channel 3 and channel m of NVR respectively. Channel 3 and channel m of NVR, as well as channel 1 and channel 2 of IPC2 can be aggregated to generate an aggregate channel.
[0150] It should be noted that since the business objects such as device streaming and snapshot data uploading are NVR channels, that is, IPC channels, when performing business set calculations, the multi-channel level rather than the device level will be used as the business mapping preset configuration (that is, business set calculations do not perform channel aggregation).
[0151] 7. Remotely collect the port bandwidth consumption of the topology root node router device: collect the port bandwidth consumption of the router through SNMP, private protocols, etc. If the router does not support the protocol to collect bandwidth consumption, perform 8 and 9, or perform 10.
[0152] 8. Obtaining a preset service set and bandwidth preset mapping table: The mapping table can be obtained by comprehensive calculation through each site device and its preset service type and data volume.
[0153] 9. Calculate the real-time bandwidth consumption of the site: The business sets in different scenario types correspond to different business bandwidth consumption.
[0154] Through the device aggregation chain of each site, the service set of each site and its mapped bandwidth consumption are calculated to determine the real-time bandwidth consumption of the site.
[0155] For example, in the case of a scene type site A, the service set includes real-time streaming + first type target snapshot images + second type target snapshot images, and the preset average bandwidth consumption is W=W1+W2+W3, where W1, W2, and W3 are the peak values of three types of services respectively.
[0156] Then W can be determined as the real-time bandwidth consumption of the site.
[0157] 10. Get the site bandwidth threshold M: The site bandwidth threshold is set as an attribute in the site model and is imported when the instance is entered.
[0158] 11. Determine the available bandwidth P for site upgrade: P = M *X% - W.
[0159] 12. Generate site upgrade current limiting strategy: Generate upgrade current limiting strategy based on upgrade available bandwidth, device aggregation chain and upgrade bandwidth allocation strategy.
[0160] Taking the upgrade bandwidth allocation strategy of average allocation as an example, suppose site 1 has 1 NVR, 5 IPCs (connected to the NVR), and 1 VA. The NVR and 5 IPCs belong to the same device aggregation chain, and VA belongs to another device aggregation chain. The upgrade current limiting strategy can be: the maximum speed limit of each device aggregation chain is P / 2; where P is the available bandwidth for the upgrade.
[0161] Assume that site 2 has 1 NVR, 5 IPCs (1 connected to the router alone, 4 connected to the NVR), and 1 VA. The NVR and the 4 IPCs connected to the NVR belong to the same device aggregation chain, the IPC connected to the router alone belongs to another device aggregation chain, and the VA belongs to another device aggregation chain (a total of 3 device aggregation chains). The upgrade current limiting strategy can be: the maximum speed limit of each device aggregation chain is P / 3.
[0162] 13. Determine the available bandwidth for upgrading each device based on the device aggregation chain: During batch upgrades, use single-channel or multi-channel current limiting based on the device aggregation chain, and combine the upgrade current limiting strategy of the device aggregation chain to calculate the available upgrade bandwidth for each device.
[0163] 14. Execute the current limiting upgrade strategy: When the DMP platform triggers a batch upgrade of devices, the Device Upgrade Service (DUS) will query the current limiting upgrade strategy and send upgrade signaling including URL to the corresponding devices according to the strategy; the devices that receive the upgrade signaling register with the DMP and obtain the upgrade package corresponding to the URL.
[0164] Exemplarily, the device upgrade service provides an upgrade package download service, and performs single-channel current limiting or multi-channel current limiting according to the current limiting upgrade strategy.
[0165] like Figure 5 As shown in the figure, the upgrade package current limiting download implementation process may include:
[0166] 1) When DMP receives a download request, DUS can read the target file from disk into memory.
[0167] 2) DUS writes data into the kernel send buffer through the write method, for example, writes data into the kernel send buffer through tomcat (a web application server).
[0168] Exemplarily, the maximum rate at which the upgrade package is downloaded by each subordinate device of the site can be determined according to the upgrade current limiting strategy, and the rate at which the DUS writes data into the kernel buffer can be controlled according to the maximum rate at which the upgrade package is downloaded.
[0169] For example, the execution time of the current method and the amount of data transferred (i.e., the execution time and the amount of data written by DUS to the kernel buffer) can be recorded to calculate the current average transfer rate. It is determined whether the current average transfer rate is greater than the maximum rate of the upgrade package download. If so, the thread is suspended for T time (e.g., 50 milliseconds) to delay the transmission, so that the interval between data packets is increased, thereby slowing down the download rate.
[0170] For example, when reading data, a token bucket algorithm can be used. The specific flow control algorithm process design can be as follows: Figure 6 shown.
[0171] like Figure 6 As shown in the figure, assuming the speed limit is 1MB / S, 1024*1024 tokens are generated per second, and the maximum number of tokens stored in the token bucket is 1048576. That is, only 1048576 bytes of data are allowed to be read per second, thus achieving the speed limit purpose.
[0172] During the upgrade package download process, determine the number of bytes that need to be downloaded this time (such as the number of bytes that need to be downloaded per second, that is, 1048576 bytes), and determine whether the corresponding number of tokens exists in the token bucket; if so, take out the corresponding number of tokens from the token bucket and read the data; otherwise, wait for the download until the corresponding number of tokens exists in the token bucket.
[0173] When the data is read, it can be determined whether the download of the upgrade package is completed.
[0174] If not finished, go to the step of determining the number of bytes to be downloaded this time.
[0175] Otherwise, end the current process.
[0176] 3) The operating system sends the data in the kernel buffer to the download requesting device.
[0177] The method provided by the present application is described above. The device provided by the present application is described below:
[0178] See also Figure 7 , is a schematic diagram of the structure of a device upgrade apparatus provided in an embodiment of the present application, such as Figure 7 As shown, the device upgrading apparatus may include:
[0179] A first determining unit is configured to determine, for any site managed by the device management platform, subordinate devices of the site and determine a physical topology of each subordinate device of the site;
[0180] The generating unit is configured to generate a device aggregation chain of the site according to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device; wherein multiple sub-devices of the router connected to the site through the same master device belong to the same device aggregation chain;
[0181] A second determining unit is configured to determine the service bandwidth consumption of the site, and determine the upgrade available bandwidth of the site according to the service bandwidth consumption of the site and the bandwidth threshold of the site;
[0182] The third determining unit is configured to determine an upgrade current limiting strategy for each subordinate device of the site according to the upgrade available bandwidth of the site and the device aggregation chain of the site;
[0183] The upgrading unit is configured to upgrade each subordinate device of the site according to the upgrading current limiting strategy.
[0184] The specific implementation process of each unit in the device upgrading apparatus to implement device upgrading can refer to the relevant description in the above method embodiment.
[0185] See also Figure 8, is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 801, a communication interface 802, a memory 803 and a communication bus 804. The processor 801, the communication interface 802 and the memory 803 communicate with each other through the communication bus 804. Among them, the memory 803 stores a computer program; the processor 801 can execute the device upgrade method described above by executing the program stored in the memory 803.
[0186] The memory 803 mentioned herein may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the memory 803 may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0187] The present application also provides a non-transitory machine-readable storage medium storing a computer program, such as Figure 8 The computer program may be provided by the memory 803 in the Figure 8 The processor 801 in the electronic device is executed to implement the device upgrade method described above.
[0188] The present application also provides a computer program stored in a non-transitory machine-readable storage medium, such as Figure 8 The memory 803 in the memory, and when the processor executes the computer program, it prompts the processor 801 to execute the device upgrading method described above.
Claims
1. A device upgrading method, characterized in that: include: For any site managed by the device management platform, determine the subordinate devices of the site and determine the physical topology of each subordinate device of the site; According to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device, a device aggregation chain of the site is generated; wherein multiple sub-devices connected to the router of the site through the same master device belong to the same device aggregation chain; Determine the service bandwidth consumption of the site, and determine the upgrade available bandwidth of the site according to the service bandwidth consumption of the site and the bandwidth threshold of the site; Determine the upgrade current limiting strategy for each subordinate device of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site; According to the upgrade current limiting strategy, upgrade each subordinate device of the site; The step of determining the upgrade current limiting strategy for each subordinate device of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site includes: According to the upgrade available bandwidth of the site and the device aggregation chain of the site, determine the upgrade current limiting strategy of each device aggregation chain of the site; For any device aggregation chain, the upgrade current limiting strategy of each device in the device aggregation chain is determined according to the upgrade current limiting strategy of the device aggregation chain.
2. The method according to claim 1, characterized in that The generating of the device aggregation chain of the site according to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device includes: When it is determined that there are multiple sub-devices connected to the router of the site through the same master device according to the physical topology of the subordinate devices of the site and the master-sub-device relationship between the subordinate devices, it is determined that the multiple sub-devices and the master device belong to the same device aggregation chain; For the same device aggregation chain, when it is determined that the same sub-device in the device aggregation chain is connected to the main device through multiple channels, multiple channels connecting the same sub-device to the main device are aggregated into one aggregation channel.
3. The method according to claim 1, characterized in that The determining of the service bandwidth consumption of the site includes: In the case where the router of the site supports the collection of bandwidth consumption by a protocol, the service bandwidth consumption of the router is collected by specifying a bandwidth information collection protocol, and the collected service bandwidth consumption is determined as the service bandwidth consumption of the site; In the case that the router of the site does not support the protocol collection bandwidth consumption, the service set of the site is determined according to the preset service type of each subordinate device of the site, and the service bandwidth consumption of the site is determined according to the service set of the site.
4. The method according to claim 1, characterized in that: Determining the upgrade current limiting strategy of each device aggregation chain of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site includes: The upgrade current limiting strategy of each device aggregation chain at the site is determined according to the upgrade available bandwidth of the site, the number of device aggregation chains at the site, and the upgrade bandwidth allocation strategy of the site.
5. The method according to claim 4, characterized in that Determining the upgrade current limiting strategy of each device in the device aggregation chain according to the upgrade current limiting strategy of the device aggregation chain includes: For a device aggregation chain including a master device and sub-devices, when the device aggregation chain is single-channel current limiting, the upgrade current limiting strategy of the device aggregation chain is determined as the upgrade current limiting strategy of each device in the device aggregation chain; In the case where the device aggregation chain is multi-channel current limiting, the upgrade current limiting strategy for each device in the device aggregation chain is determined based on the upgrade current limiting strategy of the device aggregation chain, the upgrade package type corresponding to each device in the device aggregation chain, and the number of upgrade package types corresponding to the device aggregation chain.
6. The method according to claim 1, characterized in that The upgrading of each subordinate device of the site according to the upgraded current limiting strategy includes: Determine the maximum rate of downloading the upgrade package of each subordinate device of the site according to the upgrade current limiting strategy; For any subordinate device of the site, when the device management platform receives a download request for the upgrade package for the device, it controls the rate at which the upgrade package file is read from the disk to the memory and the rate at which the upgrade package file is written from the memory to the kernel buffer based on the maximum download rate of the upgrade package for the device, and sends the data in the kernel buffer to the subordinate device.
7. The method according to claim 1, characterized in that The upgrading of each subordinate device of the site according to the upgraded current limiting strategy includes: When it is determined that the update conditions of the upgraded current limiting strategy are met, the upgraded current limiting strategy is updated, and each subordinate device of the site is upgraded according to the updated upgraded current limiting strategy; The conditions for satisfying the upgrade current limiting strategy update include one or more of the following: The current upgrade flow limiting strategy expires, the preset upgrade flow limiting strategy update cycle is reached, or the service set of the site changes.
8. A device upgrading apparatus, characterized in that: include: A first determining unit is configured to determine, for any site managed by the device management platform, subordinate devices of the site and determine a physical topology of each subordinate device of the site; The generating unit is configured to generate a device aggregation chain of the site according to the physical topology of each subordinate device of the site and the master-sub-device relationship between each subordinate device; wherein multiple sub-devices connected to the router of the site through the same master device belong to the same device aggregation chain; A second determining unit is configured to determine the service bandwidth consumption of the site, and determine the upgrade available bandwidth of the site according to the service bandwidth consumption of the site and the bandwidth threshold of the site; The third determining unit is configured to determine an upgrade current limiting strategy for each subordinate device of the site according to the upgrade available bandwidth of the site and the device aggregation chain of the site; An upgrading unit, configured to upgrade each subordinate device of the site according to the upgrading current limiting strategy; Among them, the third determination unit is specifically configured to determine the upgrade current limiting strategy of each device aggregation chain of the site based on the upgrade available bandwidth of the site and the device aggregation chain of the site; for any device aggregation chain, the upgrade current limiting strategy of each device in the device aggregation chain is determined based on the upgrade current limiting strategy of the device aggregation chain.
9. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 7 when executing a program stored in a memory.
Citation Information
Patent Citations
Aggregation link management method and apparatus
CN101340381A
Multipath load balancing method based on service awareness
CN103685054A