CN103617133B - Virtual memory compression method and device in a kind of Windows systems - Google Patents
Virtual memory compression method and device in a kind of Windows systems Download PDFInfo
- Publication number
- CN103617133B CN103617133B CN201310656949.2A CN201310656949A CN103617133B CN 103617133 B CN103617133 B CN 103617133B CN 201310656949 A CN201310656949 A CN 201310656949A CN 103617133 B CN103617133 B CN 103617133B
- Authority
- CN
- China
- Prior art keywords
- virtual memory
- data
- file
- memory
- behavior
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 88
- 238000007906 compression Methods 0.000 title claims abstract description 86
- 230000006835 compression Effects 0.000 title claims abstract description 86
- 230000006399 behavior Effects 0.000 claims abstract description 43
- 230000026676 system process Effects 0.000 claims abstract description 19
- 230000006870 function Effects 0.000 claims description 54
- 238000004422 calculation algorithm Methods 0.000 claims description 14
- 238000001914 filtration Methods 0.000 claims description 12
- 230000006837 decompression Effects 0.000 claims description 11
- 238000007726 management method Methods 0.000 claims description 10
- 238000004140 cleaning Methods 0.000 claims description 6
- 238000013144 data compression Methods 0.000 claims description 6
- 230000000903 blocking effect Effects 0.000 claims 4
- 230000008569 process Effects 0.000 abstract description 54
- 239000002699 waste material Substances 0.000 abstract description 3
- 238000004364 calculation method Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 239000012634 fragment Substances 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 238000005457 optimization Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000005192 partition Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000000429 assembly Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000013467 fragmentation Methods 0.000 description 1
- 238000006062 fragmentation reaction Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机系统优化技术领域,具体涉及一种Windows系统中虚拟内存压缩方法和装置。The invention relates to the technical field of computer system optimization, in particular to a virtual memory compression method and device in a Windows system.
背景技术Background technique
计算机开机时,需要从磁盘上读取文件来启动计算机系统。很多场景下,文件不是保存在磁盘连续的簇中,而是被分散保存到整个磁盘的不同位置,即在磁盘上产生了文件碎片。例如,当存储文件的磁盘空间不充足时,在磁盘上删除文件或添加文件时会产生大量的文件碎片,对文件的删改越频繁,文件碎片的现象越严重。由于在读取磁盘上不同位置的文件时,磁盘触头需要移动至不同的位置,文件碎片会使磁盘触头来回频繁移动,导致文件读取时间过长,因此,现有方案通过将一个文件的文件碎片填写至磁盘中连续的空间中,来缩短开机过程中读取该文件的时间,以加快计算机系统的开机速度。When the computer is turned on, it needs to read files from the disk to start the computer system. In many scenarios, files are not stored in continuous clusters on the disk, but are scattered and stored in different locations throughout the disk, that is, file fragments are generated on the disk. For example, when the disk space for storing files is insufficient, a large number of file fragments will be generated when files are deleted or added on the disk. The more frequent the deletion and modification of files, the more serious the phenomenon of file fragmentation will be. When reading files in different locations on the disk, the disk contacts need to move to different positions, and file fragments will cause the disk contacts to move back and forth frequently, resulting in a long file reading time. Therefore, the existing scheme uses a file The file fragments are filled in the continuous space in the disk to shorten the time to read the file during the boot process, so as to speed up the boot speed of the computer system.
而在计算机开机的过程中,计算机中所运行的程序均需经由内存执行,若执行的程序占用内存很大或很多,则会导致内存消耗殆尽。为解决该问题,Windows系统中运用了虚拟内存技术,即匀出一部分磁盘空间来充当内存使用。当内存耗尽时,计算机就会自动调用磁盘来充当内存,以应对系统对虚拟内存的占用量大于实际物理内存的情况。虚拟内存技术使得应用程序认为它拥有连续的可用的内存(一个连续完整的地址空间)。When the computer is turned on, the programs running in the computer need to be executed through the memory. If the executed programs occupy a large or a lot of memory, the memory will be exhausted. In order to solve this problem, the virtual memory technology is used in the Windows system, that is, a part of the disk space is set aside to be used as memory. When the memory is exhausted, the computer will automatically call the disk to act as memory to deal with the situation that the system occupies more virtual memory than actual physical memory. Virtual memory technology makes an application think that it has contiguous available memory (a contiguous complete address space).
Windows系统中的虚拟内存技术的实现机制具体为:在系统盘下配置一个虚拟内存文件pagefile.sys,即为虚拟内存保留的磁盘空间;当进程占用的虚拟内存过大时,将当前进程暂时不需要的数据从虚拟内存中换入至虚拟内存文件中;当进程读取已换入虚拟内存文件中的数据时,再将该数据从虚拟内存文件中换入虚拟内存中。这种机制扩展了虚拟内存的空间,使虚拟内存不但可以利用实际的物理内存存储数据,还可以利用磁盘中的一部分空间扩展虚拟内存以存储数据。然而频繁的向磁盘读写数据会耗费大量时间,从而造成了计算机系统运行缓慢的问题。The implementation mechanism of the virtual memory technology in the Windows system is as follows: configure a virtual memory file pagefile.sys under the system disk, which is the disk space reserved for virtual memory; The required data is swapped from the virtual memory into the virtual memory file; when the process reads the data that has been swapped into the virtual memory file, the data is swapped from the virtual memory file into the virtual memory. This mechanism expands the space of the virtual memory, so that the virtual memory can not only use the actual physical memory to store data, but also use a part of the disk space to expand the virtual memory to store data. However, frequent reading and writing of data to the disk will consume a lot of time, thus causing the problem of slow operation of the computer system.
现有技术采用系统优化加速技术解决进程占用大量内存时,计算机系统运行缓慢的问题。例如计算机提供的一些优化加速的功能,当用户选用优化功能时,将当前无用的进程关闭并释放被关闭进程所占用的虚拟内存。但是,现有技术无法解决在不关闭进程的情况下,所占用的虚拟内存过大所导致的系统运行缓慢的问题。The prior art adopts the system optimization acceleration technology to solve the problem that the computer system runs slowly when the process occupies a large amount of memory. For example, some optimization and acceleration functions provided by the computer, when the user selects the optimization function, the currently useless process is closed and the virtual memory occupied by the closed process is released. However, the prior art cannot solve the problem of slow running of the system caused by excessively occupied virtual memory without closing the process.
发明内容Contents of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的Windows系统中虚拟内存压缩方法和装置。In view of the above problems, the present invention is proposed to provide a virtual memory compression method and device in a Windows system that overcomes the above problems or at least partially solves the above problems.
根据本发明的一个方面,提供了一种Windows系统中虚拟内存压缩方法,包括:拦截系统进程中的常驻线程通过虚拟内存向虚拟内存文件写数据的行为,将数据进行压缩,存储在虚拟内存中;拦截常驻线程通过虚拟内存向虚拟内存文件读数据的行为,将存储在虚拟内存中的数据进行解压缩,返回给系统进程。According to one aspect of the present invention, a virtual memory compression method in a Windows system is provided, comprising: intercepting the behavior of a resident thread in a system process writing data to a virtual memory file through the virtual memory, compressing the data, and storing it in the virtual memory Medium; intercept the behavior of the resident thread to read data to the virtual memory file through the virtual memory, decompress the data stored in the virtual memory, and return it to the system process.
根据本发明的另一方面,提供了一种Windows系统中虚拟内存压缩装置,包括:I/O拦截模块,适于拦截系统进程中的常驻线程通过虚拟内存向虚拟内存文件写数据的行为,以及拦截常驻线程通过虚拟内存向虚拟内存文件读数据的行为;内存压缩模块,适于在I/O拦截模块拦截常驻线程通过虚拟内存向虚拟内存文件写数据的行为之后,将数据进行压缩,存储在虚拟内存中;内存解压缩模块,适于在I/O拦截模块拦截常驻线程通过虚拟内存向虚拟内存文件读数据的行为之后,将存储在虚拟内存中的数据进行解压缩,返回给系统进程。According to another aspect of the present invention, a virtual memory compression device in a Windows system is provided, including: an I/O interception module, adapted to intercept the behavior of a resident thread in a system process writing data to a virtual memory file through a virtual memory, And intercept the behavior of the resident thread to read data to the virtual memory file through the virtual memory; the memory compression module is suitable for compressing the data after the I/O interception module intercepts the behavior of the resident thread writing data to the virtual memory file through the virtual memory , stored in the virtual memory; the memory decompression module is suitable for decompressing the data stored in the virtual memory after the I/O interception module intercepts the behavior of the resident thread reading data to the virtual memory file through the virtual memory, and returns to the system process.
根据本发明的Windows系统中虚拟内存压缩方法和装置,拦截系统进程中的常驻线程通过虚拟内存向虚拟内存文件写数据的行为,并对该数据压缩后重新存回虚拟内存而不是磁盘中;之后,拦截常驻线程通过虚拟内存向虚拟内存文件读取该数据的行为,对压缩存储至虚拟内存的数据解压后发送给进程,可以在当前进程都在工作的情况下,所占用的虚拟内存过大时,避免对磁盘的频繁读写造成的时间浪费,进而解决了系统运行缓慢的问题。According to the virtual memory compression method and device in the Windows system of the present invention, the behavior of the resident thread in the system process to write data to the virtual memory file through the virtual memory is intercepted, and the data is compressed and stored back in the virtual memory instead of the disk; Afterwards, the behavior of the resident thread to read the data from the virtual memory file through the virtual memory is intercepted, and the data compressed and stored in the virtual memory is decompressed and sent to the process. When the current process is working, the occupied virtual memory When the value is too large, the time wasted caused by frequent reading and writing of the disk is avoided, thereby solving the problem of slow system operation.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:
图1示出了根据本发明一个实施例的Windows系统中虚拟内存压缩方法的流程图;Fig. 1 shows the flowchart of the virtual memory compression method in the Windows system according to one embodiment of the present invention;
图2示出了根据本发明另一个实施例的Windows系统中虚拟内存压缩方法的流程图;Fig. 2 shows the flowchart of the virtual memory compression method in the Windows system according to another embodiment of the present invention;
图3示出了本发明一个实施例提供的Windows系统中虚拟内存压缩装置与虚拟内存、虚拟内存文件连接的结构框图。Fig. 3 shows a structural block diagram of the connection between the virtual memory compression device, the virtual memory and the virtual memory file in the Windows system provided by an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
计算机开机过程是从计算机通电自检完成之后开始进行的,这一过程可以细分为预引导、引导、载入内核、初始化内核和系统登录操作这五个阶段,将计算机开机过程中执行预引导、引导、载入内核、初始化内核至系统登录操作时从系统磁盘上读取的文件作为系统开机文件,记录读取该系统开机文件的顺序作为获取到的读取顺序。在开机过程中需要读取的文件主要包括Ntldr、Boot.ini、Ntdetect.com、Ntoskrnl.exe、Ntbootdd.sys以及Bootsect.dos等文件,各个阶段的主要处理过程如下:The computer boot process begins after the computer power-on self-test is completed. This process can be subdivided into five stages: pre-boot, boot, kernel loading, initialization kernel, and system login operation. The pre-boot , guide, load the kernel, initialize the kernel, and read the files from the system disk during the system login operation as the system startup file, and record the sequence of reading the system startup file as the obtained reading sequence. The files that need to be read during the boot process mainly include Ntldr, Boot.ini, Ntdetect.com, Ntoskrnl.exe, Ntbootdd.sys, and Bootsect.dos. The main processing processes of each stage are as follows:
预引导阶段pre-boot phase
计算机启动后,BIOS自检通过后,开始寻找引导设备,正常情况下需要的引导的设备就是计算机硬盘。BIOS读取硬盘的第一个扇区的引导代码,即主引导记录(Master BootRecord,MBR)到内存,然后将控制权转移到MBR代码。MBR代码功能是寻找磁盘的引导分区(boot partition),其第一个扇区为引导扇区(boot sector),该卷称为系统卷(systemvolume)。After the computer is started and the BIOS self-test is passed, it starts to look for the boot device. Normally, the boot device needed is the computer hard disk. The BIOS reads the boot code of the first sector of the hard disk, that is, the Master Boot Record (MBR) into the memory, and then transfers control to the MBR code. The function of the MBR code is to find the boot partition of the disk, the first sector of which is the boot sector, and this volume is called the system volume.
引导阶段bootstrap phase
引导扇区的代码能够解析系统卷的文件格式,并找到Ntldr,该程序会将处理器由实模式(Real Mode)切换为32位平坦内存模式(32-bit Flat Memory Mode)。Ntldr程序在完成了初始化工作之后会从硬盘上读取boot.ini文件,根据该文件中的内容选择操作系统。在选择了需要载入的Windows操作系统之后,Ntdetect.com将计算机中安装的所有硬件信息收集起来,并将该信息交给Ntldr。The code in the boot sector parses the file format of the system volume and finds Ntldr, which switches the processor from Real Mode to 32-bit Flat Memory Mode. After the Ntldr program completes the initialization work, it will read the boot.ini file from the hard disk, and select the operating system according to the contents of the file. After selecting the Windows operating system to load, Ntdetect.com gathers information about all the hardware installed in the computer and passes this information to Ntldr.
载入内核阶段load kernel stage
载入系统的内核文件Ntoskrnl.exe,但这里仅仅是载入,内核此时还不会被初始化。随后载入硬件抽象层HAL.dll。加载SYSTEM注册表储巢文件(%SystemRoot%\system32\Config\System)为注册表键值(HKEY_LOCAL_MACHINE\SYSTEM),根据注册表中引导设备驱动列表添加相应的文件系统驱动,以实现对各个分区、目录、文件的访问管理。Load the system's kernel file Ntoskrnl.exe, but here it is only loaded, and the kernel will not be initialized at this time. Then load the hardware abstraction layer HAL.dll. Load the nesting file of the SYSTEM registry (%SystemRoot%\system32\Config\System) as the registry key (HKEY_LOCAL_MACHINE\SYSTEM), and add the corresponding file system driver according to the boot device driver list in the registry, so as to implement each partition, Directory and file access management.
初始化内核阶段Initialize the kernel stage
内核初始化进程会加载(HKEY_LOCAL_MACHINE\SYSTEM\The kernel initialization process will load (HKEY_LOCAL_MACHINE\SYSTEM\
CurrentControlSet\services)中记录的驱动,如磁盘管理过滤驱动、网络驱动等。先加载注册为“Start”键值0(SERVICE_BOOT_START)的驱动然后加载键值为1(SERVICE_SYSTEM_START)的驱动。首先扫描(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ServiceGro upOrder)中定义的组别加载顺序,按照组别依次加载已注册的驱动,已注册驱动的组别会记录在注册表键值“Group”中。对相同组别的驱动,会根据注册表键值“Tag”来决定加载顺序。GroupOrderList(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GroupOrder List)中每个组的第一项都是Tag值的数值。接下来是要加载的Tag值的数字顺序。组中的设备驱动程序首先按照其由GroupOrderList所定义的Tag值进行加载。如果设备驱动程序没有Tag值,或者Tag值不在GroupOrderList中,则这些设备驱动程序将在加载具有有效Tag值的设备驱动程序之后进行加载。Drivers recorded in CurrentControlSet\services), such as disk management filter drivers, network drivers, etc. First load the driver registered as "Start" key value 0 (SERVICE_BOOT_START) and then load the driver with key value 1 (SERVICE_SYSTEM_START). First scan the group loading order defined in (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder), and load the registered drivers in order according to the group, and the registered driver group will be recorded in the registry key "Group". For drivers of the same group, the loading sequence will be determined according to the registry key "Tag". The first item of each group in the GroupOrderList (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GroupOrder List) is the value of the Tag value. Next is the numerical order of the Tag values to load. The device drivers in the group are first loaded according to the Tag value defined by GroupOrderList. If the device driver has no Tag value, or the Tag value is not in the GroupOrderList, these device drivers will be loaded after loading the device driver with a valid Tag value.
系统登录阶段System login phase
在本阶段会话管理器启动本地安全性授权子系统。执行到这一步后,计算机显示屏上会显示Windows系统的登录界面,与此同时,后台会加载一些非关键的设备驱动。In this phase the session manager starts the local security authorization subsystem. After this step is executed, the Windows system login interface will be displayed on the computer screen, and at the same time, some non-critical device drivers will be loaded in the background.
通过上述五个阶段的操作,计算机开机过程执行完毕,从而获知了系统开机时所有需要读取的系统开机文件以及这些系统开机文件的读取顺序。Through the operations in the above five stages, the computer booting process is completed, so that all system booting files that need to be read and the reading sequence of these system booting files are known when the system is booting up.
图1示出了根据本发明一个实施例的Windows系统中虚拟内存压缩方法的流程图,如图1所示,该方法包括如下步骤:Fig. 1 shows the flowchart of the virtual memory compression method in the Windows system according to one embodiment of the present invention, as shown in Fig. 1, the method comprises the following steps:
步骤S110,拦截系统进程中的常驻线程通过虚拟内存向虚拟内存文件写数据的行为,将数据进行压缩,存储在虚拟内存中。Step S110, intercepting the behavior of the resident thread in the system process writing data to the virtual memory file through the virtual memory, compressing the data, and storing it in the virtual memory.
本发明实施例中,进程是指具有一定独立功能的程序关于某个数据集合上的一次运行活动,进程是系统进行资源分配和调度的一个独立单位;线程是指进程的一个实体,是CPU调度和分派的基本单位;线程是比进程更小的能独立运行的基本单位;线程自己基本上不拥有系统资源,只拥有一点在运行中必不可少的资源,但是它可与同属一个进程的其他的线程共享进程所拥有的全部资源。在系统进程里面会有一个常驻线程,当系统对虚拟内存的占用量大于实际物理内存的时候,会将不常用的数据写入虚拟内存文件中。In the embodiment of the present invention, a process refers to a program with certain independent functions about a running activity on a certain data set, and a process is an independent unit for the system to perform resource allocation and scheduling; a thread refers to an entity of a process, which is a CPU scheduling The basic unit of allocation and allocation; a thread is a basic unit that is smaller than a process and can run independently; a thread itself basically does not own system resources, but only has a few resources that are essential in operation, but it can communicate with other processes belonging to the same process The threads share all resources owned by the process. There will be a resident thread in the system process. When the system occupies more virtual memory than the actual physical memory, it will write infrequently used data into the virtual memory file.
虚拟内存文件即是指操作系统为虚拟内存保留的磁盘空间,例如Windows系统中的pagefile.sys文件,pagefile.sys文件包含了Windows操作系统中的系统设置和变量,用于运行操作系统的功能、常用的存储设备驱动程序和其他核心的Windows功能。当系统占用的虚拟内存空间大于实际物理内存时,Windows系统会唤醒用于换页的常驻线程,常驻线程会执行使虚拟内存向虚拟内存文件写数据的行为,即发送将当前进程的相关数据从虚拟内存中写入至虚拟内存文件中的请求,通过pagefile.sys文件提供更大的虚拟内存空间,从而满足进程对更大内存的需求;本步骤对该请求进行拦截,将请求写入虚拟内存文件中的数据进行压缩,然后将该数据存储回虚拟内存中,而并非如现有技术那样将数据写入磁盘。The virtual memory file refers to the disk space reserved by the operating system for virtual memory, such as the pagefile. Commonly used storage device drivers and other core Windows functions. When the virtual memory space occupied by the system is larger than the actual physical memory, the Windows system will wake up the resident thread for paging, and the resident thread will perform the behavior of making the virtual memory write data to the virtual memory file, that is, send the current process related The request to write data from the virtual memory to the virtual memory file provides a larger virtual memory space through the pagefile.sys file to meet the process’s demand for larger memory; this step intercepts the request and writes Instead of writing the data to disk as in the prior art, the data in the virtual memory file is compressed and then stored back in virtual memory.
步骤S120,拦截常驻线程通过虚拟内存向虚拟内存文件读数据的行为,将存储在虚拟内存中的数据进行解压缩,返回给系统进程。Step S120, intercepting the behavior of the resident thread reading data from the virtual memory file through the virtual memory, decompressing the data stored in the virtual memory, and returning it to the system process.
当进程需要读取存储在虚拟内存中的已压缩的数据时,由于进程并不知晓该数据没有被写入磁盘中,仍会让常驻线程执行通过虚拟内存向虚拟内存文件读该数据的行为,即发送从虚拟内存文件中读取该进程需要使用的数据的请求;本步骤对该请求进行拦截,将该进程请求读取的且已经压缩至虚拟内存的数据进行解压,并返回给进程。When the process needs to read the compressed data stored in the virtual memory, since the process does not know that the data has not been written to the disk, it will still let the resident thread perform the behavior of reading the data to the virtual memory file through the virtual memory , that is, send a request to read the data that the process needs to use from the virtual memory file; this step intercepts the request, decompresses the data that the process requests to read and has been compressed into the virtual memory, and returns it to the process.
根据本发明上述实施例提供的方法,拦截系统进程中的常驻线程通过虚拟内存向虚拟内存文件写数据的行为,并对该数据压缩后重新存回虚拟内存而不是磁盘中;之后,拦截常驻线程通过虚拟内存向虚拟内存文件读取该数据的行为,对压缩存储至虚拟内存的数据解压后发送给进程,可以在当前进程都在工作的情况下,所占用的虚拟内存过大时,避免对磁盘的频繁读写造成的时间浪费,进而解决了系统运行缓慢的问题。进一步解决了磁盘触头在磁道中频繁切换来回往复移动造成的文件读取时间过长的问题,能够显著提高计算机的开机速度,更加有效地实现计算机开机加速的目的。According to the method provided by the above-mentioned embodiments of the present invention, intercept the behavior of the resident thread in the system process writing data to the virtual memory file through the virtual memory, and store the data back in the virtual memory instead of the disk after compressing the data; The resident thread reads the data from the virtual memory file through the virtual memory, decompresses the compressed data stored in the virtual memory, and sends it to the process. When the current process is working and the virtual memory occupied is too large, Avoid the waste of time caused by frequent reading and writing of the disk, and then solve the problem of slow system operation. It further solves the problem of too long file reading time caused by the frequent switching and reciprocating movement of the disk contacts in the magnetic track, can significantly improve the booting speed of the computer, and more effectively realize the purpose of accelerating the booting of the computer.
本发明实施例中能够应用于NTFS文件系统中,则系统开机文件为NTFS系统下计算机开机时需要读取的文件。NTFS文件系统为Microsoft的Windows系列操作系统提供文件系统。NTFS对传统的文件分配表(FAT,File Allocation Table)系统和高性能文件系统(HPFS,High-Performance File System)作了若干改进,例如,支持元数据,并且使用了高级数据结构,以便于改善性能、可靠性和磁盘空间利用率,并提供了若干附加扩展功能,如访问控制列表和文件系统日志。NTFS的特点包括支持2TB大小的分区、可恢复的文件系统、支持文件夹压缩以及有效管理磁盘空间等等。In the embodiment of the present invention, it can be applied to the NTFS file system, and the system startup file is a file that needs to be read when the computer is turned on under the NTFS system. The NTFS file system provides the file system for Microsoft's Windows family of operating systems. NTFS has made several improvements to the traditional file allocation table (FAT, File Allocation Table) system and high-performance file system (HPFS, High-Performance File System), for example, supports metadata, and uses advanced data structures to facilitate improvement performance, reliability, and disk space utilization, and provides several additional extensions, such as access control lists and file system journaling. The characteristics of NTFS include supporting partitions of 2TB size, recoverable file system, support for folder compression, effective management of disk space, and so on.
图2示出了根据本发明另一个实施例的Windows系统中虚拟内存压缩方法的流程图,如图2所示,该方法包括如下步骤:Fig. 2 shows the flowchart of the virtual memory compression method in the Windows system according to another embodiment of the present invention, as shown in Fig. 2, the method comprises the following steps:
步骤S210,利用Windows系统提供的文件过滤功能,拦截系统进程中的常驻线程通过虚拟内存向虚拟内存文件写数据的行为。Step S210, using the file filtering function provided by the Windows system to intercept the behavior of the resident thread in the system process writing data to the virtual memory file through the virtual memory.
当虚拟内存向虚拟内存文件(pagefile.sys)写数据时,即向磁盘写数据时,利用Windows系统提供的文件过滤功能,对向pagefile.sys文件写数据的行为进行拦截。具体地,本发明通过开发文件过滤驱动实现该拦截功能。文件过滤驱动是一种Windows系统内核模式的驱动,它依靠拦截发往已存在的内核模式目标驱动的I/O请求来提供新的附加功能,而不会使底层驱动或用户程序做任何改变。文件过滤驱动拦截向pagefile.sys文件写数据的请求并获取请求向pagefile.sys文件写入的数据。文件过滤驱动不同于内存换页。内存换页属于内存管理,需要知道源程序才能进行。而文件过滤驱动提供是Windows系统的辅助功能,文件过滤驱动能够在不知道源程序的情况下拦截虚拟内存向虚拟内存文件写数据的行为。When the virtual memory writes data to the virtual memory file (pagefile.sys), that is, when writing data to the disk, use the file filtering function provided by the Windows system to intercept the behavior of writing data to the pagefile.sys file. Specifically, the present invention implements the interception function by developing a file filter driver. A file filter driver is a Windows system kernel-mode driver that provides new additional functionality by intercepting I/O requests sent to existing kernel-mode target drivers without making any changes to the underlying drivers or user programs. The file filtering driver intercepts the request to write data to the pagefile.sys file and obtains the data requested to be written to the pagefile.sys file. File filter drivers are different from memory paging. Memory paging belongs to memory management, and it needs to know the source program to proceed. The file filtering driver provides an auxiliary function of the Windows system, and the file filtering driver can intercept the behavior of writing data from the virtual memory to the virtual memory file without knowing the source program.
步骤S220,计算数据的压缩比,该步骤为本实施例的可选步骤。Step S220, calculating the compression ratio of the data, which is an optional step in this embodiment.
压缩比指压缩前与压缩后的文件所占的磁盘空间比值。数据的压缩比高,说明数据的冗余度高,即数据的重复率高,适合压缩。本实施例对请求向pagefile.sys文件写入的数据进行压缩比计算,获取计算结果。根据计算结果,优先选择压缩比高的数据进行后续压缩处理。一种可选的实施方式是,预先设定一阈值,选择压缩比高于或等于该设定阈值的数据进行后续压缩处理;对于压缩比低于该设定阈值的数据,可以依据现有的方法将其写入pagefile.sys文件中,数据的压缩比低,说明数据的冗余度低,即数据的重复率低,不适合压缩,将不适合压缩的数据直接写入虚拟内存文件,避免了压缩效率低下的问题。这里的设定阈值可以设置为96%,但不以此为限。The compression ratio refers to the ratio of disk space occupied by files before compression to those after compression. A high data compression ratio indicates that the data redundancy is high, that is, the data has a high repetition rate and is suitable for compression. In this embodiment, the compression ratio calculation is performed on the data requested to be written into the pagefile.sys file, and the calculation result is obtained. According to the calculation result, the data with high compression ratio is preferentially selected for subsequent compression processing. An optional implementation is to pre-set a threshold, and select data whose compression ratio is higher than or equal to the set threshold for subsequent compression processing; for data whose compression ratio is lower than the set threshold, it can be based on the existing The method writes it into the pagefile.sys file. The compression ratio of the data is low, indicating that the redundancy of the data is low, that is, the repetition rate of the data is low, and it is not suitable for compression. Write the data that is not suitable for compression directly into the virtual memory file to avoid The problem of low compression efficiency is solved. The setting threshold here can be set to 96%, but not limited thereto.
本发明实施例也不仅限于上述方式,也可以采用其他方式选择数据进行后续的压缩处理,其选择依据除了根据压缩比之外,也可以考虑其它因素。The embodiments of the present invention are not limited to the above methods, and other methods may also be used to select data for subsequent compression processing, and the selection basis may also consider other factors besides the compression ratio.
步骤S230,利用LZO系列压缩算法将压缩比高于或等于设定阈值的数据进行压缩,存储在虚拟内存中。In step S230, the data whose compression ratio is higher than or equal to the set threshold is compressed by using the LZO series of compression algorithms, and stored in the virtual memory.
LZO(Lempel-Ziv-Oberhumer)系列压缩算法是一种数据压缩无损算法,通过软件工具lzop实现。LZO系列压缩算法能够将数据块压缩成匹配数据(滑动字典)和非匹配文字的序列。而且LZO对于较长的匹配数据以及较长的非匹配文字序列有专门的处理,这样对于高度冗余的数据能够取得很好的效果,并且对于不可压缩的数据也能得到可以接受的效果。LZO系列压缩算法解压简单、压缩/解压速度非常快、仅需占用64k虚拟内存。因此使用LZO系列压缩算法对数据进行压缩,对于Windows系统占用虚拟内存的空间大于实际物理内存的情况,能够进一步减少虚拟内存的占用,提升系统整体的运行速度。本发明实施例也不仅限于使用LZO系列压缩算法,也可以使用其它数据压缩无损算法。The LZO (Lempel-Ziv-Oberhumer) series compression algorithm is a lossless data compression algorithm, which is realized by the software tool lzop. The LZO family of compression algorithms is capable of compressing data blocks into sequences of matching data (sliding dictionaries) and non-matching literals. Moreover, LZO has special processing for longer matching data and longer non-matching text sequences, so that it can achieve good results for highly redundant data, and can also get acceptable results for incompressible data. The LZO series compression algorithm is easy to decompress, the compression/decompression speed is very fast, and only needs to occupy 64k virtual memory. Therefore, the use of LZO series compression algorithms to compress data can further reduce the occupation of virtual memory and improve the overall operating speed of the system when the space occupied by the virtual memory of the Windows system is larger than the actual physical memory. The embodiments of the present invention are not limited to the use of LZO series compression algorithms, and other lossless data compression algorithms may also be used.
步骤S240,利用Windows系统提供的文件过滤功能,拦截常驻线程通过虚拟内存向虚拟内存文件读数据的行为。Step S240, using the file filtering function provided by the Windows system to intercept the behavior of the resident thread reading data to the virtual memory file through the virtual memory.
当进程需要读取已经通过步骤S230进行压缩并存回虚拟内存的数据时,系统根据原有的虚拟内存扩展机制,仍然认为该数据存储于pagefile.sys文件中,系统会向pagefile.sys文件请求读取该进程所需数据。此时,通过Windows系统提供的文件过滤功能对向pagefile.sys文件读取数据的请求进行拦截。具体地如步骤S210所述的,是由文件过滤驱动在不知道源程序的情况下拦截常驻线程通过虚拟内存向虚拟内存文件读数据的行为。When the process needs to read the data that has been compressed and stored back into the virtual memory in step S230, the system still thinks that the data is stored in the pagefile. Get the data needed for the process. At this time, the request to read data from the pagefile.sys file is intercepted through the file filtering function provided by the Windows system. Specifically, as described in step S210, the file filter driver intercepts the behavior of the resident thread reading data to the virtual memory file through the virtual memory without knowing the source program.
步骤S250,将存储在虚拟内存中的数据进行解压缩,返回给进程。Step S250, decompressing the data stored in the virtual memory and returning it to the process.
在拦截向pagefile.sys文件请求读取该进程所需数据的行为后,从虚拟内存中读取该数据,对数据进行解压缩处理,这里的解压缩方法与步骤230所使用的压缩方法是相对应的。解压缩后将数据返回给请求的进程。After intercepting the request to the pagefile.sys file to read the data required by the process, the data is read from the virtual memory, and the data is decompressed. The decompression method here is the same as the compression method used in step 230 corresponding. Returns the data to the requesting process after decompression.
通过本实施例上述处理步骤,可以在不知道源代码的情况下,对向虚拟内存文件读写数据的行为进行拦截。此外,一方面提前对数据是否适合压缩进行判断,对不适合压缩的数据直接存入虚拟内存文件,另一方面采用对虚拟内存要求小、压缩效率高的LZO系列压缩算法进行压缩,能够在不关闭进程的前提下,进一步节约虚拟内存可用空间、提升系统运行速度。Through the above processing steps in this embodiment, the behavior of reading and writing data to the virtual memory file can be intercepted without knowing the source code. In addition, on the one hand, it judges whether the data is suitable for compression in advance, and directly stores the data that is not suitable for compression into the virtual memory file; On the premise of closing the process, it further saves the available space of the virtual memory and improves the operating speed of the system.
进一步的,在上述实施例中,如果在步骤S230之后一直到进程关闭,进程都没有发送读取已压缩存储在虚拟内存中的数据的请求,在这种情况下数据存储在虚拟内存中占用虚拟内存的空间,使其它数据得不到及时处理。为了解决该问题,本发明实施例所采用的一种可选的方法是:利用钩子函数钩取Windows系统的内存释放函数;在钩取到内存释放函数之后,清理存储在虚拟内存中的数据。Further, in the above-mentioned embodiment, if after step S230 until the process is closed, the process does not send a request to read the compressed data stored in the virtual memory, in this case the data stored in the virtual memory occupies a virtual The memory space prevents other data from being processed in time. In order to solve this problem, an optional method adopted in the embodiment of the present invention is: use the hook function to hook the memory release function of the Windows system; after hooking the memory release function, clean up the data stored in the virtual memory.
内存释放函数具体指Windows系统在进程关闭时所调用的函数,如MiReleasePageFileSpace函数。在Windows系统原有的虚拟内存扩展机制下应用本发明的情况下,当进程关闭时,Windows系统会调用内存释放函数。本发明实施例通过钩子函数(hook函数)钩取该内存释放函数,作为系统关闭进程的通知消息,利用Windows系统自带的功能检测出占用虚拟内存空间的进程是否工作。在钩取到内存释放函数之后,清理存储在虚拟内存中的数据,以完成数据清理。The memory release function specifically refers to the function called by the Windows system when the process is closed, such as the MiReleasePageFileSpace function. When the present invention is applied under the original virtual memory expansion mechanism of the Windows system, when the process is closed, the Windows system will call the memory release function. The embodiment of the present invention hooks the memory release function through a hook function (hook function) as a notification message for the system to shut down the process, and uses the built-in function of the Windows system to detect whether the process occupying the virtual memory space is working. After the memory release function is hooked, the data stored in the virtual memory is cleaned up to complete data cleaning.
可选地,本发明实施例提供的方法也可以定时清理存储在虚拟内存中的超过一定时间没有被读取的数据,而不是等到进程关闭后再清理。Optionally, the method provided by the embodiment of the present invention may also periodically clean up the data stored in the virtual memory that has not been read for a certain period of time, instead of waiting for the process to be closed before cleaning up.
根据本发明上述实施例提供的方法,利用Windows系统本身的功能完成对虚拟内存文件读写数据行为的拦截、以及对虚拟内存中数据的释放,对现有系统改动小,实现方便。利用文件过滤功能能够在不知道源代码的情况下完成对虚拟内存文件读写数据行为的拦截。利用LZO系列压缩算法进行压缩能够进一步提高压缩效率,提高系统的运行速度。利用内存释放函数能够实时将没用的虚拟内存释放,进一步提高系统运行速度。According to the method provided by the above-mentioned embodiments of the present invention, the function of the Windows system itself is used to intercept the behavior of reading and writing data in the virtual memory file and release the data in the virtual memory, which requires little modification to the existing system and is convenient to implement. Using the file filtering function can complete the interception of reading and writing data behaviors of virtual memory files without knowing the source code. Using the LZO series of compression algorithms for compression can further improve the compression efficiency and improve the operating speed of the system. Use the memory release function to release the useless virtual memory in real time, further improving the operating speed of the system.
图3示出了本发明一个实施例提供的Windows系统中虚拟内存压缩装置300与虚拟内存370、虚拟内存文件380连接的结构框图,如图3所示,该装置300包括:I/O拦截模块310、内存压缩模块320以及内存解压缩模块330。Fig. 3 shows the structural block diagram that virtual memory compression device 300 is connected with virtual memory 370, virtual memory file 380 in the Windows system that one embodiment of the present invention provides, as shown in Fig. 3, this device 300 comprises: I/O interception module 310 , a memory compression module 320 and a memory decompression module 330 .
I/O拦截模块310适于拦截系统进程中的常驻线程通过虚拟内存370向虚拟内存文件380写数据的行为,以及拦截常驻线程通过虚拟内存370向虚拟内存文件380读数据的行为。The I/O interception module 310 is suitable for intercepting the behavior of the resident thread in the system process writing data to the virtual memory file 380 through the virtual memory 370 and intercepting the behavior of the resident thread reading data to the virtual memory file 380 through the virtual memory 370 .
具体地,I/O拦截模块310利用Windows系统提供的文件过滤功能,拦截常驻线程通过虚拟内存370向虚拟内存文件写数据的行为,并且利用Windows系统提供的文件过滤功能,拦截常驻线程通过虚拟内存370向虚拟内存文件读数据的行为。以pagefile.sys文件为例,当I/O拦截模块310拦截到向pagefile.sys文件写数据的请求时,I/O拦截模块310向内存压缩模块320发送将数据压缩的请求。当I/O拦截模块310拦截到向pagefile.sys文件读数据的请求时,I/O拦截模块310向内存解压缩模块330发送将数据解压的请求。Specifically, the I/O interception module 310 uses the file filtering function provided by the Windows system to intercept the behavior of the resident thread writing data to the virtual memory file through the virtual memory 370, and uses the file filtering function provided by the Windows system to intercept the resident thread from passing through the virtual memory file. The behavior of virtual memory 370 reading data to a virtual memory file. Taking the pagefile.sys file as an example, when the I/O interception module 310 intercepts a request to write data to the pagefile.sys file, the I/O interception module 310 sends a request to the memory compression module 320 to compress the data. When the I/O interception module 310 intercepts the request to read data from the pagefile.sys file, the I/O interception module 310 sends a request to the memory decompression module 330 to decompress the data.
具体地,I/O拦截模块310可以为开发的文件过滤驱动。文件过滤驱动是一种Windows系统内核模式的驱动,它依靠拦截发往已存在的内核模式目标驱动的I/O请求来提供新的附加功能,而不会使底层驱动或用户程序做任何改变。文件过滤驱动拦截向pagefile.sys文件读写数据的请求。文件过滤驱动不同于内存换页。内存换页属于内存管理,需要知道源程序才能进行。而文件过滤驱动提供是Windows系统的辅助功能,文件过滤驱动能够在不知道源程序的情况下拦截向pagefile.sys文件读写数据的请求。Specifically, the I/O interception module 310 may be a developed file filter driver. A file filter driver is a Windows system kernel-mode driver that provides new additional functionality by intercepting I/O requests sent to existing kernel-mode target drivers without making any changes to the underlying drivers or user programs. The file filter driver intercepts requests to read and write data to the pagefile.sys file. File filter drivers are different from memory paging. Memory paging belongs to memory management, and it needs to know the source program to proceed. The file filter driver is an auxiliary function of the Windows system, and the file filter driver can intercept requests for reading and writing data to the pagefile.sys file without knowing the source program.
内存压缩模块320适于在I/O拦截模块310拦截常驻线程通过虚拟内存370向虚拟内存文件380写数据的行为之后,将数据进行压缩,存储在虚拟内存370中。The memory compression module 320 is adapted to compress the data and store it in the virtual memory 370 after the I/O interception module 310 intercepts the behavior of the resident thread writing data to the virtual memory file 380 through the virtual memory 370 .
具体地,内存压缩模块320利用LZO系列压缩算法将数据进行压缩。内存压缩模块320根据I/O拦截模块310发送的将数据压缩的请求,将数据进行压缩,存储在虚拟内存370中。Specifically, the memory compression module 320 uses the LZO series of compression algorithms to compress the data. The memory compression module 320 compresses the data and stores it in the virtual memory 370 according to the data compression request sent by the I/O interception module 310 .
内存解压缩模块330适于在I/O拦截模块310拦截常驻线程通过虚拟内存370向虚拟内存文件380读数据的行为之后,将存储在虚拟内存370中的数据进行解压缩,返回给进程。The memory decompression module 330 is adapted to decompress the data stored in the virtual memory 370 and return it to the process after the I/O interception module 310 intercepts the behavior of the resident thread reading data to the virtual memory file 380 through the virtual memory 370 .
具体地,内存解压缩模块330根据I/O拦截模块310发送的将数据解压的请求,将存储在虚拟内存中的数据进行解压缩,返回给进程。Specifically, the memory decompression module 330 decompresses the data stored in the virtual memory according to the data decompression request sent by the I/O interception module 310, and returns it to the process.
可选地,本发明的装置还包括计算模块350和写入模块360。Optionally, the device of the present invention further includes a computing module 350 and a writing module 360 .
计算模块350适于计算数据的压缩比。压缩比指压缩前与压缩后的文件所占的磁盘空间比值。数据的压缩比高,说明数据的冗余度高,即数据的重复率高,适合压缩。计算模块350对请求向pagefile.sys文件写入的数据进行压缩比计算,获取计算结果。内存压缩模块320根据计算结果,优先选择压缩比高的数据进行后续压缩处理。一种可选的实施方式是,预先设定一阈值,内存压缩模块320适于将压缩比高于或等于设定阈值的数据进行压缩。写入模块360适于将压缩比低于设定阈值的数据写入虚拟内存文件380中;数据的压缩比低,说明数据的冗余度低,即数据的重复率低,不适合压缩,将不适合压缩的数据直接写入虚拟内存文件,避免了压缩效率低下的问题。The calculation module 350 is adapted to calculate the compression ratio of the data. The compression ratio refers to the ratio of disk space occupied by files before compression to those after compression. A high data compression ratio indicates that the data redundancy is high, that is, the data has a high repetition rate and is suitable for compression. The calculation module 350 calculates the compression ratio of the data requested to be written into the pagefile.sys file, and obtains the calculation result. According to the calculation result, the memory compression module 320 preferentially selects data with a high compression ratio for subsequent compression processing. An optional implementation manner is that a threshold is preset, and the memory compression module 320 is adapted to compress data whose compression ratio is higher than or equal to the preset threshold. The writing module 360 is suitable for writing the data whose compression ratio is lower than the set threshold value in the virtual memory file 380; the compression ratio of the data is low, indicating that the redundancy of the data is low, that is, the repetition rate of the data is low, and it is not suitable for compression. Data that is not suitable for compression is directly written to the virtual memory file, avoiding the problem of low compression efficiency.
可选地,本发明的装置还包括内存管理模块340,适于利用钩子函数钩取Windows系统的内存释放函数;在钩取到内存释放函数之后,清理存储在虚拟内存370中的数据。内存释放函数具体指Windows系统在进程关闭时所调用的函数,如MiReleasePageFileSpace函数。在Windows系统原有的虚拟内存扩展机制下应用本发明的情况下,当进程关闭时,Windows系统会调用内存释放函数。内存管理模块340通过钩子函数(hook函数)钩取该内存释放函数,作为系统关闭进程的通知消息,利用Windows系统自带的功能检测出占用虚拟内存空间的进程是否工作。内存管理模块340在钩取到内存释放函数之后,清理存储在虚拟内存中的数据,以完成数据清理。Optionally, the device of the present invention further includes a memory management module 340, adapted to use a hook function to hook the memory release function of the Windows system; after hooking the memory release function, clean up the data stored in the virtual memory 370. The memory release function specifically refers to the function called by the Windows system when the process is closed, such as the MiReleasePageFileSpace function. When the present invention is applied under the original virtual memory expansion mechanism of the Windows system, when the process is closed, the Windows system will call the memory release function. The memory management module 340 hooks the memory release function through a hook function (hook function) as a notification message for the system to shut down the process, and uses the built-in function of the Windows system to detect whether the process occupying the virtual memory space is working. After hooking the memory release function, the memory management module 340 cleans up the data stored in the virtual memory to complete the data cleaning.
可选地,内存管理模块340也可以定时清理存储在虚拟内存中的超过一定时间没有被读取的数据,而不是等到进程关闭后再清理。Optionally, the memory management module 340 may also periodically clean up data stored in the virtual memory that has not been read for a certain period of time, instead of waiting for the process to be closed before cleaning up.
根据本发明实施例提供的装置,可以在当前进程都在工作的情况下,所占用的虚拟内存过大时,避免对磁盘的频繁读写造成的时间浪费,进而解决了系统运行缓慢的问题。此外,利用Windows系统本身的功能完成对虚拟内存文件读写数据行为的拦截、以及对虚拟内存中数据的释放,对现有系统改动小,实现方便。利用文件过滤功能能够在不知道源代码的情况下完成对虚拟内存文件读写数据行为的拦截。利用LZO系列压缩算法进行压缩能够进一步提高压缩效率,提高系统的运行速度。利用内存释放函数能够实时将没用的虚拟内存释放,进一步提高系统运行速度。提前对数据是否适合压缩进行判断,对不适合压缩的数据直接存入虚拟内存文件,也能够进一步提高系统运行速度。According to the device provided by the embodiment of the present invention, when the current processes are all working and the occupied virtual memory is too large, time waste caused by frequent reading and writing of the disk can be avoided, thereby solving the problem of slow system operation. In addition, using the functions of the Windows system itself to complete the interception of the behavior of reading and writing data in virtual memory files and the release of data in the virtual memory, the changes to the existing system are small and the implementation is convenient. Using the file filtering function can complete the interception of reading and writing data behaviors of virtual memory files without knowing the source code. Using the LZO series of compression algorithms for compression can further improve the compression efficiency and improve the operating speed of the system. Use the memory release function to release the useless virtual memory in real time, further improving the operating speed of the system. Judging whether the data is suitable for compression in advance, and directly storing the data that is not suitable for compression into the virtual memory file can also further improve the operating speed of the system.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings), as well as any method or method so disclosed, may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的Windows系统中虚拟内存压缩装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all functions of some or all of the components in the virtual memory compression device in the Windows system according to the embodiment of the present invention . The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310656949.2A CN103617133B (en) | 2013-12-06 | 2013-12-06 | Virtual memory compression method and device in a kind of Windows systems |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310656949.2A CN103617133B (en) | 2013-12-06 | 2013-12-06 | Virtual memory compression method and device in a kind of Windows systems |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103617133A CN103617133A (en) | 2014-03-05 |
CN103617133B true CN103617133B (en) | 2017-08-25 |
Family
ID=50167836
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310656949.2A Active CN103617133B (en) | 2013-12-06 | 2013-12-06 | Virtual memory compression method and device in a kind of Windows systems |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103617133B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107608782B (en) * | 2016-07-11 | 2021-01-29 | 斑马智行网络(香港)有限公司 | Memory compression method and device, operating system and electronic equipment |
CN106997316B (en) * | 2017-04-11 | 2020-02-21 | 上海联彤网络通讯技术有限公司 | System and method for detecting abnormal increase of memory |
CN109254954B (en) * | 2018-09-13 | 2020-06-09 | 政采云有限公司 | File processing method and device, computing equipment and storage medium |
CN109445693A (en) * | 2018-10-19 | 2019-03-08 | 郑州云海信息技术有限公司 | A kind of data compression method and device |
CN110457235B (en) * | 2019-08-20 | 2021-10-08 | Oppo广东移动通信有限公司 | Memory compression method, device, terminal and storage medium |
CN113742299B (en) * | 2020-05-27 | 2024-01-02 | 奇安信网神信息技术(北京)股份有限公司 | File compression and decompression method and file compression and decompression device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399915A (en) * | 2013-07-31 | 2013-11-20 | 北京华易互动科技有限公司 | Optimal reading method for index file of search engine |
-
2013
- 2013-12-06 CN CN201310656949.2A patent/CN103617133B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399915A (en) * | 2013-07-31 | 2013-11-20 | 北京华易互动科技有限公司 | Optimal reading method for index file of search engine |
Non-Patent Citations (1)
Title |
---|
基于Windows文件系统微过滤驱动模型的文件透明加解密系统的研究与实现;林海元;《中国优秀硕士学位论文全文数据库 信息科技辑》;20100215;第2010卷(第2期);第1.2,2.2-3.4,4.1.1-4.1.5节,附图5.1 * |
Also Published As
Publication number | Publication date |
---|---|
CN103617133A (en) | 2014-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6709245B2 (en) | Adaptive persistence system, method, interface | |
CN103617133B (en) | Virtual memory compression method and device in a kind of Windows systems | |
US8165177B2 (en) | System and method for hybrid virtual machine monitor file system operations | |
US9612966B2 (en) | Systems, methods and apparatus for a virtual machine cache | |
CN103827809B (en) | For the system and method for virtual partition monitoring | |
CN110704161B (en) | Virtual machine creation method and device and computer equipment | |
KR102443600B1 (en) | hybrid memory system | |
US8930732B2 (en) | Fast speed computer system power-on and power-off method | |
EP2851792A1 (en) | Solid state drives that cache boot data | |
CN113722131A (en) | Method and system for facilitating fast crash recovery in a storage device | |
CN111868679B (en) | Hybrid memory system | |
US9176676B2 (en) | Efficiency of virtual machines that use de-duplication as primary data storage | |
CN103617009A (en) | Method and device for writing data to disk through cache during starting up | |
CN112231238B (en) | Reducing memory commit overhead using memory compression | |
US10846265B2 (en) | Method and apparatus for accessing file, and storage system | |
CN102968323A (en) | Computer terminal and method for accelerating starting-up of computer system | |
CN112654965A (en) | External paging and swapping of dynamic modules | |
JP6100750B2 (en) | Device with memory and controller and device with data storage device | |
US9904559B2 (en) | Information processing apparatus and activation method therefor for processing data of a hibernation image | |
CN102968324A (en) | Method and device for organizing booting files of computer system | |
JP6080492B2 (en) | Information processing apparatus, activation method, and program | |
TWI441082B (en) | Capacity extending method for virtual hard disk | |
CN117519596A (en) | NS space defragmentation method, device, equipment and medium of solid state disk | |
JP6080491B2 (en) | Information processing apparatus, activation method, and program | |
JP2014085907A (en) | Information processor, starting method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220801 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |