CN116048630A - Method for accessing hidden area data, electronic equipment and storage medium - Google Patents
Method for accessing hidden area data, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116048630A CN116048630A CN202211404424.5A CN202211404424A CN116048630A CN 116048630 A CN116048630 A CN 116048630A CN 202211404424 A CN202211404424 A CN 202211404424A CN 116048630 A CN116048630 A CN 116048630A
- Authority
- CN
- China
- Prior art keywords
- hidden area
- program
- hard disk
- type
- electronic device
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4403—Processor initialisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4406—Loading of operating system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44594—Unloading
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请公开了一种访问隐藏区数据的方法、电子设备及存储介质,方法包括:根据第一程序向第一类硬盘下发指令,将隐藏区调整为可见状态;根据获取的设备编号断开所述第一类硬盘,重新加载与所述电子设备连接的设备,以改变所述第一类硬盘的逻辑块地址的状态,使得所述隐藏区的可见状态生效;根据第二程序,调整所述隐藏区对应的逻辑块地址的分区表;重新连接与所述电子设备相连的设备,根据调整后的所述分区表重新连接所述第一类硬盘的分区,以确定所述隐藏区的位置。本发明通过对隐藏区属性快速设定、调整对应分区表来实现正确访问或更新隐藏区数据,高效准确的使用此类SSD固件层的隐藏区。
The application discloses a method for accessing data in a hidden area, electronic equipment and a storage medium. The method includes: issuing an instruction to the first type of hard disk according to the first program to adjust the hidden area to a visible state; disconnecting the hidden area according to the obtained device number The hard disk of the first type reloads the device connected to the electronic device to change the state of the logical block address of the hard disk of the first type so that the visible state of the hidden area takes effect; according to the second program, adjust the The partition table of the logical block address corresponding to the hidden area; reconnect the device connected to the electronic device, and reconnect the partition of the first type of hard disk according to the adjusted partition table to determine the location of the hidden area . The present invention realizes correct access or update of data in the hidden area by quickly setting the attribute of the hidden area and adjusting the corresponding partition table, and efficiently and accurately uses the hidden area of the SSD firmware layer.
Description
技术领域technical field
本申请涉及数据处理领域,特别涉及一种访问隐藏区数据的方法、电子设备及存储介质。The present application relates to the field of data processing, in particular to a method for accessing data in a hidden area, electronic equipment and a storage medium.
背景技术Background technique
在固态硬盘上,通过类似HD的HPA的方式,实现对部分逻辑块地址隐藏的功能,从而在固态硬盘上形成了一个隐藏区。隐藏区对于通用的BIOS和OS等上层软件都是不可见的,也就实现了隐藏和保护数据的目的,防止数据被非法访问或丢失。On the solid-state hard disk, the function of hiding part of the logical block address is realized through a method similar to HD's HPA, thereby forming a hidden area on the solid-state hard disk. The hidden area is invisible to general-purpose BIOS and OS and other upper-layer software, which realizes the purpose of hiding and protecting data and prevents data from being illegally accessed or lost.
为了最大价值发挥固态硬盘上隐藏区的价值,在此固态硬盘上隐藏区内创建一个文件系统,这样可以拓展隐藏区的使用方式:可以利用这部分存储空间来作为用户重要数据的备份,或者安装一些特殊的应用程序,甚至可以在此隐藏区内一个轻量级的操作系统。那么,对于部署在隐藏区数据或者系统如何自动化的快速访问和更新显得尤为重要。In order to maximize the value of the hidden area on the solid state drive, a file system is created in the hidden area on the solid state drive, which can expand the use of the hidden area: this part of the storage space can be used as a backup of the user's important data, or installed Some special applications can even be a lightweight operating system within this hidden area. Then, it is particularly important to quickly access and update the data deployed in the hidden area or how the system is automated.
现有的解决方案中,采用如下方式:启动一个本地操作系统、或livecd系统;通过基于NVMe协议的固态硬盘隐藏相关指令设置隐藏可见;重新修订包含隐藏区的分区表、根据此分区表访问或者更新隐藏区数据。In the existing solutions, the following methods are adopted: start a local operating system or a livecd system; set hidden and visible through the hidden related instructions of the solid-state hard disk based on the NVMe protocol; revise the partition table containing the hidden area, access or Update hidden area data.
该方案的缺点是:需要启动其他系统,单步执行相关指令和步骤,出错概率高,不能自动化完成。The disadvantage of this solution is that it needs to start other systems, execute relevant instructions and steps in a single step, the probability of error is high, and it cannot be completed automatically.
发明内容Contents of the invention
针对上述问题,本申请实施例公开一种访问隐藏区数据的方法、电子设备及存储介质,实现对隐藏区属性快速设定、调整对应分区表、正确访问或更新隐藏区数据,高效准确的使用隐藏区。In view of the above problems, the embodiment of the present application discloses a method, electronic device and storage medium for accessing hidden area data, so as to realize rapid setting of hidden area attributes, adjustment of corresponding partition table, correct access or update of hidden area data, and efficient and accurate use hidden area.
本申请实施例的目的之一,在于提供一种访问隐藏区数据的方法,应用于电子设备,其特征在于,包括:One of the purposes of the embodiments of the present application is to provide a method for accessing hidden area data, which is applied to electronic devices, and is characterized in that it includes:
根据第一程序向第一类硬盘下发指令,将隐藏区调整为可见状态;Sending instructions to the first type of hard disk according to the first program to adjust the hidden area to a visible state;
根据获取的设备编号断开所述第一类硬盘,重新加载与所述电子设备连接的设备,以改变所述第一类硬盘的逻辑块地址的状态,使得所述隐藏区的可见状态生效;Disconnecting the hard disk of the first type according to the obtained device number, reloading the device connected to the electronic device, so as to change the state of the logical block address of the hard disk of the first type, so that the visible state of the hidden area takes effect;
根据第二程序,调整所述隐藏区对应的逻辑块地址的分区表;According to the second program, adjusting the partition table of the logical block address corresponding to the hidden area;
重新连接与所述电子设备相连的设备,根据调整后的所述分区表重新连接所述第一类硬盘的分区,以确定所述隐藏区的位置;Reconnecting the device connected to the electronic device, and reconnecting the partition of the first type of hard disk according to the adjusted partition table, so as to determine the location of the hidden area;
接收对所述隐藏区的访问请求,根据访问请求的类型重新映射所有的分区和文件系统,以访问到所述隐藏区。An access request to the hidden area is received, and all partitions and file systems are remapped according to the type of the access request, so as to access the hidden area.
作为一可选实施例,所述根据获取的设备编号断开所述第一类硬盘,包括:As an optional embodiment, the disconnecting the hard disk of the first type according to the obtained device number includes:
启动第三程序,获取第一环境下所述第一类硬盘的设备编号。Start the third program to obtain the device number of the first type of hard disk in the first environment.
作为一可选实施例,所述启动第三程序,包括:As an optional embodiment, the starting the third program includes:
接收来自所述电子设备上操作系统发送的启动指令;receiving a startup command sent from the operating system on the electronic device;
或者,接收来自外部存储设备内启动文件发送的启动指令。Or, receive the startup command sent from the startup file in the external storage device.
作为一可选实施例,所述方法还包括:As an optional embodiment, the method also includes:
在接收所述访问请求之前,确认所述电子设备在第一环境下是否安装有第二类硬盘;Before receiving the access request, confirm whether the electronic device is equipped with a second-type hard disk in the first environment;
若有,则将所述第二类硬盘移除。If yes, then remove the second type of hard disk.
作为一可选实施例,所述方法还包括:As an optional embodiment, the method also includes:
当所述访问请求为数据升级或者程序升级时,获取第一环境下连接在所述电子设备上的外部存储设备的设备数量;When the access request is for data upgrade or program upgrade, obtain the device quantity of the external storage device connected to the electronic device in the first environment;
将所述设备数量与预设阈值比较,根据比较结果执行相应操作。The number of devices is compared with a preset threshold, and corresponding operations are performed according to the comparison result.
作为一可选实施例,所述根据比较结果执行相应操作,包括:As an optional embodiment, the performing corresponding operations according to the comparison result includes:
当所述设备数量处于所述预设阈值的范围内时,在第一环境下重新映射所有的分区和文件系统。When the number of devices is within the range of the preset threshold, all partitions and file systems are remapped under the first environment.
作为一可选实施例,所述根据比较结果执行相应操作,包括:As an optional embodiment, the performing corresponding operations according to the comparison result includes:
当所述设备数量不处于所述预设阈值的范围内时,根据接收到的操作指令,结束所述第一程序的运行。When the number of devices is not within the range of the preset threshold, according to the received operation instruction, the running of the first program is terminated.
作为一可选实施例,所述方法还包括:As an optional embodiment, the method also includes:
当所述访问请求为数据访问或者程序启动时,断开第一环境下连接在所述电子设备上的外部存储设备。When the access request is data access or program startup, disconnect the external storage device connected to the electronic device under the first environment.
本申请实施例的目的之一,在于提供一种电子设备,包括:One of the purposes of the embodiments of the present application is to provide an electronic device, including:
第一调整模块,用于根据第一程序向第一类硬盘下发指令,将隐藏区调整为可见状态;The first adjustment module is configured to issue an instruction to the first type of hard disk according to the first program to adjust the hidden area to a visible state;
第一重载模块,用于根据所述的设备编号断开所述第一类硬盘,重新加载与所述电子设备连接的设备,以改变所述第一类硬盘的逻辑块地址的状态,使得所述隐藏区的可见状态生效;The first reloading module is used to disconnect the first-type hard disk according to the device number, and reload the device connected to the electronic device to change the state of the logical block address of the first-type hard disk, so that The visible state of the hidden area takes effect;
第二调整模块,用于根据第二程序,调整所述隐藏区对应的逻辑块地址的分区表;A second adjustment module, configured to adjust the partition table of the logical block address corresponding to the hidden area according to the second program;
第二重载模块,用于重新连接与所述电子设备相连的设备,根据调整后的所述分区表重新连接所述第一类硬盘的分区,以确定所述隐藏区的位置;The second overload module is used to reconnect the device connected to the electronic device, and reconnect the partition of the first type of hard disk according to the adjusted partition table to determine the location of the hidden area;
接收模块,用于接收对所述隐藏区的访问请求,根据访问请求的类型重新映射所有的分区和文件系统,以访问到所述隐藏区。The receiving module is configured to receive an access request to the hidden area, and remap all partitions and file systems according to the type of the access request, so as to access the hidden area.
本申请实施例的目的之一,在于提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现前述的一种访问隐藏区数据的方法中的各个步骤。One of the purposes of the embodiments of the present application is to provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, each step in the aforementioned method for accessing data in a hidden area is implemented .
本申请实施例的有益效果在于:The beneficial effects of the embodiments of the present application are:
本发明通过对隐藏区属性快速设定、调整对应分区表来实现正确访问或更新隐藏区数据,高效准确的使用此类SSD固件层的隐藏区。使用标准UEFI EDK2架构实现,支持多架构交叉编译执行,避免多次开发,可一致性高。The present invention realizes correct access or update of data in the hidden area by quickly setting the attribute of the hidden area and adjusting the corresponding partition table, and efficiently and accurately uses the hidden area of the SSD firmware layer. Implemented using the standard UEFI EDK2 architecture, supports multi-architecture cross-compilation execution, avoids multiple developments, and has high consistency.
可开机后BIOS自动引导启动,同时支持在UEFI Shell环境手动执行,同样支持grub中启动执行;全程自动化,提高效率、保证质量、执行效果一致性高。After booting, the BIOS can automatically boot and start. At the same time, it supports manual execution in the UEFI Shell environment, and also supports startup and execution in grub; the whole process is fully automated, improving efficiency, ensuring quality, and high consistency of execution results.
附图说明Description of drawings
图1为本申请实施例方法的流程图;Fig. 1 is the flowchart of the embodiment method of the present application;
图2为本申请实施例电子设备的框架图;FIG. 2 is a frame diagram of an electronic device according to an embodiment of the present application;
图3为现有技术示意图一;Figure 3 is a schematic diagram of the prior art;
图4为现有技术示意图二;Figure 4 is a schematic diagram of the prior art II;
图5为本申请实施例中所需文件存放目录结构图。FIG. 5 is a structure diagram of a directory for storing required files in the embodiment of the present application.
具体实施方式Detailed ways
此处参考附图描述本申请的各种方案以及特征。Various aspects and features of the present application are described herein with reference to the accompanying drawings.
应理解的是,可以对此处申请的实施例做出各种修改。因此,上述说明书不应该视为限制,而仅是作为实施例的范例。本领域的技术人员将想到在本申请的范围和精神内的其他修改。It should be understood that various modifications may be made to the embodiments applied for herein. Accordingly, the above description should not be viewed as limiting, but only as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
包含在说明书中并构成说明书的一部分的附图示出了本申请的实施例,并且与上面给出的对本申请的大致描述以及下面给出的对实施例的详细描述一起用于解释本申请的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and, together with the general description of the application given above and the detailed description of the embodiments given below, serve to explain the embodiments of the application. principle.
通过下面参照附图对给定为非限制性实例的实施例的优选形式的描述,本申请的这些和其它特性将会变得显而易见。These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment given as non-limiting examples with reference to the accompanying drawings.
还应当理解,尽管已经参照一些具体实例对本申请进行了描述,但本领域技术人员能够确定地实现本申请的很多其它等效形式。It should also be understood that, while the application has been described with reference to a few specific examples, those skilled in the art will be able to implement certain other equivalents of the application.
当结合附图时,鉴于以下详细说明,本申请的上述和其他方面、特征和优势将变得更为显而易见。The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
此后参照附图描述本申请的具体实施例;然而,应当理解,所申请的实施例仅仅是本申请的实例,其可采用多种方式实施。熟知和/或重复的功能和结构并未详细描述以避免不必要或多余的细节使得本申请模糊不清。因此,本文所申请的具体的结构性和功能性细节并非意在限定,而是仅仅作为权利要求的基础和代表性基础用于教导本领域技术人员以实质上任意合适的详细结构多样地使用本申请。Specific embodiments of the present application are hereinafter described with reference to the accompanying drawings; however, it should be understood that the applied embodiments are merely examples of the present application, which can be implemented in various ways. Well-known and/or repetitive functions and constructions are not described in detail to avoid obscuring the application with unnecessary or redundant detail. Therefore, specific structural and functional details disclosed herein are not intended to be limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present invention in virtually any suitable detailed structure. Apply.
本说明书可使用词组“在一种实施例中”、“在另一个实施例中”、“在又一实施例中”或“在其他实施例中”,其均可指代根据本申请的相同或不同实施例中的一个或多个。This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may refer to the same or one or more of the different embodiments.
通常,传统隐藏区布局方式如图3所示,EFI系统分区在Windows系统的磁盘管理器或者Livecd系统的DiskGenius工具可以查看到,从而可以对分区进行删除、格式化、设置隐藏、取消隐藏等操作。Usually, the layout of the traditional hidden area is shown in Figure 3. The EFI system partition can be viewed in the disk manager of the Windows system or the DiskGenius tool of the Livecd system, so that the partition can be deleted, formatted, hidden, and unhidden. .
在固态硬盘上可以通过类似HD的HPA的方式,实现对部分逻辑块地址隐藏的功能,从而形成了一个固态硬盘上的隐藏区。固态硬盘隐藏区在系统中默认无法查看,从而无法被访问,无法被破坏。On the solid-state hard disk, the function of hiding part of the logical block address can be realized through a method similar to HD's HPA, thus forming a hidden area on the solid-state hard disk. The hidden area of the solid state drive cannot be viewed by default in the system, so it cannot be accessed or destroyed.
通用的自动化部署方式只能在传统全盘安装,对于初始化设置了隐藏区的固态硬盘,如图4所示,也只能在看见状态的固态硬盘区域(实线部分)进行安装操作系统,无法访问到固态硬盘隐藏区(虚线部分)。The general automatic deployment method can only be installed on the traditional full disk. For the solid-state hard disk with a hidden area set for initialization, as shown in Figure 4, the operating system can only be installed in the visible state of the solid-state hard disk area (the solid line part), and cannot be accessed. Go to the hidden area of the SSD (dotted line).
这是由于NVME固件程序不会上报被初始化为隐藏区部分的逻辑块地址,在BIOS或者OS中不会看到这部分区域。This is because the NVME firmware program will not report the logical block address initialized as part of the hidden area, and this part of the area will not be seen in the BIOS or OS.
基于上述内容,本申请实施例的目的之一,在于提供一种访问隐藏区数据的方法,应用于电子设备,包括:Based on the above, one of the purposes of the embodiments of the present application is to provide a method for accessing hidden area data, which is applied to electronic devices, including:
根据第一程序向第一类硬盘下发指令,将隐藏区调整为可见状态。所述第一类硬盘为NVME SSD。第一程序在UEFI Shell环境下使用。According to the first program, an instruction is sent to the hard disk of the first type to adjust the hidden area to a visible state. The first type of hard disk is NVME SSD. The first program is used under the UEFI Shell environment.
具体地,执行NVMeOpen.efi(第一程序),第一程序为UEFI辅助程序,对NVME SSD下发指令,以识别隐藏区是否存在,并根据检查结果设置隐藏区为可见状态。Specifically, execute NVMeOpen.efi (the first program), the first program is a UEFI auxiliary program, and issues instructions to the NVME SSD to identify whether the hidden area exists, and set the hidden area as a visible state according to the inspection result.
为了使得UEFI环境中设置的第一类硬盘属性生效,需要根据获取的设备编号断开所述第一类硬盘,重新加载与所述电子设备连接的设备,以改变所述第一类硬盘的逻辑块地址(下文中LBA指代为逻辑块地址)的状态,使得所述隐藏区的可见状态生效。In order to make the hard disk attributes of the first type set in the UEFI environment take effect, it is necessary to disconnect the hard disk of the first type according to the obtained device number, and reload the device connected to the electronic device to change the logic of the hard disk of the first type The state of the block address (hereinafter referred to as the logical block address by LBA) makes the visible state of the hidden area take effect.
具体地,由于此时UEFI环境中已经没有NVME SSD对应的设备编号的存在,此处只能重新连接所有设备。重新连接后,NVME SSD就会设置全部磁盘的LBA为可见可访问的状态。Specifically, since there is no device number corresponding to the NVME SSD in the UEFI environment at this time, all devices can only be reconnected here. After reconnecting, NVME SSD will set the LBA of all disks to be visible and accessible.
为了实现本方法的高效,先断开NVME SSD,而不是重启电子设备或者断开所有设备,可以节省操作周期,以及减少对多余设备断开引起的风险。In order to achieve the efficiency of this method, disconnecting the NVME SSD first, instead of restarting the electronic device or disconnecting all devices, can save operating cycles and reduce the risk of disconnecting redundant devices.
作为一可选实施例,所述根据获取的设备编号断开所述第一类硬盘,包括:启动第三程序,获取第一环境下所述第一类硬盘的设备编号。所述第一环境为UEFI Shell环境。As an optional embodiment, the disconnecting the first-type hard disk according to the obtained device number includes: starting a third program to obtain the device number of the first-type hard disk in the first environment. Described first environment is UEFI Shell environment.
具体地,第三程序启动时,初始化UEFI Shell下所需环境参数。本方法使用时,先启动第三程序对电子设备的使用环境进行初始化,再通过第一程序和第二程序完成相应的步骤。Specifically, when the third program is started, the required environment parameters under the UEFI Shell are initialized. When the method is used, the third program is first started to initialize the use environment of the electronic device, and then the corresponding steps are completed through the first program and the second program.
由于电子设备上外围设备数量、种类等各不相同,运行的BIOS程序中对所有设备的枚举顺序和分配的编号各不相同,所以需要第三程序动态查询当前UEFI Shell环境下NVME SSD的设备编号。本方法支持不同BIOS实现中对设备顺序及编号的枚举方式。Since the number and types of peripheral devices on electronic devices are different, the enumeration order and assigned numbers of all devices in the running BIOS program are different, so a third program is required to dynamically query the NVME SSD devices in the current UEFI Shell environment serial number. This method supports enumeration methods for device sequences and numbers in different BIOS implementations.
作为一可选实施例,所述启动第三程序,包括:接收来自所述电子设备上操作系统发送的启动指令;或者,接收来自外部存储设备内启动文件发送的启动指令。As an optional embodiment, the starting the third program includes: receiving a startup instruction sent from an operating system on the electronic device; or receiving a startup instruction sent from a startup file in an external storage device.
其中,启动第三程序可以在UEFI Shell环境中通过命令行方式执行,也可以独立封装成一个ISO镜像,并将此ISO镜像刻复到外部存储设备中,例如U盘,通过开机自动U盘启动。U盘内所需文件存放目录结构如图5所示。Among them, starting the third program can be executed through the command line in the UEFI Shell environment, or can be independently packaged into an ISO image, and the ISO image can be copied to an external storage device, such as a USB flash drive, which can be automatically started by booting the USB flash drive. . The required file storage directory structure in the U disk is shown in Figure 5.
第二种启动方式具体步骤如下:The specific steps of the second startup method are as follows:
a)依据BIOS UEFI模式启动规则将第三程序重新命名为bootx64.efi;a) Rename the third program as bootx64.efi according to the BIOS UEFI mode startup rules;
b)将重命名后的bootx64.efi文件存放替换到规则所指定的目录中;b) Store and replace the renamed bootx64.efi file into the directory specified by the rule;
c)使用ISO封装工具或命令,封装成ISO镜像;c) Use ISO packaging tools or commands to package into an ISO image;
d)使用封装的ISO镜像制作启动U盘;d) Use the encapsulated ISO image to make a bootable U disk;
e)将U盘接入电子设备,选择U盘启动电子设备;e) Connect the U disk to the electronic device, and select the U disk to start the electronic device;
f)第三程序就可以被BIOS作为普通操作系统的启动文件启动并执行。f) The third program can be started and executed by the BIOS as a startup file of a common operating system.
例如,当所述电子设备为计算时,支持兆芯(C86)、海光(C86)、龙芯(mips)、龙芯(loongarch64)、飞腾(ARM)、Intel、AMD多CPU平台。启动第三程序的过程为:For example, when the electronic device is computing, Zhaoxin (C86), Haiguang (C86), Loongson (mips), Loongson (loongarch64), Phytium (ARM), Intel, AMD multi-CPU platforms are supported. The process of starting the third program is:
进行开机,按F1或者delete键进入BIOS环境,检查并确认启动方式为UEFI或者UEFI优先;Start the computer, press F1 or delete to enter the BIOS environment, check and confirm that the boot mode is UEFI or UEFI priority;
启动UEFI Shell环境,然后通过命令行手动执行第三程序或者制作启动U盘自动执行第三程序;Start the UEFI Shell environment, and then manually execute the third program through the command line or make a boot U disk to automatically execute the third program;
第三程序启动,初始化UEFI Shell下所需环境参数,以便后续步骤在该环境下进行操作。The third program starts, and initializes the required environment parameters under UEFI Shell, so that the subsequent steps can be operated in this environment.
根据第二程序,调整所述隐藏区对应的逻辑块地址的分区表。具体地,执行NVMeGPT.efi(第二程序),第二程序为UEFI辅助程序,调整隐藏区内已可见的LBA具备分区表信息。According to the second program, the partition table of the logical block address corresponding to the hidden area is adjusted. Specifically, execute NVMeGPT.efi (the second program), the second program is a UEFI auxiliary program, and adjust the visible LBA in the hidden area to have partition table information.
重新连接与所述电子设备相连的设备,根据调整后的所述分区表重新连接所述第一类硬盘的分区,以确定所述隐藏区的位置。具体地,在UEFI环境下重新连接所有设备,此时会依据新的NVME SSD磁盘容量的分区表重新连接各个分区。Reconnecting the device connected to the electronic device, and reconnecting the partitions of the first type of hard disk according to the adjusted partition table, so as to determine the location of the hidden area. Specifically, reconnect all devices in the UEFI environment, and then reconnect each partition according to the partition table of the new NVME SSD disk capacity.
接收对所述隐藏区的访问请求,根据访问请求的类型重新映射所有的分区和文件系统,以访问到所述隐藏区。An access request to the hidden area is received, and all partitions and file systems are remapped according to the type of the access request, so as to access the hidden area.
具体地,在UEFI环境重新映射所有的分区和文件系统,重新创建UEFI Shell环境的分区标识fs*。完成第三程序的既定功能,例如隐藏区内数据访问、程序启动、数据或程序更新等;结束第三程序,退出UEFI环境重启。Specifically, all partitions and file systems are remapped in the UEFI environment, and the partition identifier fs* of the UEFI Shell environment is recreated. Complete the established functions of the third program, such as data access in the hidden area, program startup, data or program update, etc.; end the third program, exit the UEFI environment and restart.
作为一可选实施例,所述方法还包括:当所述访问请求为数据升级或者程序升级时,获取第一环境下连接在所述电子设备上的外部存储设备的设备数量。所述外部存储设备包括以下至少一种:U盘或者移动硬盘或者其他种类移动存储介质。As an optional embodiment, the method further includes: when the access request is data upgrade or program upgrade, acquiring the device quantity of the external storage device connected to the electronic device in the first environment. The external storage device includes at least one of the following: U disk, mobile hard disk or other types of mobile storage media.
检查此时电子设备中外接了多少个外部存储设备,将所述设备数量与预设阈值比较,根据比较结果执行相应操作。Check how many external storage devices are connected to the electronic device at this time, compare the number of devices with a preset threshold, and perform corresponding operations according to the comparison result.
作为一可选实施例,所述根据比较结果执行相应操作,包括:当所述设备数量处于所述预设阈值的范围内时,在第一环境下重新映射所有的分区和文件系统。As an optional embodiment, the performing corresponding operations according to the comparison result includes: remapping all partitions and file systems in the first environment when the number of devices is within the range of the preset threshold.
具体地,所述预设阈值设为1,如果仅外接了本方法程序的工作用外部存储设备,即外部存储设备的设备数量为1,满足阈值范围要求,则进行后续步骤。Specifically, the preset threshold is set to 1, and if only the working external storage device of the method program is externally connected, that is, the number of external storage devices is 1, and the threshold range requirement is met, then proceed to the next step.
作为一可选实施例,所述根据比较结果执行相应操作,包括:当所述设备数量不处于所述预设阈值的范围内时,根据接收到的操作指令,结束所述第一程序的运行。As an optional embodiment, the performing the corresponding operation according to the comparison result includes: when the number of devices is not within the range of the preset threshold, ending the operation of the first program according to the received operation instruction .
具体地,如果外接的外部存储设备数量多于1个(本方法程序所存放的U盘),即所述设备数量不在阈值范围内。此时接收到的操作指令包括报告外部存储设备的设备数量的指令、提示摘除多于USB存储设备的指令以及结束第三程序的指令。Specifically, if the number of external storage devices connected is more than one (the U disk stored in the program of this method), that is, the number of devices is not within the threshold range. The operation instructions received at this time include an instruction to report the device quantity of the external storage device, an instruction to prompt removal of more than USB storage devices, and an instruction to end the third program.
作为一可选实施例,所述方法还包括:当所述访问请求为数据访问或者程序启动时,断开第一环境下连接在所述电子设备上的外部存储设备。As an optional embodiment, the method further includes: disconnecting the external storage device connected to the electronic device under the first environment when the access request is data access or program startup.
作为一可选实施例,所述方法还包括:在接收所述访问请求之前,确认所述电子设备在第一环境下是否安装有第二类硬盘;若有,则将所述第二类硬盘移除。所述第二类硬盘为其他SATA接口类型的SSD或HDD。As an optional embodiment, the method further includes: before receiving the access request, confirming whether the electronic device is installed with a second-type hard disk in the first environment; remove. The second type of hard disk is SSD or HDD of other SATA interface types.
具体地,当所述电子设备为计算机时,由于UEFI环境中各个分区表现方式都是fs*然而其顺序又非常依赖于计算机主板设计、外围设备在主板布线、BIOS枚举设备先后顺序等多种不确定因素。Specifically, when the electronic device is a computer, since each partition in the UEFI environment is expressed in the form of fs*, its order is very dependent on the design of the computer motherboard, the wiring of peripheral devices on the motherboard, the sequence of devices enumerated by the BIOS, etc. Uncertainties.
为了准备访问NVME SSD的隐藏区,本方法采用的方式是按照程序功能需求卸载特定多余存储设备。即先确认是否存在其他SATA接口类型的SSD或HDD,如果存在则卸载此设备。In order to prepare for accessing the hidden area of NVME SSD, the method adopted in this method is to unload specific redundant storage devices according to the functional requirements of the program. That is, first confirm whether there are SSDs or HDDs of other SATA interface types, and if so, uninstall this device.
此方法通过UEFI Shell环境运行,基于UEFI EDK2进行开发实现,可以完成计算机开机后BIOS自动引导启动等特点。This method runs through the UEFI Shell environment and is developed and implemented based on UEFI EDK2. It can complete the BIOS automatic booting and starting after the computer is turned on.
当应用的电子设备为计算机时,如图1所示,具体自动化流程步骤如下:When the applied electronic device is a computer, as shown in Figure 1, the specific automation process steps are as follows:
1)电子设备开机,按F1或者delete键进入BIOS环境,检查并确认启动方式为UEFI或者UEFI优先。1) Turn on the electronic device, press the F1 or delete key to enter the BIOS environment, check and confirm that the boot mode is UEFI or UEFI priority.
2)启动UEFI Shell环境,根据接收的启动指令执行本方法程序(即第三程序)。2) Start the UEFI Shell environment, and execute the method program (ie the third program) according to the received startup command.
3)第三程序启动,初始化UEFI Shell下所需环境参数。3) The third program starts to initialize the required environment parameters under UEFI Shell.
4)由于计算机主板上外围设备数量、种类等各不相同,运行的BIOS程序中对所有设备的枚举顺序和分配的编号各不相同,所以需要本方法程序中动态查询当前计算机UEFIShell环境下NVME SSD的设备编号。4) Since the number and types of peripheral devices on the computer motherboard are different, the enumeration order and assigned numbers of all devices in the running BIOS program are different, so it is necessary to dynamically query the NVME in the UEFIShell environment of the current computer in this method program. The device number of the SSD.
5)执行NVMeOpen.efi,第一程序为UEFI辅助程序,对NVME SSD固件下发指令识别隐藏区是否存在,并根据检查结果设置SSD的隐藏区为可见状态。5) Execute NVMeOpen.efi, the first program is the UEFI auxiliary program, which sends instructions to the NVME SSD firmware to identify whether the hidden area exists, and sets the hidden area of the SSD to a visible state according to the inspection result.
6)在UEFI环境中需要设置的SSD属性生效,需要依据步骤4)中获取的设备编号对NVME SSD进行断开。为了实现本方法的高效,断开NVME SSD设备而不是重启计算机或者断开所有设备,可以节省操作周期及减少对多余设备断开引起的风险。6) The SSD attributes that need to be set in the UEFI environment take effect, and the NVME SSD needs to be disconnected according to the device number obtained in step 4). In order to achieve the efficiency of this method, disconnecting the NVME SSD device instead of restarting the computer or disconnecting all devices can save operating cycles and reduce the risk of disconnecting redundant devices.
7)由于此时UEFI环境中已没有NVME SSD设备编号的存在,此处只能重新连接所有设备,此时NVME SSD固件就会设置全部磁盘的LBA可见可访问。7) Since there is no NVME SSD device number in the UEFI environment at this time, all devices can only be reconnected here. At this time, the NVME SSD firmware will set the LBA of all disks to be visible and accessible.
8)执行第二个UEFI辅助程序NVMeGPT.efi,调整NVME SSD固件设置隐藏区内已可见的LBA具备分区表信息。8) Execute the second UEFI auxiliary program NVMeGPT.efi, and adjust the NVME SSD firmware to set the visible LBA in the hidden area to have partition table information.
9)在UEFI环境重新连接所有设备,此时会依据步骤8)中新的全盘磁盘容量的分区表重新连接各个分区。9) Reconnect all devices in the UEFI environment. At this time, each partition will be reconnected according to the partition table of the new full disk capacity in step 8).
10)由于UEFI环境中各个分区表现方式都是fs*,然而其顺序又非常依赖于计算机主板设计、外围设备在主板布线、BIOS枚举设备先后顺序等多种不确定因素。10) Since each partition in the UEFI environment is represented by fs*, its order is very dependent on various uncertain factors such as the design of the computer motherboard, the wiring of peripheral devices on the motherboard, and the sequence of devices enumerated by the BIOS.
为了准备访问NVME SSD的隐藏区,本方法采用的方式是按照程序功能需求卸载特定多余存储设备。先确认是否存在其他SATA接口类型的SSD或HDD,如果存在则卸载此设备。In order to prepare for accessing the hidden area of NVME SSD, the method adopted in this method is to unload specific redundant storage devices according to the functional requirements of the program. First confirm whether there is an SSD or HDD with other SATA interface types, and if so, uninstall this device.
11)如果执行隐藏区内数据升级或者软件升级功能,则检查此时计算机中外接了多少个外部存储设备;11) If performing the data upgrade or software upgrade function in the hidden area, check how many external storage devices are connected to the computer at this time;
12)如果外接的外部设备数量多于1个(本方法程序所存放的U盘),报告外部存储设备的数量,并提示摘除多于外部存储设备,并结束第三程序。12) If the number of external devices connected is more than one (U disk stored in this method program), report the number of external storage devices, and prompt to remove more external storage devices, and end the third program.
13)如果仅外接了本方法程序的工作用外部存储设备,则进行后续步骤15)。13) If only the working external storage device of the method program is externally connected, proceed to subsequent step 15).
14)接步骤11):如果执行数据访问或者隐藏区内程序升级,断开所有外部存储设备;14) Continue to step 11): If performing data access or program upgrade in the hidden area, disconnect all external storage devices;
15)在UEFI环境重新映射所有的分区和文件系统,重新创建UEFI Shell环境的分区标识fs*;15) Remap all partitions and file systems in the UEFI environment, and recreate the partition identifier fs* of the UEFI Shell environment;
16)完成本方法程序既定功能,例如隐藏区内数据访问、程序启动执行、数据或程序软件更新等;16) Complete the established functions of the program of this method, such as data access in the hidden area, program startup and execution, data or program software update, etc.;
17)结束程序,退出UEFI环境重启等。17) End the program, exit the UEFI environment and restart.
本申请实施例的目的之一,在于提供一种电子设备,如图2所示,包括:One of the purposes of the embodiments of the present application is to provide an electronic device, as shown in FIG. 2 , including:
第一调整模块,用于根据第一程序向第一类硬盘下发指令,将隐藏区调整为可见状态。还包括第三获取模块,用于启动第三程序获取第一环境下第一类硬盘的设备编号。The first adjustment module is configured to issue an instruction to the first type of hard disk according to the first program to adjust the hidden area to a visible state. It also includes a third obtaining module, which is used to start a third program to obtain the device number of the first type of hard disk in the first environment.
第一重载模块,用于根据所述的设备编号断开所述第一类硬盘,重新加载与所述电子设备连接的设备,以改变所述第一类硬盘的逻辑块地址的状态,使得所述隐藏区的可见状态生效。The first reloading module is used to disconnect the first-type hard disk according to the device number, and reload the device connected to the electronic device to change the state of the logical block address of the first-type hard disk, so that The visible state of the hidden area takes effect.
第二调整模块,用于根据第二程序,调整所述隐藏区对应的逻辑块地址的分区表。The second adjustment module is configured to adjust the partition table of the logical block address corresponding to the hidden area according to the second program.
第二重载模块,用于重新连接与所述电子设备相连的设备,根据调整后的所述分区表重新连接所述第一类硬盘的分区,以确定所述隐藏区的位置。The second reloading module is used to reconnect the device connected to the electronic device, and reconnect the partition of the first type of hard disk according to the adjusted partition table to determine the location of the hidden area.
接收模块,用于接收对所述隐藏区的访问请求,根据访问请求的类型重新映射所有的分区和文件系统,以访问到所述隐藏区。The receiving module is configured to receive an access request to the hidden area, and remap all partitions and file systems according to the type of the access request, so as to access the hidden area.
所述电子设备还包括:第一获取模块,用于在接收所述访问请求之前,确认所述电子设备在第一环境下是否安装有第二类硬盘;若有,则将所述第二类硬盘移除。The electronic device also includes: a first acquisition module, configured to confirm whether the electronic device has a second-type hard disk installed in the first environment before receiving the access request; Hard drive removed.
所述电子设备还包括:The electronic equipment also includes:
第二获取模块,用于当所述访问请求为数据升级或者程序升级时,获取第一环境下连接在所述电子设备上的外部存储设备的设备数量;比较模块,用于将所述设备数量与预设阈值比较,根据比较结果执行相应操作。The second obtaining module is used to obtain the device quantity of the external storage device connected to the electronic device in the first environment when the access request is a data upgrade or program upgrade; the comparison module is used to compare the device quantity Compare with the preset threshold, and perform corresponding operations according to the comparison result.
电子设备可以为台式计算机(PC)、笔记本电脑、平板电脑、手机等微型或小型计算机,也可以为服务器、工控机等大型计算机。The electronic device may be a micro or small computer such as a desktop computer (PC), a notebook computer, a tablet computer, or a mobile phone, or may be a large computer such as a server or an industrial computer.
本申请实施例的目的之一,在于提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现前述的一种访问隐藏区数据的方法中的各个步骤。One of the purposes of the embodiments of the present application is to provide a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, each step in the aforementioned method for accessing data in a hidden area is implemented .
以上实施例仅为本申请的示例性实施例,不用于限制本申请,本申请的保护范围由权利要求书限定。本领域技术人员可以在本申请的实质和保护范围内,对本申请做出各种修改或等同替换,这种修改或等同替换也应视为落在本申请的保护范围内。The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent replacements to the present application within the spirit and protection scope of the present application, and such modifications or equivalent replacements shall also be deemed to fall within the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211404424.5A CN116048630A (en) | 2022-11-10 | 2022-11-10 | Method for accessing hidden area data, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211404424.5A CN116048630A (en) | 2022-11-10 | 2022-11-10 | Method for accessing hidden area data, electronic equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116048630A true CN116048630A (en) | 2023-05-02 |
Family
ID=86117113
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211404424.5A Pending CN116048630A (en) | 2022-11-10 | 2022-11-10 | Method for accessing hidden area data, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116048630A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119720232A (en) * | 2024-11-07 | 2025-03-28 | 北京长擎软件有限公司 | Hidden area security management method, hidden area file system, device and medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080104380A1 (en) * | 2006-10-31 | 2008-05-01 | Dell Products, Lp | Method and system to dynamically boot to a non-visible partition |
| CN103049223A (en) * | 2012-12-28 | 2013-04-17 | 厦门市美亚柏科信息股份有限公司 | System, device and method for relieving hidden partition of hard disk |
| CN106502739A (en) * | 2016-10-31 | 2017-03-15 | 北京深之度科技有限公司 | Method, device and the computing device that boot disk is made using movable storage device |
| CN114491651A (en) * | 2022-04-18 | 2022-05-13 | 深圳佰维存储科技股份有限公司 | File system protection method and device, readable storage medium and electronic equipment |
| CN114546266A (en) * | 2022-02-07 | 2022-05-27 | 联想开天科技有限公司 | Configuration method and device for hidden partition of solid state disk and storage medium |
-
2022
- 2022-11-10 CN CN202211404424.5A patent/CN116048630A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080104380A1 (en) * | 2006-10-31 | 2008-05-01 | Dell Products, Lp | Method and system to dynamically boot to a non-visible partition |
| CN103049223A (en) * | 2012-12-28 | 2013-04-17 | 厦门市美亚柏科信息股份有限公司 | System, device and method for relieving hidden partition of hard disk |
| CN106502739A (en) * | 2016-10-31 | 2017-03-15 | 北京深之度科技有限公司 | Method, device and the computing device that boot disk is made using movable storage device |
| CN114546266A (en) * | 2022-02-07 | 2022-05-27 | 联想开天科技有限公司 | Configuration method and device for hidden partition of solid state disk and storage medium |
| CN114491651A (en) * | 2022-04-18 | 2022-05-13 | 深圳佰维存储科技股份有限公司 | File system protection method and device, readable storage medium and electronic equipment |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119720232A (en) * | 2024-11-07 | 2025-03-28 | 北京长擎软件有限公司 | Hidden area security management method, hidden area file system, device and medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI225215B (en) | Method and system for maintaining firmware versions in a data processing system | |
| FR2772947A1 (en) | SYSTEM FOR RECOVERY AFTER INCIDENT IN A COMPUTER USING A HIGH-CAPACITANT REMOVABLE SUPPORT | |
| CN102799464B (en) | Virtual machine creation method and system, virtual machine reloading method and system | |
| US7962739B2 (en) | Recovering from hard disk errors that corrupt one or more critical system boot files | |
| CN104679540B (en) | Computer system and computer system starting method | |
| US9804855B1 (en) | Modification of temporary file system for booting on target hardware | |
| US7000231B1 (en) | Method of manufacturing operating system master template, method of manufacturing a computer entity and product resulting therefrom, and method of producing a production version of an operating system | |
| US9846621B1 (en) | Disaster recovery—multiple restore options and automatic management of restored computing devices | |
| CN106445577A (en) | Update method, server system, and non-transitory computer-readable medium | |
| JP5768277B2 (en) | Dismount storage volume | |
| US20220214945A1 (en) | System Booting Method and Apparatus, Node Device, and Computer-Readable Storage Medium | |
| US11157349B2 (en) | Systems and methods for pre-boot BIOS healing of platform issues from operating system stop error code crashes | |
| US9619340B1 (en) | Disaster recovery on dissimilar hardware | |
| US9971532B2 (en) | GUID partition table based hidden data store system | |
| CN110825419A (en) | A firmware refresh method, device, electronic device and storage medium | |
| US8838947B2 (en) | Manufacturing information handling systems | |
| US7849300B2 (en) | Method for changing booting sources of a computer system and a related backup/restore method thereof | |
| CN113342365A (en) | Operating system deployment method, device, equipment and computer-readable storage medium | |
| CN111090546B (en) | Method, device and equipment for restarting operating system and readable storage medium | |
| CN116048630A (en) | Method for accessing hidden area data, electronic equipment and storage medium | |
| GB2434667A (en) | Maintaining System Management BIOS in a computer system | |
| US7506115B2 (en) | Incremental provisioning of software | |
| CN110399168A (en) | Majority according to disk storage server system start method, device and equipment | |
| TWI518594B (en) | Computer system and activation method for computer system | |
| CN113950673B (en) | Non-volatile storage partition identifier |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |