CN107733674B - Component upgrading method and terminal - Google Patents

Component upgrading method and terminal Download PDF

Info

Publication number
CN107733674B
CN107733674B CN201610666197.1A CN201610666197A CN107733674B CN 107733674 B CN107733674 B CN 107733674B CN 201610666197 A CN201610666197 A CN 201610666197A CN 107733674 B CN107733674 B CN 107733674B
Authority
CN
China
Prior art keywords
module
upgrade
target component
upgrading
management module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610666197.1A
Other languages
Chinese (zh)
Other versions
CN107733674A (en
Inventor
张洋
张虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Aiqi Technology Co ltd
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Aiqi Technology Co ltd
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Aiqi Technology Co ltd, Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Aiqi Technology Co ltd
Priority to CN201610666197.1A priority Critical patent/CN107733674B/en
Publication of CN107733674A publication Critical patent/CN107733674A/en
Application granted granted Critical
Publication of CN107733674B publication Critical patent/CN107733674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload

Abstract

The disclosure relates to a component upgrading method and a terminal, and belongs to the field of embedded systems. The method comprises the following steps: when the target component in the target peripheral module meets the upgrading condition, the upgrading management module receives a target component upgrading packet sent by the wireless access module and stores the target component upgrading packet in the flash module; when the target component upgrading package is received, the upgrading management module acquires the target component upgrading package from the flash module and sends the target component upgrading package to the target peripheral module; and the target peripheral module stores the target component upgrading packet in the designated partition of the flash unit and upgrades the target component by operating the target component upgrading packet. The method takes the flash module as an intermediary, stores the target component upgrading packet into the flash module, and then sends the target component upgrading packet in the flash module to the flash unit of the target peripheral module for upgrading, so that the difference of upgrading modes caused by different components is avoided, resources are saved, and the components are conveniently managed in a unified manner.

Description

Component upgrading method and terminal
Technical Field
The present disclosure relates to the field of embedded technologies, and in particular, to a component upgrading method and a terminal.
Background
In the field of computer technology, a component is an application for implementing a certain function. In order to meet the use requirements of users, various components are installed in the terminal, such as a multimedia playing component, a web browsing component, a communication component, a sensor component, and the like. Upgrade issues are often involved in managing these components.
At present, when an assembly is upgraded, a terminal system can download an assembly upgrading package from a network, and then sends the assembly upgrading package to an external module where the assembly to be upgraded is located, and the external module realizes the upgrading of the assembly by running the assembly upgrading package. However, since the communication modes between different components and the terminal system are different, when the terminal upgrades different components, it needs to send the component upgrade package to different peripheral modules in different modes.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a component upgrade method and a terminal.
According to a first aspect of the embodiments of the present disclosure, a method for upgrading a component is provided, where the method is applied to a terminal, the terminal includes a wireless access module, an upgrade management module, a flash module, and a plurality of peripheral modules, each peripheral module includes at least one component and a flash unit, and the method includes:
when determining that a target component in a target peripheral module meets an upgrading condition, the upgrading management module receives a target component upgrading packet sent by the wireless access module and stores the target component upgrading packet in the flash module;
when the target component upgrading package is received, the upgrading management module acquires the target component upgrading package from the flash module and sends the target component upgrading package to the target peripheral module;
and the target peripheral module stores the target component upgrading packet in a designated partition of a flash unit, and upgrades the target component by running the target component upgrading packet in the designated partition.
In another embodiment of the present disclosure, the method further comprises:
the upgrade management module sends a request information message to the wireless access module;
when the request information message is received, the wireless access module sends an upgrade query message to the upgrade management module, wherein the upgrade query message at least carries the version number of the target component upgrade package;
when the upgrade inquiry message is received, the upgrade management module judges whether the target assembly meets the upgrade condition;
and if the voltage at the two ends of the target peripheral module is higher than the preset voltage and the version number of the target assembly is lower than the version number of the target assembly upgrading packet, the upgrading management module determines that the target assembly meets the upgrading condition.
In another embodiment of the present disclosure, after the determining, by the upgrade management module, whether the target component meets an upgrade condition, the method further includes:
and if the target component does not meet the upgrading condition, the upgrading management module sends a reminding message to the wireless access module, and the wireless access module reminds the user.
In another embodiment of the present disclosure, the terminal further includes a multimedia module, and the multimedia module and the upgrade management module share the flash module;
before the upgrade management module receives the target component upgrade package sent by the wireless access module, the method further includes:
the upgrading management module sends a use request of the flash module to the multimedia module;
when the use request is received, the multimedia module stops using the flash module and sends a first response message to the upgrade management module;
when the first response message is received, the upgrade management module initializes the flash module and executes a step of receiving a target component upgrade package sent by the wireless access module.
In another embodiment of the present disclosure, the receiving, by the upgrade management module, a target component upgrade package sent by the wireless access module includes:
the wireless access module and the upgrade management module predetermine an encryption algorithm and a decryption algorithm;
the wireless access module encrypts the target component upgrading packet by using the encryption algorithm and sends the encrypted target component upgrading packet to the upgrading management module;
the upgrade management module receives the encrypted target component upgrade package;
the storing the target component upgrade package in the flash module includes:
the upgrade management module decrypts the encrypted target component upgrade package by using the decryption algorithm;
and the upgrade management module stores the decrypted target assembly upgrade package in the flash module.
In another embodiment of the present disclosure, the storing the target component upgrade package in the flash module includes:
and in the receiving process of the target component upgrading packet, the upgrading management module stores the received bytes in a cache, and writes the bytes in the cache into the flash module by taking a page as a unit.
In another embodiment of the present disclosure, the writing the bytes in the cache into the flash module in units of pages includes:
if the number of unreceived bytes is 0, the upgrade management module compares the bytes in the cache with a preset number;
if the number of the bytes in the cache is smaller than the preset number, the upgrade management module writes the bytes in the cache into one page in the flash module;
if the number of bytes in the cache is larger than or equal to the preset number, the upgrade management module writes the preset number of bytes in the cache into one page in the flash module, and writes the rest bytes into the other page in the flash module.
In another embodiment of the present disclosure, the writing the bytes in the cache into the flash module in units of pages includes:
if the number of bytes which are not received is not 0, the upgrade management module compares the bytes in the cache with a preset number;
if the bytes in the cache are smaller than the preset number, the upgrade management module continues to receive the target component upgrade package until the reception is finished;
if the number of bytes in the cache is larger than or equal to the preset number, the upgrade management module writes the preset number of bytes in the cache into one page in the flash module, writes the rest bytes into the initial position of the cache, and continues to receive the target component upgrade package until the receiving is completed.
In another embodiment of the present disclosure, before the obtaining, by the upgrade management module, the target component upgrade package from the flash module, the method further includes:
when receiving an end message sent by the wireless access module, the upgrade management module sends a start data message to the target peripheral module, wherein the start data message at least carries byte length information of the target component upgrade package;
when the starting data message is received, the target peripheral module records byte length information of the target component upgrading packet and sends second response information to the upgrading management module;
and when the second response information is received, the upgrading management module executes the operation of acquiring the target component upgrading packet from the flash module.
In another embodiment of the present disclosure, the storing, by the target peripheral module, the target component upgrade package in a designated partition of a flash unit includes:
and when the target component upgrading packet is received, the target peripheral module stores the target component upgrading packet in the appointed subarea of the flash unit according to the number of bytes which can be contained in one page of the appointed subarea.
In another embodiment of the present disclosure, the upgrading the target component by running the target component upgrade package includes:
when receiving a data end message sent by the upgrade management module, restarting the target peripheral module, and operating the target component upgrade package in the designated partition;
and if the target component upgrading packet is operated successfully, the target peripheral module sets the mark on the upgrading mark position as an upgrading mark so as to finish upgrading the target component.
According to a second aspect of the embodiments of the present disclosure, a terminal is provided, where the terminal includes a wireless access module, an upgrade management module, a flash module, and a plurality of peripheral modules, and each peripheral module includes at least one component and a flash unit;
the upgrading management module is used for receiving a target component upgrading packet sent by the wireless access module and storing the target component upgrading packet in the flash module when the target component in the target peripheral module meets the upgrading condition;
the upgrade management module is used for acquiring the target component upgrade package from the flash module and sending the target component upgrade package to the target peripheral module when the target component upgrade package is received;
and the target peripheral module is used for storing the target component upgrading packet in a designated partition of a flash unit and upgrading the target component by operating the target component upgrading packet in the designated partition.
In another embodiment of the present disclosure, the upgrade management module is further configured to send a request message to the wireless access module;
the wireless access module is further configured to send an upgrade query message to the upgrade management module when receiving the request information message, where the upgrade query message at least carries a version number of the target component upgrade package;
the upgrade management module is further configured to determine whether the target component meets an upgrade condition when the upgrade query message is received;
the upgrade management module is further configured to determine that the target component meets an upgrade condition when the voltage at two ends of the target peripheral module is higher than a preset voltage and the version number of the target component is lower than the version number of the target component upgrade package.
In another embodiment of the present disclosure, the upgrade management module is further configured to send a prompting message to the wireless access module when the target component does not meet the upgrade condition, and the wireless access module prompts a user.
In another embodiment of the present disclosure, the terminal further includes a multimedia module, and the multimedia module and the upgrade management module share the flash module;
the upgrade management module is further configured to, before receiving the target component upgrade package sent by the wireless access module, further include:
the upgrade management module is also used for sending a use request of the flash module to the multimedia module;
the multimedia module is further used for stopping using the flash module when the use request is received, and sending a first response message to the upgrade management module;
the upgrade management module is further configured to initialize the flash module when receiving the first response message, and receive a target component upgrade package sent by the wireless access module.
In another embodiment of the present disclosure, the wireless access module is further configured to determine an encryption algorithm and a decryption algorithm in advance with the upgrade management module;
the wireless access module is also used for encrypting the target component upgrading packet by using the encryption algorithm and sending the encrypted target component upgrading packet to the upgrading management module;
the upgrade management module is also used for receiving the encrypted target component upgrade package;
the upgrade management module is further configured to decrypt the encrypted target component upgrade package using the decryption algorithm;
the upgrade management module is further configured to store the decrypted target component upgrade package in the flash module.
In another embodiment of the present disclosure, the upgrade management module is further configured to store the received bytes in a cache during the receiving process of the target component upgrade package, and write the bytes in the cache into the flash module in units of pages.
In another embodiment of the present disclosure, the upgrade management module is further configured to compare bytes in the cache with a preset number when the number of bytes not received is 0;
the upgrade management module is further configured to write the bytes in the cache into one page in the flash module when the bytes in the cache are smaller than the preset number;
the upgrade management module is further configured to, when the number of bytes in the cache is greater than or equal to the preset number, write the preset number of bytes in the cache into one page of the flash module, and write the remaining bytes into another page of the flash module.
In another embodiment of the present disclosure, the upgrade management module is further configured to compare bytes in the cache with a preset number when the number of bytes not received is not 0;
the upgrade management module is further configured to continue receiving the target component upgrade package until the receiving is completed when the number of bytes in the cache is smaller than the preset number;
the upgrade management module is further configured to, when the number of bytes in the cache is greater than or equal to the preset number, write the preset number of bytes in the cache into one page in the flash module, write the remaining bytes into an initial position of the cache, and continue to receive the target component upgrade package until the reception is completed.
In another embodiment of the present disclosure, the upgrade management module is further configured to send a start data packet to the target peripheral module when receiving an end packet sent by the wireless access module, where the start data packet at least carries byte length information of the target component upgrade packet;
the target peripheral module is further configured to record byte length information of the target component upgrade package when receiving the start data packet, and send second response information to the upgrade management module;
the upgrade management module is further configured to obtain the target component upgrade package from the flash module when the second response information is received.
In another embodiment of the present disclosure, the target peripheral module is further configured to, when receiving the target component upgrade package, store the target component upgrade package in a designated partition of a flash unit according to a number of bytes that can be accommodated in one page of the designated partition.
In another embodiment of the present disclosure, the target peripheral module is further configured to restart the target peripheral module when receiving a data end packet sent by the upgrade management module, and run the target component upgrade package in the designated partition;
and the target peripheral module is also used for setting the mark on the upgrading mark position as an upgrading mark when the target component upgrading packet runs successfully so as to finish upgrading the target component.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the target component upgrading package is stored in the flash module by taking the flash module as an intermediary, and then the target component upgrading package in the flash module is sent to the flash unit of the target peripheral module for upgrading, so that the difference of upgrading modes brought by different components is avoided, resources are saved, and the components are conveniently managed in a unified manner.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a component upgrade method in accordance with an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a component upgrade method in accordance with an exemplary embodiment.
FIG. 3 is a diagram illustrating a storage process for storing a target component upgrade package in a flash module, according to an example embodiment.
Fig. 4 is a schematic diagram illustrating a structure of a terminal according to an exemplary embodiment.
FIG. 5 illustrates a block diagram of an apparatus for component upgrade, according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a component upgrading method according to an exemplary embodiment, where as shown in fig. 1, the component upgrading method is used in a terminal, the terminal includes a wireless access module, an upgrade management module, a flash module, and a plurality of peripheral modules, each peripheral module includes at least one component and a flash unit, and the component upgrading method includes the following steps.
In step 101, when it is determined that the target component in the target peripheral module meets the upgrade condition, the upgrade management module receives a target component upgrade package sent by the wireless access module, and stores the target component upgrade package in the flash module.
In step 102, when the target component upgrade package is received, the upgrade management module obtains the target component upgrade package from the flash module and sends the target component upgrade package to the target peripheral module.
In step 103, the target peripheral module stores the target component upgrade package in the designated partition of the flash unit, and upgrades the target component by running the target component upgrade package in the designated partition.
According to the method provided by the embodiment of the disclosure, the flash module is used as an intermediary, the target component upgrading package is stored in the flash module, and then the target component upgrading package in the flash module is sent to the flash unit of the target peripheral module for upgrading, so that the difference of upgrading modes caused by different components is avoided, resources are saved, and the components are conveniently managed in a unified manner.
In another embodiment of the present disclosure, the method further comprises:
the upgrading management module sends a request information message to the wireless access module;
when receiving the request information message, the wireless access module sends an upgrade query message to the upgrade management module, wherein the upgrade query message at least carries the version number of the target component upgrade package;
when receiving an upgrade inquiry message, the upgrade management module judges whether the target assembly meets the upgrade condition;
and if the voltage at the two ends of the target peripheral module is higher than the preset voltage and the version number of the target assembly is lower than that of the target assembly upgrading package, the upgrading management module determines that the target assembly meets the upgrading condition.
In another embodiment of the present disclosure, after the determining, by the upgrade management module, whether the target component meets the upgrade condition, the method further includes:
and if the target component does not meet the upgrading condition, the upgrading management module sends a reminding message to the wireless access module, and the wireless access module reminds the user.
In another embodiment of the present disclosure, the terminal further includes a multimedia module, and the multimedia module and the upgrade management module share a flash module;
before the upgrade management module receives the target component upgrade package sent by the wireless access module, the method further includes:
the upgrading management module sends a use request for the flash module to the multimedia module;
when receiving the use request, the multimedia module stops using the flash module and sends a first response message to the upgrade management module;
when the first response message is received, the upgrade management module initializes the flash module and executes the step of receiving the target component upgrade package sent by the wireless access module.
In another embodiment of the present disclosure, the receiving, by the upgrade management module, a target component upgrade package sent by the wireless access module includes:
the wireless access module and the upgrade management module predetermine an encryption algorithm and a decryption algorithm;
the wireless access module encrypts the target component upgrading packet by using an encryption algorithm and sends the encrypted target component upgrading packet to the upgrading management module;
the upgrade management module receives the encrypted target component upgrade package;
storing the target component upgrade package in a flash module, comprising:
the upgrade management module decrypts the encrypted target component upgrade package by using a decryption algorithm;
and the upgrade management module stores the decrypted target component upgrade package in the flash module.
In another embodiment of the present disclosure, storing a target component upgrade package in a flash module includes:
in the receiving process of the target component upgrading packet, the upgrading management module stores the received bytes in the cache, and writes the bytes in the cache into the flash module by taking the page as a unit.
In another embodiment of the present disclosure, writing bytes in a cache into a flash module in units of pages includes:
if the number of bytes which are not received is 0, the upgrade management module compares the bytes in the cache with the preset number;
if the number of the bytes in the cache is smaller than the preset number, the upgrade management module writes the bytes in the cache into one page in the flash module;
if the number of bytes in the cache is larger than or equal to the preset number, the upgrade management module writes the previous preset number of bytes in the cache into one page in the flash module, and writes the rest bytes into the other page in the flash module.
In another embodiment of the present disclosure, writing bytes in a cache into a flash module in units of pages includes:
if the number of bytes which are not received is not 0, the upgrade management module compares the bytes in the cache with the preset number;
if the bytes in the cache are less than the preset number, the upgrade management module continues to receive the target component upgrade package until the reception is finished;
if the number of bytes in the cache is larger than or equal to the preset number, the upgrading management module writes the previous preset number of bytes in the cache into one page in the flash module, writes the rest bytes into the initial position of the cache, and continues to receive the target component upgrading packet until the receiving is completed.
In another embodiment of the present disclosure, before the upgrade management module obtains the target component upgrade package from the flash module, the method further includes:
when receiving an end message sent by the wireless access module, the upgrade management module sends a start data message to the target peripheral module, wherein the start data message at least carries byte length information of an upgrade packet of a target assembly;
when receiving a start data message, the target peripheral module records byte length information of a target component upgrade package and sends second response information to the upgrade management module;
and when the second response information is received, the upgrading management module executes the operation of acquiring the target component upgrading packet from the flash module.
In another embodiment of the present disclosure, the storing, by the target peripheral module, the target component upgrade package in a designated partition of the flash unit includes:
when receiving the target component upgrading packet, the target peripheral module stores the target component upgrading packet in the designated partition of the flash unit according to the number of bytes which can be contained in one page of the designated partition.
In another embodiment of the present disclosure, upgrading a target component by running a target component upgrade package includes:
when a data end message sent by the upgrade management module is received, the target peripheral module is restarted to operate a target component upgrade package in the designated partition;
and if the target component upgrading packet is operated successfully, the target peripheral module sets the identifier on the upgrading identifier as an upgrading identifier so as to complete the upgrading of the target component.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 2 is a flowchart illustrating a component upgrading method according to an exemplary embodiment, where as shown in fig. 2, the component upgrading method is used in a terminal, and the terminal includes a wireless access module, an upgrade management module, a flash module, and a plurality of peripheral modules.
The wireless access module can acquire different component upgrade packages and information thereof from a network, and can be a WiFi module, a Bluetooth module and the like. The wireless upgrade management module may be connected to the wireless access module, the flash module, and the plurality of peripheral modules, and is responsible for upgrading components in the plurality of peripheral modules, and the upgrade management module may be a Central Processing Unit (CPU), an MCU (micro controller Unit), or the like in the terminal. The peripheral modules are used for realizing different functions of the terminal, each peripheral module can be a sensor module, a multimedia module and the like, each peripheral module comprises at least one component and a flash unit, the components in the peripheral modules comprise firmware of the peripheral modules, various application programs and the like, and the upgrading is the upgrading of the firmware in the peripheral modules and the upgrading of databases of a voice library, an action library and an expression library of the application programs.
Referring to fig. 2, a component upgrade method provided by an embodiment of the present disclosure includes the following steps.
In step 201, the upgrade management module selects a target peripheral module from the plurality of peripheral modules, and determines whether a target component in the target peripheral module meets an upgrade condition.
Generally, a low-version component has some vulnerabilities relative to a high-version component, and the vulnerabilities can reduce the performance of a terminal system and even influence the normal operation of a terminal. In order to repair bugs existing in the components, improve system performance, and ensure smooth operation of the terminal, each component in each peripheral module needs to be upgraded.
In this embodiment, the wireless access module can receive component upgrade notifications pushed by different servers, taking receiving a component upgrade notification of a target component in a target peripheral module as an example, when receiving the component upgrade notification of the target component, the wireless access module sends a request message to the upgrade management module to trigger the upgrade management module to determine whether the target component in the target peripheral module meets an upgrade condition, where the specific determination process refers to steps 2011 to 2013:
2011. and the upgrading management module sends a request information message to the wireless access module.
Wherein, the request message at least carries the target component identifier.
2012. And when receiving the request information message, the wireless access module sends an upgrade inquiry message to the upgrade management module.
Wherein, the upgrade inquiry message at least carries the version number of the target component upgrade package, the target component identifier, and the like.
2013. When receiving the upgrade inquiry message, the upgrade management module judges whether the target component meets the upgrade condition.
In this embodiment, the upgrade management module maintains a peripheral module list in which attribute information, such as a component version number and the like, of each peripheral module and at least one component included in the peripheral module is stored. When an upgrade inquiry message is received, the upgrade management module acquires attribute information of the target assembly from the peripheral module list, inquires whether the voltage at two ends of the target peripheral module is higher than a preset voltage or not according to the acquired attribute information of the target assembly, and inquires whether the version number of the target assembly is lower than the version number of the target assembly upgrade package or not.
In an embodiment of the present disclosure, if the voltage at two ends of the target peripheral module is higher than the preset voltage and the version number of the target component is lower than the version number of the target component upgrade package, the upgrade management module determines that the target component meets the upgrade condition, and then completes the upgrade of the target component through the following steps.
In another embodiment of the present disclosure, the upgrade management module determines that the target component does not satisfy the upgrade condition if the voltage across the peripheral module is lower than a preset voltage or the version number of the target component is higher than the version number of the target component upgrade package. When the target assembly is determined not to meet the upgrading condition, the upgrading management module can send a reminding message to the wireless access module, and the wireless access module reminds the user. Aiming at the upgrading condition that the target assembly is not satisfied, when the upgrading management module sends a reminding message to the wireless access module, the upgrading management module can also carry a corresponding processing scheme in the reminding message, and if the voltage value of the two ends of the target assembly is lower than the preset voltage and does not satisfy the upgrading condition, a user can be reminded to increase the voltage of the target peripheral module in the sent reminding message, and the like.
In step 202, the upgrade management module receives the target component upgrade package sent by the wireless access module and stores the target component upgrade package in the flash module.
The terminal comprises a wireless access module, an upgrading management module, a flash module and a plurality of peripheral modules, and further comprises a multimedia module, wherein the flash module is shared by the multimedia module and the upgrading management module, and application programs of the multimedia module in normal operation are stored in the flash module. Generally, the upgrade management module also has a certain storage space, so the upgrade management module does not use the flash module, and the flash module is used by the multimedia module.
However, since the target component upgrade package is large, the storage space of the upgrade management module itself is limited, and most of the storage space of the upgrade management module itself is occupied by the internal operating system, the target component upgrade package received by the upgrade management module from the wireless access module can only be stored in the flash module. In order to avoid conflict when a plurality of modules use the flash module simultaneously, when the target assembly meets the upgrading condition and before the target assembly sent by the wireless access module is received, the upgrading management module can send a use request for the flash module to the multimedia module, when the use request is received, the multimedia module stops using the flash module and sends a first response message to the upgrading management module, and when the first response message is received, the upgrading management module can send a data acquisition request to the wireless access module to trigger the wireless access module to send a target assembly upgrading package.
The format of the data in the target component upgrade package sent by the wireless access module to the upgrade management module is shown in table 1. As shown in table 1.
TABLE 1
Figure BDA0001077555150000141
The target component data packet includes a header, a type, a subclass, a plurality of data, a checksum, a trailer, and the like. The first data item indicates that the firmware and the database are both data files. File name 1 indicates that the object to be upgraded is firmware, 2 … in the file name is a reference number of 2 or more, and indicates that the object to be upgraded is a database. The length indicates the upgrade package size. The method for checking the target component is exclusive-or checking, and correspondingly, the check bit is the result of exclusive-or checking all the previous bytes.
In order to improve data security, before data transmission, the wireless access module may negotiate to determine an encryption algorithm and a decryption algorithm used for data transmission according to an encryption algorithm and a decryption algorithm supported by the local terminal and an encryption algorithm and a decryption algorithm supported by the upgrade management module. Based on the determined encryption algorithm, the wireless access module encrypts the target component upgrade package by using the encryption algorithm and sends the encrypted target component upgrade package to the upgrade management module. Based on the determined decryption algorithm, when the encrypted target component upgrade package is received, the upgrade management module decrypts the encrypted target component upgrade package by using the decryption algorithm, and then stores the decrypted target component upgrade package in the flash module.
The number of effective bytes transmitted to the upgrade management module by the wireless access module each time is at most a specified number of bytes, so that the upgrade management module can only receive the specified number of bytes at most each time in the process of receiving the target component upgrade package sent by the wireless access module. The number of the designated units may be 12, 13, 14, etc., and the number of the designated units is 14 in this embodiment.
The upgrade management module writes data into the flash module by taking a page as a unit when the data is written into the flash module, and each page of the flash module can only write a preset number of bytes at most, so that received bytes can be stored in a cache firstly in order to successfully write a target component upgrade package into the flash module. The preset number may be 256, 300, 500, etc., and the preset number is 256 in this embodiment.
In this embodiment, in the process of receiving the target component upgrade package, when the upgrade management module writes the bytes in the cache into the flash module in units of pages, the following two cases may be used according to whether the number of bytes that are not received after the current reception is 0. The number of bytes which are not received after the current reception can be preliminarily judged through the number of bytes which are received at the current time, if the number of bytes which are received at the current time is less than 14, the number of bytes which are not received after the current reception can be determined to be 0, if the number of bytes which are received at the current time is more than or equal to 14, the number of bytes which are not received after the last reception needs to be subtracted by 14, if the number of bytes which are received at the current time is equal to 0, the number of bytes which are not received after the current reception can also be determined to be 0, and if the number of.
In the first case, the number of bytes that are not received after this reception is 0.
If the number of bytes which are not received is 0, the data in the target component upgrade package is completely received, and at this time, the data need to be completely written into the flash module no matter what the number of bytes in the cache is. Because each page of the flash module can only write 256 bytes at most, and the sum of the number of bytes received this time and the original number of bytes in the cache may be greater than or equal to 256 or less than 256, for whether the sum of the number of bytes received this time and the original number of bytes in the cache is greater than or equal to 256, the update management module has different ways of writing the data in the cache into the flash module, and therefore, the update management module needs to compare the number of bytes in the cache with the preset number. If the number of bytes in the cache is less than 256, the upgrade management module can write the bytes in the cache into one page in the flash module; if the byte number in the cache is more than or equal to 256, the upgrade management module writes the first 256 bytes in the cache into one page in the flash module, and writes the rest bytes into the other page in the flash module.
In the second case, the number of bytes not received after this reception is not 0.
If the number of bytes not received is not 0, it indicates that the data in the target component upgrade package is not completely received, and it is necessary to continue receiving the target component upgrade package until the reception is completed. Because each page of the flash module can only write 256 bytes at most, the sum of the byte number received this time and the original byte number in the cache may be greater than or equal to 256 or less than 256, and for whether the sum of the byte number received this time and the original byte number in the cache is greater than or equal to 256, the updating management module has different ways of writing the data in the cache into the flash module, and therefore, the updating management module needs to compare the byte number in the cache with the preset number. If the number of bytes in the cache is less than 256, the upgrade management module continues to receive the target component upgrade package until the receiving is completed; if the number of bytes in the cache is more than or equal to 256, the upgrade management module writes the first 256 bytes in the cache into one page in the flash module, writes the rest bytes into the initial position of the cache, continues to receive the target assembly upgrade package, judges whether the number of bytes which are not received is 0 or not when receiving the data in the target assembly upgrade package sent by the wireless access module each time, and then writes the data into the flash module by adopting a corresponding writing mode until the receiving is completed.
For the process of the upgrade management module storing the target component upgrade package in the flash module, for convenience of understanding, the following description will take fig. 3 as an example.
Referring to fig. 3, in the process of receiving the target component upgrade package, the upgrade management module determines whether the number of bytes received this time is greater than or equal to 14, if the number of bytes received is less than 14, the upgrade management module stores the bytes received this time in Buf (cache), and determines whether the number of bytes in Buf is greater than or equal to 256, if the number of bytes in Buf is greater than or equal to 256, the first 256 bytes in Buf are written into one page in the flash module, and the remaining bytes are written into the other page in the flash module; and if the number of bytes in the Buf is less than 256, writing the number of bytes in the Buf into one page in the flash module.
If the number of bytes received this time is greater than or equal to 14, the upgrade management module stores the bytes received this time in the Buf, and subtracts 14 from the number of bytes not received last time to obtain the number of bytes not received after this time. If the number of bytes which are not received after the current reception is 0, the upgrade management module judges whether the number of bytes in the Buf is more than or equal to 256, if the number of bytes in the Buf is more than or equal to 256, the first 256 bytes in the Buf are written into one page of the flash module, the rest bytes are written into the other page of the flash module, and if the number of bytes in the Buf is less than 256, the number of bytes in the Buf are written into one page of the flash module; if the number of bytes which are not received after the current receiving is not 0, the upgrade management module judges whether the number of bytes in the Buf is more than or equal to 256, if the number of bytes in the Buf is more than or equal to 256, the first 256 bytes in the Buf are written into one page in the flash module, the rest bytes are written into the initial position of the cache, and the target component upgrade package is continuously received until the receiving is completed; if the number of bytes in the Buf is less than 256, the target component upgrade package continues to be received until the reception is completed.
In step 203, when the target component upgrade package is received, the upgrade management module obtains the target component upgrade package from the flash module and sends the target component upgrade package to the target peripheral module.
When the target component upgrading packet is sent, the wireless access module sends a receiving message to the upgrading management module, and when an ending message sent by the wireless access module is received, the upgrading management module sends a starting data message to the target peripheral module, wherein the starting data message at least carries byte length information of the target component upgrading packet. When receiving the start data message, the target peripheral module records byte length information of the target component upgrade package and sends second response information to the upgrade management module, and when receiving the second response information, the upgrade management module acquires the target component upgrade package from the flash module and sends the target component upgrade package to the target peripheral module. Because the data in the target component upgrade package is stored in the flash module by taking the page as a unit, when the upgrade management module acquires the target component upgrade package from the flash module, the upgrade management module acquires the target component upgrade package by taking the page as a unit and transmits the target component upgrade package to the target peripheral module by taking the page as a unit.
In step 204, the target peripheral module stores the target component upgrade package in the designated partition of the flash unit, and upgrades the target component by running the target component upgrade package in the designated partition.
In this embodiment, the flash unit of the target peripheral module at least includes a designated partition, and the designated partition is used for storing the received target component upgrade package. Generally, the number of bytes that can be accommodated by one page in a flash unit designated partition of the target peripheral module is different from the number of bytes that can be accommodated by one page in the flash module, so that in the process of receiving the target component upgrade package, the target peripheral module stores the target component upgrade package in the designated partition of the flash unit according to the number of bytes that can be accommodated by one page in the designated partition. For example, the number of bytes that can be accommodated by one page in the flash module is 256 bytes, the number of bytes that can be accommodated by one page in the designated partition of the flash unit is 500 bytes, and in the process of receiving the target component upgrade package, the target peripheral module writes the received bytes into the designated partition of the flash unit whenever 500 bytes are received.
When the upgrade management module sends all data in the target component upgrade package to the target peripheral module, the upgrade management unit sends a data end message to the target peripheral module, when the data end message sent by the upgrade management module is received, the target peripheral module performs soft reset and restarts, the target component upgrade package in the designated partition is operated, and if the target component upgrade package is successfully operated, the target peripheral module sets the identifier on the upgrade identifier bit as an upgrade identifier so as to complete the upgrade of the target component.
Furthermore, after the target assembly is upgraded, the target peripheral module sends upgrade success information to the upgrade management module, the upgrade management module sends the upgrade success information to the wireless access module, and the wireless access module stores the current information of the target assembly after receiving the upgrade success information and upgrades other assemblies according to the upgrade method of the target assembly. Certainly, if the target component is not upgraded, the target peripheral module sends upgrade failure information to the upgrade management module, the upgrade management module sends the upgrade failure information to the wireless access module, and the wireless access module upgrades the target component again after receiving the upgrade failure information.
According to the method provided by the embodiment of the disclosure, the flash module is used as an intermediary, the target component upgrading package is stored in the flash module, and then the target component upgrading package in the flash module is sent to the flash unit of the target peripheral module for upgrading, so that the difference of upgrading modes caused by different components is avoided, resources are saved, and the components are conveniently managed in a unified manner.
Fig. 4 is a diagram illustrating a terminal according to an example embodiment. Referring to fig. 4, the terminal includes a wireless access module 401, an upgrade management module 402, a flash module 403, and a plurality of peripheral modules 404, where each peripheral module 404 includes at least one component 4041 and a flash unit 4042; wherein the target peripheral module is one of the plurality of peripheral modules 404;
the upgrade management module 402 is configured to receive a target component upgrade package sent by the wireless access module 401 and store the target component upgrade package in the flash module 403 when it is determined that the target component in the target peripheral module 402 meets an upgrade condition;
the upgrade management module 402 is configured to, when the target component upgrade package is received, obtain the target component upgrade package from the flash module 403, and send the target component upgrade package to the target peripheral module 402;
and the target peripheral module 404 is configured to store the target component upgrade package in the designated partition of the flash unit, and upgrade the target component by running the target component upgrade package in the designated partition.
In another embodiment of the present disclosure, the upgrade management module 402 is further configured to send a request message to the wireless access module;
the wireless access module 401 is further configured to send an upgrade query message to the upgrade management module when receiving the request information message, where the upgrade query message at least carries a version number of the target component upgrade package;
the upgrade management module 402 is further configured to determine whether the target component meets an upgrade condition when receiving the upgrade query message;
the upgrade management module 402 is further configured to determine that the target component meets the upgrade condition when the voltage at two ends of the target peripheral module is higher than the preset voltage and the version number of the target component is lower than the version number of the target component upgrade package.
In another embodiment of the present disclosure, the upgrade management module 402 is further configured to send a prompting message to the wireless access module 401 when the target component does not meet the upgrade condition, and the wireless access module 401 prompts the user.
In another embodiment of the present disclosure, the terminal further includes a multimedia module, and the multimedia module and the upgrade management module 402 share a flash module 403;
the upgrade management module 402 is further configured to, before receiving the target component upgrade package sent by the wireless access module 401, further include:
the upgrade management module 402 is further configured to send a use request for the flash module 403 to the multimedia module;
the multimedia module is also used for stopping using the flash module when receiving the use request and sending a first response message to the upgrade management module;
the upgrade management module 402 is further configured to initialize the flash module 403 when receiving the first response message, and receive the target component upgrade package sent by the wireless access module 401.
In another embodiment of the present disclosure, the wireless access module 401 is further configured to determine an encryption algorithm and a decryption algorithm in advance with the upgrade management module 402;
the wireless access module 401 is further configured to encrypt the target component upgrade package by using an encryption algorithm, and send the encrypted target component upgrade package to the upgrade management module;
the upgrade management module 402 is further configured to receive an encrypted target component upgrade package;
the upgrade management module 402 is further configured to decrypt the encrypted target component upgrade package using a decryption algorithm;
the upgrade management module 402 is further configured to store the decrypted target component upgrade package in the flash module.
In another embodiment of the present disclosure, the upgrade management module 402 is further configured to store the received bytes in a cache during the receiving process of the target component upgrade package, and write the bytes in the cache into the flash module 403 in units of pages.
In another implementation of the present disclosure, the upgrade management module 402 is further configured to compare bytes in the cache with a preset number when the number of bytes not received is 0;
the upgrade management module 402 is further configured to write the bytes in the cache into one page in the flash module when the number of the bytes in the cache is less than the preset number;
the upgrade management module 402 is further configured to, when the number of bytes in the cache is greater than or equal to the preset number, write the previous preset number of bytes in the cache into one page of the flash module, and write the remaining bytes into another page of the flash module.
In another implementation of the present disclosure, the upgrade management module 402 is further configured to compare bytes in the cache with a preset number when the number of bytes not received is not 0;
the upgrade management module 402 is further configured to, when the number of bytes in the cache is smaller than the preset number, continue to receive the target component upgrade package until the reception is completed;
the upgrade management module 402 is further configured to, when the number of bytes in the cache is greater than or equal to the preset number, write the previous preset number of bytes in the cache into one page in the flash module, write the remaining bytes into the initial position of the cache, and continue to receive the target component upgrade package until the receiving is completed.
In another embodiment of the present disclosure, the upgrade management module 402 is further configured to send a start data packet to the target peripheral module when receiving an end packet sent by the wireless access module, where the start data packet at least carries byte length information of the target component upgrade packet;
the target peripheral module 404 is further configured to record byte length information of the target component upgrade package when the start data packet is received, and send second response information to the upgrade management module;
the upgrade management module 402 is further configured to obtain the target component upgrade package from the flash module when the second response information is received.
In another embodiment of the present disclosure, the target peripheral module 404 is further configured to, when receiving the target component upgrade package, store the target component upgrade package in the designated partition of the flash unit according to the number of bytes that can be accommodated in one page of the designated partition.
In another embodiment of the present disclosure, the target peripheral module 404 is further configured to restart and run the target component upgrade package in the designated partition when receiving the data end packet sent by the upgrade management module;
the target peripheral module 404 is further configured to set the identifier on the upgrade identifier bit as an upgrade identifier when the target component upgrade package successfully runs, so as to complete the upgrade on the target component.
The terminal provided by the embodiment of the disclosure takes the flash module as an intermediary, stores the target component upgrade package into the flash module, and then sends the target component upgrade package in the flash module to the flash unit of the target peripheral module for upgrading, so that the difference of upgrade modes caused by different components is avoided, resources are saved, and the components are conveniently managed in a unified manner.
With regard to the terminal in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 5 is a block diagram illustrating an apparatus 500 for component upgrade, according to an example embodiment. For example, the apparatus 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 5, the apparatus 500 may include one or more of the following components: processing component 502, memory 504, power component 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor component 514, and communication component 516.
The processing component 502 generally controls overall operation of the device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 502 may include one or more processors 520 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is configured to store various types of data to support operations at the apparatus 500. Examples of such data include instructions for any application or method operating on device 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 504 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 506 provides power to the various components of the device 500. The power components 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 500.
The multimedia component 508 includes a screen that provides an output interface between the device 500 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 500 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 510 is configured to output and/or input audio signals. For example, audio component 510 includes a Microphone (MIC) configured to receive external audio signals when apparatus 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 504 or transmitted via the communication component 516. In some embodiments, audio component 510 further includes a speaker for outputting audio signals.
The I/O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 may detect an open/closed state of the apparatus 500, the relative positioning of the components, such as a display and keypad of the apparatus 500, the sensor assembly 514 may also detect a change in the position of the apparatus 500 or a component of the apparatus 500, the presence or absence of user contact with the apparatus 500, orientation or acceleration/deceleration of the apparatus 500, and a change in the temperature of the apparatus 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is configured to facilitate communication between the apparatus 500 and other devices in a wired or wireless manner. The apparatus 500 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 520 of the apparatus 500 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein that, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a component upgrade method.
The non-transitory computer readable storage medium provided by the embodiment of the disclosure stores the target component upgrade package into the flash module by taking the flash module as an intermediary, and then sends the target component upgrade package in the flash module to the flash unit of the target peripheral module for upgrading, so that the difference of upgrade modes caused by different components is avoided, resources are saved, and the components are conveniently and uniformly managed.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (20)

1. A component upgrading method is applied to a terminal, the terminal comprises a wireless access module, an upgrading management module, a flash module and a plurality of peripheral modules, each peripheral module comprises at least one component and a flash unit, and the method comprises the following steps:
when determining that a target component in a target peripheral module meets an upgrading condition, the upgrading management module receives a target component upgrading packet sent by the wireless access module and stores the target component upgrading packet in the flash module;
when the target component upgrading package is received, the upgrading management module acquires the target component upgrading package from the flash module and sends the target component upgrading package to the target peripheral module;
the target peripheral module stores the target component upgrading packet in a designated partition of a flash unit, and upgrades the target component by running the target component upgrading packet in the designated partition;
the terminal also comprises a multimedia module, and the multimedia module and the upgrading management module share the flash module;
before the upgrade management module receives the target component upgrade package sent by the wireless access module, the method further includes:
the upgrading management module sends a use request of the flash module to the multimedia module;
when the use request is received, the multimedia module stops using the flash module and sends a first response message to the upgrade management module;
when the first response message is received, the upgrade management module initializes the flash module and executes a step of receiving a target component upgrade package sent by the wireless access module.
2. The method of claim 1, further comprising:
the upgrade management module sends a request information message to the wireless access module;
when the request information message is received, the wireless access module sends an upgrade query message to the upgrade management module, wherein the upgrade query message at least carries the version number of the target component upgrade package;
when the upgrade inquiry message is received, the upgrade management module judges whether the target assembly meets the upgrade condition;
and if the voltage at the two ends of the target peripheral module is higher than the preset voltage and the version number of the target assembly is lower than the version number of the target assembly upgrading packet, the upgrading management module determines that the target assembly meets the upgrading condition.
3. The method of claim 2, wherein after the upgrade management module determines whether the target component meets the upgrade condition, the method further comprises:
and if the target component does not meet the upgrading condition, the upgrading management module sends a reminding message to the wireless access module, and the wireless access module reminds the user.
4. The method of claim 1, wherein the upgrade management module receives a target component upgrade package sent by the wireless access module, and comprises:
the wireless access module and the upgrade management module predetermine an encryption algorithm and a decryption algorithm;
the wireless access module encrypts the target component upgrading packet by using the encryption algorithm and sends the encrypted target component upgrading packet to the upgrading management module;
the upgrade management module receives the encrypted target component upgrade package;
the storing the target component upgrade package in the flash module includes:
the upgrade management module decrypts the encrypted target component upgrade package by using the decryption algorithm;
and the upgrade management module stores the decrypted target assembly upgrade package in the flash module.
5. The method of claim 1, wherein storing the target component upgrade package in the flash module comprises:
and in the receiving process of the target component upgrading packet, the upgrading management module stores the received bytes in a cache, and writes the bytes in the cache into the flash module by taking a page as a unit.
6. The method of claim 5, wherein writing the bytes in the cache to the flash module in units of pages comprises:
if the number of unreceived bytes is 0, the upgrade management module compares the bytes in the cache with a preset number;
if the number of the bytes in the cache is smaller than the preset number, the upgrade management module writes the bytes in the cache into one page in the flash module;
if the number of bytes in the cache is larger than or equal to the preset number, the upgrade management module writes the preset number of bytes in the cache into one page in the flash module, and writes the rest bytes into the other page in the flash module.
7. The method of claim 5, wherein writing the bytes in the cache to the flash module in units of pages comprises:
if the number of bytes which are not received is not 0, the upgrade management module compares the bytes in the cache with a preset number;
if the bytes in the cache are smaller than the preset number, the upgrade management module continues to receive the target component upgrade package until the reception is finished;
if the number of bytes in the cache is larger than or equal to the preset number, the upgrade management module writes the preset number of bytes in the cache into one page in the flash module, writes the rest bytes into the initial position of the cache, and continues to receive the target component upgrade package until the receiving is completed.
8. The method of claim 1, wherein before the upgrade management module obtains the target component upgrade package from the flash module, the method further comprises:
when receiving an end message sent by the wireless access module, the upgrade management module sends a start data message to the target peripheral module, wherein the start data message at least carries byte length information of the target component upgrade package;
when the starting data message is received, the target peripheral module records byte length information of the target component upgrading packet and sends second response information to the upgrading management module;
and when the second response information is received, the upgrading management module executes the operation of acquiring the target component upgrading packet from the flash module.
9. The method of claim 1, wherein storing the target component upgrade package by the target peripheral module in a designated partition of a flash unit comprises:
and when the target component upgrading packet is received, the target peripheral module stores the target component upgrading packet in the appointed subarea of the flash unit according to the number of bytes which can be contained in one page of the appointed subarea.
10. The method of claim 1, wherein the upgrading the target component by running the target component upgrade package comprises:
when receiving a data end message sent by the upgrade management module, restarting the target peripheral module, and operating the target component upgrade package in the designated partition;
and if the target component upgrading packet is operated successfully, the target peripheral module sets the mark on the upgrading mark position as an upgrading mark so as to finish upgrading the target component.
11. A terminal is characterized by comprising a wireless access module, an upgrade management module, a flash module and a plurality of peripheral modules, wherein each peripheral module comprises at least one component and a flash unit;
the upgrading management module is used for receiving a target component upgrading packet sent by the wireless access module and storing the target component upgrading packet in the flash module when the target component in the target peripheral module meets the upgrading condition;
the upgrade management module is used for acquiring the target component upgrade package from the flash module and sending the target component upgrade package to the target peripheral module when the target component upgrade package is received;
the target peripheral module is used for storing the target component upgrading packet in a designated partition of a flash unit and upgrading the target component by running the target component upgrading packet in the designated partition;
the terminal also comprises a multimedia module, and the multimedia module and the upgrading management module share the flash module;
the upgrade management module is further configured to send a request for using the flash module to the multimedia module before receiving the target component upgrade package sent by the wireless access module;
the multimedia module is further used for stopping using the flash module when the use request is received, and sending a first response message to the upgrade management module;
the upgrade management module is further configured to initialize the flash module when receiving the first response message, and receive a target component upgrade package sent by the wireless access module.
12. The terminal of claim 11, wherein the upgrade management module is further configured to send a request message to the wireless access module;
the wireless access module is further configured to send an upgrade query message to the upgrade management module when receiving the request information message, where the upgrade query message at least carries a version number of the target component upgrade package;
the upgrade management module is further configured to determine whether the target component meets an upgrade condition when the upgrade query message is received;
the upgrade management module is further configured to determine that the target component meets an upgrade condition when the voltage at two ends of the target peripheral module is higher than a preset voltage and the version number of the target component is lower than the version number of the target component upgrade package.
13. The terminal of claim 12, wherein the upgrade management module is further configured to send a reminding message to the wireless access module to remind a user by the wireless access module when the target component does not meet the upgrade condition.
14. The terminal of claim 11, wherein the wireless access module is further configured to determine an encryption algorithm and a decryption algorithm in advance with the upgrade management module;
the wireless access module is also used for encrypting the target component upgrading packet by using the encryption algorithm and sending the encrypted target component upgrading packet to the upgrading management module;
the upgrade management module is also used for receiving the encrypted target component upgrade package;
the upgrade management module is further configured to decrypt the encrypted target component upgrade package using the decryption algorithm;
the upgrade management module is further configured to store the decrypted target component upgrade package in the flash module.
15. The terminal of claim 11, wherein the upgrade management module is further configured to store received bytes in a cache during the receiving of the target component upgrade package, and write the bytes in the cache into the flash module in units of pages.
16. The terminal of claim 15, wherein the upgrade management module is further configured to compare bytes in the cache with a preset number when a number of bytes not received is 0;
the upgrade management module is further configured to write the bytes in the cache into one page in the flash module when the bytes in the cache are smaller than the preset number;
the upgrade management module is further configured to, when the number of bytes in the cache is greater than or equal to the preset number, write the preset number of bytes in the cache into one page of the flash module, and write the remaining bytes into another page of the flash module.
17. The terminal of claim 15, wherein the upgrade management module is further configured to compare bytes in the cache with a preset number when a number of bytes not received is not 0;
the upgrade management module is further configured to continue receiving the target component upgrade package until the receiving is completed when the number of bytes in the cache is smaller than the preset number;
the upgrade management module is further configured to, when the number of bytes in the cache is greater than or equal to the preset number, write the preset number of bytes in the cache into one page in the flash module, write the remaining bytes into an initial position of the cache, and continue to receive the target component upgrade package until the reception is completed.
18. The terminal of claim 11, wherein the upgrade management module is further configured to send a start data packet to the target peripheral module when receiving an end packet sent by the wireless access module, where the start data packet at least carries byte length information of the target component upgrade packet;
the target peripheral module is further configured to record byte length information of the target component upgrade package when receiving the start data packet, and send second response information to the upgrade management module;
the upgrade management module is further configured to obtain the target component upgrade package from the flash module when the second response information is received.
19. The terminal of claim 11, wherein the target peripheral module is further configured to, when receiving the target component upgrade package, store the target component upgrade package in a designated partition of a flash unit according to a number of bytes that can be accommodated by one page of the designated partition.
20. The terminal of claim 11, wherein the target peripheral module is further configured to restart and run the target component upgrade package in the designated partition when receiving a data end packet sent by the upgrade management module;
and the target peripheral module is also used for setting the mark on the upgrading mark position as an upgrading mark when the target component upgrading packet runs successfully so as to finish upgrading the target component.
CN201610666197.1A 2016-08-12 2016-08-12 Component upgrading method and terminal Active CN107733674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610666197.1A CN107733674B (en) 2016-08-12 2016-08-12 Component upgrading method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610666197.1A CN107733674B (en) 2016-08-12 2016-08-12 Component upgrading method and terminal

Publications (2)

Publication Number Publication Date
CN107733674A CN107733674A (en) 2018-02-23
CN107733674B true CN107733674B (en) 2021-03-09

Family

ID=61201478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610666197.1A Active CN107733674B (en) 2016-08-12 2016-08-12 Component upgrading method and terminal

Country Status (1)

Country Link
CN (1) CN107733674B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968294A (en) * 2021-02-26 2022-08-30 深圳怡化电脑科技有限公司 Firmware upgrading method and device for equipment, electronic equipment and storage medium
CN113626060B (en) * 2021-08-06 2023-08-01 天津津航计算技术研究所 Online upgrade method based on separate storage under vxworks system
CN114125902A (en) * 2021-11-30 2022-03-01 上海移远通信技术股份有限公司 WWAN equipment and configuration method, device and storage medium thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577901A (en) * 2009-06-19 2009-11-11 中兴通讯股份有限公司 Wireless access platform and equipment upgrading management system and method thereof
CN104967497A (en) * 2015-06-09 2015-10-07 武汉数字派特科技有限公司 Network communication protocol-based reliable data transmission method and upgrading method
CN105278998A (en) * 2015-11-17 2016-01-27 北京联合众为科技发展有限公司 Single-chip microcomputer hardware upgrading method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8184543B2 (en) * 2008-12-02 2012-05-22 Broadcom Corporation Millimeter wave probing of components via a probe device and methods for use therewith
CN103392174B (en) * 2012-11-29 2015-11-25 华为技术有限公司 Based on the system of flash memory storage, partition method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577901A (en) * 2009-06-19 2009-11-11 中兴通讯股份有限公司 Wireless access platform and equipment upgrading management system and method thereof
CN104967497A (en) * 2015-06-09 2015-10-07 武汉数字派特科技有限公司 Network communication protocol-based reliable data transmission method and upgrading method
CN105278998A (en) * 2015-11-17 2016-01-27 北京联合众为科技发展有限公司 Single-chip microcomputer hardware upgrading method

Also Published As

Publication number Publication date
CN107733674A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
JP6348989B2 (en) Firmware restoration method, apparatus, terminal, program, and recording medium
JP6259122B2 (en) Firmware upgrade method, apparatus, program, and recording medium
US9886264B2 (en) Method and device for upgrading firmware
WO2016011743A1 (en) Storage space saving method and apparatus
JP6189000B2 (en) Application installation package processing method, apparatus, program, and recording medium
CN109669730B (en) Process keep-alive method, device, electronic equipment and medium
CN109388625B (en) Method and device for processing configuration file in multi-distributed file system
CN113110852A (en) Firmware upgrading method and device and storage medium
US20160110181A1 (en) Method and device for upgrading a router
WO2017041397A1 (en) Device control method and apparatus
CN107357613B (en) Application updating method and device and computer readable storage medium
CN105094931A (en) Software upgrading method and device
CN106454392A (en) Live broadcast processing method, device and terminal
CN103914520B (en) Data query method, terminal device and server
CN109582400B (en) Program calling method and device
CN106775903B (en) Security policy file updating method and device
JP2018506809A (en) Method and apparatus for monitoring system partition file
CN107733674B (en) Component upgrading method and terminal
CN107463372B (en) Data-driven page updating method and device
CN108280342B (en) Application synchronization method and device for application synchronization
CN108153540B (en) System upgrading method, device, terminal and storage medium
CN107071008B (en) Terminal equipment positioning method, device and equipment
CN106375350B (en) Flashing verification method and device
CN112163192A (en) root authority acquisition method, root authority acquisition device, root authority acquisition medium and electronic equipment
CN107220082B (en) Application program installation method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant