Disclosure of Invention
The invention provides a method, a device and equipment for wireless upgrading of intelligent household equipment, and solves the problem that directional OTAs (over the air) of a master MCU and a slave MCU cannot be completed in the existing intelligent household equipment upgrading scheme.
In a first aspect, the present invention provides a method for wirelessly upgrading an intelligent home device, which is applied to an intelligent home device, where the intelligent home device includes a master micro control unit MCU and a plurality of slave MCUs, and the method includes:
receiving an upgrading instruction sent by a server, wherein the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises a master MCU and/or a slave MCU;
downloading corresponding upgrading data of the MCU to be upgraded to a memory from the upgrading data downloading address;
and upgrading the MCU to be upgraded by using the upgrading data of the MCU to be upgraded in the memory, and feeding back an upgrading result to the server.
Optionally, upgrading the MCU to be upgraded by using the upgrade data of the MCU to be upgraded in the memory, including:
inquiring the state of the MCU to be upgraded, sending a state switching instruction to the MCU to be upgraded which is not switched to the state to be upgraded, and indicating to switch to the state to be upgraded;
respectively sending upgrading firmware to corresponding MCU to be upgraded so that the corresponding MCU to be upgraded acquires corresponding upgrading data from the memory by using the upgrading firmware and stores the upgrading data in a receiving cache region of the corresponding MCU to be upgraded;
and sending an upgrading instruction to the MCU to be upgraded, and controlling the MCU to be upgraded to upgrade according to the stored upgrading data.
Optionally, after the sending the upgrade firmware to the corresponding MCU to be upgraded respectively, the method further includes:
acquiring the size of a receiving cache region of the corresponding MCU to be upgraded, and determining the size of corresponding upgrading data transmitted in a single time according to the size of the receiving cache region;
and transmitting the corresponding data to be upgraded to the corresponding MCU to be upgraded for multiple times according to the size of the corresponding upgrading data transmitted once.
Optionally, before sending the upgrade firmware to the corresponding MCU to be upgraded, the method further includes:
acquiring the size of the available address space of the corresponding MCU to be upgraded;
and determining whether a space for storing the firmware exists in the corresponding MCU to be upgraded according to the size of the available address space.
Optionally, sending a state switching instruction to the MCU to be upgraded that is not switched to the state to be upgraded includes:
determining the MCU to be upgraded which is not switched to the state to be upgraded as a main MCU, and sending the state switching instruction to the main MCU;
and determining that the MCU to be upgraded which is not switched to the state to be upgraded is a slave MCU, sending the state switching instruction to a master MCU, and sending the state switching instruction to the slave MCU which is not switched to the state to be upgraded through the master MCU.
Optionally, after controlling the MCU to be upgraded to upgrade according to the stored upgrade data, the method further includes:
inquiring an upgrading result of the MCU to be upgraded, wherein the upgrading result at least comprises one of the following items: whether the upgrade is successful, the upgrade ending time and the upgrade failure reason.
Optionally, after controlling the MCU to be upgraded to upgrade according to the stored upgrade data, the method further includes:
and recovering the upgraded MCU from the state to be upgraded to the use state.
In a second aspect, the present invention provides a wireless upgraded smart home device, including a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is used for reading the program in the memory and executing the following steps:
receiving an upgrading instruction sent by a server, wherein the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises a master MCU and/or a slave MCU;
downloading corresponding upgrading data of the MCU to be upgraded to a memory from the upgrading data downloading address;
and upgrading the MCU to be upgraded by using the upgrading data of the MCU to be upgraded in the memory, and feeding back an upgrading result to the server.
Optionally, the upgrading the MCU to be upgraded by the processor using the upgrade data of the MCU to be upgraded in the memory includes:
inquiring the state of the MCU to be upgraded, sending a state switching instruction to the MCU to be upgraded which is not switched to the state to be upgraded, and indicating to switch to the state to be upgraded;
respectively sending upgrading firmware to corresponding MCU to be upgraded so that the corresponding MCU to be upgraded acquires corresponding upgrading data from the memory by using the upgrading firmware and stores the upgrading data in a receiving cache region of the corresponding MCU to be upgraded;
and sending an upgrading instruction to the MCU to be upgraded, and controlling the MCU to be upgraded to upgrade according to the stored upgrading data.
Optionally, after the processor sends the upgrade firmware to the corresponding MCUs to be upgraded, the processor is further configured to:
acquiring the size of a receiving cache region of the corresponding MCU to be upgraded, and determining the size of corresponding upgrading data transmitted in a single time according to the size of the receiving cache region;
and transmitting the corresponding data to be upgraded to the corresponding MCU to be upgraded for multiple times according to the size of the corresponding upgrading data transmitted once.
Optionally, before the processor sends the upgrade firmware to the corresponding MCU to be upgraded, the processor is further configured to:
acquiring the size of the available address space of the corresponding MCU to be upgraded;
and determining whether a space for storing the firmware exists in the corresponding MCU to be upgraded according to the size of the available address space.
Optionally, the sending, by the processor, a state switching instruction to the MCU to be upgraded that is not switched to the state to be upgraded includes:
determining the MCU to be upgraded which is not switched to the state to be upgraded as a main MCU, and sending the state switching instruction to the main MCU;
and determining that the MCU to be upgraded which is not switched to the state to be upgraded is a slave MCU, sending the state switching instruction to a master MCU, and sending the state switching instruction to the slave MCU which is not switched to the state to be upgraded through the master MCU.
Optionally, after the processor controls the MCU to be upgraded to upgrade according to the stored upgrade data, the processor is further configured to:
inquiring an upgrading result of the MCU to be upgraded, wherein the upgrading result at least comprises one of the following items: whether the upgrade is successful, the upgrade ending time and the upgrade failure reason.
Optionally, after the processor controls the MCU to be upgraded to upgrade according to the stored upgrade data, the processor is further configured to:
and recovering the upgraded MCU from the state to be upgraded to the use state.
In a third aspect, the present invention provides an apparatus for wireless upgrade of smart home devices, including:
the system comprises an instruction receiving unit, an upgrading unit and a data processing unit, wherein the instruction receiving unit is used for receiving an upgrading instruction sent by a server, the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises a master MCU and/or a slave MCU;
the data acquisition unit is used for downloading corresponding upgrading data of the MCU to be upgraded from the upgrading data downloading address to the memory;
and the upgrading unit is used for upgrading the MCU to be upgraded by utilizing the upgrading data of the MCU to be upgraded in the memory and feeding back an upgrading result to the server.
Optionally, the upgrading unit upgrades the MCU to be upgraded by using the upgrade data of the MCU to be upgraded in the memory, including:
inquiring the state of the MCU to be upgraded, sending a state switching instruction to the MCU to be upgraded which is not switched to the state to be upgraded, and indicating to switch to the state to be upgraded;
respectively sending upgrading firmware to corresponding MCU to be upgraded so that the corresponding MCU to be upgraded acquires corresponding upgrading data from the memory by using the upgrading firmware and stores the upgrading data in a receiving cache region of the corresponding MCU to be upgraded;
and sending an upgrading instruction to the MCU to be upgraded, and controlling the MCU to be upgraded to upgrade according to the stored upgrading data.
Optionally, after the upgrading unit sends the upgrading firmware to the corresponding MCUs to be upgraded, the upgrading unit is further configured to:
acquiring the size of a receiving cache region of the corresponding MCU to be upgraded, and determining the size of corresponding upgrading data transmitted in a single time according to the size of the receiving cache region;
and transmitting the corresponding data to be upgraded to the corresponding MCU to be upgraded for multiple times according to the size of the corresponding upgrading data transmitted once.
Optionally, the upgrading unit is further configured to, before sending the upgrade firmware to the corresponding MCU to be upgraded, respectively:
acquiring the size of the available address space of the corresponding MCU to be upgraded;
and determining whether a space for storing the firmware exists in the corresponding MCU to be upgraded according to the size of the available address space.
Optionally, the sending, by the upgrade unit, a state switching instruction to the MCU to be upgraded that is not switched to the state to be upgraded includes:
determining the MCU to be upgraded which is not switched to the state to be upgraded as a main MCU, and sending the state switching instruction to the main MCU;
and determining that the MCU to be upgraded which is not switched to the state to be upgraded is a slave MCU, sending the state switching instruction to a master MCU, and sending the state switching instruction to the slave MCU which is not switched to the state to be upgraded through the master MCU.
Optionally, the upgrading unit is configured to, after controlling the MCU to be upgraded to upgrade according to the stored upgrade data, further:
inquiring an upgrading result of the MCU to be upgraded, wherein the upgrading result at least comprises one of the following items: whether the upgrade is successful, the upgrade ending time and the upgrade failure reason.
Optionally, the upgrading unit is configured to, after controlling the MCU to be upgraded to upgrade according to the stored upgrade data, further:
and recovering the upgraded MCU from the state to be upgraded to the use state.
In a fourth aspect, the present invention provides a computer program medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method for wireless upgrade of smart home devices as provided in the first aspect above.
The invention provides a method, a device and equipment for wireless upgrading of intelligent household equipment, which have the following beneficial effects:
by downloading the upgrade data to the memory and utilizing the upgrade data in the memory to upgrade the MCU, a wired upper computer tool is replaced, OTA upgrade of a main MCU and/or a slave MCU of the intelligent household equipment is realized, and the intelligent household equipment is more flexible and convenient to upgrade.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the embodiments of the present application, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: in the description of the embodiments of the present application, "a" or "a" refers to two or more, and other terms and the like should be understood similarly, the preferred embodiments described herein are only used for explaining and explaining the present application, and are not used for limiting the present application, and features in the embodiments and examples of the present application may be combined with each other without conflict.
It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Hereinafter, some terms in the embodiments of the present disclosure are explained to facilitate understanding by those skilled in the art.
(1) In the embodiment of the present disclosure, the term "micro control Unit" (MCU), also called Single Chip Microcomputer (Single Chip Microcomputer) or Single Chip Microcomputer, is a computer that appropriately reduces the frequency and specification of a Central Processing Unit (CPU), and integrates peripheral interfaces such as a memory (memory) and a counter (Timer) on a Single Chip to form a Chip.
(2) In The embodiment of The present disclosure, The term "Over The Air" (OTA), that is, Over The Air, specifically refers to a remote wireless upgrade technology.
(3) In the embodiment of the present disclosure, the term "upper computer" refers to a computer that can directly issue a control command, and correspondingly, the lower computer is a computer that directly controls a device to obtain a device status. The command sent by the upper computer is firstly sent to the lower computer, and the lower computer is interpreted into a corresponding time sequence signal according to the command to directly control the corresponding equipment.
(4) The term "internet of things module" in the embodiment of the present disclosure is also called a Wi-Fi module or a serial port Wi-Fi module, belongs to an internet of things transmission layer, and has a function of converting a serial port or TTL level into an embedded module conforming to a Wi-Fi wireless network communication standard. The traditional hardware equipment is embedded into a Wi-Fi module, can be directly connected into the Internet by utilizing Wi-Fi, and is an important component for realizing application of Internet of things such as wireless intelligent home.
(5) In the embodiment of the disclosure, the term "Local Area Network" (LAN), the coverage Area of the LAN is generally within several kilometers, and the LAN has the characteristics of convenience in installation, cost saving, convenience in expansion and the like, so that the LAN is widely applied to various offices.
(6) In the embodiments of the present disclosure, the term "Wide Area Network" (or WAN for short), also called external Network or public Network, is a remote Network that connects local Area networks or metropolitan Area networks in different regions for computer communication, and usually spans a large physical range, ranging from tens of kilometers to thousands of kilometers, and can connect multiple regions, cities and countries, or span several continents and provide remote communication, thereby forming an international remote Network.
To make the objects, technical solutions and advantages of the present disclosure clearer, the present disclosure will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, rather than all embodiments. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort, shall fall within the scope of protection of the present disclosure.
In view of The existing scheme for upgrading The smart home devices, The software of The upper computer can only be connected through a wire, and The upgrading is carried out through a development tool, so that The problem that The oriented wireless upgrading (Over The Air, OTA) of The master MCU and The slave MCU cannot be completed exists. The application provides a method, a device and equipment for wireless upgrading of intelligent household equipment.
The invention conception of the application is as follows: firstly, receiving an upgrading instruction sent by a server, wherein the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises a master MCU and/or a slave MCU; then downloading corresponding upgrading data of the MCU to be upgraded from the upgrading data downloading address to a memory; and finally, upgrading the MCU to be upgraded by using the upgrading data of the MCU to be upgraded in the memory, and feeding back an upgrading result to the server.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The following describes a method, an apparatus, and a device for wireless upgrade of smart home devices in this embodiment in detail with reference to the accompanying drawings.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a schematic diagram of a scenario of wireless upgrade of an intelligent home device, including:
the intelligent home equipment 101 comprises an internet of things module, a main MCU and a plurality of slave MCUs, and is used for receiving an upgrading instruction sent by a server, wherein the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises the main MCU and/or the slave MCU; downloading corresponding upgrading data of the MCU to be upgraded to a memory from the upgrading data downloading address; and upgrading the MCU to be upgraded by using the upgrading data of the MCU to be upgraded in the memory, and feeding back an upgrading result to the server.
The smart home devices may be any smart home devices in terms of service functions, for example, three smart home devices, namely, a smart refrigerator 101-1, a smart air conditioner 101-2, and a smart washing machine 101-3, are exemplarily shown in fig. 1. The smart home devices in fig. 1 are only examples of the smart home devices in the embodiments of the present invention, and do not limit the smart home devices in the embodiments of the present invention, and any smart home devices that meet the requirements may be applied to the embodiments of the present invention.
As shown in fig. 2, an embodiment of the present invention provides an internal schematic diagram of an intelligent home device.
The intelligent home equipment is internally provided with a plurality of Micro Control Units (MCU), wherein the MCU comprises a main MCU Master and n +1 Slave MCU Slave, the main MCU can realize communication with the n +1 Slave MCU, and the specific communication relation is shown in fig. 2.
The intelligent household equipment further comprises an internet of things module, and the internet of things module can be communicated with the main MCU.
The server 103 is configured to send an upgrade instruction to the smart home device 101, and receive an upgrade result fed back by the smart home device 101;
the server sends the upgrade instruction to the corresponding smart home devices, for example, if the upgrade instruction includes upgrade instruction 1 of smart home device 1 and upgrade instruction 2 of smart home device 2, the server sends upgrade instruction 1 to smart home device 1, and sends upgrade instruction 2 to smart home device 2.
As an optional implementation manner, the server sends the upgrade instruction to all the transmittable smart home devices, the smart home device receiving the upgrade instruction identifies the compatibility of the received upgrade instruction and the upgrade condition of the smart home device, determines that the received upgrade instruction is compatible with the smart home device, and the upgrade condition meets the requirement, and performs upgrade.
It should be noted that the upgrade instruction may be sent by the server forwarding control end, or may be sent by the server itself when the upgrade condition is satisfied.
The condition for satisfying the upgrade includes at least one of the following conditions:
a new upgraded version exists;
and the preset upgrading period is met.
In an implementation scenario of the upgrade instruction sent by the server forwarding control end, fig. 1 further includes:
and the control end 104 is configured to generate an upgrade instruction according to an upgrade requirement of a user, and send the upgrade instruction to the server.
The control end may be a virtual platform or device in various forms, for example, a cloud platform 104-1, a mobile end 104-2, and a PC end 104-3 are exemplarily shown in fig. 1. The control terminal in fig. 1 is only an example of the control terminal in the embodiment of the present invention, and does not limit the control terminal in the embodiment of the present invention, and any control terminal that meets the requirements may be applied to the embodiment of the present invention.
It should be noted that the upgrade instruction may be sent by forwarding through a router, or may be directly transmitted through a local area network.
In an implementation scenario that the server forwards the upgrade instruction through the router, the method shown in fig. 1 further includes:
and the router 102 is configured to forward the upgrade instruction sent by the server.
It should be noted that, the communication between the smart home device and the router is realized through a local area network, and the communication between the server and the control end and the router is realized through a wide area network.
When the server and the control terminal are under a local area network with the router, the server and the control terminal can also communicate with the router through the local area network.
An embodiment of the present invention provides a flowchart of a method for wirelessly upgrading an intelligent home device, as shown in fig. 3, including:
step S301, receiving an upgrading instruction sent by a server, wherein the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises a master MCU and/or a slave MCU;
the upgrade instruction indicates the MCU to be upgraded to perform the upgrade operation, and specifically, the identifier of the MCU to be upgraded may be carried in the upgrade instruction.
The upgrading instruction further comprises verification information, a hardware version number of the intelligent household equipment, the size of upgrading data and the version of the upgrading data.
An example of an upgrade instruction provided in an embodiment of the present invention is given below:
{
"MCUs":[{
"MCU":"0201",
"URL":http://server.something.com/path/to/firmware1,
"CRC32":"22222CAA",
"HW":"0001",
"Size":30,
"OldSW":"00.15"
}
]
}
wherein, "" MCU ": "0201" "is the identification number of the MCU to be upgraded," "URL": http:// server. sensing. com/path/to/firmware1 "is the update data download address corresponding to the MCU0201 described above," "CRC 32": "22222CAA" "is check information," "HW": 0001 is the hardware version number of the intelligent household equipment, Size: 30 "is the size of the upgrade data," "OldSW": "00.15" is a version of the upgrade data.
Determining whether the upgrading instruction has errors or not through checking information; and screening the intelligent household equipment needing to be upgraded according to the hardware version number of the intelligent household equipment.
The upgrade instruction is only a specific example of the upgrade instruction in the embodiment of the present invention, and is not limited to the upgrade instruction in the embodiment of the present invention, and any upgrade instruction meeting the requirement may be applied to the embodiment of the present invention.
Step S302, downloading corresponding upgrading data of the MCU to be upgraded from the upgrading data downloading address to a memory;
as an optional implementation manner, the memory is a flash memory of the internet of things module in the smart home device.
Above-mentioned intelligent household equipment passes through main MCU and supplies power for thing networking module, and at main MCU's upgrading in-process, main MCU receives the state switching instruction after, can switch into the user state and wait the upgrading state, and the process of above-mentioned switching state can lead to thing networking module outage. The upgrading data are stored in a flash memory of the Internet of things module, switching can be completed at the main MCU, the upgrading data are read after the main MCU is restarted, and upgrading operation is continuously executed, so that upgrading failure caused by power failure is avoided.
And step S303, upgrading the MCU to be upgraded by using the upgrading data of the MCU to be upgraded in the memory, and feeding back an upgrading result to the server.
The upgrading data are downloaded to the flash memory of the Internet of things module through the Internet of things module, then the upgrading process of the MCU is controlled by the Internet of things module, a wired upper computer tool is replaced by the wireless Internet of things module, OTA upgrading is completed, and the intelligent equipment is upgraded more flexibly and conveniently.
As an optional implementation manner, the upgrading the MCU to be upgraded by using the upgrade data of the MCU to be upgraded in the memory includes:
inquiring the state of the MCU to be upgraded, sending a state switching instruction to the MCU to be upgraded which is not switched to the state to be upgraded, and indicating to switch to the state to be upgraded;
it should be noted that the state of the MCU includes a state to be upgraded and a use state, where the state to be upgraded is a state in which the MCU upgrade can be executed, and the use state is a normal operating state in which the MCU upgrade cannot be executed.
As an optional implementation manner, the state to be upgraded is a bootloader state.
The intelligent home equipment determines the MCU in the use state in the MCU to be upgraded by inquiring the state of the MCU to be upgraded, and sends a state switching instruction to the MCU in the use state to instruct the MCU to be upgraded; or
The method comprises the steps that the intelligent household equipment sends a state switching instruction to the MCU to be upgraded, the MCU to be upgraded is instructed to be switched to the state to be upgraded, the MCU in the state to be upgraded in the MCU to be upgraded maintains the state unchanged, and the MCU in the use state in the MCU to be upgraded switches the state to be upgraded.
After receiving the response of the MCU to be upgraded to complete state switching, the intelligent household equipment inquires the state of the MCU to be upgraded and determines that the state of the MCU to be upgraded is the state to be upgraded.
Because thing networking module can only realize with main MCU's communication, can't realize with the direct communication between the MCU from, and main MCU can realize with the MCU from between the communication, so send state switching instruction to not switch to the MCU of treating upgrading of the state of treating upgrading, include:
determining the MCU to be upgraded which is not switched to the state to be upgraded as a main MCU, and sending the state switching instruction to the main MCU;
and determining that the MCU to be upgraded which is not switched to the state to be upgraded is a slave MCU, sending the state switching instruction to a master MCU, and sending the state switching instruction to the slave MCU which is not switched to the state to be upgraded through the master MCU.
Respectively sending upgrading firmware to corresponding MCU to be upgraded so that the corresponding MCU to be upgraded acquires corresponding upgrading data from the memory by using the upgrading firmware and stores the upgrading data in a receiving cache region of the corresponding MCU to be upgraded;
as an optional implementation manner, before sending the upgrade firmware to the corresponding MCU to be upgraded, the method further includes:
acquiring the size of the available address space of the corresponding MCU to be upgraded;
and determining whether a space for storing the firmware exists in the corresponding MCU to be upgraded according to the size of the available address space.
If the corresponding MCU to be upgraded has a space for storing the firmware, executing the operation of sending the upgraded firmware;
and if the corresponding MCU to be upgraded does not have a space for storing the firmware, feeding back error information.
As an optional implementation manner, after sending the upgrade firmware to the corresponding MCU to be upgraded, the method further includes:
acquiring the size of a receiving cache region of the corresponding MCU to be upgraded, and determining the size of corresponding upgrading data transmitted in a single time according to the size of the receiving cache region;
and transmitting the corresponding data to be upgraded to the corresponding MCU to be upgraded for multiple times according to the size of the corresponding upgrading data transmitted once.
It should be noted that the size of the data to be upgraded transmitted each time is smaller than the size of the receiving buffer.
And if the size of the data to be upgraded is smaller than that of the receiving cache region, transmitting all the data to be upgraded to the corresponding MCU to be upgraded at one time.
As an optional implementation manner, the receiving buffer is a buffer.
And sending an upgrading instruction to the MCU to be upgraded, and controlling the MCU to be upgraded to upgrade according to the stored upgrading data.
Through the operation, the directional upgrading of the master MCU and/or the slave MCU is completed.
After controlling the MCU to be upgraded to upgrade according to the stored upgrade data, the method further comprises the following steps:
inquiring an upgrading result of the MCU to be upgraded, wherein the upgrading result at least comprises one of the following items: whether the upgrade is successful, the upgrade ending time and the reason of upgrade failure;
and feeding back the upgrading result to the server.
And after receiving the upgrading result, the server determines whether the MCU which fails to be upgraded exists according to the received upgrading result, and performs further processing.
And recovering the upgraded MCU from the state to be upgraded to a use state so that only the household equipment can normally operate.
As shown in fig. 4, an embodiment of the present invention provides a flow chart of instruction interaction for wireless upgrading of smart home devices, and the flow chart mainly includes the following steps:
step 1, a server sends a 100# instruction to an Internet of things module of intelligent household equipment;
the 100# instruction is an upgrading instruction, and the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address.
The server can issue commands for upgrading a plurality of MCUs facing one or more intelligent household devices at a time.
Step 2, the Internet of things module receives and analyzes the 100# instruction;
and after analyzing the upgrading instruction, the Internet of things module downloads corresponding upgrading data of the MCU to be upgraded to the memory from the upgrading data downloading address, and if a plurality of MCUs to be upgraded need upgrading, the corresponding upgrading data are sequentially downloaded to the memory.
Step 3, the Internet of things module sends a 101# instruction to the MCU to be upgraded, and the state of the MCU to be upgraded is inquired;
and the 101# instruction is a state checking instruction of the MCU and inquires the state of the MCU to be upgraded.
Step 4, the MCU to be upgraded sends a 101# response to the Internet of things module, wherein the 101# response comprises the state of the queried MCU;
step 5, the Internet of things module sends a 102# instruction to the MCU to be upgraded and instructs the MCU to switch to a state to be upgraded;
the 102# instruction is an MCU state switching instruction and indicates the MCU to be switched to a state to be upgraded.
Step 6, the MCU to be upgraded sends a 102# response to the Internet of things module and informs the Internet of things module of finishing state switching;
step 7, the Internet of things module sends a 101# instruction to the MCU to be upgraded, and the state of the MCU to be upgraded is inquired;
step 8, the MCU to be upgraded sends a 101# response to the Internet of things module, wherein the 101# response comprises the state of the queried MCU;
and ensuring that the MCU to be upgraded enters a state to be upgraded.
Step 9, the Internet of things module sends a 103# instruction to the MCU to be upgraded, and the size of a receiving cache area of the MCU to be upgraded is obtained;
the 103# instruction is a size query instruction of a receiving buffer of the MCU to determine the size of the corresponding upgrade data for a single transmission.
Step 10, the MCU to be upgraded sends a 103# response to the Internet of things module, wherein the 101# response contains the size of a receiving cache region of the MCU;
step 11, the Internet of things module sends a 104# instruction to an MCU to be upgraded to acquire the size of an available address space of the MCU;
the 104# instruction is a size query instruction of an available address space of the MCU, and the size of the available address space of the MCU is obtained to determine whether a space for storing the firmware exists in the corresponding MCU to be upgraded.
Step 12, the MCU to be upgraded sends a 104# response to the Internet of things module, wherein the 104# response comprises the size of the available address space of the inquired MCU;
and after receiving the response of No. 104, the Internet of things module respectively sends the upgrading firmware to the corresponding MCU to be upgraded.
Step 13, the Internet of things module sends a 200# instruction to the MCU to be upgraded and transmits upgrade data to the corresponding MCU to be upgraded;
and the 200# instruction is an upgrade data transmission instruction, and upgrade data which is not larger than the size of the receiving cache region is transmitted to a specified MCU at one time according to the size of the receiving cache region acquired by the 103# response until the data is transmitted completely.
Step 14, the MCU to be upgraded sends a 200# response to the Internet of things module, and the 200# response feeds back the upgrade data and finishes transmission;
step 15, the Internet of things module sends a 105# instruction to the MCU to be upgraded and controls the MCU to be upgraded to upgrade according to the stored upgrade data;
the 105# instruction is an upgrading instruction and controls the MCU to be upgraded to upgrade according to the stored upgrading data.
The upgrading process needs a certain time, and the communication between the internet of things module and the MCU is interrupted for a period of time in the upgrading process.
Step 16, the MCU to be upgraded sends a 105# response to the Internet of things module, and the 105# response feeds back the upgrade to be finished;
step 17, the Internet of things module sends a 106# instruction to the MCU to be upgraded, and the upgraded MCU is restored to a use state from the state to be upgraded;
and the 106# instruction is a state switching instruction, and the upgraded MCU is restored to a use state from a state to be upgraded.
Step 18, the MCU to be upgraded sends a 106# response to the Internet of things module, and the 106# response feedback state switching is finished;
and step 19, reporting the upgrading result to the server by the Internet of things module of the intelligent household equipment.
Example 2
The embodiment of the present invention provides a wireless upgraded smart home device 500, which includes a memory 501 and a processor 502, as shown in fig. 5, wherein:
the memory is used for storing a computer program;
the processor is used for reading the program in the memory and executing the following steps:
receiving an upgrading instruction sent by a server, wherein the upgrading instruction comprises an MCU to be upgraded and a corresponding upgrading data downloading address, and the MCU to be upgraded comprises a master MCU and/or a slave MCU;
downloading corresponding upgrading data of the MCU to be upgraded to a memory from the upgrading data downloading address;
and upgrading the MCU to be upgraded by using the upgrading data of the MCU to be upgraded in the memory, and feeding back an upgrading result to the server.
Optionally, the upgrading the MCU to be upgraded by the processor using the upgrade data of the MCU to be upgraded in the memory includes:
inquiring the state of the MCU to be upgraded, sending a state switching instruction to the MCU to be upgraded which is not switched to the state to be upgraded, and indicating to switch to the state to be upgraded;
respectively sending upgrading firmware to corresponding MCU to be upgraded so that the corresponding MCU to be upgraded acquires corresponding upgrading data from the memory by using the upgrading firmware and stores the upgrading data in a receiving cache region of the corresponding MCU to be upgraded;
and sending an upgrading instruction to the MCU to be upgraded, and controlling the MCU to be upgraded to upgrade according to the stored upgrading data.
Optionally, after the processor sends the upgrade firmware to the corresponding MCUs to be upgraded, the processor is further configured to:
acquiring the size of a receiving cache region of the corresponding MCU to be upgraded, and determining the size of corresponding upgrading data transmitted in a single time according to the size of the receiving cache region;
and transmitting the corresponding data to be upgraded to the corresponding MCU to be upgraded for multiple times according to the size of the corresponding upgrading data transmitted once.
Optionally, before the processor sends the upgrade firmware to the corresponding MCU to be upgraded, the processor is further configured to:
acquiring the size of the available address space of the corresponding MCU to be upgraded;
and determining whether a space for storing the firmware exists in the corresponding MCU to be upgraded according to the size of the available address space.
Optionally, the sending, by the processor, a state switching instruction to the MCU to be upgraded that is not switched to the state to be upgraded includes:
determining the MCU to be upgraded which is not switched to the state to be upgraded as a main MCU, and sending the state switching instruction to the main MCU;
and determining that the MCU to be upgraded which is not switched to the state to be upgraded is a slave MCU, sending the state switching instruction to a master MCU, and sending the state switching instruction to the slave MCU which is not switched to the state to be upgraded through the master MCU.
Optionally, after the processor controls the MCU to be upgraded to upgrade according to the stored upgrade data, the processor is further configured to:
inquiring an upgrading result of the MCU to be upgraded, wherein the upgrading result at least comprises one of the following items: whether the upgrade is successful, the upgrade ending time and the upgrade failure reason.
Optionally, after the processor controls the MCU to be upgraded to upgrade according to the stored upgrade data, the processor is further configured to:
and recovering the upgraded MCU from the state to be upgraded to the use state.
An embodiment of the present invention provides a device for wirelessly upgrading smart home devices, as shown in fig. 6, including:
the instruction receiving unit 601 is configured to receive an upgrade instruction sent by a server, where the upgrade instruction includes an MCU to be upgraded and a corresponding upgrade data download address, and the MCU to be upgraded includes a master MCU and/or a slave MCU;
a data obtaining unit 602, configured to download, from the upgrade data download address, corresponding upgrade data of the MCU to be upgraded to a memory;
and the upgrading unit 603 is configured to upgrade the MCU to be upgraded by using the upgrade data of the MCU to be upgraded in the memory, and feed back an upgrade result to the server.
Optionally, the upgrading unit upgrades the MCU to be upgraded by using the upgrade data of the MCU to be upgraded in the memory, including:
inquiring the state of the MCU to be upgraded, sending a state switching instruction to the MCU to be upgraded which is not switched to the state to be upgraded, and indicating to switch to the state to be upgraded;
respectively sending upgrading firmware to corresponding MCU to be upgraded so that the corresponding MCU to be upgraded acquires corresponding upgrading data from the memory by using the upgrading firmware and stores the upgrading data in a receiving cache region of the corresponding MCU to be upgraded;
and sending an upgrading instruction to the MCU to be upgraded, and controlling the MCU to be upgraded to upgrade according to the stored upgrading data.
Optionally, after the upgrading unit sends the upgrading firmware to the corresponding MCUs to be upgraded, the upgrading unit is further configured to:
acquiring the size of a receiving cache region of the corresponding MCU to be upgraded, and determining the size of corresponding upgrading data transmitted in a single time according to the size of the receiving cache region;
and transmitting the corresponding data to be upgraded to the corresponding MCU to be upgraded for multiple times according to the size of the corresponding upgrading data transmitted once.
Optionally, the upgrading unit is further configured to, before sending the upgrade firmware to the corresponding MCU to be upgraded, respectively:
acquiring the size of the available address space of the corresponding MCU to be upgraded;
and determining whether a space for storing the firmware exists in the corresponding MCU to be upgraded according to the size of the available address space.
Optionally, the sending, by the upgrade unit, a state switching instruction to the MCU to be upgraded that is not switched to the state to be upgraded includes:
determining the MCU to be upgraded which is not switched to the state to be upgraded as a main MCU, and sending the state switching instruction to the main MCU;
and determining that the MCU to be upgraded which is not switched to the state to be upgraded is a slave MCU, sending the state switching instruction to a master MCU, and sending the state switching instruction to the slave MCU which is not switched to the state to be upgraded through the master MCU.
Optionally, the upgrading unit is configured to, after controlling the MCU to be upgraded to upgrade according to the stored upgrade data, further:
inquiring an upgrading result of the MCU to be upgraded, wherein the upgrading result at least comprises one of the following items: whether the upgrade is successful, the upgrade ending time and the upgrade failure reason.
Optionally, the upgrading unit is configured to, after controlling the MCU to be upgraded to upgrade according to the stored upgrade data, further:
and recovering the upgraded MCU from the state to be upgraded to the use state.
The present invention also provides a computer program medium, on which a computer program is stored, which when executed by a processor implements the steps of the method for wireless upgrade of an intelligent home device applied to an intelligent home device provided in the above embodiment 1.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The technical solutions provided by the present application are introduced in detail, and the present application applies specific examples to explain the principles and embodiments of the present application, and the descriptions of the above examples are only used to help understand the method and the core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.