WO2016000166A1 - 一种数据处理方法及智能终端 - Google Patents

一种数据处理方法及智能终端 Download PDF

Info

Publication number
WO2016000166A1
WO2016000166A1 PCT/CN2014/081253 CN2014081253W WO2016000166A1 WO 2016000166 A1 WO2016000166 A1 WO 2016000166A1 CN 2014081253 W CN2014081253 W CN 2014081253W WO 2016000166 A1 WO2016000166 A1 WO 2016000166A1
Authority
WO
WIPO (PCT)
Prior art keywords
partition
write
write protection
multimedia card
embedded multimedia
Prior art date
Application number
PCT/CN2014/081253
Other languages
English (en)
French (fr)
Inventor
李志刚
施国军
赵迎春
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2014/081253 priority Critical patent/WO2016000166A1/zh
Priority to CN201480036342.7A priority patent/CN105637521B/zh
Priority to US15/322,298 priority patent/US10235048B2/en
Publication of WO2016000166A1 publication Critical patent/WO2016000166A1/zh

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1416Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights
    • G06F12/1425Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block
    • G06F12/1441Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block for a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/79Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in semiconductor storage media, e.g. directly-addressable memories
    • 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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • 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/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • 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/068Hybrid storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1052Security improvement

Definitions

  • the present invention relates to the field of computer data processing, and in particular, to a data processing method and an intelligent terminal.
  • eMMC embedded Multi Media Card
  • MMC Multi Media Card
  • flash memory main controller
  • main controller main controller
  • Smart terminals such as mobile phones and tablets.
  • DRM Data Rights Management
  • the Widevine software is installed on the smart terminal of Android system, and the data in the eMMC is encrypted by Widevine software to prevent the data in the eMMC from being abnormally rewritten.
  • Windvine is essentially a software-only encryption technology that only increases the difficulty of rewriting data in eMMC.
  • hackers or enthusiasts can crack Windvine passwords to rewrite data, or use smart terminal preset applications. Modify and so on. Therefore, abnormally rewriting the data of the embedded multimedia card after the illegal root may cause the system of the intelligent terminal to be unstable.
  • the embodiments of the present invention provide a data processing method and an intelligent terminal, which can effectively solve the problem that the read-only partition data of the embedded multimedia card is abnormally rewritten under the premise that the normal upgrade is not affected.
  • a data processing method is provided, which is applied to an embedded multimedia card, where the embedded multimedia card includes a read-only partition, and the method includes: Receiving a write protection cancel command sent by the central processing unit;
  • the write protection command is executed on the designated partition.
  • the method before the receiving a write protection cancel command sent by the central processing unit, the method further includes:
  • a write protection command sent by the central processor is performed on the read-only partition that requires write protection.
  • the write protection cancellation command includes a physical address and a length of executing the write protection cancel command on the designated partition
  • the write protection command includes a physical address and a length of executing the write protection command to the designated partition
  • the physical address is a physical address that needs to be written into the embedded multimedia card.
  • a data processing method for use in a central processing unit, the method comprising:
  • the embedded multimedia card includes a read-only partition in a write protection state
  • the method before the sending a write protection cancel command to the embedded multimedia card, the method further includes: at least one upgrade file and a logical address of each of the upgrade files;
  • the upgrade file is required to be written into the physical address of the embedded multimedia card according to the upgrade file address.
  • the method further includes: according to the logical address of the upgrade file, Query a correspondence between a preset logical address and a read-only partition;
  • the write protection cancel command includes the physical address and a length of executing the write protection cancel command on the specified partition, where the write protection command includes The physical address and a length of the write protection command performed on the designated partition.
  • the method further includes: checking whether the power failure protection identifier is an abnormal power failure identifier;
  • the power-down protection identifier is an abnormal power-down identifier, obtaining a physical address corresponding to a logical address of the read-only partition of the embedded multimedia card that needs to be write-protected;
  • the write protection command including the physical address and a length of performing a write protection command on the read-only partition.
  • the first achievable manner to the fourth achievable manner, in the fifth achievable manner, after the sending a write protection command to the embedded multimedia card also includes:
  • Reading read-only status attribute control information of all partitions of the embedded multimedia card where the read-only status attribute control information includes a partition number, a partition write protection attribute, a partition start write protection status, and a partition current write protection status;
  • the partition corresponding to the partition number is a write-protected partition, read the partition corresponding to the partition number from the read-only state attribute control information to the next boot-on write protection state.
  • the sixth implementation manner after the partition corresponding to the partition number is read from the read-only state, the next boot-on write protection state is read.
  • the method further includes:
  • partition corresponding to the partition number is in the write protection state, determine whether the partition corresponding to the partition number is a write protection partition
  • partition corresponding to the partition number is not a write-protected partition, set the partition as a write-protected partition;
  • partition corresponding to the partition number is a write-protected partition, update the partition to be currently written. Protection status.
  • the seventh implementation manner after the partition corresponding to the partition number is read from the read-only state, the next boot-on write protection state is read.
  • the method further includes:
  • partition corresponding to the partition number is not in the write protection state, determine whether the partition corresponding to the partition number is a write protection partition
  • partition corresponding to the partition number is a write-protected partition, cancel write protection on the partition;
  • the current write protection state of the partition is updated.
  • an embedded multimedia card is provided, where the embedded multimedia card includes a read-only partition, and the embedded multimedia card includes:
  • a first receiving unit configured to receive a write protection cancel command sent by the central processing unit, where the first execution unit is configured to execute the write protection cancel command on the specified partition for storing the upgrade file in the read-only partition;
  • a second receiving unit configured to receive the upgrade file sent by the central processing unit
  • a writing unit configured to write the upgrade file into the specified partition
  • a sending unit configured to send a write completion message to the central processor after the upgrade file is written
  • the embedded multimedia card further includes: And a third execution unit, configured to execute a write protection command sent by the central processing unit to the read-only partition that needs write protection.
  • the write protection cancellation command includes a physical address and a length of executing the write protection cancel command on the designated partition
  • the write protection command includes a physical address and a length of executing the write protection command to the designated partition
  • the physical address is a physical address that needs to be written into the embedded multimedia card.
  • a central processing unit including:
  • a first sending unit configured to send a write protection cancel command to the embedded multimedia card, where the embedded multimedia card includes a read-only partition in a write protection state;
  • a second sending unit configured to send an upgrade file to the embedded multimedia card
  • a receiving unit configured to receive a write completion message sent by the embedded multimedia card, where the write completion message includes logic of the upgrade file An address, the write completion message is a message that the embedded multimedia card successfully writes the upgrade file to a specified partition of the upgrade file;
  • the central processing unit further includes: the upgrade data packet includes at least one upgrade file and a logical address of each of the upgrade files;
  • a first querying unit configured to query, according to a logical address of the upgrade file, a correspondence between a preset logical address and a read-only partition
  • a second acquiring unit configured to acquire a specified partition of the upgrade file
  • a first determining unit configured to determine whether the designated partition of the upgrade file is a write protection partition
  • a second query unit configured to: if the specified partition of the upgrade file is a write protection score And the physical address corresponding to the logical address of the upgrade file is queried according to the logical address of the upgrade file, where the physical address is a physical address that needs to be written into the embedded multimedia card.
  • the central processor further includes:
  • a third query unit configured to query, according to the logical address of the upgrade file, a correspondence between a preset logical address and a read-only partition
  • a third obtaining unit configured to acquire a specified partition of the upgrade file
  • a second determining unit configured to determine whether the specified partition of the upgrade file is a write protected partition
  • a fourth query unit configured to: if the specified partition of the upgrade file is a write-protected partition, query a physical address corresponding to the logical address of the upgrade file according to the logical address of the upgrade file.
  • the write protection cancel command includes the physical address and performing on the specified partition
  • the write protection cancel command has a length
  • the write protection command includes the physical address and a length of executing the write protection command to the designated partition.
  • the central processor further includes:
  • the checking unit is configured to check whether the power-down protection identifier is an abnormal power-down identifier
  • the fourth acquiring unit is configured to: if the power-down protection identifier is an abnormal power-down identifier, obtain the embedded multimedia card that needs to be write-protected only Read the physical address corresponding to the logical address of the partition;
  • a fourth sending unit configured to send a write protection command to the embedded multimedia card, where the write protection command includes the physical address and a length of performing a write protection command on the read-only partition.
  • the central processing unit further includes:
  • a first reading unit configured to read read-only status attribute control information of all partitions of the embedded multimedia card, where the read-only status attribute control information includes a partition number, a partition write protection attribute, and a partition start write protection The state and the partition are currently in a write-protected state;
  • the third determining unit is configured to determine, according to the partition number, whether the partition corresponding to the partition number is a write-protected partition;
  • a second reading unit configured to: if the partition corresponding to the partition number is a write-protected partition, read the partition corresponding to the partition number from the read-only status of the control information to be next write-on protection status.
  • the central processor further includes:
  • a fourth determining unit configured to determine whether a partition corresponding to the partition number is in a write protection state in a next boot write protection state
  • the fourth determining unit is further configured to: if the partition corresponding to the partition number is in a write-protected state, determine whether the partition corresponding to the partition number is a write-protected partition;
  • a setting unit configured to set the partition as a write-protected partition if the partition corresponding to the partition number is not a write-protected partition
  • a first updating unit configured to update a current write protection state of the partition to a write protection state
  • the first update unit is further configured to update a current write protection state of the partition if the partition corresponding to the partition number is a write protection partition.
  • the central processor further includes:
  • the fourth determining unit is further configured to determine whether the next boot-protected state of the partition corresponding to the partition number is a write-protected state; The fourth determining unit is further configured to: if the partition corresponding to the partition number is next, the write protection state is not a write protection state, and determine whether the partition corresponding to the partition number is a write protection partition;
  • a canceling unit configured to cancel write protection on the partition if the partition corresponding to the partition number is a write-protected partition
  • a second update unit configured to update a current write protection state of the partition
  • the second update unit is further configured to update a current write protection state of the partition if the partition corresponding to the partition number is not a write protection partition.
  • a fifth aspect provides an intelligent terminal, comprising: any of the above embedded multimedia cards, any of the above described central processors.
  • an embedded multimedia card where the embedded multimedia card includes a read-only partition, and the embedded multimedia card includes:
  • a receiver configured to receive a write protection cancel command sent by the central processing unit;
  • a memory configured to store the program code;
  • the program code for invoking the memory storage performs the following method: executing the write protection cancel command on a specified partition in the read-only partition for storing an upgrade file;
  • the receiver is further configured to receive the upgrade file sent by the central processor; the method performed by the processor further includes: writing the upgrade file to the specified partition;
  • the receiver is further configured to receive a write protection command sent by the central processor; the method performed by the processor further includes: executing the write protection command on the designated partition.
  • the method performed by the processor further includes: performing, by the central processing unit, the read-only partition that needs write protection Write protection command.
  • the write protection cancellation command includes a physical address and a length of executing the write protection cancel command on the specified partition
  • the write protection command includes a physical address and a length of executing the write protection command to the designated partition
  • the physical address is a physical address that needs to be written into the embedded multimedia card.
  • a central processing unit including:
  • a transmitter configured to send a write protection cancel command to the embedded multimedia card, where the embedded multimedia card includes a read-only partition in a write protection state;
  • the transmitter is further configured to send an upgrade file to the embedded multimedia card;
  • a receiver configured to receive a write completion message sent by the embedded multimedia card, where the write completion message includes logic of the upgrade file An address, the write completion message is a message that the embedded multimedia card successfully writes the upgrade file to a specified partition of the upgrade file;
  • the transmitter is further configured to send a write protection command to the embedded multimedia card.
  • the central processing unit further includes:
  • a memory for storing program code
  • the program code for invoking the memory storage performs the following method: at least one upgrade file and a logical address of each of the upgrade files;
  • the address is the physical address at which the upgrade file needs to be written to the embedded multimedia card.
  • the method performed by the processor further includes:
  • the write protection cancel command includes the physical address and performs execution on the specified partition
  • the write protection cancel command has a length
  • the write protection command includes the physical address and a length of executing the write protection command to the designated partition.
  • the method performed by the processor further includes:
  • the power-down protection identifier is an abnormal power-down identifier, obtaining a physical address corresponding to a logical address of the read-only partition of the embedded multimedia card that needs to be write-protected;
  • the transmitter is further configured to send a write protection command to the embedded multimedia card, the write protection command including the physical address and a length of performing a write protection command on the read-only partition.
  • the method performed by the processor further includes: reading the embedded multimedia card Read-only status attribute control information for all partitions, the read-only status attribute control information including partition number, partition write protection attribute, minute The next time the zone is booted, the write protection state and the current write protection state of the partition;
  • the partition corresponding to the partition number is a write-protected partition, read the partition corresponding to the partition number from the read-only state attribute control information to the next boot-on write protection state.
  • the method performed by the processor further includes:
  • partition corresponding to the partition number is in the write protection state, determine whether the partition corresponding to the partition number is a write protection partition
  • partition corresponding to the partition number is not a write-protected partition, set the partition as a write-protected partition;
  • the current write protection state of the partition is updated.
  • the method performed by the processor further includes:
  • partition corresponding to the partition number is not in the write protection state, determine whether the partition corresponding to the partition number is a write protection partition
  • partition corresponding to the partition number is a write-protected partition, cancel write protection on the partition;
  • the eighth aspect provides a smart terminal, comprising: the embedded multimedia card of any of the above, the central processor of any of the above.
  • Embodiments of the present invention provide a data processing method and an intelligent terminal.
  • the embedded multimedia card of the smart terminal performs a write protection cancel command on the designated partition of the upgrade file, and then the embedded multimedia card upgrades the file.
  • Writing to the designated partition, the embedded multimedia card performs a write protection command on the specified partition, and the embedded multimedia card can be effectively solved under the premise that the normal upgrade is not affected, compared with the prior art. Specifies that the partition data is abnormally overwritten.
  • FIG. 1 is a flowchart of a data processing method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another data processing method according to an embodiment of the present invention
  • FIG. 3 is a flowchart of still another data processing method according to an embodiment of the present invention
  • FIG. 4 is a flowchart of still another data processing method according to an embodiment of the present invention
  • FIG. 5 is a flowchart of still another data processing method according to an embodiment of the present invention
  • FIG. 6 is a flowchart of still another data processing method according to an embodiment of the present invention
  • FIG. 7 is still another data according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of an embedded multimedia card according to an embodiment of the present invention
  • FIG. 9 is a schematic structural diagram of another embedded multimedia card according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a central processing unit according to an embodiment of the present invention
  • FIG. 1 is a schematic structural diagram of another central processing unit according to an embodiment of the present invention
  • FIG. 12 is a schematic structural diagram of still another embedded multimedia card according to an embodiment of the present invention
  • FIG. 13 is a schematic structural diagram of another central processing unit according to an embodiment of the present invention
  • FIG. 14 is a schematic structural diagram of another central processing unit according to an embodiment of the present invention
  • FIG. 15 is a schematic diagram of an intelligent terminal according to an embodiment of the present invention.
  • partition mounted partition, etc.
  • these designated partitions, mounted partitions should not be limited to these terms. These terms are only used to distinguish different areas in a read-only partition.
  • the specified partition can be a system partition, a super block, etc. in the Android system.
  • the word “if” as used herein may be interpreted as “at time” or “when” or “in response to determination”, “in response to judgment” or “in response to detection” .
  • the phrase “if determined”, “if judged” or “if detected (conditions or events stated)” can be interpreted as “when determined” or “in response to determination” or “when detected” ( When a condition or event is stated, “,” when judged (condition or event of the statement) “or” in response to the test (condition or thing stated) Pieces)".
  • the smart terminal is provided with an embedded multimedia card (eMMC), and the embedded multimedia card has a write protection function, and the embedded multimedia card has permanent write protection, power-on write protection and temporary write protection, wherein, the permanent write protection It can only be set once. After successful setting, it cannot be canceled.
  • the power-on write protection needs to be reset every time the power is turned on. If the power is off, the write protection function is invalid.
  • the temporary write protection is enabled by the command to enable the write protection function or cancel the write protection function. After still valid, only write protection is cancelled by command.
  • the EMMC Embedded Multi Media Card protocol specifies control commands such as write-protection and write-protection.
  • the eMMC has different partitions, and the partition may be a read-only partition or a readable and writable partition.
  • the partition table of the smart terminal records the partition of the eMMC.
  • a read-only partition can be a system boot loader (BootLoader) partition or a system (System) partition, and a read-only partition stores a system program or a preset application.
  • the readable and writable partition can be a User data partition or a U-disk partition.
  • the data of the read-only partition of the smart terminal may be allowed to be overwritten, and in any other case, the rewriting is considered to be an abnormal rewriting, and the data of the read-only partition is After abnormal rewriting, some functions of the intelligent terminal may be abnormal, the intelligent terminal cannot be started, or data is lost.
  • the invention uses the temporary write protection function of the embedded multimedia card to write-protect the read-only partition of the embedded multimedia card.
  • An embodiment of the present invention provides a data processing method, which is applied to an embedded multimedia card, where the embedded multimedia card includes a read-only partition. As shown in FIG. 1, the method includes:
  • Step 101 The embedded multimedia card receives a write protection cancel command sent by a central processing unit.
  • Step 102 The embedded multimedia card executes the write protection cancel command on a specified partition of the read-only partition for storing an upgrade file.
  • Step 103 The embedded multimedia card receives the upgrade file sent by the central processing unit.
  • Step 104 The embedded multimedia card writes the upgrade file into the specified partition.
  • Step 105 After the upgrade file of the embedded multimedia card is written, send a write completion message to the central processor.
  • Step 106 The embedded multimedia card receives a write protection command sent by the central processing unit.
  • Step 107 The embedded multimedia card executes the write protection command on the designated partition.
  • the embedded multimedia card of the smart terminal performs a write protection cancel command on the designated partition of the upgrade file, and then the embedded multimedia card writes the upgrade file to the office.
  • the specified partition, the embedded multimedia card performs a write protection command on the specified partition, and the specified partition data of the embedded multimedia card can be effectively solved under the premise that the normal upgrade is not affected compared with the prior art. Abnormal rewriting problem.
  • the smart terminal includes a central processing unit and an embedded multimedia card
  • the embedded multimedia card includes a read-only partition, and an embedded multimedia card that needs to be write-protected before receiving a write-protection cancel command sent by the central processor.
  • the read-only partition performs a write protection command sent by the central processing unit to prevent abnormally overwriting the data of the read-only partition of the smart terminal, and the range of the read-only partition is equal to the range of the write-protected partition, and the upgrade is obtained in the smart terminal. data pack.
  • the write protection command may be SET_WRITE_PROT, the write protection command may be SEND_WRITE_PROT, and the write protection command may be SEND_WRITE_PROT_TYPE.
  • Class of write protection commands The type is temporary write protection.
  • the write protection cancel command may be
  • the write protection cancel command for the read-only partition can be SEND_WRITE_PROT
  • the write protection cancel command can be SEND_WRITE_PROT_TYPE
  • the write protection cancel command of the present invention The type is temporarily canceled for write protection.
  • the invention uses the temporary write protection function of the embedded multimedia card to write-protect the read-only partition of the embedded multimedia card.
  • the embodiment of the present invention provides a data processing method, which is applied to a central processing unit. As shown in FIG. 2, the method includes:
  • Step 201 The central processor sends a write protection cancel command to the embedded multimedia card, where the embedded multimedia card includes a read-only partition in a write protection state.
  • Step 202 The central processor sends an upgrade file to the embedded multimedia card.
  • Step 203 The central processor receives a write completion message sent by the embedded multimedia card, where the write completion message includes a logical address of the upgrade file, and the write completion message is the embedded multimedia card.
  • the upgrade file is successfully written to the message of the specified partition of the upgrade file.
  • Step 204 The central processor sends a write protection command to the embedded multimedia card.
  • the write protection cancel command is sent to the embedded multimedia card, and the file is upgraded, so that the embedded multimedia card of the smart terminal performs writing on the specified partition of the upgrade file.
  • Protecting the cancel command, and writing the upgrade file to the designated partition after receiving the write completion message sent by the embedded multimedia card, sending a write protection command to the embedded multimedia card to re-assign the designated partition Write protection, as opposed to the prior art, in the normal upgrade Under the premise of being unaffected, it can effectively solve the problem that the specified partition data of the embedded multimedia card is abnormally rewritten.
  • the purpose of the embodiment of the present invention is to control the write protection of the read-only partition in the embedded multimedia card that needs to be write-protected during the system upgrade process.
  • the purpose of the embodiment of the present invention is that the smart terminal is abnormal during the upgrade process. After the smart terminal is started again, the embedded multimedia card of the smart terminal re-upgrades the read-only partition in the embedded multimedia card that needs to be write-protected, but the read-only partition has no write protection, and the smart terminal re-attends the After the read-only partition write protection, the read-only partition that needs to be write-protected in the embedded multimedia card is upgraded.
  • the embodiment of the invention provides a data processing method, which is applied to a central processing unit and an embedded multimedia card. As shown in FIG. 3, the method includes:
  • Step 301 The central processor checks whether the power-down protection identifier is an abnormal power-down identifier.
  • step 305 If the power failure protection indicator is not an abnormal power failure identifier, go to step 305.
  • the power-down protection flag is 0, it indicates that it is not an abnormal power-down flag; if the power-down protection flag is 1, it can indicate an abnormal power-down flag.
  • the user can press the power button of the smart terminal for 1 - 3 seconds to enable the smart terminal to start up. Then, when the smart terminal detects that there is an upgrade data packet, the smart terminal checks whether the power failure protection identifier is an abnormal power failure identifier.
  • the smart terminal checks that the power-down protection identifier is an abnormal power-down identifier, it may be because the smart terminal is running an upgrade data package or the like when the smart terminal is powered on before the current power-on state. For example, the smart terminal is upgrading the system version. If the intelligent terminal suddenly loses power, the power-down protection indicator is updated to an abnormal power-down identifier.
  • Step 302 The central processor acquires a physical address corresponding to a logical address of a read-only partition of the embedded multimedia card that needs to be write protected.
  • the central processing unit stores a partition table of the embedded multimedia card, wherein the partition table records a correspondence between a partition of the embedded multimedia card and a logical address of the partition, and the embedded address corresponding to the logical address is embedded
  • the correspondence between the physical addresses of the multimedia cards For example, if the partition of the embedded multimedia card stores the system program of the smart terminal or the system boot loader, the partition may be regarded as a read-only partition.
  • the read-only partition may be a system partition or a system boot loader.
  • the partition of the embedded multimedia card stores the user data of the smart terminal
  • the partition can be regarded as a readable and writable partition, for example, the readable and writable partition can be a user data partition or U disk ( U-disk ) partition.
  • the central processor can obtain the logical address of the read-only partition of the embedded multimedia card that needs to be write-protected, and obtain the physical address corresponding to the logical address according to the logical address.
  • the central processing unit obtains the logical address, and the physical address is obtained according to the logical address. The present invention is not described herein.
  • Step 303 The central processor sends a write protection command to the embedded multimedia card.
  • the write protection command includes the physical address corresponding to the logical address of the read-only partition of the embedded multimedia card that needs to be write-protected by the central processing unit, the length of the write-protected command to the read-only partition, and the type of the write-protected command.
  • the write protection command may be SET_WRITE_PROT, the write protection command may be SEND_WRITE_PROT, and the write protection command may be SEND_WRITE_PROT_TYPE.
  • the type of write protection command is temporary write protection.
  • Step 304 The embedded multimedia card writes and protects the read-only partition of the embedded multimedia card that needs to be write protected according to a write protection command sent by the central processing unit.
  • the embedded multimedia card includes a controller, and the controller of the embedded multimedia card searches for a read-only partition corresponding to the physical address according to the physical address, and the embedded multimedia card needs write protection according to a write protection command sent by the central processing unit.
  • Read-only partition write protection of the embedded multimedia card when the central processor of the smart terminal checks that the power-down protection identifier is an abnormal power-down identifier, the embedded multimedia card resets the embedded multimedia card that needs to be write-protected according to a write-protection command sent by the central processing unit.
  • Read-only partition write protection thereby effectively avoiding the read-only partition of the embedded multimedia card requiring write protection from abnormally overwriting the data of the read-only partition when there is no write protection.
  • Step 305 The central processor checks the upgrade data packet.
  • the central processor reads the CRC (Cyclic Redundancy Check) data from the upgrade packet, checks the CRC data, reads the MD5 data, verifies the MD5 data, and reads the platform code (school code). Check the platform code, read the upgrade package version information, verify the upgrade package version information, and so on.
  • CRC Cyclic Redundancy Check
  • the CRC data, the MD5 data, the platform code, and the upgrade packet version information in the upgrade data packet of the CPU are all prior art, and the present invention will not go into details.
  • Step 306 The central processor obtains a logical address of the upgrade image file in the upgrade data packet.
  • the central processor obtains the logical address of the upgrade image file in the upgrade packet from the upgrade packet.
  • the upgrade data packet includes at least one upgrade image file, a logical address of each of the upgrade image files, a file name of each of the upgrade image files, and a version number of each of the upgrade image files.
  • the image file can be similar to a ZIP archive, that is, a specific series of files can be made into a single file in a certain format for the user to download and use, such as a beta version of the operating system or game.
  • Step 307 The central processor searches for a correspondence between the preset logical address and the read-only partition according to the logical address of the upgrade image file, and obtains a partition corresponding to the logical address of the upgrade image file.
  • the central processor stores a correspondence between all preset logical addresses of the embedded multimedia card and the read-only partition, and the central processor first performs the logic according to the upgrade image file. Comparing the address with all preset logical addresses of the embedded multimedia card stored by the central processing unit to obtain a preset logical address equal to the logical address of the upgraded image file, and then, according to the preset logical address Corresponding relationship with the read-only partition is obtained by partitioning the embedded multimedia card, that is, the partition is a partition corresponding to the logical address of the upgrade image file.
  • Step 308 The central processor determines whether the partition corresponding to the logical address of the upgrade image file is a write-protected partition.
  • step 309 is performed.
  • step 3012 If the partition corresponding to the logical address of the upgrade image file is not a write-protected partition, go to step 3012.
  • the central processor may determine, according to the partition number of the partition corresponding to the logical address of the upgrade image file, whether the partition is a partition that needs to be write-protected, and determine, according to the partition number of the partition corresponding to the logical address of the upgrade image file, The partition is a partition that needs to be write-protected. It is determined whether the partition corresponding to the logical address of the upgrade image file is write-protected, that is, the central processor determines whether the partition corresponding to the logical address of the upgrade image file is a write-protected partition.
  • the partition corresponding to the logical address of the upgrade image file may be the entire read-only partition of the embedded multimedia card.
  • Step 309 The central processor queries the physical address corresponding to the logical address of the upgrade image file according to the logical address of the upgrade image file.
  • the central processor stores a physical address corresponding to the logical address of the upgrade image file, and the central processor queries the physical address corresponding to the logical address of the upgraded mirror file according to the logical address of the upgrade image file.
  • the physical address is a physical address at which the upgraded image file needs to be written to the embedded multimedia card. It should be noted that the physical address query based on the logical address in the present invention is a prior art, and the present invention is not described herein again.
  • Step 3010 The central processor sends a write protection to the embedded multimedia card. The command and the upgrade image file.
  • the write protection cancel command includes the physical address of the upgrade image file written to the embedded multimedia card, the length of the write protection cancel command for the read-only partition, and the type of the write protection cancel command.
  • the write protection cancel command may be CLR_WRITE_PROT, and the length of the write protection cancel command for the read-only partition may be SEND_WRITE_PROT, and the type of the write protection cancel command may be SEND_WRITE_PROT_TYPE,
  • the type of write protection cancel command of the invention is temporary cancellation write protection.
  • Step 301 The embedded multimedia card cancels write protection to the partition corresponding to the logical address of the upgrade image file according to the write protection cancel command sent by the central processing unit.
  • Step 3012 The embedded multimedia card writes the data in the upgrade image file to a partition corresponding to the logical address of the upgrade image file.
  • Step 3013 The embedded multimedia card sends a write completion message to the central processing unit.
  • the write completion message includes a logical address of the upgrade image file, and the write completion message is that the embedded multimedia card successfully writes the data in the upgrade image file to the partition corresponding to the logical address of the upgrade image file. Eliminate, .
  • Step 3014 The central processor queries, according to the logical address of the upgrade image file, a correspondence between a preset logical address and a read-only partition, and obtains a partition corresponding to the logical address of the upgraded mirror file.
  • the central processor stores a correspondence between all preset logical addresses of the embedded multimedia card and the read-only partition, and the central processor firstly performs the embedded multimedia card according to the logical address of the upgraded image file and the central processor. Comparing all the preset logical addresses to obtain a preset logical address equal to the logical address of the upgrade image file, and then, according to the correspondence between the preset logical address and the read-only partition Obtaining a partition of the embedded multimedia card, that is, the partition is a partition corresponding to a logical address of the upgrade image file.
  • Step 3015 The central processor determines whether the partition corresponding to the logical address of the upgrade image file is a write-protected partition.
  • step 3016 If the partition corresponding to the logical address of the upgrade image file is a write-protected partition, go to step 3016.
  • step 3019 If the partition corresponding to the logical address of the upgrade image file is not a write-protected partition, go to step 3019.
  • the central processor may determine, according to the partition number of the partition corresponding to the logical address of the upgrade image file, whether the partition is a partition that needs to be write-protected, and determine, according to the partition number of the partition corresponding to the logical address of the upgrade image file, The partition is a partition that needs to be write-protected. It is determined whether the partition corresponding to the logical address of the upgrade image file is write-protected, that is, the central processor determines whether the partition corresponding to the logical address of the upgrade image file is a write-protected partition.
  • Step 3016 The central processor searches for a physical address corresponding to the logical address of the upgrade image file according to the logical address of the upgrade image file.
  • the central processor stores a physical address corresponding to the logical address of the upgrade image file, and the central processor queries the physical address corresponding to the logical address of the upgraded mirror file according to the logical address of the upgrade image file.
  • Step 3017 The central processor sends a write protection command to the embedded multimedia card.
  • the write protection command includes a physical address corresponding to a logical address of the upgrade image file, a length of a write protection command to the read-only partition, and a type of a write protection command.
  • the write protection command may be SET_WRITE_PROT, the write protection command may be SEND_WRITE_PROT, and the write protection command may be SEND_WRITE_PROT_TYPE.
  • the type of write protection command is temporary write protection.
  • Step 3018 The embedded multimedia card writes and protects the partition corresponding to the logical address of the upgrade image file according to the write protection command sent by the central processing unit.
  • Step 3019 The central processor upgrades the partition corresponding to the logical address of the upgrade image file.
  • the smart terminal can simultaneously upgrade multiple designated partitions of the embedded multimedia card, and each designated partition is independently upgraded, and the smart terminal can dynamically set the write protection control according to the position and size of the specified partition of the embedded multimedia card. range.
  • the central processing unit of the intelligent terminal sends a write protection command to the embedded multimedia card, and the embedded multimedia card writes and protects the read-only partition of the embedded multimedia card in advance, and then the smart terminal is upgraded.
  • the central processing unit of the intelligent terminal sends a write protection cancel command to the embedded multimedia card, and the embedded multimedia card only applies to the embedded multimedia card.
  • the read partition cancels the write protection, rewrites the data of the read-only partition of the embedded multimedia card, and further, the central processor of the intelligent terminal sends a write protection command to the embedded multimedia card, and the read-only partition of the embedded embedded multimedia card Rewriting protection, compared with the prior art, can effectively solve the problem that the eMMC read-only partition data is abnormally rewritten under the premise that the normal upgrade is not affected.
  • the purpose of the embodiment of the present invention is that the smart terminal is in the super user right (root) state, and when the smart terminal upgrades the designated partition that needs to be write-protected in the embedded multimedia card, the designated partition that needs to be write-protected in the embedded multimedia card is performed.
  • Write protection control the designated partition may be part of an entire read-only partition or a read-only partition.
  • the embodiment of the present invention provides a data processing method, which is applied to a central processing unit and an embedded multimedia card (eMMC).
  • the embedded multimedia card is provided with a read-only partition, as shown in FIG. 5, and includes:
  • Step 401 The central processor acquires a digital rights management password. Users can obtain digital rights management from the Internet through smart terminals
  • Step 402 The central processor determines whether the digital rights management password is equal to a preset digital copyright management password.
  • the central processor stores a preset digital rights management (Widevine) password. If the digital rights management (Widevine) password is equal to the preset digital rights management (Widevine) password, and the Widevine password is unlocked from the smart terminal, the smart terminal is In the superuser privilege (root) state, go to step 403.
  • Widevine digital rights management
  • Step 403 The central processor sets a brush flag.
  • the central processor can allow data rewriting of partitions of the system (System) partition, data of the Recovery mode partition, data of the Cust partition, etc. After the correct Widevine password is entered by fastboot, the flashing flag is set.
  • the brush machine is a terminology for smart terminals. It refers to changing or replacing some languages, pictures, ring tones, software or operating systems that exist in the intelligent terminal through certain methods, that is, reinstalling the system for the smart terminal, Appropriate deletion of some programs or files may cause some functions of the smart terminal to be abnormal, or even fail to start normally. Therefore, when the smart terminal is not in the super user right (root) state, after the smart terminal is flashed, the terminal manufacturer no longer wants to brush the user. Warranty service is available.
  • Step 404 The central processor acquires a logical address of the upgrade file in the upgrade data package.
  • the upgrade data package includes at least one upgrade file, a logical address of each of the upgrade files, a file name of each of the upgrade files, and a version number of each of the upgrade files.
  • Step 405 The central processor queries, according to the logical address of the upgrade file, the correspondence between the preset logical address and the read-only partition, and obtains the logic of the upgrade file.
  • the partition corresponding to the address is the partition corresponding to the address.
  • the central processor stores a correspondence between all preset logical addresses of the embedded multimedia card and the read-only partition, and the central processor firstly stores all the embedded multimedia cards according to the logical address of the upgrade file and the central processing unit.
  • the preset logical address is compared to obtain a preset logical address equal to the logical address of the upgrade file, and then, according to the correspondence between the preset logical address and the read-only partition, the embedded multimedia card is obtained.
  • a partition that is, the partition is a partition corresponding to a logical address of the upgrade file.
  • Step 406 The central processor determines whether the system partition is a write protection partition.
  • step 4010 If the system partition is not a write protected partition, go to step 4010.
  • the central processor may determine, according to the partition number of the system partition, whether the partition is a partition that needs to be write-protected. If the partition is determined to be a partition that needs to be write-protected according to the partition number of the system partition, determine whether the system partition has been written. Protection, that is, the central processor determines whether the system partition is a write-protected partition.
  • Step 407 The central processor queries the physical address of the system partition according to the logical address of the system partition.
  • the central processor stores a correspondence between the logical address of the system partition and the system partition, and the central processor queries the physical address of the system partition according to the logical address of the system partition.
  • Step 408 The central processor sends a write protection cancel command and an upgrade file to the embedded multimedia card.
  • the write protection cancel command includes a physical address of a system partition of the embedded multimedia card, a length of a write protection cancel command for the system partition, and a type of a write protection cancel command.
  • the write protection cancel command may be CLR_WRITE_PROT, partitioning the system
  • the length of the write protection cancel command may be SEND_WRITE_PROT
  • the type of the write protection cancel command may be SEND_WRITE_PROT_TYPE
  • the type of write protection cancel command described in the present invention is temporary cancel write protection.
  • Step 409 The embedded multimedia card cancels write protection on the system partition according to the write protection cancel command sent by the central processing unit.
  • Step 4010 The embedded multimedia card rewrites the data of the system partition.
  • the embedded multimedia card receives the data transmitted by the central processing unit, rewrites the data of the system partition, and then sends a write completion message to the central processing unit.
  • Step 401 1 The embedded multimedia card sends a write completion message to the central processing unit.
  • the write completion message includes a logical address of a system partition, and the write completion message is a message that the embedded multimedia card successfully writes data in the upgrade file to a system partition.
  • Step 4012 The central processor queries the correspondence between the preset logical address and the read-only partition according to the logical address of the upgrade file to obtain a system partition.
  • the central processor stores a correspondence between all preset logical addresses of the embedded multimedia card and the read-only partition, and the central processor firstly stores all the embedded multimedia cards according to the logical address of the upgrade file and the central processing unit.
  • the preset logical address is compared to obtain a preset logical address equal to the logical address of the upgrade file, and then, according to the correspondence between the preset logical address and the read-only partition, the embedded multimedia card is obtained.
  • the system partition that is, the partition is a partition corresponding to the logical address of the upgrade file.
  • Step 4013 The central processor determines whether the system partition is a write protected partition.
  • step 4014 If the system partition is a write protected partition, go to step 4014.
  • step 4017 The area code determines whether the system partition is a partition that needs to be write-protected. If it is determined that the system partition is a partition that needs to be write-protected according to the partition number of the partition corresponding to the logical address of the upgrade file, it is determined whether the system partition is write-protected. That is, the central processor determines whether the partition corresponding to the logical address of the upgrade file is a write-protected partition.
  • Step 4014 The central processor queries the location according to the logical address of the upgrade file.
  • the central processor queries the physical address corresponding to the logical address of the upgrade file according to the logical address of the upgrade file.
  • Step 4015 The central processor sends a write protection command to the embedded multimedia card. And, the length of the write protection command to the system partition and the type of write protection command.
  • the write protection command may be SET_WRITE_PROT, the length of the write protection command for the system partition may be SEND_WRITE_PROT, and the type of the write protection command may be SEND_WRITE_PROT_TYPE, the present invention
  • the type of write protection command is temporary write protection.
  • Step 4016 The embedded multimedia card writes protection to the system partition according to a write protection command sent by the central processing unit.
  • Step 4017 The central processor upgrades the system partition of the embedded multimedia card.
  • the smart terminal when the smart terminal is in the super user right (root) state, the smart terminal still write protects the bootloader partition, and can allow write protection to the system (System) partition, the engineering mode (Recovery partition), and the Cust partition; 4012 to step 401 6 are optional steps.
  • the central processing unit of the intelligent terminal sends a write protection command to the embedded multimedia card, and the embedded multimedia card is pre-embedded for multiple Read-only partition write protection of the media card.
  • the smart terminal is in the super user right (root) state, and the user can selectively delete, add or modify the read-only partition data of the embedded multimedia card, and the central processing unit of the smart terminal embeds
  • the multimedia card sends a write protection cancel command, and the embedded multimedia card cancels the write protection of the system partition of the embedded multimedia card selected by the user, rewrites the data of the system partition of the embedded multimedia card, and further, the central processor of the intelligent terminal according to the user
  • the requirement is to send a write protection command to the embedded multimedia card, and to rewrite the system partition of the rewritten embedded multimedia card, compared with the prior art, in the state where the smart terminal is in the super user right (root) state, After the write-protected system partition of the multimedia card is canceled, the data of the system partition
  • the purpose of the embodiment of the present invention is to control the write-protected read-only partition of the embedded multimedia card that needs to be write-protected when the file of the read-only partition that needs to be write-protected in the embedded multimedia card of the smart terminal is mounted.
  • the embodiment of the invention provides a data processing method, which is applied to a central processing unit and an embedded multimedia card (eMMC). It is assumed that the intelligent terminal is in a booting state, and the partition of the embedded multimedia card is in a mount state, as shown in the figure.
  • the method includes the following steps: Step 501: The central processor acquires a logical address of a mounted partition of the embedded multimedia card.
  • Step 502 The central processor queries the corresponding relationship between the preset logical address and the read-only partition according to the logical address of the mounted partition, and obtains the mounted partition.
  • the central processor stores a correspondence between all preset logical addresses of the embedded multimedia card and the read-only partition, and the central processor firstly stores the embedded multimedia card according to the logical address of the mounted partition and the central processor. All preset logical addresses are performed Comparing, obtaining a preset logical address equal to the logical address of the mounted partition, and then obtaining a partition of the embedded multimedia card according to the correspondence between the preset logical address and the read-only partition, that is, the The partition is the partition corresponding to the logical address of the mount partition.
  • Step 503 The central processor determines whether the mounted partition is a write protected partition. If the mount partition is a write protected partition, go to step 504.
  • step 508 If the mount partition is not a write protected partition, go to step 508.
  • the central processor may determine, according to the partition number of the mounted partition, whether the partition is a partition that needs to be write-protected. If the partition is determined to be a partition that needs to be write-protected according to the partition number of the mounted partition, determine the mounted partition. Whether the protection has been written, that is, the central processor determines whether the partition corresponding to the logical address of the mounted partition is a write-protected partition.
  • Step 504 The central processor sets a mount start flag.
  • the central processor sets a mount start flag to the mount partition.
  • the mount may be when a file in the storage device is accessed, and the partition where the file is located needs to be mounted to an existing directory of the smart terminal, and then the storage device is accessed by accessing the directory.
  • Step 505 The central processor queries the physical address of the mounted partition according to the logical address of the mounted partition.
  • Step 506 The central processor sends a write protection cancel command to the embedded multimedia card.
  • the write protection cancel command includes a physical address of the mount partition, a length of a write protection cancel command for the mount partition, and a write protection cancel command type.
  • the write protection cancel command may be CLR_WRITE_PROT, and the length of the write protection cancel command for the read-only partition may be SEND_WRITE_PROT, and the type of the write protection cancel command may be SEND_WRITE_PROT_TYPE,
  • the type of write protection cancel command of the invention is temporary cancellation write protection.
  • Step 507 The embedded multimedia card is protected according to write protection sent by the central processing unit.
  • the cancel command cancels write protection for the mounted partition.
  • the controller of the embedded multimedia card cancels write protection on the mounted partition according to the write protection cancel command.
  • Step 508 The embedded multimedia card reads the data of the mounted partition, and updates the Super Block information.
  • Step 509 The embedded multimedia card sends a mount end message to the central processing unit.
  • the mount end message includes a logical address of the mount partition.
  • Step 5010 The central processing unit searches the corresponding relationship between the preset logical address and the read-only partition according to the logical address of the mounted partition, and obtains the mounted partition.
  • the central processor stores a correspondence between all preset logical addresses of the embedded multimedia card and the read-only partition, and the central processor firstly stores the embedded multimedia card according to the logical address of the mounted partition and the central processor. Comparing all the preset logical addresses to obtain a preset logical address equal to the logical address of the mounted partition, and then obtaining embedded multimedia according to the correspondence between the preset logical address and the read-only partition
  • the partition of the card, that is, the partition is the mount partition.
  • Step 501 The central processor determines whether the mounted partition is a write protected partition.
  • step 5012 If the mount partition is a write protected partition, go to step 5012.
  • step 5016 If the mount partition is not a write protected partition, go to step 5016.
  • the central processor may determine, according to the partition number of the mounted partition, whether the partition is a partition that needs to be write-protected. If the partition is determined to be a partition that needs to be write-protected according to the partition number of the mounted partition, determine the mounted partition. Whether the write protection has been written, that is, the central processor determines whether the mount partition is a write protected partition.
  • Step 5012 The central processor queries the physical address corresponding to the logical address of the mount partition according to the logical address of the mount partition.
  • the central processor stores a physical address corresponding to the logical address of the mount partition, and the central processor queries the logic of the mount partition according to the logical address of the mount partition.
  • the physical address corresponding to the address is a physical address corresponding to the address.
  • Step 5013 The central processor sends a write protection command to the embedded multimedia card.
  • the write protection command includes a physical address corresponding to a logical address of the mount partition, a length of a write protection command to the mount partition, and a type of a write protection command.
  • the write protection command may be SET_WRITE_PROT
  • the length of the write protection command for the mount partition may be SEND_WRITE_PROT
  • the write protection command type may be SEND_WRITE_PROT_TYPE, the present invention
  • the type of write protection command is temporary write protection.
  • Step 5014 The embedded multimedia card writes protection to the mounted partition according to a write protection command sent by the central processing unit.
  • Step 5015 The central processor sets a mount end flag of the mount partition.
  • Step 5016 The central processor mounts the partition of the embedded multimedia card to end.
  • the mount start flag and the mount end flag are used to monitor abnormal power failure of the smart terminal.
  • the read-only partition of the embedded multimedia card may also be in a mounted state, and the central processor needs to set the mount flag to the read-only partition of the embedded multimedia card. After the read-only partition of the embedded multimedia card is rewritten, the mount end flag is set, so that if the power-down occurs when the read-only partition of the embedded multimedia card is rewritten, the embedded multimedia card can be based on the mount flag. If the power is abnormally powered off, the read-only partition write protection of the embedded multimedia card that needs to be write-protected may be reset according to a write protection command sent by the central processing unit, thereby effectively avoiding the embedded protection requiring write protection. The read-only partition of the multimedia card abnormally overwrites the data of the read-only partition when there is no write protection.
  • the present invention further includes the method described in Embodiment 5.
  • Embodiment 6 The purpose of the embodiment of the present invention is to record the write protection status of the read-only partition in the embedded multimedia card that needs to be write protected.
  • the embodiment of the invention provides a data processing method, which is applied to a central processing unit and an embedded multimedia card (eMMC). As shown in FIG. 7, the method includes:
  • Step 601 The central processing unit reads read-only status attribute control information of all partitions of the embedded multimedia card.
  • the read-only status attribute control information includes a partition number, a partition write protection attribute, a partition start write protection status, and a partition current write protection status.
  • Read-only status attribute control information can be included in the misc partition.
  • the partition number may be an identifier of a partition of the embedded multimedia card; the partition write protection attribute is used to indicate whether the partition of the embedded multimedia card is write-protected or non-write-protected; and the next boot-on write protection state of the partition is used to indicate the next time of the smart terminal.
  • the partition of the embedded multimedia card is write-protected or non-write-protected at boot time.
  • the partition can be pre-set to write protection status to write-protected state or non-write-protected state.
  • the current write-protected state of the partition indicates that the partition of the current embedded multimedia card is Write protection status or non-write protection status.
  • the read-only status attribute control information for each partition of the intelligent terminal can record the read-only attribute of each partition through the read-only status attribute structure.
  • the definition is as follows:
  • Step 602 The central processor determines, according to the partition number, whether the partition corresponding to the partition number is a write-protected partition.
  • the central processor reads the partition number pair from the read-only state attribute control information
  • the partition write protection attribute should be used to determine whether the partition corresponding to the partition number is a write-protected partition.
  • a write-protected partition can be a read-only partition, such as a System partition, a Recovery partition, or a Cust partition; a write-protected partition can be readable and writable, such as User data partitions and U disk ( U-disk ) partition.
  • Step 603 The central processor reads, from the read-only status attribute control information, a partition-on write protection state of the partition corresponding to the partition number.
  • the user can set the partition to write protection status next time.
  • Step 604 The central processor determines whether the partition corresponding to the partition number is in a write-protected state.
  • the step 605 is performed.
  • Step 605 The central processor determines whether the partition corresponding to the partition number is a write protection partition.
  • the central processor reads the current write protection status of the partition corresponding to the partition number from the read-only status attribute control information, and determines whether the partition corresponding to the partition number is a write protection partition.
  • step 606a is performed; if the partition corresponding to the partition number is a write-protected partition, Go to step 6010.
  • step 6010 is performed; if the partition corresponding to the partition number is a write-protected partition, Step 606b is performed.
  • Step 606a The central processor sends a write protection command to the embedded multimedia card. Go to step 607.
  • the write protection command includes mounting a partition physical address.
  • Step 607 The embedded multimedia card writes and protects the partition corresponding to the partition number according to a write protection command sent by the central processing unit. Go to step 609.
  • Step 606b The central processor sends a write protection cancel command to the embedded multimedia card. Go to step 608.
  • the write protection cancel command includes mounting a partition physical address.
  • Step 608 The embedded multimedia card cancels write protection on the partition corresponding to the partition number according to the write protection cancel command sent by the central processing unit. Go to step 609.
  • Step 609 The embedded multimedia card sends a response message to the central processing unit. Go to step 6010.
  • the embedded multimedia card When the embedded multimedia card writes and protects the partition corresponding to the partition number according to the write protection command sent by the central processor, the embedded multimedia card sends a response message to the central processor, where the response message includes a write protection completion response.
  • the embedded multimedia card When the embedded multimedia card cancels write protection on the partition corresponding to the partition number according to the write protection cancel command sent by the central processor, the embedded multimedia card sends a response message to the central processor, where the response message includes canceling write protection. response.
  • Step 6010 The central processor updates a current write protection state of the partition. Go to step 601 1.
  • the central processor updates the current write protection state of the partition to a write protection state.
  • the central processor updates the current write protection state of the partition to a non-write protection state.
  • Step 601 The central processor verifies the end of the partition of the embedded multimedia card.
  • the data processing method monitors the write protection status of all partitions of the embedded multimedia card by setting read-only status attribute control information of all partitions of the embedded multimedia card, and re-embeds each time in the smart terminal. After the data of the partition of the multimedia card is updated, the current write protection state of the partition of the partition is updated, compared to the prior art. Enables the write protection function of the embedded multimedia card, writes and protects the embedded multimedia card, and monitors the write protection status of all the partitions of the embedded multimedia card in real time, which can effectively prevent the partition of the embedded multimedia card from being abnormally rewritten. data.
  • the embedded multimedia card cancels the write protection of the partition according to the write protection cancel command, including:
  • the intelligent terminal is in the super user right (root) state
  • the embedded multimedia card write protection partition according to the write protection command includes:
  • the burned version of the smart terminal starts normally
  • the upgraded version of the smart terminal starts normally
  • the intelligent terminal enables the write protection function of the embedded multimedia card, and the partition write protection of the embedded multimedia card, in the normal intelligent terminal upgrade process or the smart terminal is in the super user right (root) Status, by unprotecting the partition of the embedded multimedia card, rewriting the data of the embedded multimedia card, and then enabling the embedded multimedia card to write protection function, which can effectively prevent hackers or enthusiasts.
  • the illegal super user authority (root) state the data of the partition of the embedded multimedia card is abnormally rewritten, or the data of the partition of the embedded multimedia card is abnormally rewritten in the case where the program stored in the smart terminal is defective.
  • Example 7 The embodiment of the present invention provides an embedded multimedia card 70.
  • the embedded multimedia card 70 includes a read-only partition, and includes:
  • the first receiving unit 701 is configured to receive a write protection cancellation command sent by the central processing unit;
  • the first execution unit 702 is configured to execute the write protection cancel command on the specified partition in the read-only partition for storing the upgrade file.
  • a second receiving unit 703, configured to receive the upgrade file sent by the central processing unit
  • a writing unit 704 configured to write the upgrade file into the designated partition
  • a third receiving unit 706, configured to receive a write protection command sent by the central processing unit
  • the second execution unit 707 is configured to execute the write protection command on the specified partition.
  • the embedded multimedia card of the smart terminal performs a write protection cancel command on the designated partition of the upgrade file, and then the embedded multimedia card writes the upgrade file to the office.
  • the specified partition, the embedded multimedia card performs a write protection command on the specified partition, and the specified partition data of the embedded multimedia card can be effectively solved under the premise that the normal upgrade is not affected compared with the prior art. Abnormal rewriting problem.
  • the embedded multimedia card 70 further includes:
  • the third execution unit 708 is configured to execute a write protection command sent by the central processing unit to the read-only partition that needs write protection.
  • the write protection cancel command includes a physical address and a length of performing the write protection cancel command on the specified partition, where the write protection command includes a physical address and a length of executing the write protection command on the specified partition,
  • the physical address is needed to be the liter
  • the level file is written to the physical address of the embedded multimedia card.
  • the embodiment of the present invention provides a central processing unit 80, as shown in FIG. 10, including: a first sending unit 801, configured to send a write protection cancel command to an embedded multimedia card; wherein, the embedded multimedia card includes a read-only partition of the protection state; a second sending unit 802, configured to send an upgrade file to the embedded multimedia card;
  • the receiving unit 803 is configured to receive a write completion message sent by the embedded multimedia card, where the write completion message includes a logical address of the upgrade file, and the write completion message is the embedded multimedia card The message that the upgrade file is successfully written to the specified partition of the upgrade file;
  • the third sending unit 804 is configured to send a write protection command to the embedded multimedia card.
  • the write protection cancel command is sent to the embedded multimedia card, and the file is upgraded, so that the embedded multimedia card of the smart terminal performs writing on the specified partition of the upgrade file.
  • Protecting the cancel command, and writing the upgrade file to the designated partition after receiving the write completion message sent by the embedded multimedia card, sending a write protection command to the embedded multimedia card to re-assign the designated partition Write protection, compared with the prior art, can effectively solve the problem that the specified partition data of the embedded multimedia card is abnormally rewritten under the premise of ensuring that the normal upgrade is not affected.
  • the central processing unit 80 further includes:
  • the first obtaining unit 805 is configured to obtain a logical address of the upgrade file in the upgrade data packet, where the upgrade data packet includes at least one upgrade file and a logical address of each of the upgrade files.
  • the first query unit 806 is configured to query, according to the logical address of the upgrade file, a correspondence between a preset logical address and a read-only partition.
  • the second obtaining unit 807 is configured to obtain a specified partition of the upgrade file.
  • the first determining unit 808 is configured to determine whether the specified partition of the upgrade file is a write-protected partition.
  • the second query unit 809 is configured to: if the specified partition of the upgrade file is a write-protected partition, query a physical address corresponding to a logical address of the upgrade file according to a logical address of the upgrade file, where the physical address is required The upgrade file is written to the physical address of the embedded multimedia card.
  • the third query unit 8010 is configured to query, according to the logical address of the upgrade file, a correspondence between a preset logical address and a read-only partition.
  • the third obtaining unit 801 1 is configured to obtain a specified partition of the upgrade file, and the second determining unit 8012 is configured to determine whether the specified partition of the upgrade file is a write-protected partition;
  • the fourth query unit 8013 is configured to: if the specified partition of the upgrade file is a write-protected partition, query a physical address corresponding to a logical address of the upgrade file according to a logical address of the upgrade file.
  • the write protection cancel command includes the physical address and a length of executing the write protection cancel command on the specified partition, the write protection command including the physical address and performing the write protection command on the designated partition length.
  • the checking unit 8014 is configured to check whether the power failure protection identifier is an abnormal power failure identifier
  • the fourth obtaining unit 8015 is configured to: if the power-down protection identifier is an abnormal power-down identifier, obtain a physical address corresponding to a logical address of the read-only partition of the embedded multimedia card that needs to be write-protected;
  • the fourth sending unit 8016 is configured to send a write protection command to the embedded multimedia card, where the write protection command includes the physical address and a length of performing a write protection command on the read-only partition.
  • the read-only status attribute control information of the area, the read-only status attribute control information includes a partition number, a partition write protection attribute, a next boot write protection state of the partition, and a current write protection status of the partition;
  • the third determining unit 8018 is configured to determine, according to the partition number, whether the partition corresponding to the partition number is a write protected partition;
  • the second reading unit 8019 is configured to: if the partition corresponding to the partition number is a write-protected partition, read the partition corresponding to the partition number from the read-only status of the control information, and then write the next boot. Protection status.
  • the fourth determining unit 8020 is configured to determine whether the next open write protection state of the partition corresponding to the partition number is a write protection state
  • the fourth determining unit 8020 is further configured to: if the partition corresponding to the partition number is in a write-protected state, determine whether the partition corresponding to the partition number is a write-protected partition;
  • the setting unit 8021 is configured to: if the partition corresponding to the partition number is not a write protection partition, set the partition as a write protection partition;
  • the first updating unit 8022 is configured to update the current write protection state of the partition to a write protection state
  • the first update unit 8022 is further configured to update a current write protection state of the partition if the partition corresponding to the partition number is a write protection partition.
  • the fourth determining unit 8020 is configured to determine whether the next boot-on protection state of the partition corresponding to the partition number is a write-protected state
  • the fourth determining unit 8020 is configured to determine, if the partition corresponding to the partition number is in a write-protected state, that the partition corresponding to the partition number is a write-protected partition;
  • the canceling unit 8023 is configured to cancel write protection on the partition if the partition corresponding to the partition number is a write protection partition;
  • a second updating unit 8024 configured to update a current write protection state of the partition;
  • the second update unit 8024 is further configured to update a current write protection state of the partition if the partition corresponding to the partition number is not a write protection partition.
  • An embodiment of the present invention provides an embedded multimedia card 90.
  • the embedded multimedia card 90 includes a read-only partition. As shown in FIG. 12, the embedded multimedia card includes: a receiver 901, configured to receive, by the central processing unit, Write protection cancel command; memory 902 for storing program code;
  • the processor 903 configured to invoke the program code stored in the memory, to perform the following method: executing the write protection cancel command on a specified partition in the read-only partition for storing an upgrade file;
  • the receiver 901 is further configured to receive the upgrade file sent by the central processing unit;
  • the method performed by the processor 903 further includes: writing the upgrade file into the designated partition;
  • a transmitter 904 configured to send a write completion message to the central processor after the upgrade file is written;
  • the receiver 901 is further configured to receive a write protection command sent by the central processing unit;
  • the method performed by the processor 903 further includes: executing the write protection command on the designated partition.
  • the embedded multimedia card of the smart terminal performs a write protection cancel command on the designated partition of the upgrade file, and then the embedded multimedia card writes the upgrade file to the office.
  • the specified partition, the embedded multimedia card performs a write protection command on the specified partition, and the specified partition data of the embedded multimedia card can be effectively solved under the premise that the normal upgrade is not affected compared with the prior art. Abnormal rewriting problem.
  • the method performed by the processor 903 further includes: the read only read-only protection
  • the partition executes a write protection command sent by the central processor.
  • the write protection cancel command includes a physical address and a length of performing the write protection cancel command on the specified partition, where the write protection command includes a physical address and a length of executing the write protection command on the specified partition,
  • the physical address is the physical address at which the upgrade file needs to be written to the embedded multimedia card.
  • the embodiment of the present invention provides a central processing unit 100, as shown in FIG. 13, including: a transmitter 1001, configured to send a write protection cancel command to an embedded multimedia card; wherein the embedded multimedia card includes a write protection state.
  • a transmitter 1001 configured to send a write protection cancel command to an embedded multimedia card; wherein the embedded multimedia card includes a write protection state.
  • Read-only partition configured to send a write protection cancel command to an embedded multimedia card; wherein the embedded multimedia card includes a write protection state.
  • the transmitter 1001 is further configured to send an upgrade file to the embedded multimedia card
  • the receiver 1002 is configured to receive a write completion message sent by the embedded multimedia card, where the write completion message includes a logical address of the upgrade file, and the write completion message is the embedded multimedia card The message that the upgrade file is successfully written to the specified partition of the upgrade file;
  • the transmitter 1001 is further configured to send a write protection command to the embedded multimedia card.
  • the write protection cancel command is sent to the embedded multimedia card, and the file is upgraded, so that the embedded multimedia card of the smart terminal performs writing on the specified partition of the upgrade file.
  • Protecting the cancel command, and writing the upgrade file to the designated partition after receiving the write completion message sent by the embedded multimedia card, sending a write protection command to the embedded multimedia card to re-assign the designated partition Write protection, compared with the prior art, can effectively solve the problem that the specified partition data of the embedded multimedia card is abnormally rewritten under the premise of ensuring that the normal upgrade is not affected.
  • the central processing unit 100 further includes:
  • the processor 1004 the program code for invoking the memory storage performs the following method: at least one upgrade file and a logical address of each of the upgrade files;
  • the upgrade file is required to be written into the physical address of the embedded multimedia card according to the upgrade file address.
  • the method performed by the processor 1004 further includes:
  • the write-protect cancellation command according to the upgrade includes the physical address and the Specifying a length of the partition to execute the write protection cancel command, the write protection command including the physical address and a length of executing the write protection command for the specified partition.
  • the method performed by the processor 1004 further includes:
  • the power-down protection identifier is an abnormal power-down identifier, obtaining a physical address corresponding to a logical address of the read-only partition of the embedded multimedia card that needs to be write-protected;
  • the transmitter is further configured to send a write protection command to the embedded multimedia card, where
  • the write protection command includes the physical address and a length of a write protection command to the read-only partition.
  • the method performed by the processor 1004 further includes:
  • Reading read-only status attribute control information of all partitions of the embedded multimedia card where the read-only status attribute control information includes a partition number, a partition write protection attribute, a partition start write protection status, and a partition current write protection status;
  • the partition corresponding to the partition number is a write-protected partition, read the partition corresponding to the partition number from the read-only state attribute control information to the next boot-on write protection state.
  • the method performed by the processor 1004 further includes:
  • partition corresponding to the partition number is in the write protection state, determine whether the partition corresponding to the partition number is a write protection partition
  • partition corresponding to the partition number is not a write-protected partition, set the partition as a write-protected partition;
  • the current write protection state of the partition is updated.
  • the method performed by the processor 1004 further includes:
  • partition corresponding to the partition number is not in the write protection state, determine whether the partition corresponding to the partition number is a write protection partition
  • the partition corresponding to the partition number is a write-protected partition, cancel write protection on the partition; Updating the current write protection state of the partition;
  • the current write protection state of the partition is updated.
  • An embodiment of the present invention provides an intelligent terminal 1 10 , as shown in FIG. 15 , including: an embedded multimedia card 1 101 and a central processing unit 1 102.
  • the embedded multimedia card 1 101 is configured to: receive a write protection cancel command sent by a central processing unit; execute the write protection cancel command on a designated partition for storing an upgrade file in the read-only partition; and receive the central processing
  • the upgrade file sent by the device writing the upgrade file to the designated partition; after the upgrade file is written, sending a write completion message to the central processor; receiving the central processor to send Write protection command; execute the write protection command on the specified partition.
  • the central processing unit 1 102 is configured to: send a write protection cancel command to the embedded multimedia card; wherein, the embedded multimedia card includes a read-only partition in a write protection state; and send an upgrade file to the embedded multimedia card; Receiving a write completion message sent by the embedded multimedia card, where the write completion message includes a logical address of the upgrade file, and the write completion message is that the embedded multimedia card successfully writes the upgrade file a message to a specified partition of the upgrade file; a write protection command is sent to the embedded multimedia card.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented Row.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as the units may or may not be physical units, and may be located in one place or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiment of the present embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

Abstract

一种数据处理方法及智能终端,涉及计算机数据处理领域。上述方法包括:接收中央处理器发送的写保护取消命令(101);对只读分区中用于存储升级文件的指定分区执行所述写保护取消命令(102);接收中央处理器发送的升级文件(103);将所述升级文件写入到所述指定分区中(104);所述升级文件写入完成后,向中央处理器发送写入完成消息(105);接收中央处理器发送的写保护指令(106);对所述指定分区执行所述写保护命令(107)。所述数据处理方法及智能终端用于在保证正常升级不受影响的前提下,有效地解决嵌入式多媒体卡的只读分区被异常改写的问题。

Description

一种数据处理方法及智能终端 技术领域
本发明涉及计算机数据处理领域, 尤其涉及一种数据处理方法 及智能终端。
背景技术
eMMC(Embedded Multi Media Card)是一种嵌入式多媒体卡, 其主要包括 MMC ( Multi Media Card , 多媒体卡) 接口、 快闪存储 器及主控制器, 主要应用于存储容量较高的消费电子产品, 例如手 机、 平板电脑等智能终端。
现有技术中, 可以采用 DRM ( Data Rights Management , 数字 版权管理) 功能保护 eMMC 中的数据。 例如在安卓系统的智能终端 上安装 Widevine软件, 使用 Widevine软件对 eMMC 中的数据进行 加密, 以防止 eMMC 中的数据被异常改写。
但是, Windvine本质上是一种纯软件的加密技术, 仅仅是增大 了改写 eMMC 中的数据的难度, 目前已有黑客或发烧友可以破解 Windvine 的密码对数据改写, 或者对智能终端预置应用进行修改 等。 因此, 非法 root后异常改写嵌入式多媒体卡的数据, 会导致智 能终端的系统不稳定等。
发明内容
本发明的实施例提供一种数据处理方法及智能终端, 在保证正 常升级不受影响的前提下, 能够有效地解决嵌入式多媒体卡的只读 分区数据被异常改写的问题。
为达到上述目 的, 本发明的实施例采用如下技术方案: 第一方面, 提供一种数据处理方法, 应用于嵌入式多媒体卡, 所述嵌入式多媒体卡包括只读分区, 所述方法包括: 接收中央处理器发送的写保护取消命令;
对所述只读分区中用于存储升级文件的指定分区执行所述写保 护取消命令;
接收所述中央处理器发送的所述升级文件;
将所述升级文件写入到所述指定分区中;
所述升级文件写入完成后, 向所述中央处理器发送写入完成消 息;
接收所述中央处理器发送的写保护命令;
对所述指定分区执行所述写保护命令。
结合第一方面, 在第一种可实现方式中, 在所述接收中央处理 器发送的写保护取消命令之前, 所述方法还包括:
对需要写保护的所述只读分区执行所述中央处理器发送的写保 护命令。
结合第一方面和第一种可实现方式中任意一种, 在第二种可实 现方式中, 所述写保护取消命令包括物理地址和对所述指定分区执 行所述写保护取消命令的长度, 所述写保护命令包括物理地址和对 所述指定分区执行所述写保护命令的长度, 所述物理地址为需要将 所述升级文件写入所述嵌入式多媒体卡的物理地址。
第二方面, 提供一种数据处理方法, 应用于中央处理器, 所述 方法包括:
向嵌入式多媒体卡发送写保护取消命令; 其中, 所述嵌入式多 媒体卡包括处于写保护状态的只读分区;
向所述嵌入式多媒体卡发送升级文件;
接收所述嵌入式多媒体卡发送的写入完成消息, 所述写入完成 消息包括所述升级文件的逻辑地址, 所述写入完成消息为所述嵌入 式多媒体卡将所述升级文件成功写入到所述升级文件的指定分区的 消息; 向所述嵌入式多媒体卡发送写保护命令。
结合第二方面, 在第一种可实现方式中, 在所述向嵌入式多媒 体卡发送写保护取消命令之前, 所述方法还包括: 至少一个升级文件和每一个所述升级文件的逻辑地址;
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分 区之间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是写保护分区;
若所述升级文件的指定分区是写保护分区, 根据所述升级文件 理地址为需要将所述升级文件写入所述嵌入式多媒体卡的物理地 址。
结合第一种可实现方式, 在第二种可实现方式中, 在所述接收 所述嵌入式多媒体卡发送的写入完成消息之后, 所述方法还包括: 根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分 区之间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是受写保护的分区; 若所述升级文件的指定分区是受写保护的分区, 根据所述升级 结合第二方面、 第一种可实现方式和第二种可实现方式中任意 一种, 在第三种可实现方式中, 所述写保护取消命令包括所述物理 地址和对所述指定分区执行所述写保护取消命令的长度, 所述写保 护命令包括所述物理地址和对所述指定分区执行所述写保护命令的 长度。
结合第三种可实现方式, 在第四种可实现方式中, 在所述获取 升级数据包中升级文件的逻辑地址之前, 所述方法还包括: 检查掉电保护标识是否是异常掉电标识;
若所述掉电保护标识是异常掉电标识, 获取需要写保护的所述 嵌入式多媒体卡的只读分区的逻辑地址对应的物理地址;
向所述嵌入式多媒体卡发送写保护命令, 所述写保护命令包括 所述物理地址和对所述只读分区执行写保护命令的长度。
结合第二方面、 第一种可实现方式至第四种可实现方式中任意 一种, 在第五种可实现方式中, 在所述向所述嵌入式多媒体卡发送 写保护命令之后, 所述方法还包括:
读取所述嵌入式多媒体卡的所有分区的只读状态属性控制信 息, 所述只读状态属性控制信息包括分区号、 分区写保护属性、 分 区下次开机写保护状态和分区当前写保护状态;
根据所述分区号判断所述分区号对应的分区是否是受写保护的 分区;
若所述分区号对应的分区是受写保护的分区, 从所述只读状态 属性控制信息中读取所述分区号对应的分区下次开机写保护状态。
结合第五种可实现方式, 在第六种可实现方式中, 在所述从所 述只读状态属' f生控制信息中读取所述分区号对应的分区下次开机写 保护状态之后, 所述方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护 状态;
若所述分区号对应的分区下次开机写保护状态是写保护状态, 判断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区不是写保护分区, 将所述分区设置为 写保护分区;
更新所述分区当前写保护状态为写保护状态;
若所述分区号对应的分区是写保护分区, 更新所述分区当前写 保护状态。
结合第六种可实现方式, 在第七种可实现方式中, 在所述从所 述只读状态属' f生控制信息中读取所述分区号对应的分区下次开机写 保护状态之后, 所述方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护 状态;
若所述分区号对应的分区下次开机写保护状态不是写保护状 态, 判断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区是写保护分区, 取消对所述分区的写 保护;
更新所述分区当前写保护状态;
若所述分区号对应的分区不是写保护分区, 更新所述分区当前 写保护状态。
第三方面, 提供一种嵌入式多媒体卡, 所述嵌入式多媒体卡包 括只读分区, 所述嵌入式多媒体卡包括:
第一接收单元, 用于接收中央处理器发送的写保护取消命令; 第一执行单元, 用于对所述只读分区中用于存储升级文件的指 定分区执行所述写保护取消命令;
第二接收单元, 用于接收所述中央处理器发送的所述升级文 件;
写入单元, 用于将所述升级文件写入到所述指定分区中; 发送单元, 用于所述升级文件写入完成后, 向所述中央处理器 发送写入完成消息;
第三接收单元, 用于接收所述中央处理器发送的写保护命令; 第二执行单元, 用于对所述指定分区执行所述写保护命令。 结合第一方面, 在第一种可实现方式中, 所述嵌入式多媒体卡 还包括: 第三执行单元, 用于对需要写保护的所述只读分区执行所述中 央处理器发送的写保护命令。
结合第一方面和第一种可实现方式中任意一种, 在第二种可实 现方式中, 所述写保护取消命令包括物理地址和对所述指定分区执 行所述写保护取消命令的长度, 所述写保护命令包括物理地址和对 所述指定分区执行所述写保护命令的长度, 所述物理地址为需要将 所述升级文件写入所述嵌入式多媒体卡的物理地址。
第四方面, 提供一种中央处理器, 包括:
第一发送单元, 用于向嵌入式多媒体卡发送写保护取消命令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分区;
第二发送单元, 用于向所述嵌入式多媒体卡发送升级文件; 接收单元, 用于接收所述嵌入式多媒体卡发送的写入完成消 息, 所述写入完成消息包括所述升级文件的逻辑地址, 所述写入完 成消息为所述嵌入式多媒体卡将所述升级文件成功写入到所述升级 文件的指定分区的消息;
第三发送单元, 用于向所述嵌入式多媒体卡发送写保护命令。 结合第四方面, 在第一种可实现方式中, 所述中央处理器还包 括: 所述升级数据包包括至少一个升级文件和每一个所述升级文件的逻 辑地址;
第一查询单元, 用于根据所述升级文件的逻辑地址, 查询预设 的逻辑地址与只读分区之间的对应关系;
第二获取单元, 用于获取所述升级文件的指定分区;
第一判断单元, 用于判断所述升级文件的指定分区是否是写保 护分区;
第二查询单元, 用于若所述升级文件的指定分区是写保护分 区, 根据所述升级文件的逻辑地址查询所述升级文件的逻辑地址对 应的物理地址, 所述物理地址为需要将所述升级文件写入所述嵌入 式多媒体卡的物理地址。
结合第一种可实现方式, 在第二种可实现方式中, 所述中央处 理器还包括:
第三查询单元, 用于根据所述升级文件的逻辑地址, 查询预设 的逻辑地址与只读分区之间的对应关系;
第三获取单元, 用于获取所述升级文件的指定分区;
第二判断单元, 用于判断所述升级文件的指定分区是否是受写 保护的分区;
第四查询单元, 用于若所述升级文件的指定分区是受写保护的 分区, 根据所述升级文件的逻辑地址查询所述升级文件的逻辑地址 对应的物理地址。
结合第四方面、 第一种可实现方式和第二种可实现方式中任意 一种, 在第三种可实现方式中, 所述写保护取消命令包括所述物理 地址和对所述指定分区执行所述写保护取消命令的长度, 所述写保 护命令包括所述物理地址和对所述指定分区执行所述写保护命令的 长度。
结合第三种可实现方式, 在第四种可实现方式中, 所述中央处 理器还包括:
检查单元, 用于检查掉电保护标识是否是异常掉电标识; 第四获取单元, 用于若所述掉电保护标识是异常掉电标识, 获 取需要写保护的所述嵌入式多媒体卡的只读分区的逻辑地址对应的 物理地址;
第四发送单元, 用于向所述嵌入式多媒体卡发送写保护命令, 所述写保护命令包括所述物理地址和对所述只读分区执行写保护命 令的长度。 结合第四方面、 第一种可实现方式至第四种可实现方式中任意 一种, 在第五种可实现方式中, 所述中央处理器还包括:
第一读取单元, 用于读取所述嵌入式多媒体卡的所有分区的只 读状态属性控制信息, 所述只读状态属性控制信息包括分区号、 分 区写保护属性、 分区下次开机写保护状态和分区当前写保护状态; 第三判断单元, 用于根据所述分区号判断所述分区号对应的分 区是否是受写保护的分区;
第二读取单元, 用于若所述分区号对应的分区是受写保护的分 区, 从所述只读状态属' f生控制信息中读取所述分区号对应的分区下 次开机写保护状态。
结合第五种可实现方式, 在第六种可实现方式中, 所述中央处 理器还包括:
第四判断单元, 用于判断所述分区号对应的分区下次开机写保 护状态是否是写保护状态;
所述第四判断单元还用于若所述分区号对应的分区下次开机写 保护状态是写保护状态, 判断所述分区号对应的分区是否是写保护 分区;
设置单元, 用于若所述分区号对应的分区不是写保护分区, 将 所述分区设置为写保护分区;
第一更新单元, 用于更新所述分区当前写保护状态为写保护状 态;
所述第一更新单元还用于若所述分区号对应的分区是写保护分 区, 更新所述分区当前写保护状态。
结合第六种可实现方式, 在第七种可实现方式中, 所述中央处 理器还包括:
所述第四判断单元还用于判断所述分区号对应的分区下次开机 写保护状态是否是写保护状态; 所述第四判断单元还用于若所述分区号对应的分区下次开机写 保护状态不是写保护状态, 判断所述分区号对应的分区是否是写保 护分区;
取消单元, 用于若所述分区号对应的分区是写保护分区, 取消 对所述分区的写保护;
第二更新单元, 用于更新所述分区当前写保护状态;
所述第二更新单元还用于若所述分区号对应的分区不是写保护 分区, 更新所述分区当前写保护状态。
第五方面, 提供一种智能终端, 包括: 以上任意所述的嵌入式 多媒体卡, 以上任意所述的中央处理器。
第六方面, 提供一种嵌入式多媒体卡, 所述嵌入式多媒体卡包 括只读分区, 所述嵌入式多媒体卡包括:
接收机, 用于接收中央处理器发送的写保护取消命令; 存储器, 用于存储程序代码;
处理器, 用于调用所述存储器存储的程序代码执行如下方法: 对所述只读分区中用于存储升级文件的指定分区执行所述写保护取 消命令;
所述接收机还用于接收所述中央处理器发送的所述升级文件; 所述处理器执行的方法还包括: 将所述升级文件写入到所述指 定分区中;
发射机, 用于所述升级文件写入完成后, 向所述中央处理器发 送写入完成消息;
所述接收机还用于接收所述中央处理器发送的写保护命令; 所述处理器执行的方法还包括: 对所述指定分区执行所述写保 护命令。
结合第六方面, 在第一种可实现方式中, 所述处理器执行的方 法还包括: 对需要写保护的所述只读分区执行所述中央处理器发送 的写保护命令。
结合第六方面和第一种可实现方式中任意一种, 在第二种可实 现方式中, 所述写保护取消命令包括物理地址和对所述指定分区执 行所述写保护取消命令的长度, 所述写保护命令包括物理地址和对 所述指定分区执行所述写保护命令的长度, 所述物理地址为需要将 所述升级文件写入所述嵌入式多媒体卡的物理地址。
第七方面, 提供一种中央处理器, 包括:
发射机, 用于向嵌入式多媒体卡发送写保护取消命令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分区;
所述发射机还用于向所述嵌入式多媒体卡发送升级文件; 接收机, 用于接收所述嵌入式多媒体卡发送的写入完成消息, 所述写入完成消息包括所述升级文件的逻辑地址, 所述写入完成消 息为所述嵌入式多媒体卡将所述升级文件成功写入到所述升级文件 的指定分区的消息;
所述发射机还用于向所述嵌入式多媒体卡发送写保护命令。 结合第七方面, 在第一种可实现方式中, 所述中央处理器还包 括:
存储器, 用于存储程序代码;
处理器, 用于调用所述存储器存储的程序代码执行如下方法: 至少一个升级文件和每一个所述升级文件的逻辑地址;
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分 区之间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是写保护分区;
若所述升级文件的指定分区是写保护分区, 根据所述升级文件 理地址为需要将所述升级文件写入所述嵌入式多媒体卡的物理地 址。
结合第一种可实现方式, 在第二种可实现方式中, 所述处理器 执行的方法还包括:
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分 区之间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是受写保护的分区; 若所述升级文件的指定分区是受写保护的分区, 根据所述升级
结合第七方面、 第一种可实现方式和第二种可实现方式中任意 一种, 在第三种可实现方式中, 所述写保护取消命令包括所述物理 地址和对所述指定分区执行所述写保护取消命令的长度, 所述写保 护命令包括所述物理地址和对所述指定分区执行所述写保护命令的 长度。
结合第三种可实现方式, 在第四种可实现方式中, 所述处理器 执行的方法还包括:
检查掉电保护标识是否是异常掉电标识;
若所述掉电保护标识是异常掉电标识, 获取需要写保护的所述 嵌入式多媒体卡的只读分区的逻辑地址对应的物理地址;
所述发射机还用于向所述嵌入式多媒体卡发送写保护命令, 所 述写保护命令包括所述物理地址和对所述只读分区执行写保护命令 的长度。
结合第七方面、 第一种可实现方式至第四种可实现方式中任意 一种, 在第五种可实现方式中, 所述处理器执行的方法还包括: 读取所述嵌入式多媒体卡的所有分区的只读状态属性控制信 息, 所述只读状态属性控制信息包括分区号、 分区写保护属性、 分 区下次开机写保护状态和分区当前写保护状态;
根据所述分区号判断所述分区号对应的分区是否是受写保护的 分区;
若所述分区号对应的分区是受写保护的分区, 从所述只读状态 属性控制信息中读取所述分区号对应的分区下次开机写保护状态。
结合第五种可实现方式, 在第六种可实现方式中, 所述处理器 执行的方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护 状态;
若所述分区号对应的分区下次开机写保护状态是写保护状态, 判断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区不是写保护分区, 将所述分区设置为 写保护分区;
更新所述分区当前写保护状态为写保护状态;
若所述分区号对应的分区是写保护分区, 更新所述分区当前写 保护状态。
结合第六种可实现方式, 在第七种可实现方式中, 所述处理器 执行的方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护 状态;
若所述分区号对应的分区下次开机写保护状态不是写保护状 态, 判断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区是写保护分区, 取消对所述分区的写 保护;
更新所述分区当前写保护状态;
若所述分区号对应的分区不是写保护分区, 更新所述分区当前 写保护状态。 第八方面, 提供一种智能终端, 包括: 以上任意所述的嵌入式 多媒体卡, 以上任意所述的中央处理器。
本发明的实施例提供一种数据处理方法及智能终端。 在智能终 端获取到升级数据包, 改写嵌入式多媒体卡的指定分区的数据之 前, 智能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护 取消命令, 然后, 该嵌入式多媒体卡将升级文件写入到所述指定分 区, 该嵌入式多媒体卡再对所述指定分区执行写保护命令, 相对于 现有技术, 在保证正常升级不受影响的前提下, 能够有效地解决嵌 入式多媒体卡的指定分区数据被异常改写的问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下 面将对实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 根据这些附图获得其他的附图。
图 1 为本发明实施例提供一种数据处理方法流程图;
图 2为本发明实施例提供另一种数据处理方法流程图; 图 3为本发明实施例提供又一种数据处理方法流程图; 图 4为本发明实施例提供再一种数据处理方法流程图; 图 5为本发明实施例提供另再一种数据处理方法流程图; 图 6为本发明实施例提供又再一种数据处理方法流程图; 图 7为本发明实施例提供另又一种数据处理方法流程图; 图 8为本发明实施例提供一种嵌入式多媒体卡的结构示意图; 图 9 为本发明实施例提供另一种嵌入式多媒体卡的结构示意 图;
图 10为本发明实施例提供一种中央处理器的结构示意图; 图 1 1 为本发明实施例提供另一种中央处理器的结构示意图; 图 12 为本发明实施例提供又一种嵌入式多媒体卡的结构示意 图;
图 13为本发明实施例提供又一种中央处理器的结构示意图; 图 14为本发明实施例提供再一种中央处理器的结构示意图; 图 1 5为本发明实施例提供一种智能终端的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术 方案进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明 一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本 领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他 实施例, 都属于本发明保护的范围。
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目 的, 而非旨在限制本发明。 在本发明实施例和所附权利要求书中所 使用的单数形式的 "一种" 、 "所述" 和 "该" 也旨在包括多数形 式, 除非上下文清楚地表示其他含义。 还应当理解, 本文中使用的 术语 "和 /或" 是指并包含一个或多个相关联的列出项目 的任何或 所有可能组合。
应当理解, 尽管在本发明实施例中可能采用术语指定分区、 挂 载分区等来描述只读分区的一部分, 但这些指定分区、 挂载分区不 应限于这些术语。 这些术语仅用来区分只读分区中的不同区域。 例 如, 指定分区可以是表示安卓系统中的系统分区、 超级块等。
取决于语境, 如在此所使用的词语 "如果" 可以被解释成为 "在……时" 或 "当……时" 或 "响应于确定" 、 "响应于判断 "或 "响应于检测" 。 类似地, 取决于语境, 短语 "如果确定" 、 "如 果判断 "或 "如果检测(陈述的条件或事件)" 可以被解释成为 "当确 定时" 或 "响应于确定" 或 "当检测(陈述的条件或事件)时" 、 "当 判断 ( 陈述的条件或事件 ) 时"或 "响应于检测(陈述的条件或事 件)" 。
现有技术中, 智能终端设置有嵌入式多媒体卡 ( eMMC ) , 嵌 入式多媒体卡具有写保护功能, 嵌入式多媒体卡的具有永久写保 护、 上电写保护和临时写保护, 其中, 永久写保护只能设置一次, 成功设置后无法取消; 上电写保护每次上电需要重新设置, 下电则 写保护功能失效; 临时写保护通过命令设置使能写保护功能或取消 写保护功能, 断电后仍然有效, 只有通过命令取消写保护。 EMMC ( Embedded Multi Media Card ) 协议规定有使能写保护功能和取消 写保护功能等控制命令。
通常, eMMC具有不同的分区, 该分区可以是只读分区或可读 可写分区等, 智能终端的分区表记录有 eMMC的分区。 只读分区可 以为系统启动加载器 ( BootLoader ) 分区或系统 ( System ) 分区, 只读分区存储有系统程序或预置应用。 可读可写分区可以为用户数 据 ( User data ) 分区或 U盘 ( U-disk ) 分区。
在智能终端升级或者合法超级用户权限 ( root ) 的情况下, 智 能终端的只读分区的数据可以允许被改写, 此外在其他任何情况下 的改写都被认为是异常改写, 只读分区的数据被异常改写后可能会 导致智能终端的某些功能异常、 智能终端无法启动或数据丟失等情 况。
本发明使用嵌入式多媒体卡的临时写保护功能对嵌入式多媒体 卡的只读分区写保护。
实施例一
本发明实施例提供一种数据处理方法, 应用于嵌入式多媒体 卡, 所述嵌入式多媒体卡包括只读分区, 如图 1 所示, 所述方法包 括:
步骤 101、 所述嵌入式多媒体卡接收中央处理器发送的写保护 取消命令。 步骤 102、 所述嵌入式多媒体卡对所述只读分区中用于存储升 级文件的指定分区执行所述写保护取消命令。
步骤 103、 所述嵌入式多媒体卡接收所述中央处理器发送的所 述升级文件。
步骤 104、 所述嵌入式多媒体卡将所述升级文件写入到所述指 定分区中。
步骤 105、 所述嵌入式多媒体卡所述升级文件写入完成后, 向 所述中央处理器发送写入完成消息。
步骤 106、 所述嵌入式多媒体卡接收所述中央处理器发送的写 保护命令。
步骤 107、 所述嵌入式多媒体卡对所述指定分区执行所述写保 护命令。
这样一来, 在改写嵌入式多媒体卡的指定分区的数据之前, 智 能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护取消命 令, 然后, 该嵌入式多媒体卡将升级文件写入到所述指定分区, 该 嵌入式多媒体卡再对所述指定分区执行写保护命令, 相对于现有技 术, 在保证正常升级不受影响的前提下, 能够有效地解决嵌入式多 媒体卡的指定分区数据被异常改写的问题。
需要说明的是, 智能终端包括中央处理器和嵌入式多媒体卡, 所述嵌入式多媒体卡包括只读分区, 在接收中央处理器发送的写保 护取消命令之前, 对需要写保护的嵌入式多媒体卡的只读分区执行 中央处理器发送的写保护命令, 防止异常改写智能终端的只读分区 的数据, 所述只读分区的范围与所述写保护分区的范围对应相等, 在智能终端获取到升级数据包。
所述写保护命令可以是 SET— WRITE— PROT , 对只读分区执行 写保护命令的长度可以是 SEND— WRITE— PROT , 写保护命令的类型 可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写保护命令的类 型 为 临 时 写 保 护 。 所 述 写 保 护 取 消 命 令 可 以 是
CLR— WRITE— PROT , 对只读分区执行写保护取消命令的长度可以 是 SEND— WRITE— PROT , 写 保 护 取 消 命 令 的 类 型 可 以 是 SEND— WRITE— PROT— TYPE , 本发明所述的写保护取消命令的类型 为临时取消写保护。
本发明使用嵌入式多媒体卡的临时写保护功能对嵌入式多媒体 卡的只读分区写保护。
实施例二
本发明实施例提供一种数据处理方法, 应用于中央处理器, 如 图 2所示, 所述方法包括:
步骤 201、 所述中央处理器向嵌入式多媒体卡发送写保护取消 命令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分 区。
步骤 202、 所述中央处理器向所述嵌入式多媒体卡发送升级文 件。
步骤 203、 所述中央处理器接收所述嵌入式多媒体卡发送的写 入完成消息, 所述写入完成消息包括所述升级文件的逻辑地址, 所 述写入完成消息为所述嵌入式多媒体卡将所述升级文件成功写入到 所述升级文件的指定分区的消息。
步骤 204、 所述中央处理器向所述嵌入式多媒体卡发送写保护 命令。
这样一来, 在改写嵌入式多媒体卡的指定分区的数据之前, 先 向嵌入式多媒体卡发送写保护取消命令, 以及升级文件, 以便于智 能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护取消命 令, 并将所述升级文件写入到指定分区, 在接收到所述嵌入式多媒 体卡发送的写入完成消息后, 再向所述嵌入式多媒体卡发送写保护 命令, 重新对指定分区写保护, 相对于现有技术, 在保证正常升级 不受影响的前提下, 能够有效地解决嵌入式多媒体卡的指定分区数 据被异常改写的问题。
实施例三
本发明实施例的目 的在于智能终端在系统升级过程中对嵌入式 多媒体卡中需要写保护的只读分区进行写保护的控制; 本发明实施 例的目 的还在于该智能终端在升级过程中异常掉电, 该智能终端再 次启动之后, 智能终端的嵌入式多媒体卡重新对嵌入式多媒体卡中 需要写保护的只读分区升级, 但是所述只读分区没有写保护, 则该 智能终端重新对所述只读分区写保护后, 再对嵌入式多媒体卡中需 要写保护的所述只读分区升级。
本发明实施例提供一种数据处理方法, 应用于中央处理器和嵌 入式多媒体卡, 如图 3所示, 包括:
步骤 301、 中央处理器检查掉电保护标识是否是异常掉电标 识。
若掉电保护标识是异常掉电标识, 执行步骤 302。
若掉电保护标识不是异常掉电标识, 执行步骤 305。
示例的, 若掉电保护标识为 0 时, 可以表示不是异常掉电标 识; 若掉电保护标识为 1 时, 可以表示是异常掉电标识。
用户可以按压智能终端的开机键持续 1 -3 秒钟, 使所述智能终 端启动开机, 然后, 该智能终端检测到有升级数据包, 则智能终端 检查掉电保护标识是否是异常掉电标识。
需要说明的是, 当智能终端检查掉电保护标识是异常掉电标识 时, 可以是由于智能终端相对当前开机之前的开机状态时, 正在运 行升级数据包等程序, 例如, 智能终端正在升级系统版本, 智能终 端突然掉电, 则掉电保护标识更新为异常掉电标识。
步骤 302、 中央处理器获取需要写保护的嵌入式多媒体卡的只 读分区的逻辑地址对应的物理地址。 中央处理器存储有嵌入式多媒体卡的分区表, 所述分区表记录 有嵌入式多媒体卡的分区与所述分区的逻辑地址的对应关系, 所述 逻辑地址与所述逻辑地址对应的所述嵌入式多媒体卡的物理地址的 对应关系。 示例的, 若嵌入式多媒体卡的分区存储有智能终端的系 统程序或系统启动加载程序, 该分区可以被认为是只读分区, 例 如, 只读分区可以是系统 ( System ) 分区或系统启动加载器 ( Boot Loader ) 分区; 若嵌入式多媒体卡的分区存储有智能终端的用户数 据, 该分区可以被认为是可读可写分区, 例如, 可读可写分区可以 是用户数据 ( User data ) 分区或 U盘 ( U-disk ) 分区。
中央处理器可以获取需要写保护的嵌入式多媒体卡的只读分区 的逻辑地址, 根据所述逻辑地址获取该逻辑地址对应的物理地址。 中央处理器获取逻辑地址, 以及根据逻辑地址获取物理地址为现有 技术, 本发明在此不再赘述。
步骤 303、 中央处理器向嵌入式多媒体卡发送写保护命令。
写保护命令包括中央处理器获取到的需要写保护的嵌入式多媒 体卡的只读分区的逻辑地址对应的物理地址、 对只读分区执行写保 护命令的长度和写保护命令的类型。
所述写保护命令可以是 SET— WRITE— PROT , 对只读分区执行 写保护命令的长度可以是 SEND— WRITE— PROT , 写保护命令的类型 可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写保护命令的类 型为临时写保护。
步骤 304、 嵌入式多媒体卡根据中央处理器发送的写保护命令 对所述需要写保护的所述嵌入式多媒体卡的只读分区写保护。
嵌入式多媒体卡包括控制器, 嵌入式多媒体卡的控制器根据所 述物理地址查找到该物理地址对应的只读分区, 嵌入式多媒体卡根 据中央处理器发送的写保护命令对所述需要写保护的所述嵌入式多 媒体卡的只读分区写保护。 这样一来, 当智能终端的中央处理器检查掉电保护标识是异常 掉电标识时, 嵌入式多媒体卡根据中央处理器发送的写保护命令重 新设置对需要写保护的所述嵌入式多媒体卡的只读分区写保护, 从 而有效地避免需要写保护的所述嵌入式多媒体卡的只读分区没有写 保护时异常改写该只读分区的数据。
步骤 305、 中央处理器校验升级数据包。
中央处理器从升级数据包中读取 CRC ( Cyclic Redundancy Check , 循环冗余校验码)数据, 校验 CRC数据, 读取 MD5数据, 校验 MD5数据, 读取平台码 ( platform code ) , 校验平台码, 读取 升级数据包版本信息, 校验升级数据包版本信息等。 中央处理器校 验升级数据包中的 CRC 数据、 MD5 数据、 平台码和升级数据包版 本信息均为现有技术, 本发明对此不再赘述。
步骤 306、 中央处理器获取升级数据包中升级镜像文件的逻辑 地址。
中央处理器从升级数据包中获取升级数据包中升级镜像文件的 逻辑地址。
需要说明的是, 所述升级数据包包括至少一个升级镜像文件、 每一个所述升级镜像文件的逻辑地址、 每一个所述升级镜像文件的 文件名和每一个所述升级镜像文件的版本号等信息。 所述镜像文件 可以类似于 ZIP 压缩包, 即可以将特定的一系列文件按照一定的格 式制作成单一的文件, 以方便用户下载和使用, 例如一个测试版的 操作系统或游戏等。
步骤 307、 中央处理器根据所述升级镜像文件的逻辑地址, 查 询预设的逻辑地址与只读分区之间的对应关系, 获取所述升级镜像 文件的逻辑地址对应的分区。
中央处理器存储有嵌入式多媒体卡的所有预设的逻辑地址与只 读分区之间的对应关系, 中央处理器先根据所述升级镜像文件的逻 辑地址与中央处理器存储的嵌入式多媒体卡的所有预设的逻辑地址 进行比较, 得到与所述升级镜像文件的逻辑地址相等的预设的逻辑 地址, 然后, 根据所述预设的逻辑地址与只读分区之间的对应关系 得到嵌入式多媒体卡的分区, 即所述分区为所述升级镜像文件的逻 辑地址对应的分区。
步骤 308、 中央处理器判断所述升级镜像文件的逻辑地址对应 的分区是否是写保护分区。
若所述升级镜像文件的逻辑地址对应的分区是写保护分区, 执 行步骤 309。
若所述升级镜像文件的逻辑地址对应的分区不是写保护分区, 执行步骤 3012。
中央处理器可以根据所述升级镜像文件的逻辑地址对应的分区 的分区号判断所述分区是否是需要写保护的分区, 若根据所述升级 镜像文件的逻辑地址对应的分区的分区号判断所述分区是需要写保 护的分区, 判断所述升级镜像文件的逻辑地址对应的分区是否已经 写保护, 即中央处理器判断所述升级镜像文件的逻辑地址对应的分 区是否是写保护分区。 所述升级镜像文件的逻辑地址对应的分区可 以是嵌入式多媒体卡的整个只读分区。
步骤 309、 中央处理器根据所述升级镜像文件的逻辑地址查询 所述升级镜像文件的逻辑地址对应的物理地址。
中央处理器存储有所述升级镜像文件的逻辑地址对应的物理地 址, 中央处理器根据所述升级镜像文件的逻辑地址查询所述升级镜 像文件的逻辑地址对应的物理地址。 所述物理地址为需要将所述升 级镜像文件写入所述嵌入式多媒体卡的物理地址。 需要说明的是, 本发明所述的根据逻辑地址查询物理地址为现有技术, 本发明在此 不再赘述。
步骤 3010、 中央处理器向所述嵌入式多媒体卡发送写保护取 消命令和所述升级镜像文件。
写保护取消命令包括升级镜像文件写入所述嵌入式多媒体卡的 物理地址、 对只读分区执行写保护取消命令的长度和写保护取消命 令的类型。
所述写保护取消命令可以是 CLR— WRITE— PROT , 对只读分区 执行写保护取消命令的长度可以是 SEND— WRITE— PROT , 写保护取 消命令的类型可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写 保护取消命令的类型为临时取消写保护。
步骤 301 1、 嵌入式多媒体卡根据所述中央处理器发送的写保 护取消命令对所述升级镜像文件的逻辑地址对应的分区取消写保 护。
步骤 3012、 嵌入式多媒体卡将所述升级镜像文件中的数据写 入到所述升级镜像文件的逻辑地址对应的分区。
基于图 3 , 如图 4所示, 在步骤 3012之后, 所述方法还包括: 步骤 3013、 嵌入式多媒体卡向中央处理器发送写入完成消 息。
写入完成消息包括升级镜像文件的逻辑地址, 所述写入完成消 息为所述嵌入式多媒体卡将所述升级镜像文件中的数据成功写入到 所述升级镜像文件的逻辑地址对应的分区的消 , 。
步骤 3014、 中央处理器根据所述升级镜像文件的逻辑地址, 查询预设的逻辑地址与只读分区之间的对应关系, 获取所述升级镜 像文件的逻辑地址对应的分区。
中央处理器存储有嵌入式多媒体卡的所有预设的逻辑地址与只 读分区之间的对应关系, 中央处理器先根据所述升级镜像文件的逻 辑地址与中央处理器存储的嵌入式多媒体卡的所有预设的逻辑地址 进行比较, 得到与所述升级镜像文件的逻辑地址相等的预设的逻辑 地址, 然后, 根据所述预设的逻辑地址与只读分区之间的对应关系 得到嵌入式多媒体卡的分区, 即所述分区为所述升级镜像文件的逻 辑地址对应的分区。
步骤 3015、 中央处理器判断所述升级镜像文件的逻辑地址对 应的分区是否是受写保护的分区。
若所述升级镜像文件的逻辑地址对应的分区是受写保护的分 区, 执行步骤 3016。
若所述升级镜像文件的逻辑地址对应的分区不是受写保护的分 区, 执行步骤 3019。
中央处理器可以根据所述升级镜像文件的逻辑地址对应的分区 的分区号判断所述分区是否是需要写保护的分区, 若根据所述升级 镜像文件的逻辑地址对应的分区的分区号判断所述分区是需要写保 护的分区, 判断所述升级镜像文件的逻辑地址对应的分区是否已经 写保护, 即中央处理器判断所述升级镜像文件的逻辑地址对应的分 区是否是写保护分区。
步骤 3016、 中央处理器根据所述升级镜像文件的逻辑地址查 询所述升级镜像文件的逻辑地址对应的物理地址。
中央处理器存储有所述升级镜像文件的逻辑地址对应的物理地 址, 中央处理器根据所述升级镜像文件的逻辑地址查询所述升级镜 像文件的逻辑地址对应的物理地址。
步骤 3017、 中央处理器向所述嵌入式多媒体卡发送写保护命 令。
所述写保护命令包括所述升级镜像文件的逻辑地址对应的物理 地址、 对只读分区执行写保护命令的长度和写保护命令的类型。 所 述写保护命令可以是 SET— WRITE— PROT , 对只读分区执行写保护 命令的长度可以是 SEND— WRITE— PROT , 写保护命令的类型可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写保护命令的类型为临 时写保护。 步骤 3018、 嵌入式多媒体卡根据所述中央处理器发送的写保 护命令对所述升级镜像文件的逻辑地址对应的分区写保护。
步骤 3019、 中央处理器对升级镜像文件的逻辑地址对应的分 区升级结束。
特别的, 智能终端可以同时对嵌入式多媒体卡的多个指定分区 升级, 每一个指定分区进行独立升级, 而且, 智能终端可以根据嵌 入式多媒体卡的指定分区的位置和大小动态设置写保护的控制范 围。
本发明实施例所述的数据处理方法, 智能终端的中央处理器向 嵌入式多媒体卡发送写保护命令, 嵌入式多媒体卡预先对嵌入式多 媒体卡的只读分区写保护, 然后, 智能终端在升级过程中, 若需要 对已经写保护的嵌入式多媒体卡的只读分区的数据改写, 智能终端 的中央处理器向嵌入式多媒体卡发送写保护取消命令, 嵌入式多媒 体卡对嵌入式多媒体卡的只读分区取消写保护, 改写嵌入式多媒体 卡的只读分区的数据, 再者, 智能终端的中央处理器向嵌入式多媒 体卡发送写保护命令, 对改写后的嵌入式多媒体卡的只读分区的再 写保护, 相对于现有技术, 在保证正常升级不受影响的前提下, 能 够有效地解决 eMMC只读分区数据被异常改写的问题。
实施例四
本发明实施例的目 的在于智能终端处于超级用户权限 ( root ) 状态下, 智能终端对嵌入式多媒体卡中需要写保护的指定分区进行 升级时, 对嵌入式多媒体卡中需要写保护的指定分区进行写保护的 控制, 所述指定分区可以是整个只读分区或只读分区的一部分。
本发明实施例提供一种数据处理方法, 应用于中央处理器和嵌 入式多媒体卡 ( eMMC ) , 所述嵌入式多媒体卡设置有只读分区, 如图 5所示, 包括:
步骤 401、 中央处理器获取数字版权管理密码。 用 户 可以通过智 能终端从互联 网 上获取数字版权管理
( Widevine ) 密码, 再通过 fastboot输入 Widevine密码。
步骤 402、 中央处理器判断数字版权管理密码是否与预设的数 字版权管理密码相等。
中央处理器存储有预设的数字版权管理 ( Widevine ) 密码, 若 数字版权管理 ( Widevine ) 密码与预设的数字版权管理 ( Widevine ) 密码相等, 解除 Widevine密码对智能终端的锁定, 则该智能终端处 于超级用户权限 ( root ) 状态, 执行步骤 403。
若数字版权管理 ( Widevine ) 密码与预设的数字版权管理 ( Widevine ) 密码不相等, 流程结束。 执行步骤 4017。
步骤 403、 中央处理器设置刷机标志。
中央处理器可以允许对系统 ( System ) 分区的数据、 工程模式 ( Recovery ) 分区的数据、 Cust 分区的数据等分区的数据改写, 通 过 fastboot输入正确 Widevine密码后, 则设置刷机标志。
需要说明的是, 刷机是针对智能终端专业术语, 是指通过一定 的方法更改或替换智能终端中原本存在的一些语言、 图片、 铃声、 软件或者操作系统等, 即给智能终端重装系统, 不恰当的删除一些 程序或文件会导致智能终端某些功能异常, 甚至无法正常启动 , 因此, 当智能终端不在超级用户权限( root )状态时, 对智能终端刷 机后, 终端厂商对刷机用户都不再提供保修服务。
步骤 404、 中央处理器获取升级数据包中升级文件的逻辑地 址。
需要说明的是, 所述升级数据包包括至少一个升级文件、 每一 个所述升级文件的逻辑地址、 每一个所述升级文件的文件名和每一 个所述升级文件的版本号等信息。
步骤 405、 中央处理器根据所述升级文件的逻辑地址, 查询预 设的逻辑地址与只读分区之间的对应关系, 获取所述升级文件的逻 辑地址对应的分区。
中央处理器存储有嵌入式多媒体卡的所有预设的逻辑地址与只 读分区之间的对应关系, 中央处理器先根据所述升级文件的逻辑地 址与中央处理器存储的嵌入式多媒体卡的所有预设的逻辑地址进行 比较, 得到与所述升级文件的逻辑地址相等的预设的逻辑地址, 然 后, 根据所述预设的逻辑地址与只读分区之间的对应关系得到嵌入 式多媒体卡的分区, 即所述分区为所述升级文件的逻辑地址对应的 分区。
本发 明 实 施例假设升 级文件 为 系 统分 区 的 应 用 软件
( /system/app ) 。
步骤 406、 中央处理器判断系统分区是否是写保护分区。
若系统分区是写保护分区, 执行步骤 407。
若系统分区不是写保护分区, 执行步骤 4010。
中央处理器可以根据系统分区的分区号判断所述分区是否是需 要写保护的分区, 若根据所述系统分区的分区号判断所述分区是需 要写保护的分区, 判断所述系统分区是否已经写保护, 即中央处理 器判断系统分区是否是写保护分区。
步骤 407、 中央处理器根据系统分区的逻辑地址查询系统分区 的物理地址。
中央处理器存储有所述系统分区的逻辑地址与系统分区之间的 对应关系, 中央处理器根据系统分区的逻辑地址查询系统分区的物 理地址。
步骤 408、 中央处理器向所述嵌入式多媒体卡发送写保护取消 命令和升级文件。
所述写保护取消命令包括嵌入式多媒体卡的系统分区的物理地 址、 对系统分区执行写保护取消命令的长度和写保护取消命令的类 型。 所述写保护取消命令可以是 CLR— WRITE— PROT , 对系统分区 执行写保护取消命令的长度可以是 SEND— WRITE— PROT , 写保护取 消命令的类型可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写 保护取消命令的类型为临时取消写保护。
步骤 409、 嵌入式多媒体卡根据所述中央处理器发送的写保护 取消命令对系统分区取消写保护。
步骤 4010、 嵌入式多媒体卡改写系统分区的数据。
嵌入式多媒体卡接收中央处理器传输的数据, 改写系统分区的 数据, 然后, 向中央处理器发送写入完成消息。
步骤 401 1、 嵌入式多媒体卡向中央处理器发送写入完成消 息。
所述写入完成消息包括系统分区的逻辑地址, 所述写入完成消 息为所述嵌入式多媒体卡将所述升级文件中的数据成功写入到系统 分区的消息。
步骤 4012、 中央处理器根据所述升级文件的逻辑地址, 查询 预设的逻辑地址与只读分区之间的对应关系, 获取系统分区。
中央处理器存储有嵌入式多媒体卡的所有预设的逻辑地址与只 读分区之间的对应关系, 中央处理器先根据所述升级文件的逻辑地 址与中央处理器存储的嵌入式多媒体卡的所有预设的逻辑地址进行 比较, 得到与所述升级文件的逻辑地址相等的预设的逻辑地址, 然 后, 根据所述预设的逻辑地址与只读分区之间的对应关系得到嵌入 式多媒体卡的系统分区, 即所述分区为所述升级文件的逻辑地址对 应的分区。
步骤 4013、 中央处理器判断所述系统分区是否是受写保护的 分区。
若所述系统分区是受写保护的分区, 执行步骤 4014。
若所述系统分区不是受写保护的分区, 执行步骤 4017。 区号判断所述系统分区是否是需要写保护的分区, 若根据所述升级 文件的逻辑地址对应的分区的分区号判断所述系统分区是需要写保 护的分区, 判断所述系统分区是否已经写保护, 即中央处理器判断 所述升级文件的逻辑地址对应的分区是否是写保护分区。
步骤 4014、 中央处理器根据所述升级文件的逻辑地址查询所
中央处理器根据所述升级文件的逻辑地址查询所述升级文件的逻辑 地址对应的物理地址。
步骤 4015、 中央处理器向所述嵌入式多媒体卡发送写保护命 令。 和、 对系统分区执行写保护命令的长度和写保护命令的类型。 所述 写保护命令可以是 SET— WRITE— PROT , 对系统分区执行写保护命 令的长度可以是 SEND— WRITE— PROT , 写保护命令的类型可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写保护命令的类型为临 时写保护。
步骤 4016、 嵌入式多媒体卡根据所述中央处理器发送的写保 护命令对所述系统分区写保护。
步骤 4017、 中央处理器对嵌入式多媒体卡的系统分区升级结 束。
需要说明的是, 在智能终端处于超级用户权限( root )状态时, 智能终端仍对 Bootloader 分区写保护, 可以允许对系统 ( System ) 分区、 工程模式( Recovery )分区、 Cust分区取消写保护; 步骤 4012 至步骤 401 6为可选步骤。
本发明实施例所述的数据处理方法, 智能终端的中央处理器向 嵌入式多媒体卡发送写保护命令, 嵌入式多媒体卡预先对嵌入式多 媒体卡的只读分区写保护, 智能终端处于超级用户权限( root )状态 下, 用户可以有选择地删除、 增加或修改嵌入式多媒体卡的只读分 区的数据, 智能终端的中央处理器向嵌入式多媒体卡发送写保护取 消命令, 嵌入式多媒体卡对用户选择的嵌入式多媒体卡的系统分区 取消写保护, 改写嵌入式多媒体卡的系统分区的数据, 再者, 智能 终端的中央处理器根据用户的要求向嵌入式多媒体卡发送写保护命 令, 对改写后的嵌入式多媒体卡的系统分区的再写保护, 相对于现 有技术, 在智能终端处于超级用户权限( root )状态下, 通过对嵌入 式多媒体卡的已经写保护的系统分区取消写保护后, 对嵌入式多媒 体卡的系统分区的数据改写, 再对嵌入式多媒体卡的系统分区使能 嵌入式多媒体卡的写保护功能, 在保证正常升级不受影响的前提 下, 能够有效地解决嵌入式多媒体卡的系统分区数据被异常改写的 问题。
实施例五
本发明实施例的目 的在于智能终端嵌入式多媒体卡中需要写保 护的只读分区的文件在挂载时, 对嵌入式多媒体卡中需要写保护的 只读分区进行写保护的控制。
本发明实施例提供一种数据处理方法, 应用于中央处理器和嵌 入式多媒体卡 ( eMMC ) , 假设智能终端正处于开机启动状态, 嵌 入式多媒体卡的分区处于挂载( mount )状态, 如图 6所示, 包括: 步骤 501、 中央处理器获取嵌入式多媒体卡的挂载分区的逻辑 地址。
步骤 502、 中央处理器根据所述挂载分区的逻辑地址, 查询预 设的逻辑地址与只读分区之间的对应关系, 获取所述挂载分区。
中央处理器存储有嵌入式多媒体卡的所有预设的逻辑地址与只 读分区之间的对应关系, 中央处理器先根据所述挂载分区的逻辑地 址与中央处理器存储的嵌入式多媒体卡的所有预设的逻辑地址进行 比较, 得到与所述挂载分区的逻辑地址相等的预设的逻辑地址, 然 后, 根据所述预设的逻辑地址与只读分区之间的对应关系得到嵌入 式多媒体卡的分区, 即所述分区为所述挂载分区的逻辑地址对应的 分区。
步骤 503、 中央处理器判断所述挂载分区是否是写保护分区。 若所述挂载分区是写保护分区, 执行步骤 504。
若所述挂载分区不是写保护分区, 执行步骤 508。
中央处理器可以根据挂载分区的分区号判断所述分区是否是需 要写保护的分区, 若根据所述挂载分区的分区号判断所述分区是需 要写保护的分区, 判断所述挂载分区是否已经写保护, 即中央处理 器判断所述挂载分区的逻辑地址对应的分区是否是写保护分区。
步骤 504、 中央处理器设置挂载开始标志。
中央处理器对所述挂载分区设置挂载开始标志。 所述挂载可以 是在访问存储设备中的文件时, 需要将文件所在的分区挂载到智能 终端一个已存在的目 录上, 然后通过访问所述目 录来访问存储设 备。
步骤 505、 中央处理器根据挂载分区的逻辑地址查询挂载分区 的物理地址。
步骤 506、 中央处理器向嵌入式多媒体卡发送写保护取消命 令。
所述写保护取消命令包括挂载分区的物理地址、 对挂载分区执 行写保护取消命令的长度和写保护取消命令的类型。
所述写保护取消命令可以是 CLR— WRITE— PROT , 对只读分区 执行写保护取消命令的长度可以是 SEND— WRITE— PROT , 写保护取 消命令的类型可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写 保护取消命令的类型为临时取消写保护。
步骤 507、 嵌入式多媒体卡根据所述中央处理器发送的写保护 取消命令对挂载分区取消写保护。
嵌入式多媒体卡接收到写保护取消命令后, 嵌入式多媒体卡的 控制器根据写保护取消命令对挂载分区取消写保护。
步骤 508、 嵌入式多媒体卡读取挂载分区的数据, 并更新超级 块 ( Super Block ) 信息。
步骤 509、 嵌入式多媒体卡向中央处理器发送挂载结束消息。 所述挂载结束消息包括挂载分区的逻辑地址。
步骤 5010、 中央处理器根据挂载分区的逻辑地址, 查询预设 的逻辑地址与只读分区之间的对应关系, 获取所述挂载分区。
中央处理器存储有嵌入式多媒体卡的所有预设的逻辑地址与只 读分区之间的对应关系, 中央处理器先根据所述挂载分区的逻辑地 址与中央处理器存储的嵌入式多媒体卡的所有预设的逻辑地址进行 比较, 得到与所述挂载分区的逻辑地址相等的预设的逻辑地址, 然 后, 根据所述预设的逻辑地址与只读分区之间的对应关系得到嵌入 式多媒体卡的分区, 即所述分区为所述挂载分区。
步骤 501 1、 中央处理器判断所述挂载分区是否是受写保护的 分区。
若所述挂载分区是受写保护的分区, 执行步骤 5012。
若所述挂载分区不是受写保护的分区, 执行步骤 5016。
中央处理器可以根据挂载分区的分区号判断所述分区是否是需 要写保护的分区, 若根据所述挂载分区的分区号判断所述分区是需 要写保护的分区, 判断所述挂载分区是否已经写保护, 即中央处理 器判断所述挂载分区是否是写保护分区。
步骤 5012、 中央处理器根据所述挂载分区的逻辑地址查询所 述挂载分区的逻辑地址对应的物理地址。
中央处理器存储有所述挂载分区的逻辑地址对应的物理地址, 中央处理器根据所述挂载分区的逻辑地址查询所述挂载分区的逻辑 地址对应的物理地址。
步骤 5013、 中央处理器向所述嵌入式多媒体卡发送写保护命 令。
所述写保护命令包括所述挂载分区的逻辑地址对应的物理地 址、 对挂载分区执行写保护命令的长度和写保护命令的类型。
所述写保护命令可以是 SET— WRITE— PROT , 对挂载分区执行 写保护命令的长度可以是 SEND— WRITE— PROT , 写保护命令的类型 可以是 SEND— WRITE— PROT— TYPE , 本发明所述的写保护命令的类 型为临时写保护。
步骤 5014、 嵌入式多媒体卡根据所述中央处理器发送的写保 护命令对所述挂载分区写保护。
步骤 5015、 中央处理器设置挂载分区的挂载结束标志。
步骤 5016、 中央处理器挂载嵌入式多媒体卡的分区结束。
特别的, 本发明实施例所述挂载开始标志和挂载结束标志用于 监控智能终端的异常掉电情况。
需要说明的是, 在智能终端处于超级用户权限( root )状态时, 嵌入式多媒体卡的只读分区也可能处于挂载状态, 中央处理器需要 对嵌入式多媒体卡的只读分区设置挂载标志, 在对嵌入式多媒体卡 的只读分区改写后设置挂载结束标志, 这样一来, 若在对嵌入式多 媒体卡的只读分区改写时出现掉电时, 嵌入式多媒体卡可以根据挂 载标志判断是异常掉电, 可以根据中央处理器发送的写保护命令重 新设置对所述需要写保护的所述嵌入式多媒体卡的只读分区写保 护, 从而有效地避免需要写保护的所述嵌入式多媒体卡的只读分区 没有写保护时异常改写该只读分区的数据。
需要说明的是, 在本发明所述的实施例一至实施例四中的任意 一个实施例所述的方法之后, 本发明还包括实施例五所述的方法。
实施例六 本发明实施例的目 的在于智能终端记录嵌入式多媒体卡中需要 写保护的只读分区的写保护状态。
本发明实施例提供一种数据处理方法, 应用于中央处理器和嵌 入式多媒体卡 ( eMMC ) , 如图 7所示, 包括:
步骤 601、 中央处理器读取嵌入式多媒体卡的所有分区的只读 状态属性控制信息。
所述只读状态属性控制信息包括分区号、 分区写保护属性、 分 区下次开机写保护状态和分区当前写保护状态。 只读状态属性控制 信息可以包括在 misc分区。 其中, 分区号可以是嵌入式多媒体卡的 分区的标识; 分区写保护属性用于指示嵌入式多媒体卡的分区是写 保护还是非写保护; 分区下次开机写保护状态用于指示智能终端下 次开机时嵌入式多媒体卡的分区是写保护还是非写保护, 可以预先 设置分区下次开机写保护状态为写保护状态或非写保护状态; 分区 当前写保护状态表示当前嵌入式多媒体卡的分区为写保护状态还是 非写保护状态。
对智能终端的每一个分区的只读状态属性控制信息, 可以通过 只读状态属性结构体, 记录每个分区的只读属性。 定义如下:
struct partition— info
{
int parti— no; 〃分区号
int parti— rw— protection; 〃分区写保护属性
int parti— rw— status— poweron; 〃分区下次开机写保护状态 int parti— rw— status; 〃分区当前写保护 夫态
}
步骤 602、 中央处理器根据分区号判断所述分区号对应的分区 是否是受写保护的分区。
中央处理器从所述只读状态属性控制信息中读取所述分区号对 应的分区写保护属性, 判断所述分区号对应的分区是否是受写保护 的分区。
若所述分区号对应的分区是受写保护的分区, 执行步骤 603。 受写保护的分区可以是只读分区, 例如系统 ( System ) 分区、 工程模式 ( Recovery ) 分区、 Cust 分区; 不受写保护的分区可以是 可读可写, 例如用户数据( User data )分区和 U盘( U-disk )分区。
步骤 603、 中央处理器从所述只读状态属性控制信息中读取所 述分区号对应的分区下次开机写保护状态。
用户可以 自主设置分区下次开机写保护状态。
步骤 604、 中央处理器判断所述分区号对应的分区下次开机写 保护状态是否是写保护状态。
若所述分区号对应的分区下次开机写保护状态是写保护状态, 或者, 若所述分区号对应的分区下次开机写保护状态不是写保护状 态, 执行步骤 605。
步骤 605、 中央处理器判断所述分区号对应的分区是否是写保 护分区。
中央处理器从所述只读状态属性控制信息中读取所述分区号对 应的分区当前写保护状态, 判断所述分区号对应的分区是否是写保 护分区。
当所述分区号对应的分区下次开机写保护状态是写保护状态 时, 若所述分区号对应的分区不是写保护分区, 执行步骤 606a; 若 所述分区号对应的分区是写保护分区, 执行步骤 6010。
当所述分区号对应的分区下次开机写保护状态不是写保护状态 时, 若所述分区号对应的分区不是写保护分区, 执行步骤 6010 ; 若 所述分区号对应的分区是写保护分区, 执行步骤 606b。
步骤 606a、 中央处理器向嵌入式多媒体卡发送写保护命令。 执行步骤 607。 所述写保护命令包括挂载分区物理地址。
步骤 607、 嵌入式多媒体卡根据所述中央处理器发送的写保护 命令对所述分区号对应的分区写保护。 执行步骤 609。
步骤 606b、 中央处理器向嵌入式多媒体卡发送写保护取消命 令。 执行步骤 608。
所述写保护取消命令包括挂载分区物理地址。
步骤 608、 嵌入式多媒体卡根据所述中央处理器发送的写保护 取消命令对所述分区号对应的分区取消写保护。 执行步骤 609。
步骤 609、 嵌入式多媒体卡向中央处理器发送响应消息。 执行 步骤 6010。
当嵌入式多媒体卡根据所述中央处理器发送的写保护命令对所 述分区号对应的分区写保护, 嵌入式多媒体卡向中央处理器发送响 应消息, 所述响应消息包括写保护完成响应。
当嵌入式多媒体卡根据所述中央处理器发送的写保护取消命令 对所述分区号对应的分区取消写保护, 嵌入式多媒体卡向中央处理 器发送响应消息, 所述响应消息包括取消写保护完成响应。
步骤 6010、 中央处理器更新所述分区当前写保护状态。 执行 步骤 601 1。
当所述分区号对应的分区下次开机写保护状态是写保护状态 时, 中央处理器更新所述分区当前写保护状态为写保护状态。
当所述分区号对应的分区下次开机写保护状态不是写保护状态 时, 中央处理器更新所述分区当前写保护状态为非写保护状态。
步骤 601 1、 中央处理器校验嵌入式多媒体卡的分区结束。
本发明实施例所述的数据处理方法, 通过设置嵌入式多媒体卡 的所有分区的只读状态属性控制信息, 来监控嵌入式多媒体卡的所 有分区的写保护状态, 在智能终端每次改写嵌入式多媒体卡的分区 的数据后, 更新所述分区的分区当前写保护状态, 相对于现有技 术, 使能嵌入式多媒体卡的写保护功能, 对嵌入式多媒体卡的分区 写保护, 再实时监控嵌入式多媒体卡的所有分区的写保护状态, 能 够有效防止异常改写嵌入式多媒体卡的分区的数据。
需要说明的是, 本发明所述的数据处理方法, 嵌入式多媒体卡 根据写保护取消命令取消分区的写保护包括:
在智能终端的中央处理器的高通端口强制加载模式时, 强制对 嵌入式多媒体卡的分区改写;
嵌入式多媒体卡的分区的数据升级;
数字版权管理 ( Widevine ) 密码解锁;
挂载( mount )分区或非挂载( umount )分区修改超级块( Super Block ) 信息;
智能终端处于超级用户权限 ( root ) 状态;
嵌入式多媒体卡根据写保护命令写保护分区包括:
智能终端的烧片版本正常启动;
智能终端的升级版本正常启动;
数字版权管理 ( Widevine ) 密码加锁;
分区挂载 ( mount ) 或非挂载 ( umount ) 过程中;
智能终端的重启后。
本发明所述的数据处理方法, 智能终端使能嵌入式多媒体卡的 写保护功能, 对嵌入式多媒体卡的分区写保护, 在正常的智能终端 升级流程中或智能终端处于超级用户权限( root )状态, 通过对嵌入 式多媒体卡的分区取消写保护, 对嵌入式多媒体卡的分区的数据改 写, 再对嵌入式多媒体卡的分区使能嵌入式多媒体卡的写保护功 能, 能够有效防止黑客或发烧友在非法超级用户权限( root )状态下 异常改写嵌入式多媒体卡的分区的数据, 或智能终端存储的程序出 现缺陷的情况下异常改写嵌入式多媒体卡的分区的数据。
实施例七 本发明实施例提供一种嵌入式多媒体卡 70 , 如图 8所示, 所述 嵌入式多媒体卡 70包括只读分区, 包括:
第一接收单元 701 , 用于接收中央处理器发送的写保护取消命 令;
第一执行单元 702 , 用于对所述只读分区中用于存储升级文件 的指定分区执行所述写保护取消命令;
第二接收单元 703 , 用于接收所述中央处理器发送的所述升级 文件;
写入单元 704 , 用于将所述升级文件写入到所述指定分区中; 发送单元 705 , 用于所述升级文件写入完成后, 向所述中央处 理器发送写入完成消息;
第三接收单元 706 , 用于接收所述中央处理器发送的写保护命 令;
第二执行单元 707 , 用于对所述指定分区执行所述写保护命 令。
这样一来, 在改写嵌入式多媒体卡的指定分区的数据之前, 智 能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护取消命 令, 然后, 该嵌入式多媒体卡将升级文件写入到所述指定分区, 该 嵌入式多媒体卡再对所述指定分区执行写保护命令, 相对于现有技 术, 在保证正常升级不受影响的前提下, 能够有效地解决嵌入式多 媒体卡的指定分区数据被异常改写的问题。
如图 9所示, 所述嵌入式多媒体卡 70还包括:
第三执行单元 708 , 用于对需要写保护的所述只读分区执行所 述中央处理器发送的写保护命令。
所述写保护取消命令包括物理地址和对所述指定分区执行所述 写保护取消命令的长度, 所述写保护命令包括物理地址和对所述指 定分区执行所述写保护命令的长度, 所述物理地址为需要将所述升 级文件写入所述嵌入式多媒体卡的物理地址。
实施例八
本发明实施例提供一种中央处理器 80 , 如图 10所示, 包括: 第一发送单元 801 , 用于向嵌入式多媒体卡发送写保护取消命 令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分区; 第二发送单元 802 , 用于向所述嵌入式多媒体卡发送升级文 件;
接收单元 803 , 用于接收所述嵌入式多媒体卡发送的写入完成 消息, 所述写入完成消息包括所述升级文件的逻辑地址, 所述写入 完成消息为所述嵌入式多媒体卡将所述升级文件成功写入到所述升 级文件的指定分区的消息;
第三发送单元 804 , 用于向所述嵌入式多媒体卡发送写保护命 令。
这样一来, 在改写嵌入式多媒体卡的指定分区的数据之前, 先 向嵌入式多媒体卡发送写保护取消命令, 以及升级文件, 以便于智 能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护取消命 令, 并将所述升级文件写入到指定分区, 在接收到所述嵌入式多媒 体卡发送的写入完成消息后, 再向所述嵌入式多媒体卡发送写保护 命令, 重新对指定分区写保护, 相对于现有技术, 在保证正常升级 不受影响的前提下, 能够有效地解决嵌入式多媒体卡的指定分区数 据被异常改写的问题。
如图 1 1所示, 所述中央处理器 80还包括:
第一获取单元 805 , 用于获取升级数据包中升级文件的逻辑地 址, 所述升级数据包包括至少一个升级文件和每一个所述升级文件 的逻辑地址;
第一查询单元 806 , 用于根据所述升级文件的逻辑地址, 查询 预设的逻辑地址与只读分区之间的对应关系; 第二获取单元 807 , 用于获取所述升级文件的指定分区; 第一判断单元 808 , 用于判断所述升级文件的指定分区是否是 写保护分区;
第二查询单元 809 , 用于若所述升级文件的指定分区是写保护 分区, 根据所述升级文件的逻辑地址查询所述升级文件的逻辑地址 对应的物理地址, 所述物理地址为需要将所述升级文件写入所述嵌 入式多媒体卡的物理地址。
第三查询单元 8010 , 用于根据所述升级文件的逻辑地址, 查 询预设的逻辑地址与只读分区之间的对应关系;
第三获取单元 801 1 , 用于获取所述升级文件的指定分区; 第二判断单元 8012 , 用于判断所述升级文件的指定分区是否 是受写保护的分区;
第四查询单元 8013 , 用于若所述升级文件的指定分区是受写 保护的分区, 根据所述升级文件的逻辑地址查询所述升级文件的逻 辑地址对应的物理地址。
所述写保护取消命令包括所述物理地址和对所述指定分区执行 所述写保护取消命令的长度, 所述写保护命令包括所述物理地址和 对所述指定分区执行所述写保护命令的长度。
检查单元 8014 , 用于检查掉电保护标识是否是异常掉电标 识;
第四获取单元 8015 , 用于若所述掉电保护标识是异常掉电标 识, 获取需要写保护的所述嵌入式多媒体卡的只读分区的逻辑地址 对应的物理地址;
第四发送单元 8016 , 用于向所述嵌入式多媒体卡发送写保护 命令, 所述写保护命令包括所述物理地址和对所述只读分区执行写 保护命令的长度。
第一读取单元 8017 , 用于读取所述嵌入式多媒体卡的所有分 区的只读状态属性控制信息, 所述只读状态属性控制信息包括分区 号、 分区写保护属性、 分区下次开机写保护状态和分区当前写保护 状态;
第三判断单元 8018 , 用于根据所述分区号判断所述分区号对 应的分区是否是受写保护的分区;
第二读取单元 8019 , 用于若所述分区号对应的分区是受写保 护的分区, 从所述只读状态属' f生控制信息中读取所述分区号对应的 分区下次开机写保护状态。
第四判断单元 8020 , 用于判断所述分区号对应的分区下次开 机写保护状态是否是写保护状态;
所述第四判断单元 8020 还用于若所述分区号对应的分区下次 开机写保护状态是写保护状态, 判断所述分区号对应的分区是否是 写保护分区;
设置单元 8021 , 用于若所述分区号对应的分区不是写保护分 区, 将所述分区设置为写保护分区;
第一更新单元 8022 , 用于更新所述分区当前写保护状态为写 保护状态;
所述第一更新单元 8022 还用于若所述分区号对应的分区是写 保护分区, 更新所述分区当前写保护状态。
所述第四判断单元 8020 , 用于判断所述分区号对应的分区下 次开机写保护状态是否是写保护状态;
所述第四判断单元 8020 , 用于若所述分区号对应的分区下次 开机写保护状态不是写保护状态, 判断所述分区号对应的分区是否 是写保护分区;
取消单元 8023 , 用于若所述分区号对应的分区是写保护分 区, 取消对所述分区的写保护;
第二更新单元 8024 , 用于更新所述分区当前写保护状态; 所述第二更新单元 8024 还用于若所述分区号对应的分区不是 写保护分区, 更新所述分区当前写保护状态。
实施例九
本发明实施例提供一种嵌入式多媒体卡 90 , 所述嵌入式多媒 体卡 90包括只读分区, 如图 12所示, 所述嵌入式多媒体卡包括: 接收机 901 , 用于接收中央处理器发送的写保护取消命令; 存储器 902 , 用于存储程序代码;
处理器 903 , 用于调用所述存储器存储的程序代码执行如下方 法: 对所述只读分区中用于存储升级文件的指定分区执行所述写保 护取消命令;
所述接收机 901还用于接收所述中央处理器发送的所述升级文 件;
所述处理器 903执行的方法还包括: 将所述升级文件写入到所 述指定分区中;
发射机 904 , 用于所述升级文件写入完成后, 向所述中央处理 器发送写入完成消息;
所述接收机 901 还用于接收所述中央处理器发送的写保护命 令;
所述处理器 903执行的方法还包括: 对所述指定分区执行所述 写保护命令。
这样一来, 在改写嵌入式多媒体卡的指定分区的数据之前, 智 能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护取消命 令, 然后, 该嵌入式多媒体卡将升级文件写入到所述指定分区, 该 嵌入式多媒体卡再对所述指定分区执行写保护命令, 相对于现有技 术, 在保证正常升级不受影响的前提下, 能够有效地解决嵌入式多 媒体卡的指定分区数据被异常改写的问题。
所述处理器 903执行的方法还包括: 对需要写保护的所述只读 分区执行所述中央处理器发送的写保护命令。
所述写保护取消命令包括物理地址和对所述指定分区执行所述 写保护取消命令的长度, 所述写保护命令包括物理地址和对所述指 定分区执行所述写保护命令的长度, 所述物理地址为需要将所述升 级文件写入所述嵌入式多媒体卡的物理地址。
实施例十
本发明实施例提供一种中央处理器 100 , 如图 13所示, 包括: 发射机 1001 , 用于向嵌入式多媒体卡发送写保护取消命令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分区;
所述发射机 1001 还用于向所述嵌入式多媒体卡发送升级文 件;
接收机 1002 , 用于接收所述嵌入式多媒体卡发送的写入完成 消息, 所述写入完成消息包括所述升级文件的逻辑地址, 所述写入 完成消息为所述嵌入式多媒体卡将所述升级文件成功写入到所述升 级文件的指定分区的消息;
所述发射机 1001 还用于向所述嵌入式多媒体卡发送写保护命 令。
这样一来, 在改写嵌入式多媒体卡的指定分区的数据之前, 先 向嵌入式多媒体卡发送写保护取消命令, 以及升级文件, 以便于智 能终端的嵌入式多媒体卡对升级文件的指定分区执行写保护取消命 令, 并将所述升级文件写入到指定分区, 在接收到所述嵌入式多媒 体卡发送的写入完成消息后, 再向所述嵌入式多媒体卡发送写保护 命令, 重新对指定分区写保护, 相对于现有技术, 在保证正常升级 不受影响的前提下, 能够有效地解决嵌入式多媒体卡的指定分区数 据被异常改写的问题。
如图 14所示, 所述中央处理器 100还包括:
存储器 1003 , 用于存储程序代码; 处理器 1004 , 用于调用所述存储器存储的程序代码执行如下 方法: 至少一个升级文件和每一个所述升级文件的逻辑地址;
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分 区之间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是写保护分区;
若所述升级文件的指定分区是写保护分区, 根据所述升级文件 理地址为需要将所述升级文件写入所述嵌入式多媒体卡的物理地 址。
所述处理器 1004执行的方法还包括:
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分 区之间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是受写保护的分区; 若所述升级文件的指定分区是受写保护的分区, 根据所述升级 所述写保护取消命令包括所述物理地址和对所述指定分区执行 所述写保护取消命令的长度, 所述写保护命令包括所述物理地址和 对所述指定分区执行所述写保护命令的长度。
所述处理器 1004执行的方法还包括:
检查掉电保护标识是否是异常掉电标识;
若所述掉电保护标识是异常掉电标识, 获取需要写保护的所述 嵌入式多媒体卡的只读分区的逻辑地址对应的物理地址;
所述发射机还用于向所述嵌入式多媒体卡发送写保护命令, 所 述写保护命令包括所述物理地址和对所述只读分区执行写保护命令 的长度。
所述处理器 1004执行的方法还包括:
读取所述嵌入式多媒体卡的所有分区的只读状态属性控制信 息, 所述只读状态属性控制信息包括分区号、 分区写保护属性、 分 区下次开机写保护状态和分区当前写保护状态;
根据所述分区号判断所述分区号对应的分区是否是受写保护的 分区;
若所述分区号对应的分区是受写保护的分区, 从所述只读状态 属性控制信息中读取所述分区号对应的分区下次开机写保护状态。
所述处理器 1004执行的方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护 状态;
若所述分区号对应的分区下次开机写保护状态是写保护状态, 判断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区不是写保护分区, 将所述分区设置为 写保护分区;
更新所述分区当前写保护状态为写保护状态;
若所述分区号对应的分区是写保护分区, 更新所述分区当前写 保护状态。
所述处理器 1004执行的方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护 状态;
若所述分区号对应的分区下次开机写保护状态不是写保护状 态, 判断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区是写保护分区, 取消对所述分区的写 保护; 更新所述分区当前写保护状态;
若所述分区号对应的分区不是写保护分区, 更新所述分区当前 写保护状态。
实施例十一
本发明实施例提供一种智能终端 1 10 , 如图 15所示, 包括: 嵌 入式多媒体卡 1 101和中央处理器 1 102 ,
所述嵌入式多媒体卡 1 101 用于: 接收中央处理器发送的写保 护取消命令; 对所述只读分区中用于存储升级文件的指定分区执行 所述写保护取消命令; 接收所述中央处理器发送的所述升级文件; 将所述升级文件写入到所述指定分区中; 所述升级文件写入完成 后, 向所述中央处理器发送写入完成消息; 接收所述中央处理器发 送的写保护命令; 对所述指定分区执行所述写保护命令。
所述中央处理器 1 102 用于: 向嵌入式多媒体卡发送写保护取 消命令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分 区; 向所述嵌入式多媒体卡发送升级文件; 接收所述嵌入式多媒体 卡发送的写入完成消息, 所述写入完成消息包括所述升级文件的逻 辑地址, 所述写入完成消息为所述嵌入式多媒体卡将所述升级文件 成功写入到所述升级文件的指定分区的消息; 向所述嵌入式多媒体 卡发送写保护命令。
所属领域的技术人员可以清楚地了解到, 为描述的方便和简 洁, 上述描述的装置和单元的具体工作过程, 可以参考前述方法实 施例中的对应过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的装置 和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施 例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能 划分, 实际实现时可以有另外的划分方式, 例如多个单元或组件可 以结合或者可以集成到另一个系统, 或一些特征可以忽略, 或不执 行。 另一点, 所显示或讨论的相互之间的耦合或直接耦合或通信连 接可以是通过一些接口, 装置或单元的间接耦合或通信连接, 可以 是电性, 机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分 开的, 作为单元显示的部件可以是或者也可以不是物理单元, 即可 以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实 际的需要选择其中的部分或者全部单元来实现本实施例方案的 目 的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处 理单元中, 也可以是各个单元单独物理包括, 也可以两个或两个以 上单元集成在一个单元中。 上述集成的单元既可以采用硬件的形式 实现, 也可以采用硬件加软件功能单元的形式实现。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或 部分步骤可以通过程序指令相关的硬件来完成, 前述的程序可以存 储于一计算机可读取存储介质中, 该程序在执行时, 执行包括上述 方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM、 磁碟 或者光盘等各种可以存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围 并不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技 术范围内, 可轻易想到变化或替换, 都应涵盖在本发明的保护范围 之内。 因此, 本发明的保护范围应以所述权利要求的保护范围为

Claims

权 利 要 求 书
1、 一种数据处理方法, 应用于嵌入式多媒体卡, 所述嵌入式多媒体 卡包括只读分区, 其特征在于, 所述方法包括:
接收中央处理器发送的写保护取消命令;
对所述只读分区中用于存储升级文件的指定分区执行所述写保护取 消命令;
接收所述中央处理器发送的所述升级文件;
将所述升级文件写入到所述指定分区中;
所述升级文件写入完成后, 向所述中央处理器发送写入完成消息; 接收所述中央处理器发送的写保护命令;
对所述指定分区执行所述写保护命令。
2、 根据权利要求 1所述的数据处理方法, 其特征在于, 在所述接收 中央处理器发送的写保护取消命令之前, 所述方法还包括:
对需要写保护的所述只读分区执行所述中央处理器发送的写保护命 令。
3、 根据权利要求 1-2任意一项权利要求所述的数据处理方法, 其特 征在于, 所述写保护取消命令包括物理地址和对所述指定分区执行所述 写保护取消命令的长度, 所述写保护命令包括物理地址和对所述指定分 区执行所述写保护命令的长度, 所述物理地址为需要将所述升级文件写 入所述嵌入式多媒体卡的物理地址。
4、 一种数据处理方法, 应用于中央处理器, 其特征在于, 所述方法 包括:
向嵌入式多媒体卡发送写保护取消命令; 其中, 所述嵌入式多媒体 卡包括处于写保护状态的只读分区;
向所述嵌入式多媒体卡发送升级文件;
接收所述嵌入式多媒体卡发送的写入完成消息, 所述写入完成消息 包括所述升级文件的逻辑地址, 所述写入完成消息为所述嵌入式多媒体 卡将所述升级文件成功写入到所述升级文件的指定分区的消息;
向所述嵌入式多媒体卡发送写保护命令。
5、 根据权利要求 4所述的数据处理方法, 其特征在于, 在所述向嵌 入式多媒体卡发送写保护取消命令之前, 所述方法还包括:
获取升级数据包中升级文件的逻辑地址, 所述升级数据包包括至少 一个升级文件和每一个所述升级文件的逻辑地址;
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分区之 间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是写保护分区;
若所述升级文件的指定分区是写保护分区, 根据所述升级文件的逻 需要将所述升级文件写入所述嵌入式多媒体卡的物理地址。
6、 根据权利要求 5所述的数据处理方法, 其特征在于, 在所述接收 所述嵌入式多媒体卡发送的写入完成消息之后, 所述方法还包括:
根据所述升级文件的逻辑地址, 查询预设的逻辑地址与只读分区之 间的对应关系;
获取所述升级文件的指定分区;
判断所述升级文件的指定分区是否是受写保护的分区;
若所述升级文件的指定分区是受写保护的分区, 根据所述升级文件 的逻辑地址查询所述升级文件的逻辑地址对应的物理地址。
7、 根据权利要求 4-6任意一项权利要求所述的数据处理方法, 其特 征在于, 所述写保护取消命令包括所述物理地址和对所述指定分区执行 所述写保护取消命令的长度, 所述写保护命令包括所述物理地址和对所 述指定分区执行所述写保护命令的长度。
8、 根据权利要求 7所述的数据处理方法, 其特征在于, 在所述获取 升级数据包中升级文件的逻辑地址之前, 所述方法还包括:
检查掉电保护标识是否是异常掉电标识;
若所述掉电保护标识是异常掉电标识, 获取需要写保护的所述嵌入 式多媒体卡的只读分区的逻辑地址对应的物理地址;
向所述嵌入式多媒体卡发送写保护命令, 所述写保护命令包括所述 物理地址和对所述只读分区执行写保护命令的长度。
9、 根据权利要求 4-8任意一项权利要求所述的数据处理方法, 其特 征在于, 在所述向所述嵌入式多媒体卡发送写保护命令之后, 所述方法 还包括:
读取所述嵌入式多媒体卡的所有分区的只读状态属' f生控制信息, 所 述只读状态属性控制信息包括分区号、 分区写保护属性、 分区下次开机 写保护状态和分区当前写保护状态;
根据所述分区号判断所述分区号对应的分区是否是受写保护的分 区;
若所述分区号对应的分区是受写保护的分区, 从所述只读状态属性 控制信息中读取所述分区号对应的分区下次开机写保护状态。
10、 根据权利要求 9所述的数据处理方法, 其特征在于, 在所述从 所述只读状态属性控制信息中读取所述分区号对应的分区下次开机写保 护状态之后, 所述方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护状 态;
若所述分区号对应的分区下次开机写保护状态是写保护状态, 判断 所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区不是写保护分区, 将所述分区设置为写保 护分区;
更新所述分区当前写保护状态为写保护状态;
若所述分区号对应的分区是写保护分区, 更新所述分区当前写保护 状态。
1 1、 根据权利要求 10所述的数据处理方法, 其特征在于, 在所述从 所述只读状态属性控制信息中读取所述分区号对应的分区下次开机写保 护状态之后, 所述方法还包括:
判断所述分区号对应的分区下次开机写保护状态是否是写保护状 态;
若所述分区号对应的分区下次开机写保护状态不是写保护状态, 判 断所述分区号对应的分区是否是写保护分区;
若所述分区号对应的分区是写保护分区,取消对所述分区的写保护; 更新所述分区当前写保护状态;
若所述分区号对应的分区不是写保护分区, 更新所述分区当前写保 护状态。
12、 一种嵌入式多媒体卡, 所述嵌入式多媒体卡包括只读分区, 其 特征在于, 所述嵌入式多媒体卡包括:
第一接收单元, 用于接收中央处理器发送的写保护取消命令; 第一执行单元, 用于对所述只读分区中用于存储升级文件的指定分 区执行所述写保护取消命令;
第二接收单元, 用于接收所述中央处理器发送的所述升级文件; 写入单元, 用于将所述升级文件写入到所述指定分区中;
发送单元, 用于所述升级文件写入完成后, 向所述中央处理器发送 写入完成消息;
第三接收单元, 用于接收所述中央处理器发送的写保护命令; 第二执行单元, 用于对所述指定分区执行所述写保护命令。
13、 根据权利要求 12所述的嵌入式多媒体卡, 其特征在于, 所述嵌 入式多媒体卡还包括:
第三执行单元, 用于对需要写保护的所述只读分区执行所述中央处 理器发送的写保护命令。
14、 根据权利要求 12- 13任意一项权利要求所述的嵌入式多媒体卡, 其特征在于, 所述写保护取消命令包括物理地址和对所述指定分区执行 所述写保护取消命令的长度, 所述写保护命令包括物理地址和对所述指 定分区执行所述写保护命令的长度, 所述物理地址为需要将所述升级文 件写入所述嵌入式多媒体卡的物理地址。
15、 一种中央处理器, 其特征在于, 包括:
第一发送单元, 用于向嵌入式多媒体卡发送写保护取消命令; 其中, 所述嵌入式多媒体卡包括处于写保护状态的只读分区;
第二发送单元, 用于向所述嵌入式多媒体卡发送升级文件; 接收单元, 用于接收所述嵌入式多媒体卡发送的写入完成消息, 所 述写入完成消息包括所述升级文件的逻辑地址, 所述写入完成消息为所 述嵌入式多媒体卡将所述升级文件成功写入到所述升级文件的指定分区 的消息;
第三发送单元, 用于向所述嵌入式多媒体卡发送写保护命令。
16、 根据权利要求 15所述的中央处理器, 其特征在于, 所述中央处 理器还包括:
第一获取单元, 用于获取升级数据包中升级文件的逻辑地址, 所述 升级数据包包括至少一个升级文件和每一个所述升级文件的逻辑地址; 第一查询单元, 用于根据所述升级文件的逻辑地址, 查询预设的逻 辑地址与只读分区之间的对应关系;
第二获取单元, 用于获取所述升级文件的指定分区; 第一判断单元, 用于判断所述升级文件的指定分区是否是写保护分 区;
第二查询单元, 用于若所述升级文件的指定分区是写保护分区, 根 据所述升级文件的逻辑地址查询所述升级文件的逻辑地址对应的物理地 址, 所述物理地址为需要将所述升级文件写入所述嵌入式多媒体卡的物 理地址。
17、 根据权利要求 16所述的中央处理器, 其特征在于, 所述中央处 理器还包括:
第三查询单元, 用于根据所述升级文件的逻辑地址, 查询预设的逻 辑地址与只读分区之间的对应关系;
第三获取单元, 用于获取所述升级文件的指定分区;
第二判断单元, 用于判断所述升级文件的指定分区是否是受写保护 的分区;
第四查询单元, 用于若所述升级文件的指定分区是受写保护的分区, 才艮据所述升级文件的逻辑地址查询所述升级文件的逻辑地址对应的物理 地址。
18、 根据权利要求 15- 17 任意一项权利要求所述的中央处理器, 其 特征在于, 所述写保护取消命令包括所述物理地址和对所述指定分区执 行所述写保护取消命令的长度, 所述写保护命令包括所述物理地址和对 所述指定分区执行所述写保护命令的长度。
19、 根据权利要求 18所述的中央处理器, 其特征在于, 所述中央处 理器还包括:
检查单元, 用于检查掉电保护标识是否是异常掉电标识;
第四获取单元, 用于若所述掉电保护标识是异常掉电标识, 获取需 要写保护的所述嵌入式多媒体卡的只读分区的逻辑地址对应的物理地 址;
第四发送单元, 用于向所述嵌入式多媒体卡发送写保护命令, 所述 写保护命令包括所述物理地址和对所述只读分区执行写保护命令的长 度。
20、 根据权利要求 15- 19 任意一项权利要求所述的中央处理器, 其 特征在于, 所述中央处理器还包括:
第一读取单元, 用于读取所述嵌入式多媒体卡的所有分区的只读状 态属性控制信息, 所述只读状态属性控制信息包括分区号、 分区写保护 属性、 分区下次开机写保护状态和分区当前写保护状态;
第三判断单元, 用于根据所述分区号判断所述分区号对应的分区是 否是受写保护的分区;
第二读取单元, 用于若所述分区号对应的分区是受写保护的分区, 从所述只读状态属性控制信息中读取所述分区号对应的分区下次开机写 保护状态。
21、 根据权利要求 20所述的中央处理器, 其特征在于, 所述中央处 理器还包括:
第四判断单元, 用于判断所述分区号对应的分区下次开机写保护状 态是否是写保护状态;
所述第四判断单元还用于若所述分区号对应的分区下次开机写保护 状态是写保护状态, 判断所述分区号对应的分区是否是写保护分区; 设置单元, 用于若所述分区号对应的分区不是写保护分区, 将所述 分区设置为写保护分区;
第一更新单元, 用于更新所述分区当前写保护状态为写保护状态; 所述第一更新单元还用于若所述分区号对应的分区是写保护分区, 更新所述分区当前写保护状态。
22、 根据权利要求 21所述的中央处理器, 其特征在于, 所述中央处 理器还包括:
所述第四判断单元还用于判断所述分区号对应的分区下次开机写保 护状态是否是写保护状态;
所述第四判断单元还用于若所述分区号对应的分区下次开机写保护 状态不是写保护状态, 判断所述分区号对应的分区是否是写保护分区; 取消单元, 用于若所述分区号对应的分区是写保护分区, 取消对所 述分区的写保护;
第二更新单元, 用于更新所述分区当前写保护状态;
所述第二更新单元还用于若所述分区号对应的分区不是写保护分 区, 更新所述分区当前写保护状态。
23、 一种嵌入式多媒体卡, 所述嵌入式多媒体卡包括只读分区, 其 特征在于, 所述嵌入式多媒体卡包括:
接收机, 用于接收中央处理器发送的写保护取消命令; 存储器, 用于存储程序代码;
处理器, 用于调用所述存储器存储的程序代码执行如下方法: 对所 述只读分区中用于存储升级文件的指定分区执行所述写保护取消命令; 所述接收机还用于接收所述中央处理器发送的所述升级文件; 所述处理器执行的方法还包括: 将所述升级文件写入到所述指定分 区中;
发射机, 用于所述升级文件写入完成后, 向所述中央处理器发送写 入完成消息;
所述接收机还用于接收所述中央处理器发送的写保护命令; 所述处理器执行的方法还包括: 对所述指定分区执行所述写保护命 令。
24、 根据权利要求 23所述的嵌入式多媒体卡, 其特征在于, 所述处 理器执行的方法还包括: 对需要写保护的所述只读分区执行所述中央处 理器发送的写保护命令。
25、 根据权利要求 23-24任意一项权利要求所述的嵌入式多媒体卡, 其特征在于, 所述写保护取消命令包括物理地址和对所述指定分区执行 所述写保护取消命令的长度, 所述写保护命令包括物理地址和对所述指 定分区执行所述写保护命令的长度, 所述物理地址为需要将所述升级文 件写入所述嵌入式多媒体卡的物理地址。
26、 一种中央处理器, 其特征在于, 包括:
发射机, 用于向嵌入式多媒体卡发送写保护取消命令; 其中, 所述 嵌入式多媒体卡包括处于写保护状态的只读分区;
所述发射机还用于向所述嵌入式多媒体卡发送升级文件;
接收机, 用于接收所述嵌入式多媒体卡发送的写入完成消息, 所述 写入完成消息包括所述升级文件的逻辑地址, 所述写入完成消息为所述 嵌入式多媒体卡将所述升级文件成功写入到所述升级文件的指定分区的 消息;
所述发射机还用于向所述嵌入式多媒体卡发送写保护命令。
PCT/CN2014/081253 2014-06-30 2014-06-30 一种数据处理方法及智能终端 WO2016000166A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2014/081253 WO2016000166A1 (zh) 2014-06-30 2014-06-30 一种数据处理方法及智能终端
CN201480036342.7A CN105637521B (zh) 2014-06-30 2014-06-30 一种数据处理方法及智能终端
US15/322,298 US10235048B2 (en) 2014-06-30 2014-06-30 Data processing method and smart device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2014/081253 WO2016000166A1 (zh) 2014-06-30 2014-06-30 一种数据处理方法及智能终端

Publications (1)

Publication Number Publication Date
WO2016000166A1 true WO2016000166A1 (zh) 2016-01-07

Family

ID=55018252

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/081253 WO2016000166A1 (zh) 2014-06-30 2014-06-30 一种数据处理方法及智能终端

Country Status (3)

Country Link
US (1) US10235048B2 (zh)
CN (1) CN105637521B (zh)
WO (1) WO2016000166A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641527A (zh) * 2020-05-28 2020-09-08 四川爱创科技有限公司 一种嵌入式芯片软件远程升级备份方法

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107621964A (zh) * 2017-10-19 2018-01-23 歌尔科技有限公司 程序加载方法、装置和可穿戴设备
CN108319520A (zh) * 2018-01-25 2018-07-24 张志和 基于安全存储的移动设备备用操作系统
TWI740272B (zh) * 2019-11-14 2021-09-21 和碩聯合科技股份有限公司 寫入映像檔至記憶體之裝置、方法及其非暫態電腦可讀取媒體
CN115525933B (zh) * 2022-08-26 2023-05-12 杭州杰峰科技有限公司 数据防篡改方法、装置、电子设备及存储介质
CN115952564B (zh) * 2023-03-01 2023-08-15 荣耀终端有限公司 数据写入方法和终端设备
CN116302005B (zh) * 2023-05-11 2023-08-22 合肥智芯半导体有限公司 芯片、芯片升级方法、装置、电子设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080082773A1 (en) * 2006-09-29 2008-04-03 Andrew Tomlin Systems for Managing File Allocation Table Information
CN101178661A (zh) * 2007-12-14 2008-05-14 华为技术有限公司 Flash集成bootrom的实现方法和装置
CN103366814A (zh) * 2012-03-31 2013-10-23 京信通信系统(中国)有限公司 一种Flash数据安全保护电路和方法
CN103678144A (zh) * 2012-09-05 2014-03-26 慧荣科技股份有限公司 数据储存装置与快闪存储器控制方法

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6904496B2 (en) 2002-03-25 2005-06-07 Dell Products L.P. Computer system with improved write cache and method therefor
JP4369708B2 (ja) * 2002-09-27 2009-11-25 パナソニック株式会社 データ処理装置
DE10315726A1 (de) * 2003-04-04 2004-11-04 Infineon Technologies Ag Programmgesteuerte Einheit
US7814478B2 (en) * 2005-11-09 2010-10-12 Texas Instruments Norway As Methods and apparatus for use in updating application programs in memory of a network device
CN100557567C (zh) 2007-12-21 2009-11-04 深圳市迅雷网络技术有限公司 一种软件版本更新提示的方法、系统及装置
JP2009217433A (ja) 2008-03-10 2009-09-24 Fuji Xerox Co Ltd ファイル管理プログラム及びファイル管理装置
TWI361353B (en) * 2008-04-10 2012-04-01 Phison Electronics Corp Data writing method for non-volatile memory, storage system and controller thereof
JP5381995B2 (ja) * 2008-10-31 2014-01-08 日本電気株式会社 データ処理システム、そのデータ処理装置とユーザ端末装置、そのコンピュータプログラムとデータ処理方法
JP2010182270A (ja) * 2009-02-09 2010-08-19 Toshiba Corp 携帯可能電子装置および携帯可能電子装置におけるデータ管理方法
US9984007B2 (en) * 2014-03-28 2018-05-29 Samsung Electronics Co., Ltd. Storage system and method for performing and authenticating write-protection thereof
CN105337904B (zh) * 2014-08-05 2018-11-27 新华三技术有限公司 控制器集群的升级方法及装置
US20160070656A1 (en) * 2014-09-05 2016-03-10 Qualcomm Incorporated Write protection management systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080082773A1 (en) * 2006-09-29 2008-04-03 Andrew Tomlin Systems for Managing File Allocation Table Information
CN101178661A (zh) * 2007-12-14 2008-05-14 华为技术有限公司 Flash集成bootrom的实现方法和装置
CN103366814A (zh) * 2012-03-31 2013-10-23 京信通信系统(中国)有限公司 一种Flash数据安全保护电路和方法
CN103678144A (zh) * 2012-09-05 2014-03-26 慧荣科技股份有限公司 数据储存装置与快闪存储器控制方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG, BAOWEI.: "`Smart Tv Development on Arm Architecture and Android System", CHINESE MASTER'S DISSERTATIONS FULL-TEXT DATABASE, 31 October 2012 (2012-10-31) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641527A (zh) * 2020-05-28 2020-09-08 四川爱创科技有限公司 一种嵌入式芯片软件远程升级备份方法

Also Published As

Publication number Publication date
CN105637521A (zh) 2016-06-01
US20170185311A1 (en) 2017-06-29
US10235048B2 (en) 2019-03-19
CN105637521B (zh) 2020-02-14

Similar Documents

Publication Publication Date Title
WO2016000166A1 (zh) 一种数据处理方法及智能终端
JP6054908B2 (ja) 変数セットを修復する方法、コンピュータ・プログラムおよびコンピュータ
US6971018B1 (en) File protection service for a computer system
US8041959B2 (en) Computer system, storage system and management computer for backing up and restore encryption key for storage system incorporating therein a stored data encryption function
US6546489B1 (en) Disk drive which provides a secure boot of a host computer system from a protected area of a disk
US8028174B2 (en) Controlling update of content of a programmable read-only memory
KR100713128B1 (ko) 바이러스 방역 장치 및 시스템
JP5889933B2 (ja) コンピュータの動作不良を防止する方法、コンピュータ・プログラムおよびコンピュータ
US20100132042A1 (en) Method for upgrading antivirus software and terminal and system thereof
US5748940A (en) Secure updating of non-volatile memory
KR101802800B1 (ko) 다중 운영 시스템 환경을 위한 미디어 보호 정책 시행
CN109964227B (zh) 更新SELinux安全策略的方法及终端
US7069445B2 (en) System and method for migration of a version of a bootable program
CN109710317B (zh) 系统启动方法、装置、电子设备及存储介质
KR20140043126A (ko) Bios 플래시 어택 보호 및 통지
US9286468B2 (en) Option read-only memory use
US20070250547A1 (en) Log Preservation Method, and Program and System Thereof
US20130036431A1 (en) Constraining Execution of Specified Device Drivers
WO2018001365A1 (zh) 一种基于移动终端的软件下载方法及系统
US20040003265A1 (en) Secure method for BIOS flash data update
US11354259B1 (en) Computer system configurations based on accessing data elements presented by baseboard management controllers
KR100824462B1 (ko) 하드웨어 호환성을 식별하고, 안정된 소프트웨어 이미지를가능하게 하는 방법 및 장치
WO2015188511A1 (zh) NAND Flash操作处理方法、装置及逻辑器件
CN115061704A (zh) 一种固件升级方法和电子设备
US20230359741A1 (en) Trusted boot method and apparatus, electronic device, and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14896554

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15322298

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14896554

Country of ref document: EP

Kind code of ref document: A1