CN118426794A - Acceleration card upgrading method, device and system, electronic equipment and storage medium - Google Patents

Acceleration card upgrading method, device and system, electronic equipment and storage medium Download PDF

Info

Publication number
CN118426794A
CN118426794A CN202310120319.7A CN202310120319A CN118426794A CN 118426794 A CN118426794 A CN 118426794A CN 202310120319 A CN202310120319 A CN 202310120319A CN 118426794 A CN118426794 A CN 118426794A
Authority
CN
China
Prior art keywords
upgrade
version image
normal
image
accelerator card
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.)
Pending
Application number
CN202310120319.7A
Other languages
Chinese (zh)
Inventor
王聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN202310120319.7A priority Critical patent/CN118426794A/en
Publication of CN118426794A publication Critical patent/CN118426794A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions
    • G06F9/44542Retargetable

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an accelerating card upgrading method, wherein an accelerating card comprises a normal version image and a recovered version image, the normal version image and the recovered version image are isolated from each other, and the recovered version image comprises a firmware partition for providing re-upgrading capability; acquiring an upgrade state of a normal version image, wherein the upgrade state comprises upgrade failure or upgrade success; if the upgrade status is upgrade failure, the method enters a recovered version image and carries out next online automatic upgrade through the firmware partition. By setting the normal version image and the recovery version image which are isolated from each other in the accelerator card, the operation of the accelerator card can be supported by the recovery version image when the normal version image fails to upgrade, and the accelerator card entering the recovery version image can be automatically upgraded again on line due to the firmware partition providing the re-upgrading capability in the recovery version image, so that the accelerator card can be maintained without manual factory return, and the maintenance cost of the accelerator card is reduced.

Description

加速卡升级方法、装置、系统、电子设备及存储介质Accelerator card upgrade method, device, system, electronic device and storage medium

技术领域Technical Field

本发明涉及加速卡升级技术领域,具体涉及一种加速卡升级方法、装置、系统、电子设备及存储介质。The present invention relates to the technical field of accelerator card upgrade, and in particular to an accelerator card upgrade method, device, system, electronic equipment and storage medium.

背景技术Background technique

AI智能加速卡的系统升级方案一般通过recovery(数据恢复)模式来进行OTA在线自动升级。recovery模式提供了一个最小系统(recovery系统)来防止正常系统升级后无法启动的情况,使得正常系统升级后无法启动时,进入最小系统进行启动运行,但该最小系统不具备再次自动升级的能力,只能通过人工返厂进行维修,增加了智能加速卡的维护成本。因此,现有的系统升级模式中,在智能加速卡升级失败后,存在无法对智能加速卡再进行自动升级的问题。The system upgrade solution for AI smart acceleration cards generally uses the recovery (data recovery) mode to perform OTA online automatic upgrades. The recovery mode provides a minimum system (recovery system) to prevent the normal system from failing to start after the upgrade. When the normal system fails to start after the upgrade, the minimum system is entered for startup and operation. However, the minimum system does not have the ability to automatically upgrade again and can only be manually returned to the factory for repair, which increases the maintenance cost of the smart acceleration card. Therefore, in the existing system upgrade mode, after the smart acceleration card upgrade fails, there is a problem that the smart acceleration card cannot be automatically upgraded again.

发明内容Summary of the invention

本发明实施例提供一种视频处理方法,旨在解决现有的系统升级模式中,在智能加速卡升级失败后,存在无法对智能加速卡再进行自动升级的问题。通过在加速卡中设置相互隔离的正常版本镜像以及恢复版本镜像,可以在正常版本镜像升级失败时,通过恢复版本镜像来支撑加速卡的运行,由于恢复版本镜像中设置有提供再升级能力的固件分区,使得进入恢复版本镜像的加速卡可以再次进行在线自动升级,可以不需要通过人工返厂进行维修,降低了加速卡的维护成本。The embodiment of the present invention provides a video processing method, which aims to solve the problem that in the existing system upgrade mode, after the smart acceleration card fails to be upgraded, the smart acceleration card cannot be automatically upgraded again. By setting a normal version image and a recovery version image that are isolated from each other in the acceleration card, the operation of the acceleration card can be supported by the recovery version image when the normal version image fails to be upgraded. Since the recovery version image is provided with a firmware partition that provides re-upgrade capability, the acceleration card that enters the recovery version image can be automatically upgraded online again, and there is no need to return the card to the factory for repair manually, thereby reducing the maintenance cost of the acceleration card.

第一方面,本发明的主要目的是提供一种加速卡升级方法,所述加速卡包括正常版本镜像以及恢复版本镜像,所述正常版本镜像与所述恢复版本镜像相互隔离,所述恢复版本镜像包括提供再升级能力的固件分区,所述方法包括:In a first aspect, the main purpose of the present invention is to provide an accelerator card upgrade method, wherein the accelerator card includes a normal version image and a recovery version image, the normal version image and the recovery version image are isolated from each other, and the recovery version image includes a firmware partition that provides re-upgrade capability, and the method includes:

获取正常版本镜像的升级状态,所述升级状态包括升级失败或升级成功;Obtaining the upgrade status of the normal version image, wherein the upgrade status includes upgrade failure or upgrade success;

若升级状态为升级失败,则进入恢复版本镜像并通过所述固件分区进行下一次在线自动升级。If the upgrade status is upgrade failure, enter the recovery version image and perform the next online automatic upgrade through the firmware partition.

可选的,在所述获取对于正常版本镜像进行在线自动升级的升级状态之前,所述方法还包括:Optionally, before obtaining the upgrade status of online automatic upgrade of the normal version image, the method further includes:

接收主端下发的正常版本升级包;Receive the normal version upgrade package sent by the master end;

通过所述正常版本升级包对所述正常版本镜像进行在线自动升级。The normal version image is automatically upgraded online through the normal version upgrade package.

可选的,在所述正常版本镜像升级之前或所述正常版本镜像升级成功之后,所述方法还包括:Optionally, before the normal version image is upgraded or after the normal version image is successfully upgraded, the method further includes:

运行所述正常版本镜像或升级成功后的所述正常版本镜像,对所述恢复版本镜像进行升级。Run the normal version image or the normal version image after successful upgrade, and upgrade the recovery version image.

可选的,所述获取正常版本镜像的升级状态,包括:Optionally, obtaining the upgrade status of the normal version image includes:

通过程序状态机获取升级后的所述正常版本镜像的启动状态;Obtaining the startup status of the upgraded normal version image through the program state machine;

根据所述启动状态,确定所述正常版本镜像的升级状态。According to the startup status, the upgrade status of the normal version image is determined.

可选的,所述根据所述启动状态,确定所述正常版本镜像的升级状态,包括:Optionally, determining the upgrade status of the normal version image according to the startup status includes:

当升级后的所述正常版本镜像为正常启动时,若正常启动失败次数大于预设值时,则确定所述正常版本镜像的升级状态为升级失败;When the normal version image after the upgrade is started normally, if the number of normal startup failures is greater than a preset value, determining that the upgrade status of the normal version image is upgrade failure;

当升级后的所述正常版本镜像为升级启动时,若不是升级后第一次启动,则确定所述正常版本镜像的升级状态为升级失败。When the normal version image after the upgrade is started for the upgrade, if it is not the first startup after the upgrade, it is determined that the upgrade status of the normal version image is upgrade failure.

可选的,所述主端与所述加速卡之间的通信链路包括第一通信链路以及第二通信链路,所述第一通信链路与所述第二通信链路包括不同的通信主体,在所述通过恢复版本镜像进行下一次在线自动升级之前,所述方法还包括:Optionally, the communication link between the master end and the acceleration card includes a first communication link and a second communication link, the first communication link and the second communication link include different communication subjects, and before performing the next online automatic upgrade by restoring the version image, the method further includes:

若所述第一通信链路正常,则通过所述第一通信链路控制所述加速卡进入所述恢复版本镜像;If the first communication link is normal, controlling the acceleration card to enter the recovery version image through the first communication link;

若所述第一通信链路异常,则通过所述第二通信链路控制所述加速卡进入所述恢复版本镜像。If the first communication link is abnormal, the acceleration card is controlled to enter the recovery version image through the second communication link.

第二方面,本发明实施例提供了一种加速卡升级装置,所述加速卡包括正常版本镜像以及恢复版本镜像,所述正常版本镜像与所述恢复版本镜像相互隔离,所述恢复版本镜像包括提供再升级能力的固件分区,加速卡升级装置包括:In a second aspect, an embodiment of the present invention provides an accelerator card upgrade device, wherein the accelerator card includes a normal version image and a recovery version image, the normal version image and the recovery version image are isolated from each other, and the recovery version image includes a firmware partition that provides a re-upgrade capability, and the accelerator card upgrade device includes:

获取模块,用于获取正常版本镜像的升级状态,所述升级状态包括升级失败或升级成功;An acquisition module, used to acquire the upgrade status of the normal version image, wherein the upgrade status includes upgrade failure or upgrade success;

第一升级模块,用于若升级状态为升级失败,则进入恢复版本镜像并通过所述固件分区进行下一次在线自动升级。The first upgrade module is used to enter the recovery version image and perform the next online automatic upgrade through the firmware partition if the upgrade status is upgrade failure.

第三方面,所述系统包括:加速卡以及主端,所述加速卡包括加速卡升级装置、正常版本镜像以及恢复版本镜像,所述加速卡升级装置用于执行本发明实施例中任意所述的加速卡升级方法。In a third aspect, the system includes: an acceleration card and a host end, the acceleration card includes an acceleration card upgrade device, a normal version image and a recovery version image, and the acceleration card upgrade device is used to execute any acceleration card upgrade method described in the embodiments of the present invention.

第四方面,本发明实施例提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述的加速卡升级方法的步骤。In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the acceleration card upgrade method as described above when executing the computer program.

第五方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述的加速卡升级方法的步骤。In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the acceleration card upgrade method as described above are implemented.

本发明实施例中,加速卡包括正常版本镜像以及恢复版本镜像,正常版本镜像与恢复版本镜像相互隔离,恢复版本镜像包括提供再升级能力的固件分区;获取正常版本镜像的升级状态,所述升级状态包括升级失败或升级成功;若升级状态为升级失败,则进入恢复版本镜像并通过所述固件分区进行下一次在线自动升级。通过在加速卡中设置相互隔离的正常版本镜像以及恢复版本镜像,可以在正常版本镜像升级失败时,通过恢复版本镜像来支撑加速卡的运行,由于恢复版本镜像中设置有提供再升级能力的固件分区,使得进入恢复版本镜像的加速卡可以再次进行在线自动升级,可以不需要通过人工返厂进行维修,降低了加速卡的维护成本。In an embodiment of the present invention, the accelerator card includes a normal version image and a recovery version image, the normal version image and the recovery version image are isolated from each other, and the recovery version image includes a firmware partition that provides re-upgrade capability; the upgrade status of the normal version image is obtained, and the upgrade status includes upgrade failure or upgrade success; if the upgrade status is upgrade failure, the recovery version image is entered and the next online automatic upgrade is performed through the firmware partition. By setting the normal version image and the recovery version image that are isolated from each other in the accelerator card, the operation of the accelerator card can be supported by the recovery version image when the normal version image fails to be upgraded. Since the recovery version image is provided with a firmware partition that provides re-upgrade capability, the accelerator card that enters the recovery version image can be automatically upgraded online again, and does not need to be manually returned to the factory for repair, thereby reducing the maintenance cost of the accelerator card.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

图1是本发明实施例提供的一种加速卡升级系统的架构图;FIG1 is an architecture diagram of an accelerator card upgrade system provided by an embodiment of the present invention;

图2是本发明实施例提供的一种加速卡升级方法的流程图;FIG2 is a flow chart of an accelerator card upgrade method provided by an embodiment of the present invention;

图3是本发明实施例提供的一种加速卡升级装置的结构示意图;FIG3 is a schematic diagram of the structure of an accelerator card upgrade device provided by an embodiment of the present invention;

图4是本发明实施例提供的一种电子设备的结构示意图。FIG. 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

请参见图1,图1是本发明实施例提供的一种加速卡升级系统的架构图,如图1所示,该加速卡升级系统包括:加速卡以及主端,加速卡与主端之间为通信连接,加速卡包括加速卡升级装置、正常版本镜像以及恢复版本镜像。Please refer to Figure 1, which is an architecture diagram of an acceleration card upgrade system provided by an embodiment of the present invention. As shown in Figure 1, the acceleration card upgrade system includes: an acceleration card and a host end, the acceleration card and the host end are communicated with each other, and the acceleration card includes an acceleration card upgrade device, a normal version image, and a recovery version image.

上述主端(host端)可以是服务器,也可以是加速卡所连接的主机,上述主端可以通过封装好的接口组件向加速卡下发升级操作,通过通信库插件提供的通信接口与加速卡进行消息传输和文件传输。上述接口组件可以是DCMI(设备控制管理接口)接口组件。The host end can be a server or a host connected to the accelerator card. The host end can send upgrade operations to the accelerator card through a packaged interface component, and perform message transmission and file transmission with the accelerator card through the communication interface provided by the communication library plug-in. The interface component can be a DCMI (Device Control Management Interface) interface component.

上述加速卡可以是AI智能加速卡或AI芯片,上述加速卡主要用于视觉处理的加速运算,上述加速卡可以通过加速卡升级装置调用本地升级库来进行升级和log日志管理。The above-mentioned acceleration card can be an AI smart acceleration card or an AI chip. The above-mentioned acceleration card is mainly used for accelerated computing of visual processing. The above-mentioned acceleration card can call the local upgrade library through the acceleration card upgrade device to perform upgrades and log management.

进一步的,上述加速卡可以是pcie加速卡,上述主端可以是pcie主机,pcie加速卡与pcie主机可以通过pcie高速外设总线进行通信连接。在一种可能的实施例中,上述pcie加速卡中处理器还包括一个用于通信的核心,pcie主机还包括一个微控制器,上述用于通信的核心与微控制器可以通过总线进行通信连接,具体可以通过Smbus总线将用于通信的核心与微控制器进行通信连接。Furthermore, the acceleration card may be a pcie acceleration card, the host may be a pcie host, and the pcie acceleration card and the pcie host may be communicatively connected via a pcie high-speed peripheral bus. In a possible embodiment, the processor in the pcie acceleration card further includes a core for communication, the pcie host further includes a microcontroller, and the core for communication and the microcontroller may be communicatively connected via a bus, specifically, the core for communication and the microcontroller may be communicatively connected via a Smbus bus.

上述镜像为系统镜像,用于为加速卡提供系统支持;上述正常版本镜像可以理解为常用的版本镜像或默认的版本镜像,上述正常版本镜像对应于加速卡的常用系统;上述恢复版本镜像可以理解为不常用的版本镜像或备用的版本镜像,上述恢复版本镜像在加速卡的系统启动失败或系统升级失败时用于替换正常版本镜像来为加速卡提供备用系统支持。恢复版本镜像为精简过的版本镜像,从而占用加速卡中较小的存储空间。The above image is a system image, which is used to provide system support for the accelerator card; the above normal version image can be understood as a commonly used version image or a default version image, which corresponds to the commonly used system of the accelerator card; the above recovery version image can be understood as an uncommon version image or a spare version image, which is used to replace the normal version image to provide spare system support for the accelerator card when the system startup or system upgrade of the accelerator card fails. The recovery version image is a streamlined version image, which occupies a smaller storage space in the accelerator card.

主端上发布有正常版本镜像升级包和恢复版本镜像升级包,当加速卡需要进行升级时,向主端发送版本镜像升级请求,主端通过封装好的接口组件向加速卡下发升级操作,通过通信库插件提供的通信接口向加速卡下发版本镜像升级包。The master end publishes normal version image upgrade packages and recovery version image upgrade packages. When the accelerator card needs to be upgraded, it sends a version image upgrade request to the master end. The master end sends the upgrade operation to the accelerator card through the encapsulated interface component and sends the version image upgrade package to the accelerator card through the communication interface provided by the communication library plug-in.

在对正常版本镜像进行OTA(空中下载技术)在线自动升级时,加速卡升级分为两个阶段,第一阶段主要做升级相关的准备,第一阶段处于正常版本镜像运行下,即第一阶段是在正常版本系统运行下进行的。加速卡接收到主端的正常版本镜像升级包,对升级包进行检查、校验工作等,在准备完成后,通知主端,主端通过封装好的接口组件下发复位操作到加速卡,通过复位操作使得加速卡进入recovery模式。第二阶段则在recovery模式下对正常版本镜像进行升级,第二阶段处于恢复版本镜像运行下,将升级包刷写到加速卡的存储里,完成对正常版本镜像的升级,然后通知主端,主端再次通过封装好的接口组件下发复位操作到加速卡,通过复位操作使得加速卡启动正常版本镜像,进入到升级后的正常版本系统。When the normal version image is automatically upgraded online using OTA (Over the Air Technology), the accelerator card upgrade is divided into two stages. The first stage is mainly to prepare for the upgrade. The first stage is under the operation of the normal version image, that is, the first stage is carried out under the operation of the normal version system. The accelerator card receives the normal version image upgrade package from the master end, checks and verifies the upgrade package, and after the preparation is completed, notifies the master end, which sends a reset operation to the accelerator card through the packaged interface component, and the accelerator card enters the recovery mode through the reset operation. The second stage is to upgrade the normal version image in the recovery mode. The second stage is under the operation of the recovery version image, and the upgrade package is written to the storage of the accelerator card to complete the upgrade of the normal version image, and then notifies the master end. The master end sends a reset operation to the accelerator card again through the packaged interface component, and the accelerator card starts the normal version image through the reset operation and enters the upgraded normal version system.

在正常版本系统正常运行的情况下,若主端发布有恢复版本镜像升级包,可以通知加速卡,加速卡向主端发送恢复版本镜像升级请求,主端通过通信库插件提供的通信接口向加速卡下发恢复版本镜像升级包,将恢复版本镜像刷写到加速卡的存储里,完成对恢复版本镜像的升级,然后通知主端。When the normal version system is running normally, if the master end releases a recovery version image upgrade package, it can notify the accelerator card, and the accelerator card sends a recovery version image upgrade request to the master end. The master end sends the recovery version image upgrade package to the accelerator card through the communication interface provided by the communication library plug-in, and writes the recovery version image to the storage of the accelerator card to complete the upgrade of the recovery version image, and then notifies the master end.

在正常版本系统升级完成后,可以检测正常版本镜像的升级状态,若升级状态为升级成功,则向主端发送升级成功的结果,若升级状态为升级失败,则向主端发送升级失败的结果,主端通过封装好的接口组件下发复位操作到加速卡,通过复位操作使得加速卡进入recovery模式,此时recovery模式会启用恢复版本镜像中的固件分区,通过恢复版本镜像中的固件分区进行下一次的在线自动升级。After the normal version system upgrade is completed, the upgrade status of the normal version image can be detected. If the upgrade status is successful, the result of the successful upgrade is sent to the master end. If the upgrade status is failed, the result of the failed upgrade is sent to the master end. The master end sends a reset operation to the accelerator card through the packaged interface component. The reset operation makes the accelerator card enter the recovery mode. At this time, the recovery mode will enable the firmware partition in the recovery version image, and the next online automatic upgrade will be performed through the firmware partition in the recovery version image.

上述固件分区可以是upgrade_firmware固件分区,upgrade_firmware固件分区可以用于提供继续进行版本镜像升级的功能,使得恢复版本下还可以通过upgrade_firmware固件分区继续进行版本镜像的在线自动升级。The firmware partition may be an upgrade_firmware partition, which may be used to provide a function of continuing to upgrade the version image, so that the online automatic upgrade of the version image may be continued through the upgrade_firmware partition in the recovery version.

具体来说,在recovery模式的升级基础上,新增一个upgrade_firmware固件分区用来提供在recovery模式下继续OTA升级的功能。当正常升级进入recovery模式时,不会触发恢复版本镜像中的upgrade_firmware固件,只有当OTA升级失败,加速卡进入到recovery模式时,才会触发恢复版本镜像中的upgrade_firmware固件,从而保证可以进行下一次的OTA升级。Specifically, based on the upgrade in recovery mode, a new upgrade_firmware partition is added to provide the function of continuing OTA upgrade in recovery mode. When the normal upgrade enters recovery mode, the upgrade_firmware firmware in the recovery version image will not be triggered. Only when the OTA upgrade fails and the accelerator card enters recovery mode, the upgrade_firmware firmware in the recovery version image will be triggered, thus ensuring that the next OTA upgrade can be performed.

请参见图2,图2是本发明实施例提供的一种加速卡升级方法的流程图,如图2所示,该加速卡升级方法应用于加速卡,具体应用于加速卡中的加速卡升级装置,加速卡包括正常版本镜像以及恢复版本镜像,正常版本镜像与恢复版本镜像相互隔离,恢复版本镜像包括提供再升级能力的固件分区,加速卡升级方法具体包括以下步骤:Please refer to FIG. 2, which is a flow chart of an accelerator card upgrade method provided by an embodiment of the present invention. As shown in FIG. 2, the accelerator card upgrade method is applied to the accelerator card, and is specifically applied to an accelerator card upgrade device in the accelerator card. The accelerator card includes a normal version image and a recovery version image. The normal version image and the recovery version image are isolated from each other. The recovery version image includes a firmware partition that provides re-upgrade capability. The accelerator card upgrade method specifically includes the following steps:

101、获取正常版本镜像的升级状态。101. Get the upgrade status of the normal version image.

在本发明实施例中,上述镜像为系统镜像,用于为加速卡提供系统支持;上述正常版本镜像可以理解为常用的版本镜像或默认的版本镜像,上述正常版本镜像对应于加速卡的常用系统,一个版本镜像对应一个版本系统。一般来说,对于系统进行版本升级指的是对正常版本镜像进行升级,升级方式可以是OTA在线自动升级。In the embodiment of the present invention, the above image is a system image, which is used to provide system support for the accelerator card; the above normal version image can be understood as a commonly used version image or a default version image, and the above normal version image corresponds to a commonly used system of the accelerator card, and one version image corresponds to one version system. Generally speaking, upgrading the system version refers to upgrading the normal version image, and the upgrade method can be OTA online automatic upgrade.

升级状态包括升级失败或升级成功,在对正常版本镜像进行升级后,可以通过正常版本镜像的启动来确定正常版本镜像的升级状态,一般来说,启动失败则可以表示升级失败,启动成功则可以表示升级成功。正常版本镜像启动成功后则可以进入到对应的正常版本系统,从而提供对应的系统支持,正常版本镜像启动失败后,则进入不了正常版本系统,无法提供对应的系统支持。或者可以通过状态结果查询来确定正常版本镜像的升级状态,也可以通过升级日志来确定正常版本镜像的升级状态。The upgrade status includes upgrade failure or upgrade success. After upgrading the normal version image, the upgrade status of the normal version image can be determined by starting the normal version image. Generally speaking, startup failure indicates upgrade failure, and startup success indicates upgrade success. After the normal version image is successfully started, the corresponding normal version system can be entered to provide corresponding system support. After the normal version image fails to start, the normal version system cannot be entered and the corresponding system support cannot be provided. Alternatively, the upgrade status of the normal version image can be determined by querying the status result, or by the upgrade log.

102、若升级状态为升级失败,则进入恢复版本镜像并通过固件分区进行下一次在线自动升级。102. If the upgrade status is upgrade failure, enter the recovery version image and perform the next online automatic upgrade through the firmware partition.

在本发明实施例中,在获取正常版本镜像的升级状态后,若升级状态为升级成功,则可以通过正常版本镜像进入正常版本系统。若升级状态为升级失败,则无法进入正常版本系统,若无恢复版本镜像来进入对应的备用版本系统,会导致加速卡无法得到系统支持,无法实现对应的系统功能,加速卡无法使用,也就是所谓的加速卡变砖。In the embodiment of the present invention, after obtaining the upgrade status of the normal version image, if the upgrade status is upgrade success, the normal version system can be entered through the normal version image. If the upgrade status is upgrade failure, the normal version system cannot be entered. If there is no recovery version image to enter the corresponding standby version system, the accelerator card cannot be supported by the system, the corresponding system function cannot be realized, and the accelerator card cannot be used, which is the so-called accelerator card bricking.

上述加速卡中包括恢复版本镜像,在正常版本镜像的升级状态为升级失败时,则可以进入recovery模式启动恢复版本镜像,从而进入对应的备用版本系统,使得加速卡得到备用系统支持,实现对应的系统功能。同时,在正常版本镜像升级失败后,进入recovery模式时会触发恢复版本镜像中的固件分区,以提供恢复版本镜像继续升级的硬件资源,从而通过恢复版本镜像中的固件分区进行下一次的在线自动升级。The above-mentioned accelerator card includes a recovery version image. When the upgrade status of the normal version image is upgrade failure, the recovery version image can be started in recovery mode to enter the corresponding backup version system, so that the accelerator card can be supported by the backup system and realize the corresponding system functions. At the same time, after the normal version image upgrade fails, the firmware partition in the recovery version image will be triggered when entering the recovery mode to provide hardware resources for the recovery version image to continue upgrading, so as to perform the next online automatic upgrade through the firmware partition in the recovery version image.

上述恢复版本镜像可以理解为不常用的版本镜像或备用的版本镜像,上述恢复版本镜像在加速卡的系统启动失败或系统升级失败时用于替换正常版本镜像来为加速卡提供备用系统支持。恢复版本镜像为精简过的版本镜像,从而占用加速卡中较小的存储空间。The above-mentioned recovery version image can be understood as an uncommon version image or a spare version image. The above-mentioned recovery version image is used to replace the normal version image to provide backup system support for the accelerator card when the system startup or system upgrade fails. The recovery version image is a streamlined version image, which occupies a smaller storage space in the accelerator card.

上述固件分区可以是upgrade_firmware固件分区,upgrade_firmware固件分区可以用于提供继续进行版本镜像升级的功能,使得恢复版本下还可以通过upgrade_firmware固件分区继续进行版本镜像的在线自动升级。The firmware partition may be an upgrade_firmware partition, which may be used to provide a function of continuing to upgrade the version image, so that the online automatic upgrade of the version image may be continued through the upgrade_firmware partition in the recovery version.

具体来说,在recovery模式的升级基础上,新增一个upgrade_firmware固件分区用来提供在recovery模式下继续OTA升级的功能。当正常升级进入recovery模式时,不会触发恢复版本镜像中的upgrade_firmware固件,只有当OTA升级失败,加速卡进入到recovery模式时,才会触发恢复版本镜像中的upgrade_firmware固件,从而保证可以进行下一次的OTA升级。Specifically, based on the upgrade in recovery mode, a new upgrade_firmware partition is added to provide the function of continuing OTA upgrade in recovery mode. When the normal upgrade enters recovery mode, the upgrade_firmware firmware in the recovery version image will not be triggered. Only when the OTA upgrade fails and the accelerator card enters recovery mode, the upgrade_firmware firmware in the recovery version image will be triggered, thus ensuring that the next OTA upgrade can be performed.

本发明实施例中,加速卡包括正常版本镜像以及恢复版本镜像,正常版本镜像与恢复版本镜像相互隔离,恢复版本镜像包括提供再升级能力的固件分区;获取正常版本镜像的升级状态,所述升级状态包括升级失败或升级成功;若升级状态为升级失败,则进入恢复版本镜像并通过所述固件分区进行下一次在线自动升级。通过在加速卡中设置相互隔离的正常版本镜像以及恢复版本镜像,可以在正常版本镜像升级失败时,通过恢复版本镜像来支撑加速卡的运行,由于恢复版本镜像中设置有提供再升级能力的固件分区,使得进入恢复版本镜像的加速卡可以再次进行在线自动升级,可以不需要通过人工返厂进行维修,降低了加速卡的维护成本。In an embodiment of the present invention, the accelerator card includes a normal version image and a recovery version image, the normal version image and the recovery version image are isolated from each other, and the recovery version image includes a firmware partition that provides re-upgrade capability; the upgrade status of the normal version image is obtained, and the upgrade status includes upgrade failure or upgrade success; if the upgrade status is upgrade failure, the recovery version image is entered and the next online automatic upgrade is performed through the firmware partition. By setting the normal version image and the recovery version image that are isolated from each other in the accelerator card, the operation of the accelerator card can be supported by the recovery version image when the normal version image fails to be upgraded. Since the recovery version image is provided with a firmware partition that provides re-upgrade capability, the accelerator card that enters the recovery version image can be automatically upgraded online again, and does not need to be manually returned to the factory for repair, thereby reducing the maintenance cost of the accelerator card.

可选的,在获取对于正常版本镜像进行在线自动升级的升级状态的步骤之前,还可以接收主端下发的正常版本升级包;通过正常版本升级包对正常版本镜像进行在线自动升级。Optionally, before the step of obtaining the upgrade status of the online automatic upgrade of the normal version image, a normal version upgrade package sent by the master end may be received; and the normal version image may be automatically upgraded online through the normal version upgrade package.

在本发明实施例中,主端上发布有正常版本镜像升级包和恢复版本镜像升级包,当加速卡需要进行升级时,向主端发送版本镜像升级请求,主端通过封装好的接口组件向加速卡下发升级操作,通过通信库插件提供的通信接口向加速卡下发版本镜像升级包。In an embodiment of the present invention, a normal version image upgrade package and a recovery version image upgrade package are published on the master end. When the accelerator card needs to be upgraded, a version image upgrade request is sent to the master end. The master end sends the upgrade operation to the accelerator card through the encapsulated interface component and sends the version image upgrade package to the accelerator card through the communication interface provided by the communication library plug-in.

在对正常版本镜像进行OTA在线自动升级时,加速卡升级分为两个阶段,第一阶段主要做升级相关的准备,第一阶段处于正常版本镜像运行下,即第一阶段是在正常版本系统运行下进行的。加速卡接收到主端的正常版本镜像升级包,对升级包进行检查、校验工作等,在准备完成后,通知主端,主端通过封装好的接口组件下发复位操作到加速卡,通过复位操作使得加速卡进入recovery模式。第二阶段则在recovery模式下对正常版本镜像进行升级,第二阶段处于恢复版本镜像运行下,将升级包刷写到加速卡的存储里,完成对正常版本镜像的升级,然后通知主端,主端再次通过封装好的接口组件下发复位操作到加速卡,通过复位操作使得加速卡启动正常版本镜像,进入到升级后的正常版本系统。When the normal version image is automatically upgraded online via OTA, the accelerator card upgrade is divided into two stages. The first stage is mainly for preparations related to the upgrade. The first stage is under the operation of the normal version image, that is, the first stage is carried out under the operation of the normal version system. The accelerator card receives the normal version image upgrade package from the master, checks and verifies the upgrade package, and after the preparation is completed, notifies the master. The master sends a reset operation to the accelerator card through the packaged interface component, and the accelerator card enters the recovery mode through the reset operation. The second stage is to upgrade the normal version image in the recovery mode. The second stage is under the operation of the recovery version image, and the upgrade package is written to the storage of the accelerator card to complete the upgrade of the normal version image. Then the master is notified. The master sends a reset operation to the accelerator card again through the packaged interface component. The accelerator card starts the normal version image through the reset operation and enters the upgraded normal version system.

可选的,在正常版本镜像升级之前或正常版本镜像升级成功的步骤之后,还可以运行正常版本镜像或升级成功后的正常版本镜像,对恢复版本镜像进行升级。Optionally, before the normal version image is upgraded or after the normal version image is successfully upgraded, the normal version image or the normal version image after the successful upgrade may be run to upgrade the recovery version image.

在本发明实施例中,加速卡在启动正常版本镜像,进入正常版本系统后,可以查询主端是否发布恢复版本镜像升级包,若主端恢复版本镜像升级包,则可以向主端发送恢复版本镜像升级请求,主端通过通信库插件提供的通信接口向加速卡下发恢复版本镜像升级包,将恢复版本镜像刷写到加速卡的存储里,完成对恢复版本镜像的升级,然后通知主端。In an embodiment of the present invention, after starting the normal version image and entering the normal version system, the accelerator card can query whether the master end has released a recovery version image upgrade package. If the master end has a recovery version image upgrade package, a recovery version image upgrade request can be sent to the master end. The master end sends the recovery version image upgrade package to the accelerator card through the communication interface provided by the communication library plug-in, and writes the recovery version image to the storage of the accelerator card to complete the upgrade of the recovery version image, and then notifies the master end.

通过正常版本系统正常运行的情况下对恢复版本镜像进行升级,可以使得恢复版本镜像升级。需要说明的是,上述恢复版本镜像为精简的版本镜像,上述恢复版本镜像升级包可以在测试设备上先进行试运行,当恢复版本镜像升级包试运行无错,则可以发布到主端上。The recovery version image can be upgraded by upgrading the recovery version image under the normal operation of the normal version system. It should be noted that the above recovery version image is a simplified version image, and the above recovery version image upgrade package can be tested on the test device first. When the recovery version image upgrade package runs without error, it can be released to the master end.

可选的,在获取正常版本镜像的升级状态的步骤中,可以获取升级后的正常版本镜像的启动状态;根据启动状态,确定正常版本镜像的升级状态。Optionally, in the step of obtaining the upgrade status of the normal version image, the startup status of the upgraded normal version image may be obtained; and the upgrade status of the normal version image may be determined according to the startup status.

在本发明实施例中,上述启动状态可以理解为启动正常版本镜像是否成功,若启动正常版本镜像成功,则会进入正常版本系统,若启动正常版本镜像失败,则进入不了正常版本系统,若无备用系统,则加速卡变砖无法使用。In an embodiment of the present invention, the above-mentioned startup status can be understood as whether the startup of the normal version image is successful. If the startup of the normal version image is successful, the normal version system will be entered. If the startup of the normal version image fails, the normal version system cannot be entered. If there is no backup system, the acceleration card will become bricked and cannot be used.

具体来说,升级后的正常版本镜像的启动状态若为启动成功,则可以确定正常版本镜像的升级状态为升级成功,若正常版本镜像的启动状态若为启动失败,则可以确定正常版本镜像的升级状态为升级失败。Specifically, if the startup status of the upgraded normal version image is startup success, the upgrade status of the normal version image can be determined to be upgrade success; if the startup status of the normal version image is startup failure, the upgrade status of the normal version image can be determined to be upgrade failure.

可选的,在根据启动状态,确定正常版本镜像的升级状态的步骤中,可以当升级后的正常版本镜像为正常启动时,若正常启动失败次数大于预设值时,则确定正常版本镜像的升级状态为升级失败;当升级后的所述正常版本镜像为升级启动时,若不是升级后第一次启动,则确定正常版本镜像的升级状态为升级失败。Optionally, in the step of determining the upgrade status of the normal version image according to the startup status, when the upgraded normal version image is started normally, if the number of normal startup failures is greater than a preset value, the upgrade status of the normal version image is determined to be upgrade failure; when the upgraded normal version image is started for upgrade, if it is not the first startup after the upgrade, the upgrade status of the normal version image is determined to be upgrade failure.

在本发明实施例中,上述正常启动可以理解为非升级状态下对正常版本镜像进行启动,具备可以理解为在升级后一段时间后的启动。可以判断是否为正常启动,若为正常启动,则进一步判断是否正常启动成功,若正常启动成功,则可以确定启动状态为启动成功。若正常启动失败,则可以根据正常启动失败的次数判断是否为升级失败,若正常启动失败次数大于预设值,则可以确定升级失败,若正常启动失败次数小于或等于预设值,则继续尝试启动,直到确定升级失败或启动成功。In the embodiment of the present invention, the above-mentioned normal startup can be understood as starting the normal version image in a non-upgraded state, and can be understood as starting after a period of time after the upgrade. It can be judged whether it is a normal startup. If it is a normal startup, it is further judged whether the normal startup is successful. If the normal startup is successful, it can be determined that the startup state is a successful startup. If the normal startup fails, it can be judged whether it is an upgrade failure based on the number of normal startup failures. If the number of normal startup failures is greater than the preset value, it can be determined that the upgrade has failed. If the number of normal startup failures is less than or equal to the preset value, the startup will continue to be tried until it is determined that the upgrade has failed or the startup is successful.

上述升级启动可以理解为在升级后一段时间内的启动。在判断不是正常启动时,则可以进一步判断是否为升级启动,若是升级启动,则可以再进一步判断是否是升级后的第一次启动,若是升级后的第一次启动,则升级后的第一启动成功,则可以确定升级成功,则是升级后的第一次启动失败,则可以确定为升级失败。The above-mentioned upgrade startup can be understood as startup within a period of time after the upgrade. When it is determined that it is not a normal startup, it can be further determined whether it is an upgrade startup. If it is an upgrade startup, it can be further determined whether it is the first startup after the upgrade. If it is the first startup after the upgrade, the first startup after the upgrade is successful, then it can be determined that the upgrade is successful. If it is the first startup after the upgrade fails, then it can be determined that the upgrade failed.

若不是正常启动也不是升级启动,则可以是强制启动,在强制启动时提示是否进入recovery模式,若选择是,则可以强制进入recovery模式,启动对应的恢复版本镜像。If it is neither a normal startup nor an upgrade startup, it can be a forced startup. During the forced startup, you will be prompted whether to enter the recovery mode. If you choose yes, you can force enter the recovery mode and start the corresponding recovery version image.

在升级状态为升级失败的情况下,则可以通知主端,主端通过封装好的接口组件下发复位操作到加速卡,通过复位操作使得加速卡进入recovery模式。When the upgrade status is upgrade failure, the master end can be notified, and the master end sends a reset operation to the accelerator card through the packaged interface component, and the accelerator card enters the recovery mode through the reset operation.

可选的,主端与加速卡之间的通信链路包括第一通信链路以及第二通信链路,第一通信链路与第二通信链路包括不同的通信主体,在通过恢复版本镜像进行下一次在线自动升级的步骤之前,还可以若第一通信链路正常,则通过第一通信链路控制加速卡进入所述恢复版本镜像;若第一通信链路异常,则通过第二通信链路控制加速卡进入所述恢复版本镜像。Optionally, the communication link between the main end and the acceleration card includes a first communication link and a second communication link, and the first communication link and the second communication link include different communication subjects. Before the next online automatic upgrade step through the recovery version image, if the first communication link is normal, the acceleration card is controlled to enter the recovery version image through the first communication link; if the first communication link is abnormal, the acceleration card is controlled to enter the recovery version image through the second communication link.

在本发明实施例中,上述加速卡可以是pcie加速卡,上述主端可以是pcie主机,上述第一通信链路可以是高速外设总线pcie链路,pcie加速卡与pcie主机可以通过pcie链路进行通信连接。上述pcie加速卡中处理器还包括一个用于通信的核心,pcie主机还包括一个微控制器,上述第二通信链路可以用于通信的核心与BMC(Baseboard ManagementController)微控制器进行通信连接,具体的,上述第二通信链路可以是基于Smbus总线的Smbus链路,通过Smbus总线将用于通信的核心与微控制器进行通信连接。可以理解的是,上述pcie链路的通信主体为pcie加速卡与pcie主机的pcie链路接口组件,上述Smbus链路的通信主体为pcie加速卡处理器中的一个小核心与pcie主机中的BMC微控制器。In an embodiment of the present invention, the acceleration card may be a pcie acceleration card, the host may be a pcie host, the first communication link may be a high-speed peripheral bus pcie link, and the pcie acceleration card and the pcie host may be communicatively connected via the pcie link. The processor in the pcie acceleration card also includes a core for communication, and the pcie host also includes a microcontroller. The second communication link may be used for the communication core to communicate with the BMC (Baseboard Management Controller) microcontroller. Specifically, the second communication link may be an Smbus link based on the Smbus bus, and the core for communication may be communicatively connected with the microcontroller via the Smbus bus. It is understandable that the communication subject of the pcie link is the pcie link interface component between the pcie acceleration card and the pcie host, and the communication subject of the Smbus link is a small core in the pcie acceleration card processor and the BMC microcontroller in the pcie host.

在进行正常版本镜像与恢复版本镜像的切换过程中,可以由程序状态机来控制正常版本镜像与恢复版本镜像的启动。具体的,在正常版本镜像升级时,改变程序状态机的初始状态为升级状态,在升级后的正常版本镜像启动成功时,恢复程序状态机的升级状态为初始状态。这样,可保证在正常启动场景下,出现启动异常时都可切换到recovery模式,启动对应的恢复版本镜像。In the process of switching between the normal version image and the recovery version image, the program state machine can control the startup of the normal version image and the recovery version image. Specifically, when the normal version image is upgraded, the initial state of the program state machine is changed to the upgraded state, and when the upgraded normal version image is successfully started, the upgraded state of the program state machine is restored to the initial state. In this way, it can be ensured that in the normal startup scenario, when a startup abnormality occurs, it can switch to the recovery mode and start the corresponding recovery version image.

具体的,pcie加速卡中还包括watchdog超时中断,在正常版本镜像启动失败时,若pcie链路正常,可以通过watchdog超时中断给host主端发送消息,此时host主端收到消息之后,操作pcie_hot_reset复位加速卡,使加速卡进入到recovery模式。Specifically, the pcie accelerator card also includes a watchdog timeout interrupt. When the normal version image fails to start, if the pcie link is normal, a message can be sent to the host master through the watchdog timeout interrupt. After the host master receives the message, it operates pcie_hot_reset to reset the accelerator card and put the accelerator card into recovery mode.

在正常版本镜像启动失败时,若pcie链路异常,无法进行pcie通信,此时可通过Smbus链路与带有BMC微控制器的Host主端进行相连,加速卡利用Smbus链路与处理器内的小核(用于通信的核心)进行通信进而复位加速卡。When the normal version image fails to start, if the pcie link is abnormal and pcie communication cannot be performed, it can be connected to the Host master with the BMC microcontroller through the Smbus link. The accelerator card uses the Smbus link to communicate with the small core (core used for communication) in the processor to reset the accelerator card.

可选的,请参见图3,图3是本发明实施例提供的一种加速卡升级装置的结构示意图,如图3所示,所述加速卡包括正常版本镜像以及恢复版本镜像,所述正常版本镜像与所述恢复版本镜像相互隔离,所述恢复版本镜像包括提供再升级能力的固件分区,所述装置包括:Optionally, please refer to FIG. 3, which is a schematic diagram of the structure of an accelerator card upgrade device provided by an embodiment of the present invention. As shown in FIG. 3, the accelerator card includes a normal version image and a recovery version image, the normal version image and the recovery version image are isolated from each other, the recovery version image includes a firmware partition that provides re-upgrade capability, and the device includes:

获取模块201,用于获取正常版本镜像的升级状态,所述升级状态包括升级失败或升级成功;The acquisition module 201 is used to acquire the upgrade status of the normal version image, where the upgrade status includes upgrade failure or upgrade success;

第一升级模块202,用于若升级状态为升级失败,则进入恢复版本镜像并通过所述固件分区进行下一次在线自动升级。The first upgrade module 202 is used to enter the recovery version image and perform the next online automatic upgrade through the firmware partition if the upgrade status is upgrade failure.

可选的,所述装置还包括:Optionally, the device further comprises:

接收模块,用于接收主端下发的正常版本升级包;The receiving module is used to receive the normal version upgrade package sent by the master end;

第二升级模块,用于通过所述正常版本升级包对所述正常版本镜像进行在线自动升级。The second upgrade module is used to automatically upgrade the normal version image online through the normal version upgrade package.

可选的,所述装置还包括:Optionally, the device further comprises:

第三升级模块,用于运行所述正常版本镜像或升级成功后的所述正常版本镜像,对所述恢复版本镜像进行升级。The third upgrade module is used to run the normal version image or the normal version image after successful upgrade to upgrade the recovery version image.

可选的,所述获取模块201包括:Optionally, the acquisition module 201 includes:

状态获取子模块,用于通过程序状态机获取升级后的所述正常版本镜像的启动状态;A status acquisition submodule, used for acquiring the startup status of the upgraded normal version image through a program state machine;

状态确定子模块,用于根据所述启动状态,确定所述正常版本镜像的升级状态。The state determination submodule is used to determine the upgrade state of the normal version image according to the startup state.

可选的,所述状态确定子模块包括:Optionally, the state determination submodule includes:

第一确定单元,用于当升级后的所述正常版本镜像为正常启动时,若正常启动失败次数大于预设值时,则确定所述正常版本镜像的升级状态为升级失败;A first determining unit is used to determine that the upgrade status of the normal version image is an upgrade failure when the normal version image after the upgrade is normally started and the number of normal startup failures is greater than a preset value;

第二确定单元,用于当升级后的所述正常版本镜像为升级启动时,若不是升级后第一次启动,则确定所述正常版本镜像的升级状态为升级失败。The second determining unit is configured to determine that the upgrade status of the normal version image is upgrade failure when the normal version image after the upgrade is started for upgrade, if it is not the first startup after the upgrade.

可选的,所述主端与所述加速卡之间的通信链路包括第一通信链路以及第二通信链路,所述第一通信链路与所述第二通信链路包括不同的通信主体,所述装置还包括:Optionally, the communication link between the master end and the acceleration card includes a first communication link and a second communication link, the first communication link and the second communication link include different communication entities, and the device further includes:

第一处理模块,用于若所述第一通信链路正常,则通过所述第一通信链路控制所述加速卡进入所述恢复版本镜像;A first processing module, configured to control the acceleration card to enter the recovery version image through the first communication link if the first communication link is normal;

第二处理模块,用于若所述第一通信链路异常,则通过所述第二通信链路控制所述加速卡进入所述恢复版本镜像。The second processing module is used to control the acceleration card to enter the recovery version image through the second communication link if the first communication link is abnormal.

需要说明的是,本发明实施例提供的河道监测装置可以应用于可以进行加速卡升级方法的智能摄像头、智能手机、电脑、服务器等设备。It should be noted that the river monitoring device provided in the embodiment of the present invention can be applied to smart cameras, smart phones, computers, servers and other devices that can perform the acceleration card upgrade method.

本发明实施例提供的加速卡升级装置能够实现上述方法实施例中加速卡升级方法实现的各个过程,且可以达到相同的有益效果。为避免重复,这里不再赘述。The accelerator card upgrade device provided in the embodiment of the present invention can implement each process implemented by the accelerator card upgrade method in the above method embodiment and can achieve the same beneficial effect. To avoid repetition, it will not be described here.

参见图4,图4是本发明实施例提供的一种电子设备的结构示意图,如图4所示,包括:存储器302、处理器301及存储在所述存储器302上并可在所述处理器301上运行的加速卡升级方法的计算机程序,其中:Referring to FIG. 4 , FIG. 4 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. As shown in FIG. 4 , the electronic device includes: a memory 302, a processor 301, and a computer program of an accelerator card upgrade method stored in the memory 302 and executable on the processor 301, wherein:

所述加速卡包括正常版本镜像以及恢复版本镜像,所述正常版本镜像与所述恢复版本镜像相互隔离,所述恢复版本镜像包括提供再升级能力的固件分区,处理器301用于调用存储器302存储的计算机程序,执行如下步骤:The accelerator card includes a normal version image and a recovery version image, the normal version image and the recovery version image are isolated from each other, the recovery version image includes a firmware partition providing re-upgrade capability, the processor 301 is used to call the computer program stored in the memory 302, and execute the following steps:

获取正常版本镜像的升级状态,所述升级状态包括升级失败或升级成功;Obtaining the upgrade status of the normal version image, wherein the upgrade status includes upgrade failure or upgrade success;

若升级状态为升级失败,则进入恢复版本镜像并通过所述固件分区进行下一次在线自动升级。If the upgrade status is upgrade failure, enter the recovery version image and perform the next online automatic upgrade through the firmware partition.

可选的,在所述获取对于正常版本镜像进行在线自动升级的升级状态之前,处理器301执行的所述方法还包括:Optionally, before obtaining the upgrade status of online automatic upgrade of the normal version image, the method executed by the processor 301 further includes:

接收主端下发的正常版本升级包;Receive the normal version upgrade package sent by the master end;

通过所述正常版本升级包对所述正常版本镜像进行在线自动升级。The normal version image is automatically upgraded online through the normal version upgrade package.

可选的,在所述正常版本镜像升级之前或所述正常版本镜像升级成功之后,处理器301执行的所述方法还包括:Optionally, before the normal version image is upgraded or after the normal version image is successfully upgraded, the method executed by the processor 301 further includes:

运行所述正常版本镜像或升级成功后的所述正常版本镜像,对所述恢复版本镜像进行升级。Run the normal version image or the normal version image after successful upgrade, and upgrade the recovery version image.

可选的,处理器301执行的所述获取正常版本镜像的升级状态,包括:Optionally, the obtaining of the upgrade status of the normal version image performed by the processor 301 includes:

通过程序状态机获取升级后的所述正常版本镜像的启动状态;Obtaining the startup status of the upgraded normal version image through the program state machine;

根据所述启动状态,确定所述正常版本镜像的升级状态。According to the startup status, the upgrade status of the normal version image is determined.

可选的,处理器301执行的所述根据所述启动状态,确定所述正常版本镜像的升级状态,包括:Optionally, the determining, according to the startup state, the upgrade state of the normal version image performed by the processor 301 includes:

当升级后的所述正常版本镜像为正常启动时,若正常启动失败次数大于预设值时,则确定所述正常版本镜像的升级状态为升级失败;When the normal version image after the upgrade is started normally, if the number of normal startup failures is greater than a preset value, determining that the upgrade status of the normal version image is upgrade failure;

当升级后的所述正常版本镜像为升级启动时,若不是升级后第一次启动,则确定所述正常版本镜像的升级状态为升级失败。When the normal version image after the upgrade is started for the upgrade, if it is not the first startup after the upgrade, it is determined that the upgrade status of the normal version image is upgrade failure.

可选的,所述主端与所述加速卡之间的通信链路包括第一通信链路以及第二通信链路,所述第一通信链路与所述第二通信链路包括不同的通信主体,在所述通过恢复版本镜像进行下一次在线自动升级之前,处理器301执行的所述方法还包括:Optionally, the communication link between the master end and the acceleration card includes a first communication link and a second communication link, the first communication link and the second communication link include different communication entities, and before the next online automatic upgrade is performed by restoring the version image, the method executed by the processor 301 further includes:

若所述第一通信链路正常,则通过所述第一通信链路控制所述加速卡进入所述恢复版本镜像;If the first communication link is normal, controlling the acceleration card to enter the recovery version image through the first communication link;

若所述第一通信链路异常,则通过所述第二通信链路控制所述加速卡进入所述恢复版本镜像。If the first communication link is abnormal, the acceleration card is controlled to enter the recovery version image through the second communication link.

本发明实施例提供的电子设备能够实现上述方法实施例中加速卡升级方法实现的各个过程,且可以达到相同的有益效果。为避免重复,这里不再赘述。本发明实施例中提供的计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现本发明实施例提供的加速卡升级方法或应用端加速卡升级方法的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The electronic device provided in the embodiment of the present invention can implement the various processes implemented by the acceleration card upgrade method in the above method embodiment, and can achieve the same beneficial effects. To avoid repetition, it will not be repeated here. The computer-readable storage medium provided in the embodiment of the present invention stores a computer program on the computer-readable storage medium. When the computer program is executed by the processor, it implements the various processes of the acceleration card upgrade method or the application-side acceleration card upgrade method provided in the embodiment of the present invention, and can achieve the same technical effects. To avoid repetition, it will not be repeated here.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存取存储器(Random AccessMemory,简称RAM)等。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是在本发明的构思下,利用本发明说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本发明的专利保护范围内。The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the concept of the present invention, or directly/indirectly applied in other related technical fields are included in the patent protection scope of the present invention.

Claims (10)

1. An accelerator card upgrade method, wherein the accelerator card includes a normal version image and a recovered version image, the normal version image and the recovered version image being isolated from each other, the recovered version image including a firmware partition providing re-upgrade capability, the method comprising:
Acquiring an upgrade state of a normal version image, wherein the upgrade state comprises upgrade failure or upgrade success;
if the upgrade status is upgrade failure, the method enters a recovered version image and carries out next online automatic upgrade through the firmware partition.
2. The accelerator card upgrade method according to claim 1, wherein before the acquiring the upgrade status for online automatic upgrade of the normal version image, the method further comprises:
Receiving a normal version upgrade package issued by a main terminal;
And carrying out online automatic upgrading on the normal version image through the normal version upgrading package.
3. The accelerator card upgrade method according to claim 2, wherein before the normal version image upgrade or after the normal version image upgrade is successful, the method further comprises:
and operating the normal version image or the normal version image after the successful upgrading is carried out, and upgrading the recovered version image.
4. The method for upgrading an accelerator card according to claim 2, wherein the obtaining the upgrade status of the normal version image includes:
acquiring the starting state of the updated normal version image through a program state machine;
And determining the upgrading state of the normal version image according to the starting state.
5. The method for upgrading an accelerator card according to claim 3, wherein determining an upgrade status of the normal version image according to the start-up status comprises:
when the updated normal version image is normally started, if the normal start failure times are larger than a preset value, determining that the upgrading state of the normal version image is upgrading failure;
when the updated normal version image is started after upgrading, if the updated normal version image is not started for the first time after upgrading, the upgrading state of the normal version image is determined to be failed in upgrading.
6. The method of claim 5, wherein the communication link between the host and the accelerator card comprises a first communication link and a second communication link, the first communication link and the second communication link comprising different communication agents, the method further comprising, prior to the next online automatic upgrade via a recovery version image:
if the first communication link is normal, controlling the accelerator card to enter the recovery version mirror image through the first communication link;
and if the first communication link is abnormal, controlling the accelerator card to enter the recovery version mirror image through the second communication link.
7. An accelerator card upgrade apparatus, wherein the accelerator card comprises a normal version image and a recovered version image, the normal version image and the recovered version image being isolated from each other, the recovered version image comprising a firmware partition providing re-upgrade capability, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring the upgrading state of the normal version image, and the upgrading state comprises upgrading failure or upgrading success;
And the first upgrading module is used for entering a recovered version image and carrying out the next online automatic upgrading through the firmware partition if the upgrading state is that the upgrading fails.
8. An accelerator card upgrade system, the system comprising: the accelerator card comprises an accelerator card upgrading device, a normal version image and a recovery version image, wherein the accelerator card upgrading device is used for executing the accelerator card upgrading method according to any of claims 1 to 6.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the accelerator card upgrade method according to any one of claims 1 to 6 when the computer program is executed by the processor.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the accelerator card upgrade method of any one of claims 1 to 6.
CN202310120319.7A 2023-02-02 2023-02-02 Acceleration card upgrading method, device and system, electronic equipment and storage medium Pending CN118426794A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310120319.7A CN118426794A (en) 2023-02-02 2023-02-02 Acceleration card upgrading method, device and system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310120319.7A CN118426794A (en) 2023-02-02 2023-02-02 Acceleration card upgrading method, device and system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118426794A true CN118426794A (en) 2024-08-02

Family

ID=92309448

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310120319.7A Pending CN118426794A (en) 2023-02-02 2023-02-02 Acceleration card upgrading method, device and system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118426794A (en)

Similar Documents

Publication Publication Date Title
US9229707B2 (en) Zero downtime mechanism for software upgrade of a distributed computer system
CN105468717B (en) Database operation method and device
US7194614B2 (en) Boot swap method for multiple processor computer systems
CN106201773A (en) The upgrading of instance system, cloud system and instance system or restoration methods
CN119377061A (en) Method for sending indicator light signal, storage medium, integrated hard disk and computer program product
CN116185510A (en) Partition switch starting method, array server and computer readable storage medium
WO2011158367A1 (en) Technology for updating active program
CN118426794A (en) Acceleration card upgrading method, device and system, electronic equipment and storage medium
CN119960782A (en) Data updating method, device, equipment, storage medium and program product
CN118210530A (en) Vehicle system firmware upgrading method and device, electronic equipment and storage medium
CN117312056A (en) Operating system upgrading backup method
CN117950694A (en) Software upgrade method, device, vehicle and storage medium
CN111522571A (en) Equipment upgrading method and device, terminal equipment and storage medium
CN116737185A (en) Mirror image loading method, device, equipment and medium
CN117931649A (en) Testing method for deadlock reset of operating system and computing device
CN106130815B (en) Board-level test method and device
US20090313627A1 (en) Technique for performing a system shutdown
CN103186403A (en) Node replacement processing method and server system using the method
CN114064086A (en) Multi-stage processor system and upgrading method thereof
CN120723188B (en) Printing method of debugging information and electronic equipment
CN119512604B (en) A method, apparatus, and electronic device for upgrading components in a Kubernetes cluster.
CN111506441A (en) A method, device, device and storage medium for monitoring Raid card information
CN121029475B (en) Server storage controller recovery methods, electronic devices
CN115185609A (en) Loading system for accessing equipment based on java language
CN121763819A (en) Test mode switching method and device

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