Detailed Description
In view of the problems in the prior art, embodiments of the present invention provide an upgrading method and apparatus for an intelligent appliance, so as to avoid abnormal upgrading of the intelligent appliance due to misuse of an upgrade file in the prior art, and facilitate upgrade management of the intelligent appliance.
As shown in fig. 1, the method for upgrading an intelligent household appliance provided in the embodiment of the present invention specifically includes the following steps:
s101, receiving an upgrading file for upgrading the intelligent household appliance;
s102, judging whether the model information in the upgrade file is matched with the model code of the intelligent household appliance;
and S103, when the model information is matched with the model code, upgrading the intelligent household appliance according to the upgrading file.
The upgrade file is generated by encrypting the model information configured as the information header of the upgrade package.
It can be understood that, when the above-mentioned upgrade method provided by the embodiment of the present invention is implemented, the upgrade file needs to be preprocessed to match and upgrade the subsequent model information. Specifically, the upgrade file described above may be generated in the following manner:
configuring the machine type information of the intelligent household appliance into an information header of an upgrading program package;
and encrypting the upgrading program package with the information header to generate an upgrading file.
After the intelligent household appliance receives the upgrade file, decryption processing corresponding to encryption operation needs to be carried out on the upgrade file, and therefore confidentiality of the upgrade operation is improved. After reading an information header of an upgrade file to obtain model information contained in the upgrade file, matching whether the model information is consistent with a model code of the intelligent household appliance or not, and performing upgrade operation only when the model information is consistent with the model code of the intelligent household appliance; and when the matching fails, quitting the upgrading program to carry out normal operation on the normal interface of the intelligent household appliance.
The method for upgrading the intelligent household appliance provided by the embodiment of the invention can be used for upgrading the system of the intelligent household appliance, and due to the difference of the systems used by different types or different types of energy-aware household appliances, after the system is upgraded by using the upgrading files of other types, upgrading failure can be caused, and even the situation that the system is unavailable can occur. Therefore, in the above-mentioned upgrading method provided in the embodiment of the present invention, the model information for distinguishing the intelligent home appliance, which is pre-packaged in the upgrade file, is extracted, and is matched with the model code of the intelligent home appliance, and the upgrade is performed when the matching is successful.
Therefore, when the upgrade file is received, the model information in the upgrade file and the model code of the intelligent household appliance are firstly matched, and the intelligent household appliance is upgraded only when the matching is successful. Therefore, the upgrade files are used for upgrading pointedly aiming at the machine type codes of different intelligent household appliances in the management of the upgrade files, the abnormal upgrade of the intelligent household appliances caused by the error use of the upgrade files in the prior art is avoided, and the upgrade management of the intelligent household appliances is more convenient.
The product code used for identifying the product information of the intelligent household appliance is stored in the intelligent household appliance in the production process of the intelligent household appliance, a user can not change the product code when using the intelligent household appliance, and the machine type code can be one part of the product code and is used for identifying the machine type of the intelligent household appliance. When the upgrade file is received, the model code of the intelligent household appliance can be extracted from the designated position in the intelligent household appliance storage to be matched with the model information in the upgrade file, for example, the model information in the upgrade file is the information in the form of the model code, and when the model information is determined to be consistent with the model code, the intelligent household appliance can be systematically upgraded according to the upgrade file.
Further, in the step S103, when the smart appliance is upgraded according to the upgrade file, the method may include the sub-steps S1031 to S1033:
s1031, extracting safety mechanism information pre-stored in the upgrade file;
the security mechanism information may include: hardware chip model information, applicable market information, and applicable operating system information. When the intelligent household appliance is sold in overseas areas, the system platform based on the intelligent household appliance is possibly the same, but the difference still exists according to different market demands, so that the information such as hardware chip model information, applicable market information, applicable operating system information and the like is used as safety mechanism information and is matched before being upgraded, and the upgrade files can be matched according to different selling areas or markets, so that the upgrade management is more reasonable. For example, the hardware chip model information may be MT 5891; when the sales region is a north american market, the applicable market information may be us; a suitable operating system may be linux; so that the security mechanism information may be MT5891_ us _ linux. In a specific application, the information parameters in the security mechanism information may be increased or decreased according to the matching precision or actual needs, and the embodiments of the present invention are not limited to the above-mentioned information parameters.
S1032, judging whether the extracted safety mechanism information is matched with the inherent information of the intelligent household appliance;
the specific information of the smart home appliance refers to information stored in the smart home appliance corresponding to the security mechanism information, and the specific information may include: hardware chip model information, applicable market information, and applicable operating system information. The unique information and the model code of the intelligent home appliance can be allocated to a dedicated partition of a system of the intelligent home appliance, and belong to the unique attributes of the system when the program is compiled. For example, the model code and the inherent information can be stored in uboot env, and through makefile configuration, a user cannot change the model code and the inherent information in any way when using the intelligent household appliance, so that the upgrading safety can be ensured.
And S1033, when the safety mechanism information is matched with the inherent information, upgrading the intelligent household appliance according to the upgrading file.
And when the safety mechanism information is matched with the inherent information, the system upgrading interface can be called to execute an upgrading process according to the upgrading file to upgrade the intelligent household appliance. In specific implementation, the security mechanism information can be read from the upgrade file and assigned to the FileModelName, the inherent information is extracted from the uboot env and assigned to the SystemModelName, whether the FileModelName and the SystemModelName are the same or not is compared, and the upgrade is performed when the FileModelName and the SystemModelName are the same.
It can be known from the above description that before the intelligent household appliance is upgraded, the model information in the upgrade file and the model code of the intelligent household appliance need to be matched, and when the matching is successful, the security mechanism information in the upgrade file and the inherent information of the intelligent household appliance are further matched, and the intelligent household appliance is upgraded only when both are successfully matched. Therefore, when the above-mentioned upgrade method provided by the embodiment of the present invention is used, the model information and the security mechanism information need to be stored in the upgrade file in advance, so that the upgrade file may be generated by the following method:
configuring the machine type information and the safety mechanism information into an information header of an upgrading program package; and encrypting the upgrading program package to generate an upgrading file.
Specifically, the model information and the security mechanism information can be configured as an upgrade file header structure, and the information can be stored in the first 64 bytes of the upgrade file, and the upgrade file is encrypted by using the AES block encryption technology, so that the security of the upgrade file is further improved. In practical application, after receiving the upgrade file, the upgrade file is dynamically decrypted, and the model information and the safety mechanism information are read at the head of the upgrade file, so that the model information and the safety mechanism information are respectively matched with the model code and the inherent information of the intelligent household appliance. For example, a physical address of the content of the model code data in the EMMC may be calculated in the uboot stage, and the model code of the intelligent household appliance may be read according to the physical address. Non-numeric non-alphabetic characters can be converted into '_' for convenient matching, and then the converted machine type code is assigned to the SystemProductName; then, the model information is read out from the designated position (such as the former 64 bytes) in the upgrade file, and is assigned to the FileProductName, so as to compare whether the SystemProductName and the FileProductName are the same or not, further compare whether the FileModelName and the SystemModelName are the same or not on the premise that the two are the same, and upgrade is performed when the two are the same.
In an implementable manner, in the above upgrading method provided by the embodiment of the present invention, as shown in fig. 2, before step S101, the following step S102' may be included, and therefore, as shown in fig. 2, the upgrading method of the intelligent appliance provided by the embodiment of the present invention may include the following steps:
s101, receiving an upgrading file for upgrading the intelligent household appliance.
S102', judging whether the version information of the upgrade file matches a target version of the intelligent household appliance upgrade; when the matching is successful, executing step S103; when the matching fails, step S102 is executed.
S102, when the version information of the upgrade file is not matched with the target version of the intelligent household appliance upgrade, judging whether the model information in the upgrade file is matched with the model code of the intelligent household appliance; when the matching is successful, executing step S103; when the matching fails, step S104 is executed.
S104, when the matching between the model information and the model code of the intelligent household appliance is unsuccessful, judging whether the file name of the upgrade file is matched with the model code of the intelligent household appliance or not; when the matching is successful, executing step S103; when the matching fails, step S105 is executed.
S103, upgrading the intelligent household appliance according to the upgrading file;
and S105, exiting the upgrading program.
In a specific application, when the step S102' is executed, usually when a certain failure occurs in the intelligent appliance and the system or software needs to be upgraded to remove the failure, the corresponding upgrade version may be queried for the failure. For example, a user may self-visit an office network or consult a sales service when an intelligent appliance fails to determine the upgrade version needed to resolve the failure. When the upgrade file is received by downloading or transmitting by radio and television, firstly, whether the version information of the upgrade file is consistent with the version to which the intelligent household appliance needs to be upgraded or not can be matched, and when the matching is successful, a differential upgrade mode can be adopted for local upgrade. When the matching mode is adopted, the source version of the household appliance is identified by the version of the specific upgrading file, and upgrading is carried out when the versions are matched. In actual application, after receiving the upgrade file of the target version, the intelligent household appliance is restarted, prompt information about whether the intelligent household appliance is upgraded or not appears on an interface after restarting, and the intelligent household appliance can be automatically upgraded after selecting yes. When the intelligent household appliance is upgraded by adopting the upgrading mode, the intelligent household appliance is upgraded by strictly depending on the matching property of the target version, so that the upgrading safety is higher.
In the step S102', when the version information of the upgrade file is not matched with the target version of the upgrade of the intelligent appliance, the step S102 is executed, and then whether the model information in the upgrade file is matched with the model code of the intelligent appliance is further determined. And in step S102, when the model information in the upgrade file is not matched with the model code of the intelligent appliance, performing step S104 to match the file name of the upgrade file with the model code of the intelligent appliance. In practical application, different upgrading modes proposed by users are different according to different sales objects, so that upgrading conditions are looser, the same version of an upgraded file is more adaptive, and matching upgrading can be performed according to file names. Thus, cross-promotion may be achieved by changing the filename.
Specifically, in step S104, determining whether the file name of the upgrade file matches the model code of the intelligent appliance may specifically include:
detecting whether the upgrade file name comprises a machine type name or not; and when the upgrade file name comprises the model name, judging whether the model name is matched with the model code of the intelligent household appliance. And detecting whether the upgrade file name comprises a machine type name or not, wherein the method can be carried out by searching a file with a preset mode in a file system.
For example, in a specific application, a file with a file name pattern matching usb _ filename.pkg may be searched in a file system, and when the filename field matches the model code of the intelligent household appliance, the file is used as an upgrade file to upgrade the intelligent household appliance. However, in a possible existing situation, the file of the usb _ filename.pkg pattern may not exist in the file system, at this time, the file system may search for a file with a filename pattern matching the upgrade _ xxx.pkg, further match whether the model information in the filename of the file of this pattern matches the model code of the smart appliance, and perform the upgrade of the smart appliance when matching.
In the matching process, when the file name is not matched with the model code, the upgrading program is quitted. After exiting the upgrading program, the intelligent household appliance can be normally started. In addition, the intelligent household appliance can be forcibly upgraded according to actual needs. Specifically, when the matching between the file name of the upgrade file and the model code fails, a forced upgrade mode can be entered, and the upgrade file name is modified into a format of a suffix name, at this time, the forced upgrade needs to be performed by skipping the matching of the security mechanism information, and after the forced upgrade is finished, the forced upgrade mode is closed, and the intelligent household appliance is started normally.
It should be noted that, in the method for upgrading an intelligent household appliance provided in the embodiment of the present invention, corresponding options may be added to a system menu according to actual needs or management requirements for different markets, and a corresponding upgrading method may be selected to directly skip other steps. For example, when the version information of the upgrade-required file matches the source version of the smart appliance, steps S101 to S102' in fig. 2 may be performed, and when the matching is successful, step S103 may be performed, and when the matching is failed, step S105 may be performed, skipping the other steps. When the upgrade file needs to be completely matched with the model of the intelligent household appliance, an upgrade script mode option can be added in an upgrade submenu in a system menu, and the upgrade script mode option is set to be in an open state by default, so that steps S101 and S102 in fig. 2 can be executed, step S103 is executed when matching is successful, step S105 is executed when matching is failed, and other steps are skipped. When the upgrade file name is required to be matched with the model of the intelligent household appliance, the upgrade script mode option can be set to be in a switch-off state by default, and at this time, step S102 can be skipped, so that steps S101 and S104 in fig. 2 can be executed, and step S103 is executed when matching is successful, and step S105 is executed when matching is failed. In some cases, in order to further improve the adaptability of the upgrade file and make the application range of the upgrade file wider, only the security mechanism information in the upgrade file needs to be matched with the inherent information of the intelligent household appliance, at this time, step S102 in fig. 1 may be skipped, when the upgrade file is received, substeps S1031 and S1032 are directly executed, the upgrade is performed when the matching is successful, and the upgrade program is exited when the matching is failed.
Based on the same inventive concept, the embodiment of the present invention provides an upgrading apparatus for an intelligent home appliance, and since the method corresponding to the device is the method in the embodiment of the present application, and the principle of solving the problem of the device is similar to the method in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
The structure of the device is shown in fig. 3, and comprises:
the receiving module 31 is configured to receive an upgrade file for upgrading the intelligent household appliance, where the upgrade file is generated by encrypting the information header of the upgrade package after configuring the model information;
the judging module 32 is used for judging whether the model information in the upgrade file is matched with the model code of the intelligent household appliance;
and the upgrading module 33 is used for upgrading the intelligent household appliance according to the upgrading file when the model information is matched with the model code.
According to the upgrading device for the intelligent household appliances, the model information used for distinguishing the models of the intelligent household appliances is stored in the upgrading file, the model information in the upgrading file and the model codes of the intelligent household appliances are firstly matched when the upgrading file is received, and the intelligent household appliances are upgraded only when the matching is successful. Therefore, the upgrade files are used for upgrading with pertinence for machine type codes of different intelligent household appliances in the management of the upgrade files, abnormal upgrade of the intelligent household appliances caused by the wrong use of the upgrade files in the prior art is avoided, and the upgrade management of the intelligent household appliances is more convenient.
Further, the upgrade module 33 is specifically configured to extract security mechanism information pre-stored in the upgrade file, where the security mechanism information includes: hardware chip model information, applicable market information and applicable operating system information; judging whether the extracted safety mechanism information is matched with the inherent information of the intelligent household appliance; and when the safety mechanism information is matched with the inherent information, upgrading the intelligent household appliance according to the upgrading file.
Optionally, the determining module 32 is further configured to determine whether the version information of the upgrade file matches a target version of the upgrade of the intelligent appliance;
the upgrading module 33 is further configured to upgrade the intelligent appliance according to the upgrade file when the version information of the upgrade file matches the target version of the upgrade of the intelligent appliance.
Optionally, the determining module 32 is further configured to determine whether the file name of the upgrade file matches the model code of the intelligent household appliance when the model information does not match the model code;
and the upgrading module 33 is further configured to upgrade the intelligent household appliance according to the upgrading file when the file name is matched with the model code.
Further, the determination module 32 is specifically configured to detect whether the upgrade file name includes a model name; and when the upgrade file name comprises the model name, judging whether the model name is matched with the model code of the intelligent household appliance.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement 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.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.