Search

CN-122018954-A - Method, system, equipment and medium for upgrading firmware equipment in embedded system

CN122018954ACN 122018954 ACN122018954 ACN 122018954ACN-122018954-A

Abstract

The invention provides an upgrading method, a system, equipment and a medium of firmware equipment in an embedded system, wherein the upgrading method is applied to a server side, the server side is communicated with the equipment side by adopting a double protocol, the equipment side is provided with a first protocol communication interface and a second protocol communication interface, the upgrading method comprises the steps of generating control instruction information, wherein the control instruction information comprises upgrading instruction information and target upgrading packet information, the upgrading instruction information is sent to the equipment side through the first protocol communication interface, the target upgrading packet information is sent to the equipment side through the second protocol communication interface, so that the equipment side can execute upgrading operation by adopting the target upgrading packet based on the upgrading instruction information.

Inventors

  • HE MEIQI
  • WU YIXUAN
  • HAN XIAORAN
  • FAN LEILEI
  • LIU XIANGQIAN
  • ZHANG RONGDA
  • GUO HENGJIANG
  • Qin Yishu
  • FENG YI
  • MA XIAO
  • ZHU HUAIYU
  • JIANG JIANPING
  • WANG JIACHENG
  • WEI CUNHAI
  • LIU YONG

Assignees

  • 国核自仪系统工程有限公司
  • 国家电投集团河北电力有限公司

Dates

Publication Date
20260512
Application Date
20260204

Claims (10)

  1. 1. The upgrading method of the firmware equipment in the embedded system is characterized in that the upgrading method is applied to a server side, the server side adopts double protocols to communicate with the equipment side, and the equipment side is provided with a first protocol communication interface and a second protocol communication interface; the upgrading method comprises the following steps: generating control instruction information, wherein the control instruction information comprises upgrade instruction information and target upgrade package information; The upgrade instruction information is sent to the equipment end through a first protocol and a first protocol communication interface, and the target upgrade package information is sent to the equipment end through a second protocol and a second protocol communication interface, so that the equipment end executes upgrade operation by adopting the target upgrade package based on the upgrade instruction information; wherein the first protocol is a protocol for transmitting complete data, and the second protocol is a protocol for transmitting data in real time.
  2. 2. The method for upgrading firmware equipment in an embedded system according to claim 1, wherein the step of generating control instruction information includes: Generating update upgrade package information and acquiring current upgrade package information stored in the equipment end; comparing the updated upgrade package information with first upgrade package difference information of the current upgrade information, and taking the updated upgrade package information and the first upgrade package difference information as the target upgrade package information; Or alternatively, the first and second heat exchangers may be, Generating update upgrade package information; And responding to the acquired reset mark information of the equipment end, and taking the update upgrade package as the target upgrade package information.
  3. 3. The method for upgrading firmware equipment in an embedded system according to claim 2, wherein the breakpoint flag information of the equipment terminal is obtained, and the second upgrade package difference information based on the breakpoint flag information and the upgrade package information is used as the target upgrade package information.
  4. 4. A method of upgrading a firmware device in an embedded system according to any of claims 1-3, wherein the first protocol comprises a TCP protocol; And/or the number of the groups of groups, The second protocol comprises a UDP protocol; And/or the number of the groups of groups, The upgrading method further comprises the following steps: And acquiring and outputting the real-time state information of the equipment end, wherein the real-time state information comprises at least one of an equipment idle state, an equipment transmission state and an equipment completion state.
  5. 5. The upgrading method of the firmware equipment in the embedded system is characterized in that the upgrading method is applied to an equipment end, and the equipment end is provided with a first protocol communication interface and a second protocol communication interface; the upgrading method comprises the following steps: The first protocol communication interface is adopted to receive upgrade instruction information sent by a server side through a first protocol, and the second protocol communication interface is adopted to receive target upgrade package information sent by the server side through a second protocol; Wherein the first protocol is a protocol for transmitting complete data, and the second protocol is a protocol for transmitting data in real time; Sequentially storing the target upgrade package information in an initial storage area; and based on the upgrade instruction information, performing upgrade operation by adopting the target upgrade package information in the initial storage area.
  6. 6. The method for upgrading a firmware device in an embedded system according to claim 5, wherein the upgrade instruction information includes a start instruction, a data transmission instruction, and an upgrade completion instruction; the target upgrade package information comprises package serial number information, data upgrade information and verification information; The initial storage area comprises a fixed data storage module and a differential data storage module; The step of sequentially storing the target upgrade package information in an initial storage area in response to the upgrade instruction information being the start instruction includes: In response to the reset mark information in the initial storage area, clearing the initial storage area, storing update package information in the initial storage area, and sending first state information to the server, wherein the first state information is in an idle state; clearing the difference data storage module in response to the breakpoint mark information in the initial storage area, storing second upgrade package difference information into the difference data storage module, and sending the first state information to the server; In response to the fact that the reset mark information and the breakpoint mark information do not exist in the initial storage area, the difference data storage module is cleared, first upgrade package difference information is stored in the difference data storage module, and the first state information is sent to the server; Or alternatively, the first and second heat exchangers may be, And responding to the upgrade instruction information as the data transmission instruction, wherein the step of completing the upgrade of the equipment end based on the target upgrade package information in the initial storage area comprises the following steps: Sequentially acquiring the data upgrading information in the initial storage area according to the packet sequence number information; checking different data upgrading information based on a preset checking mode to generate a checking result; Responding to the verification result as success, determining current update progress information based on the packet sequence number information, and sending second state information by the server, wherein the second state information is a device transmission state; responding to the verification result as failure, acquiring the packet sequence number information corresponding to the failure of verification of the data upgrading information, and sending breakpoint mark information, the corresponding packet sequence number information and the second state information to the server; Or alternatively, the first and second heat exchangers may be, In response to the upgrade instruction information being the upgrade completion instruction, the upgrade method includes: and clearing the target upgrade package information in the initial storage area, and sending third state information to the server, wherein the third state information is a device completion state.
  7. 7. The upgrading system of the firmware equipment in the embedded system is characterized in that the upgrading system is applied to a service end, wherein the service end adopts double protocols to communicate with the equipment end, and the equipment end is provided with a first protocol communication interface and a second protocol communication interface; The upgrade system includes: the system comprises an instruction generation module, a control module and a control module, wherein the instruction generation module is used for generating control instruction information, and the control instruction information comprises upgrade instruction information and target upgrade package information; The instruction transmission module is used for transmitting the upgrade instruction information to the equipment end through a first protocol and the first protocol communication interface, and transmitting the target upgrade package information to the equipment end through a second protocol and the second protocol communication interface, so that the equipment end executes upgrade operation by adopting the target upgrade package based on the upgrade instruction information; wherein the first protocol is a protocol for transmitting complete data, and the second protocol is a protocol for transmitting data in real time.
  8. 8. The upgrading system of the firmware equipment in the embedded system is characterized in that the upgrading system is applied to an equipment end, and the equipment end is provided with a first protocol communication interface and a second protocol communication interface; The upgrade system includes: The instruction receiving module is used for receiving upgrade instruction information sent by the server through a first protocol by adopting the first protocol communication interface and receiving target upgrade package information sent by the server through a second protocol by adopting a second protocol communication interface; Wherein the first protocol is a protocol for transmitting complete data, and the second protocol is a protocol for transmitting data in real time; the instruction storage module is used for sequentially storing the target upgrade package information in an initial storage area; And the upgrading module is used for executing upgrading operation by adopting the target upgrading packet information in the initial storage area based on the upgrading instruction information.
  9. 9. An electronic device comprising a memory, a processor and a computer program stored on the memory for execution on the processor, wherein the processor, when executing the computer program, implements a method of upgrading a firmware device in an embedded system according to any one of claims 1 to 6.
  10. 10. A computer program product comprising a computer program which, when executed by a processor, implements a method of upgrading a firmware device in an embedded system according to any one of claims 1 to 6.

Description

Method, system, equipment and medium for upgrading firmware equipment in embedded system Technical Field The present disclosure relates to the field of data processing, and in particular, to a method, a system, an apparatus, and a medium for upgrading firmware devices in an embedded system. Background In the technical field of firmware upgrade of embedded devices, the existing scheme mainly faces the following limitations: Firstly, the full-scale upgrading mode needs to transmit a complete firmware packet, which often results in excessively long transmission time in industrial application scenes with limited network bandwidth, and occupies a large amount of equipment storage space. This feature makes it difficult to adapt to small embedded devices (e.g. MCU (microcontroller) based platforms) where storage resources are scarce. The traditional incremental upgrade scheme still has various defects that a) a storage management strategy is stiff, a fixed block erasing mode is generally adopted, dynamic adjustment cannot be carried out by combining hardware characteristics (such as a minimum erasing unit and a block structure) of external Flash, storage resource waste or write failure is easy to cause, b) a communication protocol is single in design, data transmission efficiency is low if only a TCP protocol (transmission control protocol) is relied on, reliability of a control instruction is insufficient and upgrade process interruption is easy to cause if only a UDP protocol (user datagram protocol) is adopted, c) a verification mechanism is weak, simple verification is generally carried out only at a transmission layer, double guarantee of a hardware layer (such as instant read-back verification after Flash) writing is lacked, and storage medium faults are difficult to effectively detect. In addition, the existing upgrading flow generally lacks effective state machine management, once upgrading is interrupted, progress cannot be traced accurately, and equipment is easy to enter a brick state (namely, the equipment cannot be started normally). Finally, the current scheme has the defects in compatibility and suitability, is difficult to flexibly adapt to the differences (such as Flash capacity, network interface performance and the like) of embedded devices of different types on hardware, and limits the popularization and application range. Disclosure of Invention The technical problem to be solved by the present disclosure is to overcome the defects in the prior art, and provide a method, a system, a device and a medium for upgrading firmware equipment in an embedded system. The technical problems are solved by the following technical scheme: According to a first aspect of the present disclosure, an upgrade method of firmware equipment in an embedded system is provided, where the upgrade method is applied to a server, the server uses dual protocols to communicate with the equipment, and the equipment is provided with a first protocol communication interface and a second protocol communication interface; the upgrading method comprises the following steps: generating control instruction information, wherein the control instruction information comprises upgrade instruction information and target upgrade package information; The upgrade instruction information is sent to the equipment end through a first protocol and a first protocol communication interface, and the target upgrade package information is sent to the equipment end through a second protocol and a second protocol communication interface, so that the equipment end executes upgrade operation by adopting the target upgrade package based on the upgrade instruction information; wherein the first protocol is a protocol for transmitting complete data, and the second protocol is a protocol for transmitting data in real time. Optionally, the step of generating control instruction information includes: Generating update upgrade package information and acquiring current upgrade package information stored in the equipment end; comparing the updated upgrade package information with first upgrade package difference information of the current upgrade information, and taking the updated upgrade package information and the first upgrade package difference information as the target upgrade package information; Or alternatively, the first and second heat exchangers may be, Generating update upgrade package information; And responding to the acquired reset mark information of the equipment end, and taking the update upgrade package as the target upgrade package information. Optionally, in response to obtaining breakpoint flag information of the device side, second upgrade package difference information based on the breakpoint flag information and the upgrade package update information is used as the target upgrade package information. Optionally, the first protocol comprises a TCP protocol; And/or the number of the groups of groups, The second protocol comprises a UDP pro