[go: up one dir, main page]

CN105760776A - Data processing method and electronic equipment - Google Patents

Data processing method and electronic equipment Download PDF

Info

Publication number
CN105760776A
CN105760776A CN201610080458.1A CN201610080458A CN105760776A CN 105760776 A CN105760776 A CN 105760776A CN 201610080458 A CN201610080458 A CN 201610080458A CN 105760776 A CN105760776 A CN 105760776A
Authority
CN
China
Prior art keywords
operating system
mapping table
data
electronic equipment
pba
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610080458.1A
Other languages
Chinese (zh)
Inventor
刘渤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201610080458.1A priority Critical patent/CN105760776A/en
Publication of CN105760776A publication Critical patent/CN105760776A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6236Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database between heterogeneous systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6281Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database at program execution time, where the protection is within the operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method and electronic equipment.The electronic equipment at least comprises a first operation system and a second operation system.The data processing method includes the steps that when it is detected that the electronic equipment works in the first operation system, LBA in the first operation system is converted into PBA through a first mapping table to conduct data reading/writing operation; when it is detected that the electronic equipment works in the second operation system, LBA in the second operation system is converted into PBA through a second mapping table to conduct data reading/writing operation, wherein the first mapping table is different from the second mapping table.

Description

A kind of data processing method and electronic equipment
Technical field
The present invention relates to data processing technique, particularly relate to a kind of data processing method and electronic equipment.
Background technology
Dual operating systems is multiple operating system even, can meet the operating experience that user is different.At present, dual operating systems is realized by following two mode: the first implementation, and two systems (OS, OperatingSystem) of dual operating systems are separately mounted in the subregion that hard disk is different, when running OS, one piece of hard disk mounts the respective subregion of OS.The second implementation, makes disk mirroring file by an OS in dual operating systems, and this disk mirroring file is placed in the subregion of another OS.When running OS, hard disk mounts the true subregion of OS respectively and is positioned at the disk mirroring file of subregion.
Two kinds of implementations of existing dual operating systems are usable in mechanical hard disk or solid state hard disc (SSD, SolidStateDrives) on, but it is problematic in that: in an OS, data in another OS can be had access to, it is impossible to realize the data isolation between two OS by some instruments.
Summary of the invention
For solving above-mentioned technical problem, embodiments provide a kind of data processing method and electronic equipment.
The data processing method that the embodiment of the present invention provides is applied to electronic equipment, and described electronic equipment at least has the first operating system, the second operating system;Described method includes:
Detect that described electronic device works is when described first operating system, utilize the first mapping table by the logical block addresses (LBA in described first operating system, LogicalBlockAddress) be converted to physical block address (PBA, PhysicalBlockAddress) and carry out the read/write operation of data;
Detect that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
In the embodiment of the present invention, described utilize the first mapping table that the LBA in described first operating system is converted to PBA to carry out the write operation of data, including:
When receiving the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to described first mapping table;
Wherein, described first logical address is determined based on described LBA, and described first physical address is determined based on described PBA.
In the embodiment of the present invention, described utilize the second mapping table that the LBA in described second operating system is converted to PBA to carry out the read operation of data, including:
When receiving the data reading instructions for the second logical address, search second physical address corresponding with described second logical address according to described second mapping table;
Data are read from described second physical address;
Wherein, described second logical address is determined based on described LBA, and described second physical address is determined based on described PBA.
In the embodiment of the present invention, described method also includes:
When detecting that described electronic equipment is switched to described second operating system by described first operating system, generate switching command;
Respond described switching command, control described first mapping table and switch to described second mapping table.
In the embodiment of the present invention, described method also includes:
Create described first mapping table for described first operating system, and be that described second operating system creates described second mapping table.
The electronic equipment that the embodiment of the present invention provides, at least has the first operating system, the second operating system;Described electronic equipment includes:
Detection unit, is used for detecting described electronic device works in the first operating system or the second operating system;
First map unit, for when detecting that described electronic device works is when described first operating system, utilizing the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;
Second map unit, for when detecting that described electronic device works is when described second operating system, utilizing the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
In the embodiment of the present invention, described first map unit, when being additionally operable to receive the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to described first mapping table;
Wherein, described first logical address is determined based on described LBA, and described first physical address is determined based on described PBA.
In the embodiment of the present invention, described second map unit, when being additionally operable to receive the data reading instructions for the second logical address, search second physical address corresponding with described second logical address according to described second mapping table;
Data are read from described second physical address;
Wherein, described second logical address is determined based on described LBA, and described second physical address is determined based on described PBA.
In the embodiment of the present invention, described detection unit, it is additionally operable to detect whether described electronic equipment is switched to described second operating system by described first operating system;
Described electronic equipment also includes: switch unit, for when detecting that described electronic equipment is switched to described second operating system by described first operating system, generating switching command;Respond described switching command, control described first mapping table and switch to described second mapping table.
In the embodiment of the present invention, described electronic equipment also includes:
Creating unit, for creating described first mapping table for described first operating system, and is that described second operating system creates described second mapping table.
The electronic equipment that another embodiment of the present invention provides, including: memorizer, at least the first operating system being stored on described memorizer, the second operating system;
Controller, is used for detecting that described electronic device works is when described first operating system, utilizes the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;Detect that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
In the technical scheme of the embodiment of the present invention, electronic equipment at least has the first operating system, the second operating system;Detect that described electronic device works is when described first operating system, utilize the first mapping table that the logical block addresses LBA in described first operating system is converted to physical block address PBA and carry out the read/write operation of data;Detect that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;Wherein, described first mapping table is different from described second mapping table.Can by OS to the access map of LBA to the access to hard drive internal PBA (i.e. physical sector) by mapping table, the physical sector (corresponding to PBA) that different mapping tables maps out is different, based on this, by different mapping tables, the data of different OS are stored in different physical sectors, it is achieved that the data isolation between two OS.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the data processing method of the embodiment of the present invention one;
Fig. 2 is the schematic flow sheet of the data processing method of the embodiment of the present invention two;
Fig. 3 is the schematic flow sheet of the data processing method of the embodiment of the present invention three;
Fig. 4 is the schematic flow sheet of the data processing method of the embodiment of the present invention four;
Fig. 5 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention five;
Fig. 6 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention six;
Fig. 7 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention seven;
Fig. 8 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention eight;
Fig. 9 is the LBA of the embodiment of the present invention schematic diagram one being converted to PBA;
Figure 10 is the LBA of the embodiment of the present invention schematic diagram two being converted to PBA.
Detailed description of the invention
In order to more fully hereinafter understand feature and the technology contents of the embodiment of the present invention, below in conjunction with accompanying drawing, the realization of the embodiment of the present invention is described in detail, appended accompanying drawing purposes of discussion only for reference, is not used for limiting the embodiment of the present invention.
Fig. 1 is the schematic flow sheet of the data processing method of the embodiment of the present invention one, and the data processing method in this example is applied to electronic equipment, and described electronic equipment at least has the first operating system, the second operating system;As it is shown in figure 1, described data processing method comprises the following steps:
Step 101: detect that described electronic device works is when described first operating system, utilizes the first mapping table that the LBA in described first operating system is converted to PBA and carries out the read/write operation of data.
In the embodiment of the present invention, described electronic equipment can be notebook, main frame, all-in-one, server etc..Described electronic equipment includes memorizer and controller, and memorizer is for storing the data of electronic equipment, instruction etc., and controller is used for controlling electronic equipment read/write data in memory, and/or performs instruction in memorizer etc..Generally, the part of functions of controller is integrated in memory, is formed and has the memorizer controlling function, such as SSD.
With reference to Fig. 9, Fig. 9 is the LBA of the embodiment of the present invention schematic diagram one being converted to PBA, the memorizer of SSD is generally flash memory (NANDFLASH), the read/write unit of flash memory is page, and the size of page is generally 4KB or 8KB, operating system read/write data is by hard disk drive (HDD, HardDiskDrive) (512 bytes (Byte)) that sector size carries out, flash memory is wiped in units of block, and do not wipe and just cannot write, this causes that the file system that operating system currently uses cannot manage SSD at all, for this, SSD adopts the mode of software the operation that the operation of flash memory invents the independent sector to disk, here it is flash translation layer (FTL) (FTL, FlashTranslationLayer).Because FTL is present between file system and physical medium (flash memory), operating system only need to operate LBA as before, and all conversion work of LBA to PBA, just entirely transfer to FTL to be responsible for.
LBA is converted to PBA by FTL, is exactly the mapping of a kind of LBA to PBA in fact.When file system transmission instruction to write or to update a specific logical page (LPAGE), FTL is actually and writes data into a different free physical page and update mapping table (associated data of LBA and PBA), and " legacy data " that comprise on this page is labeled as engineering noise (data after renewal have been written into new PBA, and the data of old address just fail naturally).Exactly because the existence of FTL, operating system could operate SSD as HDD like that.
For SSD, based on FTL mapping process, it is possible to by loading different mapping tables (FTLmap), instantaneous one another independent hard disk of hard disk " becoming ", here, independent hard disk refers to that the data inside subregion and subregion are all different.
In the embodiment of the present invention, electronic equipment at least has the first operating system (OS1) and the second operating system (OS2), this example has OS1 and OS2 for electronic equipment and explains, and the situation of more than three operating systems is with two operating systems in like manner.Here, OS1 can be Android system, and OS2 can be other operating systems different from Android system, for instance Windows operating system.Can also, OS1 and OS2 is Android system or Windows operating system, but two different operating systems.
In the embodiment of the present invention, electronic equipment can be operated in the first operating system or be operated in the second operating system, and when electronic equipment is started shooting, user can select electronic equipment to enter the first operating system and still enter the second operating system.Wherein, corresponding first mapping table of the first operating system, corresponding second mapping table of the second operating system.
Specifically, when detecting that described electronic device works is when described first operating system, utilize the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data.So, the data in the first operating system have just been stored entirely in the physical medium determined based on the first mapping table.
Step 102: detect that described electronic device works is when described second operating system, utilizes the second mapping table that the LBA in described second operating system is converted to PBA and carries out the read/write operation of data.
In the embodiment of the present invention, described first mapping table is different from described second mapping table.When detecting that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data.So, the data in the second operating system have just been stored entirely in the physical medium determined based on the second mapping table.
The physical medium determined based on the first mapping table is equivalent to two independent hard disks with the physical medium determined based on the second mapping table, and here, independent hard disk refers to: subregion and the data inside subregion are different.So, the data of two operating systems are entirely isolated, better user experience.
Fig. 2 is the schematic flow sheet of the data processing method of the embodiment of the present invention two, and the data processing method in this example is applied to electronic equipment, and described electronic equipment at least has the first operating system, the second operating system;As in figure 2 it is shown, described data processing method comprises the following steps:
Step 201: detect that described electronic device works is when described first operating system, when receiving the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to the first mapping table.
In the embodiment of the present invention, described electronic equipment can be notebook, main frame, all-in-one, server etc..Described electronic equipment includes memorizer and controller, and memorizer is for storing the data of electronic equipment, instruction etc., and controller is used for controlling electronic equipment read/write data in memory, and/or performs instruction in memorizer etc..Generally, the part of functions of controller is integrated in memory, is formed and has the memorizer controlling function, such as SSD.
With reference to Fig. 9, Fig. 9 is the LBA of the embodiment of the present invention schematic diagram one being converted to PBA, the memorizer of SSD is generally NANDFLASH, the read/write unit of flash memory is page, and the size of page is generally 4KB or 8KB, operating system read/write data is (512 bytes (Byte)) that undertaken by the sector size of HDD, flash memory is wiped in units of block, and do not wipe and just cannot write, this causes that the file system that operating system currently uses cannot manage SSD at all, for this, SSD adopts the mode of software the operation that the operation of flash memory invents the independent sector to disk, here it is FTL.Because FTL is present between file system and physical medium (flash memory), operating system only need to operate LBA as before, and all conversion work of LBA to PBA, just entirely transfer to FTL to be responsible for.
LBA is converted to PBA by FTL, is exactly the mapping of a kind of LBA to PBA in fact.When file system transmission instruction to write or to update a specific logical page (LPAGE), FTL is actually and writes data into a different free physical page and update mapping table (associated data of LBA and PBA), and " legacy data " that comprise on this page is labeled as engineering noise (data after renewal have been written into new PBA, and the data of old address just fail naturally).Exactly because the existence of FTL, operating system could operate SSD as HDD like that.
For SSD, based on FTL mapping process, it is possible to by loading different mapping tables (FTLmap), instantaneous one another independent hard disk of hard disk " becoming ", here, independent hard disk refers to that the data inside subregion and subregion are all different.
In the embodiment of the present invention, electronic equipment at least has the first operating system (OS1) and the second operating system (OS2), this example has OS1 and OS2 for electronic equipment and explains, and the situation of more than three operating systems is with two operating systems in like manner.Here, OS1 can be Android system, and OS2 can be other operating systems different from Android system, for instance Windows operating system.Can also, OS1 and OS2 is Android system or Windows operating system, but two different operating systems.
In the embodiment of the present invention, electronic equipment can be operated in the first operating system or be operated in the second operating system, and when electronic equipment is started shooting, user can select electronic equipment to enter the first operating system and still enter the second operating system.Wherein, corresponding first mapping table of the first operating system, corresponding second mapping table of the second operating system.
In the embodiment of the present invention, utilize the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data.So, the data in the first operating system have just been stored entirely in the physical medium determined based on the first mapping table.
The read/write operation of data being described in detail below: when electronic device works is when the first operating system, all data of the first operating system are all based on the first mapping table and carry out the conversion of LBA to PBA.For the write operation of data, when receiving the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to described first mapping table.Here, described first logical address is determined based on described LBA, and described first physical address is determined based on described PBA.For the read operation of data, when receiving the data reading instructions for the first logical address, search first physical address corresponding with described first logical address according to described first mapping table;Data are read from described first physical address.
Be converted to the schematic diagram two of PBA with reference to the LBA that Figure 10, Figure 10 are the embodiment of the present invention, it is assumed that write data (physical address n) on page0, next write data to page1 (physical address n+1).Then page0 data are updated, but the data after updating not are cover up, and FTL can be written on address (n+2) it, and then labelling (address n) is engineering noise.After repeatedly such operation, this block will become loaded with the data of many " effectively " and engineering noise.If to be again written to this block, it is necessary to first wipe the data of whole piece, certainly it is accomplished by first the data of all " effectively " being copied to other blank block is wiped again.
Step 202: detect that described electronic device works is when described second operating system, when receiving the data reading instructions for the second logical address, searches second physical address corresponding with described second logical address according to described second mapping table;Data are read from described second physical address.
In the embodiment of the present invention, described first mapping table is different from described second mapping table.When detecting that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data.So, the data in the second operating system have just been stored entirely in the physical medium determined based on the second mapping table.
The read/write operation of data being described in detail below: when electronic device works is when the second operating system, all data of the second operating system are all based on the second mapping table and carry out the conversion of LBA to PBA.For the write operation of data, when receiving the data writing instructions for the second logical address, write data in second physical address of free time, and the mapping relations of described second logical address Yu described second physical address are stored to described second mapping table.Here, described second logical address is determined based on described LBA, and described second physical address is determined based on described PBA.For the read operation of data, when receiving the data reading instructions for the second logical address, search second physical address corresponding with described second logical address according to described second mapping table;Data are read from described second physical address.
The physical medium determined based on the first mapping table is equivalent to two independent hard disks with the physical medium determined based on the second mapping table, and here, independent hard disk refers to: subregion and the data inside subregion are different.So, the data of two operating systems are entirely isolated, better user experience.
Fig. 3 is the schematic flow sheet of the data processing method of the embodiment of the present invention three, and the data processing method in this example is applied to electronic equipment, and described electronic equipment at least has the first operating system, the second operating system;As it is shown on figure 3, described data processing method comprises the following steps:
Step 301: detect that described electronic device works is when described first operating system, utilizes the first mapping table that the LBA in described first operating system is converted to PBA and carries out the read/write operation of data.
In the embodiment of the present invention, described electronic equipment can be notebook, main frame, all-in-one, server etc..Described electronic equipment includes memorizer and controller, and memorizer is for storing the data of electronic equipment, instruction etc., and controller is used for controlling electronic equipment read/write data in memory, and/or performs instruction in memorizer etc..Generally, the part of functions of controller is integrated in memory, is formed and has the memorizer controlling function, such as SSD.
With reference to Fig. 9, Fig. 9 is the LBA of the embodiment of the present invention schematic diagram one being converted to PBA, the memorizer of SSD is generally NANDFLASH, the read/write unit of flash memory is page, and the size of page is generally 4KB or 8KB, operating system read/write data is (512 bytes (Byte)) that undertaken by the sector size of HDD, flash memory is wiped in units of block, and do not wipe and just cannot write, this causes that the file system that operating system currently uses cannot manage SSD at all, for this, SSD adopts the mode of software the operation that the operation of flash memory invents the independent sector to disk, here it is FTL.Because FTL is present between file system and physical medium (flash memory), operating system only need to operate LBA as before, and all conversion work of LBA to PBA, just entirely transfer to FTL to be responsible for.
LBA is converted to PBA by FTL, is exactly the mapping of a kind of LBA to PBA in fact.When file system transmission instruction to write or to update a specific logical page (LPAGE), FTL is actually and writes data into a different free physical page and update mapping table (associated data of LBA and PBA), and " legacy data " that comprise on this page is labeled as engineering noise (data after renewal have been written into new PBA, and the data of old address just fail naturally).Exactly because the existence of FTL, operating system could operate SSD as HDD like that.
For SSD, based on FTL mapping process, it is possible to by loading different mapping tables (FTLmap), instantaneous one another independent hard disk of hard disk " becoming ", here, independent hard disk refers to that the data inside subregion and subregion are all different.
In the embodiment of the present invention, electronic equipment at least has the first operating system (OS1) and the second operating system (OS2), this example has OS1 and OS2 for electronic equipment and explains, and the situation of more than three operating systems is with two operating systems in like manner.Here, OS1 can be Android system, and OS2 can be other operating systems different from Android system, for instance Windows operating system.Can also, OS1 and OS2 is Android system or Windows operating system, but two different operating systems.
In the embodiment of the present invention, electronic equipment can be operated in the first operating system or be operated in the second operating system, and when electronic equipment is started shooting, user can select electronic equipment to enter the first operating system and still enter the second operating system.Wherein, corresponding first mapping table of the first operating system, corresponding second mapping table of the second operating system.
Specifically, when detecting that described electronic device works is when described first operating system, utilize the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data.So, the data in the first operating system have just been stored entirely in the physical medium determined based on the first mapping table.
Step 302: detect that described electronic device works is when described second operating system, utilizes the second mapping table that the LBA in described second operating system is converted to PBA and carries out the read/write operation of data.
In the embodiment of the present invention, described first mapping table is different from described second mapping table.When detecting that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data.So, the data in the second operating system have just been stored entirely in the physical medium determined based on the second mapping table.
Step 303: when detecting that described electronic equipment is switched to described second operating system by described first operating system, generates switching command;Respond described switching command, control described first mapping table and switch to described second mapping table.
In the embodiment of the present invention, electronic device works is when the first operating system, it is also possible to switched to the second operating system by specific instruction triggers electronic equipment by the first operating system, and at this moment, corresponding mapping table is also required to switch over.The physical medium determined based on the first mapping table is equivalent to two independent hard disks with the physical medium determined based on the second mapping table, and here, independent hard disk refers to: subregion and the data inside subregion are different.So, the data of two operating systems are entirely isolated, better user experience.
In the embodiment of the present invention, in the AT order of SSD, increase the instruction to FTLmap switching.When different OS carries out fervent, send the order of switching FTLmap to SSD.In this manner it is possible to the hard disk of an OS, dynamically switch to the hard disk of another OS, the data of two OS will not coexist simultaneously, it is achieved thereby that the data of many OS are mutually isolated.
Fig. 4 is the schematic flow sheet of the data processing method of the embodiment of the present invention four, and the data processing method in this example is applied to electronic equipment, and described electronic equipment at least has the first operating system, the second operating system;As shown in Figure 4, described data processing method comprises the following steps:
Step 401: create described first mapping table for described first operating system, and be that described second operating system creates described second mapping table.
In the embodiment of the present invention, described electronic equipment can be notebook, main frame, all-in-one, server etc..Described electronic equipment includes memorizer and controller, and memorizer is for storing the data of electronic equipment, instruction etc., and controller is used for controlling electronic equipment read/write data in memory, and/or performs instruction in memorizer etc..Generally, the part of functions of controller is integrated in memory, is formed and has the memorizer controlling function, such as SSD.
In the embodiment of the present invention, it is possible to when electronic equipment is started shooting, it is directly that two operating systems are respectively created the first corresponding mapping table and the second mapping table.Electronic equipment can also be worked as when entering the first operating system, be that the first operating system creates the first mapping table.When electronic equipment enters the second operating system, then it is that the second operating system creates the second mapping table.
Step 402: detect that described electronic device works is when described first operating system, utilizes the first mapping table that the LBA in described first operating system is converted to PBA and carries out the read/write operation of data.
With reference to Fig. 9, Fig. 9 is the LBA of the embodiment of the present invention schematic diagram one being converted to PBA, the memorizer of SSD is generally NANDFLASH, the read/write unit of flash memory is page, and the size of page is generally 4KB or 8KB, operating system read/write data is (512 bytes (Byte)) that undertaken by the sector size of HDD, flash memory is wiped in units of block, and do not wipe and just cannot write, this causes that the file system that operating system currently uses cannot manage SSD at all, for this, SSD adopts the mode of software the operation that the operation of flash memory invents the independent sector to disk, here it is FTL.Because FTL is present between file system and physical medium (flash memory), operating system only need to operate LBA as before, and all conversion work of LBA to PBA, just entirely transfer to FTL to be responsible for.
LBA is converted to PBA by FTL, is exactly the mapping of a kind of LBA to PBA in fact.When file system transmission instruction to write or to update a specific logical page (LPAGE), FTL is actually and writes data into a different free physical page and update mapping table (associated data of LBA and PBA), and " legacy data " that comprise on this page is labeled as engineering noise (data after renewal have been written into new PBA, and the data of old address just fail naturally).Exactly because the existence of FTL, operating system could operate SSD as HDD like that.
For SSD, based on FTL mapping process, it is possible to by loading different mapping tables (FTLmap), instantaneous one another independent hard disk of hard disk " becoming ", here, independent hard disk refers to that the data inside subregion and subregion are all different.
In the embodiment of the present invention, electronic equipment at least has the first operating system (OS1) and the second operating system (OS2), this example has OS1 and OS2 for electronic equipment and explains, and the situation of more than three operating systems is with two operating systems in like manner.Here, OS1 can be Android system, and OS2 can be other operating systems different from Android system, for instance Windows operating system.Can also, OS1 and OS2 is Android system or Windows operating system, but two different operating systems.
In the embodiment of the present invention, electronic equipment can be operated in the first operating system or be operated in the second operating system, and when electronic equipment is started shooting, user can select electronic equipment to enter the first operating system and still enter the second operating system.Wherein, corresponding first mapping table of the first operating system, corresponding second mapping table of the second operating system.
Specifically, when detecting that described electronic device works is when described first operating system, utilize the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data.So, the data in the first operating system have just been stored entirely in the physical medium determined based on the first mapping table.
Step 403: detect that described electronic device works is when described second operating system, utilizes the second mapping table that the LBA in described second operating system is converted to PBA and carries out the read/write operation of data.
In the embodiment of the present invention, described first mapping table is different from described second mapping table.When detecting that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data.So, the data in the second operating system have just been stored entirely in the physical medium determined based on the second mapping table.
Step 404: when detecting that described electronic equipment is switched to described second operating system by described first operating system, generates switching command;Respond described switching command, control described first mapping table and switch to described second mapping table.
In the embodiment of the present invention, electronic device works is when the first operating system, it is also possible to switched to the second operating system by specific instruction triggers electronic equipment by the first operating system, and at this moment, corresponding mapping table is also required to switch over.The physical medium determined based on the first mapping table is equivalent to two independent hard disks with the physical medium determined based on the second mapping table, and here, independent hard disk refers to: subregion and the data inside subregion are different.So, the data of two operating systems are entirely isolated, better user experience.
In the embodiment of the present invention, in the AT order of SSD, increase the instruction to FTLmap switching.When different OS carries out fervent, send the order of switching FTLmap to SSD.In this manner it is possible to the hard disk of an OS, dynamically switch to the hard disk of another OS, the data of two OS will not coexist simultaneously, it is achieved thereby that the data of many OS are mutually isolated.
Fig. 5 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention five, and described electronic equipment at least has the first operating system, the second operating system;As it is shown in figure 5, described electronic equipment includes:
Detection unit 51, is used for detecting described electronic device works in the first operating system or the second operating system;
First map unit 52, for when detecting that described electronic device works is when described first operating system, utilizing the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;
Second map unit 53, for when detecting that described electronic device works is when described second operating system, utilizing the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
It will be appreciated by those skilled in the art that the function that realizes of each unit in the electronic equipment shown in Fig. 5 can refer to the associated description of aforementioned data processing method and understands.The function of each unit in the electronic equipment shown in Fig. 5 can be realized by the program that runs on processor, it is possible to is realized by concrete logic circuit.
Fig. 6 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention six, and described electronic equipment at least has the first operating system, the second operating system;As shown in Figure 6, described electronic equipment includes:
Detection unit 61, is used for detecting described electronic device works in the first operating system or the second operating system;
First map unit 62, for when detecting that described electronic device works is when described first operating system, utilizing the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;
Second map unit 63, for when detecting that described electronic device works is when described second operating system, utilizing the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
Described first map unit 62, when being additionally operable to receive the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to described first mapping table;
Wherein, described first logical address is determined based on described LBA, and described first physical address is determined based on described PBA.
Described second map unit 63, when being additionally operable to receive the data reading instructions for the second logical address, searches second physical address corresponding with described second logical address according to described second mapping table;
Data are read from described second physical address;
Wherein, described second logical address is determined based on described LBA, and described second physical address is determined based on described PBA.
Described detection unit 61, is additionally operable to detect whether described electronic equipment is switched to described second operating system by described first operating system;
Described electronic equipment also includes: switch unit 64, for when detecting that described electronic equipment is switched to described second operating system by described first operating system, generating switching command;Respond described switching command, control described first mapping table and switch to described second mapping table.
It will be appreciated by those skilled in the art that the function that realizes of each unit in the electronic equipment shown in Fig. 6 can refer to the associated description of aforementioned data processing method and understands.The function of each unit in the electronic equipment shown in Fig. 6 can be realized by the program that runs on processor, it is possible to is realized by concrete logic circuit.
Fig. 7 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention seven, and described electronic equipment at least has the first operating system, the second operating system;As it is shown in fig. 7, described electronic equipment includes:
Detection unit 71, is used for detecting described electronic device works in the first operating system or the second operating system;
First map unit 72, for when detecting that described electronic device works is when described first operating system, utilizing the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;
Second map unit 73, for when detecting that described electronic device works is when described second operating system, utilizing the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
In the embodiment of the present invention, described electronic equipment also includes:
Creating unit 74, for creating described first mapping table for described first operating system, and is that described second operating system creates described second mapping table.
It will be appreciated by those skilled in the art that the function that realizes of each unit in the electronic equipment shown in Fig. 7 can refer to the associated description of aforementioned data processing method and understands.The function of each unit in the electronic equipment shown in Fig. 7 can be realized by the program that runs on processor, it is possible to is realized by concrete logic circuit.
Fig. 8 is the structure composition schematic diagram of the electronic equipment of the embodiment of the present invention eight, and as shown in Figure 8, described electronic equipment includes: memorizer 81, at least the first operating system being stored on described memorizer 81, the second operating system;
Controller 82, is used for detecting that described electronic device works is when described first operating system, utilizes the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;Detect that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
It will be appreciated by those skilled in the art that the function that realizes of each unit in the electronic equipment shown in Fig. 8 can refer to the associated description of aforementioned data processing method and understands.The function of each unit in the electronic equipment shown in Fig. 8 can be realized by the program that runs on processor, it is possible to is realized by concrete logic circuit.
Between technical scheme described in the embodiment of the present invention, when not conflicting, it is possible to combination in any.
In several embodiments provided by the present invention, it should be understood that disclosed method and smart machine, it is possible to realize by another way.Apparatus embodiments described above is merely schematic, such as, the division of described unit, it is only a kind of logic function to divide, actual can have other dividing mode when realizing, and as: multiple unit or assembly can be in conjunction with, or is desirably integrated into another system, or some features can ignore, or do not perform.It addition, the coupling each other of shown or discussed each ingredient or direct-coupling or communication connection can be through INDIRECT COUPLING or the communication connection of some interfaces, equipment or unit, it is possible to be electrical, machinery or other form.
The above-mentioned unit illustrated as separating component can be or may not be physically separate, and the parts shown as unit can be or may not be physical location, namely may be located at a place, it is also possible to be distributed on multiple NE;Part or all of unit therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme.
It addition, each functional unit in various embodiments of the present invention can be fully integrated in second processing unit, it is also possible to be that each unit is individually as a unit, it is also possible to two or more unit are integrated in a unit;Above-mentioned integrated unit both can adopt the form of hardware to realize, it would however also be possible to employ hardware adds the form of SFU software functional unit and realizes.
The above; being only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, any those familiar with the art is in the technical scope that the invention discloses; change can be readily occurred in or replace, all should be encompassed within protection scope of the present invention.

Claims (11)

1. a data processing method, is applied to electronic equipment, and described electronic equipment at least has the first operating system, the second operating system;Described method includes:
Detect that described electronic device works is when described first operating system, utilize the first mapping table that the logical block addresses LBA in described first operating system is converted to physical block address PBA and carry out the read/write operation of data;
Detect that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
2. data processing method according to claim 1, described utilizes the first mapping table that the LBA in described first operating system is converted to PBA to carry out the write operation of data, including:
When receiving the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to described first mapping table;
Wherein, described first logical address is determined based on described LBA, and described first physical address is determined based on described PBA.
3. data processing method according to claim 1, described utilizes the second mapping table that the LBA in described second operating system is converted to PBA to carry out the read operation of data, including:
When receiving the data reading instructions for the second logical address, search second physical address corresponding with described second logical address according to described second mapping table;
Data are read from described second physical address;
Wherein, described second logical address is determined based on described LBA, and described second physical address is determined based on described PBA.
4. data processing method according to claim 1, described method also includes:
When detecting that described electronic equipment is switched to described second operating system by described first operating system, generate switching command;
Respond described switching command, control described first mapping table and switch to described second mapping table.
5. the data processing method according to any one of Claims 1-4, described method also includes:
Create described first mapping table for described first operating system, and be that described second operating system creates described second mapping table.
6. an electronic equipment, described electronic equipment at least has the first operating system, the second operating system;Described electronic equipment includes:
Detection unit, is used for detecting described electronic device works in the first operating system or the second operating system;
First map unit, for when detecting that described electronic device works is when described first operating system, utilizing the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;
Second map unit, for when detecting that described electronic device works is when described second operating system, utilizing the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
7. electronic equipment according to claim 6, described first map unit, when being additionally operable to receive the data writing instructions for the first logical address, write data in first physical address of free time, and the mapping relations of described first logical address Yu described first physical address are stored to described first mapping table;
Wherein, described first logical address is determined based on described LBA, and described first physical address is determined based on described PBA.
8. electronic equipment according to claim 6, described second map unit, when being additionally operable to receive the data reading instructions for the second logical address, search second physical address corresponding with described second logical address according to described second mapping table;
Data are read from described second physical address;
Wherein, described second logical address is determined based on described LBA, and described second physical address is determined based on described PBA.
9. electronic equipment according to claim 6, described detection unit, it is additionally operable to detect whether described electronic equipment is switched to described second operating system by described first operating system;
Described electronic equipment also includes: switch unit, for when detecting that described electronic equipment is switched to described second operating system by described first operating system, generating switching command;Respond described switching command, control described first mapping table and switch to described second mapping table.
10. the electronic equipment according to any one of claim 6 to 9, described electronic equipment also includes:
Creating unit, for creating described first mapping table for described first operating system, and is that described second operating system creates described second mapping table.
11. an electronic equipment, described electronic equipment includes: memorizer, at least the first operating system being stored on described memorizer, the second operating system;
Controller, is used for detecting that described electronic device works is when described first operating system, utilizes the first mapping table that the LBA in described first operating system is converted to PBA and carry out the read/write operation of data;Detect that described electronic device works is when described second operating system, utilize the second mapping table that the LBA in described second operating system is converted to PBA and carry out the read/write operation of data;
Wherein, described first mapping table is different from described second mapping table.
CN201610080458.1A 2016-02-04 2016-02-04 Data processing method and electronic equipment Pending CN105760776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610080458.1A CN105760776A (en) 2016-02-04 2016-02-04 Data processing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610080458.1A CN105760776A (en) 2016-02-04 2016-02-04 Data processing method and electronic equipment

Publications (1)

Publication Number Publication Date
CN105760776A true CN105760776A (en) 2016-07-13

Family

ID=56330617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610080458.1A Pending CN105760776A (en) 2016-02-04 2016-02-04 Data processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN105760776A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021004231A1 (en) * 2019-07-10 2021-01-14 华为技术有限公司 Data storage method for flash memory device and flash memory device
CN112882663A (en) * 2021-03-25 2021-06-01 湖南国科微电子股份有限公司 Random writing method, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030177334A1 (en) * 2002-03-14 2003-09-18 International Business Machines Corporation Address mapping for disk drive to accommodate multiple operating systems
CN1711525A (en) * 2002-11-18 2005-12-21 Arm有限公司 Virtual-to-physical memory address mapping within a data processing system having secure and non-secure domains
US20070094440A1 (en) * 2005-10-20 2007-04-26 Simpletech, Inc. Enhanced data access in a storage device
CN101493794A (en) * 2009-01-19 2009-07-29 成都市华为赛门铁克科技有限公司 Flash memory data processing method and device
CN103383652A (en) * 2013-06-28 2013-11-06 记忆科技(深圳)有限公司 Switching method for operating systems of computer platform
CN103761190A (en) * 2013-12-19 2014-04-30 华为技术有限公司 Data processing method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030177334A1 (en) * 2002-03-14 2003-09-18 International Business Machines Corporation Address mapping for disk drive to accommodate multiple operating systems
CN1711525A (en) * 2002-11-18 2005-12-21 Arm有限公司 Virtual-to-physical memory address mapping within a data processing system having secure and non-secure domains
US20070094440A1 (en) * 2005-10-20 2007-04-26 Simpletech, Inc. Enhanced data access in a storage device
CN101493794A (en) * 2009-01-19 2009-07-29 成都市华为赛门铁克科技有限公司 Flash memory data processing method and device
CN103383652A (en) * 2013-06-28 2013-11-06 记忆科技(深圳)有限公司 Switching method for operating systems of computer platform
CN103761190A (en) * 2013-12-19 2014-04-30 华为技术有限公司 Data processing method and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021004231A1 (en) * 2019-07-10 2021-01-14 华为技术有限公司 Data storage method for flash memory device and flash memory device
US12405744B2 (en) 2019-07-10 2025-09-02 Huawei Technologies Co., Ltd. Data storage method and flash device for allocating a physical address based on a flash translation layer
CN112882663A (en) * 2021-03-25 2021-06-01 湖南国科微电子股份有限公司 Random writing method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
EP2691857B1 (en) Memory mirroring and redundancy generation for high availability
JP6253614B2 (en) Storage device virtualization
US9342243B2 (en) Method and electronic apparatus for implementing multi-operating system
US9183026B2 (en) Supporting heterogeneous virtualization
US9665419B2 (en) Enhanced restart of a core dumping application
CN105677257A (en) Data storage method and electronic equipment
RU2011147372A (en) CONVERTING MACHINES TO VIRTUAL MACHINES
KR20170057237A (en) Supporting multiple operating system environments in computing device without contents conversion
US20170177225A1 (en) Mid-level controllers for performing flash management on solid state drives
CN105760218A (en) Online migration method and device for virtual machine
CN105550122A (en) Data processing method, storage device and electronic device
US20120324186A1 (en) Method, apparatus and computer for data operation
CN105760776A (en) Data processing method and electronic equipment
US20120179885A1 (en) Write control system
US10216433B2 (en) Accessing a virtual volume on a storage array
US11256435B2 (en) Method and apparatus for performing data-accessing management in a storage server
CN112486406B (en) Dynamically adjusting multiple memory copies and memory mapping windows to optimize I/O performance
JP2013114650A (en) Address space conversion device, address space conversion method of the same, and computer program
CN109542840B (en) SoC system
CN112286839A (en) Low overhead translation lookaside buffer pulldown
CN114063913B (en) EMMC partition storage method and structure
US11989435B2 (en) Re-partitioning of a flash memory device
CN105718300A (en) Virtual machine switching system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160713

RJ01 Rejection of invention patent application after publication