Firmware updating method, system, device, equipment and storage mediumTechnical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a system, an apparatus, a device, and a storage medium for firmware update.
Background
Arduino: an open source electronic prototype platform which is convenient, flexible and convenient to use. Including hardware (various models of Arduino circuit boards) and software (Arduino IDE). The program is uploaded to the Arduino board by writing the program code in the IDE.
AVRDUDE: AVR Downloader Uploader, a program for downloading and uploading memory on an Atmel AVR microcontroller.
With the development of network technology, people have higher and higher entertainment requirements on electronic devices. Therefore, the software firmware of the electronic device needs to be updated or upgraded frequently. However, the current requirements for the programming capability of users for updating or upgrading the software firmware are high, and the requirements of the masses cannot be met.
For example, today's robot toys generally speak, sing songs, etc., and such actions are implemented by means of built-in programs. The Arduino circuit board is installed in the robot toy, and an AVRDUDE tool is adopted for updating the firmware of the Arduino circuit board in the prior art. AVRDUDE is a command line programming software, all operations are implemented through command line termination to enter the termination mode of AVRDUDE. The AVRDUDE tool is integrated in IDE software on a PC, developers write programs on the PC by the IDE software, are connected with the Arduino circuit board through a serial port, set parameters and update the programs to the Arduino circuit board, so that different functions are realized. Because the application of the Arduino hardware is slowly opened to the public, the existing specialized updating mode has higher requirement on the programming capability of a user, and the requirement of the public cannot be met. A simpler method is urgently needed to update the Arduino firmware, so that the public can conveniently realize the operation of different functions of the toy with the Arduino mainboard.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. To this end, it is an object of the present invention to provide a method, system, apparatus, device and storage medium for firmware update which is simpler and easier to implement.
The technical scheme adopted by the invention is as follows: a method of firmware update comprising the steps of:
scanning and identifying a two-dimensional code by using a mobile terminal, wherein the two-dimensional code corresponds to a firmware file stored in a server;
the mobile terminal acquires a firmware file corresponding to the two-dimensional code from the server;
and the mobile terminal sends the firmware file to the electronic equipment to automatically update the firmware file.
Preferably, the step of acquiring, by the mobile terminal, the firmware file corresponding to the two-dimensional code from the server specifically includes:
the mobile terminal scans and identifies the two-dimension code, and jumps to a server address page corresponding to the two-dimension code, wherein the server address page stores a first application program and/or a download link of the first application program, and the firmware file and/or a download link of the firmware file;
the server address page judges whether the mobile terminal installs the first application program;
if the mobile terminal does not install the first application program, downloading the first application program and installing the first application program to the mobile terminal;
if the first application program is installed on the mobile terminal, starting the first application program;
and acquiring the firmware file from the server address page by using the first application program.
Preferably, the step of sending the firmware file to the electronic device by the mobile terminal for automatic updating of the firmware file includes:
the mobile terminal is connected with the electronic equipment according to mainboard information of the electronic equipment, wherein the mainboard information comprises a network address of a mainboard and a mainboard type;
and the mobile terminal sends the firmware file to the electronic equipment to automatically update the firmware file.
Preferably, a method of firmware update further comprises the steps of: and the mobile terminal acquires and displays the update state of the firmware file on a display screen.
A system for firmware update, comprising:
the scanning unit is used for scanning and identifying a two-dimensional code by the mobile terminal, wherein the two-dimensional code corresponds to a firmware file stored in the server;
the acquisition unit is used for acquiring the firmware file corresponding to the two-dimensional code from the server by the mobile terminal;
and the sending unit is used for sending the firmware file to the electronic equipment by the mobile terminal to automatically update the firmware file.
Preferably, the acquiring unit includes:
the skipping unit is used for skipping to a server address page corresponding to the two-dimensional code, and the server address page stores a first application program and/or a downloading link of the first application program, and the firmware file and/or a downloading link of the firmware file;
the judging unit is used for judging whether the first application program is installed on the mobile terminal or not by the server address page;
a firmware file obtaining unit, configured to obtain the firmware file from the server address page by using the first application program.
Preferably, the sending unit is connected to the electronic device according to motherboard information of the electronic device, and sends the firmware file to the electronic device for automatic update of the firmware file, where the motherboard information includes a network address of the motherboard and a motherboard type.
A firmware updating device comprises a mobile terminal, a two-dimensional code and a server;
the two-dimensional code corresponds to a firmware file stored in a server;
the mobile terminal is used for scanning and identifying the two-dimension code, sending a request for downloading the firmware file to the server according to the information of the two-dimension code, and transmitting the obtained firmware file to the electronic equipment for automatic updating of the firmware file;
and the server is used for sending the corresponding firmware file to the mobile terminal according to the firmware file downloading request sent by the mobile terminal.
An apparatus for firmware update, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described firmware update method.
A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the above-described firmware updating method.
The invention has the beneficial effects that: according to the firmware updating method, the firmware updating system, the firmware updating device, the firmware updating equipment and the firmware updating storage medium, the firmware files are pre-stored in the server, and the two-dimensional code is set for each firmware file; scanning and identifying the two-dimensional code by using the mobile terminal, and acquiring a firmware file corresponding to the two-dimensional code from the server; and the mobile terminal sends the firmware file to the electronic equipment for automatic updating of the firmware file. The method, the system, the device, the equipment and the storage medium for updating the firmware through the two-dimensional code are simpler, more intelligent and convenient to implement.
The invention fully utilizes the convenience of two-dimension code scanning, and automatically updates the firmware by scanning the two-dimension code triggering event.
Drawings
FIG. 1 is a flowchart illustrating a firmware update method according to an embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
As shown in fig. 1, the present invention discloses a firmware updating method, which comprises the following steps:
scanning and identifying a two-dimensional code by using a mobile terminal, wherein the two-dimensional code corresponds to a firmware file stored in a server;
the mobile terminal acquires a firmware file corresponding to the two-dimensional code from the server;
and the mobile terminal sends the firmware file to the electronic equipment for automatic updating of the firmware file.
In this embodiment, the mobile terminal includes an intelligent terminal having a scanning function and a communication function, such as a mobile phone and a tablet computer. The firmware files are stored in the cloud server in advance, and a corresponding two-dimensional code is set for each firmware file. And scanning and identifying the two-dimensional code by using the mobile terminal, so that the firmware file corresponding to the two-dimensional code can be obtained from the cloud server. And then the firmware file is sent to the electronic equipment to complete the automatic updating of the firmware file.
In this embodiment, the electronic device includes a robot, a numerical control or program control system, and other devices that can be updated and controlled by the mobile terminal.
Further, the mobile terminal obtains the firmware file corresponding to the two-dimensional code from the server, and the method specifically includes:
the mobile terminal scans the two-dimensional code and jumps to a server address page corresponding to the two-dimensional code, wherein the server address page stores the first application program and/or a download link of a firmware file and/or a download link of the firmware file;
the server address page judges whether the mobile terminal is provided with a first application program or not;
if the mobile terminal does not install the first application program, downloading the first application program and installing the first application program to the mobile terminal;
if the mobile terminal has installed the first application program, starting the first application program;
the firmware file is obtained from the server address page using the first application.
And the user scans and identifies the two-dimension code by using the mobile terminal, and the interface jumps to a server address page corresponding to the two-dimension code. The server address page stores the first application and/or a download link of the first application. The first application program is an APP installed in a mobile terminal of a user, and the APP can update firmware of the electronic device.
The server address page judges whether the first application program is installed in the mobile terminal of the user or not through the background program code. And if the mobile terminal of the user does not install the first application program, acquiring the first application program from the address page of the server or skipping to a download link of the first application program, downloading the first application program and installing the first application program to the mobile terminal of the user. And if the first application program is installed on the mobile terminal of the user, starting the first application program, and acquiring the firmware file from the server address page by using the first application program. The server address page may only store the download link of the firmware file, and at this time, the first application program is used to obtain the download link of the firmware file from the server address page, and the firmware file is obtained through the download link of the firmware file.
Specifically, in the APPs of the android system and the IOS system, after the two-dimensional code is scanned, the firmware updating interface of the APP can be started, the parameter ID is brought to the updating interface through the server address page, the parameter ID is the unique code of the firmware file corresponding to the two-dimensional code, and therefore the firmware file corresponding to the two-dimensional code is accurately obtained.
Further, the mobile terminal sends the firmware file to the electronic device for automatic updating of the firmware file, which specifically includes:
the mobile terminal is connected with the electronic equipment according to the mainboard information of the electronic equipment;
and the mobile terminal sends the firmware file to the electronic equipment for automatic updating of the firmware file.
In this embodiment, the motherboard information of the electronic device includes a network address of the motherboard, a motherboard type, and the like, and is used to determine the electronic device that needs to be updated.
Further, a method for updating firmware further comprises the steps of:
the mobile terminal acquires and displays the update state of the firmware file on a display screen.
After the mobile terminal sends the firmware file to the electronic equipment, the mobile terminal can acquire the updating state of the firmware file in real time and display the success or failure of updating on the display screen. And if the updating fails, scanning the two-dimensional code again to obtain the firmware file.
Example one
A toy robot (electronic device) houses an Arduino Mega 2560 circuit board.
In order to provide different plays for users, a corresponding firmware file is generated for each play, a unique ID (code) is set, and the firmware file is stored in a cloud server in advance.
For each ID (code), a corresponding server address page and a corresponding two-dimensional code are generated.
And the user scans the two-dimensional code through a mobile phone or other mobile terminals and jumps to a server address page corresponding to the two-dimensional code. The server address page determines whether the user's mobile terminal has an APP (first application) installed. The APP can be used for updating the firmware of the electronic equipment, and can also be an application program used for a user to operate the toy robot.
If the APP is not installed on the mobile terminal of the user, downloading the APP and installing the APP on the mobile terminal; or skipping to the downloading link of the APP, downloading the APP and installing the APP to the mobile terminal;
and if the APP is installed on the mobile terminal of the user, starting the APP. And the user acquires the firmware file from the cloud server by using the APP.
After the mobile terminal of the user acquires the firmware file, the mobile terminal is connected with a wifi module of the Arduino Mega 256 circuit board of the toy robot through a serial port according to the information of the Arduino Mega 256 circuit board. The information of the Arduino Mega 256 circuit board includes a network address of the wifi module, a type of the circuit board, and the like. And after the connection is successful, calling an AVRDUDE command line, and sending the firmware file to the Arduino Mega 256 circuit board for automatic updating. The AVRDUDE command line contains the network address of the wifi module, such as 192.168.0.201; also included is circuit board type information, such as Mega 256.
After the firmware file is sent, displaying an updating state on the APP: update success or update failure. And if the updating fails, scanning the two-dimensional code again to obtain the firmware file.
The invention also discloses a system for updating firmware, which comprises:
the scanning unit is used for scanning and identifying the two-dimensional code by the mobile terminal, and the two-dimensional code corresponds to a firmware file stored in the server;
the acquisition unit is used for acquiring the firmware file corresponding to the two-dimensional code from the server by the mobile terminal;
and the sending unit is used for sending the firmware file to the electronic equipment by the mobile terminal for automatic updating of the firmware file.
Further, the acquisition unit includes:
the skipping unit is used for skipping to a server address page corresponding to the two-dimensional code, and the server address page stores the first application program and/or a download link of the first application program, and the firmware file and/or a download link of the firmware file;
the judging unit is used for judging whether the mobile terminal is provided with the first application program or not by the server address page;
a firmware file acquiring unit for acquiring a firmware file from the server address page by using the first application program.
Further, the sending unit is connected with the electronic device according to the mainboard information of the electronic device, and sends the firmware file to the electronic device for automatic updating of the firmware file.
The invention also discloses a firmware updating device, which comprises a mobile terminal, a two-dimensional code and a server;
the two-dimensional code corresponds to a firmware file stored in the server;
the mobile terminal is used for scanning and identifying the two-dimension code, sending a firmware file downloading request to the server according to the two-dimension code information, and transmitting the obtained firmware file to the electronic equipment for automatic updating of the firmware file;
the server is used for sending the corresponding firmware file to the mobile terminal according to the firmware file downloading request sent by the mobile terminal.
The invention also discloses a firmware updating device, which comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method of firmware update.
A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform a method of firmware update is also disclosed.
According to the invention, firmware files are pre-stored in a server, and a two-dimensional code is set for each firmware file; scanning and identifying the two-dimensional code by using the mobile terminal, and acquiring a firmware file corresponding to the two-dimensional code from the server; and the mobile terminal sends the firmware file to the electronic equipment for automatic updating of the firmware file. The method, the system, the device, the equipment and the storage medium for updating the firmware through the two-dimensional code are simpler, more intelligent and convenient to implement.
The invention fully utilizes the convenience of two-dimension code scanning, combines the characteristics of the toy industry, and automatically updates the firmware by scanning the two-dimension code triggering event. Is particularly suitable for various toys provided with Arduino circuit boards.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.