CN114172875B - Remote upgrading method and system for network camera and readable storage medium - Google Patents

Remote upgrading method and system for network camera and readable storage medium Download PDF

Info

Publication number
CN114172875B
CN114172875B CN202111472394.7A CN202111472394A CN114172875B CN 114172875 B CN114172875 B CN 114172875B CN 202111472394 A CN202111472394 A CN 202111472394A CN 114172875 B CN114172875 B CN 114172875B
Authority
CN
China
Prior art keywords
upgrading
upgrade
connectable
package
network camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111472394.7A
Other languages
Chinese (zh)
Other versions
CN114172875A (en
Inventor
欧阳昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xiaopai Technology Co ltd
Original Assignee
Shenzhen Xiaopai Technology Co ltd
Filing date
Publication date
Application filed by Shenzhen Xiaopai Technology Co ltd filed Critical Shenzhen Xiaopai Technology Co ltd
Priority to CN202111472394.7A priority Critical patent/CN114172875B/en
Publication of CN114172875A publication Critical patent/CN114172875A/en
Application granted granted Critical
Publication of CN114172875B publication Critical patent/CN114172875B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a remote upgrading method, a remote upgrading system and a readable storage medium of a network camera, wherein an original upgrading packet is downloaded from a remote server through first upgrading equipment to carry out upgrading; the first upgrading device finishes upgrading and sends a first search request for the first connectable device; the first upgrading device receives a first search response sent by the first connectable device based on the first search request; according to the first search response, the first upgrading device determines a second upgrading device in the first connectable device; the first upgrading device sends a first reorganization upgrading package generated based on the original upgrading package to the second upgrading device so that the second upgrading device can complete upgrading based on the first reorganization upgrading package. By means of the one-to-one propagation type upgrading between the devices, repeated redundant connection between the devices and the total server is reduced, bandwidth pressure can be reduced, and processing capacity of the processor is improved.

Description

Remote upgrading method and system for network camera and readable storage medium
Technical Field
The present invention relates to the field of remote upgrade, and in particular, to a method and system for remote upgrade of a network camera, and a readable storage medium.
Background
With the rapid development of society, the convergence effect of cities is more and more obvious, so that the social security requirement is more and more vigorous, the security industry is also developed rapidly, the IPC (Internet Protocol Camera, network camera) is used as the most basic security equipment at the forefront, the IPC is self-evident, and the IPC is used as the Internet of things equipment, and remote upgrading is an essential basic function. At present, the IPC batch remote upgrade scheme mostly executes a process of downloading an upgrade package from a remote server > verification of an upgrade package > upgrade for each device, and although this process is the simplest process for one device, it is redundant for a plurality of devices in a local area network that each device needs to download an upgrade package from a remote server. Therefore, how to reduce the repeated work of downloading the upgrade package from the remote server for each device in the IPC batch upgrade process, and optimize the upgrade process becomes a current urgent problem to be solved.
Disclosure of Invention
The invention mainly aims to provide a remote upgrading method and system for a network camera and a readable storage medium, and aims to solve the problem of redundancy repetition in the IPC batch upgrading process and optimize the upgrading process.
In order to achieve the above object, the present invention provides a method for remotely upgrading a network camera, the method comprising the steps of:
the first upgrading device downloads an original upgrading packet from a remote server to upgrade;
the first upgrading device finishes upgrading and sends a first search request for the first connectable device;
The first upgrading device receives a first search response sent by the first connectable device based on the first search request;
According to the first search response, the first upgrading device determines a second upgrading device in the first connectable device;
The first upgrading device sends a first reorganization upgrading package generated based on the original upgrading package to the second upgrading device so that the second upgrading device can complete upgrading based on the first reorganization upgrading package.
Optionally, after the step of sending, by the first upgrade apparatus, the first reorganized upgrade packet generated based on the original upgrade packet to the second upgrade apparatus, the method includes:
The second upgrading device finishes upgrading and sends a second search request for the second connectable device;
the second upgrading device receives a second search response sent by the second connectable device based on the second search request;
According to the second search response, the second upgrading device determines a third upgrading device in the second connectable device;
and the second upgrading device sends a second recombined upgrading packet generated based on the first recombined upgrading packet to the third upgrading device so that the third upgrading device can finish upgrading based on the second recombined upgrading packet.
Optionally, after the step of sending the upgrade package to the second upgrade device by the first upgrade device to complete the upgrade by the second upgrade device based on the upgrade package, the method further includes:
the second upgrading device finishes upgrading, and the first upgrading device continues to send a third search request for a third connectable device;
the first upgrading device receives a third search response sent by the third connectable device based on the third search request;
according to the third search response, the first upgrading device determines a fourth upgrading device in the third connectable device;
the first upgrading device sends the first reorganization upgrading package generated based on the original upgrading package to the fourth upgrading device so that the fourth upgrading device can complete upgrading based on the first reorganization upgrading package.
Optionally, the step of downloading, by the first upgrade device, the original upgrade package from the remote server, and performing the upgrade includes:
the first upgrading device negotiates an original encryption key with a remote server;
the first upgrading device downloads an original upgrading packet from a remote server;
The first upgrading device decrypts the original upgrading package by using the original encryption key and upgrades the original upgrading package.
Optionally, the step of sending the first search request to the first connectable device after the first upgrading device completes upgrading includes:
The first upgrading device finishes upgrading and determines first connectable devices with network connection in the connection range of the local area network;
The first upgrading device sends a first search request to the first connectable device, wherein the first search request comprises a broadcast search packet.
Optionally, the first search response includes a device model number and a current version number;
the step of determining, by the first upgrade device, a second upgrade device in the first connectable device according to the first search response includes:
judging whether the equipment model of the first connectable equipment is the same as the equipment model of the first upgrading equipment;
If yes, judging whether the current version number of the first connectable equipment is lower than the current version number of the first upgrading equipment;
if yes, the first connectable equipment is determined to be second upgrading equipment.
Optionally, before the step of sending the first reorganization upgrade package to the second upgrade device by the first upgrade device to complete the upgrade based on the second reorganization upgrade package, the first upgrade device includes:
the first upgrading device initiates a connection request to the second upgrading device;
and the first upgrading equipment receives the connection response of the second upgrading equipment and establishes connection.
Optionally, the step that the first upgrade device sends the first reorganization upgrade package to the second upgrade device, so that the second upgrade device completes the upgrade based on the second reorganization upgrade package includes:
the first upgrading device negotiates a second encryption key with the second upgrading device;
the first upgrading device reads and generates the first reorganization upgrading packet, and encrypts the first reorganization upgrading packet by using the second encryption key;
the first upgrading device sends the encrypted first reorganization upgrading packet to the second upgrading device so that the second upgrading device decrypts the first reorganization upgrading packet based on the second encryption key and completes upgrading.
In addition, in order to achieve the above object, the present invention also provides a remote upgrade system for a network camera, the remote upgrade system for a network camera comprising: the network camera remote upgrading system comprises a memory, a processor and a network camera remote upgrading program which is stored in the memory and can run on the processor, wherein the network camera remote upgrading program realizes the steps of the network camera remote upgrading method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a readable storage medium having stored thereon the network camera remote upgrade program, which when executed by a processor, implements the steps of the network camera remote upgrade method as described above.
The embodiment of the invention provides a remote upgrading method, a remote upgrading system and a readable storage medium for a network camera, wherein an original upgrading packet is downloaded from a remote server through first upgrading equipment to carry out upgrading; the first upgrading device finishes upgrading and sends a first search request for the first connectable device; the first upgrading device receives a first search response sent by the first connectable device based on the first search request; according to the first search response, the first upgrading device determines a second upgrading device in the first connectable device; the first upgrading device sends a first reorganization upgrading package generated based on the original upgrading package to the second upgrading device so that the second upgrading device can complete upgrading based on the first reorganization upgrading package. Because the first upgrade device can send the first reorganization upgrade package generated based on the original upgrade package to the second upgrade device, so that the second upgrade device upgrades according to the first reorganization upgrade package, thereby replacing the repeated action generated by the second upgrade device also directly obtaining the upgrade package from the remote server, the one-to-one propagation mode of the upgrade package between the devices can further realize the one-to-one propagation of the devices, the repeated redundant connection between the devices and the server is reduced, the bandwidth influence on the upgrade server during the IPC batch remote upgrade is reduced, the bandwidth pressure is reduced, and the processing capacity of the processor is improved.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of a remote upgrade method for a network camera according to the present invention;
FIG. 3 is a flowchart of a second embodiment of a remote upgrade method for a network camera according to the present invention;
FIG. 4 is a flowchart of a third embodiment of a remote upgrade method for a network camera according to the present invention;
FIG. 5 is a schematic diagram of a key interaction flow in the first, second and third embodiments of the remote upgrade method of the network camera of the present invention;
Fig. 6 is a topology diagram of a device upgrade in a preferred embodiment of the network camera remote upgrade method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a terminal structure of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC (personal computer ) or terminal equipment with display function such as a tablet personal computer, a portable computer, a server and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit ), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., wireless-Fidelity, wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 1 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a network camera remote upgrade program may be included in a memory 1005, which is one type of computer storage medium.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client and communicating data with the client; and the processor 1001 may be configured to call a remote upgrade program of the web camera stored in the memory 1005 and perform the following operations:
the first upgrading device downloads an original upgrading packet from a remote server to upgrade;
the first upgrading device finishes upgrading and sends a first search request for the first connectable device;
The first upgrading device receives a first search response sent by the first connectable device based on the first search request;
According to the first search response, the first upgrading device determines a second upgrading device in the first connectable device;
The first upgrading device sends a first reorganization upgrading package generated based on the original upgrading package to the second upgrading device so that the second upgrading device can complete upgrading based on the first reorganization upgrading package.
Further, the processor 1001 may call the network camera remote upgrade program stored in the memory 1005, and further perform the following operations:
The second upgrading device finishes upgrading and sends a second search request for the second connectable device;
the second upgrading device receives a second search response sent by the second connectable device based on the second search request;
According to the second search response, the second upgrading device determines a third upgrading device in the second connectable device;
and the second upgrading device sends a second recombined upgrading packet generated based on the first recombined upgrading packet to the third upgrading device so that the third upgrading device can finish upgrading based on the second recombined upgrading packet.
Further, the processor 1001 may call the network camera remote upgrade program stored in the memory 1005, and further perform the following operations:
the second upgrading device finishes upgrading, and the first upgrading device continues to send a third search request for a third connectable device;
the first upgrading device receives a third search response sent by the third connectable device based on the third search request;
according to the third search response, the first upgrading device determines a fourth upgrading device in the third connectable device;
the first upgrading device sends the first reorganization upgrading package generated based on the original upgrading package to the fourth upgrading device so that the fourth upgrading device can complete upgrading based on the first reorganization upgrading package.
Further, the processor 1001 may call the network camera remote upgrade program stored in the memory 1005, and further perform the following operations:
the first upgrading device negotiates an original encryption key with a remote server;
the first upgrading device downloads an original upgrading packet from a remote server;
The first upgrading device decrypts the original upgrading package by using the original encryption key and upgrades the original upgrading package.
Further, the processor 1001 may call the network camera remote upgrade program stored in the memory 1005, and further perform the following operations:
The first upgrading device finishes upgrading and determines first connectable devices with network connection in the connection range of the local area network;
The first upgrading device sends a first search request to the first connectable device, wherein the first search request comprises a broadcast search packet.
Further, the first search response includes a device model number and a current version number, and the processor 1001 may call the remote upgrade program of the webcam stored in the memory 1005, and further perform the following operations:
judging whether the equipment model of the first connectable equipment is the same as the equipment model of the first upgrading equipment;
If yes, judging whether the current version number of the first connectable equipment is lower than the current version number of the first upgrading equipment;
if yes, the first connectable equipment is determined to be second upgrading equipment.
Further, the processor 1001 may call the network camera remote upgrade program stored in the memory 1005, and further perform the following operations:
the first upgrading device initiates a connection request to the second upgrading device;
and the first upgrading equipment receives the connection response of the second upgrading equipment and establishes connection.
Further, the processor 1001 may call the network camera remote upgrade program stored in the memory 1005, and further perform the following operations:
the first upgrading device negotiates a second encryption key with the second upgrading device;
the first upgrading device reads and generates the first reorganization upgrading packet, and encrypts the first reorganization upgrading packet by using the second encryption key;
the first upgrading device sends the encrypted first reorganization upgrading packet to the second upgrading device so that the second upgrading device decrypts the first reorganization upgrading packet based on the second encryption key and completes upgrading.
Based on the hardware structure, various embodiments of the network camera remote upgrading method are provided.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a remote upgrade method for a network camera according to the present invention.
In this embodiment, the remote upgrade method for a network camera includes:
Step S10, the first upgrading device downloads an original upgrading packet from a remote server to upgrade;
in this embodiment, the remote server may be configured to provide an upgrade package to an IPC device that needs to be upgraded remotely, where the upgrade package provided by the remote server is the original upgrade package, and the original upgrade package may be obtained by the first upgrade device and then used for version upgrade of the device.
When a plurality of IPC devices exist in the same local area network and need to be upgraded to a new version, the first IPC device which is successfully connected with the remote server and downloads an original upgrade package from the remote server is the first upgrade device, wherein the IPC device serving as the first upgrade device can be directly designated in the plurality of IPC devices, or the plurality of IPC devices can send connection requests to the remote server, and the IPC device connected with the remote server firstly becomes the first upgrade device.
Further, the step S10 may include:
step S11, the first upgrading device negotiates an original encryption key with a remote server;
The original encryption key is used for encoding and decoding the original upgrade package, and can be determined by the first upgrade device and the remote server in a key protocol establishment mode.
Step S12, the first upgrading device downloads an original upgrading packet from a remote server;
Step S13, the first upgrade device decrypts the original upgrade package by using the original encryption key, and upgrades the original upgrade package.
In this embodiment, the first upgrade apparatus may perform version upgrade first based on the original upgrade package acquired from the remote server. Specifically, when a plurality of network cameras needing to be upgraded exist in the same local area network, the first network camera which is successfully connected with the server and acquires the original upgrade package from the first network camera starts to carry out version upgrade.
Step S20, the first upgrading device finishes upgrading and sends a first search request for the first connectable device;
The first search request can be automatically sent out after the first upgrading equipment finishes the local upgrading, and is used for searching the IPC equipment which can establish connection with the first upgrading equipment in the same local area network range at the current time, and the IPC equipment which can establish connection with the first upgrading equipment in the same local area network range at the current time can respond to the first search request.
The first connectable device is an IPC device capable of being connected with a first upgrading device in the same local area network at the current time, and it is understood that the first connectable device may be a plurality of IPC devices.
Further, the step S20 may include:
step S21, the first upgrading device finishes upgrading, and the first connectable device with network connection is determined to exist in the connection range of the local area network;
In step S22, the first upgrade device sends a first search request to the first connectable device, where the first search request includes a broadcast search packet.
The broadcast search packet is a broadcast packet with a search function sent by the first upgrade device, and may broadcast a search signal to all first connectable devices.
In this embodiment, after the first upgrade device is successfully upgraded to the new version, a first search request is sent to other devices needing to be upgraded in the local area network, specifically, after the first network camera finishes the upgrade, other network cameras needing to be upgraded are searched in the local area network, and the search mode may be a mode of sending a broadcast search packet to perform the search.
Step S30, the first upgrading device receives a first search response sent by the first connectable device based on the first search request;
The first search response is a response returned to the first upgrading device by the first connectable device after receiving the first search request sent by the first upgrading device, and the response can be received by the first upgrading device. The first search response may include a device model number and a current version number.
Specifically, after the first network camera which completes the upgrade searches other network cameras needing to be upgraded in the local area network, the first network camera receives responses sent by the other network cameras needing to be upgraded.
Step S40, according to the first search response, the first upgrading device determines a second upgrading device in the first connectable device;
The second upgrading device is an IPC device to be upgraded, which is the same as the first upgrading device in model and lower than the version of the first upgrading device, in the same local area network, and the first upgrading device and the second upgrading device are in one-to-one connection so as to realize one-to-one propagation of the upgrading package between the first upgrading device and the second upgrading device.
Further, the step S40 may include:
step S41, judging whether the equipment model of the first connectable equipment is the same as the equipment model of the first upgrading equipment;
step S42, if yes, judging whether the current version number of the first connectable device is lower than the current version number of the first upgrading device;
and step S43, if yes, determining the first connectable equipment as second upgrading equipment.
In this embodiment, since the first upgrade apparatus is only connected to one apparatus at a time, although there are multiple first connectable apparatuses in the same lan, the first upgrade apparatus eventually still needs to determine a unique apparatus among the multiple first connectable apparatuses by sending a first search request and receiving a first search response, and use the unique apparatus as a second upgrade apparatus, and establish connection with the second upgrade apparatus, so as to transfer an upgrade package, so that an upgrade process of the second upgrade apparatus no longer needs to repeat connection with a server and upgrade package acquisition, thereby reducing bandwidth pressure.
Further, no matter when the IPC device receives the search request or receives the search response, the received objects are always ordered in sequence, in this embodiment, the first upgrading device always performs condition judgment on the first connectable device corresponding to the first search response received first according to the order of receiving the response, and if the condition is met, the first upgrading device determines that the first connectable device with the same device model and a lower current version number is the second upgrading device.
Specifically, the first network camera which completes the upgrade determines the network camera which transmits the one-to-one upgrade packet to the first network camera through the preset condition judgment according to the received responses sent by other network cameras which need to be upgraded.
Step S50, the first upgrade device sends a first reorganized upgrade package generated based on the original upgrade package to the second upgrade device, so that the second upgrade device completes upgrade based on the first reorganized upgrade package.
Further, the step S50 may include:
step S48, the first upgrading device initiates a connection request to the second upgrading device;
The connection request may be a proprietary protocol TCP (Transmission Control Protocol ) connection request, among others.
In step S49, the first upgrade device receives the connection response of the second upgrade device, and establishes a connection.
In this embodiment, the connection is performed in a manner of establishing a private protocol, so that a leakage risk can be prevented, and data transmission between the first upgrade device and the second upgrade device can be performed safely.
Further, the step S50 may include:
step S51, the first upgrading device negotiates a second encryption key with the second upgrading device;
In this embodiment, when the first upgrade apparatus and the second upgrade apparatus negotiate a second encryption key, a key interaction method based on an ECDH (Elliptic Curve Diffie-HELLMAN KEY Exchange ) algorithm may be used to perform key Exchange.
Step S52, the first upgrade device reads and generates the first reorganization upgrade package, and uses the second encryption key to encrypt;
The first reorganization upgrade package may be an upgrade package formed by the first upgrade device reading uboot, kernel, rootfs from the local FLASH and encrypting the upgrade package by using the second encryption key.
Step S53, the first upgrade device sends the encrypted first reorganized upgrade packet to the second upgrade device, so that the second upgrade device decrypts the first reorganized upgrade packet based on the second encryption key and completes the upgrade.
In this embodiment, the upgrade package sent by the first upgrade device to the second upgrade device is not the original upgrade package obtained by the first upgrade device from the remote server at first, but is obtained by the first upgrade device after being read from the local FLASH and being encrypted, and the upgrade of the device to the new version can be realized by either the original upgrade package or the first reorganization upgrade package.
Specifically, after determining the equipment to be upgraded which transmits the upgrade package to the first network camera, the first network camera sends the reorganization upgrade package read from the local to the equipment to be upgraded so as to finish equipment upgrade.
The embodiment of the invention provides a remote upgrading method for a network camera, which comprises the steps of downloading an original upgrading packet from a remote server through first upgrading equipment to upgrade; the first upgrading device finishes upgrading and sends a first search request for the first connectable device; the first upgrading device receives a first search response sent by the first connectable device based on the first search request; according to the first search response, the first upgrading device determines a second upgrading device in the first connectable device; the first upgrading device sends a first reorganization upgrading package generated based on the original upgrading package to the second upgrading device so that the second upgrading device can complete upgrading based on the first reorganization upgrading package. Because the first upgrade device can send the first reorganization upgrade package generated based on the original upgrade package to the second upgrade device, so that the second upgrade device upgrades according to the first reorganization upgrade package, and repeated actions generated by directly acquiring the upgrade package from a remote server by the second upgrade device are replaced, the one-to-one propagation mode of the upgrade package between the devices can be further realized, the one-to-one propagation mode between the devices can be realized, the management operation difficulty of the devices can be reduced, the bandwidth pressure can be reduced while repeated redundant connection is reduced, the processing capacity of a processor is improved, and the leakage risk in the upgrade package transmission process can be effectively prevented by carrying out one-to-one encryption transmission on the upgrade package.
Further, referring to fig. 3, a second embodiment of the remote upgrade method for a network camera according to the present invention is proposed, and based on the first embodiment, after the step S50, the method includes:
step a10, the second upgrading device finishes upgrading and sends a second search request for a second connectable device;
In this embodiment, the second search request may be automatically sent by the second upgrade device after the second upgrade device completes the local upgrade, so as to find the IPC device capable of establishing connection with the second upgrade device within the same local area network at the current time, where the IPC device capable of establishing connection with the second upgrade device within the same local area network at the current time can respond to the second search request.
The second connectable device is an IPC device capable of being connected with a second upgrading device in the same local area network at the current time, and it is understood that the second connectable device may be a plurality of IPC devices.
Step a20, the second upgrading device receives a second search response sent by the second connectable device based on the second search request;
The second search response is a response returned to the second upgrading device by the second connectable device after receiving the second search request sent by the second upgrading device, and the response can be received by the second upgrading device. The second search response may include a device model number and a current version number.
Step a30, according to the second search response, the second upgrading device determines a third upgrading device in the second connectable device;
The third upgrading device is an IPC device to be upgraded, which is the same as the second upgrading device in the same local area network and is lower than the second upgrading device in version, and the second upgrading device and the third upgrading device are in one-to-one connection so as to realize one-to-one propagation of the upgrading package between the second upgrading device and the third upgrading device.
Further, the second upgrading device always performs condition judgment on the second connectable device corresponding to the first received second search response according to the sequence of the received responses, namely, whether the device model of the second connectable device is the same as that of the second upgrading device is judged first, if yes, whether the current version number of the second connectable device is lower than that of the second upgrading device is judged, and if yes, the second upgrading device determines the second connectable device with the same device model and lower current version number as the third upgrading device.
Step a40, the second upgrade device sends a second reconfiguration upgrade packet generated based on the first reconfiguration upgrade packet to the third upgrade device, so that the third upgrade device can complete upgrade based on the second reconfiguration upgrade packet.
The second re-upgrading packet may be an upgrading packet formed by the second upgrading device reading uboot, kernel, rootfs from the local FLASH and encrypting the second upgrading packet by using an encryption key, where the encryption key may be obtained by performing key exchange by the second upgrading device and the third upgrading device by using a key interaction method based on an ECDH algorithm.
In this embodiment, the second upgrading device completes the upgrading, and sends out a second search request for the second connectable device; the second upgrading device receives a second search response sent by the second connectable device based on the second search request; according to the second search response, the second upgrading device determines a third upgrading device in the second connectable device; and the second upgrading device sends a second recombined upgrading packet generated based on the first recombined upgrading packet to the third upgrading device so that the third upgrading device can finish upgrading based on the second recombined upgrading packet. Because the equipment after successful upgrading can read related data from the local FLASH to obtain the reorganized upgrading packet, the reorganized upgrading packet is transmitted to other equipment which needs to be upgraded in the same local area network one by one so as to be used for the equipment waiting for upgrading to finish upgrading, the cardinality of the equipment for transmitting the reorganized upgrading packet is continuously increased, the speed and the efficiency of one-to-one upgrading of the propagation type are ensured to a certain extent, and the searching and propagation processes of the upgrading packet are automatically linked, so that the operation and the management of remote upgrading are simplified.
Further, referring to fig. 4, a third embodiment of the remote upgrade method for a network camera according to the present invention is provided, based on the first embodiment, after the step S50, the method further includes:
Step b10, the second upgrading device finishes upgrading, and the first upgrading device continues to send a third search request for a third connectable device;
in this embodiment, the third search request may be automatically sent by the first upgrade device after the upgrade packet transmission with the second upgrade device is completed, so as to find an IPC device capable of establishing a connection with the first upgrade device within the same local area network at the current time, where the IPC device capable of establishing a connection with the first upgrade device within the same local area network at the current time can respond to the third search request.
After the third connectable device completes the transmission of the upgrade packet between the first upgrade device and the second upgrade device, the third connectable device can be a plurality of IPC devices in the same local area network capable of being connected with the first upgrade device at the current time.
Step b20, the first upgrading device receives a third search response sent by the third connectable device based on the third search request;
the third search response is a response returned to the first upgrading device by the third connectable device after receiving the third search request sent by the first upgrading device, and the response can be received by the first upgrading device. The third search response may include a device model number and a current version number.
Step b30, according to the third search response, the first upgrading device determines a fourth upgrading device in the third connectable device;
The fourth upgrading device is an IPC device to be upgraded, which is the same as the first upgrading device in model and lower than the version of the first upgrading device, in the same local area network, and the first upgrading device and the fourth upgrading device are in one-to-one connection so as to realize one-to-one propagation of the upgrading package between the first upgrading device and the fourth upgrading device.
Further, the first upgrade device always performs condition judgment on the third connectable device corresponding to the first received third search response according to the sequence of the received responses, namely, whether the device model of the third connectable device is the same as that of the first upgrade device is judged first, if yes, whether the current version number of the third connectable device is lower than that of the first upgrade device is judged, and if yes, the first upgrade device determines the third connectable device with the same device model and a lower current version number as a fourth upgrade device.
Step b40, the first upgrade device sends the first reorganization upgrade package generated based on the original upgrade package to the fourth upgrade device, so that the fourth upgrade device completes upgrade based on the first reorganization upgrade package.
The first reorganization upgrade package can be an upgrade package formed by the first upgrade device reading uboot, kernel, rootfs from the local FLASH and encrypting the upgrade package by using an encryption key, wherein the encryption key can be obtained by the first upgrade device and the fourth upgrade device through key exchange by using a key interaction method based on an ECDH algorithm.
In this embodiment, the second upgrade device completes the upgrade, and the first upgrade device continues to send a third search request for a third connectable device; the first upgrading device receives a third search response sent by the third connectable device based on the third search request; according to the third search response, the first upgrading device determines a fourth upgrading device in the third connectable device; the first upgrading device sends the first reorganization upgrading package generated based on the original upgrading package to the fourth upgrading device so that the fourth upgrading device can complete upgrading based on the first reorganization upgrading package. Because each device after successful upgrading is completed, after one-to-one upgrade package transmission and upgrading are completed, next one-to-one upgrade package transmission and upgrading can be automatically started, the transmission frequency is not limited, the speed and the efficiency of one-to-one upgrade of the device are ensured to a certain extent, and the repeated automatic transmission of the same device also plays a role in simplifying the upgrading process.
Further, referring to fig. 5, fig. 5 is a schematic diagram of a key interaction flow in the first, second and third embodiments of the remote upgrade method for a network camera according to the present invention:
Step c10, two devices A and B exist, and the two devices default to use the same key interaction algorithm and two auxiliary parameters g and p for key calculation;
step c20, device a generates a random number as the local private key PriA and generates device a's public key PubA by g-PriA mod p= PubA;
step c30, the device a sends the public key PubA to the device B through a private protocol;
Step c40, device B generates a random number as the local private key PriB and generates device B's public key PubB by g-PriB mod p= PubB;
step c50, the device B sends the public key PubB to the device a through a private protocol;
Step c60, device B generates a symmetric key KB by k= PubA ≡prib mod p using PubA and PriB;
step c70, device a generates symmetric key KA by k= PubB ≡pria mod p using PubB and PriA;
Step c80, ka=kb, i.e. both obtain the same key, which is the key used for the upgrade package encryption.
The device is preferably an IPC device, i.e. a webcam.
The first upgrade device in the first embodiment of the present invention may be regarded as a device a in the above-mentioned key interaction process, and the second upgrade device may be regarded as a device B in the above-mentioned key interaction process. The first upgrading device and the second upgrading device can negotiate to obtain the second encryption password based on the key interaction method.
The second upgrade apparatus in the second embodiment of the present invention may also be regarded as the apparatus a in the key interaction process described above, and the third upgrade apparatus may also be regarded as the apparatus B in the key interaction process described above.
The first upgrade apparatus in the third embodiment of the present invention may also be regarded as the apparatus a in the key interaction process, and the fourth upgrade apparatus may also be regarded as the apparatus B in the key interaction process.
Through the embodiment, one-to-one secret transmission of the reorganization upgrade package between the first upgrade device and the second upgrade device in the first embodiment, between the second upgrade device and the third upgrade device in the second embodiment, and between the first upgrade device and the fourth upgrade device in the third embodiment can be realized, and the security of remote upgrade of the device is enhanced.
Further, referring to fig. 6, fig. 6 is a topology diagram of device upgrade in a preferred embodiment of the network camera remote upgrade method of the present invention.
In this embodiment, the device a may be used as the first upgrade device in the present invention, which obtains the original upgrade package from the remote server and upgrades the upgrade at time 1;
Further, the device B may be used as the second upgrade device in the present invention, and after the device a finishes upgrading, the device B transmits the first reorganized upgrade packet to the device B at time 2, so that the device B finishes upgrading;
Further, the device C may be used as the third upgrade device in the present invention, the device D may be used as the fourth upgrade device in the present invention, and after the device B finishes the upgrade, the second reconfiguration upgrade packet is transmitted to the device C at time 3, so that the device C finishes the upgrade; meanwhile, after the upgrade package transmission between the equipment A and the equipment B is finished, the equipment A transmits the first reorganization upgrade package to the equipment D at the time 3 so that the equipment D can finish the upgrade;
Further, at time 4, the device C, the device B, the device D and the device a transmit the reorganized upgrade package read from the local FLASH to the device E, the device F, the device G and the device H, respectively, where the upgrade package transmission process between the device C and the device E, between the device B and the device F, and between the device D and the device G may be regarded as an extension of the second embodiment of the present invention, and the upgrade package transmission process between the device a and the device H may be regarded as an extension of the third embodiment of the present invention.
Based on the second and third embodiments of the present invention, the transmission process of the reorganized upgrade package may repeatedly occur between the IPC device that has completed the upgrade and the IPC device to be upgraded until all IPC devices of the same type in the same local area network complete the upgrade.
It can be understood that each IPC device that has completed the upgrade can be repeatedly connected with a separate IPC device to be upgraded, and the transmission of the reorganized upgrade packet is performed, so that the IPC device to be upgraded can complete the upgrade.
The invention also provides a remote upgrading system of the network camera, which comprises: the method for remotely upgrading the network camera comprises a memory, a processor and a network camera remote upgrading program which is stored in the memory and can run on the processor, wherein the network camera remote upgrading program realizes the steps of the method for remotely upgrading the network camera according to any one of the embodiments when being executed by the processor.
The invention also provides a readable storage medium, wherein the readable storage medium stores the remote upgrade program of the network camera, and the remote upgrade program of the network camera realizes the steps of the remote upgrade method of the network camera according to any embodiment when being executed by a processor.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (9)

1. The remote upgrading method for the network camera is characterized by comprising the following steps of:
the method comprises the steps that a first upgrading device downloads an original upgrading packet from a remote server to upgrade, wherein the first upgrading device is an IPC device which is connected with the remote server first and sends a connection request to the remote server by a plurality of IPC devices;
the first upgrading device finishes upgrading and sends a first search request for the first connectable device;
The first upgrading device receives a first search response sent by the first connectable device based on the first search request;
According to the first search response, the first upgrading device determines a second upgrading device in the first connectable device;
The first upgrading device sends a first reorganization upgrading package generated based on the original upgrading package to the second upgrading device so that the second upgrading device can complete upgrading based on the first reorganization upgrading package;
the first upgrade device sends a first reorganization upgrade package to a second upgrade device for the second upgrade device to complete the upgrade based on the first reorganization upgrade package, including:
the first upgrading device negotiates a second encryption key with the second upgrading device;
reading uboot, kernel, rootfs the first upgrading device from the local device to generate the first reorganization upgrading packet, and performing encryption processing by using the second encryption key;
The first upgrading device sends the encrypted first reorganization upgrading packet to the second upgrading device so that the second upgrading device decrypts the first reorganization upgrading packet based on the second encryption key and completes upgrading;
the step of negotiating a second encryption key with the second upgrade apparatus by the first upgrade apparatus includes:
two devices A and B exist, and the two devices default to use the same key interaction algorithm and two auxiliary parameters g and p for key calculation;
device a generates a random number as the local private key PriA and generates device a's public key PubA by g-PriA mod p= PubA;
The device A sends the public key PubA to the device B through a private protocol;
Device B generates a random number as the local private key PriB and generates device B's public key PubB by g-PriB mod p= PubB;
the device B sends the public key PubB to the device A through a private protocol;
Device B generates a symmetric key KB by k= PubA ∈prib mod p using PubA and PriB;
device a generates a symmetric key KA over k= PubB ∈pria mod p using PubB and PriA;
ka=kb, i.e. both sides obtain the same key, which is the key used for encryption of the upgrade package, where the first upgrade device is regarded as device a and the second upgrade device is regarded as device B;
The method further comprises the steps of:
and the first upgrading device judges the condition of the first connectable device corresponding to the first search response received first according to the sequence of the received responses, and if the condition is met, the first upgrading device determines the first connectable device as the second upgrading device.
2. The network camera remote upgrade method according to claim 1, wherein after the step of the first upgrade apparatus transmitting the first reorganized upgrade package generated based on the original upgrade package to the second upgrade apparatus, the first upgrade apparatus comprises:
The second upgrading device finishes upgrading and sends a second search request for the second connectable device;
the second upgrading device receives a second search response sent by the second connectable device based on the second search request;
According to the second search response, the second upgrading device determines a third upgrading device in the second connectable device;
and the second upgrading device sends a second recombined upgrading packet generated based on the first recombined upgrading packet to the third upgrading device so that the third upgrading device can finish upgrading based on the second recombined upgrading packet.
3. The network camera remote upgrade method according to claim 1, wherein the first upgrade apparatus transmits the first reorganization upgrade package to a second upgrade apparatus for the second upgrade apparatus to complete the step of upgrading based on the first reorganization upgrade package, further comprising:
the second upgrading device finishes upgrading, and the first upgrading device continues to send a third search request for a third connectable device;
the first upgrading device receives a third search response sent by the third connectable device based on the third search request;
according to the third search response, the first upgrading device determines a fourth upgrading device in the third connectable device;
the first upgrading device sends the first reorganization upgrading package generated based on the original upgrading package to the fourth upgrading device so that the fourth upgrading device can complete upgrading based on the first reorganization upgrading package.
4. The remote upgrade method of network camera according to claim 1, wherein the first upgrade apparatus downloads an original upgrade package from a remote server, and the upgrade method comprises:
the first upgrading device negotiates an original encryption key with a remote server;
the first upgrading device downloads an original upgrading packet from a remote server;
The first upgrading device decrypts the original upgrading package by using the original encryption key and upgrades the original upgrading package.
5. The network camera remote upgrade method according to claim 1, wherein the step of the first upgrade apparatus completing the upgrade and transmitting a first search request for the first connectable apparatus comprises:
The first upgrading device finishes upgrading and determines first connectable devices with network connection in the connection range of the local area network;
The first upgrading device sends a first search request to the first connectable device, wherein the first search request comprises a broadcast search packet.
6. The network camera remote upgrade method according to claim 1, wherein the first search response includes a device model number and a current version number;
the step of determining, by the first upgrade device, a second upgrade device in the first connectable device according to the first search response includes:
judging whether the equipment model of the first connectable equipment is the same as the equipment model of the first upgrading equipment;
If yes, judging whether the current version number of the first connectable equipment is lower than the current version number of the first upgrading equipment;
if yes, the first connectable equipment is determined to be second upgrading equipment.
7. The method of claim 1, wherein the first upgrade apparatus transmits a first reorganized upgrade package to a second upgrade apparatus for the second upgrade apparatus to complete the step of upgrading based on the first reorganized upgrade package, comprising:
the first upgrading device initiates a connection request to the second upgrading device;
and the first upgrading equipment receives the connection response of the second upgrading equipment and establishes connection.
8. A network camera remote upgrade system, the network camera remote upgrade system comprising: a memory, a processor and a network camera remote upgrade program stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the network camera remote upgrade method according to any one of claims 1 to 7.
9. A readable storage medium, wherein the readable storage medium has stored thereon the network camera remote upgrade program, which when executed by a processor, implements the steps of the network camera remote upgrade method according to any one of claims 1 to 7.
CN202111472394.7A 2021-12-03 Remote upgrading method and system for network camera and readable storage medium Active CN114172875B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111472394.7A CN114172875B (en) 2021-12-03 Remote upgrading method and system for network camera and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111472394.7A CN114172875B (en) 2021-12-03 Remote upgrading method and system for network camera and readable storage medium

Publications (2)

Publication Number Publication Date
CN114172875A CN114172875A (en) 2022-03-11
CN114172875B true CN114172875B (en) 2024-06-25

Family

ID=

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021031889A1 (en) * 2019-08-16 2021-02-25 中兴通讯股份有限公司 Upgrade method, communication device and computer-readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021031889A1 (en) * 2019-08-16 2021-02-25 中兴通讯股份有限公司 Upgrade method, communication device and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN101651684A (en) Systems and methods for providing network devices
CN112566113B (en) Key generation and terminal network distribution method, device and equipment
WO2021213463A1 (en) Network configuration method and apparatus for intelligent device, and electronic device and computer-readable medium
CN114124452B (en) Terminal authentication method, related equipment and authentication system
WO2020054365A1 (en) Communication device, communication method, and program
US8341703B2 (en) Authentication coordination system, terminal apparatus, storage medium, authentication coordination method, and authentication coordination program
CN111385611B (en) Account login method of smart television, smart television and terminal equipment
CN113613227B (en) Data transmission method and device of Bluetooth equipment, storage medium and electronic device
CN114172875B (en) Remote upgrading method and system for network camera and readable storage medium
CN111787514B (en) Method and device for acquiring equipment control data, storage medium and electronic device
CN117336363A (en) Online upgrade method, system, equipment and computer readable storage medium
CN110087281A (en) The method, apparatus and system of network insertion
JP2008027202A (en) Session management method, server used for the same, session management program, and recording medium with recorded program
CN111737084A (en) Information monitoring method and device, intelligent equipment, computer equipment and medium
CN114172875A (en) Remote upgrading method and system for network camera and readable storage medium
JP2010251915A (en) Authentication federation system, authentication federation method, mobile terminal, relay terminal device, and service device
CN112689016B (en) Intelligent device control method, device and storage medium
JP6158697B2 (en) Communication system and software update method
JP7176451B2 (en) Wireless communication system and cryptographic key transmission/reception method
JP2010183327A (en) Communication device and communication control method in split download system
US20200053186A1 (en) Communication terminal, communication method, and recording medium
CN110572818A (en) Virtual SIM card migration method, system and computer readable storage medium
CN113141609B (en) Encryption communication method and terminal
US20240187220A1 (en) Pqc-based mqtt communication method, device, system, and computer program
JP2008113427A (en) Network access device, method for establishing network connection, and mobile communication system using the same

Legal Events

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