A method and apparatus for upgrading battery-powered cameras in an NVR
By using a cloud-based server-managed NVR upgrade method, combined with mechanisms for resuming data transmission after network outages and retransmitting data after power outages, the problems of low efficiency, low security, and high network resource consumption during the upgrade process of battery-powered cameras have been solved, achieving an efficient and secure upgrade process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INFINOVA
- Filing Date
- 2025-06-10
- Publication Date
- 2026-06-30
Smart Images

Figure CN120602768B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video surveillance and network communication technology, and in particular to a method and apparatus for upgrading battery-powered cameras in an NVR. Background Technology
[0002] Battery-powered cameras require no power cord, boast long battery life, are portable, and easy to install, making them widely used in security monitoring, intelligent transportation, and smart city applications. Currently, upgrading existing NVRs (Network Video Recorders) to battery-powered cameras typically involves two methods: one is upgrading via firmware stored locally on the NVR, but this requires manual operation, resulting in low efficiency and security; the other is upgrading via wireless network, which can fail due to network fluctuations or power outages, requiring a re-download of the firmware package, consuming significant network resources and wasting power.
[0003] Therefore, existing methods for upgrading battery-powered cameras in NVRs suffer from low upgrade efficiency, low security, and high network resource consumption during the upgrade process. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method and apparatus for upgrading battery cameras in an NVR, so as to solve the problems of low upgrade efficiency, low security and high network resource consumption in the existing NVR battery camera upgrade process.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] The first aspect of this invention provides a method for upgrading battery cameras in an NVR (Network VR System) applied to a battery camera upgrade system, comprising the following steps: a cloud server obtains a new firmware upgrade package; if the version of the new firmware upgrade package is higher than the firmware version of one or more channels of the battery cameras in the NVR, the cloud server sends an upgrade notification to the user terminal; upon receiving the upgrade notification, the user terminal prompts the user that one or more channels of the battery cameras in the NVR need to be upgraded, and upon receiving the user's confirmation of the upgrade instruction, obtains an upgrade command from the cloud server and sends it to the NVR; after receiving the upgrade command, the NVR sends a download request to the cloud server to download the new firmware upgrade package; after receiving the download request, the cloud server returns the new firmware upgrade package to the NVR; after the NVR successfully downloads the new firmware upgrade package, the NVR sends the new firmware upgrade package to all channels of the battery cameras that need to be upgraded, transmitting a fixed amount of data each time until all the data of the new firmware upgrade package has been transmitted; the battery cameras receive the new firmware upgrade package. After the package is sent, the upgrade begins, and the current firmware version number is returned to the NVR. The NVR receives the current firmware version number returned by the battery camera, compares the current firmware version number with the version of the new firmware upgrade package to determine whether the upgrade is successful, and sends the upgrade result to the user terminal. The user terminal prompts the user whether the upgrade was successful or failed based on the upgrade result, and returns the current firmware version number to the cloud server. The above steps are repeated until all battery cameras on all channels corresponding to the new firmware upgrade package on the NVR are successfully upgraded. During the process of the NVR sending the new firmware upgrade package to the battery camera, if the battery camera is detected to be disconnected from the network, the NVR will start the network disconnection resume transmission mechanism. After the NVR and the battery camera are reconnected, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. If the battery camera is detected to be powered off, the NVR will start the power-off retransmission mechanism. After the NVR and the battery camera are reconnected, the NVR will resend the new firmware upgrade package to the battery camera.
[0007] The second aspect of this invention provides a method for upgrading battery cameras in an NVR, comprising the following steps: after receiving an upgrade command from a user terminal, sending a download request to a cloud server to download a new firmware upgrade package; after successfully downloading the new firmware upgrade package, sending the new firmware upgrade package to all battery cameras in all channels that need to be upgraded, transmitting a fixed amount of data each time until all data of the new firmware upgrade package is transmitted; receiving the current firmware version number returned by the battery camera after the upgrade, determining whether the upgrade was successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and sending the upgrade result to the user terminal; wherein, during the process of the NVR battery camera sending the new firmware upgrade package, if the battery camera is detected to be disconnected from the network, the NVR starts a network disconnection resume mechanism, and after the NVR and the battery camera are reconnected, the NVR continues to send the remaining data of the new firmware upgrade package to the battery camera; if the battery camera is detected to be powered off, the NVR starts a power-off retransmission mechanism, and after the NVR and the battery camera are reconnected, the NVR resends the new firmware upgrade package to the battery camera.
[0008] A third aspect of the present invention provides an apparatus for upgrading battery cameras in an NVR, configured in the NVR, comprising: a download request module, configured to send a download request to a cloud server to download a new firmware upgrade package after receiving an upgrade command sent by a user terminal; an upgrade package sending module, configured to send the new firmware upgrade package to all battery cameras in all channels requiring upgrade after successful download of the new firmware upgrade package, transmitting a fixed amount of data each time until all data of the new firmware upgrade package has been transmitted; and an upgrade result judgment module, configured to receive the current firmware version number returned after the battery camera upgrade, determine whether the upgrade was successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and output the upgrade result. The results are sent to the user terminal; the download request module, upgrade package sending module, and upgrade result judgment module run repeatedly until all battery cameras on all channels corresponding to the new firmware upgrade package on the NVR are successfully upgraded; wherein, during the process of the NVR sending the new firmware upgrade package to the battery camera, if the upgrade package sending module detects that the battery camera has lost network access, the NVR will start the network disconnection resume transmission mechanism, and after the NVR and the battery camera are reconnected, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera; if the battery camera is detected to have lost power, the NVR will start the power outage retransmission mechanism, and after the NVR and the battery camera are reconnected, the NVR will resend the new firmware upgrade package to the battery camera.
[0009] The aforementioned method and device for upgrading battery-powered cameras using an NVR simplify the upgrade process, minimize manual intervention, optimize upgrade efficiency and security, and reduce maintenance costs. During the upgrade process, the NVR employs a network disconnection resume and power-off retransmission mechanism to send the new firmware upgrade package to the battery-powered cameras, effectively reducing the upgrade failure rate and bandwidth consumption, thus solving the problem of high network resource usage. It supports simultaneous upgrades of multiple battery-powered cameras on the NVR, avoiding repeated downloads of upgrade packages, saving bandwidth, and shortening upgrade time. Users can view the upgrade results through a client application, enhancing the user experience. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a method for upgrading a battery camera using an NVR in a battery camera upgrade system, according to an embodiment of the present invention.
[0011] Figure 2 A flowchart illustrating a method for upgrading a battery-powered camera in an NVR, as provided in an embodiment of the present invention;
[0012] Figure 3 This is a schematic diagram of an NVR device for upgrading a battery-powered camera, provided in one embodiment of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to more clearly understand the purpose, technical solution, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0014] This invention provides a method for upgrading a battery-powered camera using an NVR. This method is applied to a battery-powered camera upgrade system, which includes a cloud server, a user terminal (e.g., a mobile phone, tablet), an NVR, and a battery-powered camera. The cloud server communicates with the user terminal and the NVR, and can store firmware upgrade packages (update programs) for the battery-powered camera, as well as control the release, verification, and push of these packages. The user terminal can associate with the NVR and the battery-powered camera, enabling functions such as browsing the camera's live stream, modifying camera parameters, and viewing recordings. The NVR associates with the battery-powered camera via Halow WiFi and performs audio and video reception and data interaction. The battery-powered camera, as a terminal device, requires no power cord, has long battery life, is portable, easy to install, and is not limited by network conditions. Furthermore, due to the characteristics of Halow WiFi, it can communicate with the NVR over long distances, offering a significant advantage over ordinary WiFi cameras.
[0015] When the user terminal is associated with the NVR and battery cameras, the user terminal associates with the NVR by setting up an account. Each account can associate with multiple NVRs, but each NVR can only associate with one account. Each NVR can associate with multiple battery cameras, but each battery camera can only associate with one NVR. The system upgrade has extremely strong security.
[0016] like Figure 1 As shown, in one embodiment of the present invention, the method for upgrading the battery camera in an NVR includes the following steps:
[0017] S10. The cloud server obtains the new firmware upgrade package. If the version of the new firmware upgrade package is higher than the firmware version of the battery camera on one or more channels of the NVR, the cloud server sends an upgrade notification to the user.
[0018] S20. When the user receives the upgrade notification, it prompts the user that the battery cameras of one or more channels of the NVR need to be upgraded, and when it receives the user's confirmation of the upgrade instruction, it obtains the upgrade command from the cloud server and sends it to the NVR.
[0019] After receiving the upgrade command, S30 and NVR send a download request to the cloud server to download the new firmware upgrade package;
[0020] After receiving the download request, the S40 and cloud server return the new firmware upgrade package to the NVR.
[0021] After the S50 and NVR successfully download the new firmware upgrade package, the NVR sends the new firmware upgrade package to all battery cameras on all channels that need to be upgraded, transmitting a fixed amount of data each time until all the data in the new firmware upgrade package has been transmitted.
[0022] After receiving the new firmware upgrade package, the S60 battery camera begins the upgrade process and returns the current firmware version number to the NVR.
[0023] The S70 and NVR receive the current firmware version number returned by the battery camera, determine whether the upgrade is successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and send the upgrade result to the user terminal.
[0024] S80. The user terminal prompts the user whether the upgrade was successful or failed based on the upgrade result, and returns the current firmware version number to the cloud server.
[0025] S90. The cloud server determines whether all battery cameras on all channels corresponding to the new firmware upgrade package of the NVR have been successfully upgraded. If yes, the process ends; otherwise, it returns to step S10.
[0026] Before starting the upgrade process, i.e. before step S10, the administrator needs to import the new firmware upgrade package into the cloud server to prepare for the upgrade.
[0027] In step S50, since the battery camera can only work for a maximum of 5 minutes each time, the present invention transmits the new firmware upgrade package to the battery camera in multiple parts. The NVR transmits a maximum of 1MB of data to the battery camera each time until all the data of the new firmware upgrade package is transmitted. The battery camera accumulates the received data to obtain the completed new firmware upgrade package.
[0028] During the process of the NVR battery camera sending the new firmware upgrade package, if the network environment is poor and data transmission is slow, the NVR will wait until all data has been sent. Specifically, if a weak network is detected (signal strength is lower than a set value), the NVR will send a wake-up command every preset time interval (e.g., 30 seconds) to wake up the battery camera and query it for the size of the received upgrade package data and the CRC checksum. If the CRC checksum passes, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera.
[0029] During the process of the NVR sending the new firmware upgrade package to the battery camera, if the battery camera is detected to be offline, the NVR will activate the offline resume mechanism. After the NVR and the battery camera reconnect, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. Specifically, if the battery camera is detected to be offline, the NVR will activate the offline resume mechanism and send a wake-up command to wake up the battery camera every preset time interval (e.g., 30 seconds). After the NVR and the battery camera reconnect, the NVR will query the battery camera for the size of the received upgrade package data and the CRC checksum. If the CRC check passes, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera.
[0030] During the process of the NVR sending the new firmware upgrade package to the battery camera, if a power outage is detected in the battery camera, the NVR will initiate a power outage retransmission mechanism. After the NVR and the battery camera reconnect, the NVR will resend the new firmware upgrade package to the battery camera. Specifically, if a power outage is detected in the battery camera, the NVR will initiate a power outage retransmission mechanism, sending a wake-up command every preset time interval (e.g., 30 seconds) within a set time range (e.g., 10 minutes) from the time the user confirms the upgrade to wake up the battery camera, until the NVR and the battery camera reconnect; the NVR will then resend the new firmware upgrade package to the battery camera.
[0031] The method for upgrading battery-powered cameras using an NVR in this embodiment only requires the administrator to import the firmware upgrade package during upgrade preparation and user authorization confirmation in step S20. All other steps are automatically completed under the control of the NVR, which ultimately provides a success or failure result, minimizing human intervention. Users can check the upgrade success status on their client app. If unsuccessful, an update button is available on the app; clicking the button again allows the user to continue the upgrade process.
[0032] The method for upgrading battery cameras using an NVR in this embodiment is simpler to operate, requires less manual intervention, optimizes upgrade efficiency and security, and reduces maintenance costs. During the upgrade process, the NVR uses a network disconnection resume and power failure retransmission mechanism to send the new firmware upgrade package to the battery camera, which can effectively reduce the upgrade failure rate and reduce upgrade bandwidth consumption, solving the problem of high network resource consumption. It supports simultaneous upgrades of multiple channels of battery cameras to the NVR, which can avoid the NVR repeatedly downloading upgrade packages, save upgrade bandwidth, and shorten upgrade time. Users can view the upgrade results through the user terminal, improving the user experience.
[0033] In a preferred embodiment of the present invention, step S40 further includes: after receiving a download request, the cloud server verifies the legality and security of the download request. If the verification passes, the cloud server returns a new firmware upgrade package to the NVR; if the verification fails, the cloud server does not return a new firmware upgrade package to the NVR. By verifying the legality and security of the download request and only returning a new firmware upgrade package to the NVR after successful verification, the cloud server can ensure the legality and security of the download request and prevent unauthorized access and tampering of the firmware upgrade package.
[0034] In a preferred embodiment of the present invention, step S50 further includes: after the NVR successfully downloads the new firmware upgrade package, it verifies the integrity and legality of the new firmware upgrade package. If the verification passes, the NVR sends the new firmware upgrade package to all battery cameras on all channels that need upgrading. The new firmware upgrade package is transmitted in multiple transmissions, with each transmission containing a fixed amount of data until all data in the new firmware upgrade package is transmitted. If the verification fails, the new firmware upgrade package is deleted and the upgrade is stopped. By verifying the integrity and legality of the new firmware upgrade package after downloading it, and confirming that the firmware upgrade package is complete and legal before sending it to the battery cameras, the effectiveness and security of the upgrade can be ensured.
[0035] In a preferred embodiment of the present invention, step S60 further includes: after receiving the new firmware upgrade package, the battery camera verifies the integrity and legality of the new firmware upgrade package. If the verification passes, the upgrade begins and the current firmware version number is returned to the NVR; if the verification fails, the new firmware upgrade package is deleted and the upgrade is stopped. By verifying the integrity and legality of the new firmware upgrade package, the battery camera ensures the effectiveness and security of the upgrade by confirming that the firmware upgrade package is complete and legal before starting the upgrade.
[0036] In a preferred embodiment of the present invention, step S10 further includes:
[0037] S11. Obtain the new firmware upgrade package from the cloud server;
[0038] S12. The cloud server determines, based on the model of the new firmware upgrade package, that the new firmware upgrade package is applicable to battery-powered cameras on one or more channels of the NVR.
[0039] S13. The cloud server determines whether the description of the new firmware upgrade package conforms to the preset format. If yes, proceed to step S14; otherwise, stop the release of the new firmware upgrade package.
[0040] S14. The cloud server determines whether the version of the new firmware upgrade package is higher than the firmware version of the battery camera on one or more channels of the NVR. If so, it sends an upgrade notification to the user and adds a data signature to the header of the new firmware upgrade package. The information in the data signature includes the upgrade package type, upgrade package size, MD5 checksum, and the proprietary model ID of the battery camera. If not, it stops the release of the new firmware upgrade package.
[0041] In steps S13-S14, the default format for the firmware upgrade package version description is "major version.minor version.patch version". When the description of the new firmware upgrade package conforms to the default format, it is then determined whether the version of the new firmware upgrade package is higher than the original firmware version of the battery camera. Only when the version of the new firmware upgrade package is higher than the original firmware version of the battery camera is the release of the new firmware upgrade package allowed. For example, if the original firmware version of the battery camera is 1.2.5250101, and a firmware upgrade package version 1.1.5250102 is received, the upgrade cannot be performed if the minor version value of the firmware upgrade package is lower than the minor version value of the original firmware version. However, if a firmware upgrade package version 1.3.5250102 is received, the upgrade is allowed.
[0042] In this embodiment, the cloud server can uniformly manage the firmware version of the battery camera. Firmware upgrade packages can only be released when the firmware version conforms to the preset format and the version is incremental. This solves the problem of version confusion and conflict that easily occurs due to the lack of unified management of the firmware version of the battery camera by the cloud server.
[0043] Step S20 further includes:
[0044] S21. When the user receives the upgrade notification, it prompts the user that the battery cameras of one or more channels of the NVR need to be upgraded, and waits for the user to confirm the upgrade instruction.
[0045] S22. When the user receives the user's confirmation instruction to upgrade, the user terminal obtains the upgrade command from the cloud server. The upgrade command includes the path of the upgrade package, the authentication ID, the digital signature, and the timeout period.
[0046] S23. The user terminal sends the upgrade command to the NVR.
[0047] In step S21, the user terminal prompts the user that one or more battery cameras on the NVR channel need to be upgraded via the update button. The user can choose to click the update button to upgrade at any time.
[0048] In step S22, the upgrade package path uses an encrypted URL address. The NVR can request to download the new firmware upgrade package from the cloud server through the URL address. The authentication ID is the user authentication ID. The information in the digital signature includes the upgrade package type, upgrade package size, MD5 checksum, and the proprietary model ID of the battery camera. The timeout period refers to the timeout period for the NVR to download the firmware upgrade package from the cloud server. The NVR must request to download the firmware upgrade package before the timeout period. If the request to download the firmware upgrade package is made after the timeout period, the cloud server will not return the firmware upgrade package, indicating that the upgrade has failed. The user's terminal will display a prompt, requiring the user to re-authorize the upgrade, thus enhancing security.
[0049] Step S30 further includes:
[0050] S31. After receiving the upgrade command, the NVR generates a download request based on the upgrade command. The information in the download request includes the path of the upgrade package, the authentication ID, the digital signature, and the timeout period.
[0051] S32 and NVR send the download request to the cloud server to download the new firmware upgrade package.
[0052] Step S40 further includes:
[0053] S41. After receiving the download request, the cloud server parses the download request to obtain the path of the upgrade package, the authentication ID, the digital signature, and the timeout period;
[0054] S42. The cloud server verifies whether the download request is secure or abnormal based on the identity authentication ID, digital signature, and timeout. If the download request is secure, a new firmware upgrade package is returned to the NVR; if the download request is abnormal, a new firmware upgrade package is not returned to the NVR.
[0055] In step S40, if the identity authentication ID, digital signature, and timeout verification all pass, the download request is considered secure; otherwise, the download request is considered abnormal. The cloud server verifies the legitimacy and security of the download request before returning the new firmware upgrade package to the NVR, ensuring the legitimacy and security of the download request and preventing unauthorized access and tampering of the firmware upgrade package.
[0056] Step S50 further includes:
[0057] After the S51 and NVR successfully download the new firmware upgrade package, they parse the data signature to obtain the upgrade package type, upgrade package size, MD5 checksum, and the proprietary model ID of the battery camera, so that the NVR can verify the integrity and legality of the data package.
[0058] S52. The NVR determines whether the upgrade package type, upgrade package size, MD5 checksum, and proprietary model ID of the battery camera have all passed verification. If yes, proceed to step S53; otherwise, delete the new firmware upgrade package and stop the upgrade.
[0059] S53. The NVR determines whether all the battery cameras in all channels that need to be upgraded are online. If yes, proceed to step S54. If no, send a wake-up command to wake up the battery cameras. After the battery cameras communicate successfully with the NVR, proceed to step S54.
[0060] S54. The NVR sends the new firmware upgrade package to all battery-powered cameras on all channels that need upgrading. The new firmware upgrade package is sent in multiple transmissions, with each transmission containing a fixed amount of data until all data in the new firmware upgrade package is transmitted. Specifically, before sending the new firmware upgrade package, the NVR categorizes all battery-powered cameras on all its connected channels according to the same manufacturer or model. In other words, the NVR sends the new firmware upgrade package to battery-powered cameras of the same manufacturer or model simultaneously (the NVR sends the new firmware upgrade package to all battery-powered cameras on all channels that need upgrading). This avoids the NVR repeatedly downloading the firmware upgrade package, saving bandwidth used for upgrading and shortening the upgrade time.
[0061] For steps S51-S54, after the NVR successfully downloads the new firmware upgrade package, it first verifies the firmware upgrade package to determine its integrity and validity. If the upgrade package type, size, MD5 checksum, and the battery camera's proprietary model ID all pass verification, the firmware upgrade package is considered complete and valid; otherwise, it is considered abnormal and will be deleted. Next, it checks if the battery camera on the upgrade channel is online. If the battery camera is offline, it needs to be woken up. After sending the wake-up command, the NVR checks if communication with the battery camera is successful. If the battery camera fails to communicate with the NVR or the NVR cannot wake up the camera, transmission cannot proceed temporarily. The NVR will wake up the battery camera at fixed intervals until communication is successful. If communication between the battery camera and the NVR is successful, the NVR sends the firmware upgrade package to the battery camera, sending a fixed amount of data each time, until all data in the new firmware upgrade package is transmitted.
[0062] In step S50, when the upgrade package type, upgrade package size, MD5 checksum, and proprietary model ID of the battery camera are all verified, it indicates that the firmware upgrade package is complete and legitimate. At this time, the new firmware upgrade package is sent to the battery camera for upgrade, which can ensure the effectiveness and security of the upgrade.
[0063] Step S60 further includes:
[0064] S61. After receiving the new firmware upgrade package, the battery camera parses the data signature to obtain the upgrade package type, upgrade package size, MD5 checksum, and the battery camera's proprietary model ID.
[0065] S62. The battery camera determines whether the upgrade package type, upgrade package size, MD5 checksum, and battery camera proprietary model ID have all passed verification. If yes, proceed to step S63; otherwise, delete the new firmware upgrade package and stop the upgrade.
[0066] S63: The battery camera starts upgrading with the new firmware upgrade package. If the upgrade is successful, the version number of the new firmware upgrade package will be used as the current firmware version number for the NVR. If the upgrade fails, the original firmware version number of the battery camera will be used as the current firmware version number for the NVR.
[0067] In step S60, when the upgrade package type, upgrade package size, MD5 checksum, and proprietary model ID of the battery camera are all verified, it indicates that the firmware upgrade package is complete and legitimate. At this point, the battery camera can start the upgrade, ensuring the effectiveness and security of the upgrade.
[0068] like Figure 2 As shown, the present invention also provides a method for upgrading the battery camera of an NVR, which includes the following steps:
[0069] S110: After receiving the upgrade command sent by the user terminal, send a download request to the cloud server to download the new firmware upgrade package;
[0070] S120. After successfully downloading the new firmware upgrade package, send the new firmware upgrade package to all battery cameras in all channels that need to be upgraded, transmitting a fixed amount of data each time until all the data in the new firmware upgrade package has been transmitted.
[0071] S130: Receive the current firmware version number returned after the battery camera upgrade, determine whether the upgrade was successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and send the upgrade result to the user terminal.
[0072] During the process of the NVR battery camera sending the new firmware upgrade package, if the battery camera is detected to be disconnected from the network, the NVR will activate the network disconnection resume mechanism. After the NVR and the battery camera are reconnected, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. If the battery camera is detected to be powered off, the NVR will activate the power outage retransmission mechanism. After the NVR and the battery camera are reconnected, the NVR will resend the new firmware upgrade package to the battery camera.
[0073] Steps S110, S120, and S130 in this embodiment correspond to respectively... Figure 1 For specific limitations of steps S30, S50, S70, S110, S120, and S130 in the illustrated embodiment, please refer to the above description. Figure 1 The limitations of steps S30, S50, and S70 in the illustrated embodiment will not be repeated here.
[0074] The method for upgrading battery cameras using an NVR in this embodiment is simpler to operate, requires less manual intervention, optimizes upgrade efficiency and security, and reduces maintenance costs. During the upgrade process, the NVR uses a network disconnection resume and power failure retransmission mechanism to send the new firmware upgrade package to the battery camera, which can effectively reduce the upgrade failure rate and reduce upgrade bandwidth consumption, solving the problem of high network resource consumption. It supports simultaneous upgrades of multiple channels of battery cameras to the NVR, which can avoid the NVR repeatedly downloading upgrade packages, save upgrade bandwidth, and shorten upgrade time. Users can view the upgrade results through the user terminal, improving the user experience.
[0075] In a preferred embodiment of the present invention, step S120 further includes: after successfully downloading the new firmware upgrade package, verifying the integrity and legality of the new firmware upgrade package; if the verification passes, sending the new firmware upgrade package to all battery cameras on all channels that need upgrading, transmitting a fixed amount of data each time until all data in the new firmware upgrade package is transmitted; if the verification fails, deleting the new firmware upgrade package and stopping the upgrade. By verifying the integrity and legality of the new firmware upgrade package after downloading it, and confirming its completeness and legality before sending it to the battery cameras, the effectiveness and security of the upgrade can be ensured.
[0076] based on Figure 2 The illustrated embodiment provides a method for upgrading an NVR battery camera applied to an NVR. The present invention also provides an apparatus for upgrading an NVR battery camera configured in an NVR. For example... Figure 3 As shown, the device for upgrading the battery camera in the NVR includes:
[0077] Download request module 110 is used to perform Figure 2 Step S110 in the method for upgrading a battery camera in the NVR shown in the embodiment is used to send a download request to the cloud server to download the new firmware upgrade package after receiving the upgrade command sent by the user terminal.
[0078] Upgrade package sending module 120, used for execution Figure 2 Step S120 in the method for upgrading battery cameras in the NVR shown in the embodiment is used to send the new firmware upgrade package to all battery cameras of all channels that need to be upgraded after the new firmware upgrade package is successfully downloaded. A fixed amount of data is transmitted each time until all the data of the new firmware upgrade package is transmitted.
[0079] Upgrade result judgment module 130 is used to execute Figure 2 In the NVR upgrade battery camera method shown in the embodiment, step S130 is used to receive the current firmware version number returned after the battery camera upgrade, determine whether the upgrade is successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and send the upgrade result to the user terminal.
[0080] In the process of the NVR battery camera sending the new firmware upgrade package, if the upgrade package sending module 120 detects that the battery camera has lost network access, the NVR will start the network disconnection resume transmission mechanism. After the NVR and the battery camera are reconnected, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. If the battery camera is detected to have lost power, the NVR will start the power outage retransmission mechanism. After the NVR and the battery camera are reconnected, the NVR will resend the new firmware upgrade package to the battery camera.
[0081] The NVR upgrade device for battery cameras in this embodiment simplifies the upgrade operation, reduces manual intervention during the upgrade process, optimizes upgrade efficiency and security, and lowers maintenance costs. During the upgrade process, the NVR uses a network disconnection resume and power failure retransmission mechanism to send the new firmware upgrade package to the battery camera, which can effectively reduce the upgrade failure rate and reduce upgrade bandwidth consumption, solving the problem of high network resource consumption. It supports simultaneous upgrades of multiple channels of battery cameras for the NVR, which can avoid the NVR repeatedly downloading upgrade packages, save upgrade bandwidth, and shorten upgrade time. Users can view the upgrade results through the user terminal, improving the user experience.
[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Those skilled in the art can make various equivalent changes and improvements based on the above embodiments, and all equivalent variations or modifications made within the scope of the claims should fall within the protection scope of the present invention.
Claims
1. A method for upgrading a battery-powered camera to an NVR, characterized in that, The method for upgrading battery cameras using an NVR is applied to a battery camera upgrade system, which includes a cloud server, a user terminal, an NVR, and battery cameras. The method for upgrading battery cameras using an NVR includes the following steps: S10. The cloud server obtains the new firmware upgrade package. If the version of the new firmware upgrade package is higher than the firmware version of the battery camera on one or more channels of the NVR, the cloud server sends an upgrade notification to the user. S20. When the user receives the upgrade notification, it prompts the user that the battery cameras of one or more channels of the NVR need to be upgraded, and when it receives the user's confirmation of the upgrade instruction, it obtains the upgrade command from the cloud server and sends it to the NVR. After receiving the upgrade command, S30 and NVR send a download request to the cloud server to download the new firmware upgrade package; After receiving the download request, the S40 and cloud server return the new firmware upgrade package to the NVR. After the S50 and NVR successfully download the new firmware upgrade package, the NVR sends the new firmware upgrade package to all battery cameras on all channels that need to be upgraded, transmitting a fixed amount of data each time until all the data in the new firmware upgrade package has been transmitted. After receiving the new firmware upgrade package, the S60 battery camera begins the upgrade process and returns the current firmware version number to the NVR. The S70 and NVR receive the current firmware version number returned by the battery camera, determine whether the upgrade is successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and send the upgrade result to the user terminal. S80. The user terminal prompts the user whether the upgrade was successful or failed based on the upgrade result, and returns the current firmware version number to the cloud server. Repeat steps S10 to S80 until all battery cameras on all channels of the NVR corresponding to the new firmware upgrade package are successfully upgraded. During the process of the NVR battery camera sending the new firmware upgrade package, if the battery camera is detected to be disconnected from the network, the NVR will activate the network disconnection resume mechanism. After the NVR and the battery camera are reconnected, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. If the battery camera is detected to be powered off, the NVR will activate the power outage retransmission mechanism. After the NVR and the battery camera are reconnected, the NVR will resend the new firmware upgrade package to the battery camera.
2. The method for upgrading a battery-powered camera to an NVR as described in claim 1, characterized in that, Step S40 further includes: after receiving the download request, the cloud server verifies the legality and security of the download request. If the verification is successful, the new firmware upgrade package is returned to the NVR; if the verification fails, the new firmware upgrade package is not returned to the NVR.
3. The method for upgrading a battery-powered camera to an NVR as described in claim 2, characterized in that, Step S50 further includes: after the NVR successfully downloads the new firmware upgrade package, it verifies the integrity and legality of the new firmware upgrade package. If the verification passes, the NVR sends the new firmware upgrade package to all battery cameras in all channels that need to be upgraded, transmitting a fixed amount of data each time until all the data in the new firmware upgrade package is transmitted. If the verification fails, the new firmware upgrade package is deleted and the upgrade is stopped.
4. The method for upgrading a battery-powered camera to an NVR as described in claim 3, characterized in that, Step S60 further includes: after the battery camera receives the new firmware upgrade package, it verifies the integrity and legality of the new firmware upgrade package. If the verification passes, the upgrade begins and the current firmware version number is returned to the NVR; if the verification fails, the new firmware upgrade package is deleted and the upgrade is stopped.
5. The method for upgrading a battery-powered camera to an NVR as described in claim 4, characterized in that, Step S10 further includes: S11. Obtain the new firmware upgrade package from the cloud server; S12. The cloud server determines, based on the model of the new firmware upgrade package, that the new firmware upgrade package is applicable to battery-powered cameras on one or more channels of the NVR. S13. The cloud server determines whether the description of the new firmware upgrade package conforms to the preset format. If yes, proceed to step S14; otherwise, stop the release of the new firmware upgrade package. S14. The cloud server determines whether the version of the new firmware upgrade package is higher than the firmware version of the battery camera on one or more channels of the NVR. If so, it sends an upgrade notification to the user and adds a data signature to the header of the new firmware upgrade package. The information in the data signature includes the upgrade package type, upgrade package size, MD5 checksum, and the proprietary model ID of the battery camera. If not, it stops the release of the new firmware upgrade package. Step S20 further includes: S21. When the user receives the upgrade notification, it prompts the user that the battery cameras of one or more channels of the NVR need to be upgraded, and waits for the user to confirm the upgrade instruction. S22. When the user receives the user's confirmation instruction to upgrade, the user terminal obtains the upgrade command from the cloud server. The upgrade command includes the path of the upgrade package, the authentication ID, the digital signature, and the timeout period. S23. The user terminal sends the upgrade command to the NVR; Step S30 further includes: S31. After receiving the upgrade command, the NVR generates a download request based on the upgrade command. The information in the download request includes the path of the upgrade package, the authentication ID, the digital signature, and the timeout period. S32, NVR sends the download request to the cloud server to request the download of the new firmware upgrade package; Step S40 further includes: S41. After receiving the download request, the cloud server parses the download request to obtain the path of the upgrade package, the authentication ID, the digital signature, and the timeout period; S42. The cloud server verifies whether the download request is secure or abnormal based on the identity authentication ID, digital signature, and timeout. If the download request is secure, a new firmware upgrade package is returned to the NVR. If the download request is abnormal, a new firmware upgrade package is not returned to the NVR. Step S50 further includes: After the S51 and NVR successfully download the new firmware upgrade package, they can parse the data signature to obtain the upgrade package type, upgrade package size, MD5 checksum, and the proprietary model ID of the battery camera. S52. The NVR determines whether the upgrade package type, upgrade package size, MD5 checksum, and proprietary model ID of the battery camera have all passed verification. If yes, proceed to step S53; otherwise, delete the new firmware upgrade package and stop the upgrade. S53. The NVR determines whether all the battery cameras in all channels that need to be upgraded are online. If yes, proceed to step S54. If no, send a wake-up command to wake up the battery cameras. After the battery cameras communicate successfully with the NVR, proceed to step S54. S54, NVR sends the new firmware upgrade package to all battery cameras on all channels that need to be upgraded, transmitting a fixed amount of data each time until all the data in the new firmware upgrade package has been transmitted. Step S60 further includes: S61. After receiving the new firmware upgrade package, the battery camera parses the data signature to obtain the upgrade package type, upgrade package size, MD5 checksum, and the battery camera's proprietary model ID. S62. The battery camera determines whether the upgrade package type, upgrade package size, MD5 checksum, and battery camera proprietary model ID have all passed verification. If yes, proceed to step S63; otherwise, delete the new firmware upgrade package and stop the upgrade. S63: The battery camera starts upgrading with the new firmware upgrade package. If the upgrade is successful, the version number of the new firmware upgrade package will be used as the current firmware version number for the NVR. If the upgrade fails, the original firmware version number of the battery camera will be used as the current firmware version number for the NVR.
6. The method for upgrading a battery-powered camera to an NVR as described in claim 1, characterized in that, If the NVR detects a network outage at the battery camera, it will activate the network outage resume mechanism. After the NVR reconnects to the battery camera, it will continue to send the remaining data of the new firmware upgrade package to the battery camera, including: If the battery camera is detected to be offline, the NVR will activate the offline resume mechanism and send a wake-up command to wake up the battery camera every preset time. After the NVR reconnects to the battery camera, the NVR queries the battery camera for the size of the received upgrade package data and the CRC checksum. If the CRC checksum passes, the NVR continues to send the remaining data of the new firmware upgrade package to the battery camera.
7. The method for upgrading a battery-powered camera to an NVR as described in claim 6, characterized in that, If a power outage is detected in the battery-powered camera, the NVR will initiate a power-off retransmission mechanism. After the NVR reconnects to the battery-powered camera, the NVR will resend the new firmware upgrade package to the battery-powered camera, including: If the battery camera is detected to be powered off, the NVR will activate the power-off retransmission mechanism. Within a set time range from the time the user confirms the upgrade, a wake-up command will be sent every preset time to wake up the battery camera until the NVR and the battery camera are reconnected. The NVR resends a new firmware upgrade package to the battery-powered cameras.
8. A method for upgrading a battery-powered camera in an NVR, characterized in that, The method for upgrading a battery-powered camera in an NVR is applied to an NVR and includes the following steps: S110: After receiving the upgrade command sent by the user terminal, send a download request to the cloud server to download the new firmware upgrade package; S120. After successfully downloading the new firmware upgrade package, send the new firmware upgrade package to all battery cameras in all channels that need to be upgraded, transmitting a fixed amount of data each time until all the data in the new firmware upgrade package has been transmitted. S130: Receive the current firmware version number returned after the battery camera upgrade, determine whether the upgrade was successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and send the upgrade result to the user terminal. During the process of the NVR battery camera sending the new firmware upgrade package, if the battery camera is detected to be disconnected from the network, the NVR will activate the network disconnection resume mechanism. After the NVR and the battery camera are reconnected, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. If the battery camera is detected to be powered off, the NVR will activate the power outage retransmission mechanism. After the NVR and the battery camera are reconnected, the NVR will resend the new firmware upgrade package to the battery camera.
9. The method for upgrading a battery-powered camera to an NVR as described in claim 8, characterized in that, Step S120 further includes: after successfully downloading the new firmware upgrade package, verifying the integrity and legality of the new firmware upgrade package; if the verification passes, sending the new firmware upgrade package to all battery cameras of all channels that need to be upgraded, transmitting a fixed amount of data each time until all data of the new firmware upgrade package is transmitted; if the verification fails, deleting the new firmware upgrade package and stopping the upgrade.
10. A device for upgrading a battery-powered camera to an NVR, characterized in that, The device for upgrading the battery camera in the NVR is configured in the NVR, and the device for upgrading the battery camera in the NVR includes: The download request module is used to send a download request to the cloud server to download the new firmware upgrade package after receiving the upgrade command from the user. The upgrade package sending module is used to send the new firmware upgrade package to all battery cameras in all channels that need to be upgraded after the new firmware upgrade package is successfully downloaded. It sends a fixed amount of data each time until all the data of the new firmware upgrade package is sent. The upgrade result judgment module is used to receive the current firmware version number returned after the battery camera upgrade, determine whether the upgrade is successful based on the comparison result between the current firmware version number and the version of the new firmware upgrade package, and send the upgrade result to the user terminal. The download request module, upgrade package sending module, and upgrade result judgment module run repeatedly in sequence until all battery cameras of all channels corresponding to the new firmware upgrade package of the NVR are successfully upgraded. Specifically, during the process of the NVR sending the new firmware upgrade package to the battery camera, if the NVR detects that the battery camera has lost network access, the NVR will activate the network disconnection resume transmission mechanism. After the NVR and the battery camera reconnect, the NVR will continue to send the remaining data of the new firmware upgrade package to the battery camera. If the NVR detects that the battery camera has lost power, the NVR will activate the power outage retransmission mechanism. After the NVR and the battery camera reconnect, the NVR will resend the new firmware upgrade package to the battery camera.