WO2019105211A1 - Electronic device and program updating method therefor - Google Patents

Electronic device and program updating method therefor Download PDF

Info

Publication number
WO2019105211A1
WO2019105211A1 PCT/CN2018/114972 CN2018114972W WO2019105211A1 WO 2019105211 A1 WO2019105211 A1 WO 2019105211A1 CN 2018114972 W CN2018114972 W CN 2018114972W WO 2019105211 A1 WO2019105211 A1 WO 2019105211A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
module
program
control module
communication module
Prior art date
Application number
PCT/CN2018/114972
Other languages
French (fr)
Chinese (zh)
Inventor
杨德中
胡钊
王东玥
王洋
Original Assignee
南京德朔实业有限公司
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 南京德朔实业有限公司 filed Critical 南京德朔实业有限公司
Priority to CN201880003939.XA priority Critical patent/CN110192321B/en
Publication of WO2019105211A1 publication Critical patent/WO2019105211A1/en
Priority to US16/887,584 priority patent/US11029941B2/en
Priority to US17/335,807 priority patent/US20210286612A1/en
Priority to US18/085,903 priority patent/US20230127497A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Definitions

  • the present disclosure relates to an electronic device and a program update method of the electronic device.
  • the upgrade file may be interrupted or the program update is suddenly interrupted due to some reasons (for example, power failure, network disconnection, etc.), resulting in incomplete upgrade or updated program.
  • This incomplete and defective program can make the charging device, the power tool and the portable power supply not work properly, and there is a safety hazard, which is likely to cause a safety accident.
  • an object of the present disclosure is to provide an electronic device with a program update that is convenient, fast, safe, and reliable, and a program update method for the electronic device.
  • An electronic device comprising: a housing; at least one adapter interface formed on a surface of the housing for detachably mounting one or more battery packs to the at least one adapter interface, wherein The battery pack can be used for a handheld power tool or a garden tool; a control module that programmably controls an operation process of the electronic device; wherein the electronic device further includes a communication module, the communication module includes: a wireless communication unit, For wirelessly communicating with an external device to receive an upgrade file from the external device; and a storage unit for storing the upgrade file from the external device; the upgrade file includes an upgrade to update the program of the control module a program; the communication module is configured to: receive, by the wireless communication unit, the upgrade file of an external device and store the upgrade file in the storage unit; and send the upgrade file when a preset condition is met The control module is updated to the program of the control module.
  • the preset condition includes the communication module receiving an upgrade request from the control module.
  • the upgrade file includes a program end identifier
  • the control module sends the upgrade request to the communication module when the program end identifier is not received.
  • the preset condition includes the communication module receiving an upgrade request from an external device.
  • the electronic device is a portable power supply device
  • the portable power supply device further includes an inverter module
  • the inverter module includes an inverter
  • the inverter is configured to convert the direct current outputted by the battery pack into an alternating current
  • the inverter module is electrically connected to the control module and at least partially receives control of the main control module.
  • the portable power supply device further includes a data bus, the control module and the inverter module are connected to the communication module through the data bus; the communication module is configured to: receive an external device through the wireless communication unit And storing the upgrade file in the storage unit; sending the upgrade file to the control module and/or the inverter module through the data bus; the upgrade file includes the control module and/or the The upgrade program of the program of the inverter module is updated.
  • control module and the inverter module have unique identifiers.
  • the upgrade file contains a unique identifier of the control module and/or the inverter module.
  • the wireless communication unit includes a WIFI module and/or a Bluetooth module.
  • control module includes a storage unit that stores a first partial program and a second partial program, the first partial program being executable by the control module to update the second partial program.
  • the electronic device is a battery pack or a power tool that uses the battery pack or a charging device that charges the battery pack.
  • a program updating method suitable for an electronic device as described above comprising: the communication module receiving an upgrade file from an external device through the wireless communication unit and storing the upgrade file in the storage unit; The communication module sends the upgrade file to the control module, and the control module updates its own program according to the upgrade file.
  • the communication module when the communication module receives an upgrade request from the control module, the communication module sends the upgrade file to the control module.
  • the upgrade file includes a program end identifier
  • the control module sends the upgrade request to the communication module when the program end identifier is not received.
  • the communication module when the communication module receives an upgrade request from an external device, the communication module sends the upgrade file to the control module.
  • Another program updating method suitable for an electronic device as described above comprising: the communication module receiving an upgrade file from an external device through the wireless communication unit and storing the upgrade file in the storage unit; And the communication module sends an upgrade instruction to the data bus; the control module and the inverter module stop working after receiving the upgrade instruction from the data bus, and enter a listening state; the control module And the inverter module determines whether the upgrade instruction is an upgrade instruction corresponding to itself, if yes, enters an upgrade mode, and if not, continues to maintain a listening state; and one of the control module and the inverter module determines that it is for itself Sending an upgrade response to the data bus after the upgrade command; after receiving the upgrade response from the data bus, the communication module sends the upgrade file through the data bus to the end corresponding to sending the upgrade response a control module or an inverter module; after the control module or the inverter module receives the upgrade file, according to the Level file update their program.
  • the communication module when the communication module receives an upgrade request from the control module or the inverter module, the communication module sends an upgrade command to the data bus.
  • the upgrade file includes a program end identifier
  • the control module or the inverter module sends the upgrade request to the communication module when the program end identifier is not received.
  • the communication module when the communication module receives an upgrade request from an external device, the communication module sends an upgrade instruction to the data bus.
  • control module and the inverter module have a unique identifier
  • the upgrade instruction includes a unique identifier of the control module and/or the inverter module; and the control module and the inverter module determine the upgrade instruction by determining Whether the unique identifier in the match matches its own unique identifier, and if so, it is determined to be an upgrade instruction for itself.
  • control module and the inverter module have a unique identifier, and the upgrade response includes the unique identifier.
  • the program updating method further includes: after receiving the upgrade response, the communication module sends an upgrade key to the unique identifier according to the unique identifier included in the upgrade response.
  • the matching control module or the inverter module, the control module or the inverter module matching the unique identifier enters a program update process after receiving the upgrade key.
  • the communication module sends the upgrade file to the control module and the inverter module in a preset order.
  • program updating method further includes: after the self-program update is completed, the control module or the inverter module sends an upgrade end feedback to the communication module; the control module does not receive the control module and the When the upgrade of the inverter module is finished, the communication module sends an upgrade command to the data bus.
  • the utility model has the advantages that the electronic device of the present disclosure and the program updating method thereof do not need to be disassembled and installed, reduce manpower and material resources, are convenient and fast, and the electronic device program runs safely and reliably.
  • FIG. 1 is a perspective structural view of a portable power source device, a battery pack, and a power tool;
  • FIG. 2 is a network diagram of information interaction between a portable power source device and an external device
  • FIG. 3 is an internal circuit schematic diagram of a portable power supply device
  • FIG. 4 is a schematic diagram of allocation of internal program storage area of a storage unit
  • Figure 5 is an information exchange process between the communication module and the main control module
  • FIG. 6 is a workflow diagram of a communication module upgrading an entire node connected thereto
  • FIG. 8 is a specific wiring diagram of a communication module, a main control module, and an inverter module;
  • FIG. 9 is a working flow chart of a software module performing software update on a main control module and an inverter module;
  • Figure 10 is a schematic view showing the internal structure of the upgrading device and the power tool
  • FIG. 11 is an information interaction between the upgrading apparatus and the power tool shown in FIG. 10 in an upgrade mode
  • Figure 12 is a schematic view showing the internal structure of the upgrading device and the battery pack
  • FIG. 13 is an information interaction between the upgrading apparatus and the battery pack shown in FIG. 10 in the upgrade mode
  • FIG. 14 is a schematic diagram of the principle of a timeout retransmission mechanism.
  • the present disclosure provides an electronic device including: a housing; at least one adapter interface formed on a surface of the housing for detachably mounting one or more battery packs to the at least one adapter interface,
  • the battery pack can be used for a handheld power tool or a garden tool;
  • a control module that can programmatically control an operation of the electronic device;
  • the electronic device further includes a communication module, the communication module includes:
  • the communication module is configured to: receive, by the wireless communication unit, the upgrade file of the external device and store the upgrade file in the storage unit; Sending the upgrade file to the control module to update the program of the control module.
  • the electronic device of the present disclosure is mainly applied to the field of battery packs and power tools, including but not limited to a portable power supply device 100 capable of adapting the battery pack 100, a battery pack 200, a power tool 300 powered by the battery pack, and a battery pack. 200 charging device.
  • a portable power supply device 100 capable of adapting the battery pack 100
  • a battery pack 200 capable of adapting the battery pack 100
  • a power tool 300 powered by the battery pack
  • a battery pack. 200 charging device a battery pack. 200 charging device.
  • the electronic device of the present disclosure will be described below by taking the portable power source device 100 as an example.
  • the portable power supply device 100 includes an adapter 110 having at least one adapter interface 111 formed on a surface of the housing for detachably mounting one or more battery packs 200 to the chassis. At least one adapter interface 111 is described, wherein the battery pack 111 is for a hand-held power tool or a garden tool.
  • the battery pack 200 can obtain electrical energy from the adaptation interface 111.
  • the plurality of battery packs 200 may be separately connected to the adapter interface 111 or may be simultaneously connected to the adapter interface 111.
  • the adapter interface 111 is formed with a portion that can be fitted to the joint of the battery pack 200 to enable the battery pack 200 to be detachably coupled to the adapter interface 111.
  • the adapter 110 also includes an inverter and a rectifier.
  • the inverter can convert the direct current outputted by the battery pack 200 connected to the adapter 110 into alternating current; the rectifier can convert the alternating current that the adapter 110 is connected into the direct current that can charge the battery pack 200.
  • Both the inverter and the rectifier are constituted by respective circuit boards and circuit components, and circuit boards and circuit components constituting the inverter and the rectifier are housed in a housing formed by the housing of the portable power supply device 100.
  • Adapter 110 also includes an AC input interface that enables adapter 110 to be connected to AC power in the grid.
  • the AC input interface can be constructed as a power plug 115 as shown in FIG.
  • the adapter 110 can charge the connected battery pack 200 through the connected alternating current; as a specific solution, the alternating current input interface is electrically connected to the rectifier, so that the alternating current input from the alternating current input interface is changed to direct current so that the battery pack 200 is charged.
  • the adapter 110 also includes an AC output interface that can be used to output AC power to enable the portable power device 100 to function as an AC power source.
  • the power source of the AC output interface may be the power stored in the battery pack 200 to which the adapter 110 is connected, or the power of the AC grid introduced by the adapter 110 from the AC input interface.
  • the AC output interface can be constructed in the form of a power outlet 112 as in Figure 1 to enable the portable power unit 100 to power a typical AC powered device.
  • the adapter 110 can use the battery pack 200 power to which it is connected and output AC power through the AC output interface.
  • the AC output interface is at least electrically connected to the inverter.
  • the direct current from the battery pack 200 is changed to an alternating current through the inverter and then output to the alternating current output interface.
  • the adapter 110 also includes a direct current output interface for causing the adapter 110 to output direct current.
  • the DC output interface can be configured as a 5V USB interface 113 as shown in FIG. 1, or can be configured as a 12V vehicle power interface 114 as shown in FIG. 1; of course, the DC output interface can also be constructed. In other forms, other voltages such as 19V, 36V are output.
  • the adapter 110 can also include a DC input interface for connecting the adapter 110 to DC power.
  • the adapter 110 can charge the battery pack 200 from the direct current that is external to its battery pack 200, and can also be used by other electrical consumers.
  • the user can use the battery of the automobile to connect to the DC input interface through the DC input interface, thereby charging the battery pack 200 connected to the adapter 110.
  • the user can use the DC output interface of the adapter 110 to charge the battery of the automobile to solve the automobile.
  • the DC input interface can also be constructed as a USB interface 114 or a 12V interface 114 as shown in FIG.
  • the portable power supply device 100 can be connected to a plurality of battery packs 200, which can be either the battery pack 200 having the same rated voltage or the battery pack 200 having a different rated voltage; the adapter 110 can enable one of the batteries to have a higher voltage or/and a lower amount of power.
  • the battery pack 200 is another battery pack 200 having a lower voltage or/and a power; of course, the adapter 110, through its internal circuitry, causes the battery pack 200 having a lower voltage or/and power to have a higher voltage or / and charge the battery pack 200.
  • the battery pack 200 includes a battery cell and a housing.
  • the cells are housed in a housing for storing energy that can be repeatedly charged and discharged.
  • the housing is for accommodating the battery cells and other components in the battery pack 200, and the housing is formed with a joint through which the battery pack 200 can be coupled to one power tool 300.
  • the battery pack 200 further includes a plurality of electrode connection terminals for at least electrically connecting the battery cells to external circuits. For example, it is electrically connected to a charging circuit in a circuit or a charger for driving the motor in the power tool 300.
  • the battery pack 200 also includes other types of connection terminals, such as communication terminals for establishing communication with the outside, temperature signal terminals for identifying or transmitting temperature signals, which may also be multiplexed in some cases for transmitting other signals. .
  • the battery pack 200 can also include a circuit board, a controller, and some corresponding detectors.
  • the circuit board is mainly used to construct the circuit in the battery pack 200.
  • the controller mainly controls the battery pack 200.
  • the detector is mainly used to detect some electrical parameters and physical parameters of the battery pack 200, such as the current and voltage of the battery pack 200 or The temperature inside the battery pack 200, and the like.
  • the circuit board, the controller, and the detector constitute a circuit that allows the battery pack 200 to have over-discharge protection or overcharge protection to prevent over-discharge or over-charging, and to enable the battery pack 200 to be wired with other external devices. Or wireless communication.
  • the battery pack 200 can provide electrical power to the DC power tool 300.
  • the battery pack 200 is detachably connected to the DC power tool 300 for powering it.
  • the DC power tool 300 includes an electrical device.
  • the electric device can include a motor.
  • the DC power tool 300 can be a hand-held power tool 300, a garden power tool 300, etc., and the power tool 300 includes but is not limited to an electric drill, an electric wrench, an electric screwdriver, an electric hammer, an impact drill, an electric planer, a lawn mower, a lawn mower, etc. .
  • the portable power supply device 100 further includes a communication module 120, and the communication module 120 includes a wireless communication unit 121 for establishing a communication connection with an external device, and can transmit data information and receive to the remote server 20 or the mobile terminal device 21. Data information of the remote server 20 or the mobile terminal device 21.
  • the wireless communication unit 121 is used to wirelessly communicate the adapter 110 with other adapters 110 or other wireless communication devices.
  • the wireless communication unit 121 can be a wireless router as a local area network, which can directly access the Internet to enable other wireless communication devices in the local area network to access the Internet, and can also communicate with the wireless communication device. Accessing the wireless communication device of the Internet to enable other wireless communication devices in the local area network to access the Internet.
  • the wireless communication unit 121 can also implement data interaction only for each wireless communication device in the local area network.
  • the wireless communication device can adopt Bluetooth and WiFi. , NFC, ZigBee and other ways to achieve wireless communication.
  • the wireless communication unit 121 includes a Bluetooth module 1212 and a WIFI module 1211, and can perform wireless communication with the remote server 20 and the mobile terminal device 21 through Bluetooth and WIFI at the same time.
  • the wireless communication unit 121 also includes one of a Bluetooth module 1212 and a WIFI module 1211.
  • the portable power supply device 100 can upload the data information to the remote server 20 by means of the WIFI module 1211 in the communication module 120, or send the data information to the mobile terminal device 21 via the Bluetooth module 1212.
  • the terminal device 21 may upload the data information received by the portable power supply device 100 to the remote server 20 after being processed or not processed; the data information of the remote server 20 may be sent to the portable power device 100 by means of WIFI, or may be transmitted through the mobile terminal device.
  • 21 is sent to the portable power supply device 100 in a Bluetooth manner; the mobile terminal device 21 can remotely transmit the control command to the portable power supply device 100 in the WIFI manner through the remote server 20, or directly send the control command to the portable power source through the Bluetooth mode.
  • Device 100
  • the portable power supply device 100, the battery pack 200, and the power tool 300 powered by the battery pack 200 constitute a portable power system, and the portable power system further includes the mobile terminal device 21 and the remote server 20.
  • the mobile terminal device 21 can be an electronic device such as a mobile phone, a dedicated handheld device, or a tablet computer.
  • the portable power supply device 100 includes a communication module 120, a main control module 132, and an inverter module 131.
  • the portable power supply device 100 further includes a battery pack coordination main module 133 and at least one battery pack coordination sub-module 134.
  • the communication module 120 includes a wireless communication unit 121 for wirelessly communicating with an external device (eg, the remote server 20, the mobile terminal device 21, etc.) to receive information from the external device, such as upgrade instructions, upgrade files, and other data.
  • the wireless communication unit 121 includes a Bluetooth module 1212 and a WIFI module 1211, and a storage unit 122 for storing files from an external device, for example, an upgrade file, the upgrade file includes a portable power source.
  • the program of one or more modules in the device 100 performs an updated upgrade procedure, which enables the portable power supply device 100 to use the upgrade file stored in the storage unit 122 for the portable power supply device 100 in the case of disconnection.
  • One or more modules for program updates are examples of program updates.
  • the communication module 120 is configured to receive the upgrade file of the external device through the wireless communication unit 121 and store the upgrade file in the storage unit 122; the upgrade can be sent under a preset condition
  • the file is transferred to one or more modules in the portable power supply unit 100, such as the main control module 132 and/or the inverter module 131, to update the program, such as the main control module and/or the inverter module.
  • the storage unit 122 may also store other data information sent by the external device or data information uploaded by the portable power supply device 100 that needs to be uploaded to the external device (for example, the portable power supply device 100 and/or the battery pack 200 and/or Status data of the power tool 300, etc.).
  • the portable power supply device 100 further includes a distribution network unit 123 for selecting a communication mode (for example, WIFI mode or Bluetooth mode) to communicate with an external device.
  • the communication module 120 further includes a communication port for communicating with other modules (eg, the main control module 132 and the inverter module 131) inside the portable power supply device 100; and a verification module for verifying The received data information is correct.
  • the portable power supply device 100 also includes a data bus to which the main control module 132 and the inverter module 131 are connected.
  • the data bus is coupled to the communication module 120 via a communication port, and the master module 132 and the inverter module 131 are coupled to the communication module 120 via the data bus.
  • the communication module 120 is configured to receive an upgrade file of the external device through the wireless communication unit 121, and send the upgrade file to the main control module 132 and/or the inverter module 131 through the data bus;
  • the upgrade file includes an upgrade program for updating the program of the main control module 132 and/or an upgrade program for updating the program of the inverter module 131.
  • the upgrade file contains a unique identifier of the master module 132 and/or the inverter module 131.
  • the main control module 132 serves as a control module of the portable power supply device 100 for programmably controlling the operation of the portable power supply device 100 and managing the operation of the entire portable power supply device 100.
  • the main control module 132 can receive the external device command through the communication module 120 and execute the corresponding process in response to the instruction, and the main control module 132 can also control the portable power supply device 100 according to the situation in the portable power supply device 100.
  • the main control module 132 is electrically connected to the battery pack coordination main module 133, and the battery pack coordination main module 133 is used to coordinately manage the plurality of battery pack coordination sub-modules 134.
  • the battery pack coordination main module 133 is connected to the communication module 120 for uploading the collected data information to the communication module 120; the inverter module 131 includes an inverter for using the battery The DC power outputted by the packet 200 is converted into AC power; the inverter module 131 is electrically connected to the main control module 132, and at least partially accepts the management of the main control module 132 in the working mode, and in the upgrade mode, passes through the The data bus is connected to the communication module 120 in parallel with the main control module 132, and is managed by the communication module 120 to complete the program update.
  • the main control module 132 and the inverter module 131 have a unique identifier, and the main control module 132 and the inverter module 131 include a storage unit, and the storage unit stores the main control module 132 and the storage unit respectively.
  • the unique identifier of the inverter module 131 is not limited to one or more bits.
  • the main control module 132 and the inverter module 131 are connected to the communication module 120 through the data bus.
  • the battery pack coordination main module 133 and the plurality of battery pack coordination sub-modules 134 are connected by an I2C bus mode; the inverter module 131 is connected to the main control module 132 and the communication module 120.
  • the communication module 120 passes the data bus pair.
  • the software programs of the inverter module 131 and the main control module 132 are updated or upgraded.
  • the communication module 120 connects each module through a bus to upgrade the programs of the respective modules, and has the following advantages: high data transmission efficiency; good scalability of the bus system, which can increase or decrease the modules connected to the bus without affecting other modules. Program update process; simplified hardware design, easy to adopt modular structure design method; easy for fault diagnosis and maintenance, easy to find the faulty part.
  • a communication connection is established between the battery pack 200 and the battery pack coordination sub-module 134, and between the power tool 300 and the battery pack 200 by using serial communication.
  • the battery pack 200 has two physical interfaces, a battery pack first port 201 and a battery pack second port 202;
  • the power tool 300 has two physical interfaces, a tool second port 301 and a tool second port. 302; when the power tool 300 is connected to the battery pack 200, the battery pack first port 201 and the battery pack second port 202 are connected to the tool first port 301 and the tool second port 302, respectively.
  • the battery pack coordination sub-module 134 has a physical interface corresponding to the battery pack first port 201 and the battery pack second port 202 for establishing communication with the battery pack 200 for charging and discharging management or data transmission, when the battery pack 200 When connected to the battery pack 200 coordination sub-module, the battery pack first port 201 and the battery pack second port 202 are respectively connected to corresponding physical interfaces of the battery pack coordination sub-module 134.
  • the present disclosure provides a program updating method suitable for the above electronic device.
  • the portable power source device 100 will be described as an example. It should be noted that the following is merely illustrative of a portable power supply device as an electronic device, and does not constitute a limitation of the present disclosure.
  • a boot loader is applied to perform product program updates.
  • the boot loader (BOOTLOADER) is a microcontroller (Microcontroller Unit, hereinafter referred to as "MCU") that implements application changes to its own part of the flash memory to implement product firmware upgrade.
  • MCU Microcontroller Unit
  • program update can be performed by a boot loader.
  • firmware also known as firmware
  • firmware is a piece of software embedded in a hardware device. It is usually located in flash memory and can be updated by the user.
  • the first part of the program does not perform normal function operations, only receives external data and instructions by communication, and verifies the information of the second part of the program (whether complete, version information, etc.)
  • the second part of the program is updated, the first part of the program is the boot loader 401; the second part of the program is the corresponding product function code, that is, the application 402.
  • the main control module 132 and the inverter module 131 have a microcontroller, and the storage unit of the main control module 132 and the inverter module 131 stores a first partial program and a second partial program, the microcontroller It is configured to execute the first partial program to update the second partial program.
  • the portable power supply device 100 is not limited to only including the main control module 132 and the inverter module 131, and may also include other modules.
  • the other modules also include the first partial program and the second partial program, and the communication module 120 may also be used for other The module's program is updated or upgraded.
  • the flash memory 400 of the MCU allocates storage space to the boot loader 401 and the application 402 according to actual conditions. For example, the flash memory 400 allocates two storage spaces SA0 and SA1 to the boot loader 401, and allocates the SA2 storage area to the application 403.
  • the identity information 403 about the device can also be stored in the flash memory, and can be stored in the SA3 area. In some embodiments, the identity information includes a unique identifier for the device.
  • the boot loader 401 has a read/write program function, can read out data information stored in the flash memory 400, can also write data information into the memory, and can overwrite all applications stored in the flash memory 400, and then write new ones. program.
  • the boot loader 401 performs reading, writing, and/or erasing by invoking commands of some predetermined functions. For example, the read command "R” can be read out of the data information in the flash memory 400, and any one of the memory segments or all of the memory segments that can be erased by the erase command "E" is called.
  • the write command "W” is called to write data to any memory segment or all memory segments.
  • the boot loader 401 stores an executable program in the flash memory 400 of the MCU, a function capable of reading data in the flash memory 400 or writing data into the flash memory.
  • the original application can be replaced with the new application by writing the new application 402 to the application area by the boot loader 401.
  • the boot loader 401 and the application are both stored in the flash memory 4000 of the MCU, if the address of the program called by the MCU is incorrect, the MCU may execute the boot loader 401 erroneously.
  • an upgrade key which is used to open the program update to avoid the call program error, causing the electronic device software system to be disordered, affecting the normal operation of the electronic device, or even damage. Electronic devices or cause a safety accident.
  • the battery pack 200, the electric power tool 300, the portable power source device 100, the electronic device such as the battery pack charging device, and the like can be updated and upgraded by applying the boot loader.
  • a method of updating the power tool 300, the battery pack 200, and the portable power source device 100 by the boot loader 401 will be described using the portable power system as an example.
  • Embodiment 1 Program update through a data bus.
  • the upper computer connects the MCUs of the plurality of modules through the bus, and the upper computer functions as an upgrade scheduling module to selectively update the program of any one or more modules mounted on the data bus by using a bus scheduling manner.
  • each module is referred to as a node 502.
  • the first node is called node 1
  • the second node is called node 2
  • the Nth node is called node N.
  • the portable power source device 100 will be described as an example.
  • the upgrade scheduling module is the communication module 120
  • the node may be any module connected to the communication module 120 through a data bus, such as the inverter module 131 and the main control module 132.
  • the portable power supply device 100 will be taken as an example to specifically describe a process in which the communication module 120 performs program update on the main control module 132 and/or the inverter module 131.
  • the communication module 120 updates the program of the main control module 132.
  • the communication module 120 is configured to receive the upgrade file of the external device through the wireless communication unit 121 and store the upgrade file in the storage unit 122;
  • the upgrade file is updated to the control module to update the program of the control module.
  • the control module is the main control module 132.
  • a program update method suitable for the above electronic device comprising:
  • the communication module 120 receives an upgrade file from the external device through the wireless communication unit 121 and stores the upgrade file in the storage unit;
  • the communication module 120 sends the upgrade file to the main control module 132 when the preset condition is met; the main control module 132 updates its own program according to the upgrade file.
  • the electronic device is a portable power supply device 100.
  • the preset condition includes the communication module 120 receiving an upgrade request from the main control module 132.
  • the upgrade file includes a program end identifier, and the main control module 132 sends the upgrade request to the communication module 120 when the program end identifier is not received.
  • the program end identifier is located at the end of the upgrade program in the upgrade file. If the main control module 132 receives the program end identifier, it indicates that the upgrade program in the received upgrade file is complete, and the main control module 132 can use the The upgrade file performs its own program update. Conversely, if the main control module 132 does not receive the program end identifier, it indicates that the upgrade program in the received upgrade file is incomplete.
  • the The software system is disordered, affecting the normal operation of the electronic device, or even damaging the electronic device or causing a safety accident. Since the electronic device in the present disclosure is in the field of battery packs and power tools, it requires high safety and reliability of the device, and therefore, in order to prevent the received incomplete upgrade files and upgrade programs from affecting the electronic device, The present disclosure sets a preset condition, and when the main control module 132 does not receive the program end identifier in the upgrade file, sends the upgrade request to the communication module 120, and the communication module 120 is stored in the storage unit 122. The upgrade file is sent to the main control module 132, so that the main control module 132 can update its own program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correct updated program, and the electronic device operation and the program update process are more secure and reliable.
  • the preset condition may further be that the communication module 120 receives an upgrade request from an external device.
  • the remote server 20 or the mobile terminal device 21 transmits an upgrade request to the communication module 120 of the portable power supply device 100 to update the program of at least one of the portable power sources 100.
  • the present disclosure also provides a program update method applicable to the above electronic device, including:
  • the communication module 120 receives an upgrade file from the external device through the wireless communication unit 121 and stores the upgrade file in the storage unit;
  • the communication module 120 sends the upgrade file to the main control module 132 when the preset condition is met; the main control module 132 updates its own program according to the upgrade file.
  • the electronic device is a portable power supply device 100.
  • the communication module 120 when the communication module 120 receives an upgrade request from the main control module 132, the communication module 120 sends the upgrade file to the main control module 132.
  • the upgrade file includes a program end identifier
  • the main control module 132 sends the upgrade request to the communication module 120 when the program end identifier is not received.
  • the program end identifier is located at the end of the upgrade program in the upgrade file. If the main control module 132 receives the program end identifier, it indicates that the upgrade program in the received upgrade file is complete, and the main control module 132 can use the The upgrade file performs its own program update. Conversely, if the main control module 132 does not receive the program end identifier, it indicates that the upgrade program in the received upgrade file is incomplete. If the upgrade file is used for program update, the The software system is disordered, affecting the normal operation of the electronic device, or even damaging the electronic device or causing a safety accident.
  • the present disclosure sets a preset condition, and when the main control module 132 does not receive the program end identifier in the upgrade file, sends the upgrade request to the communication module 120, and the communication module 120 is stored in the storage unit 122.
  • the upgrade file is sent to the main control module 132, so that the main control module 132 can update its own program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correct updated program, and the electronic device operation and the program update process are more secure and reliable. .
  • the communication module 120 when the communication module 120 receives an upgrade request from an external device, the communication module 120 sends the upgrade file to the main control module 132.
  • the communication module 120 sends the upgrade file to the main control module 132 over the data bus.
  • the communication module 120 can also send the upgrade file to the main control module 132 through the normal data line.
  • the communication module 120 updates the program of the main control module 132, and the specific process is as follows:
  • the communication module 120 sends the upgrade command to the main control module 132;
  • the communication module 120 has received an upgrade file from the external device through the wireless communication unit 121 and stores the upgrade file in the storage unit 122.
  • the communication module 120 simultaneously receives an upgrade request and an upgrade file from the external device through the wireless communication unit 121, and sends an upgrade instruction to the main control module 132 in response to the upgrade request.
  • the main control module 132 does not receive the program end identifier, that is, when the upgrade file in the upgrade file received by the main control module 132 is incomplete, the upgrade is actively sent to the communication module 120.
  • the communication module 120 sends an upgrade instruction to the main control module 132 in response to the upgrade request.
  • the main control module 132 sends an upgrade response to the communication module 120;
  • the main control module 132 After receiving the upgrade command, the main control module 132 stops the original work and determines whether it is its own upgrade command. If yes, if it is, it enters the upgrade mode, and if not, continues to maintain the monitor state.
  • the communication module 120 sends the upgrade file to the main control module 132 or the inverter module 131 through the data bus, and the inverter module 131 performs the same work. That is, the inverter module 132 receives the upgrade command from the data bus, stops the original operation, and determines whether it is its own upgrade command. If yes, if it is, it enters the upgrade mode, and if not, continues to maintain the monitor state. In this embodiment, the program is updated to the main control module 132. Therefore, the main control module 132 determines that it is an upgrade command for itself, and enters the upgrade mode, and the inverter module 131 continues to maintain the listening state.
  • the listening state here can be understood as the standby state, which means that the node stops the current work and monitors whether there is an instruction on itself on the bus in real time.
  • the upgrade instruction includes identity information of the node, and the identity information of the node is a unique identifier that each node has different from other nodes.
  • the main control module 132 and the inversion module 131 determine whether the upgrade instruction is an upgrade instruction for itself by determining whether the unique identifier included in the upgrade instruction matches its own unique identifier. After the node determines that it is an upgrade command for itself, the upgrade response (including the unique identifier) is sent to the upgrade communication module 120 via the data bus.
  • the main control module 132 since it is a program update to the main control module 132, the main control module 132 determines that it is an upgrade instruction to itself, and then sends an upgrade response to the upgrade communication module 120 through the data bus.
  • the upgrade response includes the unique identifier of the master module 132.
  • the communication module 120 sends an upgrade key to the main control module 132 after receiving the upgrade response.
  • the communication module 120 sends an upgrade key to the main control module 132 or the inverter module 131 that matches the unique identifier according to the unique identifier included in the upgrade response, and matches the unique identifier.
  • the main control module 132 or the inverter module 131 feeds back the upgrade and enters the program update process.
  • the communication module 120 since it is a program update to the main control module 132, the communication module 120 transmits an upgrade key to the main control module 132 according to the unique identifier included in the upgrade response.
  • the boot loader 401 and the application are both stored in the flash memory 4000 of the MCU, if the address of the program called by the MCU is incorrect, the MCU may erroneously execute the boot loader 401.
  • the upgrade key is introduced to open the program update to avoid the error of the calling program, causing the electronic device software system to be disordered, affecting the normal operation of the electronic device, or even damaging the electronic device or causing a security accident.
  • the main control module 132 replies and confirms the upgrade to the communication module 120.
  • the communication module 120 sends the first upgrade data packet to the main control module 132.
  • the communication module 120 After receiving the confirmation upgrade information, the communication module 120 sends the upgrade file to the main control module 132 or the inverter module 131 corresponding to the upgrade response. In this embodiment, since it is a program update to the main control module 132, the communication module 120 transmits the upgrade file to the main control module 132 according to the unique identifier included in the upgrade response.
  • the communication module 120 divides the upgrade file into a plurality of upgrade data packets and numbers them, and then sends the upgrade data packets in the numbered order according to the upgrade data package to the main control module 132.
  • the communication module 120 first sends the first upgrade data packet to the main control module 132. After receiving the upgrade data packet, the main control module 132 confirms whether the received upgrade data packet is correct, and if correct, returns the correct information to the communication module 120. Specifically, it can be confirmed by the check digit whether the upgrade data packet is correct.
  • the communication module 120 sends a second upgrade data packet to the main control module 132.
  • the communication module 120 sends the second upgrade data packet to the main control module 132 according to the above method.
  • the main control module 132 After receiving the upgrade data packet, the main control module 132 confirms whether the received upgrade data packet is correct, and if correct, returns the correct information to the communication module 120.
  • the main control module 132 After receiving the upgrade file divided into a plurality of upgrade data packages, the main control module 132 updates its own program according to the upgrade file.
  • the main control module 132 sends an upgrade end feedback to the communication module 120.
  • the main control module 132 sends an upgrade end feedback to the communication module 120 after completing the update of the program according to the upgrade file, and the main control module 132 returns to the normal working state. If the communication module does not receive the upgrade end feedback, it indicates that the main control module has not completed the upgrade or the upgrade is unsuccessful. When the communication module 120 does not receive the upgrade control feedback of the main control module 132, the communication module 120 sends an upgrade command to the The main control module 132, in this way, the main control module 132 that has not completed the upgrade can update its own program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correctly updated program, and the electronic device operation and the program update process are more secure and reliable.
  • the above embodiment is only a process in which the communication module 120 updates the program of the main control module 132 through the data bus.
  • the program update process of the communication module 120 to the inverter module 131 and other modules through the data bus is similar to the above process. I will not repeat them here.
  • the above embodiment is only a program update process performed by the main control module 132.
  • the communication module 120 performs program updates on a plurality of or all of the nodes mounted on the data bus in a predetermined order.
  • the communication module 120 updates the programs of the main control module 132 and the inverter module, and the specific process is as follows:
  • the communication module 120 receives an upgrade file from an external device through the wireless communication unit 121 and stores the upgrade file in the storage unit 122;
  • the communication module 120 sends an upgrade instruction to the data bus when the preset condition is met;
  • the main control module 132 and the inverter module 131 After receiving the upgrade instruction from the data bus, the main control module 132 and the inverter module 131 stop working and enter a listening state;
  • the main control module 132 and the inversion module 131 determine whether the upgrade instruction is an upgrade instruction corresponding to itself, and if yes, enter an upgrade mode, and if not, continue to maintain the listening state;
  • One of the main control module 132 and the inverter module 131 determines to send an upgrade response to the data bus after upgrading the command;
  • the communication module 120 After receiving the upgrade response from the data bus, the communication module 120 sends the upgrade file to the main control module 132 or the inverter module 131 corresponding to the upgrade response by using the data bus;
  • the main control module 132 or the inverter module 131 updates its own program according to the upgrade file after receiving the upgrade file.
  • the preset conditions are as described above, and are not described herein again.
  • the communication module 120 when the communication module 120 receives an upgrade request from the main control module 132 or the inverter module 131, the communication module sends an upgrade instruction to the data bus.
  • the upgrade file includes a program end identifier, and the main control module 132 or the inverter module 131 sends the upgrade request to the communication module 120 when the program end identifier is not received. If the main control module 132 receives the program end identifier, it indicates that the upgrade program in the received upgrade file is complete, and the main control module 132 can use the upgrade file to perform its own program update.
  • variable module 131 does not receive the program end identifier, it indicates that the upgrade program in the received upgrade file is incomplete. If the upgrade file is used to update the program, the software system may be disordered, affecting the normal operation of the electronic device, or even being damaged. Electronic devices or cause a safety accident.
  • the present disclosure sets a preset condition, and sends the upgrade request to the communication module 120 when the main control module 132 or the inverter module 131 does not receive the program end identifier in the upgrade file, and the communication module 120 is stored in the
  • the upgrade file in the storage unit 122 is sent to the main control module 132 or the inverter module 131, so that the main control module 132 or the inverter module 131 can update the self program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correct updated program, and the program runs safely and reliably.
  • the communication module 120 When the communication module 120 receives an upgrade request from an external device, the communication module sends an upgrade instruction to the data bus.
  • the master module 132 and the inverter module 131 have unique identifiers, and the upgrade response includes the unique identifier.
  • the program update method further includes: after receiving the upgrade response, the communication module 120 sends an upgrade key to match the unique identifier according to the unique identifier included in the upgrade response.
  • the main control module 132 or the inverter module 131, the main control module 132 or the inverter module 131 matching the unique identifier enters the program update process after receiving the upgrade key. .
  • the communication module 120 sends the upgrade file to the main control module 132 and the inverter module 131 in a preset order.
  • the program update method further includes: after completing the self-program update, the main control module 132 or the inverter module 131 sends an upgrade end feedback to the communication module 120; the communication module 120 does not receive the main control When the upgrade of the module 132 and the inverter module 131 is ended, the communication module 120 sends an upgrade command to the data bus for forced upgrade.
  • the upgrade end feedback is sent to the communication device 120 after the upgrade of each module is completed.
  • the communication module 120 resends the upgrade command to the corresponding module. Active upgrade to avoid the electronic device system disorder caused by incomplete upgrade, affect the normal operation of the electronic device, or even damage the electronic device or cause a safety accident.
  • the upgrade end feedback is set.
  • the communication module 120 does not receive the upgrade end feedback of the main control module 132 and the inverter module 131, the communication module 120 sends an upgrade instruction to the data bus, so that the module that has not completed the upgrade can be utilized.
  • the re-received upgrade file updates its own program. In this way, the electronic device can be normally operated under the program that is correctly and completely updated, and the program operation is more secure and reliable.
  • FIG. 6 and FIG. 7 are processes in which the communication module 120 and each node operate in an upgrade mode.
  • the working process of the communication module 120 in the upgrade mode is as follows:
  • S61 save an upgrade file from an external device (for example, the remote server 20, the mobile terminal device 21);
  • the upgrade file includes a program end identifier
  • the node for example, (the main control module 132 or the inverter module 131) determines whether the program end identifier is received, and if not, actively sends an upgrade request to the node.
  • the communication module 120 is configured to actively request an update procedure. In this way, it is ensured that the received upgrade file is completely executable and safe and reliable, so that the electronic device can run safely and reliably after the program update ends, without causing the software system to be disordered after the program update due to the incomplete program. , affecting normal work and even bringing security incidents.
  • the node After receiving the upgrade end instruction, it may be verified whether there is an upgrade end identifier in the upgrade program received by the node, and if not, it indicates that the upgrade program received this time is abnormal (incomplete), then the node The node enters the forced upgrade mode, and the node sends an upgrade request to the communication module 120 (the preset condition is met), and the communication module 120 resends the upgrade instruction of the node, and re-upgrades the node.
  • the communication module 120 initiates an upgrade instruction to perform an upgrade process of the corresponding node, and in other embodiments, the node may perform a forced upgrade. In this mode, the node actively initiates an upgrade request (including node identity information). The communication module 120 enters the passive upgrade mode and upgrades the corresponding node.
  • the communication module 120 may cause an abnormality in the upgrade file received by the communication module 120 due to an abnormality (power failure or network disconnection), and the program update process may not be performed. Work properly.
  • the storage unit 122 of the communication module 120 of the present disclosure can retain the latest correct upgrade program and upgrade file, so that the upgrade file and the upgrade program can be called to complete the node upgrade when the program update is needed. In this embodiment, the communication is performed.
  • the storage unit 122 of the module 120 is used to store the latest correct upgrade program or upgrade file.
  • the upgrade process connected to each node of the communication module 120 is a closely coordinated node upgrade system. Since the electronic device of the present disclosure is applicable to the field of power tools and the field of battery packs, the safety and reliability of the electronic device are required to be high. Therefore, each node connected through the bus needs to enter the upgrade mode or the monitor state simultaneously, and exit the upgrade mode. In order to avoid the electronic device in the working mode, suddenly enter the upgrade mode-update program and may cause a security accident. For example, when the portable power supply device 100 outputs power to an external device (for example, a grill), the upgrade is suddenly started in a normal working state to cause the program to be updated, which may cause the output power or the working mode of the portable power source to suddenly change and cause an external device.
  • an external device for example, a grill
  • each node in the upgrade mode is as follows.
  • the node is a module connected to the communication module 120 by a bus.
  • the node may be connected to the communication module 120.
  • Each node receives an upgrade instruction of the communication module 120 from the data bus;
  • Each node determines whether it is an upgrade instruction to the local node, if yes, the process goes to step S74 to enter the upgrade mode, and if not, the process goes to step S72 to continue to maintain the listening state;
  • S75 Receive an upgrade key from the communication module 120, and confirm the upgrade
  • S76 Receive an upgrade data packet from the communication module 120 and verify whether the upgrade data packet is correct.
  • each node After receiving the upgrade end command, each node needs to check the received upgrade file. If the received program is found to be abnormal (for example, the program is incomplete), the node will actively send an upgrade request to the communication module 120 for active. After the upgrade, the communication module 120 resends the upgrade file to the node after receiving the upgrade request (the preset condition is met). After receiving the correct upgrade file that is split into multiple upgrade data packages, the main control module 132 updates its own program according to the upgrade file. After completing the self-program update, each node sends an upgrade end feedback to the communication module 120. When the communication module 120 does not receive the upgrade end feedback of the node, the communication module 120 sends an upgrade instruction to the data bus to re-program the program for the node whose program update is unsuccessful.
  • the communication module 120 After receiving the upgrade end command, each node needs to check the received upgrade file. If the received program is found to be abnormal (for example, the program is incomplete), the node will actively send an upgrade request to the communication module 120 for active. After
  • step S78 determining whether it is a full node upgrade end command, if yes, then go to step S79, if not, then go to the next node, then go to step S73;
  • the data communication format transmitted to the bus includes a unique identifier of the target node, for example, an address or an SN sequence number, which is a unique identifier different from other nodes.
  • the upgrade process or program update process is made more secure by matching the unique identifier of the upgrade or program update object.
  • the communication module 120 takes the main control module 132 and the inverter module 131 of the portable power supply device 100 as an example, and describes a method in which the communication module 120 sequentially updates each node through the data bus.
  • the upgrade file containing the upgrade program is stored in the remote server 20, and the remote server 20 can directly send the upgrade file to the communication module 120 by means of WIFI, or send or copy the upgrade file to the mobile terminal device 21 (ipad, mobile phone, etc.).
  • the upgrade file is then transmitted to the communication module 120 via the mobile terminal device 21 via Bluetooth.
  • the process in which the remote server 20 directly sends the upgrade file to the communication module 120 for program update by means of WIFI is as follows: when it is required to update the program of the portable power supply device 100, the remote server 20 sends the upgrade prompt information to the user mobile APP. The user selects the upgrade, and after receiving the user upgrade command, the remote server 20 sends the upgrade file to the communication module 120 through the WIFI mode, and the communication module 120 acts as a master module 132 and is mounted on the data bus in a scheduling manner through the data bus.
  • the inverter module 131 performs program update.
  • the communication module 120 sends an upgrade instruction to the main control module 132 and the inverter module 131 to the data bus.
  • Each module detects that there is an upgrade instruction on the bus, stops all current operations, and detects whether the upgrade instruction is an upgrade instruction to the node. If not, then continue to monitor, and if so, enter upgrade mode.
  • the communication module 120 upgrades the main control module 132 and the inverter module 131 in a preset order, and the method of upgrading or updating the program is as described above, and details are not described herein again.
  • the program update open condition has three ways: First, the communication module 120 upgrades the module that needs to be upgraded after receiving the upgrade file and the upgrade request of the remote server; second, the communication module 120 is After receiving the upgrade request of each module (the preset condition is met), the module that needs to be upgraded is upgraded, and the method is that the module actively requests the program update; and third, the communication module 120 starts the program after confirming by the user on the mobile terminal device. Update process.
  • the data bus is an RS485 bus
  • the communication module 120 is connected to the main control module 132 and the inverter module 131 as an upper computer through an RS485 bus.
  • the specific wiring manner is as follows: in the normal working mode, the receiving pin RXD and the transmitting pin TXD of the serial port of the main control module 132 are all enabled, and the serial port of the inverter module 131 is in the listening state, that is, the receiving pin.
  • the TXD pin is in the normal I/O input state; in the upgrade mode, after receiving the corresponding node upgrade command of the bus, the corresponding node enters the enable state, that is, the receiving pin RXD and the sending of the corresponding node's serial port.
  • the pin TXD is in the enabled state, while the other module is in the listening state, and resumes the normal working state after the upgrade is completed.
  • the communication module 120 performs program update on the main control module 132 and the inverter module 131 through the RS485 bus in a preset order, and more specifically performs firmware upgrade.
  • the communication module 120 sends the upgrade file to the main control module 132 and the inverter module 131 in a preset order to update the main control module 132 and the inverter module 131.
  • the specific process of the communication module 120 updating the programs of the main control module 132 and the inverter module 131 in the order of the re-inversion module 131 of the pre-master module 132 is as follows:
  • S91 The main control module 132 and the inverter module 131 are in a normal working mode.
  • the serial port of the main control module 132 is in the transceiving enable state, that is, the receiving pin RXD and the transmitting pin TXD of the serial port of the main control module 132 are all enabled; the serial port of the inverter module 131 is in the listening state, that is, the inverter module 131 The receiving pin RXD is enabled, and the transmitting pin TXD is in the normal I/O input state;
  • the communication module 120 checks whether an upgrade command is received, and if yes, proceeds to S93, and if not, proceeds to step S91.
  • the communication module 120 sends the upgrade instruction in a preset order.
  • the communication module 120 first sends the upgrade command of the main control module 132 to upgrade the main control module 132 first;
  • the main control module 132 enters the upgrade mode, the serial port of the main control module 132 is in the transceiver enable state, and the inverter module 131 is in the monitoring state.
  • the main control module 132 and the inverter module 131 first determine whether it is an upgrade instruction for itself, and if so, enter an upgrade mode, and if not, enter the monitoring mode. status. In this embodiment, since the main control module 132 is upgraded first, the main control module 132 first enters the upgrade mode.
  • the communication module 120 sends an upgrade instruction of the inverter module 131 to upgrade the inverter module 131.
  • the inverter module 131 enters the upgrade mode, and the main control module 132 enters the monitoring state, and the serial port of the inverter module 131 is in the transmitting and receiving state.
  • the communication module 120 sends all the node upgrade completion instructions, and the upgrade is completed, and the system returns to the normal working state.
  • the communication module 120 sends an upgrade file to upgrade the main control module 132. After the upgrade of the main control module 132, the communication module 120 sends a node upgrade end instruction thereto, and the main control module 132 sends an upgrade end feedback and updates according to the received upgrade file. The self program then sends an upgrade end feedback to the communication module 120. Then, the communication module 120 performs program upgrade on the inverter module 131 of the next node in the same manner. After the upgrade of the inverter module 131 is completed, the communication module 120 sends a node upgrade end instruction to the inverter module, and the inverter module is completed according to the upgrade file. After the update of the self program, the upgrade end feedback is sent, and the communication module 120 broadcasts all the upgrade end instructions to the data bus.
  • each node After each node detects all the upgrade end instructions on the bus, the normal operation is resumed, and the upgrade is completed.
  • each node executes a first part of the program (ie, the boot loader) to update the second part of the program (ie, the application) using the new program (included in the upgrade package described above) in the received upgrade file.
  • the electronic device includes: at least one adapter interface disposed on a surface of the housing of the electronic device for detachably mounting the one or more battery packs to at least An adapter interface, wherein the battery pack is for a hand-held power tool or a garden tool; the control module is programmable to control an operation process of the electronic device; wherein the electronic device further includes a communication module and a data line, and the communication module includes a wireless communication unit And a storage unit, configured to store an upgrade file of the external device, the communication module configured to receive the upgrade file of the external device through the wireless communication unit, and send the upgrade file to the control module through the data line; the data line connection control module and the communication The module is configured to transmit data between the control module and the wireless communication unit; the communication module sends the upgrade file to the control module when the preset condition is met.
  • the communication module includes a storage unit configured to store at least an upgrade file from the external device.
  • the wireless communication unit includes a WIFI module and/or a Bluetooth module.
  • control module includes a main control module and an inverter module.
  • the main control module and the inverter module have a unique identifier
  • the upgrade file includes a unique identifier of the main control module and/or the inverter module.
  • a program updating method suitable for the above electronic device comprising: the communication module receives an upgrade request and an upgrade file from an external device through a wireless communication unit and saves the upgrade file in a storage unit; and under the preset condition of the group, the communication The module sends an upgrade instruction to the control module through the data line; the control module sends the upgrade response to the communication module through the data line after receiving the upgrade instruction through the data line; after receiving the upgrade response, the communication module sends the upgrade file to the control module through the data line; The module updates its own program based on the upgrade file.
  • the upgrade file includes a program end identifier
  • the control module determines whether the program end identifier is received. If not, the upgrade request is actively sent to the communication module to actively request the update program.
  • control module includes a main control module and an inverter module
  • communication module updates the programs of the main control module and the inverter module according to a preset sequence.
  • the electronic device updating program of the present disclosure does not need to be disassembled and installed, reduces manpower and material resources, is convenient and fast, and is safe and reliable in operation.
  • Embodiment 2 Program update is performed by using the upgrading apparatus 500.
  • the communication mode between the existing power tool 300 and the battery pack 200 is single-line communication, and has a corresponding communication protocol for discharging management of the battery pack 200.
  • the power tool 300 can be program-updated in accordance with the method of the above-described update procedure, and the wireless communication unit 121 is mounted on the communication line to transmit the program information through a predetermined communication protocol, thereby realizing the update and upgrade of the battery pack 200 or the tool program.
  • an upgrade device 500 for connecting the power tool 300 or the battery pack 200 to the power tool 300 or the battery pack 200 can be designed.
  • the upgrading apparatus 500 previously stores an upgrade file of the power tool 300 or the battery pack 200, and has a communication port that communicates with the power tool 300 or the communication port of the battery pack 200.
  • the upgrade device 500 is connected to the power tool 300 or the battery pack 200, a communication connection is established through the respective communication ports, and the upgrade file in the upgrade device 500 is transmitted to the power tool or the battery pack 200 according to a predetermined communication protocol.
  • the power tool 300 can be any type of power tool including, but not limited to, electric drills, electric hammers, screwdrivers, impact drills, electric circular saw jigsaws, reciprocating saws, band saws, electric scissors, sanders, angle grinders, lamps, lasers. , nail guns, etc.
  • the power tool 300 has a microcontroller 303 (hereinafter referred to as "MCU").
  • the MCU 303 includes a flash memory 306.
  • the flash 306 stores a tool application 308, a tool boot loader 307, and identity information 309 of the power tool 300.
  • the flash memory 306 can have a plurality of storage areas including an area for storing the application 308, an area for storing the boot loader 307, and an area for storing the identity information 309 of the power tool 300. The above storage area can be read out or erased or rewritten.
  • the application 308 operates in an operational mode for controlling the operation of the power tool 300, such as controlling the rotational speed of the motor, controlling the motor to start in a set manner, and the like.
  • the boot loader 306 runs in an upgrade mode for updating at least a portion of the application.
  • a device is required to import the new application into the flash memory of the power tool 300 to update and/or upgrade the application 308 in the flash memory 306.
  • the device is a dedicated device for upgrading the power tool 300 program, hereinafter referred to as an upgrade device 500.
  • the upgrading apparatus 500 includes an MCU 501 including a storage unit 502 for storing data or programs, a data reading unit 503 for reading data, and for verifying whether the power tool 300 is A verification unit 504 that matches information such as the upgrade device 500.
  • the upgrade apparatus 500 also includes a display module 505 for human-machine interface display, and the display module 505 can display the remaining time or progress of the upgrade.
  • the upgrade device 500 also has an interface unit 508 for connecting to an external storage device 509.
  • the external storage device 509 may be a removable memory card, a memory chip or a memory, such as a TF card, a USB flash drive, or the like, or may be another device that can be connected to the upgrade device 500 by wire or wirelessly, such as a PC or the like.
  • the external storage device 509 stores the latest application for updating one or more of the power tools 300, which may partially or completely cover the old applications in the power tool 300.
  • the upgrading apparatus 500 obtains the latest application for the one or more power tools 300 stored by the external storage device 509 through the interface unit 508 and stores it in the storage unit 502 to upgrade the software programs of the different power tools 300.
  • the upgrade device 500 has a communication interface for connection to the power tool 300.
  • the communication interface is used by the microcontroller of the power tool 300 to establish communication with the upgrade device 500 to complete the program update of the power tool 300.
  • the MCU 303 of the power tool 300 can transmit information to the external device through the communication interface, for example, the power tool MCU 303 transmits the identity information of the power tool 300, etc. to the upgrading apparatus 500 through the communication interface.
  • the MCU 303 of the power tool can also receive the signal of the upgrade device 500 through the communication interface, and perform a response process based on the signal, for example, the MCU 303 receives the signal of the upgrade device 500, and decides whether to enter the work mode or the upgrade mode.
  • the communication interface can be a dedicated signal port (eg, a data port) or a multiplexed shared terminal (eg, a temperature signal port).
  • the communication interface can be a single port or a multi-port. To simplify the program, two ports can be used for communication.
  • the power tool 300 has two physical interfaces - a tool first port 301 and a tool second port 302.
  • the upgrading device 500 has an upgraded first port 506 and an upgraded second port 507 corresponding thereto, respectively for
  • the tool first port 301 of the power tool 300 is coupled to the tool second port 302.
  • the tool first port 301 is used to establish communication between the power tool 300 and the battery pack 200
  • the tool second port 302 is used to transport the battery pack 200. Temperature signal or identify battery pack 200 properties.
  • the tool first port 301 is used to identify the upgrade device 500, which maintains the original communication function, the communication protocol, and the communication content.
  • the tool second port 302 is multiplexed, which is used to establish communication between the power tool 300 and the upgrading apparatus 500, and receive and transmit data information during the upgrade process.
  • the power tool 300 identifies whether the external device inserted into the power tool 300 is the battery pack 200 or the upgrade device 500 by identifying whether the voltage of the tool first port 301 is a high voltage or a low voltage, such as when external When the device is inserted into the power tool 300, the voltage of the tool first port 301 is pulled low, and the power tool 300 recognizes that the external device is the upgrading device 500.
  • the power tool 300 After the power tool 300 recognizes that the external device is the upgrade device 500, it enters the upgrade mode.
  • the power tool MCU 303 executes a boot loader 307 to perform a program update process. Since the upgrade device 500 stores one or more latest programs for program update of different power tools 300, when the program is updated for the specific power tool 300, it is necessary to select the corresponding latest program. To this end, the identity information 309 representing the power tool 300 and/or the upgrade device 500 may be stored in the flash memory 306 of the MCU 303 of the power tool 300 in advance, and the representative power tool 300 and/or the storage device in the storage unit of the upgrade device 500 may also be stored.
  • the identity information of the device 500 is upgraded so that the power tool 300 and the upgrade device 500 can be properly matched before the old application 308 of the power tool 300 is rewritten to prevent an update program error, resulting in the power tool 300 not operating properly after the program update.
  • the upgrading apparatus 500 has a verification unit 501 each having a verification unit 305.
  • the verification unit 504 of the upgrade apparatus 500 is configured to verify the identity information of the power tool 300, and the verification unit of the power tool 300 is used to verify whether the data in the data transmission is correct, whether the program is complete, or the like. The identity information of the upgrade device 500 is verified.
  • the boot loader 307 needs to write a new program in the upgrade device 500 into the storage area of the application 308 of the power tool 300.
  • the data packets of the new application may be large, and cannot be transferred in one time.
  • the data packet of the new application can be split into multiple small data packets, which is convenient for multiple transmissions.
  • the packet sequence may be disordered, resulting in incorrect new programs being written.
  • the data packets may be numbered, and at the time of data transmission, the number is verified to ensure that the data packets are sequentially written to the corresponding areas of the flash memory 306 of the power tool 300 in order.
  • the power tool 300 and the upgrading apparatus 500 transmit the data information involved in the upgrade process by upgrading the second port 507 and the tool second port 302, including an upgrade instruction, an upgrade end instruction, a feedback reply, an upgrade data packet, and the like.
  • the power tool 300 executes the application 308 in the flash memory 306, and the boot loader 307 is also stored in the flash memory 306. If the address of the program called by the MCU 303 is incorrect, the MCU 303 may be executed incorrectly.
  • the boot loader 307 such that the working power tool 300 is not working properly, may even pose a security risk. To solve this problem, it can be solved by introducing an upgrade key, which is used to instruct the application to upgrade.
  • an upgrade key is sent to the MCU 303 of the power tool 300.
  • the MCU 303 confirms that it is an upgrade command of the application, and then executes the boot loader 306.
  • the software program of the power tool 300 is updated.
  • the MCU 303 of the power tool 300 will only start executing the boot loader 307 after receiving the upgrade key sent by the upgrade apparatus 500, otherwise the boot loader 307 will not be executed. In this way, it can be ensured that the boot loader 307 is executed only when a finer program is required, and is not executed in the power tool 300 operating mode to ensure the safety of the power tool 300.
  • the upgrading apparatus 500 needs to acquire the latest program stored by the external storage device through the interface unit 508 and store it in its own storage unit 502. Then, the user connects the upgrade device 500 to the electric worker 300 that needs to be upgraded, the tool first port 301 and the upgrade first port 506 establish a connection, and the tool second port 302 and the upgrade second port 507 establish a connection.
  • the tool first port 301 voltage is pulled low
  • the power tool 300 detects that the tool first port 301 is at a low voltage
  • the power tool 300 enters the upgrade mode.
  • the upgrade device 500 and the power tool 300 exchange information through the tool second port 302 and the upgrade second port 507.
  • the upgrade device 500 can be connected thereto to perform the power tool 300. Program update.
  • the power tool 300 detects that the tool first port 301 is a low voltage signal and enters an upgrade mode.
  • the power tool 300 returns its identity information to the upgrading apparatus 500, ready to be upgraded;
  • the upgrade device 500 verifies the identity information of the power tool 300, determines whether to upgrade, and if it can be upgraded, sends an upgrade key to the power tool 300;
  • the upgrading apparatus 500 compares the received identity information 309 of the power tool 300 with the identity information of one or more power tools 300 stored in advance in the storage unit 502, and confirms whether or not the received storage unit 502 stores the received information.
  • the identity information 309 if any, determines that the upgrade device 500 can upgrade the power tool 300, and if not, determines that the upgrade is not possible.
  • the power tool 300 obtains the upgrade key, confirms the upgrade, and replies to the upgrade to the upgrade device 500;
  • S118 The power tool 300 receives the last data packet and returns the correct one
  • the upgrading apparatus 500 sends an upgrade end flag to the power tool 300;
  • an abnormal situation for example, power failure
  • the program 308 is an incomplete program.
  • the power tool 300 may not work properly or even malfunction, posing a security risk.
  • the upgrade program is rewritten, and the power tool 300 enters the forced upgrade mode.
  • the power tool 300 In the forced upgrade mode, once the upgrade device 500 is connected to the power tool 300, the power tool 300 no longer determines whether to enter the upgrade mode according to the voltage of the tool first port 301, but the power tool 300 actively sends an upgrade request to the upgrade device 500. In this way, the upgrade program is rewritten.
  • an upgrade file of an external device for example, a mobile phone, a PC, etc.
  • an upgrade file of an external device for example, a mobile phone, a PC, etc.
  • the application is updated, and the program can be updated by the bus scheduling method or the ordinary communication method without upgrading the device 500.
  • Embodiment 2 Program update is performed by using the upgrading apparatus 500.
  • the method of updating the battery pack 200 program by the upgrading apparatus 500 is similar to the method of upgrading the power tool 300 by the upgrading apparatus 500.
  • the upgrade device 500 for program update of the battery pack 200 and the upgrade device 500 for program update of the power tool 300 may be the same component, except that the upgrade programs stored in the storage unit 502 are different, respectively.
  • the upgrade procedure for the battery pack 200 and the upgrade procedure for the power tool 300 may be the same component, except that the upgrade programs stored in the storage unit 502 are different, respectively.
  • the power tool 300 updates the program in the non-operation mode after power-on, and the battery pack 200 can update the program at any time.
  • the battery pack 200 enters the upgrade mode, it can be detected whether the voltage identification of the first port 201 of the battery pack is the upgrade device 500, or the battery pack 200 can directly send an upgrade request to the upgrade device 500 to enter the upgrade mode.
  • the battery pack 200 when the external device such as the charger or the upgrading device 500 or the power tool 300 is connected to the battery pack 200, after the battery pack 200 is powered on, firstly, according to the external device feedback signal, it is confirmed which device is used, and when the battery pack 200 is confirmed to be After the device 500 is upgraded, the battery pack 200 sends its own identity information to the upgrade device 500, and is ready to upgrade.
  • the external device such as the charger or the upgrading device 500 or the power tool 300
  • the battery pack 200 has two physical interfaces, a battery pack first port 201 and a battery pack second port 202.
  • the upgrade apparatus 500 has an upgraded first port 506 and an upgraded second port 507 corresponding thereto, respectively. It is connected to the battery pack first port 201 and the battery pack second port 202.
  • the battery pack 200 sends the self-identity information 209 to the upgrading apparatus 500 to request to enter the upgrade mode, it is necessary to set an upgrade flag in the battery pack 200 in advance.
  • the upgrade flag can be written to the flash memory 206 or other memory of the MCU of the battery pack 200 by an external device using wireless or wired means.
  • the upgrade device 500 is connected to the battery pack 200, if it is detected that the battery pack 200 stores the upgrade identifier, the upgrade key is sent to the battery pack 200, and the MCU 203 of the battery pack 200 executes the boot loader 207, which will upgrade the storage unit of the device 500.
  • the upgrade program in 502 is written to the application storage area of the battery pack 200 to update the battery pack 200 application, otherwise the program update process is not performed. Once the upgrade program is executed, regardless of whether the upgrade was successful or not, the upgrade ID is cleared to prevent the boot loader from being executed multiple times.
  • the information exchange process of the upgrading apparatus 500 and the battery pack 200 in the upgrade mode is as follows:
  • the upgrade device 500 sends its own identity information to the battery pack 200;
  • the battery pack 200 receives the identity information of the upgrade device 500, and returns the identity information to the upgrade device 500 to prepare for the upgrade;
  • the upgrade device 500 verifies the identity information of the battery pack 200, determines whether to perform the upgrade, and if the upgrade is possible, sends the upgrade key to the battery pack 200;
  • the upgrading apparatus 500 determines whether to upgrade, specifically, the following content: First, whether the battery pack 200 identity information and the upgrading apparatus 500, the upgrading apparatus 500 stores the identity information of the received battery pack 200 in advance in the storage unit 502. The identity information 209 of one or more battery packs 200 is compared to determine whether the received identity information is stored in the storage unit 502. If so, it is determined that the battery pack 200 can be updated. If not, the program cannot be executed. Update; second, whether there is an upgrade flag in the battery pack 200 memory, if yes, it is judged that the battery pack 200 can be updated, if not, it is judged that the program update cannot be performed;
  • the battery pack 200 receives the upgrade key, confirms the upgrade, and replies to the upgrade to the upgrade apparatus 500;
  • the battery pack 200 After receiving the data packet, the battery pack 200 checks whether the data packet is correct (whether the data packet sequence is correct, whether the data packet content is correct, etc.), and if correct, returns the correct to the upgrading apparatus 500;
  • the battery pack 200 receives the last data packet and returns the correct one
  • the upgrade device 500 sends an upgrade end flag to the battery pack 200;
  • the host 600 sends an instruction or data to the slave 700, and the slave 700 receives the command or data and feeds back to the host 600 to ensure that the transmission is normal (refer to FIG. 14).
  • the host 600 sends an instruction or data to the slave 700, the slave 700 does not feed back to the host 600 within a specified time, or the host 600 does not receive feedback from the slave 700 within a specified time.
  • perform the timeout retransmission as follows:
  • S152 The host 600 determines whether the slave 700 is replied within the specified time. If yes, the next command or data is sent to the slave 700, and the process goes to step S151; if not, the command or data transmission is considered to be unsuccessful;
  • step S154 The host 600 determines whether the predetermined upper limit of the number of retransmissions is reached. If yes, the transmission is considered to have failed, and the process goes to step S5; if not, the process goes to step S152.
  • the host 600 is the communication module 120 or the upgrade device
  • the slave 700 is the main control module 132, the inverter module 131, the power tool 300, and the battery pack 200.
  • the upper limit of the number of retransmissions is set according to specific conditions or requirements, for example, 3 times, 5 times, 10 times, etc., in order to save energy.
  • the display module of the upgrading apparatus 500 displays an alarm state to remind the user that the upgrade has failed.
  • the present disclosure provides a method for updating an electronic device and an electronic device, and the method for updating the program of the electronic device and the electronic device is convenient, fast, and reliable.

Abstract

An electronic device, comprising: a housing, at least one adapter interface (111) used for enabling one or more battery packs (200) to be detachably mounted to the electronic device, a control module, and a communication module (120). The communication module (120) comprises a wireless communication unit (121) and a storage unit (122). The storage unit (122) is used for storing an upgrade file from an external device. The upgrade file comprises an upgrade program for updating the program of the control module. The communication module (120) is configured to receive the upgrade file from the external device by means of the wireless communication unit (121), store the upgrade file in the storage unit (122), and send, if a preset condition is satisfied, the upgrade file to the control module so as to update the program of the control module. The program updating method for the electronic device is convenient, efficient, and reliable.

Description

电子装置以及电子装置的程序更新方法Electronic device and program updating method of electronic device 技术领域Technical field
本公开涉及电子装置以及电子装置的程序更新方法。The present disclosure relates to an electronic device and a program update method of the electronic device.
背景技术Background technique
随着电池技术的发展,电动工具正在逐渐取代引擎工具。为了实现近似于引擎工作的工作效果和续航时间,为电动工具供电的电池包的额定功率和容量也越来越大,为电池包充电的充电装置的输出功率要求也相应地越来越大,因而充电装置需要具备的安全性要求也越来越高。同样地,由于电动工具使用电机工作,其输出电流和输出功率较大,且其在工作时,存在一定的危险性,因而也需要具备较高的安全性能。With the development of battery technology, power tools are gradually replacing engine tools. In order to achieve the working effect and endurance time of the engine work, the rated power and capacity of the battery pack for powering the power tool are also increasing, and the output power requirement of the charging device for charging the battery pack is correspondingly larger and larger. Therefore, the safety requirements required for the charging device are also increasing. Similarly, since the power tool uses the motor to work, its output current and output power are large, and it has certain dangers during operation, and thus requires high safety performance.
另外,在户外进行工作和旅游,往往需要交流电源来为一些工具或设施供电;传统的可携带的便携式电源装置,往往尤其内部的电芯组供电,一旦该电源的电芯组的电能消耗完则无法持续提供交流电。本公开采用为电动工具供电的电池包为便携式电源装置供电,可解决上述问题。In addition, working and traveling outdoors often requires AC power to power some tools or facilities; traditional portable portable power units often supply power to the internal battery pack, once the power of the battery pack is exhausted. It is not possible to provide AC power continuously. The present disclosure solves the above problems by using a battery pack that powers a power tool to power a portable power source device.
而当充电装置、电动工具或便携式电源装置中的一个或多个软件程序出现问题或需要对已经出货的产品进行程序更改或软件升级时,需要拆机并且扣胶实现产品软件程序的更改或升级,这不但需要投入极大的人力物力,而且也会延长项目周期。为此,迫切需要一种适用于上述充电装置、电动工具或便携式电源装置等电动工具领域的电子装置的方便快捷的程序更新方法。When there is a problem in one or more software programs in the charging device, the power tool or the portable power device, or when a program change or software upgrade is required for the already shipped product, the device needs to be disassembled and the glue is changed to implement the product software program or Upgrade, this not only requires a lot of manpower and resources, but also extends the project cycle. For this reason, there is an urgent need for a convenient and quick program updating method suitable for an electronic device in the field of power tools such as the above-described charging device, power tool or portable power source device.
另外,在程序更新过程中,可能因某些原因(例如,断电、断网等)使得正在传输中的升级文件中断传输或程序更新突然中断,造成升级文件不完整或已经更新的程序不完整,这种不完整的有缺陷的程序会使得充电装置、电动工具以及便携式电源不能正常工作,存在安全隐患,容易造成安全事故。In addition, during the program update process, the upgrade file may be interrupted or the program update is suddenly interrupted due to some reasons (for example, power failure, network disconnection, etc.), resulting in incomplete upgrade or updated program. This incomplete and defective program can make the charging device, the power tool and the portable power supply not work properly, and there is a safety hazard, which is likely to cause a safety accident.
发明内容Summary of the invention
为解决现有技术的不足,本公开的目的在于提供一种程序更新方便快捷且安全可靠的电子装置以及电子装置的程序更新方法。In order to solve the deficiencies of the prior art, an object of the present disclosure is to provide an electronic device with a program update that is convenient, fast, safe, and reliable, and a program update method for the electronic device.
为了实现上述目标,本公开采用如下的技术方案:In order to achieve the above objectives, the present disclosure adopts the following technical solutions:
一种电子装置,包括:壳体;至少一个适配接口,形成于所述壳体的表面,用于使一个或多个电池包可拆卸地安装至所述至少一个适配接口,其中,所述电池包能够用于手持式电动工具或花园工具;控制模块,可编程地控制所述电子装置的操作过程;其中,所述电子装置还包括通信模块,所述通信模块包括:无线通信单元,用于与外部设备进行无线通信,以接收来自外部设备的升级文件;以及存储单元,用于存储来自外部设备的所述升级文件;所述升级文件包含对所述控制模块的程序进行更新的升级程序;所述通信模块被配置为:通过所述无线通信单元接收外部设备的所述升级文件并将所述升级文件存储在所述存储单元;在满足预设条件下,能够发送所述升级文件至所述控制模块以对所述控制模块的程序进行更新。An electronic device comprising: a housing; at least one adapter interface formed on a surface of the housing for detachably mounting one or more battery packs to the at least one adapter interface, wherein The battery pack can be used for a handheld power tool or a garden tool; a control module that programmably controls an operation process of the electronic device; wherein the electronic device further includes a communication module, the communication module includes: a wireless communication unit, For wirelessly communicating with an external device to receive an upgrade file from the external device; and a storage unit for storing the upgrade file from the external device; the upgrade file includes an upgrade to update the program of the control module a program; the communication module is configured to: receive, by the wireless communication unit, the upgrade file of an external device and store the upgrade file in the storage unit; and send the upgrade file when a preset condition is met The control module is updated to the program of the control module.
进一步地,所述预设条件包括所述通信模块接收到来自所述控制模块的升级请求。Further, the preset condition includes the communication module receiving an upgrade request from the control module.
进一步地,所述升级文件包含程序结束标识,所述控制模块在未接收到所述程序结束标识时发送所述升级请求给所述通信模块。Further, the upgrade file includes a program end identifier, and the control module sends the upgrade request to the communication module when the program end identifier is not received.
进一步地,所述预设条件包括所述通信模块接收到来自外部设备的升级请求。Further, the preset condition includes the communication module receiving an upgrade request from an external device.
进一步地,所述电子装置为便携式电源装置,所述便携式电源装置还包括逆变模块,所述逆变模块包括逆变器,所述逆变器用于将所述电池包输出的直流电转变为交流电;所述逆变模块电连接至所述控制模块,至少部分地接受所述主控模块的控制。Further, the electronic device is a portable power supply device, and the portable power supply device further includes an inverter module, the inverter module includes an inverter, and the inverter is configured to convert the direct current outputted by the battery pack into an alternating current The inverter module is electrically connected to the control module and at least partially receives control of the main control module.
进一步地,所述便携式电源装置还包括数据总线,所述控制模块和逆变模块通过所述数据总线连接至所述通信模块;所述通信模块被配置为:通过所述无线通信单元接收外部设备的升级文件并将其存储在所述存储单元;通过所述数据总线将所述升级文件发送至所述控制模块和/或逆变模块;所述升级文件包含对所述控制模块和/或所述逆变模块的程序进行更新的升级程序。Further, the portable power supply device further includes a data bus, the control module and the inverter module are connected to the communication module through the data bus; the communication module is configured to: receive an external device through the wireless communication unit And storing the upgrade file in the storage unit; sending the upgrade file to the control module and/or the inverter module through the data bus; the upgrade file includes the control module and/or the The upgrade program of the program of the inverter module is updated.
进一步地,所述控制模块和所述逆变模块具有唯一标识符。Further, the control module and the inverter module have unique identifiers.
进一步地,所述升级文件包含所述控制模块和/或逆变模块的唯一标识符。Further, the upgrade file contains a unique identifier of the control module and/or the inverter module.
进一步地,所述无线通信单元包括WIFI模组和/或蓝牙模组。Further, the wireless communication unit includes a WIFI module and/or a Bluetooth module.
进一步地,所述控制模块包括处存储单元,所述存储单元存储有第一部分程序和第二部分程序,所述第一部分程序可被所述控制模块执行以更新所述第二部分程序。Further, the control module includes a storage unit that stores a first partial program and a second partial program, the first partial program being executable by the control module to update the second partial program.
进一步地,所述电子装置为电池包或使用所述电池包供电的电动工具或为所述电池包充电的充电装置。Further, the electronic device is a battery pack or a power tool that uses the battery pack or a charging device that charges the battery pack.
一种适用于如上所述的电子装置的程序更新方法,包括:所述通信模块通过所述无线通信单元接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元;在满足预设条件下,所述通信模块将所述升级文件发送至所述控制模块;所述控制模块根据所述升级文件更新自身的程序。A program updating method suitable for an electronic device as described above, comprising: the communication module receiving an upgrade file from an external device through the wireless communication unit and storing the upgrade file in the storage unit; The communication module sends the upgrade file to the control module, and the control module updates its own program according to the upgrade file.
进一步地,在所述通信模块接收到来自所述控制模块的升级请求时,所述通信模块将所述升级文件发送至所述控制模块。Further, when the communication module receives an upgrade request from the control module, the communication module sends the upgrade file to the control module.
进一步地,所述升级文件包含程序结束标识,所述控制模块在未接收到所述程序结束标识时发送所述升级请求给所述通信模块。Further, the upgrade file includes a program end identifier, and the control module sends the upgrade request to the communication module when the program end identifier is not received.
进一步地,在所述通信模块接收到来自外部设备的升级请求时,所述通信模块将所述升级文件发送至所述控制模块。Further, when the communication module receives an upgrade request from an external device, the communication module sends the upgrade file to the control module.
另一种适用于如上所述的电子装置的程序更新方法,包括:所述通信模块通过所述无线通信单元接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元;在满足预设条件下,所述通信模块发送升级指令至所述数据总线;所述控制模块和逆变模块从所述数据总线上接收到所述升级指令后停止工作,进入监听状态;所述控制模块和逆变模块判断所述升级指令是否是对应自身的升级指令,如果是则进入升级模式,如果不是,则继续维持监听状态;所述控制模块和所述逆变模块之一判断是对自身的升级指令后发送升级响应至所述数据总线;所述通信模块从所述数据总线接收到所述升级响应后,通过所述数据总线发送所述升级文件至与发送所述升级响应对应的所述控制模块或逆变模块;所述控制模块或逆变模块在接收到所述升级文件后根据所述升级文件更新自身的程序。Another program updating method suitable for an electronic device as described above, comprising: the communication module receiving an upgrade file from an external device through the wireless communication unit and storing the upgrade file in the storage unit; And the communication module sends an upgrade instruction to the data bus; the control module and the inverter module stop working after receiving the upgrade instruction from the data bus, and enter a listening state; the control module And the inverter module determines whether the upgrade instruction is an upgrade instruction corresponding to itself, if yes, enters an upgrade mode, and if not, continues to maintain a listening state; and one of the control module and the inverter module determines that it is for itself Sending an upgrade response to the data bus after the upgrade command; after receiving the upgrade response from the data bus, the communication module sends the upgrade file through the data bus to the end corresponding to sending the upgrade response a control module or an inverter module; after the control module or the inverter module receives the upgrade file, according to the Level file update their program.
进一步地,在所述通信模块接收到来自所述控制模块或所述逆变模块的升 级请求时,所述通信模块发送升级指令至所述数据总线。Further, when the communication module receives an upgrade request from the control module or the inverter module, the communication module sends an upgrade command to the data bus.
进一步地,所述升级文件包含程序结束标识,所述控制模块或逆变模块在未接收到所述程序结束标识时发送所述升级请求至所述通信模块。Further, the upgrade file includes a program end identifier, and the control module or the inverter module sends the upgrade request to the communication module when the program end identifier is not received.
进一步地,在所述通信模块接收到来自外部设备的升级请求时,所述通信模块发送升级指令至所述数据总线。Further, when the communication module receives an upgrade request from an external device, the communication module sends an upgrade instruction to the data bus.
进一步地,所述控制模块和逆变模块具有唯一标识符,所述升级指令包含所述控制模块和/或逆变模块的唯一标识符;所述控制模块和逆变模块通过判断所述升级指令中的所述唯一标识符与自身的唯一标识符是否匹配,如果是,则判断是对自身的升级指令。Further, the control module and the inverter module have a unique identifier, and the upgrade instruction includes a unique identifier of the control module and/or the inverter module; and the control module and the inverter module determine the upgrade instruction by determining Whether the unique identifier in the match matches its own unique identifier, and if so, it is determined to be an upgrade instruction for itself.
进一步地,所述控制模块和逆变模块具有唯一标识符,所述升级响应包含所述唯一标识符。Further, the control module and the inverter module have a unique identifier, and the upgrade response includes the unique identifier.
进一步地,所述程序更新方法还包括:所述通信模块在接收到所述升级响应后,根据所述升级响应中包含的所述唯一标识符,发送升级密钥给与所述唯一标识符相匹配的所述控制模块或所述逆变模块,与所述唯一标识符相匹配的所述控制模块或所述逆变模块在收到所述升级密钥后,进入程序更新过程。Further, the program updating method further includes: after receiving the upgrade response, the communication module sends an upgrade key to the unique identifier according to the unique identifier included in the upgrade response The matching control module or the inverter module, the control module or the inverter module matching the unique identifier enters a program update process after receiving the upgrade key.
进一步地,所述通信模块按照预设顺序发送所述升级文件至所述控制模块和所述逆变模块。Further, the communication module sends the upgrade file to the control module and the inverter module in a preset order.
进一步地,所述程序更新方法还包括:所述控制模块或逆变模块在完成自身程序更新后,发送升级结束反馈至所述通信模块;在所述通信模块未接收到所述控制模块和所述逆变模块的升级结束反馈时,所述通信模块发送升级指令至所述数据总线。Further, the program updating method further includes: after the self-program update is completed, the control module or the inverter module sends an upgrade end feedback to the communication module; the control module does not receive the control module and the When the upgrade of the inverter module is finished, the communication module sends an upgrade command to the data bus.
本公开的有益之处在于:本公开的电子装置及其程序更新方法,程序更新无需拆机装机,减少人力物力且方便快捷,并且电子装置程序运行安全可靠。The utility model has the advantages that the electronic device of the present disclosure and the program updating method thereof do not need to be disassembled and installed, reduce manpower and material resources, are convenient and fast, and the electronic device program runs safely and reliably.
附图说明DRAWINGS
图1是便携式电源装置、电池包和电动工具的立体结构图;1 is a perspective structural view of a portable power source device, a battery pack, and a power tool;
图2是便携式电源装置与外部设备之间的信息交互网络图;2 is a network diagram of information interaction between a portable power source device and an external device;
图3是便携式电源装置的内部电路原理图;3 is an internal circuit schematic diagram of a portable power supply device;
图4是存储单元内部程序存储区分配示意图;4 is a schematic diagram of allocation of internal program storage area of a storage unit;
图5是通信模块和主控模块之间的信息交互过程;Figure 5 is an information exchange process between the communication module and the main control module;
图6是通信模块对连接其上的全部节点进行升级的工作流程图;6 is a workflow diagram of a communication module upgrading an entire node connected thereto;
图7是图6中各个节点在升级过程中的工作流程图;7 is a flow chart of the operation of each node in FIG. 6 during the upgrade process;
图8是通信模块与主控模块以及逆变模块的具体接线图;8 is a specific wiring diagram of a communication module, a main control module, and an inverter module;
图9是通信模块对主控模块和逆变模块进行软件更新的工作流程图;9 is a working flow chart of a software module performing software update on a main control module and an inverter module;
图10是升级装置与电动工具内部构成示意图;Figure 10 is a schematic view showing the internal structure of the upgrading device and the power tool;
图11是升级模式下图10所示的升级装置与电动工具之间的信息交互;11 is an information interaction between the upgrading apparatus and the power tool shown in FIG. 10 in an upgrade mode;
图12是升级装置与电池包内部构成示意图;Figure 12 is a schematic view showing the internal structure of the upgrading device and the battery pack;
图13是升级模式下图10所示的升级装置与电池包之间的信息交互;FIG. 13 is an information interaction between the upgrading apparatus and the battery pack shown in FIG. 10 in the upgrade mode;
图14是超时重传机制的原理示意图。14 is a schematic diagram of the principle of a timeout retransmission mechanism.
具体实施方式Detailed ways
以下结合附图和具体实施例对本公开作具体的介绍。The present disclosure will be specifically described below in conjunction with the drawings and specific embodiments.
本公开提供一种电子装置,包括:壳体;至少一个适配接口,形成于所述壳体的表面,用于使一个或多个电池包可拆卸地安装至所述至少一个适配接口,其中,所述电池包能够用于手持式电动工具或花园工具;控制模块,可编程地控制所述电子装置的操作过程;其中,电子装置还包括通信模块,所述通信模块包括:The present disclosure provides an electronic device including: a housing; at least one adapter interface formed on a surface of the housing for detachably mounting one or more battery packs to the at least one adapter interface, The battery pack can be used for a handheld power tool or a garden tool; a control module that can programmatically control an operation of the electronic device; wherein the electronic device further includes a communication module, the communication module includes:
无线通信单元,用于与外部设备建立通信链路,以接收来自外部设备的升级文件;以及存储单元,用于存储来自外部设备的所述升级文件;所述升级文件包含对所述控制模块的程序进行更新的升级程序;所述通信模块被配置为:通过所述无线通信单元接收外部设备的所述升级文件并将所述升级文件存储在所述存储单元;在满足预设条件下,能够发送所述升级文件至所述控制模块以对所述控制模块的程序进行更新。a wireless communication unit for establishing a communication link with an external device to receive an upgrade file from the external device; and a storage unit for storing the upgrade file from the external device; the upgrade file including the control module An update program for updating the program; the communication module is configured to: receive, by the wireless communication unit, the upgrade file of the external device and store the upgrade file in the storage unit; Sending the upgrade file to the control module to update the program of the control module.
本公开的电子装置主要应用于电池包和电动工具领域,包括但不限于能够够适配电池包100的便携式电源装置100、电池包200、使用所述电池包供电的 电动工具300、为电池包200充电的充电装置。下面以便携式电源装置100为例说明本公开的电子装置。The electronic device of the present disclosure is mainly applied to the field of battery packs and power tools, including but not limited to a portable power supply device 100 capable of adapting the battery pack 100, a battery pack 200, a power tool 300 powered by the battery pack, and a battery pack. 200 charging device. The electronic device of the present disclosure will be described below by taking the portable power source device 100 as an example.
参考图1至图3,便携式电源装置100包括适配器110,适配器110具有至少一个适配接口111,形成于所述壳体的表面,用于使一个或多个电池包200可拆卸地安装至所述至少一个适配接口111,其中,所述电池包111用于手持式电动工具或花园工具。电池包200可从适配接口111获取电能。多个电池包200既可以分别地连接至适配接口111,也可以同时的连接到适配接口111。适配接口111形成有能与电池包200的结合部相适配的部分,以使电池包200能够可拆卸的连接到适配接口111。Referring to FIGS. 1 through 3, the portable power supply device 100 includes an adapter 110 having at least one adapter interface 111 formed on a surface of the housing for detachably mounting one or more battery packs 200 to the chassis. At least one adapter interface 111 is described, wherein the battery pack 111 is for a hand-held power tool or a garden tool. The battery pack 200 can obtain electrical energy from the adaptation interface 111. The plurality of battery packs 200 may be separately connected to the adapter interface 111 or may be simultaneously connected to the adapter interface 111. The adapter interface 111 is formed with a portion that can be fitted to the joint of the battery pack 200 to enable the battery pack 200 to be detachably coupled to the adapter interface 111.
适配器110还包括一个逆变器和一个整流器。其中,逆变器能使适配器110所连接的电池包200所输出的直流电变为交流电;整流器能使适配器110接入的交流电变为能为电池包200充电的直流电。逆变器和整流器均由相应的电路板和电路元件构成,构成逆变器和整流器的电路板和电路元件容纳在便携式电源装置100的壳体所形成的容纳腔中。The adapter 110 also includes an inverter and a rectifier. The inverter can convert the direct current outputted by the battery pack 200 connected to the adapter 110 into alternating current; the rectifier can convert the alternating current that the adapter 110 is connected into the direct current that can charge the battery pack 200. Both the inverter and the rectifier are constituted by respective circuit boards and circuit components, and circuit boards and circuit components constituting the inverter and the rectifier are housed in a housing formed by the housing of the portable power supply device 100.
适配器110还包括交流电输入接口,其能使适配器110接入电网中的交流电。具体而言,交流电输入接口可以构造为如图1所示的电源插头115。适配器110可以通过接入的交流电为其所连接的电池包200充电;作为具体方案,交流电输入接口电性连接至整流器,从而使从交流电输入接口接入的交流电变为直流电从而电池包200充电。 Adapter 110 also includes an AC input interface that enables adapter 110 to be connected to AC power in the grid. In particular, the AC input interface can be constructed as a power plug 115 as shown in FIG. The adapter 110 can charge the connected battery pack 200 through the connected alternating current; as a specific solution, the alternating current input interface is electrically connected to the rectifier, so that the alternating current input from the alternating current input interface is changed to direct current so that the battery pack 200 is charged.
适配器110还包括交流电输出接口,它能用于输出交流电,从而使便携式电源装置100能作为AC电源。作为具体方案,交流电输出接口的电能来源既可以是适配器110所连接的电池包200中所存储的电能,也可以是由适配器110从交流电输入接口引入的交流电电网的电能。交流电输出接口可以被构造为如图1所以的电源插座112的形式,使便携式电源装置100能为一般的AC用电设备供电。The adapter 110 also includes an AC output interface that can be used to output AC power to enable the portable power device 100 to function as an AC power source. As a specific solution, the power source of the AC output interface may be the power stored in the battery pack 200 to which the adapter 110 is connected, or the power of the AC grid introduced by the adapter 110 from the AC input interface. The AC output interface can be constructed in the form of a power outlet 112 as in Figure 1 to enable the portable power unit 100 to power a typical AC powered device.
适配器110可以使用其所连接的电池包200电能并通过交流电输出接口输出交流电。作为具体的方案,交流电输出接口至少电性连接至逆变器。来自电池包200的直流电经过逆变器变为交流电然后输出到交流电输出接口。The adapter 110 can use the battery pack 200 power to which it is connected and output AC power through the AC output interface. As a specific solution, the AC output interface is at least electrically connected to the inverter. The direct current from the battery pack 200 is changed to an alternating current through the inverter and then output to the alternating current output interface.
适配器110还包括直流电输出接口,其用于使适配器110输出直流电。具 体而言,直流电输出接口既可以被构造为如图1所示的5V的USB接口113,也可以被构造为如图1所示的12V车载电源接口114;当然,直流电输出接口也可以被构造成其他形式,输出诸如19V,36V等其他电压。The adapter 110 also includes a direct current output interface for causing the adapter 110 to output direct current. Specifically, the DC output interface can be configured as a 5V USB interface 113 as shown in FIG. 1, or can be configured as a 12V vehicle power interface 114 as shown in FIG. 1; of course, the DC output interface can also be constructed. In other forms, other voltages such as 19V, 36V are output.
适配器110还可以包括直流电输入接口,用于使适配器110接入直流电。适配器110从其电池包200以外所接入的直流电既可以给电池包200充电,同时也可以供中其他的用电装置所使用。例如,用户可以利用汽车的蓄电池,通过直流电输入接口连接到直流电输入接口,从而对适配器110所连接的电池包200充电,当然,用户可以利用适配器110的直流电输出接口为汽车的蓄电池充电以解决汽车因蓄电池被放空而无法启动的问题。直流电输入接口也可以被构造为如图1所示的USB接口114或12V接口114。The adapter 110 can also include a DC input interface for connecting the adapter 110 to DC power. The adapter 110 can charge the battery pack 200 from the direct current that is external to its battery pack 200, and can also be used by other electrical consumers. For example, the user can use the battery of the automobile to connect to the DC input interface through the DC input interface, thereby charging the battery pack 200 connected to the adapter 110. Of course, the user can use the DC output interface of the adapter 110 to charge the battery of the automobile to solve the automobile. The problem that the battery cannot be started because it is emptied. The DC input interface can also be constructed as a USB interface 114 or a 12V interface 114 as shown in FIG.
便携式电源装置100可连接多个电池包200,它们既可以是额定电压相同的电池包200也可以是额定电压不相同的电池包200;适配器110能使其中一个具有较高电压或/和电量的电池包200为另一个具有较低的电压或/和电量的电池包200;当然,适配器110通过其内部的电路,使具有较低的电压或/和电量的电池包200为具有较高电压或/和电量的电池包200充电。The portable power supply device 100 can be connected to a plurality of battery packs 200, which can be either the battery pack 200 having the same rated voltage or the battery pack 200 having a different rated voltage; the adapter 110 can enable one of the batteries to have a higher voltage or/and a lower amount of power. The battery pack 200 is another battery pack 200 having a lower voltage or/and a power; of course, the adapter 110, through its internal circuitry, causes the battery pack 200 having a lower voltage or/and power to have a higher voltage or / and charge the battery pack 200.
电池包200包括电芯和壳体。电芯容纳在壳体中,用于存储能量,其能被反复充放电。壳体用于容纳电池包200中的电芯以及其他部件,并且壳体形成有结合部,电池包200可以通过该结合部结合至一个电动工具300。电池包200还包括若干电极连接端子,它们至少用于使电芯与外部的电路构成电性连接。比如与电动工具300中的用于驱动电机的电路或充电器中的充电电路构成电性连接。The battery pack 200 includes a battery cell and a housing. The cells are housed in a housing for storing energy that can be repeatedly charged and discharged. The housing is for accommodating the battery cells and other components in the battery pack 200, and the housing is formed with a joint through which the battery pack 200 can be coupled to one power tool 300. The battery pack 200 further includes a plurality of electrode connection terminals for at least electrically connecting the battery cells to external circuits. For example, it is electrically connected to a charging circuit in a circuit or a charger for driving the motor in the power tool 300.
电池包200还包括其他类型的连接端子,比如用于与外部建立通信的通信端子,用于识别或传递温度信号的温度信号端子,这些端子在一些情况中也可以复用,用来传递其他信号。The battery pack 200 also includes other types of connection terminals, such as communication terminals for establishing communication with the outside, temperature signal terminals for identifying or transmitting temperature signals, which may also be multiplexed in some cases for transmitting other signals. .
电池包200还可以包含电路板、控制器以及一些相应的探测器。电路板主要用于构建电池包200内的电路,控制器主要实现对电池包200的控制,探测器主要用于检测电池包200的一些电参数和物理参数,比如电池包200的电流、电压或者电池包200内部的温度等。具体而言,电路板、控制器以及探测器所构成的电路使电池包200具有过放保护或过充保护的功能,防止过度放电或过 度充电,并且使电池包200能与其他外部设备进行有线或无线的通信。The battery pack 200 can also include a circuit board, a controller, and some corresponding detectors. The circuit board is mainly used to construct the circuit in the battery pack 200. The controller mainly controls the battery pack 200. The detector is mainly used to detect some electrical parameters and physical parameters of the battery pack 200, such as the current and voltage of the battery pack 200 or The temperature inside the battery pack 200, and the like. Specifically, the circuit board, the controller, and the detector constitute a circuit that allows the battery pack 200 to have over-discharge protection or overcharge protection to prevent over-discharge or over-charging, and to enable the battery pack 200 to be wired with other external devices. Or wireless communication.
电池包200可以为直流电动工具300提供电能。电池包200能够可拆卸的连接至直流电动工具300为之供电。直流电动工具300包括一个用电装置。用电装置可以包括电机。直流电动工具300可以为手持电动工具300、园林电动工具300等,电动工具300包括但不局限于电钻、电动扳手、电动螺丝刀、电锤、冲击电钻、电刨、割草机、打草机等。The battery pack 200 can provide electrical power to the DC power tool 300. The battery pack 200 is detachably connected to the DC power tool 300 for powering it. The DC power tool 300 includes an electrical device. The electric device can include a motor. The DC power tool 300 can be a hand-held power tool 300, a garden power tool 300, etc., and the power tool 300 includes but is not limited to an electric drill, an electric wrench, an electric screwdriver, an electric hammer, an impact drill, an electric planer, a lawn mower, a lawn mower, etc. .
便携式电源装置100还包括通信模块120,所述的通信模块120包括无线通信单元121,无线通信单元121用于与外部设备建立通信连接,可以向远程服务器20或移动终端设备21发送数据信息以及接收远程服务器20或移动终端设备21的数据信息。The portable power supply device 100 further includes a communication module 120, and the communication module 120 includes a wireless communication unit 121 for establishing a communication connection with an external device, and can transmit data information and receive to the remote server 20 or the mobile terminal device 21. Data information of the remote server 20 or the mobile terminal device 21.
具体而言,无线通信单元121以用于使适配器110与其他适配器110或者其他无线通信设备进行无线通信。作为一种具体的方案,无线通信单元121可以是作为一个局域网络的无线路由器,其可以直接接入互联网而使局域网内的其他无线通信设备接入互联网,也可以通过能与之通信的一个能接入互联网的无线通信设备而使局域网内的其他无线通信设备接入互联网,当然,无线通信单元121也可以仅仅使局域网内的各个无线通信设备实现数据交互,该无线通信设备可采用蓝牙、WiFi、NFC、ZigBee等方式实现无线通信。In particular, the wireless communication unit 121 is used to wirelessly communicate the adapter 110 with other adapters 110 or other wireless communication devices. As a specific solution, the wireless communication unit 121 can be a wireless router as a local area network, which can directly access the Internet to enable other wireless communication devices in the local area network to access the Internet, and can also communicate with the wireless communication device. Accessing the wireless communication device of the Internet to enable other wireless communication devices in the local area network to access the Internet. Of course, the wireless communication unit 121 can also implement data interaction only for each wireless communication device in the local area network. The wireless communication device can adopt Bluetooth and WiFi. , NFC, ZigBee and other ways to achieve wireless communication.
作为一个实施例,无线通信单元121包括蓝牙模组1212和WIFI模组1211,可以同时通过蓝牙和WIFI的方式与远程服务器20和移动终端设备21进行无线通信。作为可选地,无线通信单元121也包括蓝牙模组1212和WIFI模组1211其中的一个。便携式电源装置100可以通过通信模块120中的WIFI模组1211将数据信息以WIFI的方式上传到远程服务器20,也可以通过蓝牙模组1212以蓝牙的方式将数据信息送给移动终端设备21,移动终端设备21可以将接收到便携式电源装置100的数据信息经过处理或不处理后上传到远程服务器20;远程服务器20的数据信息可以通过WIFI的方式发送给便携式电源装置100,也可以通过移动终端设备21以蓝牙的方式发送给便携式电源装置100;移动终端设备21可以通过远程服务器20以WIFI的方式将控制指令远程发送给便携式电源装置100,也可以通过蓝牙的方式直接将控制指令发送给便携式电源装置100。As an embodiment, the wireless communication unit 121 includes a Bluetooth module 1212 and a WIFI module 1211, and can perform wireless communication with the remote server 20 and the mobile terminal device 21 through Bluetooth and WIFI at the same time. Optionally, the wireless communication unit 121 also includes one of a Bluetooth module 1212 and a WIFI module 1211. The portable power supply device 100 can upload the data information to the remote server 20 by means of the WIFI module 1211 in the communication module 120, or send the data information to the mobile terminal device 21 via the Bluetooth module 1212. The terminal device 21 may upload the data information received by the portable power supply device 100 to the remote server 20 after being processed or not processed; the data information of the remote server 20 may be sent to the portable power device 100 by means of WIFI, or may be transmitted through the mobile terminal device. 21 is sent to the portable power supply device 100 in a Bluetooth manner; the mobile terminal device 21 can remotely transmit the control command to the portable power supply device 100 in the WIFI manner through the remote server 20, or directly send the control command to the portable power source through the Bluetooth mode. Device 100.
上述便携式电源装置100、电池包200、使用电池包200供电的电动工具300 构成便携式电能系统,便携式电能系统还包括可以包括上述移动终端设备21以及远程服务器20。移动终端设备21可以为手机、专用手持式设备、平板电脑等电子设备。The portable power supply device 100, the battery pack 200, and the power tool 300 powered by the battery pack 200 constitute a portable power system, and the portable power system further includes the mobile terminal device 21 and the remote server 20. The mobile terminal device 21 can be an electronic device such as a mobile phone, a dedicated handheld device, or a tablet computer.
参照图3所示的便携式电能系统,其包括便携式电源装置100、电池包200、电动工具300。其中,便携式电源装置100包括通信模块120、主控模块132、逆变模块131。便携式电源装置100还包括电池包协调主模块133、至少一个电池包协调子模块134。Referring to the portable power system shown in FIG. 3, the portable power supply device 100, the battery pack 200, and the power tool 300 are included. The portable power supply device 100 includes a communication module 120, a main control module 132, and an inverter module 131. The portable power supply device 100 further includes a battery pack coordination main module 133 and at least one battery pack coordination sub-module 134.
通信模块120包括无线通信单元121,用于与外部设备(例如,远程服务器20、移动终端设备21等)进行无线通信,以接收来自外部设备的信息,例如,升级指令、升级文件,以及其他数据和指令等;无线通信单元121包括蓝牙模组1212和WIFI模组1211;存储单元122,所述存储单元122用于存储来自外部设备的文件,例如,升级文件,所述升级文件包含对便携式电源装置100中的一个或多个模块的程序进行更新的升级程序,所述使得便携式电源装置100在断网的情况下,也能使用保存在存储单元122中的升级文件对便携式电源装置100中的一个或多个模块进行程序更新。所述通信模块120被配置为:通过所述无线通信单元121接收外部设备的所述升级文件并将所述升级文件存储在所述存储单元122;在满足预设条件下,能够发送所述升级文件至便携式电源装置100中一个或多个模块,例如主控模块132和/或逆变模块131,以对所述例如主控模块和/或逆变模块的程序进行更新。The communication module 120 includes a wireless communication unit 121 for wirelessly communicating with an external device (eg, the remote server 20, the mobile terminal device 21, etc.) to receive information from the external device, such as upgrade instructions, upgrade files, and other data. The wireless communication unit 121 includes a Bluetooth module 1212 and a WIFI module 1211, and a storage unit 122 for storing files from an external device, for example, an upgrade file, the upgrade file includes a portable power source. The program of one or more modules in the device 100 performs an updated upgrade procedure, which enables the portable power supply device 100 to use the upgrade file stored in the storage unit 122 for the portable power supply device 100 in the case of disconnection. One or more modules for program updates. The communication module 120 is configured to receive the upgrade file of the external device through the wireless communication unit 121 and store the upgrade file in the storage unit 122; the upgrade can be sent under a preset condition The file is transferred to one or more modules in the portable power supply unit 100, such as the main control module 132 and/or the inverter module 131, to update the program, such as the main control module and/or the inverter module.
当然,所述的存储单元122还可以存储外部设备发送的其他的数据信息或便携式电源装置100上传的需要上传到外部设备的数据信息(例如,便携式电源装置100和/或电池包200和/或电动工具300的状态数据等)。Of course, the storage unit 122 may also store other data information sent by the external device or data information uploaded by the portable power supply device 100 that needs to be uploaded to the external device (for example, the portable power supply device 100 and/or the battery pack 200 and/or Status data of the power tool 300, etc.).
作为可选地,便携式电源装置100还包括配网单元123,用于选择以何种通信方式(例如,WIFI方式或蓝牙方式)与外部设备进行通信。在其他些实施例中,通信模块120还包括通信端口,用于与便携式电源装置100内部的其他模块(例如,主控模块132和逆变模块131)进行通信;校验模块,用于校验接收的数据信息是否正确。Optionally, the portable power supply device 100 further includes a distribution network unit 123 for selecting a communication mode (for example, WIFI mode or Bluetooth mode) to communicate with an external device. In other embodiments, the communication module 120 further includes a communication port for communicating with other modules (eg, the main control module 132 and the inverter module 131) inside the portable power supply device 100; and a verification module for verifying The received data information is correct.
便携式电源装置100还包括数据总线,主控模块132和逆变模块131连接至所述数据总线。所述数据总线通过通信端口连接至通信模块120,所述主控模 块132和逆变模块131通过所述数据总线连接至所述通信模块120。所述通信模块120被配置为通过所述无线通信单元121接收外部设备的升级文件,且通过所述数据总线将所述升级文件发送至所述主控模块132和/或逆变模块131;所述升级文件包含对所述主控模块132的程序进行更新的升级程序和/或对所述逆变模块131的程序进行更新的升级程序。所述升级文件包含所述主控模块132和/或逆变模块131的唯一标识符。The portable power supply device 100 also includes a data bus to which the main control module 132 and the inverter module 131 are connected. The data bus is coupled to the communication module 120 via a communication port, and the master module 132 and the inverter module 131 are coupled to the communication module 120 via the data bus. The communication module 120 is configured to receive an upgrade file of the external device through the wireless communication unit 121, and send the upgrade file to the main control module 132 and/or the inverter module 131 through the data bus; The upgrade file includes an upgrade program for updating the program of the main control module 132 and/or an upgrade program for updating the program of the inverter module 131. The upgrade file contains a unique identifier of the master module 132 and/or the inverter module 131.
主控模块132作为便携式电源装置100的控制模块,用于可编程的控制所述便携式电源装置100的操作过程,对整个便携式电源装置100的工作进行管理。主控模块132可以通过通信模块120的接受外部设备指令,并响应于该指令执行相应过程,主控模块132还可以自行根据便携式电源装置100中情况控制所述便携式电源装置100。主控模块132电连接到电池包协调主模块133,电池包协调主模块133用于协调管理多个电池包协调子模块134。在一些实施例中,电池包协调主模块133连接到通信模块120,用于将收集的数据信息上传到通信模块120;逆变模块131包括逆变器,所述逆变器用于将所述电池包200输出的直流电转变为交流电;所述逆变模块131电连接至所述主控模块132,在工作模式下至少部分地接受所述主控模块132的管理,而在升级模式下,通过所述数据总线与主控模块132并行的连接到通信模块120,接受通信模块120的管理而完成程序更新。The main control module 132 serves as a control module of the portable power supply device 100 for programmably controlling the operation of the portable power supply device 100 and managing the operation of the entire portable power supply device 100. The main control module 132 can receive the external device command through the communication module 120 and execute the corresponding process in response to the instruction, and the main control module 132 can also control the portable power supply device 100 according to the situation in the portable power supply device 100. The main control module 132 is electrically connected to the battery pack coordination main module 133, and the battery pack coordination main module 133 is used to coordinately manage the plurality of battery pack coordination sub-modules 134. In some embodiments, the battery pack coordination main module 133 is connected to the communication module 120 for uploading the collected data information to the communication module 120; the inverter module 131 includes an inverter for using the battery The DC power outputted by the packet 200 is converted into AC power; the inverter module 131 is electrically connected to the main control module 132, and at least partially accepts the management of the main control module 132 in the working mode, and in the upgrade mode, passes through the The data bus is connected to the communication module 120 in parallel with the main control module 132, and is managed by the communication module 120 to complete the program update.
所述主控模块132和所述逆变模块131具有唯一标识符,所述主控模块132和所述逆变模块131包括存储单元,所述存储单元分别存储有所述主控模块132和所述逆变模块131的所述唯一标识符。The main control module 132 and the inverter module 131 have a unique identifier, and the main control module 132 and the inverter module 131 include a storage unit, and the storage unit stores the main control module 132 and the storage unit respectively. The unique identifier of the inverter module 131.
在本实施例中,所述主控模块132和逆变模块131通过所述数据总线连接至所述通信模块120。电池包协调主模块133与多个电池包协调子模块134之间通过I2C总线方式连接;逆变模块131连接到主控模块132和通信模块120,在升级模式中,通信模块120通过数据总线对逆变模块131和主控模块132的软件程序的进行更新或升级。通信模块120通过总线连接各个模块以对各个模块的程序进行升级主要有以下优点:数据传送效率较高;总线系统扩充性好,可以增加或减少连接在总线上的模块,而不会影响其他模块的程序更新过程;简化了硬件设计,便于采用模块化结构设计方法;便于故障诊断和维修,方便找到出现故障的部位。In this embodiment, the main control module 132 and the inverter module 131 are connected to the communication module 120 through the data bus. The battery pack coordination main module 133 and the plurality of battery pack coordination sub-modules 134 are connected by an I2C bus mode; the inverter module 131 is connected to the main control module 132 and the communication module 120. In the upgrade mode, the communication module 120 passes the data bus pair. The software programs of the inverter module 131 and the main control module 132 are updated or upgraded. The communication module 120 connects each module through a bus to upgrade the programs of the respective modules, and has the following advantages: high data transmission efficiency; good scalability of the bus system, which can increase or decrease the modules connected to the bus without affecting other modules. Program update process; simplified hardware design, easy to adopt modular structure design method; easy for fault diagnosis and maintenance, easy to find the faulty part.
电池包200与电池包协调子模块134之间、电动工具300与电池包200之间使用采用串口通信方式建立通信连接。具体而言,参照图3,电池包200具有两个物理接口,电池包第一端口201和电池包第二端口202;电动工具300具有两个物理接口,工具第二端口301和工具第二端口302;当电动工具300与电池包200连接时,电池包第一端口201和电池包第二端口202分别连接到工具第一端口301和工具第二端口302。电池包协调子模块134具有与电池包第一端口201和电池包第二端口202对应连接的物理接口,用于与电池包200建立通信,对其进行充放电管理或数据传输,当电池包200连接到电池包200协调子模块时,电池包第一端口201和电池包第二端口202分别与电池包协调子模块134的对应物理接口连接。A communication connection is established between the battery pack 200 and the battery pack coordination sub-module 134, and between the power tool 300 and the battery pack 200 by using serial communication. Specifically, referring to FIG. 3, the battery pack 200 has two physical interfaces, a battery pack first port 201 and a battery pack second port 202; the power tool 300 has two physical interfaces, a tool second port 301 and a tool second port. 302; when the power tool 300 is connected to the battery pack 200, the battery pack first port 201 and the battery pack second port 202 are connected to the tool first port 301 and the tool second port 302, respectively. The battery pack coordination sub-module 134 has a physical interface corresponding to the battery pack first port 201 and the battery pack second port 202 for establishing communication with the battery pack 200 for charging and discharging management or data transmission, when the battery pack 200 When connected to the battery pack 200 coordination sub-module, the battery pack first port 201 and the battery pack second port 202 are respectively connected to corresponding physical interfaces of the battery pack coordination sub-module 134.
当电池包200、电动工具300、便携式电源装置100、电池包充电装置等电子装置软件出现问题或需要对已经出货的产品进行程序更改或软件升级时,需要拆机并且扣胶实现产品软件的更改,这不但需要投入极大的人力物力,而且也会延期项目周期,为此,迫切需要一种方便快捷的程序更新方法。When there is a problem in the electronic device software such as the battery pack 200, the power tool 300, the portable power supply device 100, the battery pack charging device, or a program change or a software upgrade is required for the already shipped product, it is necessary to disassemble the device and implement the product software. Change, this not only requires a lot of manpower and material resources, but also delays the project cycle. For this reason, there is an urgent need for a convenient and quick program update method.
为解决上述问题,本公开提供一种适用于上述电子装置的程序更新方法,下面以便携式电源装置100为例进行说明。需要注意的是,以下仅是以便携式电源装置作为电子装置进行示例性说明,并不构成对本公开的限制。In order to solve the above problems, the present disclosure provides a program updating method suitable for the above electronic device. Hereinafter, the portable power source device 100 will be described as an example. It should be noted that the following is merely illustrative of a portable power supply device as an electronic device, and does not constitute a limitation of the present disclosure.
在本实施例中,应用引导加载程序来进行产品程序更新。引导加载程序(BOOTLOADER)是微控制器(Microcontroller Unit,以下简称“MCU”)对自身部分闪存的操作实现应用程序的更改,从而实现产品固件升级。这样,就可以通过产品上的预留通信接口与产品内部的MCU进行通信,使MCU调用引导加载程序对应用程序进行更改,实现产品固件的更新和升级。对于便携式电源装置100中具有微控制器的各个模块而言,均可通过引导加载程序来进行程序更新。In this embodiment, a boot loader is applied to perform product program updates. The boot loader (BOOTLOADER) is a microcontroller (Microcontroller Unit, hereinafter referred to as "MCU") that implements application changes to its own part of the flash memory to implement product firmware upgrade. In this way, it is possible to communicate with the MCU inside the product through the reserved communication interface on the product, so that the MCU calls the boot loader to make changes to the application, and implements product firmware update and upgrade. For each module having a microcontroller in the portable power supply device 100, program update can be performed by a boot loader.
参照图4,利用引导加载程序实现程序更新,在一些具体的实施方式中,利用引导加载程序进行固件升级。固件(firmware),又叫韧件,是一种嵌入在硬件装置中的软件,通常它是位于快闪存储器中,而且可以让使用者更新。在设计产品的固件程序时,需要编写两部分程序,第一部分程序不执行正常的功能操作,仅通过通信方式接收外部数据和指令、校验第二部分程序的信息(是否完 整、版本信息等)、对第二部分程序进行更新,第一部分程序即为引导加载程序401;第二部分程序是对应的产品功能代码,即为应用程序402。在本实施例中,主控模块132和所述逆变模块131具有微控制器,主控模块132和逆变模块131的存储单元存储有第一部分程序和第二部分程序,所述微控制器被配置为执行所述第一部分程序以更新所述第二部分程序。当然,便携式电源装置100不限于仅包括主控模块132和逆变模块131,还可以包括其他模块,其他模块中相应的也包括上述第一部分程序和第二部分程序,通信模块120还可以对其他模块的程序进行更新或升级。Referring to Figure 4, program updates are implemented using a boot loader, and in some specific implementations, firmware upgrades are performed using a boot loader. Firmware, also known as firmware, is a piece of software embedded in a hardware device. It is usually located in flash memory and can be updated by the user. When designing the firmware program of the product, it is necessary to write a two-part program. The first part of the program does not perform normal function operations, only receives external data and instructions by communication, and verifies the information of the second part of the program (whether complete, version information, etc.) The second part of the program is updated, the first part of the program is the boot loader 401; the second part of the program is the corresponding product function code, that is, the application 402. In this embodiment, the main control module 132 and the inverter module 131 have a microcontroller, and the storage unit of the main control module 132 and the inverter module 131 stores a first partial program and a second partial program, the microcontroller It is configured to execute the first partial program to update the second partial program. Of course, the portable power supply device 100 is not limited to only including the main control module 132 and the inverter module 131, and may also include other modules. The other modules also include the first partial program and the second partial program, and the communication module 120 may also be used for other The module's program is updated or upgraded.
MCU的闪存400根据实际情况给引导加载程序401和应用程序402分配存储空间,例如,闪存400给引导加载程序401分配SA0与SA1两个存储空间,给应用程序403分配SA2存储区域。闪存中还可以存储有关于设备的身份信息403,在可以存储在SA3区域。在一些实施例中,所述的身份信息包括关于该设备的唯一标识符。The flash memory 400 of the MCU allocates storage space to the boot loader 401 and the application 402 according to actual conditions. For example, the flash memory 400 allocates two storage spaces SA0 and SA1 to the boot loader 401, and allocates the SA2 storage area to the application 403. The identity information 403 about the device can also be stored in the flash memory, and can be stored in the SA3 area. In some embodiments, the identity information includes a unique identifier for the device.
引导加载程序401具有读写编程序功能,可以读出存储在闪存400中的数据信息,也可将数据信息写入存储器,还可以覆盖存储在闪存400中的全部应用程序,然后写入新的程序。引导加载程序401通过调用一些预定功能的命令来执行读取、写入和/或擦除。例如,调用读取命令“R”可以读出闪存400中的数据信息,调用擦除命令“E”可以擦除的任意一个存储器段或所有存储器段。调用写入命令“W”将数据写入到任意一个存储器段或所有存储器段。The boot loader 401 has a read/write program function, can read out data information stored in the flash memory 400, can also write data information into the memory, and can overwrite all applications stored in the flash memory 400, and then write new ones. program. The boot loader 401 performs reading, writing, and/or erasing by invoking commands of some predetermined functions. For example, the read command "R" can be read out of the data information in the flash memory 400, and any one of the memory segments or all of the memory segments that can be erased by the erase command "E" is called. The write command "W" is called to write data to any memory segment or all memory segments.
引导加载程序401存储在MCU的闪存400中的可执行程序,能够读取闪存400中的数据或写入数据到闪存中的功能。当存储在闪存400中的应用程序需要更新时,就可通过将引导加载程序401将新的应用程序402写入到的应用程序区,以用新的应用程序代替原来的应用程序。The boot loader 401 stores an executable program in the flash memory 400 of the MCU, a function capable of reading data in the flash memory 400 or writing data into the flash memory. When the application stored in the flash memory 400 needs to be updated, the original application can be replaced with the new application by writing the new application 402 to the application area by the boot loader 401.
由于引导加载程序401和应用程序均存储在MCU的闪存4000中,如果MCU调用的程序的地址发生错误,那么MCU就可能会错误的执行引导加载程序401。为了解决这一问题,在实际操作中,可以通过引入升级密钥来解决,升级密钥用于开启程序更新,以避免调用程序出错,造成电子装置软件系统紊乱,影响电子装置正常工作,甚至损坏电子装置或造成安全事故。Since the boot loader 401 and the application are both stored in the flash memory 4000 of the MCU, if the address of the program called by the MCU is incorrect, the MCU may execute the boot loader 401 erroneously. In order to solve this problem, in actual operation, it can be solved by introducing an upgrade key, which is used to open the program update to avoid the call program error, causing the electronic device software system to be disordered, affecting the normal operation of the electronic device, or even damage. Electronic devices or cause a safety accident.
电池包200、电动工具300、便携式电源装置100、电池包充电装置等电子 装置等均可通过应用引导加载程序进行软件更新和升级。下面以便携式电能系统为例,说明利用引导加载程序401对电动工具300、电池包200、便携式电源装置100进行程序更新的方法。The battery pack 200, the electric power tool 300, the portable power source device 100, the electronic device such as the battery pack charging device, and the like can be updated and upgraded by applying the boot loader. Hereinafter, a method of updating the power tool 300, the battery pack 200, and the portable power source device 100 by the boot loader 401 will be described using the portable power system as an example.
实施例一:通过数据总线进行程序更新。Embodiment 1: Program update through a data bus.
在总线通信系统中,上位机通过总线连接多个模块的MCU,上位机作为升级调度模块可采用总线调度方式选择性地更新挂载在数据总线上的任意一个或多个模块的程序。为了方便描述,将各个模块称为节点502。例如第一节点,称为节点1,第二节点,称为节点2......,第N节点称为节点N。In the bus communication system, the upper computer connects the MCUs of the plurality of modules through the bus, and the upper computer functions as an upgrade scheduling module to selectively update the program of any one or more modules mounted on the data bus by using a bus scheduling manner. For convenience of description, each module is referred to as a node 502. For example, the first node is called node 1, the second node is called node 2, ..., and the Nth node is called node N.
下面以便携式电源装置100为例进行说明。在本实施例中,升级调度模块为通信模块120,节点可以是通过数据总线连接到通信模块120上的任意模块,例如逆变模块131、主控模块132。下面以便携式电源装置100为例,具体说明通信模块120通过对主控模块132和/或以及逆变模块131进行程序更新的过程。Hereinafter, the portable power source device 100 will be described as an example. In this embodiment, the upgrade scheduling module is the communication module 120, and the node may be any module connected to the communication module 120 through a data bus, such as the inverter module 131 and the main control module 132. Hereinafter, the portable power supply device 100 will be taken as an example to specifically describe a process in which the communication module 120 performs program update on the main control module 132 and/or the inverter module 131.
作为一种实施方式,通信模块120对主控模块132的程序进行更新。在升级模式中,通信模块120被配置为:通过所述无线通信单元121接收外部设备的所述升级文件并将所述升级文件存储在所述存储单元122;在满足预设条件下,能够发送所述升级文件至控制模块以对控制模块的程序进行更新。在本实施例中,所述的控制模块为主控模块132。As an implementation manner, the communication module 120 updates the program of the main control module 132. In the upgrade mode, the communication module 120 is configured to receive the upgrade file of the external device through the wireless communication unit 121 and store the upgrade file in the storage unit 122; The upgrade file is updated to the control module to update the program of the control module. In this embodiment, the control module is the main control module 132.
一种适用于上述电子装置的程序更新方法,包括:A program update method suitable for the above electronic device, comprising:
通信模块120通过所述无线通信单元121接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元;The communication module 120 receives an upgrade file from the external device through the wireless communication unit 121 and stores the upgrade file in the storage unit;
在满足预设条件下,所述通信模块120将所述升级文件发送至所述主控模块132;所述主控模块132根据所述升级文件更新自身的程序。在本实施例中,所述的电子装置为便携式电源装置100。The communication module 120 sends the upgrade file to the main control module 132 when the preset condition is met; the main control module 132 updates its own program according to the upgrade file. In the embodiment, the electronic device is a portable power supply device 100.
所述预设条件包括所述通信模块120接收到来自所述主控模块132的升级请求。所述升级文件包含程序结束标识,所述主控模块132在未接收到所述程序结束标识时发送所述升级请求给所述通信模块120。所述的程序结束标识位于升级文件中的升级程序的结束处,如果主控模块132接收到程序结束标识,则表示接收到的升级文件中的升级程序是完整的,主控模块132可以使用该升级 文件进行自身程序更新,相反地,如果主控模块132没有接收到程序结束标识,则表示接收到的升级文件中的升级程序是不完整的,如果使用该升级文件进行程序更新,则会使得软件系统紊乱,影响电子装置正常工作,甚至损坏电子装置或造成安全事故。由于本公开中的电子装置是电池包领域和电动工具领域,其对装置的安全性和可靠性要求较高,因此,为了防止接收到的不完整的升级文件和升级程序对电子装置造成影响,本公开设置预设条件,在所述主控模块132没有接收到所述升级文件中的程序结束标识时发送所述升级请求给所述通信模块120,通信模块120件存储在存储单元122中的升级文件发送给主控模块132,这样,主控模块132就可以利用重新接收到的升级文件对自身程序进行更新。通过这样的方式,可以使电子装置在正确的更新后的程序下正常工作,电子装置运行和程序更新过程更加安全可靠。The preset condition includes the communication module 120 receiving an upgrade request from the main control module 132. The upgrade file includes a program end identifier, and the main control module 132 sends the upgrade request to the communication module 120 when the program end identifier is not received. The program end identifier is located at the end of the upgrade program in the upgrade file. If the main control module 132 receives the program end identifier, it indicates that the upgrade program in the received upgrade file is complete, and the main control module 132 can use the The upgrade file performs its own program update. Conversely, if the main control module 132 does not receive the program end identifier, it indicates that the upgrade program in the received upgrade file is incomplete. If the upgrade file is used for program update, the The software system is disordered, affecting the normal operation of the electronic device, or even damaging the electronic device or causing a safety accident. Since the electronic device in the present disclosure is in the field of battery packs and power tools, it requires high safety and reliability of the device, and therefore, in order to prevent the received incomplete upgrade files and upgrade programs from affecting the electronic device, The present disclosure sets a preset condition, and when the main control module 132 does not receive the program end identifier in the upgrade file, sends the upgrade request to the communication module 120, and the communication module 120 is stored in the storage unit 122. The upgrade file is sent to the main control module 132, so that the main control module 132 can update its own program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correct updated program, and the electronic device operation and the program update process are more secure and reliable.
作为可选地,所述预设条件还可以是所述通信模块120接收到来自外部设备的升级请求。在联网的情况下,远程服务器20或移动终端设备21发送升级请求给便携式电源装置100的通信模块120,以对便携式电源100中的至少一个模块的程序进行更新。Optionally, the preset condition may further be that the communication module 120 receives an upgrade request from an external device. In the case of networking, the remote server 20 or the mobile terminal device 21 transmits an upgrade request to the communication module 120 of the portable power supply device 100 to update the program of at least one of the portable power sources 100.
本公开还提供一种适用于上述电子装置的程序更新方法,包括:The present disclosure also provides a program update method applicable to the above electronic device, including:
通信模块120通过所述无线通信单元121接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元;The communication module 120 receives an upgrade file from the external device through the wireless communication unit 121 and stores the upgrade file in the storage unit;
在满足预设条件下,所述通信模块120将所述升级文件发送至所述主控模块132;所述主控模块132根据所述升级文件更新自身的程序。在本实施例中,所述的电子装置为便携式电源装置100。The communication module 120 sends the upgrade file to the main control module 132 when the preset condition is met; the main control module 132 updates its own program according to the upgrade file. In the embodiment, the electronic device is a portable power supply device 100.
作为一种实施方式,在所述通信模块120接收到来自所述主控模块132的升级请求时,所述通信模块120将所述升级文件发送至所述主控模块132。As an implementation manner, when the communication module 120 receives an upgrade request from the main control module 132, the communication module 120 sends the upgrade file to the main control module 132.
具体地,所述升级文件包含程序结束标识,所述主控模块132在未接收到所述程序结束标识时发送所述升级请求给所述通信模块120。Specifically, the upgrade file includes a program end identifier, and the main control module 132 sends the upgrade request to the communication module 120 when the program end identifier is not received.
所述的程序结束标识位于升级文件中的升级程序的结束处,如果主控模块132接收到程序结束标识,则表示接收到的升级文件中的升级程序是完整的,主控模块132可以使用该升级文件进行自身程序更新,相反地,如果主控模块132没有接收到程序结束标识,则表示接收到的升级文件中的升级程序是不完整的, 如果使用该升级文件进行程序更新,则会使得软件系统紊乱,影响电子装置正常工作,甚至损坏电子装置或造成安全事故。由于本公开中的电子装置是电池包领域和电动工具领域,其对装置的安全性和可靠性要求较高,因此,为了防止接收到的不完整的升级文件和升级程序对电子装置造成影响,本公开设置预设条件,在所述主控模块132没有接收到所述升级文件中的程序结束标识时发送所述升级请求给所述通信模块120,通信模块120件存储在存储单元122中的升级文件发送给主控模块132,这样,主控模块132就可以利用重新接收到的升级文件对自身程序进行更新。通过这样的方式,可以使电子装置在正确的更新后的程序下正常工作,电子装置运行和程序更新过程更加安全可靠。。The program end identifier is located at the end of the upgrade program in the upgrade file. If the main control module 132 receives the program end identifier, it indicates that the upgrade program in the received upgrade file is complete, and the main control module 132 can use the The upgrade file performs its own program update. Conversely, if the main control module 132 does not receive the program end identifier, it indicates that the upgrade program in the received upgrade file is incomplete. If the upgrade file is used for program update, the The software system is disordered, affecting the normal operation of the electronic device, or even damaging the electronic device or causing a safety accident. Since the electronic device in the present disclosure is in the field of battery packs and power tools, it requires high safety and reliability of the device, and therefore, in order to prevent the received incomplete upgrade files and upgrade programs from affecting the electronic device, The present disclosure sets a preset condition, and when the main control module 132 does not receive the program end identifier in the upgrade file, sends the upgrade request to the communication module 120, and the communication module 120 is stored in the storage unit 122. The upgrade file is sent to the main control module 132, so that the main control module 132 can update its own program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correct updated program, and the electronic device operation and the program update process are more secure and reliable. .
作为另一种实施方式,在所述通信模块120接收到来自外部设备的升级请求时,所述通信模块120将所述升级文件发送至所述主控模块132。As another implementation manner, when the communication module 120 receives an upgrade request from an external device, the communication module 120 sends the upgrade file to the main control module 132.
在一些实施方式中,通信模块120通过数据总线发送升级文件至主控模块132。当然,通信模块120还可以通过普通数据线发送升级文件至主控模块132。In some embodiments, the communication module 120 sends the upgrade file to the main control module 132 over the data bus. Of course, the communication module 120 can also send the upgrade file to the main control module 132 through the normal data line.
参照图5,作为一种实施方式,通信模块120对主控模块132的程序进行更新,具体过程如下:Referring to FIG. 5, as an implementation manner, the communication module 120 updates the program of the main control module 132, and the specific process is as follows:
S51:通信模块120发送升级指令所述主控模块132;S51: The communication module 120 sends the upgrade command to the main control module 132;
在此之前,通信模块120已经通过所述无线通信单元121接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元122。Prior to this, the communication module 120 has received an upgrade file from the external device through the wireless communication unit 121 and stores the upgrade file in the storage unit 122.
作为一种实施方式,通信模块120通过所述无线通信单元121同时接收来自外部设备的升级请求和升级文件,并响应于所述升级请求发送升级指令至所述主控模块132。作为另一种实施方式,在主控模块132未接收到所述程序结束标识时,也即是说主控模块132接收到的升级文件中的升级文件不完整时,主动向通信模块120发送升级请求,通信模块120响应于所述升级请求发送升级指令至所述主控模块132。As an implementation manner, the communication module 120 simultaneously receives an upgrade request and an upgrade file from the external device through the wireless communication unit 121, and sends an upgrade instruction to the main control module 132 in response to the upgrade request. As another implementation manner, when the main control module 132 does not receive the program end identifier, that is, when the upgrade file in the upgrade file received by the main control module 132 is incomplete, the upgrade is actively sent to the communication module 120. The request, the communication module 120 sends an upgrade instruction to the main control module 132 in response to the upgrade request.
S52:主控模块132发送升级响应至通信模块120;S52: The main control module 132 sends an upgrade response to the communication module 120;
主控模块132接收到升级指令后,停止原先工作,并判断是否是自身的升级指令,如果是,如果是则进入升级模式,如果不是,则继续维持监听状态。After receiving the upgrade command, the main control module 132 stops the original work and determines whether it is its own upgrade command. If yes, if it is, it enters the upgrade mode, and if not, continues to maintain the monitor state.
如果逆变模块131和主控模块132通过数据总线连接到通信模块120,通信 模块120通过数据总线发送升级文件至主控模块132或逆变模块131,此时逆变模块131进行同样的工作,即逆变模块132从数据总线上接收到升级指令,停止原先工作,并判断是否是自身的升级指令,如果是,如果是则进入升级模式,如果不是,则继续维持监听状态。由于在本实施例中,是对主控模块132的程序更新,因此,主控模块132判断是对自身的升级指令,进入升级模式,而逆变模块131继续维持监听状态。此处的监听状态可以理解为待机状态,指的是节点停止当前工作,并实时监视总线上是否有对自身的指令。在一些实施方式中,升级指令包含节点的身份信息,节点的身份信息为各个节点所具有的区别于其他节点的唯一标识符。在本实施例中,主控模块132和逆变模块131通过判断升级指令中包含的唯一标识符是否与自身的唯一标识符匹配来判断该升级指令是否是对自身的升级指令。在节点判断是对自身的升级指令后,通过数据总线发送升级响应(包含唯一标识符)给升级通信模块120。If the inverter module 131 and the main control module 132 are connected to the communication module 120 through the data bus, the communication module 120 sends the upgrade file to the main control module 132 or the inverter module 131 through the data bus, and the inverter module 131 performs the same work. That is, the inverter module 132 receives the upgrade command from the data bus, stops the original operation, and determines whether it is its own upgrade command. If yes, if it is, it enters the upgrade mode, and if not, continues to maintain the monitor state. In this embodiment, the program is updated to the main control module 132. Therefore, the main control module 132 determines that it is an upgrade command for itself, and enters the upgrade mode, and the inverter module 131 continues to maintain the listening state. The listening state here can be understood as the standby state, which means that the node stops the current work and monitors whether there is an instruction on itself on the bus in real time. In some embodiments, the upgrade instruction includes identity information of the node, and the identity information of the node is a unique identifier that each node has different from other nodes. In this embodiment, the main control module 132 and the inversion module 131 determine whether the upgrade instruction is an upgrade instruction for itself by determining whether the unique identifier included in the upgrade instruction matches its own unique identifier. After the node determines that it is an upgrade command for itself, the upgrade response (including the unique identifier) is sent to the upgrade communication module 120 via the data bus.
在本实施例中,由于是对主控模块132的程序更新,主控模块132判断是对自身的升级指令,然后通过数据总线发送升级响应给升级通信模块120。所述升级响应包含主控模块132的所述唯一标识符。In this embodiment, since it is a program update to the main control module 132, the main control module 132 determines that it is an upgrade instruction to itself, and then sends an upgrade response to the upgrade communication module 120 through the data bus. The upgrade response includes the unique identifier of the master module 132.
S53:通信模块120发送升级密钥至主控模块132;S53: the communication module 120 sends an upgrade key to the main control module 132;
作为可选地,通信模块120在接收到升级响应后发送升级密钥至主控模块132。Alternatively, the communication module 120 sends an upgrade key to the main control module 132 after receiving the upgrade response.
具体地,通信模块120根据升级响应中包含的唯一标识符,发送升级密钥给与所述唯一标识符相匹配的所述主控模块132或逆变模块131,与所述唯一标识符相匹配的所述主控模块132或逆变模块131在收到所述升级密钥后,反馈确认升级,进入程序更新过程。Specifically, the communication module 120 sends an upgrade key to the main control module 132 or the inverter module 131 that matches the unique identifier according to the unique identifier included in the upgrade response, and matches the unique identifier. After receiving the upgrade key, the main control module 132 or the inverter module 131 feeds back the upgrade and enters the program update process.
在本实施例中,由于是对主控模块132的程序更新,因此,通信模块120根据升级响应中包含的唯一标识符,发送升级密钥给主控模块132。In this embodiment, since it is a program update to the main control module 132, the communication module 120 transmits an upgrade key to the main control module 132 according to the unique identifier included in the upgrade response.
如上文所述,由于引导加载程序401和应用程序均存储在MCU的闪存4000中,如果MCU调用的程序的地址发生错误,那么MCU就可能会错误的执行引导加载程序401。引入升级密钥,用于开启程序更新,以避免调用程序出错,造成电子装置软件系统紊乱,影响电子装置正常工作,甚至损坏电子装置或造成安全事故。As described above, since the boot loader 401 and the application are both stored in the flash memory 4000 of the MCU, if the address of the program called by the MCU is incorrect, the MCU may erroneously execute the boot loader 401. The upgrade key is introduced to open the program update to avoid the error of the calling program, causing the electronic device software system to be disordered, affecting the normal operation of the electronic device, or even damaging the electronic device or causing a security accident.
S54:主控模块132回复确认升级给通信模块120。S54: The main control module 132 replies to confirm the upgrade to the communication module 120.
作为可选地,主控模块132在接收到通信模块120的升级密钥后,回复确认升级给通信模块120。Optionally, after receiving the upgrade key of the communication module 120, the main control module 132 replies and confirms the upgrade to the communication module 120.
S55:通信模块120发送第一个升级数据包给主控模块132。S55: The communication module 120 sends the first upgrade data packet to the main control module 132.
所述通信模块120在收到确认升级信息后,发送所述升级文件至与发送所述升级响应对应的所述主控模块132或逆变模块131。在本实施例中,由于是对主控模块132的程序更新,因此,通信模块120根据升级响应中包含的唯一标识符,发送所述升级文件至给主控模块132。通信模块120将升级文件分成多个升级数据包并编号,然后按照编号顺序发送升级数据包按照升级数据包至主控模块132。通信模块120首先发送第一个升级数据包给主控模块132。主控模块132接收到升级数据包后,确认收到的升级数据包是否正确,如果正确,则回复正确信息给通信模块120。具体地,可以通过校验位确认升级数据包是否正确。After receiving the confirmation upgrade information, the communication module 120 sends the upgrade file to the main control module 132 or the inverter module 131 corresponding to the upgrade response. In this embodiment, since it is a program update to the main control module 132, the communication module 120 transmits the upgrade file to the main control module 132 according to the unique identifier included in the upgrade response. The communication module 120 divides the upgrade file into a plurality of upgrade data packets and numbers them, and then sends the upgrade data packets in the numbered order according to the upgrade data package to the main control module 132. The communication module 120 first sends the first upgrade data packet to the main control module 132. After receiving the upgrade data packet, the main control module 132 confirms whether the received upgrade data packet is correct, and if correct, returns the correct information to the communication module 120. Specifically, it can be confirmed by the check digit whether the upgrade data packet is correct.
S56:通信模块120发送第二个升级数据包给主控模块132。S56: The communication module 120 sends a second upgrade data packet to the main control module 132.
同样地,通信模块120按照上述方法发送第二个升级数据包给主控模块132。Similarly, the communication module 120 sends the second upgrade data packet to the main control module 132 according to the above method.
主控模块132接收到升级数据包后,确认收到的升级数据包是否正确,如果正确,则回复正确信息给通信模块120。After receiving the upgrade data packet, the main control module 132 confirms whether the received upgrade data packet is correct, and if correct, returns the correct information to the communication module 120.
S57:升级数据包全部发送完毕,通信模块120发送升级结束指令。S57: After the upgrade data packet is completely transmitted, the communication module 120 sends an upgrade end instruction.
在接收到被分割成多个升级数据包的升级文件后,主控模块132根据升级文件更新自身程序。After receiving the upgrade file divided into a plurality of upgrade data packages, the main control module 132 updates its own program according to the upgrade file.
S58:主控模块132发送升级结束反馈至通信模块120。S58: The main control module 132 sends an upgrade end feedback to the communication module 120.
主控模块132根据升级文件完成自身程序更新后发送升级结束反馈至通信模块120,主控模块132恢复正常工作状态。如果通信模块没有接收到升级结束反馈,则表示主控模块没有完成升级或升级不成功,在通信模块120未接收到所述主控模块132升级结束反馈时,通信模块120发送升级指令至所述主控模块132,这样,没有完成升级的主控模块132就可以利用重新接收到的升级文件对自身程序进行更新。通过这样的方式,可以使电子装置在正确完全地更新后的程序下正常工作,电子装置运行和程序更新过程更加安全可靠。The main control module 132 sends an upgrade end feedback to the communication module 120 after completing the update of the program according to the upgrade file, and the main control module 132 returns to the normal working state. If the communication module does not receive the upgrade end feedback, it indicates that the main control module has not completed the upgrade or the upgrade is unsuccessful. When the communication module 120 does not receive the upgrade control feedback of the main control module 132, the communication module 120 sends an upgrade command to the The main control module 132, in this way, the main control module 132 that has not completed the upgrade can update its own program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correctly updated program, and the electronic device operation and the program update process are more secure and reliable.
上述实施方式仅是通信模块120通过数据总线对主控模块132的程序更新 的过程,而在升级模式下,通信模块120通过数据总线对逆变模块131以及其他模块的程序更新过程类似上述过程,此处不再赘述。The above embodiment is only a process in which the communication module 120 updates the program of the main control module 132 through the data bus. In the upgrade mode, the program update process of the communication module 120 to the inverter module 131 and other modules through the data bus is similar to the above process. I will not repeat them here.
上述实施方式仅是对主控模块132进行的程序更新过程。在其他一些实施方式中,通信模块120按照预设的顺序对挂载在数据总线上的多个或全部节点进行程序更新。The above embodiment is only a program update process performed by the main control module 132. In some other implementations, the communication module 120 performs program updates on a plurality of or all of the nodes mounted on the data bus in a predetermined order.
作为一种实施方式,通信模块120对主控模块132和逆变模块的程序进行更新,具体过程如下:As an implementation manner, the communication module 120 updates the programs of the main control module 132 and the inverter module, and the specific process is as follows:
所述通信模块120通过所述无线通信单元121接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元122;The communication module 120 receives an upgrade file from an external device through the wireless communication unit 121 and stores the upgrade file in the storage unit 122;
在满足预设条件下,所述通信模块120发送升级指令至所述数据总线;The communication module 120 sends an upgrade instruction to the data bus when the preset condition is met;
所述主控模块132和逆变模块131从所述数据总线上接收到所述升级指令后停止工作,进入监听状态;After receiving the upgrade instruction from the data bus, the main control module 132 and the inverter module 131 stop working and enter a listening state;
所述主控模块132和逆变模块131判断所述升级指令是否是对应自身的升级指令,如果是则进入升级模式,如果不是,则继续维持监听状态;The main control module 132 and the inversion module 131 determine whether the upgrade instruction is an upgrade instruction corresponding to itself, and if yes, enter an upgrade mode, and if not, continue to maintain the listening state;
所述主控模块132和所述逆变模块131之一判断是对自身的升级指令后发送升级响应至所述数据总线;One of the main control module 132 and the inverter module 131 determines to send an upgrade response to the data bus after upgrading the command;
所述通信模块120从所述数据总线接收到所述升级响应后,通过所述数据总线发送所述升级文件至与发送所述升级响应对应的所述主控模块132或逆变模块131;After receiving the upgrade response from the data bus, the communication module 120 sends the upgrade file to the main control module 132 or the inverter module 131 corresponding to the upgrade response by using the data bus;
所述主控模块132或逆变模块131在接收到所述升级文件后根据所述升级文件更新自身的程序。The main control module 132 or the inverter module 131 updates its own program according to the upgrade file after receiving the upgrade file.
所述预设条件如上所述,此处不再赘述。作为一种实施方式,在所述通信模块120接收到来自所述主控模块132或所述逆变模块131的升级请求时,所述通信模块发送升级指令至所述数据总线。所述升级文件包含程序结束标识,所述主控模块132或逆变模块131在未接收到所述程序结束标识时发送所述升级请求至所述通信模块120。如果主控模块132接收到程序结束标识,则表示接收到的升级文件中的升级程序是完整的,主控模块132可以使用该升级文件进行自身程序更新,相反地,如果主控模块132或逆变模块131没有接收到程序 结束标识,则表示接收到的升级文件中的升级程序是不完整的,如果使用该升级文件进行程序更新,则会使得软件系统紊乱,影响电子装置正常工作,甚至损坏电子装置或造成安全事故。由于本公开中的电子装置属于电池包领域和电动工具领域,其对装置的安全性和可靠性要求较高,因此,为了防止接收到的不完整的升级文件和升级程序对电子装置造成影响,本公开设置预设条件,在所述主控模块132或逆变模块131没有接收到所述升级文件中的程序结束标识时发送所述升级请求给所述通信模块120,通信模块120件存储在存储单元122中的升级文件发送给主控模块132或逆变模块131,这样,主控模块132或逆变模块131就可以利用重新接收到的升级文件对自身程序进行更新。通过这样的方式,可以使电子装置在正确的更新后的程序下正常工作,程序运行安全可靠。The preset conditions are as described above, and are not described herein again. As an implementation manner, when the communication module 120 receives an upgrade request from the main control module 132 or the inverter module 131, the communication module sends an upgrade instruction to the data bus. The upgrade file includes a program end identifier, and the main control module 132 or the inverter module 131 sends the upgrade request to the communication module 120 when the program end identifier is not received. If the main control module 132 receives the program end identifier, it indicates that the upgrade program in the received upgrade file is complete, and the main control module 132 can use the upgrade file to perform its own program update. Conversely, if the main control module 132 or the reverse If the variable module 131 does not receive the program end identifier, it indicates that the upgrade program in the received upgrade file is incomplete. If the upgrade file is used to update the program, the software system may be disordered, affecting the normal operation of the electronic device, or even being damaged. Electronic devices or cause a safety accident. Since the electronic device in the present disclosure belongs to the field of battery packs and power tools, it has high requirements on the safety and reliability of the device, and therefore, in order to prevent the received incomplete upgrade files and upgrade programs from affecting the electronic device, The present disclosure sets a preset condition, and sends the upgrade request to the communication module 120 when the main control module 132 or the inverter module 131 does not receive the program end identifier in the upgrade file, and the communication module 120 is stored in the The upgrade file in the storage unit 122 is sent to the main control module 132 or the inverter module 131, so that the main control module 132 or the inverter module 131 can update the self program by using the re-acquired upgrade file. In this way, the electronic device can be normally operated under the correct updated program, and the program runs safely and reliably.
在所述通信模块120接收到来自外部设备的升级请求时,所述通信模块发送升级指令至所述数据总线。When the communication module 120 receives an upgrade request from an external device, the communication module sends an upgrade instruction to the data bus.
所述主控模块132和逆变模块131具有唯一标识符,所述升级响应包含所述唯一标识符。The master module 132 and the inverter module 131 have unique identifiers, and the upgrade response includes the unique identifier.
所述程序更新方法还包括:所述通信模块120在接收到所述升级响应后,根据所述升级响应中包含的所述唯一标识符,发送升级密钥给与所述唯一标识符相匹配的所述主控模块132或所述逆变模块131,与所述唯一标识符相匹配的所述主控模块132或所述逆变模块131在收到所述升级密钥后,进入程序更新过程。The program update method further includes: after receiving the upgrade response, the communication module 120 sends an upgrade key to match the unique identifier according to the unique identifier included in the upgrade response. The main control module 132 or the inverter module 131, the main control module 132 or the inverter module 131 matching the unique identifier enters the program update process after receiving the upgrade key. .
所述通信模块120按照预设顺序发送所述升级文件至所述主控模块132和所述逆变模块131。The communication module 120 sends the upgrade file to the main control module 132 and the inverter module 131 in a preset order.
所述程序更新方法还包括:所述主控模块132或逆变模块131在完成自身程序更新后,发送升级结束反馈至所述通信模块120;在所述通信模块120未接收到所述主控模块132和所述逆变模块131的升级结束反馈时,所述通信模块120发送升级指令至所述数据总线,以进行强制升级。在对多个模块进行升级时,通过在每个模块升级结束后发送升级结束反馈给通信装置120,这样,可以使得电子装置在有模块没有升级完成时,通信模块120重新发送升级指令给对应模块,进行主动升级,以避免未完全升级导致电子装置系统紊乱,影响电子装置正常工作,甚至损坏电子装置或造成安全事故。由于本公开中的电子装置是电 池包领域和电动工具领域,其对安全性和可靠性要求较高,因此,为了防止未完全升级对电子装置的正常工作造成影响,设置升级结束反馈,在所述通信模块120未接收到所述主控模块132和所述逆变模块131的升级结束反馈时,所述通信模块120发送升级指令至所述数据总线,这样,没有完成升级的模块就可以利用重新接收到的升级文件对自身程序进行更新。通过这样的方式,可以使电子装置在正确完全地更新后的程序下正常工作,程序运行更加安全可靠。The program update method further includes: after completing the self-program update, the main control module 132 or the inverter module 131 sends an upgrade end feedback to the communication module 120; the communication module 120 does not receive the main control When the upgrade of the module 132 and the inverter module 131 is ended, the communication module 120 sends an upgrade command to the data bus for forced upgrade. When upgrading a plurality of modules, the upgrade end feedback is sent to the communication device 120 after the upgrade of each module is completed. Thus, when the electronic device is not upgraded, the communication module 120 resends the upgrade command to the corresponding module. Active upgrade to avoid the electronic device system disorder caused by incomplete upgrade, affect the normal operation of the electronic device, or even damage the electronic device or cause a safety accident. Since the electronic device in the present disclosure is in the field of battery packs and power tools, it has high requirements on safety and reliability. Therefore, in order to prevent the incomplete upgrade from affecting the normal operation of the electronic device, the upgrade end feedback is set. When the communication module 120 does not receive the upgrade end feedback of the main control module 132 and the inverter module 131, the communication module 120 sends an upgrade instruction to the data bus, so that the module that has not completed the upgrade can be utilized. The re-received upgrade file updates its own program. In this way, the electronic device can be normally operated under the program that is correctly and completely updated, and the program operation is more secure and reliable.
作为一种实施方式,图6和图7是通信模块120和各个节点在升级模式下工作过程。参照图6,通信模块120在升级模式下的工作过程如下:As an embodiment, FIG. 6 and FIG. 7 are processes in which the communication module 120 and each node operate in an upgrade mode. Referring to FIG. 6, the working process of the communication module 120 in the upgrade mode is as follows:
S61:保存来自外部设备(例如远程服务器20、移动终端设备21)的升级文件;S61: save an upgrade file from an external device (for example, the remote server 20, the mobile terminal device 21);
S62:按照预设的顺序依次对各个节点进行升级;S62: Upgrade each node in sequence according to a preset order;
S63:发送对节点N的升级指令;S63: Send an upgrade instruction to the node N.
S64:发送第N个升级数据包;S64: Send the Nth upgrade data packet;
S65:节点N升级完成,发送节点N升级结束指令;S65: the node N upgrade is completed, and the node N upgrade end instruction is sent;
S66:判断是否全部节点升级结束,如果是,则转至步骤S67,如果否,则转至下一个节点N(N=N+1)后,转至步骤S62;S66: determining whether all nodes are upgraded, if yes, go to step S67, if no, go to the next node N (N = N + 1), then go to step S62;
S67:广播式发送全部升级结束指令。S67: Broadcast all the upgrade end instructions.
在升级过程中,可能会发生异常情况,导致节点接收到的升级程序不完整,从而影响节点的正常工作。为此,可以通过设置程序结束标识来解决这一问题。During the upgrade process, an abnormal situation may occur, causing the upgrade program received by the node to be incomplete, thus affecting the normal operation of the node. To do this, you can solve this problem by setting the program end flag.
在本实施例中,所述升级文件包含程序结束标识,节点例如(主控模块132或所述逆变模块131)判断是否接收到所述程序结束标识,如果否,则主动发送升级请求给所述通信模块120,以主动请求更新程序。通过这样的方式,确保接收到的升级文件是完整地可执行的且安全可靠,使得电子装置在程序更新结束后能够安全可靠地运行,而不会因为不完整的程序使得程序更新后软件系统紊乱,影响正常工作,甚至带来安全事故。In this embodiment, the upgrade file includes a program end identifier, and the node, for example, (the main control module 132 or the inverter module 131) determines whether the program end identifier is received, and if not, actively sends an upgrade request to the node. The communication module 120 is configured to actively request an update procedure. In this way, it is ensured that the received upgrade file is completely executable and safe and reliable, so that the electronic device can run safely and reliably after the program update ends, without causing the software system to be disordered after the program update due to the incomplete program. , affecting normal work and even bringing security incidents.
具体而言,可以在接收到升级结束指令后,校验该节点接收到的升级程序中是否有升级结束标识,如果没有,则表示本次接收到的升级程序异常(不完整),那么该节点会进入强制升级模式,该节点发送升级请求给通信模块120(满 足预设条件),通信模块120重新发送该节点的升级指令,对该节点进行重新升级。在上述实施方式中,是通信模块120发起升级指令进行相应节点的升级过程,而在另一些实施方式中,节点可以进行强制升级,在该模式下,节点主动发起升级请求(包含节点身份信息),通信模块120则进入被动升级模式,对相应的节点进行升级。Specifically, after receiving the upgrade end instruction, it may be verified whether there is an upgrade end identifier in the upgrade program received by the node, and if not, it indicates that the upgrade program received this time is abnormal (incomplete), then the node The node enters the forced upgrade mode, and the node sends an upgrade request to the communication module 120 (the preset condition is met), and the communication module 120 resends the upgrade instruction of the node, and re-upgrades the node. In the above embodiment, the communication module 120 initiates an upgrade instruction to perform an upgrade process of the corresponding node, and in other embodiments, the node may perform a forced upgrade. In this mode, the node actively initiates an upgrade request (including node identity information). The communication module 120 enters the passive upgrade mode and upgrades the corresponding node.
需要说明的是,通信模块120在对各个节点进行程序更新的过程中,可能会因为异常(断电、断网)情况导致通信模块120接收到的升级文件中的程序异常,导致程序更新过程无法正常进行。而本公开的通信模块120的存储单元122能保留最新的正确的升级程序和升级文件,以在需要程序更新时能够调用该问升级文件和升级程序以完成节点升级,在本实施例中,通信模块120的存储单元122用于存储最新的正确的升级程序或升级文件。It should be noted that, in the process of updating the program of each node, the communication module 120 may cause an abnormality in the upgrade file received by the communication module 120 due to an abnormality (power failure or network disconnection), and the program update process may not be performed. Work properly. The storage unit 122 of the communication module 120 of the present disclosure can retain the latest correct upgrade program and upgrade file, so that the upgrade file and the upgrade program can be called to complete the node upgrade when the program update is needed. In this embodiment, the communication is performed. The storage unit 122 of the module 120 is used to store the latest correct upgrade program or upgrade file.
连接到通信模块120的各个节点的升级过程是一个紧密合作的节点升级系统。由于本公开的电子装置适用于电动工具领域和电池包领域,对电子装置的安全性和可靠性要求较高,因此,通过总线连接的各个节点需同步进入升级模式或监听状态,以及退出升级模式,以避免电子装置在工作模式时,突然进入升级模式一更新程序而可能造成安全事故。例如,便携式电源装置100在输出电能给外部设备(例,烧烤架)使用时,在正常工作状态下突然开始升级使程序更新,可能导致便携式电源的输出功率或工作模式突然变化而对外部设备造成损害甚至引发安全事故;对电动工具300而言,电动工具300正常工作时,电机转动,当从正常工作模式下突然进入升级模式,正在工作的电机仍然运转但由于程序正在更新,电机的运转可能突然发生不可预期的变化,损害电动工具甚至造成安全事故。参照图7,各个节点在升级模式下的工作过程如下,所述的节点为通过总线方式连接到通信模块120的各个模块,对便携式电源装置100而言,上述节点可以是连接到通信模块120的主控模块132和逆变模块131。The upgrade process connected to each node of the communication module 120 is a closely coordinated node upgrade system. Since the electronic device of the present disclosure is applicable to the field of power tools and the field of battery packs, the safety and reliability of the electronic device are required to be high. Therefore, each node connected through the bus needs to enter the upgrade mode or the monitor state simultaneously, and exit the upgrade mode. In order to avoid the electronic device in the working mode, suddenly enter the upgrade mode-update program and may cause a security accident. For example, when the portable power supply device 100 outputs power to an external device (for example, a grill), the upgrade is suddenly started in a normal working state to cause the program to be updated, which may cause the output power or the working mode of the portable power source to suddenly change and cause an external device. The damage even causes a safety accident; for the power tool 300, when the power tool 300 is working normally, the motor rotates, and when it enters the upgrade mode suddenly from the normal working mode, the working motor is still running but the operation of the motor may be due to the program being updated. Unexpected changes suddenly occur, damaging power tools and even causing safety accidents. Referring to FIG. 7, the working process of each node in the upgrade mode is as follows. The node is a module connected to the communication module 120 by a bus. For the portable power supply device 100, the node may be connected to the communication module 120. The main control module 132 and the inverter module 131.
S71:各个节点从数据总线上接收到通信模块120的升级指令;S71: Each node receives an upgrade instruction of the communication module 120 from the data bus;
S72:全部节点停止当前工作,进入监听状态;S72: All nodes stop the current work and enter the listening state;
S73:各个节点判断是否是对本节点的升级指令,如果是则转至步骤S74,进入升级模式,如果否,则转至步骤S72,继续保持监听状态;S73: Each node determines whether it is an upgrade instruction to the local node, if yes, the process goes to step S74 to enter the upgrade mode, and if not, the process goes to step S72 to continue to maintain the listening state;
S74:相应节点进入升级模式,发送升级响应(包括节点唯一标识符)至通 信模块120;S74: the corresponding node enters the upgrade mode, and sends an upgrade response (including the node unique identifier) to the communication module 120;
S75:接收来自通信模块120的升级密钥,确认升级;S75: Receive an upgrade key from the communication module 120, and confirm the upgrade;
S76:接收来自通信模块120的升级数据包并校验升级数据包是否正确;S76: Receive an upgrade data packet from the communication module 120 and verify whether the upgrade data packet is correct.
S77:升级数据包传输完成从总线上接收到升级结束指令;S77: The upgrade packet transmission completion receives an upgrade end instruction from the bus;
当各个节点在接收到升级结束指令后,需要对接收到的升级文件进行校验,如果发现接收到的程序异常(比如,程序不完整),节点会主动发送升级请求给通信模块120以进行主动升级,通信模块120在接收到该升级请求后(满足预设条件),重新发送升级文件给该节点。在接收到被分割成多个升级数据包的正确的升级文件后,主控模块132根据升级文件更新自身程序。各个节点在完成自身程序更新后,发送升级结束反馈至所述通信模块120。在通信模块120未接收到节点的升级结束反馈时,通信模块120发送升级指令至所述数据总线,以对程序更新不成功的节点重新进行程序更新。After receiving the upgrade end command, each node needs to check the received upgrade file. If the received program is found to be abnormal (for example, the program is incomplete), the node will actively send an upgrade request to the communication module 120 for active. After the upgrade, the communication module 120 resends the upgrade file to the node after receiving the upgrade request (the preset condition is met). After receiving the correct upgrade file that is split into multiple upgrade data packages, the main control module 132 updates its own program according to the upgrade file. After completing the self-program update, each node sends an upgrade end feedback to the communication module 120. When the communication module 120 does not receive the upgrade end feedback of the node, the communication module 120 sends an upgrade instruction to the data bus to re-program the program for the node whose program update is unsuccessful.
S78:判断是否是全部节点升级结束指令,如果是,则转至步骤S79,如果否,则转至下一节点后转至步骤S73;S78: determining whether it is a full node upgrade end command, if yes, then go to step S79, if not, then go to the next node, then go to step S73;
S78:全部节点升级结束,系统复位,全部节点恢复正常工作。S78: All nodes are upgraded, the system is reset, and all nodes resume normal operation.
通信模块120通过数据总线对需要升级的节点进行升级时,其发送到总线的数据通信格式包含目标节点的唯一标识符,例如,地址或SN序列号,是区别于其他节点的唯一标识符。通过匹配升级或程序更新对象的唯一标识符,使得升级过程或程序更新过程更安全可靠。When the communication module 120 upgrades a node that needs to be upgraded through the data bus, the data communication format transmitted to the bus includes a unique identifier of the target node, for example, an address or an SN sequence number, which is a unique identifier different from other nodes. The upgrade process or program update process is made more secure by matching the unique identifier of the upgrade or program update object.
参照图8和图9,以通信模块120对便携式电源装置100的主控模块132和逆变模块131为例,说明通信模块120通过数据总线按照顺序对各个节点进行程序更新的方法。Referring to FIG. 8 and FIG. 9, the communication module 120 takes the main control module 132 and the inverter module 131 of the portable power supply device 100 as an example, and describes a method in which the communication module 120 sequentially updates each node through the data bus.
包含升级程序的升级文件存储在远程服务器20,远程服务器20可以通过WIFI的方式直接将升级文件发送到通信模块120,也可以将升级文件发送或拷贝到移动终端设备21(ipad、手机等),然后利用移动终端设备21通过蓝牙方式将升级文件发送到通信模块120。The upgrade file containing the upgrade program is stored in the remote server 20, and the remote server 20 can directly send the upgrade file to the communication module 120 by means of WIFI, or send or copy the upgrade file to the mobile terminal device 21 (ipad, mobile phone, etc.). The upgrade file is then transmitted to the communication module 120 via the mobile terminal device 21 via Bluetooth.
具体地,远程服务器20通过WIFI的方式直接将升级文件发送到通信模块120进行程序更新的过程如下:当需要对便携式电源装置100需要进行程序更新 时,远程服务器20发送升级提示信息到用户手机APP上,用户选择升级,远程服务器20接收到用户升级命令后,通过WIFI方式发送升级文件到通信模块120,通信模块120作为通过数据总线以调度方式对挂载在数据总线上的主控模块132和逆变模块131进行程序更新。通信模块120发送对主控模块132和逆变模块131的升级指令到数据总线,各个模块一旦检测到总线上有升级指令,全部停止当前工作,并检测升级指令是否是对本节点的升级指令,如果不是,则继续保持监听状态,如果是,则进入升级模式。通信模块120按照预设的顺序对主控模块132和逆变模块131进行升级,升级或程序更新的方法如上所述,此处不再赘述。Specifically, the process in which the remote server 20 directly sends the upgrade file to the communication module 120 for program update by means of WIFI is as follows: when it is required to update the program of the portable power supply device 100, the remote server 20 sends the upgrade prompt information to the user mobile APP. The user selects the upgrade, and after receiving the user upgrade command, the remote server 20 sends the upgrade file to the communication module 120 through the WIFI mode, and the communication module 120 acts as a master module 132 and is mounted on the data bus in a scheduling manner through the data bus. The inverter module 131 performs program update. The communication module 120 sends an upgrade instruction to the main control module 132 and the inverter module 131 to the data bus. Each module detects that there is an upgrade instruction on the bus, stops all current operations, and detects whether the upgrade instruction is an upgrade instruction to the node. If not, then continue to monitor, and if so, enter upgrade mode. The communication module 120 upgrades the main control module 132 and the inverter module 131 in a preset order, and the method of upgrading or updating the program is as described above, and details are not described herein again.
综上所述,在本公开中,程序更新开启条件有三种方式:一是通信模块120在接收到远程服务器的升级文件和升级请求后就对需要升级的模块进行升级;二是通信模块120在接收到各个模块的升级请求(满足预设条件)后对需要升级的模块进行升级,该方式为各个模块主动要求程序更新;三是通信模块120在通过用户在移动终端设备上确认后在开始程序更新过程。In summary, in the present disclosure, the program update open condition has three ways: First, the communication module 120 upgrades the module that needs to be upgraded after receiving the upgrade file and the upgrade request of the remote server; second, the communication module 120 is After receiving the upgrade request of each module (the preset condition is met), the module that needs to be upgraded is upgraded, and the method is that the module actively requests the program update; and third, the communication module 120 starts the program after confirming by the user on the mobile terminal device. Update process.
对便携式电源装置100而言,在一些具体的实施方式中,数据总线为RS485总线,通信模块120作为上位机通过RS485总线与主控模块132和逆变模块131连接。参照图8,具体接线方式如下:正常工作模式下,主控模块132的串口的接收引脚RXD和发送引脚TXD都处于使能状态,逆变模块131的串口处于监听状态,即接收引脚RXD使能,发送引脚TXD处于普通I/O输入状态;升级模式下,当接收到总线的相应节点升级指令后,相应节点进入使能态,即相应节点的串口的接收引脚RXD和发送引脚TXD都处于使能状态,而另一模块的处于监听状态,待升级结束后,均恢复正常工作状态。通信模块120按照预设的顺序通过RS485总线对主控模块132和逆变模块131进行程序更新,更具体的进行固件升级。For the portable power supply device 100, in some specific embodiments, the data bus is an RS485 bus, and the communication module 120 is connected to the main control module 132 and the inverter module 131 as an upper computer through an RS485 bus. Referring to FIG. 8, the specific wiring manner is as follows: in the normal working mode, the receiving pin RXD and the transmitting pin TXD of the serial port of the main control module 132 are all enabled, and the serial port of the inverter module 131 is in the listening state, that is, the receiving pin. RXD is enabled, the TXD pin is in the normal I/O input state; in the upgrade mode, after receiving the corresponding node upgrade command of the bus, the corresponding node enters the enable state, that is, the receiving pin RXD and the sending of the corresponding node's serial port. The pin TXD is in the enabled state, while the other module is in the listening state, and resumes the normal working state after the upgrade is completed. The communication module 120 performs program update on the main control module 132 and the inverter module 131 through the RS485 bus in a preset order, and more specifically performs firmware upgrade.
在一些实施方式中,所述通信模块120按照预设顺序发送所述升级文件至所述主控模块132和所述逆变模块131以对主控模块132和所述逆变模块131进行程序更新。参照图9,在一些实施例中,通信模块120按照先主控模块132再逆变模块131的顺序对主控模块132和逆变模块131的程序进行更新的具体过程如下:In some embodiments, the communication module 120 sends the upgrade file to the main control module 132 and the inverter module 131 in a preset order to update the main control module 132 and the inverter module 131. . Referring to FIG. 9, in some embodiments, the specific process of the communication module 120 updating the programs of the main control module 132 and the inverter module 131 in the order of the re-inversion module 131 of the pre-master module 132 is as follows:
S91:主控模块132和逆变模块131处于正常工作模式。S91: The main control module 132 and the inverter module 131 are in a normal working mode.
主控模块132的串口处于收发使能状态,即主控模块132的串口的接收引脚RXD和发送引脚TXD都处于使能状态;逆变模块131的串口处于监听状态,即逆变模块131的接收引脚RXD使能,发送引脚TXD处于普通I/O输入状态;The serial port of the main control module 132 is in the transceiving enable state, that is, the receiving pin RXD and the transmitting pin TXD of the serial port of the main control module 132 are all enabled; the serial port of the inverter module 131 is in the listening state, that is, the inverter module 131 The receiving pin RXD is enabled, and the transmitting pin TXD is in the normal I/O input state;
S92:通信模块120检查是否接收到升级指令,如果是,则进入S93,如果不是,则转至步骤S91。S92: The communication module 120 checks whether an upgrade command is received, and if yes, proceeds to S93, and if not, proceeds to step S91.
S93:通信模块120按照预设顺序发送升级指令。在本实施例中,通信模块120先发送主控模块132升级指令,以先对主控模块132进行升级;S93: The communication module 120 sends the upgrade instruction in a preset order. In this embodiment, the communication module 120 first sends the upgrade command of the main control module 132 to upgrade the main control module 132 first;
S94:主控模块132进入升级模式,主控模块132的串口处于收发使能态,逆变模块131处于监听状态。S94: The main control module 132 enters the upgrade mode, the serial port of the main control module 132 is in the transceiver enable state, and the inverter module 131 is in the monitoring state.
需要注意的是,主控模块132和逆变模块131在接收到来自通信模块120的升级指令后,首先判断是否是对自身的升级指令,如果是,则进入升级模式,如果不是,则进入监听状态。在本实施例中,由于先对主控模块132升级,因此,主控模块132先进入升级模式。It should be noted that after receiving the upgrade instruction from the communication module 120, the main control module 132 and the inverter module 131 first determine whether it is an upgrade instruction for itself, and if so, enter an upgrade mode, and if not, enter the monitoring mode. status. In this embodiment, since the main control module 132 is upgraded first, the main control module 132 first enters the upgrade mode.
S95:主控模块132升级完成。S95: The main control module 132 is upgraded.
S96:通信模块120发送逆变模块131升级指令,以对逆变模块131进行升级;S96: The communication module 120 sends an upgrade instruction of the inverter module 131 to upgrade the inverter module 131.
S97:逆变模块131进入升级模式,主控模块132进入监听状态,逆变模块131的串口处于收发使能态。S97: The inverter module 131 enters the upgrade mode, and the main control module 132 enters the monitoring state, and the serial port of the inverter module 131 is in the transmitting and receiving state.
S98:逆变模块131升级完成。S98: The upgrade of the inverter module 131 is completed.
S99:通信模块120发送全部节点升级完成指令,本次升级结束,系统恢复正常工作状态。S99: The communication module 120 sends all the node upgrade completion instructions, and the upgrade is completed, and the system returns to the normal working state.
通信模块120发送升级文件对主控模块132进行升级,主控模块132升级结束后,通信模块120给其发送节点升级结束指令,主控模块132发送升级结束反馈,并根据接收到的升级文件更新自身程序,然后向通信模块120发送升级结束反馈。然后,通信模块120按照同样的方式对下一个节点的逆变模块131进行程序升级,在逆变模块131升级结束后,通信模块120给其发送节点升级结束指令,逆变模块在根据升级文件完成自身程序更新后发送升级结束反馈, 通信模块120广播式发送全部升级结束指令到数据总线,各个节点检测到总线上的全部升级结束指令后,恢复正常工作,本次升级全部结束。在升级过程中,各个节点执行第一部分程序(即引导加载程序)来使用接收到的升级文件中的新的程序(包含在上述升级数据包中)来更新第二部分程序(即应用程序)。The communication module 120 sends an upgrade file to upgrade the main control module 132. After the upgrade of the main control module 132, the communication module 120 sends a node upgrade end instruction thereto, and the main control module 132 sends an upgrade end feedback and updates according to the received upgrade file. The self program then sends an upgrade end feedback to the communication module 120. Then, the communication module 120 performs program upgrade on the inverter module 131 of the next node in the same manner. After the upgrade of the inverter module 131 is completed, the communication module 120 sends a node upgrade end instruction to the inverter module, and the inverter module is completed according to the upgrade file. After the update of the self program, the upgrade end feedback is sent, and the communication module 120 broadcasts all the upgrade end instructions to the data bus. After each node detects all the upgrade end instructions on the bus, the normal operation is resumed, and the upgrade is completed. During the upgrade process, each node executes a first part of the program (ie, the boot loader) to update the second part of the program (ie, the application) using the new program (included in the upgrade package described above) in the received upgrade file.
在其他的一些实施例中,在其他的一些实施例中,电子装置包括:至少一个适配接口,设置于电子装置的壳体表面,用于使一个或多个电池包可拆卸地安装至至少一个适配接口,其中,电池包用于手持式电动工具或花园工具;控制模块,可编程地控制电子装置的操作过程;其中,电子装置还包括通信模块和数据线,通信模块包括无线通信单元和存储单元,存储单元用于存储外部设备的升级文件,通信模块被配置为通过无线通信单元接收外部设备的升级文件,且通过数据线将升级文件发送至控制模块;数据线连接控制模块和通信模块,用于在控制模块和无线通信单元之间传输数据;在满足预设条件下,通信模块将升级文件发送给控制模块。In some other embodiments, in some other embodiments, the electronic device includes: at least one adapter interface disposed on a surface of the housing of the electronic device for detachably mounting the one or more battery packs to at least An adapter interface, wherein the battery pack is for a hand-held power tool or a garden tool; the control module is programmable to control an operation process of the electronic device; wherein the electronic device further includes a communication module and a data line, and the communication module includes a wireless communication unit And a storage unit, configured to store an upgrade file of the external device, the communication module configured to receive the upgrade file of the external device through the wireless communication unit, and send the upgrade file to the control module through the data line; the data line connection control module and the communication The module is configured to transmit data between the control module and the wireless communication unit; the communication module sends the upgrade file to the control module when the preset condition is met.
作为一种实施方式,通信模块包括存储单元,存储单元被配置为至少存储来自外部设备的升级文件。As an embodiment, the communication module includes a storage unit configured to store at least an upgrade file from the external device.
作为一种实施方式,无线通信单元包括WIFI模组和/或蓝牙模组。As an implementation manner, the wireless communication unit includes a WIFI module and/or a Bluetooth module.
作为一种实施方式,控制模块包括主控模块和逆变模块,主控模块和逆变模块具有唯一标识符,升级文件包含主控模块和/或逆变模块的唯一标识符。As an implementation manner, the control module includes a main control module and an inverter module. The main control module and the inverter module have a unique identifier, and the upgrade file includes a unique identifier of the main control module and/or the inverter module.
一种适用于上述一种电子装置的程序更新方法,包括:通信模块通过无线通信单元接收来自外部设备的升级请求和升级文件并将升级文件保存在存储单元;在们组预设条件下,通信模块通过数据线发送升级指令至控制模块;控制模块通过数据线接收升级指令后通过数据线发送升级响应至通信模块;通信模块接收到升级响应后,通过数据线发送升级文件至控制模块;控制继电器模块根据升级文件更新自身程序。A program updating method suitable for the above electronic device, comprising: the communication module receives an upgrade request and an upgrade file from an external device through a wireless communication unit and saves the upgrade file in a storage unit; and under the preset condition of the group, the communication The module sends an upgrade instruction to the control module through the data line; the control module sends the upgrade response to the communication module through the data line after receiving the upgrade instruction through the data line; after receiving the upgrade response, the communication module sends the upgrade file to the control module through the data line; The module updates its own program based on the upgrade file.
作为一种实施方式,升级文件包含程序结束标识,控制模块判断是否接收到程序结束标识,如果否,则主动发送升级请求给通信模块,以主动请求更新程序。As an implementation manner, the upgrade file includes a program end identifier, and the control module determines whether the program end identifier is received. If not, the upgrade request is actively sent to the communication module to actively request the update program.
作为一种实施方式,控制模块包括主控模块和逆变模块,通信模块按照预设顺序更新主控模块和逆变模块的程序。As an implementation manner, the control module includes a main control module and an inverter module, and the communication module updates the programs of the main control module and the inverter module according to a preset sequence.
本公开的电子装置更新程序无需拆机装机、减少人力物力,方便快捷,且运行安全可靠。The electronic device updating program of the present disclosure does not need to be disassembled and installed, reduces manpower and material resources, is convenient and fast, and is safe and reliable in operation.
实施例二:利用升级装置500进行程序更新。Embodiment 2: Program update is performed by using the upgrading apparatus 500.
现有电动工具300和电池包200之间的通信方式为单线通信,有其对应的通信协议,用于电池包200放电管理。可以按照上述更新程序的方法对电动工具300进行程序更新,通过在通信线上挂载无线通信单元121,通过预定的通信协议传送程序信息,从而实现电池包200或工具程序的更新和升级。The communication mode between the existing power tool 300 and the battery pack 200 is single-line communication, and has a corresponding communication protocol for discharging management of the battery pack 200. The power tool 300 can be program-updated in accordance with the method of the above-described update procedure, and the wireless communication unit 121 is mounted on the communication line to transmit the program information through a predetermined communication protocol, thereby realizing the update and upgrade of the battery pack 200 or the tool program.
但是,加入无线通信单元121会增加一定的成本,为减少成本,可以设计一个与工具或电池包200连接的用于给电动工具300或电池包200进行程序更细的升级装置500。升级装置500预先存储了电动工具300或电池包200的升级文件,并具有与电动工具300或电池包200的通信端口进行通信的通信端口。当需要升级时,将升级装置500连接至电动工具300或电池包200,通过各自的通信端口建立通信连接,按照预定通信协议,将升级装置500中的升级文件传送给电动工具或电池包200,实现产品的更新升级。However, the addition of the wireless communication unit 121 adds a certain cost. To reduce the cost, an upgrade device 500 for connecting the power tool 300 or the battery pack 200 to the power tool 300 or the battery pack 200 can be designed. The upgrading apparatus 500 previously stores an upgrade file of the power tool 300 or the battery pack 200, and has a communication port that communicates with the power tool 300 or the communication port of the battery pack 200. When an upgrade is required, the upgrade device 500 is connected to the power tool 300 or the battery pack 200, a communication connection is established through the respective communication ports, and the upgrade file in the upgrade device 500 is transmitted to the power tool or the battery pack 200 according to a predetermined communication protocol. Implement product updates and upgrades.
(1)电动工具300的程序更新方法。(1) A program update method of the electric power tool 300.
电动工具300可以是任何类型的动力工具,包括但不限于电钻、电锤、螺丝刀、冲击钻、电圆锯曲线锯、往复锯、带锯、电剪刀、砂光机、角磨、灯、激光器、钉枪等。The power tool 300 can be any type of power tool including, but not limited to, electric drills, electric hammers, screwdrivers, impact drills, electric circular saw jigsaws, reciprocating saws, band saws, electric scissors, sanders, angle grinders, lamps, lasers. , nail guns, etc.
参照图10,电动工具300有微控制器303(以下简称“MCU”),MCU 303包括闪存306,闪,306内存储有工具应用程序308、工具引导加载程序307、电动工具300的身份信息309。闪存306可以具有多个存储区域,包括用于存储应用程序308的区域、用于存储引导加载程序307的区域,用于存储电动工具300的身份信息309的区域。上述存储区域可以被读出,也可以被擦除或重写。Referring to FIG. 10, the power tool 300 has a microcontroller 303 (hereinafter referred to as "MCU"). The MCU 303 includes a flash memory 306. The flash 306 stores a tool application 308, a tool boot loader 307, and identity information 309 of the power tool 300. . The flash memory 306 can have a plurality of storage areas including an area for storing the application 308, an area for storing the boot loader 307, and an area for storing the identity information 309 of the power tool 300. The above storage area can be read out or erased or rewritten.
应用程序308在工作模式运行,用于控制电动工具300的工作过程,比如控制电机的转速、控制电机按设定方式启动等。引导加载程序306在升级模式下运行,用于至少更新部分应用程序。The application 308 operates in an operational mode for controlling the operation of the power tool 300, such as controlling the rotational speed of the motor, controlling the motor to start in a set manner, and the like. The boot loader 306 runs in an upgrade mode for updating at least a portion of the application.
对于没有通信模块120或无线通信单元121的电动工具300,需要一个设备将新的应用程序导入到电动工具300的闪存中,以对闪存306中的应用程序308 进行更新和/或升级。该设备是一个对电动工具300程序进行升级的专用设备,以下称为升级装置500。For the power tool 300 without the communication module 120 or the wireless communication unit 121, a device is required to import the new application into the flash memory of the power tool 300 to update and/or upgrade the application 308 in the flash memory 306. The device is a dedicated device for upgrading the power tool 300 program, hereinafter referred to as an upgrade device 500.
参照图10,在一个实施例中,升级装置500包括MCU 501,MCU501包括用于存储数据或程序的存储单元502、用于读取数据的数据读取单元503、用于校验电动工具300是否与升级装置500匹配等信息的校验单元504。升级装置500还包括用于人机界面显示的显示模块505,显示模块505可以显示升级剩余时间或进度。升级装置500还具有接口单元508,用于与外部存储设备509连接。外部存储设备509可以是可移动的存储卡、存储芯片或存储器,比如TF卡、U盘等,也可以是能通过有线或无线方式连接到升级装置500的其他设备,比如PC机等。外部存储设备509存储有用于更新一个或多个电动工具300的最新应用程序,该最新的应用程序可以部分或全部覆盖电动工具300中的旧的应用程序。升级装置500通过接口单元508获得外部存储设备509存储的适用于一个或多个电动工具300的最新的应用程序,并将其存储到存储单元502,以便对不同电动工具300的软件程序进行升级。Referring to FIG. 10, in one embodiment, the upgrading apparatus 500 includes an MCU 501 including a storage unit 502 for storing data or programs, a data reading unit 503 for reading data, and for verifying whether the power tool 300 is A verification unit 504 that matches information such as the upgrade device 500. The upgrade apparatus 500 also includes a display module 505 for human-machine interface display, and the display module 505 can display the remaining time or progress of the upgrade. The upgrade device 500 also has an interface unit 508 for connecting to an external storage device 509. The external storage device 509 may be a removable memory card, a memory chip or a memory, such as a TF card, a USB flash drive, or the like, or may be another device that can be connected to the upgrade device 500 by wire or wirelessly, such as a PC or the like. The external storage device 509 stores the latest application for updating one or more of the power tools 300, which may partially or completely cover the old applications in the power tool 300. The upgrading apparatus 500 obtains the latest application for the one or more power tools 300 stored by the external storage device 509 through the interface unit 508 and stores it in the storage unit 502 to upgrade the software programs of the different power tools 300.
升级装置500具有用于与电动工具300连接的通信接口。通信接口用于电动工具300的微控制器与升级装置500建立通信,以完成电动工具300的程序更新。电动工具300的MCU 303可以通过通信接口向外部设备发送信息,比如电动工具MCU 303通过通信接口向升级装置500发送电动工具300的身份信息等。电动工具的MCU 303还可以通过通信接口接收升级装置500的信号,并基于该信号执行响应过程,比如MCU 303接收升级装置500的信号,决定进入工作模式还是升级模式。通信接口可以是专用的信号端口(例如,数据端口),也可以是多路复用的共享端子(例如,温度信号端口)。通信接口可以是单端口,也可以是多端口,为了简化程序,可以采用双端口进行通信。The upgrade device 500 has a communication interface for connection to the power tool 300. The communication interface is used by the microcontroller of the power tool 300 to establish communication with the upgrade device 500 to complete the program update of the power tool 300. The MCU 303 of the power tool 300 can transmit information to the external device through the communication interface, for example, the power tool MCU 303 transmits the identity information of the power tool 300, etc. to the upgrading apparatus 500 through the communication interface. The MCU 303 of the power tool can also receive the signal of the upgrade device 500 through the communication interface, and perform a response process based on the signal, for example, the MCU 303 receives the signal of the upgrade device 500, and decides whether to enter the work mode or the upgrade mode. The communication interface can be a dedicated signal port (eg, a data port) or a multiplexed shared terminal (eg, a temperature signal port). The communication interface can be a single port or a multi-port. To simplify the program, two ports can be used for communication.
参照图10,电动工具300具有两个物理接口——工具第一端口301和工具第二端口302,升级装置500具有与之对应的升级第一端口506和升级第二端口507,分别用于与电动工具300的工具第一端口301和工具第二端口302连接。在电动工具300正常工作模式下,即电池包200连接到电动工具300时,工具第一端口301用于电动工具300和电池包200之间建立通信,工具第二端口302用于传输电池包200温度信号或识别电池包200属性。在电动工具300的升级模式下,即升级装置500连接到电池包200时,工具第一端口301用于识别升 级装置500,其维持原通信功能、通信协议、通信内容不变。此时,工具第二端口302复用,其被用于建立电动工具300和升级装置500之间的通信,接收和发送升级过程中数据信息。Referring to FIG. 10, the power tool 300 has two physical interfaces - a tool first port 301 and a tool second port 302. The upgrading device 500 has an upgraded first port 506 and an upgraded second port 507 corresponding thereto, respectively for The tool first port 301 of the power tool 300 is coupled to the tool second port 302. In the normal operating mode of the power tool 300, that is, when the battery pack 200 is connected to the power tool 300, the tool first port 301 is used to establish communication between the power tool 300 and the battery pack 200, and the tool second port 302 is used to transport the battery pack 200. Temperature signal or identify battery pack 200 properties. In the upgrade mode of the power tool 300, that is, when the upgrade device 500 is connected to the battery pack 200, the tool first port 301 is used to identify the upgrade device 500, which maintains the original communication function, the communication protocol, and the communication content. At this time, the tool second port 302 is multiplexed, which is used to establish communication between the power tool 300 and the upgrading apparatus 500, and receive and transmit data information during the upgrade process.
具体而言,在一个实施例中,电动工具300通过识别工具第一端口301的电压是高电压还是低电压来识别插入到电动工具300的外部装置是电池包200还是升级装置500,比如当外部装置插入到电动工具300,工具第一端口301的电压被拉低,则电动工具300识别到外部装置是升级装置500。Specifically, in one embodiment, the power tool 300 identifies whether the external device inserted into the power tool 300 is the battery pack 200 or the upgrade device 500 by identifying whether the voltage of the tool first port 301 is a high voltage or a low voltage, such as when external When the device is inserted into the power tool 300, the voltage of the tool first port 301 is pulled low, and the power tool 300 recognizes that the external device is the upgrading device 500.
电动工具300识别到外部装置是升级装置500后,进入升级模式。电动工具MCU 303执行引导加载程序307进行程序更新过程。由于升级装置500中存储有一个或多个用于对不同电动工具300进行程序更新的最新程序,在对特定电动工具300进行程序更新时,需要选择对应的最新程序。为此,可以预先在电动工具300的MCU 303的闪存306中存储代表电动工具300和/或升级装置500的身份信息309,并且在升级装置500的存储单元中同样存储代表电动工具300和/或升级装置500的身份信息,以便在电动工具300的旧的应用程序308被改写前,能正确匹配电动工具300和升级装置500,防止更新程序错误,导致程序更新后电动工具300不能正确运行。升级装置500具有校验单元501,电动工具300均具有校验单元305。在一个实施例中,升级装置500的校验单元504用于校验电动工具300的身份信息,电动工具300的校验单元用于校验数据传输中数据是否正确、程序是否完整等,也可以校验升级装置500的身份信息。After the power tool 300 recognizes that the external device is the upgrade device 500, it enters the upgrade mode. The power tool MCU 303 executes a boot loader 307 to perform a program update process. Since the upgrade device 500 stores one or more latest programs for program update of different power tools 300, when the program is updated for the specific power tool 300, it is necessary to select the corresponding latest program. To this end, the identity information 309 representing the power tool 300 and/or the upgrade device 500 may be stored in the flash memory 306 of the MCU 303 of the power tool 300 in advance, and the representative power tool 300 and/or the storage device in the storage unit of the upgrade device 500 may also be stored. The identity information of the device 500 is upgraded so that the power tool 300 and the upgrade device 500 can be properly matched before the old application 308 of the power tool 300 is rewritten to prevent an update program error, resulting in the power tool 300 not operating properly after the program update. The upgrading apparatus 500 has a verification unit 501 each having a verification unit 305. In one embodiment, the verification unit 504 of the upgrade apparatus 500 is configured to verify the identity information of the power tool 300, and the verification unit of the power tool 300 is used to verify whether the data in the data transmission is correct, whether the program is complete, or the like. The identity information of the upgrade device 500 is verified.
在程序更新过程中,引导加载程序307需要将升级装置500中的新的程序写入到电动工具300的应用程序308的存储区域内。新的应用程序的数据包有可能会比较大,不能一次性传输完成,可以将新的应用程序的数据包拆分成多个小数据包,方便分多次传输。在多个数据包传输过程中,可能会发生数据包顺序紊乱,造成写入的新的程序不正确。为了解决这一问题,可以对数据包进行编号,并且在数据传输时,校验该编号,以保证数据包按顺序依次被写入到电动工具300的闪存306的相应区域。During the program update process, the boot loader 307 needs to write a new program in the upgrade device 500 into the storage area of the application 308 of the power tool 300. The data packets of the new application may be large, and cannot be transferred in one time. The data packet of the new application can be split into multiple small data packets, which is convenient for multiple transmissions. During the transmission of multiple packets, the packet sequence may be disordered, resulting in incorrect new programs being written. In order to solve this problem, the data packets may be numbered, and at the time of data transmission, the number is verified to ensure that the data packets are sequentially written to the corresponding areas of the flash memory 306 of the power tool 300 in order.
具体地,电动工具300和升级装置500通过升级第二端口507和工具第二端口302传输升级过程中涉及的数据信息,包含升级指令、升级结束指令、反馈回复、升级数据包等。Specifically, the power tool 300 and the upgrading apparatus 500 transmit the data information involved in the upgrade process by upgrading the second port 507 and the tool second port 302, including an upgrade instruction, an upgrade end instruction, a feedback reply, an upgrade data packet, and the like.
电动工具300在工作模式下,会执行闪存306中的应用程序308,而引导加载程序307也存储在闪存306中,如果MCU 303调用的程序的地址发生错误,那么MCU 303就可能会错误的执行引导加载程序307,这样正在工作的电动工具300无法正常可能,甚至还会带来安全隐患。为了解决这一问题,可以通过引入升级密钥来解决,升级密钥用于指示应用程序升级的命令。In the working mode, the power tool 300 executes the application 308 in the flash memory 306, and the boot loader 307 is also stored in the flash memory 306. If the address of the program called by the MCU 303 is incorrect, the MCU 303 may be executed incorrectly. The boot loader 307, such that the working power tool 300 is not working properly, may even pose a security risk. To solve this problem, it can be solved by introducing an upgrade key, which is used to instruct the application to upgrade.
具体而言,升级装置500确认可以升级之后,发送一个升级密钥给电动工具300的MCU 303,MCU 303接收到该升级密钥,确认是应用程序的升级命令后,然后执行引导加载程序306,更新电动工具300的软件程序。电动工具300的MCU 303只有在收到升级装置500发送的升级密钥后,才会开始执行引导加载程序307,否则不会执行引导加载程序307。这样,可以确保引导加载程序307只有在需要更细程序时,才被执行,而不会在电动工具300工作模式下执行,以保证电动工具300运行的安全性。Specifically, after the upgrade device 500 confirms that the upgrade is possible, an upgrade key is sent to the MCU 303 of the power tool 300. After receiving the upgrade key, the MCU 303 confirms that it is an upgrade command of the application, and then executes the boot loader 306. The software program of the power tool 300 is updated. The MCU 303 of the power tool 300 will only start executing the boot loader 307 after receiving the upgrade key sent by the upgrade apparatus 500, otherwise the boot loader 307 will not be executed. In this way, it can be ensured that the boot loader 307 is executed only when a finer program is required, and is not executed in the power tool 300 operating mode to ensure the safety of the power tool 300.
下面结合图10和图11,说明升级装置500更新电动工具300的程序的方法作。Next, a method of updating the program of the electric power tool 300 by the upgrading apparatus 500 will be described with reference to FIGS. 10 and 11.
首先,升级装置500需要通过接口单元508获取外部存储设备存储的最新的程序,并将其存储在自身的存储单元502内。然后,用户将升级装置500连接至需要升级的电动工300,工具第一端口301和升级第一端口506建立连接,工具第二端口302和升级第二端口507建立连接。工具第一端口301电压被拉低,电动工具300检测到工具第一端口301为低电压,电动工具300进入升级模式。升级装置500和电动工具300通过工具第二端口302和升级第二端口507进行信息交互。First, the upgrading apparatus 500 needs to acquire the latest program stored by the external storage device through the interface unit 508 and store it in its own storage unit 502. Then, the user connects the upgrade device 500 to the electric worker 300 that needs to be upgraded, the tool first port 301 and the upgrade first port 506 establish a connection, and the tool second port 302 and the upgrade second port 507 establish a connection. The tool first port 301 voltage is pulled low, the power tool 300 detects that the tool first port 301 is at a low voltage, and the power tool 300 enters the upgrade mode. The upgrade device 500 and the power tool 300 exchange information through the tool second port 302 and the upgrade second port 507.
需要说明的是,在电动工具300的工作模式下,不宜使电动工具300停下来进行程序更新,可以在电动工具300上电后开始工作前,将升级装置500与之连接,进行电动工具300的程序更新。It should be noted that, in the working mode of the power tool 300, it is not appropriate to stop the power tool 300 for program update. Before the power tool 300 is powered on, the upgrade device 500 can be connected thereto to perform the power tool 300. Program update.
以下对升级装置500和电动工具300在升级模式下的信息交互过程进行说明:The following describes the information exchange process of the upgrade device 500 and the power tool 300 in the upgrade mode:
S111:电动工具300检测到工具第一端口301为低电压信号,进入升级模式;S111: The power tool 300 detects that the tool first port 301 is a low voltage signal and enters an upgrade mode.
S112:电动工具300回复其身份信息给升级装置500,准备升级;S112: The power tool 300 returns its identity information to the upgrading apparatus 500, ready to be upgraded;
S113:升级装置500校验电动工具300的身份信息,判断是否进行升级,如果可以升级,则发送升级密钥给电动工具300;S113: The upgrade device 500 verifies the identity information of the power tool 300, determines whether to upgrade, and if it can be upgraded, sends an upgrade key to the power tool 300;
具体而言,升级装置500将接收到的电动工具300的身份信息309和预先存储在存储单元502的一个或多个电动工具300的身份信息进行比较,确认存储单元502中是否存储有接收到的身份信息309,如果有,则判断此升级装置500可以对电动工具300进行升级,如果没有,则判断不能进行升级。Specifically, the upgrading apparatus 500 compares the received identity information 309 of the power tool 300 with the identity information of one or more power tools 300 stored in advance in the storage unit 502, and confirms whether or not the received storage unit 502 stores the received information. The identity information 309, if any, determines that the upgrade device 500 can upgrade the power tool 300, and if not, determines that the upgrade is not possible.
S114:电动工具300获得升级密钥,确认升级,并回复确认升级给升级装置500;S114: The power tool 300 obtains the upgrade key, confirms the upgrade, and replies to the upgrade to the upgrade device 500;
S115:升级装置500接收到电动工具300的确认升级信号后,开始发送第一个升级程序数据包;S115: After receiving the confirmation upgrade signal of the power tool 300, the upgrading apparatus 500 starts to send the first upgrade program data packet;
S116:电动工具300接收到数据包后,校验数据包是否正确,如果正确则回复正确给升级装置500;S116: After receiving the data packet, the power tool 300 verifies whether the data packet is correct, and if correct, returns the correct message to the upgrading apparatus 500;
S117:升级装置500接收到正确回复后,继续发送下一个数据包,直至最后一个数据包;S117: After receiving the correct reply, the upgrading apparatus 500 continues to send the next data packet until the last data packet;
S118:电动工具300接收到最后一个数据包,并回复正确;S118: The power tool 300 receives the last data packet and returns the correct one;
S119:升级装置500发送升级结束标志给电动工具300;S119: The upgrading apparatus 500 sends an upgrade end flag to the power tool 300;
S120:电动工具300接收到升级结束标志后,回复升级完成。S120: After receiving the upgrade end flag, the power tool 300 returns to the upgrade completion.
需要说明的是,在电动工具300的升级模式下,发生异常情况(例如,断电),会导致升级程序或升级文件不能全部被写入到电动工具300的闪存303中,电动工具300的应用程序308是一个不完整的程序,在电动工具300工作模式下,如果运行该不完整的应用程序,会导致电动工具300不能正常工作,甚至发生故障,带来安全隐患。It should be noted that, in the upgrade mode of the power tool 300, an abnormal situation (for example, power failure) may occur, which may result in the upgrade program or the upgrade file not being completely written into the flash memory 303 of the power tool 300, and the application of the power tool 300. The program 308 is an incomplete program. In the working mode of the power tool 300, if the incomplete application is run, the power tool 300 may not work properly or even malfunction, posing a security risk.
为了解决这一问题,可以在升级程序的开头和结尾分别加上标识,例如在第一个升级程序数据包加上程序开始标识,而在最后一个升级程序数据包加上程序结束标识,如果电动工具300没有接收到程序结束标识,那么认为被写入电动工具300的升级程序不完整,该不完整的升级程序将不会被执行。只有在确保电动工具300的应用程序中存在程序结束标识时,应用程序才会被执行。In order to solve this problem, you can add the identifier at the beginning and end of the upgrade program, for example, in the first upgrade program packet plus the program start identifier, and in the last upgrade program packet plus the program end identifier, if electric If the tool 300 does not receive the program end identification, then the upgrade program that is written to the power tool 300 is considered to be incomplete, and the incomplete upgrade program will not be executed. The application will only be executed if there is a program end identifier in the application of the power tool 300.
发生上述异常情况后,需要重新或继续写入升级程序。在一个实施例中, 发生上述异常情况后,重新写入升级程序,电动工具300进入强制升级模式。在强制升级模式下,一旦升级装置500与电动工具300连接后,电动工具300不再根据工具第一端口301的电压来判断是否进入升级模式,而是电动工具300主动发送升级请求给升级装置500,这样,升级程序被重新写入。After the above abnormal conditions occur, you need to restart or continue to write to the upgrade program. In one embodiment, after the abnormal condition occurs, the upgrade program is rewritten, and the power tool 300 enters the forced upgrade mode. In the forced upgrade mode, once the upgrade device 500 is connected to the power tool 300, the power tool 300 no longer determines whether to enter the upgrade mode according to the voltage of the tool first port 301, but the power tool 300 actively sends an upgrade request to the upgrade device 500. In this way, the upgrade program is rewritten.
当然,在电动工具300具有通信模块120的情况下,可以通过通信模块获取外部设备(例如,手机,PC机等)的升级文件,然后利用通信模块或其他模块通过对方式对电动工具300中的应用程序进行更新,可以是总线调度方式,也可以是普通的通信方式对电动工具进行程序更新,而不需要升级装置500。Of course, in the case that the power tool 300 has the communication module 120, an upgrade file of an external device (for example, a mobile phone, a PC, etc.) can be acquired through the communication module, and then the communication module or other module is used to pass the pair on the power tool 300. The application is updated, and the program can be updated by the bus scheduling method or the ordinary communication method without upgrading the device 500.
实施例二:利用升级装置500进行程序更新。Embodiment 2: Program update is performed by using the upgrading apparatus 500.
(2)电池包200的程序更新的方法。(2) A method of updating the program of the battery pack 200.
利用升级装置500更新电池包200程序的方法与利用升级装置500对电动工具300的进行程序升级的方法类似。The method of updating the battery pack 200 program by the upgrading apparatus 500 is similar to the method of upgrading the power tool 300 by the upgrading apparatus 500.
用于为电池包200的进行程序更新的升级装置500与给电动工具300进行程序更新的升级装置500组成部件可以相同,区别在于,两者存储单元502中存储的升级程序不一样,分别是用于电池包200的升级程序以及用于电动工具300的升级程序。The upgrade device 500 for program update of the battery pack 200 and the upgrade device 500 for program update of the power tool 300 may be the same component, except that the upgrade programs stored in the storage unit 502 are different, respectively. The upgrade procedure for the battery pack 200 and the upgrade procedure for the power tool 300.
需要说明的是,电动工具300是在上电后,非工作模式下进行程序的更新,而电池包200可以在任何时间进行程序更新。电池包200进入升级模式的条件,可以检测电池包第一端口201的电压识别是否是升级装置500,也可以是电池包200直接向升级装置500发送升级请求,以进入升级模式。It should be noted that the power tool 300 updates the program in the non-operation mode after power-on, and the battery pack 200 can update the program at any time. When the battery pack 200 enters the upgrade mode, it can be detected whether the voltage identification of the first port 201 of the battery pack is the upgrade device 500, or the battery pack 200 can directly send an upgrade request to the upgrade device 500 to enter the upgrade mode.
具体地,当充电器或升级装置500或电动工具300等外部设备连接到电池包200,电池包200上电后,首先根据外部设备反馈信号,以确认是哪种设备,当电池包200确认是升级装置500后,电池包200发送自身身份信息给升级装置500后,准备升级。Specifically, when the external device such as the charger or the upgrading device 500 or the power tool 300 is connected to the battery pack 200, after the battery pack 200 is powered on, firstly, according to the external device feedback signal, it is confirmed which device is used, and when the battery pack 200 is confirmed to be After the device 500 is upgraded, the battery pack 200 sends its own identity information to the upgrade device 500, and is ready to upgrade.
参照图12,电池包200具有两个物理接口,电池包第一端口201和电池包第二端口202,升级装置500具有与之对应的升级第一端口506和升级第二端口507,分别用于与电池包第一端口201和电池包第二端口202连接。Referring to FIG. 12, the battery pack 200 has two physical interfaces, a battery pack first port 201 and a battery pack second port 202. The upgrade apparatus 500 has an upgraded first port 506 and an upgraded second port 507 corresponding thereto, respectively. It is connected to the battery pack first port 201 and the battery pack second port 202.
在电池包200通过发送自身身份信息209给升级装置500,以请求进入升级 模式的方式中,需要预先在电池包200内设置升级标识。升级标识可以通过外部设备利用无线或有线的方式写入电池包200的MCU的闪存206或其他存储器中。当升级装置500连接到电池包200,若检测到电池包200存储有升级标识,则发送升级密钥给电池包200,电池包200的MCU 203执行引导加载程序207,将升级装置500的存储单元502内的升级程序写入到电池包200的应用程序存储区,对电池包200应用程序进行更新,否则不进行程序更新过程。一旦升级程序被执行,不管本次升级是否成功,升级标识都要被清除,以防止引导加载程序被多次执行。In the manner in which the battery pack 200 sends the self-identity information 209 to the upgrading apparatus 500 to request to enter the upgrade mode, it is necessary to set an upgrade flag in the battery pack 200 in advance. The upgrade flag can be written to the flash memory 206 or other memory of the MCU of the battery pack 200 by an external device using wireless or wired means. When the upgrade device 500 is connected to the battery pack 200, if it is detected that the battery pack 200 stores the upgrade identifier, the upgrade key is sent to the battery pack 200, and the MCU 203 of the battery pack 200 executes the boot loader 207, which will upgrade the storage unit of the device 500. The upgrade program in 502 is written to the application storage area of the battery pack 200 to update the battery pack 200 application, otherwise the program update process is not performed. Once the upgrade program is executed, regardless of whether the upgrade was successful or not, the upgrade ID is cleared to prevent the boot loader from being executed multiple times.
结合图13,升级装置500和电池包200在升级模式下的信息交互过程如下:Referring to FIG. 13, the information exchange process of the upgrading apparatus 500 and the battery pack 200 in the upgrade mode is as follows:
S131:升级装置500发送自身身份信息给电池包200;S131: The upgrade device 500 sends its own identity information to the battery pack 200;
S132:电池包200接收到升级装置500的身份信息,回复自身身份信息给升级装置500,准备升级;S132: The battery pack 200 receives the identity information of the upgrade device 500, and returns the identity information to the upgrade device 500 to prepare for the upgrade;
S133:升级装置500校验电池包200的身份信息,判断是否进行升级,如果可以升级,则发送升级密钥给电池包200;S133: The upgrade device 500 verifies the identity information of the battery pack 200, determines whether to perform the upgrade, and if the upgrade is possible, sends the upgrade key to the battery pack 200;
升级装置500判断是否升级,具体而言,要判断以下内容:一是电池包200身份信息是否与升级装置500,升级装置500将接收到的电池包200的身份信息和预先存储在存储单元502内的一个或多个电池包200的身份信息209进行比较,判断存储单元502中是否存储有接收到的身份信息,如果有,则判断可以对电池包200进行程序更新,如果没有,则不能进行程序更新;二是电池包200存储器中是否有升级标识,如果有,则判断可以对电池包200进行程序更新,如果没有,则判断不能进行程序更新;The upgrading apparatus 500 determines whether to upgrade, specifically, the following content: First, whether the battery pack 200 identity information and the upgrading apparatus 500, the upgrading apparatus 500 stores the identity information of the received battery pack 200 in advance in the storage unit 502. The identity information 209 of one or more battery packs 200 is compared to determine whether the received identity information is stored in the storage unit 502. If so, it is determined that the battery pack 200 can be updated. If not, the program cannot be executed. Update; second, whether there is an upgrade flag in the battery pack 200 memory, if yes, it is judged that the battery pack 200 can be updated, if not, it is judged that the program update cannot be performed;
S134:电池包200接收到升级密钥,确认升级,并回复确认升级给升级装置500;S134: The battery pack 200 receives the upgrade key, confirms the upgrade, and replies to the upgrade to the upgrade apparatus 500;
S135:升级装置500接收到电池包200的确认升级信息后,开始发送第一个升级程序数据包;S135: After receiving the confirmation upgrade information of the battery pack 200, the upgrading apparatus 500 starts to send the first upgrade program data packet;
S136:电池包200接收到数据包后,校验数据包是否正确(数据包顺序是否正确、数据包内容是否正确等),如果正确则回复正确给升级装置500;S136: After receiving the data packet, the battery pack 200 checks whether the data packet is correct (whether the data packet sequence is correct, whether the data packet content is correct, etc.), and if correct, returns the correct to the upgrading apparatus 500;
S137:升级装置500接收到正确回复后,继续发送下一个数据包,直至最 后一个数据包;S137: After receiving the correct reply, the upgrading apparatus 500 continues to send the next data packet until the last data packet;
S138:电池包200接收到最后一个数据包,并回复正确;S138: The battery pack 200 receives the last data packet and returns the correct one;
S139:升级装置500发送升级结束标志给电池包200;S139: The upgrade device 500 sends an upgrade end flag to the battery pack 200;
S140:电池包200接收到升级结束标志后,回复升级完成。S140: After the battery pack 200 receives the upgrade end flag, the upgrade is completed.
在上述数据传输过程中,需要考虑数据传输超时的可能性,为此引入超时重传机制。在正常传输过程中,主机600发送指令或数据给从机700,从机700接收到指令或数据后给主机600反馈,以保证此次传输正常(参考图14)。而在超时传输中,主机600发送指令或数据给从机700,从机700没有在规定的时间内给主机600反馈或主机600未在规定的时间内收到从机700的反馈。为了确保数据能有效传输,按如下步骤进行超时重传:In the above data transmission process, it is necessary to consider the possibility of data transmission timeout, and a timeout retransmission mechanism is introduced for this purpose. During the normal transmission process, the host 600 sends an instruction or data to the slave 700, and the slave 700 receives the command or data and feeds back to the host 600 to ensure that the transmission is normal (refer to FIG. 14). In the timeout transmission, the host 600 sends an instruction or data to the slave 700, the slave 700 does not feed back to the host 600 within a specified time, or the host 600 does not receive feedback from the slave 700 within a specified time. To ensure that the data can be transmitted efficiently, perform the timeout retransmission as follows:
S151:主机600发送指令或数据给从机700后,开始计时;S151: After the host 600 sends an instruction or data to the slave 700, the timer starts.
S152:主机600判断是否在规定时间内收到从机700回复,如果是,则发送下一个指令或数据给从机700,转至步骤S151;如果否,则认为此次指令或数据传输失败;S152: The host 600 determines whether the slave 700 is replied within the specified time. If yes, the next command or data is sent to the slave 700, and the process goes to step S151; if not, the command or data transmission is considered to be unsuccessful;
S153:主机600再次发送相同指令或数据给从机700;S153: The host 600 sends the same instruction or data to the slave 700 again;
S154:主机600判断是否达到规定的重传次数上限,如果是,则认为传输失败,转至步骤S5;如果否,则转至步骤S152。S154: The host 600 determines whether the predetermined upper limit of the number of retransmissions is reached. If yes, the transmission is considered to have failed, and the process goes to step S5; if not, the process goes to step S152.
S156:终止传输过程。S156: Terminate the transmission process.
在上述程序更新过程中,主机600为通信模块120或升级装置,从机700为主控模块132逆变模块131、电动工具300、电池包200。需要说明的是,重传次数上限根据具体情况或要求设定,例如3次、5次、10次等,以利于节约能源。在传输失败后,升级装置500的显示模块显示报警状态,提醒用户升级失败。In the above program update process, the host 600 is the communication module 120 or the upgrade device, and the slave 700 is the main control module 132, the inverter module 131, the power tool 300, and the battery pack 200. It should be noted that the upper limit of the number of retransmissions is set according to specific conditions or requirements, for example, 3 times, 5 times, 10 times, etc., in order to save energy. After the transmission fails, the display module of the upgrading apparatus 500 displays an alarm state to remind the user that the upgrade has failed.
以上显示和描述了本公开的基本原理、主要特征和优点。本行业的技术人员应该了解,上述实施例不以任何形式限制本公开,凡采用等同替换或等效变换的方式所获得的技术方案,均落在本公开的保护范围内。The basic principles, main features and advantages of the present disclosure have been shown and described above. It should be understood by those skilled in the art that the above-described embodiments are not intended to limit the disclosure in any way, and the technical solutions obtained by means of equivalent replacement or equivalent transformation are all within the scope of the disclosure.
工业实用性Industrial applicability
本公开提供了一种电子装置及电子装置的程序更新方法,可以实现电子装置以及电子装置的程序更新的方法方便快捷且可靠。The present disclosure provides a method for updating an electronic device and an electronic device, and the method for updating the program of the electronic device and the electronic device is convenient, fast, and reliable.

Claims (24)

  1. 一种电子装置,包括:An electronic device comprising:
    壳体;case;
    至少一个适配接口,形成于所述壳体的表面,用于使一个或多个电池包可拆卸地安装至所述至少一个适配接口,其中,所述电池包能够用于手持式电动工具或花园工具;At least one mating interface formed on a surface of the housing for detachably mounting one or more battery packs to the at least one mating interface, wherein the battery pack can be used for a hand-held power tool Or garden tools;
    控制模块,可编程地控制所述电子装置的操作过程;a control module that programmably controls an operation process of the electronic device;
    其特征在于,所述电子装置还包括通信模块,所述通信模块包括:The electronic device further includes a communication module, and the communication module includes:
    无线通信单元,用于与外部设备进行无线通信,以接收来自外部设备的升级文件;以及a wireless communication unit for wirelessly communicating with an external device to receive an upgrade file from the external device;
    存储单元,用于存储来自外部设备的所述升级文件;所述升级文件包含对所述控制模块的程序进行更新的升级程序;a storage unit, configured to store the upgrade file from an external device; the upgrade file includes an upgrade program for updating a program of the control module;
    所述通信模块被配置为:通过所述无线通信单元接收外部设备的所述升级文件并将所述升级文件存储在所述存储单元;在满足预设条件下,能够发送所述升级文件至所述控制模块以对所述控制模块的程序进行更新。The communication module is configured to: receive, by the wireless communication unit, the upgrade file of an external device and store the upgrade file in the storage unit; and send the upgrade file to a location under a preset condition The control module updates the program of the control module.
  2. 根据权利要求1所述的电子装置,其特征在于:所述预设条件包括所述通信模块接收到来自所述控制模块的升级请求。The electronic device of claim 1, wherein the predetermined condition comprises the communication module receiving an upgrade request from the control module.
  3. 根据权利要求2所述的电子装置,其特征在于:所述升级文件包含程序结束标识,所述控制模块在未接收到所述程序结束标识时发送所述升级请求给所述通信模块。The electronic device according to claim 2, wherein the upgrade file includes a program end identifier, and the control module sends the upgrade request to the communication module when the program end identifier is not received.
  4. 根据权利要求1所述的电子装置,其特征在于:所述预设条件包括所述通信模块接收到来自外部设备的升级请求。The electronic device according to claim 1, wherein the preset condition comprises the communication module receiving an upgrade request from an external device.
  5. 根据权利要求1所述的电子装置,其特征在于:所述电子装置为便携式 电源装置,所述便携式电源装置还包括逆变模块,所述逆变模块包括逆变器,所述逆变器用于将所述电池包输出的直流电转变为交流电;所述逆变模块电连接至所述控制模块,至少部分地接受所述主控模块的控制。The electronic device according to claim 1, wherein the electronic device is a portable power supply device, the portable power supply device further includes an inverter module, the inverter module includes an inverter, and the inverter is used for Converting the direct current outputted by the battery pack into alternating current; the inverter module is electrically connected to the control module, at least partially receiving control of the main control module.
  6. 根据权利要求5所述的电子装置,其特征在于:所述电子装置还包括数据总线,所述控制模块和逆变模块通过所述数据总线连接至所述通信模块;所述通信模块被配置为:通过所述无线通信单元接收外部设备的升级文件并将其存储在所述存储单元;通过所述数据总线将所述升级文件发送至所述控制模块和/或逆变模块;所述升级文件包含对所述控制模块和/或所述逆变模块的程序进行更新的升级程序。The electronic device according to claim 5, wherein said electronic device further comprises a data bus, said control module and said inverter module being connected to said communication module via said data bus; said communication module being configured to Receiving, by the wireless communication unit, an upgrade file of the external device and storing it in the storage unit; transmitting the upgrade file to the control module and/or the inverter module through the data bus; the upgrade file An upgrade program is included that updates the program of the control module and/or the inverter module.
  7. 根据权利要求6所述的电子装置,其特征在于:所述控制模块和所述逆变模块具有唯一标识符。The electronic device of claim 6 wherein said control module and said inverter module have unique identifiers.
  8. 根据权利要求7所述的电子装置,其特征在于:所述升级文件包含所述控制模块和/或逆变模块的唯一标识符。The electronic device of claim 7, wherein the upgrade file comprises a unique identifier of the control module and/or the inverter module.
  9. 根据权利要求1所述的电子装置,其特征在于:所述无线通信单元包括WIFI模组和/或蓝牙模组。The electronic device according to claim 1, wherein the wireless communication unit comprises a WIFI module and/or a Bluetooth module.
  10. 根据权利要求1所述的电子装置,其特征在于:所述控制模块包括处存储单元,所述存储单元存储有第一部分程序和第二部分程序,所述第一部分程序可被所述控制模块执行以更新所述第二部分程序。The electronic device according to claim 1, wherein said control module comprises a storage unit, said storage unit storing a first partial program and a second partial program, said first partial program being executable by said control module To update the second part of the program.
  11. 根据权利要求1至4任意一项所述的电子装置,其特征在于:所述电子装置为电池包或使用所述电池包供电的电动工具或为所述电池包充电的充电装置。The electronic device according to any one of claims 1 to 4, wherein the electronic device is a battery pack or a power tool that supplies power using the battery pack or a charging device that charges the battery pack.
  12. 一种适用于如权利要求1所述的电子装置的程序更新方法,包括:A program update method for an electronic device according to claim 1, comprising:
    所述通信模块通过所述无线通信单元接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元;The communication module receives an upgrade file from an external device through the wireless communication unit and stores the upgrade file in the storage unit;
    在满足预设条件下,所述通信模块将所述升级文件发送至所述控制模块;The communication module sends the upgrade file to the control module when a preset condition is met;
    所述控制模块根据所述升级文件更新自身的程序。The control module updates its own program according to the upgrade file.
  13. 根据权利要求12所述的程序更新方法,其特征在于:在所述通信模块接收到来自所述控制模块的升级请求时,所述通信模块将所述升级文件发送至所述控制模块。The program updating method according to claim 12, wherein said communication module transmits said upgrade file to said control module when said communication module receives an upgrade request from said control module.
  14. 根据权利要求13所述的程序更新方法,其特征在于:所述升级文件包含程序结束标识,所述控制模块在未接收到所述程序结束标识时发送所述升级请求给所述通信模块。The program updating method according to claim 13, wherein the upgrade file includes a program end identifier, and the control module sends the upgrade request to the communication module when the program end identifier is not received.
  15. 根据权利要求12所述的程序更新方法,其特征在于:在所述通信模块接收到来自外部设备的升级请求时,所述通信模块将所述升级文件发送至所述控制模块。The program updating method according to claim 12, wherein said communication module transmits said upgrade file to said control module when said communication module receives an upgrade request from an external device.
  16. 一种适用于如权利要求5所述的电子装置的程序更新方法,包括:A program updating method suitable for an electronic device according to claim 5, comprising:
    所述通信模块通过所述无线通信单元接收来自外部设备的升级文件并将所述升级文件存储在所述存储单元;The communication module receives an upgrade file from an external device through the wireless communication unit and stores the upgrade file in the storage unit;
    在满足预设条件下,所述通信模块发送升级指令至所述数据总线;The communication module sends an upgrade instruction to the data bus when the preset condition is met;
    所述控制模块和逆变模块从所述数据总线上接收到所述升级指令后停止工作,进入监听状态;After receiving the upgrade instruction from the data bus, the control module and the inverter module stop working and enter a listening state;
    所述控制模块和逆变模块判断所述升级指令是否是对应自身的升级指令,如果是则进入升级模式,如果不是,则继续维持监听状态;The control module and the inverter module determine whether the upgrade instruction is an upgrade instruction corresponding to itself, and if yes, enter an upgrade mode, and if not, continue to maintain a listening state;
    所述控制模块和所述逆变模块之一判断是对自身的升级指令后发送升级响 应至所述数据总线;One of the control module and the inverter module determines that an upgrade command is sent to the data bus after upgrading the command;
    所述通信模块从所述数据总线接收到所述升级响应后,通过所述数据总线发送所述升级文件至与发送所述升级响应对应的所述控制模块或逆变模块;After receiving the upgrade response from the data bus, the communication module sends the upgrade file to the control module or the inverter module corresponding to the sending the upgrade response by using the data bus;
    所述控制模块或逆变模块在接收到所述升级文件后根据所述升级文件更新自身的程序。The control module or the inverter module updates its own program according to the upgrade file after receiving the upgrade file.
  17. 根据权利要求16所述的程序更新方法,其特征在于:在所述通信模块接收到来自所述控制模块或所述逆变模块的升级请求时,所述通信模块发送升级指令至所述数据总线。The program updating method according to claim 16, wherein when the communication module receives an upgrade request from the control module or the inverter module, the communication module sends an upgrade command to the data bus .
  18. 根据权利要求17所述的程序更新方法,其特征在于:所述升级文件包含程序结束标识,所述控制模块或逆变模块在未接收到所述程序结束标识时发送所述升级请求至所述通信模块。The program updating method according to claim 17, wherein the upgrade file includes a program end identifier, and the control module or the inverter module sends the upgrade request to the Communication module.
  19. 根据权利要求16所述的程序更新方法,其特征在于:在所述通信模块接收到来自外部设备的升级请求时,所述通信模块发送升级指令至所述数据总线。The program updating method according to claim 16, wherein said communication module transmits an upgrade command to said data bus when said communication module receives an upgrade request from an external device.
  20. 根据权利要求16所述的程序更新方法,其特征在于:所述控制模块和逆变模块具有唯一标识符,所述升级指令包含所述控制模块和/或逆变模块的唯一标识符;所述控制模块和逆变模块通过判断所述升级指令中的所述唯一标识符与自身的唯一标识符是否匹配,如果是,则判断是对自身的升级指令。The program updating method according to claim 16, wherein the control module and the inverter module have a unique identifier, and the upgrade instruction includes a unique identifier of the control module and/or the inverter module; The control module and the inverter module determine whether the unique identifier in the upgrade instruction matches its own unique identifier, and if so, determine that it is an upgrade instruction for itself.
  21. 根据权利要求16所述的程序更新方法,其特征在于:所述控制模块和逆变模块具有唯一标识符,所述升级响应包含所述唯一标识符。The program updating method according to claim 16, wherein said control module and said inverter module have a unique identifier, and said upgrade response includes said unique identifier.
  22. 根据权利要求21所述的程序更新方法,其特征在于:所述程序更新方法还包括:所述通信模块在接收到所述升级响应后,根据所述升级响应中包含 的所述唯一标识符,发送升级密钥给与所述唯一标识符相匹配的所述控制模块或所述逆变模块,与所述唯一标识符相匹配的所述控制模块或所述逆变模块在收到所述升级密钥后,进入程序更新过程。The program updating method according to claim 21, wherein the program updating method further comprises: after receiving the upgrade response, the communication module, according to the unique identifier included in the upgrade response, Sending an upgrade key to the control module or the inverter module that matches the unique identifier, the control module or the inverter module that matches the unique identifier receives the upgrade After the key, enter the program update process.
  23. 根据权利要求16所述的程序更新方法,其特征在于:所述通信模块按照预设顺序发送所述升级文件至所述控制模块和所述逆变模块。The program updating method according to claim 16, wherein the communication module transmits the upgrade file to the control module and the inverter module in a preset order.
  24. 根据权利要求23所述的程序更新方法,其特征在于:所述程序更新方法还包括:所述控制模块或逆变模块在完成自身程序更新后,发送升级结束反馈至所述通信模块;在所述通信模块未接收到所述控制模块和所述逆变模块的升级结束反馈时,所述通信模块发送升级指令至所述数据总线。The program updating method according to claim 23, wherein the program updating method further comprises: after the self-program update is completed, the control module or the inverter module sends an upgrade end feedback to the communication module; When the communication module does not receive the upgrade end feedback of the control module and the inverter module, the communication module sends an upgrade instruction to the data bus.
PCT/CN2018/114972 2017-11-30 2018-11-12 Electronic device and program updating method therefor WO2019105211A1 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201880003939.XA CN110192321B (en) 2017-11-30 2018-11-12 Electronic device
US16/887,584 US11029941B2 (en) 2017-11-30 2020-05-29 Electrical device and program update method thereof
US17/335,807 US20210286612A1 (en) 2017-11-30 2021-06-01 Electrical device and program update method thereof
US18/085,903 US20230127497A1 (en) 2017-11-30 2022-12-21 Electrical device and program update method thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711237737.5 2017-11-30
CN201711237737 2017-11-30

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/122770 Continuation WO2019120292A1 (en) 2017-11-30 2018-12-21 Battery pack and method for data transmission between battery pack and electronic device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/887,584 Continuation US11029941B2 (en) 2017-11-30 2020-05-29 Electrical device and program update method thereof

Publications (1)

Publication Number Publication Date
WO2019105211A1 true WO2019105211A1 (en) 2019-06-06

Family

ID=66664683

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/114972 WO2019105211A1 (en) 2017-11-30 2018-11-12 Electronic device and program updating method therefor

Country Status (2)

Country Link
CN (1) CN110192321B (en)
WO (1) WO2019105211A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698863A (en) * 2020-12-30 2021-04-23 天津恒达文博科技股份有限公司 Intelligent tour guide machine charging writing-in equipment and charging writing-in method
CN114762475A (en) * 2020-12-30 2022-07-19 南京泉峰科技有限公司 Electronic system for self-driven device

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968535A (en) * 2019-11-29 2020-04-07 上海庆科信息技术有限公司 Control instruction processing method and device, processor and electronic device
CN111385300B (en) * 2020-03-05 2022-03-18 深圳市电科电源股份有限公司 Method and system for self-adapting of multiple communication protocols of energy storage system
CN111880823B (en) * 2020-07-17 2024-01-30 合肥移瑞通信技术有限公司 Method, system and medium for upgrading communication module by system and computer equipment
CN115576587B (en) * 2022-11-18 2023-04-14 合肥康芯威存储技术有限公司 Firmware upgrading device and method for storage device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008011645A (en) * 2006-06-29 2008-01-17 Toshiba Corp Power supply controller, electronic device, and operation control method
CN101655801A (en) * 2009-09-11 2010-02-24 华为技术有限公司 Method and device for upgrading drive software
US20140109075A1 (en) * 2012-10-17 2014-04-17 Movimento Group Module updating device
CN104102514A (en) * 2014-07-18 2014-10-15 江苏兆伏新能源有限公司 Firmware upgrading method and firmware upgrading device
CN107231026A (en) * 2017-06-27 2017-10-03 罗冠庆 A kind of multifunctional intellectual recognizes the pocket power supply unit of purposes

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013014914A2 (en) * 2011-07-24 2013-01-31 Makita Corporation Adapter for power tools, power tool system and method of operating the same
WO2014015072A2 (en) * 2012-07-17 2014-01-23 Milwaukee Electric Tools Corporation Universal protocol for power tools
CN103942080B (en) * 2014-05-16 2016-08-24 国网山东省电力公司青岛供电公司 Electronic device information transmission method
JP6567805B2 (en) * 2014-05-26 2019-08-28 株式会社マキタ Electric tool equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008011645A (en) * 2006-06-29 2008-01-17 Toshiba Corp Power supply controller, electronic device, and operation control method
CN101655801A (en) * 2009-09-11 2010-02-24 华为技术有限公司 Method and device for upgrading drive software
US20140109075A1 (en) * 2012-10-17 2014-04-17 Movimento Group Module updating device
CN104102514A (en) * 2014-07-18 2014-10-15 江苏兆伏新能源有限公司 Firmware upgrading method and firmware upgrading device
CN107231026A (en) * 2017-06-27 2017-10-03 罗冠庆 A kind of multifunctional intellectual recognizes the pocket power supply unit of purposes

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698863A (en) * 2020-12-30 2021-04-23 天津恒达文博科技股份有限公司 Intelligent tour guide machine charging writing-in equipment and charging writing-in method
CN114762475A (en) * 2020-12-30 2022-07-19 南京泉峰科技有限公司 Electronic system for self-driven device

Also Published As

Publication number Publication date
CN110192321B (en) 2023-04-04
CN110192321A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
WO2019105211A1 (en) Electronic device and program updating method therefor
WO2019120292A1 (en) Battery pack and method for data transmission between battery pack and electronic device
CN110226154B (en) Portable power supply capable of being upgraded remotely and remote upgrading method
US11029941B2 (en) Electrical device and program update method thereof
WO2008027920A2 (en) Power supply capable of receiving digital communications from electronic devices
JP2013509153A (en) Battery connection device patch and related system and method
CN104412245A (en) Modular wireless power, light and automation control
CN110457055B (en) Firmware upgrading control method, system and control terminal for quick-charging protocol
CN105135599A (en) Air conditioner firmware upgrading device and method
US20200251917A1 (en) Method for connecting a battery powered device to a server via a battery module powering the device and related device
CN105159109B (en) A kind of PLC controller remote update system
CN105608859A (en) Method and system for enabling wireless control in tools
US20200313448A1 (en) Power bridge device using mobile robot battery
CA3075328C (en) System and method for monitoring and remotely controlling a state of charge of at least one battery pack
WO2018145541A1 (en) Terminal and multi-path power supply control method
CN104898509A (en) Industrial control computer monitoring method and system based on secure short message
CN105208517A (en) Wireless router device and communication method
CN104807127A (en) Offline update device and method for air conditioner controller program
JP7044135B2 (en) Network unit, maintenance system, computer program and power storage element data transmission method
CN105576949A (en) Power adapter and debugging method and system
CN117784643A (en) Equipment management method and device, storage medium and electronic device
CN112486526A (en) Firmware upgrading use method and system, charger, user terminal and server
CN115842405A (en) High-pressure energy storage valve system, control unit of power module of high-pressure energy storage valve system and upgrading method of control unit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18884091

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18884091

Country of ref document: EP

Kind code of ref document: A1