The application is invention entitled " a kind of method processing production data and the dress proposed on March 28th, 2013
Put " the divisional application of Chinese invention patent application 201310103347.4.
Detailed description of the invention
The embodiment of the present invention provides a kind of method and apparatus processing production data, in the method, at mobile terminal
Upper layer application read the production data message failure in first part of production data after, the device drives of mobile terminal
Read the production data message in second part of production data, and first part of production data is replaced with second part
Production data, solve the problem that production digital independent that mobile terminal modifiers causes is failed, it is ensured that move
Dynamic terminal can successfully obtain production data during normally using.
The schematic diagram of the procedure processing production data that Fig. 1 provides for the embodiment of the present invention, as it is shown in figure 1,
The method comprises the following steps:
The upper layer application of S101: mobile terminal reads the production data message in first part of production data.
S102: the production during the upper layer application of mobile terminal reads first part of production data in S101 step
After data message failure, the device drives of mobile terminal reads the production data message in second part of production data,
And first part of production data is replaced with second part of production data.
In embodiments of the present invention, it is contemplated that the importance of production data, production data have two parts, first
After production data message in part production data reads unsuccessfully, can read further in second part of production data
Production data message, and replace first part of production data by second part of production data, raw to realize product
Produce the recovery of data.
Before mobile terminal dispatches from the factory, and in factory during upgrading products creation data, will write or update
Production data be successively written as first part of production data and second part of production data, to realize backing up, now,
Two parts of production data are identical.But owing to repeatedly the reading of production data, storing depositing of production data
The hardware damage of reservoir, the factor such as deletion of modifiers, may cause first part of production data to read, though or energy
Read, but the data that read out are verified makes mistakes, then first part of production data is the most unavailable, now, by mobile terminal
Device drives stealth ground reads the production data message in second part of production data automatically, and first part of product is raw
Produce data and replace with second part of production data of reading, to recover production data.Here " stealthy " refer to for
The user of mobile terminal is invisible, and " automatically " refers to device drives production in knowing first part of production data
After data message reads unsuccessfully, it is not necessary to through the confirmation of upper layer application, automatically read the product in second part of production data
Product creation data information, and the production data message read is returned to upper layer application.Wherein, the equipment of mobile terminal
Driving can be the driving code in mobile terminal operating system kernel.Owing to said process is unknown to the user of mobile terminal
, therefore improve user's perception.
Further, second part of production data is only read by the device drives of mobile terminal.
First part of production data has read-write interface to upper layer application, is visible to upper layer application;In the factory, may be used
Write first part of production data with specific equipment by the upper layer application of mobile terminal, and after dispatching from the factory, use normal
During mobile terminal, upper layer application is only capable of the production data message reading in first part of production data, it is impossible to
Rewrite, delete production data.Second part of production data is hidden the most completely, uniquely can operate it just
It it is device drives.Alternatively, the driving code during device drives is mobile terminal operating system kernel.
Further, first part of production data and second part of production data are stored respectively in the same of mobile terminal
In the different subregions of one memorizer or different memory.
Do so, can be prevented effectively from and cause two parts of production data all cannot read owing to a subregion damages
Situation, reliability is high.Actual when realizing, a production data can take the memory space of the sizes such as 32K, 64K, the most greatly
Depending on neglecting the data volume of production data.
Further, the method processing production data that the embodiment of the present invention provides also includes: mobile terminal will be received
The initial product creation data arrived is as first part of production data, and stores first part of production data, and should
The initial product creation data received is as second part of production data, and stores second part of production data.
In the production process of mobile terminal, mobile terminal using the initial product creation data that receives first as first part
Production data store, and are stored as second part of production data by device drives stealth the most again.Two
Any one in individual storing process is made mistakes, then can reenter production process.Until the number of times repeating to enter generation process reaches
To the frequency threshold value (such as: 2 times) preset.
Further, the method processing production data that the embodiment of the present invention provides also includes:
The production data of the renewal received are replaced, as first part of production data, first stored by mobile terminal
Part production data, and using the production data that update as second part of production data, replace the stored
Two parts of production data.
According to technique needs, in a special case (such as: product anti-package), upgrading products in the factory are needed to produce number
According to.During Gai, respectively two parts of production data be updated, it is ensured that two parts of production data are identical.
Further, if the production data of renewal being replaced the first part of production data failure stored, then
The device drives of mobile terminal reads the production data message in the first part of production data stored, if reading into
The production data of the renewal received are replaced, as first part of production data, the first part of product stored by merit the most again
Product creation data;
If the production data of renewal to be replaced the second part of production data failure stored, the then equipment of mobile terminal
Driving the production data message read in the second part of production data stored, if reading successfully, the most again will receive
To the production data of renewal replace the second part of production data stored as second part of production data.
When upgrading products creation data, it is likely to be due to many reasons such as operation, hardware device read-write, causes once updating
Failure, here, no matter first part of production data and second part of production data any one updates unsuccessfully, then it is assumed that product
Product creation data updates unsuccessfully.Now, optional renewal process is exited, it is possible to attempt reading the production data stored,
If reading successfully, then prove that the hardware storing these production data does not damage, and can attempt upgrading products creation data again.
Actual when realizing, the threshold value (such as: 2 times) of predeterminable repetition update times, reach this threshold value preset when repeating update times
Time, then exit renewal process.
Device drives, when being read out production data, uses function bdget_disk () to obtain storage product
The memorizer of creation data or the equipment handle (as the parameter of function call below) of memory partition, and pass through family of functions
Bread () and brelse () reads production data.Device drives can pass through family of functions getblk (), mark_buffer_
Dirty (), ll_rw_block (), brelse () realize the mutual replacement of two parts of production data.This ensures that there two
The synchronization of part production data.Such as, when two parts of production data be stored respectively in same memorizer subregion BCK1 and
During BCK2, by above-mentioned family of functions, the data of BCK1 can be write BCK2.Merely illustrative with superior function, it is not construed as this
The restriction of bright embodiment.
Below, with reference to Fig. 2, Fig. 3 and Fig. 4, the production digital independent of the embodiment of the present invention, initial product are described respectively
The write of creation data and the renewal process of production data.
First, the process of the production digital independent of the embodiment of the present invention is described with reference to Fig. 2.
The upper layer application of S201: mobile terminal reads the production data message in first part of production data, if
Success, then perform step S202;If failure, then perform step S203;
S202: return the production data message read to upper layer application;
The device drives of S203: mobile terminal reads the production data message in second part of production data automatically, if
Failure, then perform step S204;If success, then perform step S205, alternatively, step can be first carried out before performing step S205
Rapid S205 ';
S204: confirm that the memorizer of storage production data or memory partition damage, it is impossible to repair, exit production
The reading flow process of data;
S205: replace first part of production data by second part of production data and return step S202;
S205 ': memory partition or memorizer to first part of production data of storage format, the purpose of this step
It is the bad block that may be present in order to remove memory partition, improves storage success rate when replacing.
Below, the ablation process of the initial product creation data of the embodiment of the present invention is described with reference to Fig. 3.
S301: enter plant produced pattern;
S302: using the initial product creation data that receives as first part of production data, and store first part of production
Data, if storing successfully, then perform step S303, if storing unsuccessfully, then return step S301;
S303: using the initial product creation data that receives as second part of production data, and store second part of production
Data, if storing successfully, then perform step S304, if storing unsuccessfully, then return step S301;
S304: enter other stages produced.
Initial product creation data writes with specific equipment before mobile terminal dispatches from the factory.Typically, mobile terminal is wanted
It is introduced into plant produced pattern and could write production data.After being successfully written production data, enter back into factory raw
Other stages produced, such as: outer cover packaging, overall performance test etc..
From above-mentioned steps it can be seen that any a first part of production data or second part of production data
Store unsuccessfully, all can reenter plant produced pattern, actual when realizing, the number of times reentering plant produced pattern can be limited
(such as: 2 times), to avoid endless loop.
Finally, the renewal process of the production data of the embodiment of the present invention is described with reference to Fig. 4.
According to technique needs, in a special case (such as: product anti-package), upgrading products in factory are needed to produce number
According to.During Gai, respectively two parts of production data be updated, be identical to ensure two parts of production data.Should
Process is achieved by the steps of:
The production data of the renewal received are replaced as first part of production data and to have been stored by S401: mobile terminal
First part of production data;If being replaced successfully, then performing step S402, if replacing unsuccessfully, then performing step S403;
The production data of the renewal received are stored by S402: mobile terminal as second part of production data, replacement
Second part of production data, if success, then perform step S405, if failure, then perform step S406;
The device drives of S403: mobile terminal reads the production data letter in the first part of production data stored
Breath, if reading successfully, then returns step S401, if failure, then performs step S404;
S404: confirm that the memorizer of storage production data or memory partition damage, it is impossible to repair, exit production
The renewal process of data;
S405: enter other steps that factory updates;
The device drives of S406: mobile terminal reads the production data letter in the second part of production data stored
Breath, if reading successfully, then returns step S402, if failure, then performs step S404.
Actual when realizing, the number of times (such as: 2 times) again updated can be limited, to avoid endless loop.Alternatively, performing
During step S402 step, if failure, it is possible to directly perform step S404, i.e. confirm memorizer or the memorizer of production data
Subregion damages, exits the more new technological process of production data, is no longer updated.
Based on same inventive concept, the embodiment of the present invention additionally provides a kind of mobile terminal and processes production data
Device, owing to the method processing production data realizing the principle embodiment of the present invention of this mobile terminal is similar, therefore should
The enforcement of mobile terminal may refer to the enforcement of method, repeats no more in place of repetition.
The structural representation of the device processing production data that Fig. 5 provides for the embodiment of the present invention.This device is concrete
Including:
Upper layer application 501, for reading the production data message in first part of production data;
Device drives 502, loses for the production data message in upper layer application 501 reads first part of production data
After losing, read the production data message in second part of production data, afterwards, first part of production data is replaced
It is second part of production data.
Further, in the device processing production data that the embodiment of the present invention provides, second part of production number
According to only being read and write by device drives.
Further, as shown in Figure 6A, the device processing production data that the embodiment of the present invention provides also includes: the
One memorizer 601, wherein, first memory 601 includes subregion BCK1 and subregion BCK2, and subregion BCK1 is for first part of product of storage
Product creation data, subregion BCK2 is for second part of production data of storage.
Or, as shown in Figure 6B, the device processing production data that the embodiment of the present invention provides also includes: second deposits
Reservoir 602 and the 3rd memorizer 603, wherein, second memory 602 is for first part of production data of storage, the 3rd storage
Device 603 is for second part of production data of storage.
Those skilled in the art are it should be appreciated that embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the reality in terms of the present invention can use complete hardware embodiment, complete software implementation or combine software and hardware
Execute the form of example.And, the present invention can use at one or more computers wherein including computer usable program code
The upper computer program product implemented of usable storage medium (including but not limited to disk memory, CD-ROM, optical memory etc.)
The form of product.
The present invention is with reference to method, equipment (system) and the flow process of computer program according to embodiments of the present invention
Figure and/or block diagram describe.It should be understood that can the most first-class by computer program instructions flowchart and/or block diagram
Flow process in journey and/or square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
Instruction arrives the processor of general purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce
A raw machine so that the instruction performed by the processor of computer or other programmable data processing device is produced for real
The device of the function specified in one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame now.
These computer program instructions may be alternatively stored in and computer or other programmable data processing device can be guided with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in this computer-readable memory produces and includes referring to
Make the manufacture of device, this command device realize at one flow process of flow chart or multiple flow process and/or one square frame of block diagram or
The function specified in multiple square frames.
These computer program instructions also can be loaded in computer or other programmable data processing device so that at meter
Perform sequence of operations step on calculation machine or other programmable devices to produce computer implemented process, thus at computer or
The instruction performed on other programmable devices provides for realizing at one flow process of flow chart or multiple flow process and/or block diagram one
The step of the function specified in individual square frame or multiple square frame.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then can make other change and amendment to these embodiments.So, claims are intended to be construed to include excellent
Select embodiment and fall into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and the modification essence without deviating from the present invention to the present invention
God and scope.So, if these amendments of the present invention and modification belong to the scope of the claims in the present invention and equivalent technologies thereof
Within, then the present invention is also intended to comprise these change and modification.