Algorithm file upgrading method, device, electronic device and storage medium

By performing upgrade preprocessing and decompressing the installation algorithm files in segments on smart devices, the problem of missing videos caused by inability to record during the upgrade is solved, and the algorithm files can be upgraded without turning off the recording function.

CN113535214BActive Publication Date: 2025-03-11ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110683907.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-21
Publication Date
2025-03-11
Estimated Expiration
2041-06-21

AI Technical Summary

Technical Problem

In the process of upgrading algorithm files of smart devices, all functions need to be turned off to provide sufficient memory, which makes recording impossible during the upgrade, and may lead to missing recording.

Method used

By obtaining algorithm file upgrade instructions, upgrade preprocessing is performed, including closing non-core processes, obtaining segmented compressed upgrade algorithm files, and decompressing them in segments and installing them to the monitoring device without turning off the recording function.

Benefits of technology

It realizes that video recording can still be performed during the algorithm file upgrade, ensuring the integrity of the video and avoiding the problem of missing video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535214B_ABST
    Figure CN113535214B_ABST
Patent Text Reader

Abstract

The present application relates to an algorithm file upgrade method, which is applied to monitoring equipment, wherein the algorithm file upgrade method includes: obtaining an algorithm file upgrade instruction; based on the algorithm file upgrade instruction, performing upgrade preprocessing on the monitoring equipment, the upgrade preprocessing includes shutting down the non-core processes of the monitoring equipment, and the core processes include the video recording process; based on the algorithm file upgrade instruction, obtaining the segmented compressed upgrade algorithm file, and decompressing the upgrade algorithm file segment by segment and installing it to the monitoring equipment. Through this application, the problem of the inability to record during the upgrade period in the related art, resulting in the loss of video during the upgrade period, is solved, and the algorithm file can be upgraded without shutting down the video recording function, ensuring the integrity of the video recording during the algorithm file upgrade period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an algorithm file upgrading method, device, electronic device and storage medium. Background Art

[0002] Nowadays, with the rapid development of the security industry, there will be a large number of intelligent devices at the front end of the security monitoring platform, such as network cameras, network video recorders, etc., and it is very important to manage these intelligent devices. For example, the upgrade, addition and deletion of algorithms in intelligent devices.

[0003] In the prior art, the upgrade of algorithm files generally involves first decompressing the algorithm files into the free memory of the storage device, and then overwriting the algorithm files in the memory onto the storage medium. However, with the iterative update of the intelligent algorithm, the algorithm files are also getting larger, and the memory space of the embedded storage device is relatively limited. When using the storage device to upgrade large files, in order to ensure the normal decompression of the compressed package of the upgrade file, the device needs to turn off all functions to provide sufficient memory for the upgrade. Since all functions are turned off, the device cannot record and store during the upgrade, and sometimes the device needs to be restarted, which results in the loss of video during the upgrade, and it is even more impossible to perform operations such as video analysis.

[0004] With regard to the problem in the related art that video recording cannot be performed during an upgrade, resulting in loss of video recording during the upgrade, no effective solution has been proposed yet. Summary of the invention

[0005] In this embodiment, an algorithm file upgrade method, device, electronic device and storage medium are provided to solve the problem in the related art that video recording cannot be performed during the upgrade period, resulting in loss of video recording during the upgrade period.

[0006] In the first aspect, an algorithm file upgrade method is provided in this embodiment, which is applied to a monitoring device, and the method includes: obtaining an algorithm file upgrade instruction; based on the algorithm file upgrade instruction, performing upgrade preprocessing on the monitoring device, the upgrade preprocessing includes shutting down non-core processes of the monitoring device, and the core processes include recording processes; based on the algorithm file upgrade instruction, obtaining the segmented compressed upgrade algorithm file, and decompressing the upgrade algorithm file in segments and installing it to the monitoring device.

[0007] In another embodiment, before acquiring the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, the method further includes: sending a file acquisition instruction based on the algorithm file upgrade instruction, so that the file sending end performs segmented compression on the upgrade algorithm file based on the file acquisition instruction.

[0008] In one of the embodiments, before performing upgrade preprocessing on the monitoring device, the method also includes: obtaining the file identifier of the upgrade algorithm file and the file identifier of the current algorithm file, wherein the file identifier includes a file update time and a file version number; comparing the file identifier of the upgrade algorithm file with the file identifier of the current algorithm file, and performing upgrade preprocessing if the file identifier of the upgrade algorithm file is different from the file identifier of the current algorithm file.

[0009] In some embodiments, before decompressing the upgrade algorithm file in segments and installing it to the monitoring device, the process also includes: obtaining the memory required for decompressing the algorithm file in segments and the available memory of the monitoring device, comparing the required memory with the available memory, obtaining a memory comparison result, and determining whether to decompress the upgrade algorithm file to the monitoring device based on the memory comparison result.

[0010] In another embodiment, the algorithm file upgrade method further includes: marking the video file generated based on the video process when the non-core process is closed, intercepting the marked video file and saving it separately to obtain the upgraded video file.

[0011] In some embodiments, after decompressing the upgrade algorithm file in segments and installing it on the monitoring device, the method further includes: obtaining an installation result, wherein the installation result includes installation success and installation failure; when the installation result is installation success, causing the monitoring device to apply the upgrade algorithm file, start a non-core process in the monitoring device; and parse the video file recorded during the upgrade. When the installation result is installation failure, generating an installation failure report and / or alarm.

[0012] In another embodiment, the parsing of the video file during the upgrade includes: obtaining the computing power currently available of the monitoring device and the computing power required to parse the video file during the upgrade; comparing the available computing power with the required computing power and obtaining the computing power comparison result, and based on the computing power comparison result, the monitoring device parses the video file during the upgrade while operating normally.

[0013] In the second aspect, an algorithm file upgrade device is provided in this embodiment, which is applied to a monitoring device and is characterized in that it includes: an upgrade instruction acquisition module: used to obtain an algorithm file upgrade instruction; an upgrade preprocessing module: used to perform upgrade preprocessing on the monitoring device based on the algorithm file upgrade instruction, wherein the upgrade preprocessing includes shutting down non-core processes of the monitoring device, and the core processes include a recording process; an algorithm file installation module: used to obtain the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, and decompress the upgrade algorithm file in segments and install it to the monitoring device.

[0014] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the algorithm file upgrade method described in the first aspect when executing the computer program.

[0015] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the algorithm file upgrade method described in the first aspect is implemented.

[0016] Compared with the related art, the algorithm file upgrade method provided in this embodiment obtains an algorithm file upgrade instruction; based on the algorithm file upgrade instruction, the monitoring device is pre-processed for upgrade, and the upgrade pre-processing includes shutting down non-core processes of the monitoring device, and the core processes include recording processes; based on the algorithm file upgrade instruction, the segmented compressed upgrade algorithm file is obtained, and the upgrade algorithm file is segmented and decompressed and installed to the monitoring device, which solves the problem in the related art that recording cannot be performed during the upgrade period, resulting in missing recording during the upgrade period, and realizes that the algorithm file can be upgraded without shutting down the recording function, ensuring the integrity of the recording during the algorithm file upgrade period.

[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 It is a hardware structure block diagram of a terminal of the algorithm file upgrade method in an embodiment of the present method;

[0020] Figure 2 It is a flowchart of an algorithm file upgrade method in an embodiment of the present method;

[0021] Figure 3 It is a flowchart of an algorithm file upgrade method in one embodiment of the present method;

[0022] Figure 4 is a flow chart of an algorithm file upgrade method in another embodiment of the present method;

[0023] Figure 5 It is a structural block diagram of the algorithm file upgrading device in an embodiment of the method. DETAILED DESCRIPTION

[0024] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0025] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0026] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 1 is a hardware structure diagram of a terminal of the algorithm file upgrade method in an embodiment of the present method. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the algorithm file upgrade method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0028] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0029] In this embodiment, an algorithm upgrade method is provided. Figure 2 : is a flow chart of the algorithm file upgrade method in an embodiment of the present method. Figure 2 As shown, the process includes the following steps:

[0030] Step S201, obtaining an algorithm file upgrade instruction.

[0031] The purpose of this embodiment is to upgrade the algorithm file, that is, to upgrade the original algorithm file in the monitoring device to an upgraded algorithm file. It can be understood that in this step, the purpose is to enable the device to start upgrading the algorithm file. Therefore, before upgrading the algorithm file, it is first necessary to obtain an algorithm file upgrade instruction to enable the device to upgrade the algorithm file.

[0032] Step S202: Perform upgrade preprocessing on the monitoring device based on the upgrade instruction of the algorithm file. The upgrade preprocessing includes shutting down non-core processes of the monitoring device. The core processes include the recording process.

[0033] In this embodiment, after receiving the algorithm file upgrade instruction, the algorithm file upgrade of the monitoring device begins. It is understandable that before the algorithm file upgrade, in order to ensure the smooth progress of the upgrade, upgrade preprocessing is required to ensure the successful upgrade of the algorithm file. It is understandable that the upgrade preprocessing may include shutting down non-core processes of the monitoring device. In this embodiment, all processes running in the monitoring device except the recording process are shut down, and only the recording process is turned on. The purpose of the upgrade preprocessing is to ensure that there is enough memory in the monitoring device to prepare for the decompression and installation of the algorithm file.

[0034] Step S203: acquiring the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, and decompressing the upgrade algorithm file segment by segment and installing it to the monitoring device.

[0035] After the upgrade preprocessing step is completed in this embodiment, it is necessary to start upgrading the algorithm file. In this embodiment, the monitoring device first needs to obtain the upgrade algorithm file based on the algorithm upgrade instruction. It can be understood that the upgrade algorithm file should be compressed in segments. Only the upgraded algorithm file compressed in segments can be decompressed in segments later. In addition, the upgrade algorithm file can be obtained from the cloud network or from an external hard disk. This embodiment does not make specific restrictions. It only needs to ensure that the monitoring device can obtain the upgraded algorithm file that is required by the current monitoring device and is compressed in segments. Then, the upgraded algorithm file is decompressed and installed on the monitoring device by segmented decompression. In this embodiment, since the upgraded algorithm file obtained is compressed in segments, Therefore, when decompressing the upgrade algorithm file, the upgrade algorithm file can be decompressed by segmented decompression, that is, each part of the file in the overall file is decompressed in turn. It can be understood that when decompressing the file by segmented decompression, only a part of the memory for decompressing all the files is needed to decompress it. Therefore, the occupied memory is a part of the memory occupied by the overall decompressed file in the prior art. Then, after a part of the file is decompressed and installed in the monitoring device, the next part is decompressed. Based on this, the overall upgrade algorithm file is divided into several part files and installed in the monitoring device in segments. The memory occupied when the algorithm file is installed can be less than the memory occupied by the current common method of decompressing the upgrade algorithm file as a whole, so as to decompress and install the algorithm file to complete the algorithm file upgrade.

[0036] Through the above steps, the algorithm file upgrade instruction is first obtained, and then based on the algorithm file upgrade instruction, the monitoring device is upgraded preprocessed, the upgrade preprocessing includes shutting down the non-core processes of the monitoring device, and the core processes include the recording process, and then based on the algorithm file upgrade instruction, the segmented compressed upgrade algorithm file is obtained, and the upgraded algorithm file is segmented and decompressed and installed on the monitoring device. The problem of the prior art that all functions need to be shut down when upgrading the algorithm file, resulting in missing recordings when upgrading the algorithm file, is solved, and the memory of the recording function can be guaranteed to be free when the algorithm file is upgraded, and the recording can still be performed when the algorithm file is upgraded, and the integrity of the recording during the algorithm file upgrade is guaranteed.

[0037] In another embodiment, before acquiring the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, the method further includes: sending a file acquisition instruction based on the algorithm file upgrade instruction, so that the file sending end performs segmented compression on the upgrade algorithm file based on the file acquisition instruction.

[0038] In this embodiment, after completing the preprocessing stage, the segmented compressed upgrade algorithm file is obtained based on the algorithm file upgrade instruction. It can be understood that before obtaining the segmented compressed upgrade algorithm file, it is necessary to ensure that the upgrade algorithm file is segmented and compressed. Therefore, it is necessary to send a file acquisition instruction based on the algorithm file upgrade instruction. Then, the file sending end compresses the upgrade algorithm file in segments before sending the upgrade algorithm file to the monitoring device, so as to ensure that the upgrade algorithm file sent to the monitoring device is a segmented compressed upgrade algorithm file, and to ensure that the subsequent segmented decompression can be performed normally.

[0039] In one of the embodiments, before performing upgrade preprocessing on the monitoring device, it also includes: obtaining the file identifier of the upgrade algorithm file and the file identifier of the current algorithm file, the file identifier including the file update time and the file version number; comparing the file identifier of the upgrade algorithm file with the file identifier of the current algorithm file, and if the file representation of the upgrade algorithm file is different from the file identifier of the current algorithm file, then performing upgrade preprocessing.

[0040] It can be understood that in this embodiment, before the upgrade preprocessing of the device, it also includes confirming whether an upgrade is required. First, the file identifiers of the upgrade algorithm file and the current algorithm file are obtained, and then the file identifier of the upgrade algorithm file is compared with the file identifier of the current algorithm file. Then, whether to upgrade can be confirmed based on the comparison result. It can be understood that based on the file upgrade time and the file version number, it can be determined whether the file version of the current algorithm file is ahead of the file version of the current upgrade algorithm file, or it can be verified whether the upgrade algorithm file is the same as the current algorithm file. It is easy to understand that only when the version of the upgrade algorithm file is ahead of the current algorithm file, or the upgrade algorithm file is different from the current algorithm file, can it be determined whether the current monitoring device continues to perform upgrade preprocessing and subsequent algorithm file upgrades. Based on this, it can be avoided to upgrade old version files or the same version files to ensure the effectiveness of the upgrade. That is, the upgrade can be performed based on whether the update time of the algorithm file is the latest, and it can also be determined based on whether the file identifier of the upgrade algorithm file is consistent with the file identifier of the current version of the algorithm file. There is no limitation in this embodiment. It only needs to ensure that before performing the upgrade preprocessing, it is confirmed whether the upgrade preprocessing is required based on the file identifiers of the algorithm files at both ends.

[0041] In some embodiments, before decompressing the upgrade algorithm file to the monitoring device, it also includes: obtaining the memory required for segmented decompression of the algorithm file and the available memory of the monitoring device, comparing the required memory and the available memory, obtaining the memory comparison result, and determining whether to decompress the upgrade algorithm file to the monitoring device based on the memory comparison result.

[0042] In this embodiment, before starting to decompress the upgraded algorithm file to the monitoring device, it is necessary to obtain the memory required for segmented decompression of the algorithm file and the current available memory of the monitoring device. Then, based on the comparison result of the required memory and the available memory, it can be judged whether the available memory in the current monitoring device is sufficient to meet the memory required for segmented decompression of the upgraded algorithm file in the device. It can be understood that the memory required for segmented decompression of the algorithm file includes the memory occupied by the algorithm file itself, the memory occupied by decompression, etc. When the required memory is less than the current available memory, it can be judged that the current monitoring device can perform normal decompression and installation of the algorithm file. It is easy to understand that when the memory required for segmented decompression of the current algorithm file is greater than the available memory, it is judged that the current monitoring device cannot perform normal decompression and installation of the algorithm file, and the installation is suspended until the available memory is sufficient to perform normal decompression and installation. Based on this, it can avoid the occurrence of insufficient memory during installation.

[0043] In another embodiment, the algorithm file upgrade method further includes: marking the video files generated based on the video process when the non-core process is closed, intercepting the marked video files and saving them separately to obtain the upgraded video files.

[0044] It is understandable that when the device is performing upgrade preprocessing, in order to ensure that there is enough memory to upgrade the algorithm file, all processes except the video recording function are closed. It is understandable that there is no process and free memory at this time to parse and process the video files during the upgrade of the algorithm file. Based on this, in this embodiment, when the non-core process is closed, that is, from the start of the upgrade preprocessing to the completion of the upgrade, the video files during this period are marked and saved separately for distinction, so that they can be easily distinguished and extracted after the upgrade is completed, so as to parse and process them. You can wait for the device to be upgraded and the memory of the device is free to perform subsequent analysis, or upload it to the network for cloud analysis. It only needs to ensure that the video files during the upgrade can be analyzed. By marking and saving the video files generated by the video recording function retained during the upgrade, it can be ensured that the video files that have not been processed and analyzed during the upgrade are distinguished in time, which is conducive to subsequent processing and improves the degree of file distinction.

[0045] In some embodiments, after decompressing the upgrade algorithm file in segments and installing it on the monitoring device, the method further includes: obtaining the installation result, which includes installation success and installation failure; when the installation result is installation success, enabling the monitoring device to apply the upgrade algorithm file and start the non-core process in the monitoring device; and parsing the video file during the upgrade. When the installation result is installation failure, generating an installation failure report and / or alarm.

[0046] In this embodiment, after the upgrade algorithm file is decompressed in segments and installed on the monitoring device, it is necessary to obtain the installation result. The way to obtain the installation result can be to test whether it can be successfully enabled by enabling the algorithm file, or to perform algorithm file verification. This is not specifically limited in this embodiment. It is only necessary to ensure that the installation result of the algorithm file can be obtained. The installation result obtained should include successful installation and failed installation. When the installation result is successful installation, it proves that the upgrade algorithm file has been successfully deployed to the monitoring device. At this time, you can exit the upgrade mode, that is, reopen the process closed during the upgrade preprocessing, and apply the upgrade algorithm that has been installed in the device at this time. file, switch the algorithm dynamic library and model files of the algorithm analysis to the upgraded versions, so that it can run the device normally based on the upgraded algorithm file, and parse the previously marked upgrade video files when there is free time in the device memory, to ensure that the device enters normal working state in time after the upgrade; when the installation result is an installation failure, it is understandable that an installation failure report needs to be generated to the device side or the technician, and / or an alarm is generated to prompt the technician that the installation failed. Optionally, the algorithm file can be upgraded again or the upgrade mode can be exited, that is, the upgrade algorithm file is deleted and the device process is restarted, which can ensure the normal operation of the device and improve the upgrade efficiency.

[0047] In another embodiment, parsing the video file during the upgrade includes: obtaining the available computing power of the current monitoring device and the computing power required to parse the video file during the upgrade; comparing the available computing power with the required computing power and obtaining the computing power comparison result, and based on the computing power comparison result, the monitoring device parses the video file during the upgrade while operating normally.

[0048] In this embodiment, after the device is installed and operates normally, it is also necessary to parse the upgrade video files that were previously marked during the upgrade. However, when parsing the upgrade video files, it is first necessary to obtain the computing power available for the current monitoring device. The available computing power of the device is the processing power that the device can provide for parsing the video, that is, the computing power that can be used to parse other files while ensuring the normal operation of the device, as well as the computing power required for parsing the upgrade video. By comparing the available computing power with the required computing power, it can be determined whether the current device has spare power to parse the upgrade video files. When it is determined that there is currently sufficient spare computing power, the upgrade video files are parsed based on the normal operating process. It can be understood that if there is currently insufficient spare computing power, the available computing power is continuously obtained, and the video files are parsed when there is sufficient spare computing power in the monitoring device, thereby ensuring the utilization effect of the device computing power and improving the utilization rate of the device computing power.

[0049] This embodiment also provides an algorithm file upgrade method. Figure 3 FIG. 1 is a flow chart of an algorithm file upgrade method in one embodiment of the present method. Figure 3 As shown, the process includes the following steps:

[0050] When performing upgrade preprocessing, first check whether the buffer can write data, that is, check whether the current available memory in the buffer is larger than the memory occupied by the upgrade algorithm file. If the buffer cannot write data at this time, repeat the check of available memory, and wait for the buffer to write data before proceeding to the next step. It is understandable that when the device is running based on the core functions, the occupied memory is different in different stages; when it is detected that the buffer can write data, the compressed data of the upgrade algorithm file is written to the buffer. It is understandable that writing the compressed data of the upgrade algorithm file to the buffer is to move the compressed package of the algorithm upgrade file to the memory, and then check whether the content in the buffer can be decompressed, that is, whether the current available memory size of the buffer can decompress the upgrade algorithm file. It is understandable that if the available memory is larger than the size required to decompress the upgrade algorithm file, If the available memory is smaller than the memory required for decompressing the upgrade algorithm file, the available memory is repeatedly detected until it is detected that the available memory in the buffer is larger than the memory required for decompressing the upgrade algorithm file, and then the decompression is started. It is easy to understand that when the upgrade algorithm file is about to be decompressed, the buffer needs to be blocked to prevent memory changes or file damage; then the upgrade algorithm file in the buffer is read, that is, the upgrade algorithm file in the buffer is decompressed to the monitoring device. When the upgrade algorithm file is decompressed to the monitoring device, the upgrade is deemed to be completed; it can be understood that in other embodiments, it is also possible to detect whether the buffer can be written and decompressed data. When it is determined that the data can be written and decompressed, the buffer is blocked, and the writing and decompression part is started. It is only necessary to ensure that the upgrade algorithm file can be successfully installed on the monitoring device.

[0051] Figure 4 FIG. 1 is a flow chart of an algorithm file upgrade method in another embodiment of the present method. Figure 4 As shown, in the present embodiment, after the algorithm file is upgraded, a step is required to parse the video file during the upgrade. It can be understood that in the present embodiment, it is first necessary to determine whether the device has any remaining intelligent computing power, that is, the computing power that can parse the video file. If the current device has any remaining intelligent computing power, the video file during the upgrade can be parsed. It can be understood that the parsing of the video file during the upgrade is performed without affecting the normal operation of the device. If there is no remaining intelligent computing power, the device continues to parse the real-time video file, that is, works normally, and waits for the device to have any remaining intelligent computing power before parsing the video file during the upgrade.

[0052] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] In this embodiment, an algorithm file upgrade device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0054] Figure 5 is a structural block diagram of an algorithm file upgrade device in an embodiment of the method, such as Figure 5 As shown, the device includes: an upgrade instruction acquisition module 10, an upgrade preprocessing module 20, an algorithm file installation module 30, an installation result acquisition module, an upgrade video analysis module, and a file acquisition instruction sending module.

[0055] Upgrade instruction acquisition module 10: used to obtain algorithm file upgrade instructions;

[0056] Upgrade preprocessing module 20: used to perform upgrade preprocessing on the monitoring device based on the upgrade instruction of the algorithm file, the upgrade preprocessing includes shutting down the non-core processes of the monitoring device, and the core processes include the recording process;

[0057] Upgrade preprocessing module 20: is also used to obtain the file identifier of the upgrade algorithm file and the file identifier of the current algorithm file, the file identifier includes the file update time and the file version number; based on the comparison between the file identifier of the upgrade algorithm file and the file identifier of the current algorithm file, if the file identifier of the upgrade algorithm file is different from the file identifier of the current algorithm file, upgrade preprocessing is performed.

[0058] The algorithm file installation module 30 is used to obtain the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, and to decompress the upgrade algorithm file segment by segment and install it into the monitoring device.

[0059] Algorithm file installation module 30: is also used to obtain the memory required for segmented decompression of the algorithm file and the available memory of the monitoring device, compare the required memory with the available memory, obtain the memory comparison result, and determine whether to decompress the upgraded algorithm file to the monitoring device based on the memory comparison result.

[0060] The algorithm file installation module 30 is also used to mark the video files generated based on the video process when the non-core process is closed, intercept the marked video files and save them separately to obtain the video files during the upgrade.

[0061] The installation result acquisition module is used to obtain the installation results, which include successful installation and failed installation. When the installation result is successful installation, the monitoring device applies the upgrade algorithm file and starts the non-core process in the monitoring device; and the video file during the upgrade is parsed; when the installation result is failed installation, an installation failure report and / or alarm is generated.

[0062] The file acquisition instruction sending module is used to send a file acquisition instruction based on the algorithm file upgrade instruction, so that the file sending end can compress the upgrade algorithm file in sections based on the file acquisition instruction.

[0063] The upgrade video parsing module is used to obtain the available computing power of the current monitoring device and the computing power required to parse the video files during the upgrade; the available computing power is compared with the required computing power, and the computing power comparison result is obtained. Based on the computing power comparison result, the monitoring device can parse the video files during the upgrade while operating normally.

[0064] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0065] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0066] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0067] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0068] S1, obtain algorithm file upgrade instructions.

[0069] S2, based on the algorithm file upgrade instruction, the monitoring device is upgraded preprocessed, the upgrade preprocessing includes shutting down the non-core processes of the monitoring device, and the core processes include the recording process.

[0070] S3, based on the algorithm file upgrade instruction, obtain the segmented compressed upgrade algorithm file, decompress the upgrade algorithm file segment by segment, and install it into the monitoring device.

[0071] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0072] In addition, in combination with the algorithm file upgrade method provided in the above embodiment, a storage medium can also be provided in this embodiment to implement the algorithm file upgrade method. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the algorithm file upgrade methods in the above embodiment is implemented.

[0073] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0074] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0075] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0076] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. An algorithm file upgrade method, applied to monitoring equipment, characterized in that: include: Get algorithm file upgrade instructions; Based on the algorithm file upgrade instruction, the monitoring device is pre-processed for upgrade, wherein the pre-processing for upgrade includes shutting down non-core processes of the monitoring device, wherein the non-core processes include device processes other than the recording process; Based on the algorithm file upgrade instruction, the upgraded algorithm file compressed in segments is obtained, and the upgraded algorithm file is decompressed in segments and installed to the monitoring device; the segmented decompression is to decompress each part of the upgraded algorithm file in sequence.

2. The algorithm file upgrade method according to claim 1, characterized in that: Before obtaining the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, the following step further comprises: A file acquisition instruction is sent based on the algorithm file upgrade instruction, so that the file sending end performs segmented compression on the upgrade algorithm file based on the file acquisition instruction.

3. The algorithm file upgrade method according to claim 1, characterized in that: Before performing the upgrade preprocessing on the monitoring device, the following steps are also included: Obtain the file identifier of the upgrade algorithm file and the file identifier of the current algorithm file, wherein the file identifier includes the file update time and the file version number; Based on the comparison between the file identifier of the upgrade algorithm file and the file identifier of the current algorithm file, if the file identifier of the upgrade algorithm file is different from the file identifier of the current algorithm file, upgrade preprocessing is performed.

4. The algorithm file upgrade method according to claim 1, characterized in that: Before the upgrade algorithm file is decompressed in sections and installed on the monitoring device, the following steps are also included: Obtain the memory required for segmented decompression of the algorithm file and the available memory of the monitoring device, compare the required memory with the available memory, obtain a memory comparison result, and determine whether to decompress the upgrade algorithm file to the monitoring device based on the memory comparison result.

5. The algorithm file upgrade method according to claim 1, characterized in that: The algorithm file upgrade method also includes: The video files generated based on the video process when the non-core process is closed are marked, and the marked video files are intercepted and saved separately to obtain the video files during the upgrade.

6. The algorithm file upgrade method according to claim 5, characterized in that: After decompressing the upgrade algorithm file in sections and installing it to the monitoring device, the following steps are also included: Obtaining installation results, where the installation results include installation success and installation failure; When the installation result is successful, the monitoring device applies the upgrade algorithm file, starts the non-core process in the monitoring device; and parses the video file during the upgrade; When the installation result is installation failure, an installation failure report and / or an alarm is generated.

7. The algorithm file upgrade method according to claim 6, characterized in that: The parsing of the video file during the upgrade includes: Obtaining the computing power currently available for the monitoring device and the computing power required for parsing the video file during the upgrade; The available computing power is compared with the required computing power, and a computing power comparison result is obtained. Based on the computing power comparison result, the monitoring device is enabled to parse the upgraded video file while operating normally.

8. An algorithm file upgrade device, applied to monitoring equipment, characterized in that: include: Upgrade instruction acquisition module: used to obtain algorithm file upgrade instructions; An upgrade preprocessing module: used to perform upgrade preprocessing on the monitoring device based on the upgrade instruction of the algorithm file, wherein the upgrade preprocessing includes shutting down non-core processes of the monitoring device, wherein the non-core processes include device processes other than the recording process; Algorithm file installation module: used to obtain the segmented compressed upgrade algorithm file based on the algorithm file upgrade instruction, and decompress the upgrade algorithm file segment by segment and install it to the monitoring device; the segmented decompression is to decompress each part of the upgrade algorithm file in turn.

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

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the algorithm file upgrading method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Intelligent remote upgrading method applied to video surveillance device

    CN109347937A

  • Firmware upgrading method, device and system

    CN111475195A