Firmware update method for smart charging device

A firmware update method for a smart charging device is disclosed. First, firmware of a first board is updated, and the first board then sets work flags to second, third board and fourth boards. The first board queries a firmware version of the second board, and then presets the work flag of a firmware version as false. When the firmware version of the second board is older, the first board sets the work flag as true, and updates the firmware of the second board, and sets the work flag as false. The first board again queries whether the work flag is set as true, when the firmware versions of the second and first boards are the same, the work flag is set as false. According to the above procedures, the firmware of the third and fourth boards is updated, so as to completely update firmware of all boards.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a firmware update method for a smart charging device, more particularly to a firmware update method using a master computer to perform energy control and allocation according to information of voltage, current and temperature, collected via a communication interface, of the slave board, and after firmware of a master board is updated, firmware of the slave boards can automatically be updated, and during the process where the master board actively updates the slave boards, a check mechanism is performed on all data, so as to prevent the data from being stolen or broken by hacking from the outside.

2. Description of the Related Art

In recent years, with rapid development of electronic technology and multimedia information, electronic products such as smart phones, tablet computers, and notebook computers are designed toward light, short, and powerful functions to have features of smaller size, lighter weight, and easy carry, and software and hardware of the electronic products are also continuously innovated, so that the electronic products can be used more flexibly and have improved practical effects, and become indispensable devices widely applied in people's work and life entertainment.

However, as the processing speed of the electronic product is improved, the mobile electronic device such as smart phone, tablet computer or notebook computer consumes more power. As a result, when a user operates a mobile electronic product while walking, the battery power of the mobile electronic device is quickly exhausted, and the user needs to find a power socket to charge the battery of the mobile electronic device.

In teaching environment (for example, schools), in order to meet the requirement in digital teaching, teachers and students use mobile electronic devices, such as tablets or notebooks, to replace traditional books for knowledge transfer, so how to conveniently charge the mobile electronics becomes extremely important. Generally, a charging device, such as a charging cabinet or a charging car, can provide a plurality of AC sockets or DC charging sockets, such as USB sockets, disposed thereon to charge the plurality of mobile electronic devices through necessary chargers and charging lines. Some conventional charging devices include a plurality of extensible boards used for controlling charging, and firmware of the plurality of boards can be updated through a computer updating apparatus. However, the conventional firmware update mechanism is incomplete, so a computer operator must carry the computer updating apparatus to the location where the charging device is disposed and manually perform the firmware update operation. As a result, in the conventional update mechanism, the charging devices cannot be updated in time subject to the computer operator scheduling. How to solve above-mention problem becomes a key issue in the industry.

SUMMARY OF THE INVENTION

Therefore, the inventors develop a firmware update method for a smart charging device according to collected data, tests and modifications, and years of research experience, so as to solve the conventional problems.

An objective of the present invention is to provide a firmware update method for a smart charging device, and the firmware update method includes steps of: updating, by a master computer, latest firmware to a first board; setting, by the first board, a plurality of work flags to a second board, a third board and a fourth board; query, by the first board, a firmware version of the second board and presetting a work flag of the firmware version of the second board as false, and when the firmware version of the second board is older than that of the latest firmware, updating the work flag of the firmware version of the second board as true, and then updating, by the first board, the firmware of the second board and setting the work flag of the firmware version of the second board as false; querying again, by the first board, whether the work flag of the firmware version of the second board is true, and when the firmware version of the second board and the first board are the same, setting the work flag of the firmware version of the second board as false; updating firmware of the third and fourth boards according to a procedure of previous steps, to complete firmware update of the boards; during the update process, a check mechanism is performed on all data, so as to prevent the data from being stolen or broken by hacking from the outside.

Another objective of the present invention is that the firmware includes an outside tool/program accesses firmware inside variable/area (OAI) region, a firmware update information storage region, a public key storage region, and a digital signature storage region.

Another objective of the present invention is that the firmware update information storage region is divided into two regions including a first region configured to store an operation firmware, and a second region configured to store an update firmware.

Another objective of the present invention is that a tool software is used to read the OAI region and import and write firmware update information into the firmware update information storage region, the firmware update information includes a CRC32 value and a time serial number, and the firmware is determined as a new version or an old version according to the time serial number.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

In addition, unless explicitly described to the contrary, the word “comprise” and variations such as “comprises” or “comprising”, will be acknowledged to imply the inclusion of stated elements but not the exclusion of any other elements.

Please refer toFIGS. 1 to 3, which are a functional block circuit diagram of a smart charging device of the present invention, and a functional block diagram and a detailed functional block diagram of an operation of using a master computer to update firmware of the smart charging device according to the present invention. The smart charging device mainly includes a smart charging device1and a master computer2. The smart charging device1includes a first board11, a second board12, a third board13, and a fourth board14. The functions and connection relationships of the functional blocks are described in detail in following paragraphs.

The present invention provides an energy control system which can be implemented by one or more circuit board, and the key feature of the present invention is to use multiple circuit boards to form a charging system. In the smart charging device1, one of the multiple circuit boards serves as a master board configured to manage and detect a total output power to control power output of a power supply, and also collect power output states of all slave boards, connected to the charging system, so as to prevent the total power of the power supply of the charging system from overloading. When the total power of the power supply is sufficient to charge the plurality of to-be-charged devices at the same time, all of the master board and the slave boards can charge the plurality of to-be-charged devices in a fully charging mode. When the total power of the power supply is insufficient to charge the plurality of to-be-charged devices at the same time, the master board allocates and divides charging periods of the master board and the slave boards, thereby taking turn to charge the to-be-charged devices in an alternating charging mode. After the alternating charging mode is performed for a period and some of the to-be-charged devices recover partial electrical power, and the total power of the power supply is sufficient to charge all to-be-charged devices at the same time, all of the master board and the slave boards can charge the to-be-charged devices in the fully charging mode until all of the to-be-charged devices are fully charged.

The smart charging device1of the present invention can be a charging cabinet or a charging car for charging to tablets or notebook computers, and can provide a charging device with scalability. In the smart charging device1, the master computer can perform energy control and allocation according to information of voltage, current and temperature, collected via a communication interface21, of the slave boards. In an embodiment, the communication interface21can be Internet, mobile network, local area network (LAN), or wireless local area network (WLAN). After the firmware of the master board is updated, the master board can automatically update the firmware of the slave boards, and during the process where the master board actively updates the slave boards, a check mechanism is performed on all data to prevent the data from being stolen or broken by hacking from the outside.

The first board11connected to the master computer is set as a master board, and the remaining boards are set as slave boards. The boards can be recognized by a hardware mechanism; alternatively, a method is required to designate a board number of each board after power on, so that information can be transmitted to the boards based on the board numbers. In order to form a circuit architecture of controlling charging operations in serial, an input interface of the first board11, which is set as the master board, can be changed from an I2C0 slave interface111(as shown inFIG. 2) to an I2C0 master interface114(as shown inFIG. 3), and the I2C0 master interface114can be used to control the third and four boards13and14.

The first board (master board)11can transmit a board number assign instruction to the slave board connected to the I2C1 master output interface thereof, so as to inform the corresponding slave board to be the second board12.

The first board11transmits the board number assign instruction to the slave board connected to the I2C0 master input interface thereof, so as to inform the corresponding slave board to be the third board13.

The third board13transmits the board number assign instruction to the slave board connected to the I2C1 master output interface thereof, so as to inform the corresponding slave board to be the fourth board14.

After the step of assigning the board numbers to the corresponding boards is completed, the master board (first board11) can communicate with slave boards including the second board12, the third board13and the fourth board14.

The input/output interfaces of the first board11include the I2C0 master interface114and an I2C1 master interface112, and a first firmware113is disposed between the input/output interfaces. The input/output interfaces of the second board12include an I2C0 slave interface121and an I2C1 master interface122, and a second firmware123is disposed between the input/output interfaces. The input/output interfaces of the third board13include an I2C0 slave interface131and an I2C1 master interface132, and a third firmware133is disposed between the input/output interfaces. The input/output interfaces of the fourth board14include an I2C0 slave interface141and an I2C1 master interface142, and a fourth firmware143is disposed between the input/output interfaces. The other of the plurality of numbered extension boards, such as a fifth board, a sixth board, . . . an Nth board, are similarly assigned with board numbers and have configurations similar to aforementioned configurations.

Please refer toFIG. 4, which is a structural view of the firmware storing information according to the present invention. A firmware3(such as one of the first firmware113, the second firmware123, the third firmware133and the fourth firmware143) includes an outside tool/program accesses firmware inside variable/area (OAI) region31, a firmware update information storage region32, a public key storage region33and a digital signature storage region34. The firmware update information storage region32is divided into two regions, which are not shown in figures. The two regions include a first region configured to store an operation firmware, and a second region configured to store an update firmware. A tool software, which is not shown in figures, can be used to read the OAI region31, and import and write firmware update information, which is not shown in figures, into the firmware update information storage region32. In an embodiment, the firmware update information can include a CRC32 value and a time serial number, and the firmware can be determined as a new version or an old version according to the time serial number.

Please refer toFIG. 5, which is a flowchart of a firmware update method for a smart charging device of the present invention. The firmware update method can be performed according to following steps.

In a step41, the master computer updates the latest firmware to the first board, which is also called as master board herein.

In a step42, after the step of assigning the board numbers to the boards is completed, the first board sets the plurality of work flags to the second board, the third board, and the fourth board and the plurality of numbered extension boards, and the work flags are used to determine whether the update operations are completed in later steps.

In a step43, the second board is updated according to procedures below. The first board queries the firmware version of the second board first, and then presets the work flag of the firmware version of the second board as false, and when the firmware version of the second board is older, the first board sets the work flag of the firmware version of the second board as true, and then updates the firmware of the second board, and then sets the work flag of the firmware version of the second board as false after the update operation; the first board again queries whether the work flag of the firmware version of the second board is set as true, and the purpose of querying the second board again is to query the firmware version again, so as to determine whether the firmware is indeed updated, when the work flag is true, the update operation is performed; and when the work flag is false, no action is performed; when the firmware versions of the second board and the first board are the same, the work flag of the firmware version of the second board is set as false.

In a step44, the firmware of the third and fourth boards and the firmware of the numbered extension board are updated according to the procedures of the step43, so as to completely update the firmware of all boards.

According the contents disclosed inFIGS. 1 to 5, the present invention provides the firmware update method for the smart charging device, and in the firmware update method, the master computer updates the latest firmware to the first board; the first board sets the plurality of work flags to the second board, the third board, and the fourth board; the first board queries the firmware version of the second board first, and presets the work flag of the firmware version of the second board as false; when the firmware version of the second board is older, the first board updates the work flag of the firmware version of the second board as true, and then updates the firmware of the second board, and then sets the work flag of the firmware version of the second board as false after the update operation; the first board queries again whether the work flag of the firmware version of the second board is set as true, and when the firmware versions of the second board and the first board are the same, the first board sets the work flag of the firmware version of the second board as false; the firmware of the third and fourth boards is updated according to the procedures of previous step, so as to completely update the firmware of the boards. As a result, the firmware update method of the present invention has excessive high security and high update efficiency.