CN116755735A - Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium - Google Patents

Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium Download PDF

Info

Publication number
CN116755735A
CN116755735A CN202310633230.0A CN202310633230A CN116755735A CN 116755735 A CN116755735 A CN 116755735A CN 202310633230 A CN202310633230 A CN 202310633230A CN 116755735 A CN116755735 A CN 116755735A
Authority
CN
China
Prior art keywords
firmware
app
upgrade
identification code
interrupt vector
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
CN202310633230.0A
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.)
Guangdong Biolight Meditech Co Ltd
Original Assignee
Guangdong Biolight Meditech 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 Guangdong Biolight Meditech Co Ltd filed Critical Guangdong Biolight Meditech Co Ltd
Priority to CN202310633230.0A priority Critical patent/CN116755735A/en
Publication of CN116755735A publication Critical patent/CN116755735A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The application provides an embedded software online upgrading method, an embedded software online upgrading device, a peritoneal dialysis instrument and a storage medium, wherein the method comprises the following steps: when an online upgrade instruction is obtained under the running state of the app firmware, writing a self-defined identification code into a standby register, and erasing an interrupt vector table of the MCU; running boot firmware by executing a soft reset instruction, and starting an online upgrading flow of the app firmware when the boot firmware detects that the register information is matched with the self-defined identification code or when the boot firmware detects that the register information is not matched with the self-defined identification code and verification information recorded in an interrupt vector table is not checked; when the app firmware finishes upgrading, the verification information of the interrupt vector table is updated according to the target image obtained by upgrading the app firmware. According to the technical scheme provided by the embodiment of the application, after the MCU is powered off and powered on again, verification information verification through the interrupt vector table is not completed through characterization upgrading, and online upgrading is triggered again, so that the robustness of an online upgrading function is improved, and the maintenance cost is reduced.

Description

Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium
Technical Field
The application relates to the technical field of medical instrument upgrading, in particular to an embedded software online upgrading method, an embedded software online upgrading device, a peritoneal dialysis instrument and a storage medium.
Background
Peritoneal dialysis machines are common medical devices that require updating of firmware on the device MCU after delivery of the device, possibly due to customer change needs or urgent repair problems. Because the equipment is complex, a user may not have a condition to disassemble the machine to connect with the burner matched with the original MCU factory, the industry common practice is to design an online upgrading function in the MCU firmware of the peritoneal dialysis machine, so that the firmware can control the MCU to acquire new firmware from an available communication interface and then burn the new firmware into the Flash inside the MCU, thereby achieving the purpose of updating the MCU firmware.
The firmware is upgraded mainly through writing open source software, the open source software only solves basic problems such as firmware transmission and burning, but abnormal conditions such as unexpected power failure and the like in the burning process can exist, the firmware in the MCU is damaged, even if the MCU is powered on again, the firmware can jump to the damaged firmware to cause system breakdown, the embedded system cannot normally run again, if equipment is returned to a factory for maintenance, the maintenance cost of the peritoneal dialysis instrument is greatly increased, the time consumption is long, no equipment is available for a medical institution during maintenance, and the medical care of a patient is affected.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides an embedded software online upgrading method, an embedded software online upgrading device, a peritoneal dialysis instrument and a storage medium, which can re-execute online upgrading after re-electrifying under the condition that power failure occurs in MCU firmware upgrading, thereby improving the reliability of the MCU firmware online upgrading function and reducing the maintenance cost of the peritoneal dialysis instrument.
In a first aspect, an embodiment of the present application provides an online upgrade method for embedded software, applied to an MCU of a peritoneal dialysis apparatus, where the MCU is pre-deployed with embedded firmware, the embedded firmware includes boot firmware and app firmware, and the online upgrade method for embedded software includes:
when an online upgrade instruction is acquired under the running state of the app firmware, writing a current custom identification code of the app firmware into a standby register of the MCU, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware;
running boot firmware by executing a soft reset instruction, wherein the boot firmware reads register information of the standby register, and the boot firmware records the self-defined identification code;
when the boot firmware detects that the register information is matched with the self-defined identification code, starting an online upgrading process of the app firmware;
when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded by the interrupt vector table is not verified, starting an online upgrading flow of the app firmware;
and when the app firmware finishes upgrading, updating the verification information of the interrupt vector table according to a target image obtained by upgrading the app firmware.
According to some embodiments of the application, the boot firmware and the app firmware are stored in a flash memory of the MCU, and a storage location of the boot firmware is located before the app firmware.
According to some embodiments of the application, the peritoneal dialysis machine is communicatively connected to a development device, and the online upgrade procedure of the app firmware comprises:
acquiring an upgrade link sent by the development equipment, wherein the upgrade link is used for indicating an access address of an upgrade file;
compiling the upgrade link through the app firmware to obtain the target image;
and writing the target image into the flash memory of the MCU.
According to some embodiments of the application, the verification information includes the custom identification code, an image length, and an image verification code, and the updating the verification information of the reserved area according to a target image obtained by updating the app firmware includes:
writing the self-defined identification code and the mirror image length of the target mirror image into the interrupt vector table;
and generating the mirror image check code, and writing the mirror image check code into a storage area of the target mirror image in the flash memory.
According to some embodiments of the application, the checking that the checking information recorded in the interrupt vector table is not passed includes at least one of:
the content recorded by the interrupt vector table is 0;
the user-defined identification code recorded by the interrupt vector table is not matched with the user-defined identification code recorded by the boot firmware;
the mirror image length represents an abnormal range;
the mirror check code recorded by the interrupt vector table is inconsistent with the mirror check code stored in the flash memory.
In a second aspect, an embodiment of the present application further provides an online upgrade apparatus for embedded software, which is applied to an MCU of a peritoneal dialysis apparatus, where the MCU is pre-deployed with embedded firmware, the embedded firmware includes boot firmware and app firmware, and the online upgrade apparatus for embedded software includes:
the upgrade preparation unit is used for writing the current custom identification code of the app firmware into a standby register of the MCU when an online upgrade instruction is acquired under the condition that the app firmware is in an operating state, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware;
the information acquisition unit is used for running boot firmware by executing a soft reset instruction, and the boot firmware reads the register information of the standby register, wherein the boot firmware records the self-defined identification code;
the first upgrading unit is used for starting an online upgrading process of the app firmware when the boot firmware detects that the register information is matched with the custom identification code;
the second upgrading unit is used for starting an online upgrading flow of the app firmware when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded by the interrupt vector table is not verified;
and the updating unit is used for updating the verification information of the interrupt vector table according to the target image obtained by updating the app firmware when the app firmware finishes updating.
According to some embodiments of the application, the peritoneal dialysis apparatus is communicatively connected to a development device, and the embedded software online upgrade apparatus further comprises:
the link acquisition unit is used for acquiring an upgrade link sent by the development equipment, wherein the upgrade link is used for indicating an access address of an upgrade file;
the image acquisition unit is used for compiling the upgrade link through the app firmware to obtain the target image;
and the image storage unit is used for writing the target image into the flash memory of the MCU.
According to some embodiments of the application, the verification information includes the custom identification code, a mirror length, and a mirror verification code, and the updating unit further includes:
the first writing unit is used for writing the self-defined identification code and the mirror image length of the target mirror image into the interrupt vector table;
and the second writing unit is used for generating the mirror image check code and writing the mirror image check code into a storage area of the target mirror image in the flash memory.
In a third aspect, embodiments of the present application provide a peritoneal dialysis machine comprising at least one control processor and a memory for communication with the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform the embedded software online upgrade method as described in the first aspect above.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium storing computer executable instructions for performing the embedded software online upgrade method according to the first aspect.
The online upgrading method of the embedded software has at least the following beneficial effects: when an online upgrade instruction is acquired under the running state of the app firmware, writing a current custom identification code of the app firmware into a standby register of the MCU, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware; running boot firmware by executing a soft reset instruction, wherein the boot firmware reads register information of the standby register, and the boot firmware records the self-defined identification code; when the boot firmware detects that the register information is matched with the self-defined identification code, starting an online upgrading process of the app firmware; when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded by the interrupt vector table is not verified, starting an online upgrading flow of the app firmware; and when the app firmware finishes upgrading, updating the verification information of the interrupt vector table according to a target image obtained by upgrading the app firmware. According to the technical scheme provided by the embodiment of the application, after the MCU is powered off and powered on again, verification information verification through the interrupt vector table is not completed through characterization upgrading, so that online upgrading is triggered again, the robustness of the online upgrading function of the MCU firmware is improved, and the maintenance cost of the peritoneal dialysis instrument is reduced.
Drawings
FIG. 1 is a flow chart of an online upgrade method for embedded software according to one embodiment of the present application;
FIG. 2 is a flow chart for obtaining a target image provided by another embodiment of the present application;
FIG. 3 is a flow chart of updating verification information provided by another embodiment of the present application;
FIG. 4 is a block diagram of an online upgrade apparatus for embedded software according to another embodiment of the present application;
fig. 5 is a block diagram of a peritoneal dialysis machine according to another embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
In the description of the present application, it should be understood that references to orientation descriptions such as upper, lower, front, rear, left, right, etc. are based on the orientation or positional relationship shown in the drawings, are merely for convenience of description of the present application and to simplify the description, and do not indicate or imply that the apparatus or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present application.
In the description of the present application, a number means one or more, a number means two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and above, below, within, etc. are understood to include the present number. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present application, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present application can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical scheme.
The embodiment of the application provides an online upgrade method, device, equipment and storage medium for embedded software, wherein the online upgrade method for the embedded software comprises the following steps: when an online upgrade instruction is acquired under the running state of the app firmware, writing a current custom identification code of the app firmware into a standby register of the MCU, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware; running boot firmware by executing a soft reset instruction, wherein the boot firmware reads register information of the standby register, and the boot firmware records the self-defined identification code; when the boot firmware detects that the register information is matched with the self-defined identification code, starting an online upgrading process of the app firmware; when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded by the interrupt vector table is not verified, starting an online upgrading flow of the app firmware; and when the app firmware finishes upgrading, updating the verification information of the interrupt vector table according to a target image obtained by upgrading the app firmware. According to the technical scheme provided by the embodiment of the application, after the MCU is powered off and powered on again, verification information verification through the interrupt vector table is not completed through characterization upgrading, so that online upgrading is triggered again, the robustness of the online upgrading function of the MCU firmware is improved, and the maintenance cost of the peritoneal dialysis instrument is reduced.
The control method of the embodiment of the application is further described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of an online upgrade method of embedded software, provided by an embodiment of the present application, where the method is applied to an MCU of a peritoneal dialysis apparatus, the MCU is pre-deployed with embedded firmware, the embedded firmware includes boot firmware and app firmware, and the online upgrade method of embedded software includes:
s11, when an online upgrade instruction is obtained under the running state of the app firmware, writing a current custom identification code of the app firmware into a standby register of the MCU, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware;
s12, running boot firmware by executing a soft reset instruction, wherein the boot firmware reads register information of a standby register, and a self-defined identification code is recorded in the boot firmware;
s13, when the boot firmware detects that the register information is matched with the self-defined identification code, starting an online upgrading process of the app firmware;
s14, when the boot firmware detects that the register information is not matched with the self-defined identification code and the verification information recorded in the interrupt vector table is not verified, starting an online upgrading process of the app firmware;
s15, when the app firmware is updated, the verification information of the interrupt vector table is updated according to the target image obtained by updating the app firmware.
It should be noted that, the value of the standby register is reset to zero after the upgrade is completed, the upgrade fails, the upgrade is interrupted, and the power is turned off and is turned on again, in this embodiment, an online upgrade instruction is obtained when the app is running, a user-defined identification code of app firmware is written into the standby register, when the register information read by the boot firmware is matched with the user-defined identification code, it is determined that the online upgrade function can be normally operated, when the register information is not matched with the user-defined identification code, it is determined that the standby register is set to zero due to the occurrence of faults such as power failure, and further verification is required to be performed on the verification information of the interrupt vector table, and in this embodiment, the user-defined identification code is used as a judgment of whether the online upgrade is normally executed, so that the upgrade efficiency can be effectively improved.
It should be noted that, the custom identification code of this embodiment adopts a specific identification code scheme with a word length, and the comparison adopts a flag bit scheme, so that it can be avoided that the spare register may have misjudgment under the condition of occurrence of a random value, so that the app online upgrade function is started by mistake, for example, if it is simply judged with 0 and 1 whether the upgrade is required, the spare register may have 1 randomly, so that the online upgrade is started by mistake, the custom identification code may adopt a specific identification code with a length of 4 bytes, and the specific form may be adjusted according to actual requirements.
It should be noted that, in the interrupt vector table of the MCU, for example, in the MCU based on Cortex-M3, the space of addresses 0x1C to 0x2B in the user Flash is reserved, and in this embodiment, the reserved area of the interrupt vector table is used to store verification information as a criterion for completing the upgrade, based on which, when the upgrade is started, the content of the interrupt vector table needs to be erased to avoid erroneous recognition.
It should be noted that, after the MCU finishes upgrading, the verification information may be written by calculating through an external tool, for example, after the app firmware finishes compiling the link to generate the intermediate image, the external tool calculates the verification information, and writes the intermediate image and the verification information as the target image, thereby finishing the upgrading. Therefore, the verification information is written after the upgrade is completed, when the power is turned off in the upgrade process, the content of the standby register is set to zero, boot firmware can certainly judge that the self-defined identification code is not matched with the register information, the verification information can be used for verification at the moment, when the verification is passed, the upgrade is completed, a subsequent business process is executed, when the verification is not passed, the upgrade fault can be determined to occur, so that the equipment can be restarted for online upgrade after the power is turned off and the power is turned on again, and the robustness of the upgrade is ensured.
It should be noted that, after the upgrade is completed, the boot firmware will match the register information of the spare register when restarting, and check the check information after unsuccessful match, because the upgrade is completed and the check information is updated, the check will pass, and at this time, the execution business process of the app firmware is skipped to ensure the normal operation of the peritoneal dialysis machine.
In addition, in an embodiment, boot firmware and app firmware are stored in the flash memory of the MCU, and the storage location of the boot firmware is located before the app firmware.
It should be noted that, the embedded firmware may be burned into the peritoneal dialysis apparatus after being developed by an external development tool, which may be a common OpenBL or OpenBLT, etc., and this embodiment is not limited thereto. During the burning, the boot firmware and the app firmware are burned to the peritoneal dialysis apparatus at the same time, the firmware can be stored in a flash memory (flash) of the MCU, for example, the front 16kb of the flash is allocated to the boot firmware, the remaining space is allocated to the app firmware, and a specific allocation mode can be adjusted according to the size of the firmware, so that the method is not limited.
It should be noted that, the custom identification code of the verification information can be adjusted according to different versions, for example, the update is performed once after each update is completed, so as to ensure that the update identification code written into the standby register can be accurately matched when the next update is performed.
Additionally, in one embodiment, the peritoneal dialysis machine is communicatively coupled to a development device, and referring to FIG. 2, the online upgrade process of the app firmware includes, but is not limited to, the steps of:
s21, acquiring an upgrade link sent by the development equipment, wherein the upgrade link is used for indicating an access address of an upgrade file;
s22, compiling an upgrade link through the app firmware to obtain a target image;
s23, writing the target mirror image into the flash memory of the MCU.
It should be noted that, the development device may be OpenBL or OpenBLT as described above, and compile the upgrade link to obtain the target image, that is, there is a binary file whose content corresponds to the content of the flash memory in the MCU, but the target image can only implement the service function, and the upgrade robustness of the embodiment needs to rely on the verification of the custom identification code and the verification information, so that on the basis of obtaining the target image, the embodiment also needs to determine the verification information based on the target image, and write the target image and the verification information into the flash memory at the same time to complete the upgrade operation.
In addition, in an embodiment, the verification information includes a custom identification code, a mirror length, and a mirror verification code, referring to fig. 3, step S15 shown in fig. 1 further includes, but is not limited to, the following steps:
s31, writing the self-defined identification code and the mirror image length of the target mirror image into an interrupt vector table;
s32, generating a mirror image check code, and writing the mirror image check code into a storage area of the target mirror image in the flash memory.
It should be noted that, in order to erase and update the initial image, the storage position of the initial image in the flash memory needs to be known, based on this, in this embodiment, by recording the image length and the image check code in the check information, based on the description of the foregoing embodiment, the first 16kb of the flash is used to store boot firmware, the remaining space is app firmware, and in the case that the number of bytes of the custom identification code is known, the storage start position of the initial image is also known, and then the storage end position can be determined based on subtracting 1 from the image length, thereby implementing positioning of the initial image. For example, the verification information stored in the reserved area is defined in the present embodiment with reference to the following table 1:
table 1: check information schematic table
It should be noted that, after the initial image is erased, the starting position of the writing of the target image may be determined to be the storage starting position, but the lengths of the target images may be different, so that the lengths of the images in the verification information need to be updated again after writing, so as to ensure that the storage area of the image can be determined at the next upgrade.
It should be noted that the check code may be a CRC32 check code, and the remaining positions of the storage space are filled, so that verification can be performed after the upgrade is interrupted and the power is turned on again.
In addition, in an embodiment, the checking information recorded in the interrupt vector table is not checked, including at least one of the following:
the content recorded in the interrupt vector table is 0;
the user-defined identification code recorded in the interrupt vector table is not matched with the user-defined identification code recorded in the boot firmware;
the mirror image length represents an abnormal range;
the mirror check code recorded by the interrupt vector table is inconsistent with the mirror check code stored in the flash memory.
It should be noted that, according to the description of the above embodiment, after the power is turned off and turned on again, the spare register is set to zero, but the interrupt vector table is updated after the upgrade is completed, so after the register information is detected to be not matched with the custom identification code, the check information can be checked, so as to determine whether the upgrade is completed.
For example, since the interrupt vector table is erased at the beginning of the upgrade and written after the upgrade is completed, if the content recorded in the interrupt vector table is 0, it can be determined that the upgrade is not completed and new verification information is not written yet, so that the upgrade process can be re-entered.
For example, the mismatching of the custom identification code recorded in the interrupt vector table and the custom identification code recorded in the boot firmware record and the characterization of the image length represent the abnormal range, which may be that an interrupt occurs during the process of writing verification information or an error occurs in the app firmware obtained by upgrading, so that the upgrade process can be re-entered when the situation is detected, and the accuracy of the upgraded firmware is ensured.
For example, since the storage area of the target image stores the image check code, for example, a CRC32 check code covering the end of the images 0x0 to 0x1B and 0x2C may be calculated, and checked to see whether the CRC32 check code is consistent with the check code read from the addresses 0x24 to 0x27, and if the check information is inconsistent, the upgrade is restarted, and if the check information is consistent, the upgrade is determined to be completed, and the subsequent operation process is executed.
In addition, the embodiment of the application also provides an online upgrade device of embedded software, which is applied to an MCU of a peritoneal dialysis apparatus, wherein the MCU is pre-deployed with embedded firmware, the embedded firmware comprises boot firmware and app firmware, and referring to fig. 4, the online upgrade device of the embedded software comprises:
an upgrade preparation unit 410, configured to, when an online upgrade instruction is obtained while the app firmware is in an operating state, write a current custom identification code of the app firmware into a standby register of the MCU, and erase an interrupt vector table of the MCU, where the interrupt vector table is used to store verification information of the app firmware;
the information obtaining unit 420 is configured to execute boot firmware by executing a soft reset instruction, where the boot firmware records a custom identification code, and reads register information of a standby register;
the first upgrade unit 430 is configured to start an online upgrade process of the app firmware when the boot firmware detects that the register information matches with the custom identification code;
the second upgrading unit 440 is configured to start an online upgrading process of the app firmware when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded in the interrupt vector table is not checked;
and the updating unit 450 is configured to update the verification information of the interrupt vector table according to the target image obtained by updating the app firmware when the app firmware finishes updating.
Additionally, in an embodiment, the peritoneal dialysis machine is communicatively coupled to the development device, and referring to fig. 4, further comprising:
a link acquiring unit 461, configured to acquire an upgrade link sent by the development device, where the upgrade link is used to indicate an access address of the upgrade file;
an image obtaining unit 462, configured to compile the upgrade link through the app firmware to obtain a target image;
the image storing unit 463 is configured to write the target image into the flash memory of the MCU.
In addition, in an embodiment, referring to fig. 4, the updating unit 450 further includes, but is not limited to, the following:
a first writing unit 451, configured to write the custom identifier and the mirror length of the target mirror into the interrupt vector table;
the second writing unit 452 is configured to generate a mirror check code, and write the mirror check code into a storage area of the target mirror in the flash memory.
As shown in fig. 5, fig. 5 is a block diagram of a peritoneal dialysis machine according to one embodiment of the present application. The application also provides a peritoneal dialysis machine comprising:
the processor 501 may be implemented by a general purpose central processing unit (Central Processing Unit, CPU), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing related programs to implement the technical scheme provided by the embodiments of the present application;
the Memory 502 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). The memory 502 may store an operating system and other application programs, and when the technical solution provided in the embodiments of the present disclosure is implemented by software or firmware, relevant program codes are stored in the memory 502, and the processor 501 invokes an online upgrade method for embedded software to execute the embodiments of the present disclosure;
an input/output interface 503 for implementing information input and output;
the communication interface 504 is configured to implement communication interaction between the device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
bus 505 that transfers information between the various components of the device (e.g., processor 501, memory 502, input/output interface 503, and communication interface 504);
wherein the processor 501, the memory 502, the input/output interface 503 and the communication interface 504 enable a communication connection between each other inside the device via the bus 505.
The embodiment of the application also provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program realizes the embedded software online upgrading method when being executed by a processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The apparatus embodiments described above are merely illustrative, in which the elements illustrated as separate components may or may not be physically separate, implemented to reside in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and may include any information delivery media.
While the preferred embodiment of the present application has been described in detail, the present application is not limited to the above embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit and scope of the present application, and these equivalent modifications or substitutions are included in the scope of the present application as defined in the appended claims.

Claims (10)

1. The on-line upgrading method of the embedded software is characterized by being applied to an MCU of a peritoneal dialysis instrument, wherein the MCU is pre-deployed with embedded firmware, the embedded firmware comprises boot firmware and app firmware, and the on-line upgrading method of the embedded software comprises the following steps:
when an online upgrade instruction is acquired under the running state of the app firmware, writing a current custom identification code of the app firmware into a standby register of the MCU, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware;
running boot firmware by executing a soft reset instruction, wherein the boot firmware reads register information of the standby register, and the boot firmware records the self-defined identification code;
when the boot firmware detects that the register information is matched with the self-defined identification code, starting an online upgrading process of the app firmware;
when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded by the interrupt vector table is not verified, starting an online upgrading flow of the app firmware;
and when the app firmware finishes upgrading, updating the verification information of the interrupt vector table according to a target image obtained by upgrading the app firmware.
2. The method for online upgrading embedded software according to claim 1, wherein the boot firmware and the app firmware are stored in a flash memory of the MCU, and a storage location of the boot firmware is located before the app firmware.
3. The method for online upgrade of embedded software according to claim 1, wherein the peritoneal dialysis machine is in communication connection with a development device, and the online upgrade process of the app firmware comprises:
acquiring an upgrade link sent by the development equipment, wherein the upgrade link is used for indicating an access address of an upgrade file;
compiling the upgrade link through the app firmware to obtain the target image;
and writing the target image into the flash memory of the MCU.
4. The method for online upgrade of embedded software according to claim 3, wherein the verification information includes the custom identification code, a mirror length, and a mirror verification code, and the updating the verification information of the reserved area according to a target mirror obtained by upgrading the app firmware includes:
writing the self-defined identification code and the mirror image length of the target mirror image into the interrupt vector table;
and generating the mirror image check code, and writing the mirror image check code into a storage area of the target mirror image in the flash memory.
5. The method for online upgrade of embedded software according to claim 4, wherein the checking that the check information recorded in the interrupt vector table is not passed comprises at least one of:
the content recorded by the interrupt vector table is 0;
the user-defined identification code recorded by the interrupt vector table is not matched with the user-defined identification code recorded by the boot firmware;
the mirror image length represents an abnormal range;
the mirror check code recorded by the interrupt vector table is inconsistent with the mirror check code stored in the flash memory.
6. An embedded software online upgrading device, which is characterized in that the MCU applied to a peritoneal dialysis instrument is pre-deployed with embedded firmware, wherein the embedded firmware comprises boot firmware and app firmware, and the embedded software online upgrading device comprises:
the upgrade preparation unit is used for writing the current custom identification code of the app firmware into a standby register of the MCU when an online upgrade instruction is acquired under the condition that the app firmware is in an operating state, and erasing an interrupt vector table of the MCU, wherein the interrupt vector table is used for storing verification information of the app firmware;
the information acquisition unit is used for running boot firmware by executing a soft reset instruction, and the boot firmware reads the register information of the standby register, wherein the boot firmware records the self-defined identification code;
the first upgrading unit is used for starting an online upgrading process of the app firmware when the boot firmware detects that the register information is matched with the custom identification code;
the second upgrading unit is used for starting an online upgrading flow of the app firmware when the boot firmware detects that the register information is not matched with the custom identification code and the verification information recorded by the interrupt vector table is not verified;
and the updating unit is used for updating the verification information of the interrupt vector table according to the target image obtained by updating the app firmware when the app firmware finishes updating.
7. The embedded software online upgrade apparatus of claim 6, wherein the peritoneal dialysis machine is communicatively connected to a development device, the embedded software online upgrade apparatus further comprising:
the link acquisition unit is used for acquiring an upgrade link sent by the development equipment, wherein the upgrade link is used for indicating an access address of an upgrade file;
the image acquisition unit is used for compiling the upgrade link through the app firmware to obtain the target image;
and the image storage unit is used for writing the target image into the flash memory of the MCU.
8. The embedded software online upgrade apparatus of claim 7, wherein the verification information includes the custom identification code, a mirror length, and a mirror verification code, and the update unit further includes:
the first writing unit is used for writing the self-defined identification code and the mirror image length of the target mirror image into the interrupt vector table;
and the second writing unit is used for generating the mirror image check code and writing the mirror image check code into a storage area of the target mirror image in the flash memory.
9. A peritoneal dialysis machine comprising at least one control processor and a memory for communication with the at least one control processor; the memory stores instructions executable by the at least one control processor to enable the at least one control processor to perform the embedded software online upgrade method of any one of claims 1 to 5.
10. A computer-readable storage medium storing computer-executable instructions for causing a computer to perform the embedded software online upgrade method of any one of claims 1 to 5.
CN202310633230.0A 2023-05-30 2023-05-30 Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium Pending CN116755735A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310633230.0A CN116755735A (en) 2023-05-30 2023-05-30 Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310633230.0A CN116755735A (en) 2023-05-30 2023-05-30 Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium

Publications (1)

Publication Number Publication Date
CN116755735A true CN116755735A (en) 2023-09-15

Family

ID=87950565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310633230.0A Pending CN116755735A (en) 2023-05-30 2023-05-30 Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium

Country Status (1)

Country Link
CN (1) CN116755735A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117880789A (en) * 2024-03-13 2024-04-12 四川九通智路科技有限公司 Bluetooth-based remote information upgrading method for Internet of things on-vehicle dimming system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117880789A (en) * 2024-03-13 2024-04-12 四川九通智路科技有限公司 Bluetooth-based remote information upgrading method for Internet of things on-vehicle dimming system
CN117880789B (en) * 2024-03-13 2024-05-03 四川九通智路科技有限公司 Bluetooth-based remote information upgrading method for Internet of things on-vehicle dimming system

Similar Documents

Publication Publication Date Title
CN106569847B (en) Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network
CN107179909B (en) Software upgrading method and device and computer readable storage medium
US8595716B2 (en) Failsafe firmware updates
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
US11995427B2 (en) Method, apparatus, device, and storage medium for upgrading vehicle-mounted Tbox
CN110928559B (en) Data burning method and device, electronic equipment and storage medium
CN112732310B (en) Firmware upgrading method, system, equipment and medium based on embedded guide partition
CN109416629A (en) Firmware upgrade method, electronic equipment, camera system and unmanned vehicle
CN116755735A (en) Online upgrading method and device for embedded software, peritoneal dialysis instrument and storage medium
CN109766140A (en) A kind of localization method and device that set-top box starting is abnormal
CN113641390B (en) System upgrading method, device, equipment and storage medium
CN112015447A (en) System updating method and device for electronic equipment, electronic equipment and storage medium
CN114895845A (en) EMmC data storage control method and embedded mainboard
CN114443175A (en) Startup configuration method for missile-borne FPGA online upgrade
CN107479924B (en) Software upgrading verification method based on Android system
CN111459496B (en) Method for generating tamper-proof program file and method for upgrading equipment
CN111352764B (en) Chip repairing method, device, equipment and storage medium
CN117608627A (en) Method for upgrading firmware, electronic device and storage medium
US7490321B2 (en) Method for updating firmware via determining program code
CN117235707A (en) Application program starting method and device, electronic equipment and storage medium
CN112835601A (en) Firmware updating method, device, equipment and storage medium
CN114625399A (en) System upgrading method and related device, equipment and storage medium
CN115686946A (en) Firmware updating method, firmware updating device and vehicle
CN112908390B (en) Data storage method, device, electronic equipment and storage medium
CN115481405A (en) Safe starting and optimized upgrading method of embedded system

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