CN105630422A - Method and device for achieving multiple applications based on small-capacity processor - Google Patents

Method and device for achieving multiple applications based on small-capacity processor Download PDF

Info

Publication number
CN105630422A
CN105630422A CN201511000181.9A CN201511000181A CN105630422A CN 105630422 A CN105630422 A CN 105630422A CN 201511000181 A CN201511000181 A CN 201511000181A CN 105630422 A CN105630422 A CN 105630422A
Authority
CN
China
Prior art keywords
application
application program
identity position
module
value
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.)
Granted
Application number
CN201511000181.9A
Other languages
Chinese (zh)
Other versions
CN105630422B (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.)
Feitian Technologies Co Ltd
Original Assignee
Feitian Technologies 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 Feitian Technologies Co Ltd filed Critical Feitian Technologies Co Ltd
Priority to CN201511000181.9A priority Critical patent/CN105630422B/en
Publication of CN105630422A publication Critical patent/CN105630422A/en
Application granted granted Critical
Publication of CN105630422B publication Critical patent/CN105630422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1068Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices in sector programmable memories, e.g. flash disk
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems

Abstract

The invention discloses a method and device for achieving multiple applications based on a small-capacity processor and belongs to the technical field of computers. The device comprises the processor and an external flash chip. The processor comprises an internal flash chip used for storing and executing one application, and the external flash chip connected with the processor is used for storing the applications. The method includes the steps that the device judges whether application programs need to be loaded or not according to application zone bits stored in an external storage area, if yes, the application programs needing to be loaded are loaded into an internal storage area from the external storage area to run according to the application zone bits, and otherwise, application programs stored in the internal storage area directly run. By means of the method and device, not only are the functions of the applications which the device can support expanded, but also the development cost of the applications of the device can be reduced.

Description

A kind of method and equipment realizing many application based on little capacity processor
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of method and the equipment that realize many application based on little capacity processor.
Background technology
Flash is the one of storage chip, flash memory is also known as flash memory, in the electronics with microcontroller or microprocessor, what microcontroller or microprocessor adopted is a treater chip, inner flash is had at treater chip internal, storage area on inner flash is used for storage and the execution of code, usually inner flash is costly, if therefore to be developed many application, need to use inner flash chip to store multiple application code, just must give the inside flash of processor chip configuration Large Copacity, cost of development will inevitably be increased like this.
Summary of the invention
The present invention proposes the outside flash chip with the use of cheapness, coordinate the treater with little capacity internal flash chip, realize many application function of equipment, can effectively solve in prior art the defect existed.
The technical solution used in the present invention is specific as follows: a kind of method realizing many application based on little capacity processor, comprises the following steps:
Step S1: device power, initialize;
Step S2: equipment reads application identity position from external memory area, judge whether to need loading application programs according to application identity position, it is, according to the application program determining in the application program that described application identity position stores in external memory area to be loaded, the application program loaded described in determining is loaded into internal storage region, then perform step S3, otherwise directly perform step S3;
Step S3: equipment self-inspection, and after self-inspection success, the application program of storage in internal storage region is determined according to application program start address, run in internal storage region the application program stored.
Described method also comprises, and when equipment receives the operation of user's switch application, according to the value of the operation setting application identity position of user's switch application, then performs step S2; Equipment described in described step S2 judges whether to need loading application programs to be specially according to application identity position, judges the value of application identity position, if equaling default value, not needing loading application programs, if being not equal to default value, needing loading application programs; The described application program that will load also comprises the value of amendment application identity position after being loaded into internal storage region be default value.
Above-mentioned steps S2 is specially, equipment reads the first application identity position and the 2nd application identity position from external memory area, judge whether to need loading application programs according to the first application identity position, it is, according to the application program determining in the application program that described 2nd application identity position stores in external memory area to be loaded, the application program loaded described in determining is loaded into internal storage region, then step S3 is performed, otherwise direct step S3.
Above-mentioned the application program loaded described in determining is loaded into internal storage region, specifically comprise: the application program file that the described application program to be loaded is corresponding is verified, if by verification, clear empty internal storage region, the data read in described application program file presetting start address from external memory area are written in internal storage region, if not by verification, loading failure.
The described value by also comprising amendment application identity position during verification is the first default value; Described not by verification time also comprise amendment application identity position value be the 2nd default value; Described first default value is corresponding with the application program being currently loaded in internal storage region, described 2nd default value with do not load before application program in internal storage region corresponding; Described equipment judges whether to need loading application programs to be specially according to application identity position, judges the value of application identity position, if equaling the first default value or the 2nd default value, not needing loading application programs, otherwise needing loading application programs.
Described the application program file that the described application program to be loaded is corresponding is verified, it is specially:
Step a1: be applied from external memory area program file according to default start address and application program file size, obtain firmware data and digest data from described application program file;
Step a2: according to default signature algorithm, described digest data are carried out sign test and obtain the first summary value, calculates summary according to the uncommon algorithm in default Kazakhstan to described firmware data and obtains the 2nd summary value;
Step a3: relatively whether described first summary value is equal with described 2nd summary value is then by verification; Otherwise not by verification, remove the described application program file in external memory area.
Realizing an equipment for many application based on little capacity processor, comprise treater and outside flash chip, include inner flash chip in described treater, the capacity of described inner flash chip is less than described outside flash chip; Described treater also includes: initialize module, read module, judgement module, load-on module, self-inspection module and operation module;
Described initialize module, for performing initialize operation after device power;
Described read module, for reading application identity position from external memory area; Described external memory area is the storage area being arranged in described outside flash chip;
Described judgement module, described application identity position for reading according to described read module judges whether to need loading application programs, if being judged as YES, according to the application program that described application identity position stores in external memory area determining the application program to be loaded and triggers load-on module work, if being judged as otherwise triggering self-inspection module work;
Described load-on module, for the described application program to be loaded being loaded into internal storage region from external memory area, and triggers self-inspection module work; Described internal storage region is the storage area being arranged in described inner flash chip;
Described self-inspection module, for performing self-test operations;
Described operation module, after performing self-test operations success for described self-inspection module, runs in internal storage region the application program stored.
Above-mentioned treater also comprises first and arranges module, for when equipment receives the operation of user's selective gist, according to the value of the operation setting application identity position of user's selective gist. Also comprise the 2nd and module is set, for when equipment receives the operation of user's switch application, according to the value of the operation setting application identity position of user's switch application;
Above-mentioned judgement module specifically for, judge the value of the described application identity position that described read module reads, if equaling default value, not needing loading application programs, if being not equal to default value, needing loading application programs;
Described load-on module, the value also successfully revising application identity position afterwards for loading is default value.
Above-mentioned read module specifically for reading the first application identity position and the 2nd application identity position from described external memory area; Described judgement module is specifically for judging whether to need loading application programs according to described first application identity position, it is according to the application program that described 2nd application identity position stores in external memory area determining the application program to be loaded and triggers load-on module work, otherwise trigger self-inspection module work.
Above-mentioned load-on module specifically for, the application program file that described application program in external memory area is corresponding is verified, if by verification, clear empty internal storage region, the data read in described application program file presetting start address from external memory area are written in internal storage region and trigger self-inspection module work, if not by verification, loading failure.
Described load-on module also for when described application program file by verification time amendment application identity position value be the first default value; Value for the amendment application identity position when described application program file is not by verifying is the 2nd default value; Described first default value is corresponding with the application program being currently loaded in internal storage region, and the application program that described 2nd default value does not perform with described load-on module before loading operates in internal storage region is corresponding;
Above-mentioned judgement module specifically for, judge the value of the described application identity position that described read module reads, if equaling the first default value or the 2nd default value, not needing loading application programs, if being not equal to the first default value or the 2nd default value, needing loading application programs.
Above-mentioned load-on module specifically comprises verification unit, and described verification unit is for verifying the application program file to be loaded;
Described verification unit specifically comprises acquiring unit, calculates unit and compare unit;
Described acquiring unit, for getting application program file from external memory area according to default start address, application program file size, obtains firmware data and digest data from described application program file;
Described calculating unit, obtains the first summary value for described digest data being carried out sign test according to default signature algorithm, according to the uncommon algorithm in default Kazakhstan, described firmware data is calculated summary and obtain the 2nd summary value;
Described compare unit, for relatively whether described first summary value is equal with described 2nd summary value, it is then by verification; Otherwise not by verification, remove the described application program file in external memory area.
The useful effect of the present invention is as follows: method and the equipment realizing many application based on little capacity processor provided by the invention, the supported application function of the equipment that not only extends, can reduce the cost of development of many application of equipment simultaneously.
Accompanying drawing explanation
Fig. 1 is the composition structural representation of a kind of equipment realizing many application based on little capacity processor provided by the invention;
Fig. 2 is a kind of method flow diagram realizing many application based on little capacity processor that embodiment 1 provides;
Fig. 3 be embodiment 1 provide load the flowchart of the first application program to internal storage region from external memory area;
Fig. 4 is the flowchart from external memory area loading the 2nd application program to internal storage region that embodiment 1 provides;
Fig. 5 is a kind of method flow diagram realizing many application based on little capacity processor that embodiment 2 provides;
Fig. 6 is the using method schema of a kind of equipment realizing many application based on little capacity processor that embodiment 3 provides;
Fig. 7 is the composition frame chart of a kind of equipment realizing many application based on little capacity processor that embodiment 4 provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only the present invention's part embodiment, instead of whole embodiments. Based on the embodiment in the present invention, those skilled in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
The present invention provides a kind of equipment and the method that realize many application based on little capacity processor, wherein, described equipment as shown in Figure 1, includes outside flash chip and treater, wherein including inner flash chip in treater, outside flash chip and treater pass through serial interface communication. In embodiment provided by the invention, external memory area is the storage area being arranged in described outside flash chip, and internal storage region is the storage area being arranged in described inner flash chip. In order to reduce the capacity requirement to inner flash chip, the scale-of-two file of an application program can be only stored in internal storage region, external memory area is deposited the scale-of-two file of multiple application program, after treater starts, first the start-up code in the boot district of operation processor, read in external memory area the application identity position stored, and judge whether to need switch application, if not needing switching namely not need to reload application program, then the application program in internal storage region being carried out self-inspection, self-inspection runs the application program in internal storage region after completing; If needing to switch, then treater reads the scale-of-two file of the application program corresponding to the application to be switched that user selects from external memory area, first clear empty internal storage region is then by the internal storage region of the scale-of-two file write treater read, then the application program in the scale-of-two file in write internal storage region is carried out verification and process of self-test by treater, verify errorless after, run the application program in internal storage region, thus realize the switching of many application. In embodiment provided by the invention, judge whether to need loading application programs specifically to judge according to application identity position, if the value of application identity position is default value, do not need loading application programs, if the value of application identity position is not equal to default value, need loading application programs. Before after wherein said default value and device power-up, user performs the operation of selective gist or switch application, the application that in inner flash chip, the current application program stored is corresponding is corresponding, what such as the current application program stored was corresponding be applied as first applies, and default value gets the first default value, and what the current application program stored was corresponding be applied as the 2nd applies, and default value gets the 2nd default value.
Embodiment 1
Present embodiments provide a kind of method realizing many application based on little capacity processor, concrete, the present embodiment peripheral storage zone stores the first application program and the 2nd application program, the application program needing loading application programs and determining to be loaded is judged whether according to application identity position, it is the first default value when the value of application identity position or does not need loading application programs during the 2nd default value, wherein, the corresponding relation of the application program stored in the value of equipment known applications zone bit and external memory area. Determining that when the value of application identity position is the first preset value the application program to be loaded is the first application program, determine that when the value of application identity position is the 2nd preset value the application program to be loaded is the 2nd application program, the first preset value is 0x01,0x00; 2nd preset value is 0x00,0x01, and the first default value is specially 0x00,0x00, and the 2nd default value is specially 0x01,0x01. As shown in Figure 2, the method that the present embodiment provides comprises:
Step 101: device power, initialize;
Concrete, described initialize comprises GPIO initialize, SPI initialize, and display screen initialize etc., comprise open system clock during device power, provides clock source to PIT (cycle interruption timer) module and USB module.
Step 102: equipment reads two byte data from the assigned address external memory area, and is stored in the first array;
Concrete, the application program that two byte data that in external memory area, assigned address stores to be switched execution for identifying, such as, many application that described equipment can realize comprise the first application and the 2nd application, with two byte data 0x01,0x00 mark to be switched to the first application, identifies with two byte data 0x00,0x01 and to be switched to the 2nd application.
Preferably, also comprise after step 101, equipment ejects application switching menu by display screen, after user key-press selects the application to be switched, two byte data that equipment can store according to assigned address in the application amendment external memory area that user selects, such as, user key-press is selected to be switched to the first application, two byte data that then assigned address in external memory area is stored by equipment are revised as 0x01,0x00.
In the present embodiment concrete, first is applied as the application (such as MiniPay) realizing payment function, and the 2nd is applied as the application (such as USBKey) realizing signature function.
Step 103: equipment judges whether the first character joint number certificate that in the first array, low position is risen is 0x00, is then perform step 106, otherwise performs step 104;
Step 104: equipment judges whether the 2nd the byte data that in the first array, low position is risen are 0x01, is then perform step 108, otherwise performs step 105;
Concrete, when two byte data that step 102 reads are 0x01,0x00, this step judged result is for performing step 105.
Step 105: equipment loads the first application program to internal storage region from external memory area, then performs step 108;
The specific implementation of this step as shown in Figure 3, comprising:
Step 105-1: obtain the first application program file in external memory area according to the first default start address, the first application program file size, obtain firmware data and digest data from described first application program file;
Concrete, the first default start address is 0x340000, and the first application program file size is 162K byte, and wherein, 18K byte above is firmware data, and remaining 144K byte is digest data.
Step 105-2: described digest data are calculated according to default signature algorithm, and by the summary that calculates stored in the 2nd array;
Concrete, presetting signature algorithm is RSA algorithm, digest data is calculated according to RSA algorithm, and by the data of rear 20 bytes of calculation result stored in the 2nd array.
Step 105-3: described firmware data is calculated according to the uncommon algorithm in default Kazakhstan, and by calculation result stored in the 3rd array;
Concrete, presetting and breathing out uncommon algorithm is SHA1 algorithm, according to SHA1 algorithm, described firmware data is calculated cryptographic Hash, and by the cryptographic Hash of 20 bytes that calculates stored in the 3rd numerical value.
Step 105-4: whether identical compare the data in the 2nd array and the 3rd array, is then perform step 105-5, otherwise performs step 105-9;
Step 105-5: clear empty internal storage region, and judge whether empty clearly success, it is then perform step 105-6, otherwise the clear empty failure of display, after re-powering, return and perform step 105-1;
Step 105-6: perform the read-write operation reading the data the first application program file from external memory area and being written in internal storage region;
Concrete, the treater of equipment reads the data of 18K byte every time from external memory area, treater writes the data of 2K byte every time in internal storage region, circulation read-write operation, until being all written to internal storage region by the data of the 162K byte in the first application program file in external memory area.
Step 105-7: judge whether to perform successfully, is then perform step 105-8, otherwise display is read and write unsuccessfully, after re-powering, returns and perform step 105-1;
Step 105-8: display loads successfully, and two of assigned address in external memory area byte data are revised as 0x00,0x00, then performs step 108.
Concrete, when two byte data of assigned address are 0x00,0x00 in external memory area, it is applied as the first application for what identify that the equipment last time performs.
Step 105-9: remove the first default start address described in external memory area and the first application program file corresponding to the first application program file size;
Step 105-10: display loads unsuccessfully, and two of assigned address in external memory area byte data are revised as 0x01,0x01, then performs step 108.
Concrete, when two byte data of assigned address are 0x00,0x00 in external memory area, it is applied as the 2nd application for what identify that the equipment last time performs.
Step 106: equipment judges whether the 2nd the byte data that in the first array, low position is risen are 0x00, is then perform step 108, otherwise performs step 107;
Concrete, when two bytes that step 102 reads are 0x00,0x01, the judged result of this step is for performing step 107.
Step 107: equipment loads the 2nd application program to internal storage region from external memory area, then performs step 108;
The specific implementation of this step is as shown in Figure 4:
Step 107-1: obtain the 2nd application program file in external memory area according to the 2nd default start address, the 2nd application program file size, obtain firmware data and digest data from described 2nd application program file;
Preferably, the 2nd default start address is 0x300000, and the 2nd application program file size is 162K byte, and wherein, front 18K byte is firmware data, and rear 144K byte is digest data.
Step 107-2: described digest data are calculated according to default signature algorithm, and by the summary that calculates stored in the 2nd array;
Preferably, presetting signature algorithm is RSA algorithm, digest data is calculated according to RSA algorithm, and by the data of rear 20 bytes of calculation result stored in the 2nd array.
Step 107-3: described firmware data is calculated according to the uncommon algorithm in default Kazakhstan, and by calculation result stored in the 3rd array;
Preferably, presetting and breathing out uncommon algorithm is SHA1 algorithm, according to SHA1 algorithm, described firmware data is calculated cryptographic Hash, and by the cryptographic Hash of 20 bytes that calculates stored in the 3rd numerical value.
Step 107-4: whether identical compare the data in the 2nd array and the 3rd array, is then perform step 107-5, otherwise performs step 107-9;
Step 107-5: clear empty internal storage region, and judge whether empty clearly success, it is then perform step 107-6, otherwise the clear empty failure of display, after re-powering, return and perform step 107-1;
Step 107-6: perform the read-write operation reading the data the 2nd application program file from external memory area and being written in internal storage region;
Concrete, the treater of equipment reads the data of 18K byte every time from external memory area, treater writes the data of 2K byte every time in internal storage region, circulation read-write operation, until being all written to internal storage region by the data of the 162K byte in the 2nd application program file in external memory area.
Step 107-7: judge whether to perform successfully, is then perform step 107-8, otherwise display is read and write unsuccessfully, after re-powering, returns and perform step 107-1;
Step 107-8: display loads successfully, and two of assigned address in external memory area byte data are revised as 0x01,0x01, then performs step 108.
Concrete, when in external memory area, two byte data of assigned address are 0x01,0x01, for identify loads after successfully in internal storage region the currently application program of storage corresponding be the 2nd application.
Step 107-9: remove the 2nd default start address described in external memory area and the 2nd application program file corresponding to the 2nd application program file size;
Step 107-10: display loads unsuccessfully, and two of assigned address in external memory area byte data are revised as 0x00,0x00, then performs step 108.
Concrete, when in external memory area, two byte data of assigned address are 0x00,0x00, for identify the application program stored in internal storage region before equipment performs to load corresponding be the first application.
Step 108: equipment self-inspection;
Concrete, equipment self-inspection comprises the integrity of the application program in device authentication internal storage region.
Step 109: equipment judges that whether self-inspection is successful then performs step 110, otherwise display fail self-test, return step 108;
Step 110: equipment, according to application program start address, performs in internal storage region the application program deposited.
Concrete, described application program start address is the known address of equipment, determines the deposit position of application program according to this address.
Further, after equipment executes the application program deposited in internal storage region, can be as empty clearly in the first array, the 2nd array and the 3rd array by interim spatial cache.
The application identity position provided in the present embodiment is made up of two bytes, two bytes according to application identity position can determine whether need loading application programs and specifically to be loaded which application program, with reason, can also be that equipment reads the first application identity position and the 2nd application identity position respectively from external memory area, judge whether to need loading application programs according to the first application identity position, it is from external memory area, determine the address of the application program to be loaded according to described 2nd application identity position, and the application program that will load is loaded into internal storage region, then perform self-inspection and run the application program in internal storage region, otherwise directly perform self-inspection and run the application program in internal storage region.
Embodiment 2
Present embodiments providing a kind of method realizing many application based on little capacity processor, in the present embodiment, inner flash chip is called for short inner flash, and outside flash chip is called for short inner flash, as shown in Figure 5, comprising:
Step 201: treater is flash transmission reading application identity position instruction externally;
Preferably, also comprise before step 201, treater runs boot program, equipment ejects application choice menu, after user key-press selects switch application, treater can according to the application identity position stored in the outside flash of application amendment that user selects, such as, user key-press selects the first application, then the first preset value is revised as in the application identity position stored in outside flash by treater, if user key-press selects the 2nd application, then the 2nd preset value is revised as in the application identity position stored in outside flash by treater. In the present embodiment, the first preset value is 0x01,0x00; 2nd preset value is 0x00,0x01.
Step 202: outside flash returns to application identity position to treater;
Step 203: treater judges whether to need loading application programs according to the application identity position received, is then perform step 204, otherwise performs step 213;
Concrete, treater judges whether the application identity position received is the first preset value or the 2nd preset value, is need loading application programs, performs step 204, otherwise does not need to load, and performs step 213.
Step 204: the application program to be loaded determined by treater according to application identity position, and externally flash sends the instruction reading firmware data and digest data;
Concrete, if application identity position is the first preset value, then determine that the application program to be switched is the first application program, if application identity position is the 2nd preset value, then determine that the application program to be switched is the 2nd application program.
Step 205: outside flash returns firmware data and digest data to treater;
Above-mentioned steps 204 and step 205 specifically comprise:
1-1. treater is according to the application program to be loaded determined, composition reads digest data command and sends outside flash, and outside flash returns digest data to treater;
1-2. treater, according to the application program to be loaded determined, forms a reading firmware data instruction and is sent to outside flash, and outside flash returns a firmware data to treater;
The firmware data size that 1-3. treater is corresponding according to the application program to be loaded judges whether to finish receiving firmware data, is then perform step 206, otherwise returns and perform 1-2.
Step 206: the described digest data received are carried out sign test according to default signature algorithm and obtain the first summary value by treater, calculates the 2nd summary value according to the uncommon algorithm in default Kazakhstan to the described firmware data received;
Step 207: whether treater compares the first summary value equal with the 2nd summary value, is then perform step 208, otherwise performs step 212;
Step 208: the inner flash of treater erasing;
Step 209: treater is flash transmission reading application program file instruction externally;
Step 210: outside flash returns application program file to treater;
Step 211: the data in the application program file received are written in inner flash by treater, then perform step 212;
Step 212: treater is flash transmission renewal application identity position instruction externally, then performs step 213;
When the renewal application identity position instruction that outside flash receives, upgrade application identity position.
Step 213: treater runs self-check program, runs the application program in inner flash after self-inspection success.
Concrete, treater runs the integrity of the application program in the inner flash of self-check program checking, if application program is complete, and self-inspection success, otherwise fail self-test.
Embodiment 3
Present embodiments provide the using method of a kind of equipment realizing many application based on little capacity processor, as shown in Figure 6, comprising:
Step 301: device power-up;
Step 302: equipment points out process of self-test by display screen;
Step 303: after equipment self-inspection completes, determines current application according to application identity position, and enters current application by display screen display;
Concrete, the value of the application identity position obtained when device power-up performs boot program is default value, determines current application according to default value. In the present embodiment, the described default value of definition is the numerical value corresponding with the application program stored in inner flash chip before equipment shutdown last time, such as, user used equipment to be used as USBKey last time, then this step obtains default value is 0x00,0x00, and the current application determined still is USBKey.
Step 304: when user presses function button, equipment is pressed programmable button by display screen to user's prompting and is switched to Another Application;
Step 305 is performed when user presses programmable button;
Preferably, when user presses programmable button, equipment receives the operation of user's switch application, according to the operation setting application identity position of user. The described application identity position that arranges is specially to be revised as the value of application identity position from the default value that current application is corresponding and to be switched numerical value corresponding to the Another Application entered. Such as, current application is USBKey, is applied as MiniPay when what user pressed that numerical key 1 to be switched to, then value by application identity position is revised as 0x01,0x00 from 0x00,0x00.
Step 305: equipment judges whether handover success, is then perform step 306, otherwise performs step 307;
Concrete, equipment is by running boot program, and the application program of the application that will switch is loaded into the inside flash chip of treater from outside flash chip, if loading successfully, performs step 306, if loading unsuccessfully, performs step 307.
Further, also comprise before execution step 306 after successfully if loading, the default value that the application program value of application identity position being revised as in current inner flash chip is corresponding. Such as, the application program being currently loaded in inner flash chip is MiniPay application program, then value by application identity position is revised as 0x01,0x01 from 0x01,0x00.
Step 306: equipment points out process of self-test by display screen, after self-inspection completes, switching enters Another Application; Terminate.
Concrete, this step also comprises the application code in the inside flash chip of equipment operation processor.
Step 307: equipment is pointed out unsuccessfully by display screen, terminates.
Further, above-mentioned steps 302 and step 303 can also be replaced and be:
Step 302': equipment points out user's selective gist by display screen;
Step 303': equipment receives the operation of user's selective gist, determines current application according to the operation of user, then performs self-inspection, self-inspection enters current application by display screen display after completing;
Concrete, the value of the application identity position obtained when device power-up performs boot program is default value, judge that whether default value is corresponding with the application that user selects, it is then directly run in current inner flash chip the application program stored, otherwise the value of application identity position is revised as from default value the numerical value of the application correspondence that user selects, the application program of application correspondence user selected is loaded into inner flash chip from outside flash chip, then self-inspection and run the application program in inner flash.
Embodiment 4
Present embodiments provide a kind of equipment realizing many application based on little capacity processor, as shown in Figure 7, this equipment comprises treater 600 and outside flash chip 500, described treater 600 is connected by serial line interface with described outside flash chip 500, includes inner flash chip 400 in described treater 600; Described treater 600 also includes: initialize module 401, read module 402, judge module 403, load-on module 404, self-inspection module 405 and run module 406;
Described initialize module 401, for performing initialize operation after device power;
Described read module 402, for reading application identity position from external memory area; Described external memory area is the storage area being arranged in described outside flash chip 500; Concrete, read module 402 in treater 600 reads the instruction of application identity position specifically for sending to described outside flash chip 500, accordingly, described outside flash chip 500 is for when receiving described reading application identity position instruction, returning to application identity position to described read module 402.
Described judgement module 403, described application identity position for reading according to described read module 403 judges whether to need loading application programs, if being judged as YES, from external memory area, determining the address of the application program to be loaded according to described application identity position and triggering load-on module work 404, if being judged as otherwise triggering self-inspection module 405 and work; Wherein, the value of application identity position is uniquely corresponding with the application program stored in external memory area, equipment this corresponding relation known, such as, preserving the list of this corresponding relation in equipment in advance, equipment determines the application program that will load from external memory area by lookup table mode according to the value of the application identity position read.
Described load-on module 404, is loaded into internal storage region for the application program that will load from external memory area, and triggers self-inspection module 405 and work; Described internal storage region is the storage area being arranged in described inner flash chip 600; Concrete, this load-on module 404 comprises reading unit, and described reading unit is used for sending, to described outside flash chip 500, the instruction reading firmware data and digest data; Described outside flash chip 500 for when receiving the instruction of described reading firmware data and digest data, returning described firmware data and described digest data to described reading unit. Concrete, reading unit can be send a reading command to read firmware data and digest data from outside flash chip, it is also possible to is send respectively to read firmware data instruction and read digest data command to read firmware data and digest data from outside flash chip.
Described self-inspection module 405, for performing self-test operations;
Described operation module 406, after performing self-test operations success for described self-inspection module 405, determines the application program stored in internal storage region, runs in internal storage region the application program stored according to application program start address.
In the present embodiment, described equipment also comprises display screen and button, if when equipment has the function for user's selective gist, described treater can also comprise and arranges module; Module is set, for when equipment receives the operation of user's selective gist, according to the value of the operation setting application identity position of user.
If when equipment has the function being switched to other application for user from current application, described arranging module, for when equipment receives the operation of user's switch application, according to the value of the operation setting application identity position of user. Accordingly, described judgement module 403, specifically for judging the value of the described application identity position that described read module 402 reads, if equaling default value, not needing loading application programs, if being not equal to default value, needing loading application programs;
Described load-on module 404, the value also successfully revising application identity position afterwards for loading is default value.
Further, described read module 402 can also be specifically for reading the first application identity position and the 2nd application identity position from described external memory area; Described judgement module 403 is specifically for judging whether to need loading application programs according to described first application identity position, it is from external memory area, determine the address of the application program to be loaded according to described 2nd application identity position and trigger load-on module 404 and work, otherwise triggers self-inspection module 405 and work.
The described load-on module 404 that the present embodiment provides is specifically for verifying the described application program file in external memory area, if by verification, clear empty internal storage region, the data read in described application program file presetting start address from external memory area are written in internal storage region and trigger self-inspection module 405 and work, if not by verification, loading failure. Described load-on module 404 also for when described application program file by verification time amendment application identity position value be the first default value; Value for the amendment application identity position when described application program file is not by verifying is the 2nd default value; Described first default value is corresponding with the application program being currently loaded in internal storage region, and the application program that described 2nd default value does not perform with described load-on module before loading operates in internal storage region is corresponding; Accordingly, described judgement module 403, specifically for judging the value of the described application identity position that described read module 402 reads, if equaling the first default value or the 2nd default value, not needing loading application programs, otherwise needing loading application programs.
Preferably, described load-on module 404 comprises verification unit, and described verification unit is for verifying the application program file in external memory area;
Described verification unit specifically comprises acquiring unit, calculates unit and compare unit;
Described acquiring unit, for getting application program file from external memory area according to default start address, application program file size, obtains firmware data and digest data from described application program file;
Described calculating unit, obtains the first summary value for described digest data being carried out sign test according to default signature algorithm, according to the uncommon algorithm in default Kazakhstan, described firmware data is calculated summary and obtain the 2nd summary value;
Described compare unit, for relatively whether described first summary value is equal with described 2nd summary value, it is then by verification; Otherwise not by verification, remove the described application program file in external memory area.
The present invention has introduced for the two methods that is applied as that can realize more in embodiment 1 and 2, it should be noted that, if realizing the switching of the application of two or more, easily expect according to the description of embodiment 1 and embodiment 2, can with multiple byte representation application identity position, opening up multiple storage address in outside flash chip and store different application programs, treater preserves the value of application identity position and the corresponding relation list of the storage address of the multiple application programs in outside flash chip in advance. When user selects switch application, equipment corresponding storage from outside flash chip is read the detailed process that application program is written in inner flash chip and can also be derived from the specific descriptions the embodiment of the present invention 1 and embodiment 2 and draw in address.
Although above it has been shown and described that embodiments of the invention, it is understandable that, above-described embodiment is exemplary, can not being interpreted as limitation of the present invention, above-described embodiment can be changed when not departing from principle and the objective of the present invention, revises, replace and modification by the those of ordinary skill of this area within the scope of the invention. The scope of the present invention is by claims and equivalent limits.

Claims (21)

1. realize a method for many application based on little capacity processor, it is characterized in that, comprising:
Step S1: device power, initialize;
Step S2: equipment reads application identity position from external memory area, judge whether to need loading application programs according to application identity position, it is, according to the application program determining in the application program that described application identity position stores in external memory area to be loaded, the application program loaded described in determining is loaded into internal storage region, then perform step S3, otherwise directly perform step S3;
Step S3: equipment self-inspection, and run in internal storage region, after self-inspection success, the application program stored.
2. the method for claim 1, is characterized in that: also comprise between described step S1 and step S2, and equipment receives the operation of user's selective gist, according to the value of the operation setting application identity position of user's selective gist, then performs step S2.
3. method as claimed in claim 1 or 2, is characterized in that: described method also comprises, and when equipment receives the operation of user's switch application, according to the value of the operation setting application identity position of user's switch application, then performs step S2;
Equipment described in described step S2 judges whether to need loading application programs to be specially according to application identity position, judges the value of application identity position, if equaling default value, not needing loading application programs, if being not equal to default value, needing loading application programs; Described the application program loaded described in determining is loaded into internal storage region after also comprise amendment application identity position value be default value.
4. the method for claim 1, it is characterized in that: described step S2 is specially, equipment reads the first application identity position and the 2nd application identity position from external memory area, judge whether to need loading application programs according to the first application identity position, it is, according to the application program determining in the application program that described 2nd application identity position stores in external memory area to be loaded, the application program loaded described in determining is loaded into internal storage region, then step S3 is performed, otherwise direct step S3.
5. the method for claim 1, it is characterized in that: described the application program loaded described in determining is loaded into internal storage region, specifically comprise: the application program file that the described application program to be loaded is corresponding is verified, if by verification, clear empty internal storage region, the data read in described application program file presetting start address from external memory area are written in internal storage region, if not by verification, loading failure.
6. method as claimed in claim 5, is characterized in that: the described value by also comprising amendment application identity position during verification is the first default value; Described not by verification time also comprise amendment application identity position value be the 2nd default value; Described first default value is corresponding with the application program being currently loaded in internal storage region, described 2nd default value with do not load before application program in internal storage region corresponding;
Described equipment judges whether to need loading application programs to be specially according to application identity position, judges the value of application identity position, if equaling the first default value or the 2nd default value, not needing loading application programs, otherwise needing loading application programs.
7. method as claimed in claim 5, is characterized in that: described verified by the application program file that the described application program to be loaded is corresponding, is specially:
Step a1: be applied from external memory area program file according to default start address and application program file size, obtain firmware data and digest data from described application program file;
Step a2: according to default signature algorithm, described digest data are carried out sign test and obtain the first summary value, calculates summary according to the uncommon algorithm in default Kazakhstan to described firmware data and obtains the 2nd summary value;
Step a3: relatively whether described first summary value is equal with described 2nd summary value is then by verification; Otherwise not by verification, remove the described application program file in external memory area.
8. the method for claim 1, it is characterized in that: described equipment reads application identity position from external memory area and is specially, the treater of described equipment sends to place, described external memory area flash chip and reads the instruction of application identity position, and place, described external memory area flash chip returns to application identity position to described treater.
9. method as claimed in claim 5, it is characterized in that: the data in the described application program file of described reading are written in internal storage region and are specially, the treater of described equipment sends the instruction reading firmware data and digest data to place, described external memory area flash chip, and place, described external memory area flash chip returns described firmware data and described digest data to described treater.
10. method as claimed in claim 9, is characterized in that: the instruction of described reading firmware data and digest data is at least one reading command.
11. 1 kinds realize the equipment of many application based on little capacity processor, it is characterized in that: described equipment comprises treater and outside flash chip, including inner flash chip in described treater, the capacity of described inner flash chip is less than described outside flash chip; Described treater also includes: initialize module, read module, judgement module, load-on module, self-inspection module and operation module;
Described initialize module, for performing initialize operation after device power;
Described read module, for reading application identity position from external memory area; Described external memory area is the storage area being arranged in described outside flash chip;
Described judgement module, described application identity position for reading according to described read module judges whether to need loading application programs, if being judged as YES, according to the application program that described application identity position stores in external memory area determining the application program to be loaded and triggers load-on module work, if being judged as otherwise triggering self-inspection module work;
Described load-on module, for the described application program to be loaded being loaded into internal storage region from external memory area, and triggers self-inspection module work; Described internal storage region is the storage area being arranged in described inner flash chip;
Described self-inspection module, for performing self-test operations;
Described operation module, after performing self-test operations success for described self-inspection module, runs in internal storage region the application program stored.
12. equipment as claimed in claim 11, is characterized in that: described treater also comprises first and arranges module, for when equipment receives the operation of user's selective gist, according to the value of the operation setting application identity position of user's selective gist.
13. equipment as described in claim 11 or 12, is characterized in that: described treater also comprises the 2nd and arranges module, for when equipment receives the operation of user's switch application, according to the value of the operation setting application identity position of user's switch application;
Described judgement module specifically for, judge the value of the described application identity position that described read module reads, if equaling default value, not needing loading application programs, if being not equal to default value, needing loading application programs;
Described load-on module, the value also successfully revising application identity position afterwards for loading is default value.
14. equipment as claimed in claim 11, is characterized in that: described read module specifically for reading the first application identity position and the 2nd application identity position from described external memory area; Described judgement module is specifically for judging whether to need loading application programs according to described first application identity position, it is according to the application program that described 2nd application identity position stores from external memory area determining the application program to be loaded and triggers load-on module work, otherwise trigger self-inspection module work.
15. equipment as claimed in claim 11, it is characterized in that: described load-on module specifically for, the application program file that the application program loaded described in external memory area is corresponding is verified, if by verification, clear empty internal storage region, the data read in described application program file presetting start address from external memory area are written in internal storage region and trigger self-inspection module work, if not by verification, loading failure.
16. equipment as claimed in claim 15, is characterized in that: described load-on module also for when described application program file by verification time amendment application identity position value be the first default value; Value for the amendment application identity position when described application program file is not by verifying is the 2nd default value; Described first default value is corresponding with the application program being currently loaded in internal storage region, and the application program that described 2nd default value does not perform with described load-on module before loading operates in internal storage region is corresponding;
Described judgement module specifically for, judge the value of the described application identity position that described read module reads, if equaling the first default value or the 2nd default value, not needing loading application programs, if being not equal to the first default value or the 2nd default value, needing loading application programs.
17. equipment as claimed in claim 15, is characterized in that: described load-on module comprises verification unit, and described verification unit is for verifying the application program file that the described application program to be loaded is corresponding;
Described verification unit specifically comprises acquiring unit, calculates unit and compare unit;
Described acquiring unit, for getting application program file from external memory area according to default start address, application program file size, obtains firmware data and digest data from described application program file;
Described calculating unit, obtains the first summary value for described digest data being carried out sign test according to default signature algorithm, according to the uncommon algorithm in default Kazakhstan, described firmware data is calculated summary and obtain the 2nd summary value;
Described compare unit, for relatively whether described first summary value is equal with described 2nd summary value, it is then by verification; Otherwise not by verification, remove the described application program file in external memory area.
18. equipment as claimed in claim 11, is characterized in that: described read module, read the instruction of application identity position specifically for sending to described outside flash chip; Described outside flash chip is used for when receiving described reading application identity position instruction, returns to application identity position to described read module.
19. equipment as claimed in claim 15, is characterized in that: described load-on module comprises reading unit, and described reading unit is used for sending, to described outside flash chip, the instruction reading firmware data and digest data; Described portion flash chip is used for when receiving the instruction of described reading firmware data and digest data, returns described firmware data and described digest data to described reading unit.
20. equipment as claimed in claim 19, is characterized in that: described reading unit is specifically for sending at least one reading command to read described firmware data and described digest data to described outside flash chip.
21. equipment as claimed in claim 11, is characterized in that: described treater is connected by serial line interface with described outside flash chip.
CN201511000181.9A 2015-12-28 2015-12-28 It is a kind of to realize the method and apparatus more applied based on low capacity processor Active CN105630422B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511000181.9A CN105630422B (en) 2015-12-28 2015-12-28 It is a kind of to realize the method and apparatus more applied based on low capacity processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511000181.9A CN105630422B (en) 2015-12-28 2015-12-28 It is a kind of to realize the method and apparatus more applied based on low capacity processor

Publications (2)

Publication Number Publication Date
CN105630422A true CN105630422A (en) 2016-06-01
CN105630422B CN105630422B (en) 2018-07-24

Family

ID=56045420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511000181.9A Active CN105630422B (en) 2015-12-28 2015-12-28 It is a kind of to realize the method and apparatus more applied based on low capacity processor

Country Status (1)

Country Link
CN (1) CN105630422B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930575A (en) * 2020-07-01 2020-11-13 联想(北京)有限公司 Firmware acquisition method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110037A (en) * 2007-08-28 2008-01-23 北京海尔集成电路设计有限公司 Method for calling application program in exterior storage medium in embedded type equipment
CN101673204A (en) * 2009-08-13 2010-03-17 上海酷吧信息技术有限公司 Dynamic loading method of application program of mobile phone based on arm
CN202759507U (en) * 2012-09-11 2013-02-27 李平 A smart phone
US20130145076A1 (en) * 2011-12-05 2013-06-06 Industrial Technology Research Institute System and method for memory storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110037A (en) * 2007-08-28 2008-01-23 北京海尔集成电路设计有限公司 Method for calling application program in exterior storage medium in embedded type equipment
CN101673204A (en) * 2009-08-13 2010-03-17 上海酷吧信息技术有限公司 Dynamic loading method of application program of mobile phone based on arm
US20130145076A1 (en) * 2011-12-05 2013-06-06 Industrial Technology Research Institute System and method for memory storage
CN202759507U (en) * 2012-09-11 2013-02-27 李平 A smart phone

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930575A (en) * 2020-07-01 2020-11-13 联想(北京)有限公司 Firmware acquisition method and device and electronic equipment

Also Published As

Publication number Publication date
CN105630422B (en) 2018-07-24

Similar Documents

Publication Publication Date Title
TWI502507B (en) Method of updating battery firmware, portable electronics device and rechargeable battery module
CN105786421B (en) Server display method and device
AU2013407292B2 (en) Devices, updaters, methods for controlling a device, and methods for controlling an updater
KR20160049956A (en) Mobile divece and operating method thereof
CN104850792A (en) Establishment method and apparatus of trust chain of server
CN110795738B (en) Computer starting method, controller, storage medium and system
US20100106956A1 (en) Bios switching system and a method thereof
JP6139386B2 (en) Programmable controller
CN110020528A (en) A kind of BMC starting method, apparatus and electronic equipment and storage medium
CN107450953B (en) Method and device for updating BIOS
CN105354059A (en) Upgrade method and apparatus for controller of air-conditioner system
CN108389600B (en) Data storage device and parameter rewriting method
US9786373B2 (en) EEPROM backup method and device
TW201716999A (en) Method for startup inspection and computer system using the same
CN103544413A (en) Method and device for verifying software copyright in intelligent terminal
CN107657153B (en) Code protection method and device for flash area in chip
CN112084064B (en) Master-slave BIOS switching method, board card and equipment
CN105630422A (en) Method and device for achieving multiple applications based on small-capacity processor
US20070162735A1 (en) Control chip for a computer boot procedure and related method
EP3291092B1 (en) Data recovery method, device and terminal
CN103106089B (en) A kind of upgrade method of intelligent platform management controller and system
US9529581B2 (en) Circuit and method for writing program codes of basic input/output system
CN109614279B (en) Industrial personal computer self-checking system and control method thereof and related equipment
CN113918199A (en) Method for updating underlying firmware program, storage medium and electronic device
CN104102517B (en) The circuit and wiring method of basic input output system program code is written

Legal Events

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