CN111813427A - Device repair method, device, electronic device and storage medium - Google Patents
Device repair method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN111813427A CN111813427A CN201910295950.4A CN201910295950A CN111813427A CN 111813427 A CN111813427 A CN 111813427A CN 201910295950 A CN201910295950 A CN 201910295950A CN 111813427 A CN111813427 A CN 111813427A
- Authority
- CN
- China
- Prior art keywords
- electronic device
- software program
- current
- current device
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0793—Remedial or corrective actions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
本申请实施例提供了设备修复方法、装置、电子设备及存储介质,该电子设备包括:处理器、存储器及通信模块,处理器用于:获取当前设备的异常信息,按照当前设备的异常信息,判断当前设备是否需要进行修复;在当前设备需要进行修复时,获取当前设备的属性信息;按照当前设备的属性信息,在预设网络中确定当前设备对应的目标设备;获取目标设备的软件程序,按照目标设备的软件程序,更新当前设备的软件程序。在本申请实施例的电子设备中,在当前设备需要修复时,确定软件程序版本信息与当前设备软件程序版本信息相同的目标设备,从目标设备中获取软件程序以更新当前设备的软件程序,能够实现设备的自动修复,减少人工工作量,提高设备修复效率。
Embodiments of the present application provide a device repairing method, device, electronic device, and storage medium. The electronic device includes: a processor, a memory, and a communication module, where the processor is used to: acquire abnormal information of the current device, and judge according to the abnormal information of the current device. Whether the current device needs to be repaired; when the current device needs to be repaired, obtain the attribute information of the current device; according to the attribute information of the current device, determine the target device corresponding to the current device in the preset network; obtain the software program of the target device, according to The software program of the target device, which updates the software program of the current device. In the electronic device of the embodiment of the present application, when the current device needs to be repaired, a target device whose software program version information is the same as the current device software program version information is determined, and the software program is obtained from the target device to update the software program of the current device. Realize automatic repair of equipment, reduce manual workload, and improve equipment repair efficiency.
Description
技术领域technical field
本申请涉及设备修复技术领域,特别是涉及设备修复方法、装置、电子设备及存储介质。The present application relates to the technical field of equipment repair, and in particular, to a method, apparatus, electronic device and storage medium for equipment repair.
背景技术Background technique
随着安防技术的发展,用于监控目的的视频监控网络已成为流行。在大型商场、景区、及公共交通等场景中,视频监控网络为人们的安全生活提供了保障与支持。With the development of security technology, video surveillance networks for surveillance purposes have become popular. In large shopping malls, scenic spots, and public transportation, video surveillance networks provide guarantee and support for people's safe life.
视频监控网络包括多个视频监控设备,各视频监控设备用于采集指定区域中的图像。相关技术中,当视频监控设备因软件异常无法启动时,需要工作人员到异常视频监控设备的安装位置,将异常视频监控设备连接专业修复工具,例如通过TFTP(Trivial FileTransfer Protocol,简单文件传输协议)工作对视频监控设备的软件进行修复,但是采用人工现场修复的方法,增加了工作人员的工作量,视频监控设备修复效率低。The video surveillance network includes a plurality of video surveillance devices, and each video surveillance device is used to collect images in a designated area. In the related art, when a video surveillance device cannot be started due to a software abnormality, a staff member is required to go to the installation location of the abnormal video surveillance device and connect the abnormal video surveillance device to a professional repair tool, such as through TFTP (Trivial File Transfer Protocol, simple file transfer protocol). The work repairs the software of the video surveillance equipment, but the method of manual on-site repair increases the workload of the staff, and the repair efficiency of the video surveillance equipment is low.
发明内容SUMMARY OF THE INVENTION
本申请实施例的目的在于提供一种设备修复方法、装置、电子设备及存储介质,以实现减少工作人员的工作量,提高设备修复效率。具体技术方案如下:The purpose of the embodiments of the present application is to provide a device repair method, device, electronic device, and storage medium, so as to reduce the workload of staff and improve the device repair efficiency. The specific technical solutions are as follows:
第一方面,本申请实施例提供了一种设备修复方法,所述方法包括:In a first aspect, an embodiment of the present application provides a device repairing method, the method comprising:
获取当前设备的异常信息,按照所述当前设备的异常信息,判断所述当前设备是否需要进行修复;Obtain the abnormal information of the current device, and determine whether the current device needs to be repaired according to the abnormal information of the current device;
在所述当前设备需要进行修复时,获取所述当前设备的属性信息,其中,所述当前设备的属性信息包括所述当前设备的软件程序版本信息;When the current device needs to be repaired, obtain attribute information of the current device, wherein the attribute information of the current device includes software program version information of the current device;
按照所述当前设备的属性信息,在预设网络中确定所述当前设备对应的目标设备,其中,所述目标设备的软件程序版本信息与所述当前设备的软件程序版本信息相同;According to the attribute information of the current device, the target device corresponding to the current device is determined in the preset network, wherein the software program version information of the target device is the same as the software program version information of the current device;
获取所述目标设备的软件程序,按照所述目标设备的软件程序,更新所述当前设备的软件程序。The software program of the target device is acquired, and the software program of the current device is updated according to the software program of the target device.
可选的,所述获取当前设备的异常信息,按照所述当前设备的异常信息,判断所述当前设备是否需要进行修复,包括:Optionally, the acquiring abnormal information of the current device, and determining whether the current device needs to be repaired according to the abnormal information of the current device, includes:
获取当前设备的异常信息;Get the abnormal information of the current device;
按照所述当前设备的异常信息,判断所述当前设备的异常次数与预设次数阈值的大小;According to the abnormal information of the current device, determine the abnormal times of the current device and the size of the preset times threshold;
若所述当前设备的异常次数大于所述次数阈值,判定所述当前设备需要进行修复;If the abnormal count of the current device is greater than the count threshold, it is determined that the current device needs to be repaired;
若所述当前设备的异常次数不大于所述次数阈值,判定所述当前设备不需要进行修复。If the abnormal count of the current device is not greater than the count threshold, it is determined that the current device does not need to be repaired.
可选的,在所述按照所述当前设备的异常信息,判断所述当前设备是否需要进行修复之后,所述方法还包括:Optionally, after judging whether the current device needs to be repaired according to the abnormal information of the current device, the method further includes:
在所述当前设备不需要进行修复时,按照所述当前设备的软件程序启动所述当前设备;When the current device does not need to be repaired, start the current device according to the software program of the current device;
在所述当前设备启动成功后,清空所述当前设备的异常信息。After the current device is successfully started, the abnormal information of the current device is cleared.
可选的,在所述获取所述目标设备的软件程序,按照所述目标设备的软件程序,更新所述当前设备的软件程序之后,所述方法还包括:Optionally, after obtaining the software program of the target device, and updating the software program of the current device according to the software program of the target device, the method further includes:
按照更新后的软件程序,启动所述当前设备;According to the updated software program, start the current device;
在所述当前设备启动成功后,清空所述当前设备的异常信息。After the current device is successfully started, the abnormal information of the current device is cleared.
可选的,在所按照所述当前设备的属性信息,在预设网络中确定所述当前设备对应的目标设备之后,所述方法还包括:Optionally, after determining the target device corresponding to the current device in the preset network according to the attribute information of the current device, the method further includes:
判断所述当前设备的本地存储中是否存在可用的配置参数;Determine whether there are available configuration parameters in the local storage of the current device;
若所述当前设备的本地存储中不存在可用的配置参数,获取所述目标设备的配置参数,将所述目标设备的配置参数存储在所述当前设备的本地存储中。If the available configuration parameters do not exist in the local storage of the current device, obtain the configuration parameters of the target device, and store the configuration parameters of the target device in the local storage of the current device.
第二方面,本申请实施例提供了一种设备修复装置,所述装置包括:In a second aspect, an embodiment of the present application provides an apparatus for repairing equipment, and the apparatus includes:
设备修复判断模块,用于获取当前设备的异常信息,按照所述当前设备的异常信息,判断所述当前设备是否需要进行修复;an equipment repair judgment module, configured to obtain abnormal information of the current equipment, and judge whether the current equipment needs to be repaired according to the abnormal information of the current equipment;
属性信息获取模块,用于在所述当前设备需要进行修复时,获取所述当前设备的属性信息,其中,所述当前设备的属性信息包括所述当前设备的软件程序版本信息;an attribute information obtaining module, configured to obtain attribute information of the current device when the current device needs to be repaired, wherein the attribute information of the current device includes software program version information of the current device;
目标设备确定模块,用于按照所述当前设备的属性信息,在预设网络中确定所述当前设备对应的目标设备,其中,所述目标设备的软件程序版本信息与所述当前设备的软件程序版本信息相同;A target device determination module, configured to determine a target device corresponding to the current device in a preset network according to the attribute information of the current device, wherein the software program version information of the target device and the software program of the current device The version information is the same;
软件程序克隆模块,用于获取所述目标设备的软件程序,按照所述目标设备的软件程序,更新所述当前设备的软件程序。The software program cloning module is used to obtain the software program of the target device, and update the software program of the current device according to the software program of the target device.
可选的,所述设备修复判断模块,包括:Optionally, the device repair judgment module includes:
异常信息获取子模块,用于获取当前设备的异常信息;Abnormal information acquisition sub-module, used to acquire abnormal information of the current device;
异常次数判断子模块,用于按照所述当前设备的异常信息,判断所述当前设备的异常次数与预设次数阈值的大小;The abnormal times judgment submodule is used for judging the abnormal times of the current equipment and the preset times threshold according to the abnormal information of the current equipment;
第一修复判定子模块,用于若所述当前设备的异常次数大于所述次数阈值,判定所述当前设备需要进行修复;a first repair determination sub-module, configured to determine that the current device needs to be repaired if the abnormal count of the current device is greater than the count threshold;
第二修复判定子模块,用于若所述当前设备的异常次数不大于所述次数阈值,判定所述当前设备不需要进行修复。The second repair determination sub-module is configured to determine that the current device does not need to be repaired if the abnormal count of the current device is not greater than the count threshold.
可选的,本申请实施例的设备修复装置还包括:Optionally, the apparatus for repairing equipment in the embodiment of the present application further includes:
第一启动模块,用于在所述当前设备不需要进行修复时,按照所述当前设备的软件程序启动所述当前设备;a first startup module, configured to start the current device according to a software program of the current device when the current device does not need to be repaired;
第一异常信息清除模块,用于在所述当前设备启动成功后,清空所述当前设备的异常信息。The first exception information clearing module is configured to clear the exception information of the current device after the current device is successfully started.
可选的,本申请实施例的设备修复装置还包括:Optionally, the apparatus for repairing equipment in the embodiment of the present application further includes:
第二启动模块,用于按照更新后的软件程序,启动所述当前设备;The second startup module is used to start the current device according to the updated software program;
第二异常信息清除模块,用于在所述当前设备启动成功后,清空所述当前设备的异常信息。The second exception information clearing module is configured to clear the exception information of the current device after the current device is successfully started.
可选的,本申请实施例的设备修复装置还包括:Optionally, the apparatus for repairing equipment in the embodiment of the present application further includes:
配置参数判断模块,用于判断所述当前设备的本地存储中是否存在可用的配置参数;a configuration parameter judgment module, used for judging whether there are available configuration parameters in the local storage of the current device;
配置参数克隆模块,用于若所述当前设备的本地存储中不存在可用的配置参数,获取所述目标设备的配置参数,将所述目标设备的配置参数存储在所述当前设备的本地存储中。A configuration parameter cloning module, configured to acquire the configuration parameters of the target device if there are no available configuration parameters in the local storage of the current device, and store the configuration parameters of the target device in the local storage of the current device .
第三方面,本申请实施例提供了一种电子设备,所述电子设备包括:In a third aspect, an embodiment of the present application provides an electronic device, and the electronic device includes:
处理器、存储器及通信模块;processor, memory and communication module;
所述存储器用于存储计算机程序;the memory is used to store computer programs;
所述通信模块用于进行网络通信;The communication module is used for network communication;
所述处理器用于在运行所述存储器中存放的计算机程序时,执行如下步骤:The processor is configured to perform the following steps when running the computer program stored in the memory:
获取所述电子设备的异常信息,按照所述电子设备的异常信息,判断所述电子设备是否需要进行修复;Acquiring abnormal information of the electronic device, and determining whether the electronic device needs to be repaired according to the abnormal information of the electronic device;
在所述电子设备需要进行修复时,获取所述电子设备的属性信息,其中,所述电子设备的属性信息包括所述电子设备的软件程序版本信息;When the electronic device needs to be repaired, acquire attribute information of the electronic device, wherein the attribute information of the electronic device includes software program version information of the electronic device;
按照所述电子设备的属性信息,在预设网络中确定所述电子设备对应的目标设备,其中,所述目标设备的软件程序版本信息与所述电子设备的软件程序版本信息相同;According to the attribute information of the electronic device, the target device corresponding to the electronic device is determined in the preset network, wherein the software program version information of the target device is the same as the software program version information of the electronic device;
获取所述目标设备的软件程序,按照所述目标设备的软件程序,更新所述电子设备的软件程序。The software program of the target device is acquired, and the software program of the electronic device is updated according to the software program of the target device.
可选的,所述获取所述电子设备的异常信息,按照所述电子设备的异常信息,判断所述电子设备是否需要进行修复,包括:Optionally, the acquiring abnormal information of the electronic device, and determining whether the electronic device needs to be repaired according to the abnormal information of the electronic device, includes:
获取所述电子设备的异常信息;Obtain abnormal information of the electronic device;
按照所述电子设备的异常信息,判断所述电子设备的异常次数与预设次数阈值的大小;According to the abnormality information of the electronic device, determine the number of the abnormality of the electronic device and the size of the preset number of times threshold;
若所述电子设备的异常次数大于所述次数阈值,判定所述电子设备需要进行修复;If the abnormal count of the electronic device is greater than the count threshold, it is determined that the electronic device needs to be repaired;
若所述电子设备的异常次数不大于所述次数阈值,判定所述电子设备不需要进行修复。If the abnormal times of the electronic equipment is not greater than the times threshold, it is determined that the electronic equipment does not need to be repaired.
可选的,所述异常信息表征所述电子设备启动失败的次数;Optionally, the abnormal information represents the number of times the electronic device fails to start;
所述按照所述电子设备的异常信息,判断所述电子设备的异常次数与预设次数阈值的大小,包括:According to the abnormal information of the electronic device, judging the abnormal times of the electronic device and the size of the preset times threshold include:
按照所述电子设备的异常信息,判断所述电子设备启动失败的次数与预设次数阈值的大小,其中,若所述电子设备启动失败的次数大于预设次数阈值,判定所述电子设备的异常次数大于预设次数阈值,若所述电子设备启动失败的次数不大于预设次数阈值,判定所述电子设备的异常次数不大于预设次数阈值。According to the abnormality information of the electronic device, determine the number of failures to start the electronic device and the preset number of thresholds, wherein if the number of failures to start the electronic device is greater than the preset number of thresholds, determine that the electronic device is abnormal The number of times is greater than the preset number of times threshold, and if the number of times the electronic device fails to start is not greater than the preset number of times threshold, it is determined that the number of abnormal times of the electronic device is not greater than the preset number of times threshold.
所述处理器还用于:在所述电子设备启动失败时,记录表征所述电子设备启动失败的异常信息。The processor is further configured to record abnormal information representing the failure to start the electronic device when the electronic device fails to start.
可选的,所述处理器还用于:在所述电子设备不需要进行修复时,按照所述电子设备的软件程序启动所述电子设备;在所述电子设备启动成功后,清空所述电子设备的异常信息。Optionally, the processor is further configured to: start the electronic device according to the software program of the electronic device when the electronic device does not need to be repaired; after the electronic device is successfully started, clear the electronic device. Device exception information.
可选的,所述处理器还用于:按照更新后的软件程序,启动所述电子设备;在所述电子设备启动成功后,清空所述电子设备的异常信息。Optionally, the processor is further configured to: start the electronic device according to the updated software program; and clear the abnormal information of the electronic device after the electronic device is successfully started.
可选的,所述处理器还用于:Optionally, the processor is also used for:
判断所述存储器中是否存在可用的配置参数;若所述存储器中不存在可用的配置参数,获取所述目标设备的配置参数,将所述目标设备的配置参数存储在所述存储器中。Determine whether there are available configuration parameters in the memory; if there are no available configuration parameters in the memory, obtain the configuration parameters of the target device, and store the configuration parameters of the target device in the memory.
可选的,所述判断所述存储器中是否存在可用的配置参数包括:Optionally, the judging whether there are available configuration parameters in the memory includes:
在所述存储器中获取配置文件,并读取所述配置文件中的配置参数,其中,所述配置参数包括多个配置项;Acquire a configuration file in the memory, and read configuration parameters in the configuration file, wherein the configuration parameters include a plurality of configuration items;
检测所述配置参数的各配置项是否均完整,若存在的不完整的配置项,判断所述配置参数不可用;Detecting whether each configuration item of the configuration parameter is complete, and if there is an incomplete configuration item, judging that the configuration parameter is unavailable;
若所述配置参数的各配置项均完整,分别判断各所述配置项的数值是否在相应的预设取值范围内,若各所述配置项的数值均在相应的预设取值范围内,判定所述配置参数可用,否则判定所述配置参数不可用。If each configuration item of the configuration parameter is complete, judge whether the value of each configuration item is within the corresponding preset value range, and if the value of each configuration item is within the corresponding preset value range , it is determined that the configuration parameter is available, otherwise it is determined that the configuration parameter is unavailable.
可选的,所述处理器还用于:按照所述目标设备的配置参数,配置所述电子设备。Optionally, the processor is further configured to configure the electronic device according to configuration parameters of the target device.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面任一所述的设备修复方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any one of the above-mentioned first aspect is implemented. Device repair method.
本申请实施例提供的设备修复方法、装置、电子设备及存储介质,获取当前设备的异常信息,按照当前设备的异常信息,判断当前设备是否需要进行修复;在当前设备需要进行修复时,获取当前设备的属性信息,其中,当前设备的属性信息包括当前设备的软件程序版本信息;按照当前设备的属性信息,在预设网络中确定当前设备对应的目标设备,其中,目标设备的软件程序版本信息与当前设备的软件程序版本信息相同;获取目标设备的软件程序,按照目标设备的软件程序,更新当前设备的软件程序。在当前设备需要修复时,确定软件程序版本信息与当前设备软件程序版本信息相同的目标设备,从目标设备中获取软件程序以更新当前设备的软件程序,能够实现设备的自动修复,减少人工工作量,提高设备修复效率。当然,实施本申请的任一产品或方法并不一定需要同时达到以上所述的所有优点。The device repair method, device, electronic device, and storage medium provided by the embodiments of the present application acquire abnormal information of the current device, and determine whether the current device needs to be repaired according to the abnormal information of the current device; when the current device needs to be repaired, obtain the current device. The attribute information of the device, wherein the attribute information of the current device includes the software program version information of the current device; according to the attribute information of the current device, the target device corresponding to the current device is determined in the preset network, wherein the software program version information of the target device is It is the same as the software program version information of the current device; the software program of the target device is obtained, and the software program of the current device is updated according to the software program of the target device. When the current device needs to be repaired, determine the target device whose software program version information is the same as the current device software program version information, and obtain the software program from the target device to update the software program of the current device, which can realize the automatic repair of the device and reduce the manual workload. , to improve the efficiency of equipment repair. Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例的设备修复方法的第一种示意图;FIG. 1 is a first schematic diagram of a device repairing method according to an embodiment of the application;
图2为本申请实施例的设备修复装置的第一种示意图;FIG. 2 is a first schematic diagram of the equipment repairing device according to an embodiment of the application;
图3为本申请实施例的设备修复方法的第二种示意图;3 is a second schematic diagram of a device repairing method according to an embodiment of the present application;
图4为本申请实施例的设备修复方法的第三种示意图;4 is a third schematic diagram of a device repairing method according to an embodiment of the present application;
图5为本申请实施例的设备修复方法的第四种示意图;5 is a fourth schematic diagram of a device repairing method according to an embodiment of the present application;
图6为本申请实施例的设备修复装置的第二种示意图;6 is a second schematic diagram of the device repairing device according to an embodiment of the application;
图7为本申请实施例的电子设备的一种示意图。FIG. 7 is a schematic diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
首先,对本申请实施例中的术语进行解释:First, the terms in the embodiments of the present application are explained:
在线克隆:特指视频监控设备,自动将网络上同类型设备程序克隆至自身Online cloning: It refers specifically to video surveillance equipment, which automatically clones the programs of the same type of equipment on the network to itself
SADP(Search Active Device Protocol,搜索在线设备协议):搜索在线网络摄像机设备信息,包括网络设备的型号、序列号、程序、网络参数等。SADP (Search Active Device Protocol): Search for online IP camera device information, including the model, serial number, program, and network parameters of the network device.
相关技术中,当监控网络中的视频监控设备异常无法启动时,需要工作人员到异常视频监控设备的安装位置,现场采用TFTP工具升级修复,但是采用人工现场修复的方法,增加了工作人员的工作量,视频监控设备修复效率低。In the related art, when the video monitoring equipment in the monitoring network cannot be started abnormally, the staff needs to go to the installation location of the abnormal video monitoring equipment, and use the TFTP tool to upgrade and repair on site, but the manual on-site repair method is used, which increases the work of the staff. The repair efficiency of video surveillance equipment is low.
有鉴于此,本申请实施例提供了一种设备修复方法,参见图1,该方法包括:In view of this, an embodiment of the present application provides a device repairing method, see FIG. 1 , the method includes:
S101,获取当前设备的异常信息,按照上述当前设备的异常信息,判断上述当前设备是否需要进行修复。S101: Acquire abnormal information of the current device, and determine whether the current device needs to be repaired according to the abnormal information of the current device.
本申请实施例的设备修复方法可以通过视频监控设备实现,还可以通过连接视频监控设备的服务器实现,下面以视频监控设备为例进行说明。The device repairing method according to the embodiment of the present application may be implemented by a video surveillance device, and may also be implemented by a server connected to the video surveillance device. The video surveillance device is used as an example for description below.
本申请实施例的设备修复方法具体可以应用于视频监控设备,因此可以通过视频监控设备实现,具体的,可以通过视频监控设备中的守护进程实现。视频监控设备获取自身的异常信息,例如,视频监控设备(即当前设备)可以从自身的Flash存储(闪存)中获取当前设备的异常信息。对当前设备的异常信息进行分析,判断当前设备是否需要进行修复。例如,在当前设备的异常信息表征当前设备的监控程序无法正常运行时,判定当前设备需要进行修复。The device repairing method of the embodiment of the present application can be specifically applied to a video surveillance device, and thus can be implemented by a video surveillance device, and specifically, can be implemented by a daemon process in the video surveillance device. The video surveillance device acquires its own abnormal information. For example, the video surveillance device (ie, the current device) can acquire the abnormal information of the current device from its own Flash storage (flash memory). Analyze the abnormal information of the current device to determine whether the current device needs to be repaired. For example, when the abnormal information of the current device indicates that the monitoring program of the current device cannot run normally, it is determined that the current device needs to be repaired.
可选的,上述获取当前设备的异常信息,按照上述当前设备的异常信息,判断上述当前设备是否需要进行修复,包括:Optionally, the above-mentioned obtaining abnormal information of the current device, and determining whether the above-mentioned current device needs to be repaired according to the above-mentioned abnormal information of the current device, including:
步骤一,获取当前设备的异常信息。Step 1: Obtain the abnormal information of the current device.
步骤二,按照上述当前设备的异常信息,判断上述当前设备的异常次数与预设次数阈值的大小。Step 2, according to the abnormality information of the current device, determine the number of the abnormality of the current device and the size of the preset number of times threshold.
按照当前设备的异常信息确定当前设备的异常次数,比较当前设备的异常次数与预设次数阈值的大小。预设次数阈值可以根据实际情况进行设定,例如设置为4次、5次或6次等。Determine the abnormal times of the current equipment according to the abnormal information of the current equipment, and compare the abnormal times of the current equipment with the preset times threshold. The preset number of times threshold can be set according to the actual situation, for example, set to 4 times, 5 times or 6 times, etc.
步骤三,若上述当前设备的异常次数大于上述次数阈值,判定上述当前设备需要进行修复。Step 3: If the abnormal count of the current device is greater than the count threshold, it is determined that the current device needs to be repaired.
步骤四,若上述当前设备的异常次数不大于上述次数阈值,判定上述当前设备不需要进行修复。Step 4: If the abnormal times of the current equipment is not greater than the threshold of times, it is determined that the current equipment does not need to be repaired.
在本申请实施例中,若当前设备的异常次数大于与预设次数阈值,说明当前设备异常次数较多,因此需要对当前设备进行修复。In the embodiment of the present application, if the abnormal times of the current equipment is greater than the preset times threshold, it means that the current equipment has many abnormal times, and therefore the current equipment needs to be repaired.
S102,在上述当前设备需要进行修复时,获取上述当前设备的属性信息,其中,上述当前设备的属性信息包括上述当前设备的软件程序版本信息。S102, when the current device needs to be repaired, acquire attribute information of the current device, where the attribute information of the current device includes software program version information of the current device.
当前设备的属性信息包括当前设备的软件程序版本信息,还可以包括当前设备的型号、序列号及网络版本信息等。The attribute information of the current device includes software program version information of the current device, and may also include the model, serial number, and network version information of the current device.
S103,按照上述当前设备的属性信息,在预设网络中确定上述当前设备对应的目标设备,其中,上述目标设备的软件程序版本信息与上述当前设备的软件程序版本信息相同。S103: Determine a target device corresponding to the current device in a preset network according to the attribute information of the current device, wherein the software program version information of the target device is the same as the software program version information of the current device.
预设网络可以为当前设备所在的视频监控网络,目标设备为预设网络中正常运行的设备。当前设备可以启用SADP搜索线程,搜索预设网络中正常的视频监控设备,获取预设网络中正常设备的软件程序版本信息,并选取软件程序版本信息与当前设备软件程序版本信息相同的设备,作为目标设备。当然预设网络也可以为万维网,当前设备在万维网中寻找目标设备。可选的,为了保证软件程序的可用性,除软件程序版本信息外,还可以获取预设网络中各设备的型号、序列号、网络版本信息,在选取目标设备时,保证目标设备的型号及网络版本信息与当前设备的型号及网络版本信息相同。The preset network may be the video surveillance network where the current device is located, and the target device may be a device running normally in the preset network. The current device can enable the SADP search thread, search for normal video surveillance devices in the preset network, obtain the software program version information of the normal devices in the preset network, and select the device whose software program version information is the same as the current device software program version information as the target device. Of course, the preset network may also be the World Wide Web, and the current device searches for the target device in the World Wide Web. Optionally, in order to ensure the availability of the software program, in addition to the software program version information, the model, serial number, and network version information of each device in the preset network can also be obtained. The version information is the same as the model and network version information of the current device.
S104,获取上述目标设备的软件程序,按照上述目标设备的软件程序,更新上述当前设备的软件程序。S104: Obtain the software program of the target device, and update the software program of the current device according to the software program of the target device.
通过在线克隆技术将目标设备的软件程序克隆到当前设备中,将当前设备的软件程序更新为上述目标设备的软件程序,以完成当前设备的修复。The software program of the target device is cloned into the current device through the online cloning technology, and the software program of the current device is updated to the software program of the above-mentioned target device, so as to complete the restoration of the current device.
本申请实施例的设备修复方法还可以通过连接视频监控设备的服务器实现,即服务器监控定时获取当前设备的异常信息,从而执行本申请实施例的设备修复方法。The device repairing method of the embodiment of the present application may also be implemented by connecting to a server of the video surveillance device, that is, the server monitors and obtains abnormal information of the current device periodically, thereby executing the device repairing method of the embodiment of the present application.
在本申请实施例中,在当前设备需要修复时,确定软件程序版本信息与当前设备软件程序版本信息相同的目标设备,从目标设备中获取软件程序以更新当前设备的软件程序,能够实现设备的自动修复,减少人工工作量,提高设备修复效率。In the embodiment of the present application, when the current device needs to be repaired, a target device whose software program version information is the same as the current device software program version information is determined, and the software program is obtained from the target device to update the software program of the current device, which can realize the Automatic repair, reduce manual workload and improve equipment repair efficiency.
可选的,在上述按照上述当前设备的异常信息,判断上述当前设备是否需要进行修复之后,上述方法还包括:Optionally, after judging whether the current device needs to be repaired according to the abnormal information of the current device, the method further includes:
步骤一,在上述当前设备不需要进行修复时,按照上述当前设备的软件程序启动上述当前设备。
步骤二,在上述当前设备启动成功后,清空上述当前设备的异常信息。Step 2, after the current device is successfully started, clear the abnormal information of the current device.
在当前设备不需要进行修复时,按照当前设备的软件程序启动当前设备的监控功能。当前设备启动成功后,清除当前设备的异常信息,从而防止因为设备中存储中异常信息较多,造成设备反复更新软件程序的情况。When the current device does not need to be repaired, start the monitoring function of the current device according to the software program of the current device. After the current device is successfully started, the abnormal information of the current device is cleared, so as to prevent the device from repeatedly updating the software program due to a large amount of abnormal information stored in the device.
若当前设备启动失败,获取上述当前设备的属性信息,按照上述当前设备的属性信息,在预设网络中确定上述当前设备对应的目标设备,获取上述目标设备的软件程序,按照上述目标设备的软件程序,更新上述当前设备的软件程序。If the current device fails to start, obtain the attribute information of the current device, determine the target device corresponding to the current device in the preset network according to the attribute information of the current device, obtain the software program of the target device, and obtain the software program of the target device according to the software program of the target device. program to update the software program of the current device described above.
可选的,在上述获取上述目标设备的软件程序,按照上述目标设备的软件程序,更新上述当前设备的软件程序之后,上述方法还包括:Optionally, after obtaining the software program of the target device above, and updating the software program of the current device according to the software program of the target device, the method further includes:
步骤一,按照更新后的软件程序,启动上述当前设备。Step 1: Start the above current device according to the updated software program.
在当前设备的软件程序更新完成后,当前设备按照更新后的软件程序进行启动。After the software program of the current device is updated, the current device starts up according to the updated software program.
步骤二,在上述当前设备启动成功后,清空上述当前设备的异常信息。Step 2, after the current device is successfully started, clear the abnormal information of the current device.
当前设备启动成功后,说明当前设备的故障应经修复,清除当前设备的异常信息,从而防止因为设备中存储中异常信息较多,这造成设备反复更新软件程序的情况。After the current device is successfully started, it means that the fault of the current device should be repaired and the abnormal information of the current device is cleared, so as to prevent the device from repeatedly updating the software program due to the excessive abnormal information stored in the device.
可选的,在所按照上述当前设备的属性信息,在预设网络中确定上述当前设备对应的目标设备之后,上述方法还包括:Optionally, after the target device corresponding to the current device is determined in the preset network according to the attribute information of the current device, the method further includes:
获取上述目标设备的配置参数,将上述目标设备的配置参数存储在上述当前设备的本地存储中。The configuration parameters of the target device are acquired, and the configuration parameters of the target device are stored in the local storage of the current device.
在一种可能的实施方式中,无论当前设备中是否有配置参数,为了保证当前设备的可用,在克隆目标设备的软件程序的同时,还会克隆目标设备的配置参数,同时克隆目标设备的软件程序及配置参数,能够增加当前设备的可用性。In a possible implementation, regardless of whether there are configuration parameters in the current device, in order to ensure the availability of the current device, while cloning the software program of the target device, the configuration parameters of the target device will also be cloned, and the software of the target device will be cloned at the same time. Program and configuration parameters that increase the availability of current equipment.
可选的,在所按照上述当前设备的属性信息,在预设网络中确定上述当前设备对应的目标设备之后,上述方法还包括:Optionally, after the target device corresponding to the current device is determined in the preset network according to the attribute information of the current device, the method further includes:
步骤一,判断上述当前设备的本地存储中是否存在可用的配置参数。Step 1: Determine whether there are available configuration parameters in the local storage of the current device.
在确定目标设备之后,除了克隆目标设备的软件程序外,还需要确定是否需要克隆目标设备的配置参数。在本申请实施例中,判断当前设备的本地存储中是否存储有可用的配置参数。例如,在当前设备的Flash存储中存在当前设备的配置参数时,则判定存在可用的配置参数;在当前设备的Flash存储中不存在当前设备的配置参数时,则判定不存在可用的配置参数。After the target device is determined, in addition to cloning the software program of the target device, it is also necessary to determine whether the configuration parameters of the target device need to be cloned. In this embodiment of the present application, it is determined whether there are available configuration parameters stored in the local storage of the current device. For example, when the configuration parameters of the current device exist in the Flash storage of the current device, it is determined that there are available configuration parameters; when the configuration parameters of the current device do not exist in the Flash storage of the current device, it is determined that there are no available configuration parameters.
步骤二,若上述当前设备的本地存储中不存在可用的配置参数,获取上述目标设备的配置参数,将上述目标设备的配置参数存储在上述当前设备的本地存储中。Step 2: If there are no available configuration parameters in the local storage of the current device, obtain the configuration parameters of the target device, and store the configuration parameters of the target device in the local storage of the current device.
在当前设备的本地存储中不存在可用的配置参数时,将目标设备的配置参数克隆到当前设备的本地存储中,在启动当前设备的过程中,按照当前设备本地存储中的配置参数配置当前设备。在当前设备的本地存储中存在可用的配置参数时,当克隆完目标设备的软件程序后,在启动当前设备的过程中,直接按照当前设备本地存储中的配置参数配置当前设备。When there are no available configuration parameters in the local storage of the current device, clone the configuration parameters of the target device to the local storage of the current device. During the process of starting the current device, configure the current device according to the configuration parameters in the local storage of the current device. . When there are available configuration parameters in the local storage of the current device, after cloning the software program of the target device, in the process of starting the current device, configure the current device directly according to the configuration parameters in the local storage of the current device.
在本申请实施例中,判断当前设备自身是否有可用的配置参数,能够按照当前设备自身的配置参数配置当前设备,满足参数独立配置的应用场景。In the embodiment of the present application, it is determined whether the current device itself has available configuration parameters, the current device can be configured according to the configuration parameters of the current device itself, and the application scenario of parameter independent configuration is satisfied.
本申请实施例还提供了一种设备修复装置,参见图2,包括:The embodiment of the present application also provides an apparatus for repairing equipment, see FIG. 2 , including:
异常检测模块201,用于检测当前设备是否处于异常状态。The
在线设备检测模块202,用于当前设备处于异常状态时,搜索预设网络中正常的设备,在正常设备中确定软件版本信息与当前设备软件版本信息相同的目标设备。The online
在线设备克隆模块203,用于将目标设备的软件程序及配置参数克隆至当前设备。The online
可选的,异常检测模块201的运行逻辑可以如图3所示。Optionally, the operation logic of the
步骤1,从当前设备flash内读取当前设备异常信息。
步骤2,判断当前设备异常次数是否大于次数阈值5,如果大于则异常检测模块201退出;否则执行步骤3。Step 2, determine whether the current device abnormality count is greater than the count threshold 5, if it is greater than the
步骤3,判断davinci进程是否已经退出,如果是则执行步骤6;否则执行步骤4。Step 3, determine whether the davinci process has exited, if so, go to Step 6; otherwise, go to Step 4.
步骤4,判断davinci是否已经启动完成,如果是则执行步骤8;否则执行步骤5Step 4, determine whether davinci has been started, if so, go to step 8; otherwise, go to step 5
步骤5,清空当前设备异常信息,将异常次数修正为0。Step 5: Clear the abnormal information of the current device, and correct the abnormal times to 0.
步骤6,判断davinci是否启动超时,如果是则执行步骤8;否则执行步骤7。Step 6, determine whether davinci has started to time out, if so, go to Step 8; otherwise, go to Step 7.
步骤7,休眠1秒钟,然后执行步骤3。Step 7, sleep for 1 second, then go to step 3.
步骤8,统计当前设备异常次数,保存至flash存储。Step 8, count the abnormal times of the current device and save it to flash storage.
步骤9,重启当前设备。Step 9, restart the current device.
在线设备检测模块202的运行逻辑可以如图4所示。The operation logic of the online
步骤1,读取当前设备异常信息。
步骤2,判断当前设备异常次数是否超过阈值5,如果没有超过阈值则进入步骤3;否则进入步骤5。In step 2, it is judged whether the current equipment abnormality number exceeds the threshold value 5, and if it does not exceed the threshold value, go to step 3; otherwise, go to step 5.
步骤3,当前设备正常启动,如果能够正常启动,则进入步骤4。Step 3, the current device starts normally, if it can start normally, go to step 4.
步骤4,当前设备启动完成后,清空异常信息,并且设置启动完成标志。Step 4: After the startup of the current device is completed, the abnormal information is cleared, and the startup completion flag is set.
步骤5,进入异常启动模式,此时davinci正常启动流程将不被执行。Step 5, enter the abnormal startup mode, at this time, the normal startup process of davinci will not be executed.
步骤6,读取自身加密以及版本信息。Step 6: Read self-encryption and version information.
步骤7,启动SADP搜索线程,搜索网络内其它在线设备,获取到在线设备的型号、序列号、网络、软件程序版本信息。Step 7, start the SADP search thread, search for other online devices in the network, and obtain the model, serial number, network, and software program version information of the online devices.
步骤8,遍历所以在线设备,依次匹配是否存在设备可以进行克隆,如果不存在可克隆设备则进入步骤3;否则进入步骤9。Step 8, traverse all online devices, and sequentially match whether there is a device that can be cloned. If there is no device that can be cloned, go to Step 3; otherwise, go to Step 9.
步骤9,在线设备可克隆性匹配成功,进入在线设备克隆模块。Step 9, the online device cloneability matching is successful, and the online device cloning module is entered.
在线设备克隆模块203的运行逻辑可以如图5所示。The operation logic of the online
步骤1,判断当前设备是否完成过程序克隆,如果完成过则执行步骤2;否则执行步骤5。
步骤2,判断当前设备是否完成过配置文件在线克隆,如果完成过则执行步骤3;否则执行步骤4。Step 2, determine whether the current device has completed the online cloning of the configuration file, if completed, perform step 3; otherwise, perform step 4.
步骤3,当前设备通过在线克隆技术无法修复,记录相关信息后,进入正常启动流程。Step 3: The current device cannot be repaired through the online cloning technology. After recording the relevant information, the normal startup process is entered.
步骤4,将已经备份在设备flash上的被克隆对象的配置文件,导入当前设备并重启设备。Step 4, import the configuration file of the cloned object that has been backed up on the flash of the device into the current device and restart the device.
步骤5,启动当前设备升级线程,准备克隆对端(目标设备)程序。Step 5, start the current device upgrade thread, and prepare to clone the peer (target device) program.
步骤6,通过内部协议,向对端发起克隆请求,首先获取对端配置参数,保存至自身flash。Step 6, initiate a clone request to the opposite end through the internal protocol, first obtain the configuration parameters of the opposite end, and save them to its own flash.
步骤7,通过内部协议,请求对端将程序发送给自身,并且通过升级模块将其升级到自身。Step 7, through the internal protocol, request the peer to send the program to itself, and upgrade it to itself through the upgrade module.
步骤8,重启设备。Step 8, restart the device.
在本申请实施例中,通过设备自身守护进程实时自查设备运行状态,判断设备是否处于异常,并且根据异常做出自我修复动作,将大大提升问题修复效率。通过SADP协议,搜索网络内在线的设备,并且实现网络内设备可克隆性的匹配。通过内部克隆协议,完成在设备的在线克隆,无需技术人员参与,将在一定程度上节约人力物力。In the embodiment of the present application, the device's own daemon process is used to check the running state of the device in real time, to determine whether the device is abnormal, and to perform self-healing actions according to the abnormality, which will greatly improve the problem repair efficiency. Through the SADP protocol, it searches for online devices in the network, and realizes the matching of the cloneability of the devices in the network. Through the internal cloning protocol, the online cloning of the device is completed without the participation of technical personnel, which will save manpower and material resources to a certain extent.
本申请实施例还提供了一种设备修复装置,参见图6,该装置包括:The embodiment of the present application also provides an apparatus for repairing equipment, referring to FIG. 6 , the apparatus includes:
设备修复判断模块601,用于获取当前设备的异常信息,按照上述当前设备的异常信息,判断上述当前设备是否需要进行修复;The device
属性信息获取模块602,用于在上述当前设备需要进行修复时,获取上述当前设备的属性信息,其中,上述当前设备的属性信息包括上述当前设备的软件程序版本信息;The attribute
目标设备确定模块603,用于按照上述当前设备的属性信息,在预设网络中确定上述当前设备对应的目标设备,其中,上述目标设备的软件程序版本信息与上述当前设备的软件程序版本信息相同;The target
软件程序克隆模块604,用于获取上述目标设备的软件程序,按照上述目标设备的软件程序,更新上述当前设备的软件程序。The software
可选的,上述设备修复判断模块601,包括:Optionally, the above-mentioned device
异常信息获取子模块,用于获取当前设备的异常信息;Abnormal information acquisition sub-module, used to acquire abnormal information of the current device;
异常次数判断子模块,用于按照上述当前设备的异常信息,判断上述当前设备的异常次数与预设次数阈值的大小;The abnormal times judgment sub-module is used for judging the abnormal times of the current equipment and the preset times threshold according to the abnormal information of the current equipment;
第一修复判定子模块,用于若上述当前设备的异常次数大于上述次数阈值,判定上述当前设备需要进行修复;A first repair determination sub-module, configured to determine that the current device needs to be repaired if the abnormal times of the current device is greater than the threshold of the number of times;
第二修复判定子模块,用于若上述当前设备的异常次数不大于上述次数阈值,判定上述当前设备不需要进行修复。The second repair determination sub-module is configured to determine that the current device does not need to be repaired if the abnormal frequency of the current device is not greater than the number of times threshold.
可选的,本申请实施的设备修复装置还包括:Optionally, the device repairing device implemented in this application further includes:
第一启动模块,用于在上述当前设备不需要进行修复时,按照上述当前设备的软件程序启动上述当前设备;a first startup module, configured to start the current device according to the software program of the current device when the current device does not need to be repaired;
第一异常信息清除模块,用于在上述当前设备启动成功后,清空上述当前设备的异常信息。The first exception information clearing module is configured to clear the exception information of the current device after the current device is successfully started.
可选的,本申请实施的设备修复装置还包括:Optionally, the device repairing device implemented in this application further includes:
第二启动模块,用于按照更新后的软件程序,启动上述当前设备;The second startup module is used to start the above-mentioned current device according to the updated software program;
第二异常信息清除模块,用于在上述当前设备启动成功后,清空上述当前设备的异常信息。The second exception information clearing module is configured to clear the exception information of the current device after the current device is successfully started.
可选的,本申请实施的设备修复装置还包括:Optionally, the device repairing device implemented in this application further includes:
配置参数判断模块,用于判断上述当前设备的本地存储中是否存在可用的配置参数;a configuration parameter judgment module, used for judging whether there are available configuration parameters in the local storage of the current device;
配置参数克隆模块,用于若上述当前设备的本地存储中不存在可用的配置参数,获取上述目标设备的配置参数,将上述目标设备的配置参数存储在上述当前设备的本地存储中。The configuration parameter cloning module is configured to obtain the configuration parameters of the target device if there is no available configuration parameter in the local storage of the current device, and store the configuration parameters of the target device in the local storage of the current device.
本申请实施例还提供了一种电子设备,参见图7,包括:处理器701、存储器702及通信模块703;An embodiment of the present application further provides an electronic device, see FIG. 7 , including: a
上述存储器702用于存储计算机程序;The above-mentioned
上述通信模块703用于进行网络通信;The above-mentioned
上述处理器701用于在运行上述存储器中存放的计算机程序时,执行如下步骤:The above-mentioned
获取上述电子设备的异常信息,按照上述电子设备的异常信息,判断上述电子设备是否需要进行修复;Obtain the abnormality information of the electronic device, and determine whether the electronic device needs to be repaired according to the abnormality information of the electronic device;
在上述电子设备需要进行修复时,获取上述电子设备的属性信息,其中,上述电子设备的属性信息包括上述电子设备的软件程序版本信息;When the electronic device needs to be repaired, obtain attribute information of the electronic device, wherein the attribute information of the electronic device includes software program version information of the electronic device;
按照上述电子设备的属性信息,在预设网络中确定上述电子设备对应的目标设备,其中,上述目标设备的软件程序版本信息与上述电子设备的软件程序版本信息相同;According to the attribute information of the electronic device, the target device corresponding to the electronic device is determined in the preset network, wherein the software program version information of the target device is the same as the software program version information of the electronic device;
获取上述目标设备的软件程序,按照上述目标设备的软件程序,更新上述电子设备的软件程序。The software program of the target device is obtained, and the software program of the electronic device is updated according to the software program of the target device.
存储器702具体可以为闪存等,异常信息表征电子设备的异常状况,在异常信息表征电子设备无法正常启动时,判定电子设备需要进行修复,否则判定电子设备不需要进行修复。在电子设备需要进行修复时,处理器701获取电子设备的属性信息,按照电子设备的属性信息,在预设网络中确定该电子设备对应的目标设备;处理器701利用通信模块703获取目标设备的软件程序,并按照目标设备的软件程序,更新电子设备存储器702中启动相关的软件程序,例如,利用目标设备的软件程序替换电子设备中启动相关的软件程序。The
可选的,上述处理器701还用于:在上述电子设备不需要进行修复时,按照上述电子设备的软件程序启动上述电子设备;在上述电子设备启动成功后,清空上述电子设备的异常信息。在当前设备不需要进行修复时,按照当前设备的软件程序启动当前设备的监控功能。当前设备启动成功后,清除当前设备的异常信息,从而防止因为设备中存储中异常信息较多,造成设备反复更新软件程序的情况。Optionally, the above-mentioned
在本申请实施例中,在当前设备需要修复时,确定软件程序版本信息与当前设备软件程序版本信息相同的目标设备,从目标设备中获取软件程序以更新当前设备的软件程序,能够实现设备的自动修复,减少人工工作量,提高设备修复效率。In the embodiment of the present application, when the current device needs to be repaired, a target device whose software program version information is the same as the current device software program version information is determined, and the software program is obtained from the target device to update the software program of the current device, which can realize the Automatic repair, reduce manual workload and improve equipment repair efficiency.
可选的,上述获取上述电子设备的异常信息,按照上述电子设备的异常信息,判断上述电子设备是否需要进行修复,包括:Optionally, obtaining the abnormal information of the electronic device above, and determining whether the electronic device needs to be repaired according to the abnormal information of the electronic device, including:
获取上述电子设备的异常信息;按照上述电子设备的异常信息,判断上述电子设备的异常次数与预设次数阈值的大小;若上述电子设备的异常次数大于上述次数阈值,判定上述电子设备需要进行修复;若上述电子设备的异常次数不大于上述次数阈值,判定上述电子设备不需要进行修复。Obtain the abnormality information of the above-mentioned electronic equipment; according to the abnormality information of the above-mentioned electronic equipment, determine the size of the abnormal times of the above-mentioned electronic equipment and the preset times threshold; if the abnormal times of the above-mentioned electronic equipment is greater than the above-mentioned times threshold, determine that the above-mentioned electronic equipment needs to be repaired ; If the abnormal times of the electronic equipment is not greater than the threshold of the times, it is determined that the electronic equipment does not need to be repaired.
在本申请实施例中,若当前设备的异常次数大于与预设次数阈值,说明当前设备异常次数较多,因此需要对当前设备进行修复。In the embodiment of the present application, if the abnormal times of the current equipment is greater than the preset times threshold, it means that the current equipment has many abnormal times, and therefore the current equipment needs to be repaired.
在一种可能的实施方式中,上述异常信息表征上述电子设备启动失败的次数;上述按照上述电子设备的异常信息,判断上述电子设备的异常次数与预设次数阈值的大小,包括:In a possible implementation manner, the above-mentioned abnormal information represents the number of times the electronic device fails to start; the above-mentioned judgment according to the above-mentioned abnormal information of the above-mentioned electronic device, the abnormal frequency of the above-mentioned electronic device and the preset times The size of the threshold value includes:
按照上述电子设备的异常信息,判断上述电子设备启动失败的次数与预设次数阈值的大小,其中,若上述电子设备启动失败的次数大于预设次数阈值,判定上述电子设备的异常次数大于预设次数阈值,若上述电子设备启动失败的次数不大于预设次数阈值,判定上述电子设备的异常次数不大于预设次数阈值。According to the abnormality information of the electronic device, determine the number of failures to start the electronic device and the preset number of thresholds, wherein, if the number of failures to start the electronic device is greater than the preset number of thresholds, it is determined that the number of abnormality of the electronic device is greater than the preset number of times. The number of times threshold, if the number of times the electronic device fails to start is not greater than the preset number of times threshold, it is determined that the number of abnormal times of the electronic device is not greater than the preset number of times threshold.
异常信息也可以为处理器701记录的。可选的,上述处理器701还用于:在上述电子设备启动失败时,记录表征上述电子设备启动失败的异常信息。The exception information can also be recorded by the
在本申请实施例中,判断电子设备启动失败的次数与预设次数阈值的大小,电子设备启动失败的次数直接表征了电子设备无法启动的情况,电子设备无法启动说明电子设备迫切需要进行修复,修复时机针对性更强。In the embodiment of the present application, the number of failures to start the electronic device and the preset number of thresholds are determined. The number of failures to start the electronic device directly represents the failure of the electronic device to start. The failure of the electronic device to start indicates that the electronic device urgently needs to be repaired. The timing of repair is more targeted.
可选的,上述处理器701还用于:按照更新后的软件程序,启动上述电子设备;在上述电子设备启动成功后,清空上述电子设备的异常信息。Optionally, the above-mentioned
当前设备启动成功后,说明当前设备的故障应经修复,清除当前设备的异常信息,从而防止因为设备中存储中异常信息较多,这造成设备反复更新软件程序的情况。After the current device is successfully started, it means that the fault of the current device should be repaired and the abnormal information of the current device is cleared, so as to prevent the device from repeatedly updating the software program due to the excessive abnormal information stored in the device.
可选的,上述处理器701还用于:判断上述存储器702中是否存在可用的配置参数;若上述存储器702中不存在可用的配置参数,获取上述目标设备的配置参数,将上述目标设备的配置参数存储在上述存储器702中。Optionally, the
判断电子设备的存储器702中是否存储有可用的配置参数。例如,在电子设备的Flash存储中存在配置参数时,则判定存在可用的配置参数;在电子设备的Flash存储中不存在配置参数时,则判定不存在可用的配置参数。It is determined whether there are available configuration parameters stored in the
在一种可能的实施方式中,上述判断上述存储器702中是否存在可用的配置参数包括:In a possible implementation manner, the above-mentioned judging whether there are available configuration parameters in the above-mentioned
在上述存储器702中获取配置文件,并读取上述配置文件中的配置参数,其中,上述配置参数包括多个配置项;Acquire a configuration file in the above-mentioned
检测上述配置参数的各配置项是否均完整,若存在的不完整的配置项,判断上述配置参数不可用;Check whether each configuration item of the above configuration parameter is complete, if there is an incomplete configuration item, judge that the above configuration parameter is unavailable;
若上述配置参数的各配置项均完整,分别判断各上述配置项的数值是否在相应的预设取值范围内,若各上述配置项的数值均在相应的预设取值范围内,判定上述配置参数可用,否则判定上述配置参数不可用。If all the configuration items of the above configuration parameters are complete, it is judged whether the value of each of the above configuration items is within the corresponding preset value range. The configuration parameters are available, otherwise it is determined that the above configuration parameters are unavailable.
不同的配置项对应的预设取值范围可能相同也可能不同。例如,在电子设备为智能相机时,可以设定智能算法的检测区域,对应的配置项可以为检测区域的起点坐标,检测区域的长及检测区域的高。检测区域的起点坐标要求为智能相机画面范围内的坐标,同时检测区域的长及高的设定要求不同超出智能相机画面范围。The preset value ranges corresponding to different configuration items may be the same or different. For example, when the electronic device is a smart camera, the detection area of the intelligent algorithm can be set, and the corresponding configuration items can be the coordinates of the starting point of the detection area, the length of the detection area, and the height of the detection area. The coordinates of the starting point of the detection area are required to be within the screen range of the smart camera, and the setting requirements for the length and height of the detection area are different beyond the screen range of the smart camera.
可选的,上述处理器701还用于:按照上述目标设备的配置参数,配置上述电子设备。在电子设备启动后,处理器701按照配置参数对电子设备进行配置,以完成电子设备的正常运行。Optionally, the
可选的,本申请实施例的电子设备还包通信总线,其中,处理器701,通信模块703及存储器702通过通信总线完成相互间的通信。Optionally, the electronic device in this embodiment of the present application further includes a communication bus, wherein the
具体的,本申请实施例的电子设备可以为视频监控设备,例如IP摄像机等。或者还可以为服务器,该服务器连接视频监控设备。Specifically, the electronic device in this embodiment of the present application may be a video surveillance device, such as an IP camera. Or it can also be a server, and the server is connected to a video surveillance device.
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral ComponentInterconnect,PCI)总线或扩展工业标准结构(Extended Industry StandardArchitecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the above electronic device and other devices.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; may also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
本申请实施还提供一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时执行如下步骤:The implementation of the present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program executes the following steps when executed by a processor:
获取当前设备的异常信息,按照当前设备的异常信息,判断当前设备是否需要进行修复;Obtain the abnormal information of the current device, and judge whether the current device needs to be repaired according to the abnormal information of the current device;
在当前设备需要进行修复时,获取当前设备的属性信息,其中,当前设备的属性信息包括当前设备的软件程序版本信息;When the current device needs to be repaired, obtain attribute information of the current device, wherein the attribute information of the current device includes software program version information of the current device;
按照当前设备的属性信息,在预设网络中确定当前设备对应的目标设备,其中,目标设备的软件程序版本信息与当前设备的软件程序版本信息相同;According to the attribute information of the current device, the target device corresponding to the current device is determined in the preset network, wherein the software program version information of the target device is the same as the software program version information of the current device;
获取目标设备的软件程序,按照目标设备的软件程序,更新当前设备的软件程序。Obtain the software program of the target device, and update the software program of the current device according to the software program of the target device.
可选的,计算机程序被处理器执行时还能够实现上述任一设备修复方法。Optionally, when the computer program is executed by the processor, any of the foregoing device repairing methods can also be implemented.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本说明书中的各个实施例均采用相关的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a related manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application are included in the protection scope of this application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910295950.4A CN111813427B (en) | 2019-04-12 | 2019-04-12 | Equipment repairing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910295950.4A CN111813427B (en) | 2019-04-12 | 2019-04-12 | Equipment repairing method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111813427A true CN111813427A (en) | 2020-10-23 |
| CN111813427B CN111813427B (en) | 2024-08-02 |
Family
ID=72844003
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910295950.4A Active CN111813427B (en) | 2019-04-12 | 2019-04-12 | Equipment repairing method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111813427B (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112637682A (en) * | 2020-12-16 | 2021-04-09 | 深圳Tcl新技术有限公司 | Abnormal offline diagnosis method, device, equipment and computer readable storage medium |
| CN114661501A (en) * | 2020-12-23 | 2022-06-24 | 华为技术有限公司 | Method and device for repairing abnormal starting-up |
| CN115686905A (en) * | 2022-10-28 | 2023-02-03 | 超聚变数字技术有限公司 | A method, device, and computing device for recovering SPD information in an internal memory |
| CN116257379A (en) * | 2023-02-14 | 2023-06-13 | 青岛海信传媒网络技术有限公司 | Self-healing method, self-healing device, electronic device and medium |
Citations (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060146817A1 (en) * | 2005-01-04 | 2006-07-06 | Lim Hyun-Keun | File update system and boot management system of mobile communication terminal, method of updating file in mobile communication terminal, and method of booting mobile communication terminal |
| CN1859162A (en) * | 2005-06-15 | 2006-11-08 | 华为技术有限公司 | Realizing method and system for automatic restoring equipment fault |
| US20080104442A1 (en) * | 2005-06-15 | 2008-05-01 | Huawei Technologies Co., Ltd. | Method, device and system for automatic device failure recovery |
| CN101221508A (en) * | 2008-01-31 | 2008-07-16 | 杭州华三通信技术有限公司 | Method and device for starting equipment |
| WO2009109145A1 (en) * | 2008-03-07 | 2009-09-11 | 华为技术有限公司 | A method for improving the reliability of communication devices and an apparatus thereof |
| WO2010081323A1 (en) * | 2009-01-19 | 2010-07-22 | 中兴通讯股份有限公司 | Method for realizing single board application version and system thereof |
| CN103838590A (en) * | 2012-11-20 | 2014-06-04 | 联想(北京)有限公司 | Software version upgrading method and electronic device |
| CN104077247A (en) * | 2013-03-26 | 2014-10-01 | 三星电子株式会社 | Method and electronic device for identifying accessory |
| US20150205979A1 (en) * | 2012-06-19 | 2015-07-23 | Beijing Qihoo Technology Company Limited | Method and system for repairing file at user terminal |
| WO2016190377A1 (en) * | 2015-05-26 | 2016-12-01 | 京セラ株式会社 | Software update device, software update system, and software update method |
| CN106462424A (en) * | 2015-03-24 | 2017-02-22 | 华为技术有限公司 | Method for updating terminal system, terminal and system |
| CN106506230A (en) * | 2016-11-30 | 2017-03-15 | 中国电信股份有限公司常州分公司 | Method and system based on wireless network remote maintenance field apparatus |
| CN107092469A (en) * | 2016-02-17 | 2017-08-25 | 杭州海康威视数字技术股份有限公司 | A kind of method for upgrading software, apparatus and system |
| US20180074929A1 (en) * | 2016-09-13 | 2018-03-15 | Kabushiki Kaisha Toshiba | Network monitoring device, network system, and computer program product |
| CN107894949A (en) * | 2017-10-11 | 2018-04-10 | 五八有限公司 | The method, apparatus and equipment of abnormality processing |
| CN107957928A (en) * | 2017-11-16 | 2018-04-24 | 南京轩世琪源软件科技有限公司 | A kind of software synchronization operation detection and analysis and troubleshooting methodology |
| CN108365982A (en) * | 2018-02-06 | 2018-08-03 | 北京小米移动软件有限公司 | Unit exception adjustment method, device, equipment and storage medium |
| CN109254864A (en) * | 2018-09-11 | 2019-01-22 | 北京奇艺世纪科技有限公司 | A kind of application failure restorative procedure, device and electronic equipment |
| CN109324918A (en) * | 2018-09-13 | 2019-02-12 | 广东小天才科技有限公司 | Application program exception handling method and device, terminal and storage medium |
| CN109542724A (en) * | 2018-11-14 | 2019-03-29 | 北京达佳互联信息技术有限公司 | Application exception processing method, device, electronic equipment and storage medium |
-
2019
- 2019-04-12 CN CN201910295950.4A patent/CN111813427B/en active Active
Patent Citations (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060146817A1 (en) * | 2005-01-04 | 2006-07-06 | Lim Hyun-Keun | File update system and boot management system of mobile communication terminal, method of updating file in mobile communication terminal, and method of booting mobile communication terminal |
| CN1859162A (en) * | 2005-06-15 | 2006-11-08 | 华为技术有限公司 | Realizing method and system for automatic restoring equipment fault |
| US20080104442A1 (en) * | 2005-06-15 | 2008-05-01 | Huawei Technologies Co., Ltd. | Method, device and system for automatic device failure recovery |
| CN101221508A (en) * | 2008-01-31 | 2008-07-16 | 杭州华三通信技术有限公司 | Method and device for starting equipment |
| WO2009109145A1 (en) * | 2008-03-07 | 2009-09-11 | 华为技术有限公司 | A method for improving the reliability of communication devices and an apparatus thereof |
| WO2010081323A1 (en) * | 2009-01-19 | 2010-07-22 | 中兴通讯股份有限公司 | Method for realizing single board application version and system thereof |
| US20150205979A1 (en) * | 2012-06-19 | 2015-07-23 | Beijing Qihoo Technology Company Limited | Method and system for repairing file at user terminal |
| CN103838590A (en) * | 2012-11-20 | 2014-06-04 | 联想(北京)有限公司 | Software version upgrading method and electronic device |
| CN104077247A (en) * | 2013-03-26 | 2014-10-01 | 三星电子株式会社 | Method and electronic device for identifying accessory |
| CN106462424A (en) * | 2015-03-24 | 2017-02-22 | 华为技术有限公司 | Method for updating terminal system, terminal and system |
| WO2016190377A1 (en) * | 2015-05-26 | 2016-12-01 | 京セラ株式会社 | Software update device, software update system, and software update method |
| CN107092469A (en) * | 2016-02-17 | 2017-08-25 | 杭州海康威视数字技术股份有限公司 | A kind of method for upgrading software, apparatus and system |
| US20180074929A1 (en) * | 2016-09-13 | 2018-03-15 | Kabushiki Kaisha Toshiba | Network monitoring device, network system, and computer program product |
| CN106506230A (en) * | 2016-11-30 | 2017-03-15 | 中国电信股份有限公司常州分公司 | Method and system based on wireless network remote maintenance field apparatus |
| CN107894949A (en) * | 2017-10-11 | 2018-04-10 | 五八有限公司 | The method, apparatus and equipment of abnormality processing |
| CN107957928A (en) * | 2017-11-16 | 2018-04-24 | 南京轩世琪源软件科技有限公司 | A kind of software synchronization operation detection and analysis and troubleshooting methodology |
| CN108365982A (en) * | 2018-02-06 | 2018-08-03 | 北京小米移动软件有限公司 | Unit exception adjustment method, device, equipment and storage medium |
| CN109254864A (en) * | 2018-09-11 | 2019-01-22 | 北京奇艺世纪科技有限公司 | A kind of application failure restorative procedure, device and electronic equipment |
| CN109324918A (en) * | 2018-09-13 | 2019-02-12 | 广东小天才科技有限公司 | Application program exception handling method and device, terminal and storage medium |
| CN109542724A (en) * | 2018-11-14 | 2019-03-29 | 北京达佳互联信息技术有限公司 | Application exception processing method, device, electronic equipment and storage medium |
Non-Patent Citations (1)
| Title |
|---|
| 贺向阳: "计算机软件安全漏洞检测技术应用研究", 《无线互联科技》 * |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112637682A (en) * | 2020-12-16 | 2021-04-09 | 深圳Tcl新技术有限公司 | Abnormal offline diagnosis method, device, equipment and computer readable storage medium |
| CN114661501A (en) * | 2020-12-23 | 2022-06-24 | 华为技术有限公司 | Method and device for repairing abnormal starting-up |
| WO2022135215A1 (en) * | 2020-12-23 | 2022-06-30 | 华为技术有限公司 | Method and apparatus for repairing abnormal power-on |
| CN115686905A (en) * | 2022-10-28 | 2023-02-03 | 超聚变数字技术有限公司 | A method, device, and computing device for recovering SPD information in an internal memory |
| CN116257379A (en) * | 2023-02-14 | 2023-06-13 | 青岛海信传媒网络技术有限公司 | Self-healing method, self-healing device, electronic device and medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111813427B (en) | 2024-08-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111813427A (en) | Device repair method, device, electronic device and storage medium | |
| CN114528350B (en) | Cluster split-brain processing methods, devices, equipment and readable storage media | |
| CN110704166A (en) | Service running method, device and server | |
| CN105589712B (en) | BMC module update method and device | |
| CN113645085B (en) | Method and device for detecting abnormality of intelligent network card, electronic equipment and storage medium | |
| CN111078471B (en) | System fault recovery method and device for display device and computer storage medium | |
| CN109144789B (en) | A method, device and system for restarting OSD | |
| CN108875837A (en) | Device and method for test target identification equipment | |
| WO2021208564A1 (en) | Device failure repair method and apparatus, electronic device, and storage medium | |
| WO2018006702A1 (en) | Abnormality processing method, apparatus and system in automation test | |
| TWI668567B (en) | Server and method for restoring a baseboard management controller automatically | |
| CN111767173A (en) | Network equipment data processing method, device, computer equipment and storage medium | |
| CN111800304A (en) | Process running monitoring method, storage medium and virtual device | |
| CN119883773B (en) | A BIOS operation and maintenance method, system and storage medium | |
| CN114884840A (en) | Application health state checking method and electronic equipment | |
| CN110362435A (en) | PCIE fault location method, device, device and medium for Purley platform server | |
| CN113504932A (en) | Firmware data updating method and device | |
| CN104268805A (en) | Line management method and system | |
| CN109960638A (en) | BMC startup reason recording method, system, device and readable storage medium | |
| CN109558209B (en) | A monitoring method for virtual machines | |
| KR20210113595A (en) | Anomaly handling method, terminal device and storage medium | |
| WO2016078224A1 (en) | Information processing method and apparatus, and computer storage medium | |
| CN113778763B (en) | Intelligent switching method and system for three-way interface service faults | |
| CN111382016A (en) | Method and device for connecting test terminal and computer | |
| CN110442467B (en) | A data sharing method, terminal, and computer-readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |