[go: up one dir, main page]

CN100429637C - Information processing apparatus and method, program, and program recording medium - Google Patents

Information processing apparatus and method, program, and program recording medium Download PDF

Info

Publication number
CN100429637C
CN100429637C CNB2005100793004A CN200510079300A CN100429637C CN 100429637 C CN100429637 C CN 100429637C CN B2005100793004 A CNB2005100793004 A CN B2005100793004A CN 200510079300 A CN200510079300 A CN 200510079300A CN 100429637 C CN100429637 C CN 100429637C
Authority
CN
China
Prior art keywords
irp
filter
api
function
ioctl
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.)
Expired - Fee Related
Application number
CNB2005100793004A
Other languages
Chinese (zh)
Other versions
CN1734433A (en
Inventor
木村真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Publication of CN1734433A publication Critical patent/CN1734433A/en
Application granted granted Critical
Publication of CN100429637C publication Critical patent/CN100429637C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)
  • Stored Programmes (AREA)

Abstract

本发明涉及一种用于处理从应用程序访问记录介质的访问请求的信息处理装置,其包括了以下部件:设置单元,用于给来自应用程序的访问请求设置唯一的优先级或设置表示对来自应用程序的访问请求的处理是否被允许的许可信息;队列控制器,用来将提供有优先级或许可信息的访问请求存储在队列中;和访问请求处理器,用来根据优先级或许可信息处理存储在队列中的访问请求。

Figure 200510079300

The present invention relates to an information processing device for processing an access request for accessing a recording medium from an application program, which includes the following components: a setting unit for setting a unique priority for an access request from an application program or setting an indication of priority for an access request from an application program The permission information of whether the processing of the access request of the application program is allowed; the queue controller is used to store the access requests provided with priority or permission information in the queue; and the access request processor is used to store the access requests according to the priority or permission information Process access requests stored in the queue.

Figure 200510079300

Description

信息处理装置和方法、程序,以及程序记录介质 Information processing apparatus and method, program, and program recording medium

技术领域 technical field

本发明涉及信息处理装置和方法、程序,以及程序记录介质。更具体地,本发明涉及一种信息处理装置和方法、一种程序和一种程序记录介质,在其中例如,能记录并能从记录介质实时播放音-视频数据(AV数据)。The present invention relates to an information processing device and method, a program, and a program recording medium. More specifically, the present invention relates to an information processing apparatus and method, a program, and a program recording medium in which, for example, audio-visual data (AV data) can be recorded and played back from the recording medium in real time.

背景技术 Background technique

将高比特率的AV数据记录到光盘并从光盘播放具有很大的需求。There is a great demand for recording and playback of high bit rate AV data to and from optical discs.

本发明的受让人以前在公开号为No.2004-005895的日本未审专利申请中提出了一种用于记录诸如视频数据以及与之关联的音频数据等多种数据格式的光盘驱动器,该光盘能以例如光盘的扇区为单位周期地记录(无需将其记录在相邻的扇区),更具体地,可以让视频数据和音频数据的边界与光盘扇区的边界一致。The assignee of the present invention previously proposed an optical disc drive for recording various data formats such as video data and audio data associated therewith in Japanese Unexamined Patent Application Publication No. 2004-005895, which The optical disc can be periodically recorded in units of, for example, sectors of the optical disc (without recording in adjacent sectors), and more specifically, the boundaries of video data and audio data can be made to coincide with the boundaries of sectors of the optical disc.

在该光盘驱动器中,一定量的视频数据或音频数据可以共同地记录在光盘上连续的存储区域上,因此,这样的数据无需查找即可被读出或写入。In this optical disc drive, a certain amount of video data or audio data can be collectively recorded on a continuous storage area on the optical disc, so that such data can be read or written without seeking.

此外,由于视频数据或音频数据以光盘扇区为单元进行记录,因此视频数据或音频数据无需一起记录在一个扇区中从而使仅读取视频数据或音频数据成为可能。即,例如,当用户只需要视频数据或音频数据时,所需的视频数据或音频数据能从光盘中读出,与视频数据和音频数据同时记录在一个扇区中相比,这提高了仅读出视频数据(或音频数据)的效率(速度)。In addition, since video data or audio data is recorded in units of disc sectors, video data or audio data need not be recorded together in one sector to make it possible to read only video data or audio data. That is, for example, when the user only needs video data or audio data, the required video data or audio data can be read out from the optical disc, which improves the performance of only video data and audio data when they are simultaneously recorded in one sector. The efficiency (speed) of reading video data (or audio data).

发明内容 Contents of the invention

本发明的受让人还提出了如下类型的光盘驱动器。光盘上的连续空闲区域具有至少一个预定的尺寸,其上与已记录的记录区域相邻的空闲区域被保留,因此数据可以记录在该保留的空间上。The assignee of the present invention has also proposed an optical disk drive of the following type. The continuous free area on the optical disc has at least a predetermined size on which the free area adjacent to the recorded recording area is reserved so that data can be recorded on the reserved space.

在这种情况下,理想地,能将一定的数据串记录在光盘上连续的记录区域中。因此,数据能在无需查找的情况下记录或播放以便高比特率的AV数据能实时地记录在光盘上或从光盘播放。In this case, ideally, a certain data string can be recorded in a continuous recording area on the optical disc. Therefore, data can be recorded or played back without seeking so that high bit rate AV data can be recorded on or played back from the optical disc in real time.

以上所描述的能在无需查找情况下记录并播放数据的光盘驱动器以下称之为“专业光盘(PD)驱动器”。使用PD驱动器记录数据的光盘以下称之为“专业光盘(PD)”。The above-described optical disc drive capable of recording and playing back data without seeking is referred to as a "Professional Disc (PD) drive" hereinafter. A disc on which data is recorded using a PD drive is hereinafter referred to as a "Professional Disc (PD)".

由于使用了更快的中央处理单元(CPU)和更低价格的大容量存储设备,因此可以实现高性能而价格低廉的计算机。在这样的计算机中,应用程序(程序)执行例如编辑大量AV数据(以下称之为“AV应用程序”)的处理。High-performance yet inexpensive computers are possible due to the use of faster central processing units (CPUs) and lower-priced mass storage devices. In such a computer, an application (program) executes processing such as editing a large amount of AV data (hereinafter referred to as "AV application").

将PD驱动器安装在计算机中或外部地将PD驱动器与计算机连接以便使AV应用程序能够访问PD驱动器从而向/从PD读出/写入AV数据的需求正在迅速增长。There is a rapidly growing need to install a PD drive in a computer or externally connect the PD drive to the computer in order to enable AV applications to access the PD drive to read/write AV data to/from the PD.

然而,在这种情况中,不能保证从/向PD实时地读取/写入AV数据。However, in this case, it cannot be guaranteed that AV data is read/written from/to PD in real time.

更具体地,在当前的计算机中,总地来说,通过使用多任务操作能同时执行多个应用程序。但是,具体地说,在多个应用程序上执行分时处理。因此,例如,当在AV应用程序访问PD之前如果已经有另一个应用程序访问了PD,那么当AV应用程序访问PD时在PD驱动器中会产生预期外的查找。More specifically, in current computers, in general, a plurality of application programs can be executed simultaneously by using multitasking operations. But, specifically, time-sharing processing is performed on multiple applications. Therefore, for example, if another application has already accessed the PD before the AV application accesses the PD, an unexpected lookup may occur in the PD driver when the AV application accesses the PD.

此外,当AV应用程序试图访问PD时另一个应用程序已经在访问该PD,那么它就必须等待。Furthermore, when another application is already accessing the PD when the AV application tries to access the PD, it has to wait.

在以上所描述的情况下,很难实时地从PD读取AV数据或将其写入PD。In the case described above, it is difficult to read AV data from or write to the PD in real time.

因此希望能够实时地在或从诸如光盘的记录介质上记录或读出数据。It is therefore desirable to be able to record or read data on or from a recording medium such as an optical disc in real time.

根据本发明的一个实施例的信息处理装置可以处理来自应用程序的访问记录介质的访问请求。该信息处理装置包括:用来设置专用于来自应用程序的访问请求的优先级或表示是否来自应用程序的访问请求已被允许的许可信息的设置装置;用来根据所提供的优先级或许可信息按序存储访问请求的队列控制装置;和用来根据优先级或许可信息按序处理所存储的访问请求的访问请求处理装置。An information processing apparatus according to an embodiment of the present invention can process an access request from an application program to access a recording medium. The information processing device includes: a setting device for setting the priority level dedicated to the access request from the application program or permission information indicating whether the access request from the application program has been allowed; queue control means for sequentially storing access requests; and access request processing means for sequentially processing the stored access requests according to priority or permission information.

设置装置可以将来自规定应用程序的访问请求的优先级设置得高于自其它应用程序的访问优先级。The setting means may set the priority of the access request from the prescribed application higher than the priority of access from other applications.

访问请求处理装置可以连续地处理来自规定应用程序的访问请求并只有当许可信息表示该访问请求已被允许时才处理来自另一个应用程序的访问请求。The access request processing means may continuously process an access request from a prescribed application and process an access request from another application only when the permission information indicates that the access request has been permitted.

信息处理装置可以进一步包括用来设置是否使用高速缓存功能的高速缓存功能设置装置。访问请求处理装置可以根据是否使用高速缓存功能而处理访问请求。The information processing apparatus may further include cache function setting means for setting whether to use the cache function. The access request processing means may process the access request depending on whether the cache function is used.

访问请求处理装置可以根据是否使用高速缓存功能而处理来自规定应用程序的访问请求。The access request processing means may process an access request from a prescribed application depending on whether the cache function is used.

信息处理装置还可以是一个用来过滤访问请求以及将该过滤后的访问请求发送到文件系统驱动器的过滤驱动器。The information processing device may also be a filter driver for filtering access requests and sending the filtered access requests to the file system driver.

从记录介质读出或将写入到记录介质的数据可以包括至少音频-视频数据。Data read from or written to the recording medium may include at least audio-visual data.

在记录介质的记录区域中,在具有至少预定尺寸的连续空闲区域当中,与已经暂存了数据的记录区域最近的空闲区域可以被保留和数据可以记录在该保留的空闲区域中。In the recording area of the recording medium, among continuous free areas having at least a predetermined size, a free area closest to a recording area in which data has been temporarily stored may be reserved and data may be recorded in the reserved free area.

根据本发明实施例用于处理来自应用程序对记录介质进行访问的访问请求的信息处理方法包括以下步骤:设置专用于来自应用程序的访问请求的优先级或表示是否来自应用程序的访问请求已被允许的许可信息;根据所提供的优先级或许可信息按序存储访问请求;和根据优先级或许可信息按序处理所存储的访问请求。An information processing method for processing an access request from an application program to a recording medium according to an embodiment of the present invention includes the steps of: setting a priority dedicated to an access request from an application program or indicating whether the access request from an application program has been blocked permission information allowed; storing the access requests in order according to the provided priority or permission information; and processing the stored access requests in order according to the priority or permission information.

根据本发明实施例允许计算机处理来自应用程序对记录介质进行访问的访问请求的程序包括以下步骤:设置专用于来自应用程序的访问请求的优先级或表示是否来自应用程序的访问请求已被允许的许可信息;根据所提供的优先级或许可信息按序存储访问请求;和根据优先级或许可信息按序处理所存储的访问请求。According to an embodiment of the present invention, the program for allowing a computer to process an access request from an application program to access a recording medium includes the following steps: setting a priority level dedicated to the access request from the application program or indicating whether the access request from the application program has been allowed permission information; storing the access requests in order according to the provided priority or permission information; and processing the stored access requests in order according to the priority or permission information.

根据本发明的实施例的程序记录介质,在其上记录允许计算机处理来自应用程序对记录介质进行访问的访问请求的程序。该程序包括以下步骤:设置专用于来自应用程序的访问请求的优先级或表示是否来自应用程序的访问请求已被允许的许可信息;根据所提供的优先级或许可信息按序存储访问请求;和根据优先级或许可信息按序处理所存储的访问请求。A program recording medium according to an embodiment of the present invention has recorded thereon a program that allows a computer to process an access request from an application program for accessing the recording medium. The procedure includes the steps of: setting a priority dedicated to an access request from an application program or permission information indicating whether an access request from an application program has been allowed; storing the access requests in order according to the provided priority or permission information; and The stored access requests are processed sequentially based on priority or permission information.

根据本发明的实施例,响应来自应用程序的访问请求,设置专用于该访问请求的优先级或表示是否访问请求已被允许的许可信息。根据所提供的优先级或许可信息按序存储访问请求。接着根据优先级或许可信息按序处理所存储的访问请求。According to an embodiment of the present invention, in response to an access request from an application program, a priority specific to the access request or permission information indicating whether the access request has been permitted is set. Access requests are stored in order according to the provided priority or permission information. The stored access requests are then processed sequentially according to priority or permission information.

根据本发明的实施例,来自某个应用程序的访问请求能够被优先处理,或只有来自一规定应用程序的访问请求才能被接受。因此,数据能实时地记录或播放。According to an embodiment of the present invention, access requests from a certain application can be prioritized, or only access requests from a specified application can be accepted. Therefore, data can be recorded or played back in real time.

附图说明 Description of drawings

图1是示出根据本发明的一个实施例的信息处理系统的结构实例的方框图;FIG. 1 is a block diagram showing a structural example of an information processing system according to an embodiment of the present invention;

图2是示出个人计算机(PC)的硬件结构实例的方框图;2 is a block diagram showing an example of a hardware configuration of a personal computer (PC);

图3图示了CPU执行的程序;Figure 3 illustrates the program executed by the CPU;

图4是示出操作系统(OS)的内部结构(文件系统)的一个实例的方框图;4 is a block diagram showing an example of an internal structure (file system) of an operating system (OS);

图5是OS执行的整个处理流程的流程图;FIG. 5 is a flow chart of the entire processing flow executed by the OS;

图6是示出执行第一功能或第二功能的PD过滤器的结构的方框图;6 is a block diagram showing the structure of a PD filter performing a first function or a second function;

图7示出了PD_API所提供的API函数;Figure 7 shows the API functions provided by PD_API;

图8示出了由IRP_MJ_DEVICE_CONTROL指定的用户定义的IOCTL代码;Figure 8 shows the user-defined IOCTL code specified by IRP_MJ_DEVICE_CONTROL;

图9是示出使用第一功能所执行的进程的流程图;FIG. 9 is a flowchart illustrating a process performed using a first function;

图10和11是示出使用第一功能所执行的进程的流程图;10 and 11 are flowcharts illustrating processes performed using the first function;

图12示出了由PD_API所提供的API函数;Figure 12 shows the API functions provided by PD_API;

图13示出了由IRP_MJ_DEVICE_CONTROL指定的用户定义的IOCTL代码;Figure 13 shows the user-defined IOCTL code specified by IRP_MJ_DEVICE_CONTROL;

图14示出了使用第二功能所执行的进程的流程图;Figure 14 shows a flowchart of a process performed using the second function;

图15和16是示出使用第二功能所执行的进程的流程图;15 and 16 are flowcharts illustrating processes performed using the second function;

图17示出执行第三功能的PD过滤器的结构实例的方框图;FIG. 17 shows a block diagram of a structural example of a PD filter performing a third function;

图18是示出使用第三功能所执行的进程的流程图;FIG. 18 is a flowchart showing a process performed using the third function;

图19是示出执行高速缓存器ON/OFF功能的PD过滤器的结构实例的方框图;FIG. 19 is a block diagram showing a structural example of a PD filter performing a cache ON/OFF function;

图20示出了由PD_API所提供的API函数;Figure 20 shows the API functions provided by PD_API;

图21示出了由IRP_MJ_DEVICE_CONTROL指定的用户所定义的IOCTL代码;Figure 21 shows user-defined IOCTL codes specified by IRP_MJ_DEVICE_CONTROL;

图22是示出使用高速缓存器ON/OFF功能执行进程的流程图;Fig. 22 is a flow chart showing the execution process using the cache ON/OFF function;

图23是示出使用高速缓存器ON/OFF功能执行进程的流程图;Fig. 23 is a flow chart showing the execution process using the cache ON/OFF function;

图24的框图示出了通过组合第一和第二功能之一与高速缓存器ON/OFF功能使用的PD过滤器的结构例;The block diagram of Fig. 24 has shown the structural example of the PD filter that is used by combining one of first and second function and cache memory ON/OFF function;

图25的框图示出了通过组合第三功能和高速缓存器ON/OFF功能使用的PD过滤器的结构例。25 is a block diagram showing a configuration example of a PD filter used by combining the third function and the cache ON/OFF function.

具体实施方式 Detailed ways

以下通过结合附图的优选实施例来对本发明进行描述。The present invention is described below through preferred embodiments in conjunction with the accompanying drawings.

图1所示根据本发明的实施例的信息处理系统包括个人计算机(PC)1和驱动器2。The information processing system according to the embodiment of the present invention shown in FIG. 1 includes a personal computer (PC) 1 and a drive 2 .

PC 1中存储有操作系统(OS)和应用(程序),并在OS的控制下通过执行应用程序执行各种类型的进程。An operating system (OS) and applications (programs) are stored in the PC 1, and various types of processes are executed by executing the applications under the control of the OS.

驱动器2,即以上所描述的PD驱动器,通过1394电缆4连接到PC 1。光盘3,即PD,能安装到驱动器2或从驱动器2拆除以便驱动器2能利用电气和电子工程师协会(IEEE)1394标准与PC1通信而从光盘3读出或写入例如AV数据的数据。Driver 2, the PD driver described above, is connected to PC 1 via 1394 cable 4. The optical disc 3, ie, PD, can be mounted to or removed from the drive 2 so that the drive 2 can communicate with the PC 1 using the Institute of Electrical and Electronics Engineers (IEEE) 1394 standard to read or write data such as AV data from the optical disc 3.

驱动器2并不一定是PD驱动器且光盘3也不一定是PD。此外,PC 1和驱动器2能根据除IEEE 1394标准以外的其它标准彼此相互通信。The drive 2 is not necessarily a PD drive and the optical disc 3 is not necessarily a PD. In addition, the PC 1 and the drive 2 can communicate with each other according to standards other than the IEEE 1394 standard.

图2示出了PC 1硬件结构的一个范例。Fig. 2 shows an example of PC 1 hardware structure.

PC 1具有内置CPU 12。输入/输出接口20通过总线11连接到CPU 12。响应用户通过输入/输出接口20操作包括键盘、鼠标、麦克风等输入单元17所输入的指令,CPU 12执行存储在只读存储器(ROM)13中的程序。CPU 12还执行存储在硬盘15中的程序、从卫星或网络发送并通过通信单元18接收并插入到硬盘15上的程序和从驱动器19上的记录介质21上读取并插入到硬盘15上的程序以及加载到随机存取存储器(RAM)14的程序。CPU 12接着执行根据方框图的流程或结构所示的进程,这将在以下论述。接着,CPU 12通过输入/输出接口20从包括液晶显示屏(LCD)或扬声器的输出单元16输出处理结果。可选地,CPU 12通过输入/输出接口20从通信单元18发送处理结果或将其记录到硬盘15上。The PC 1 has a built-in CPU 12. The input/output interface 20 is connected to the CPU 12 through the bus 11. The CPU 12 executes a program stored in a read only memory (ROM) 13 in response to an instruction input by a user through the input/output interface 20 operating the input unit 17 including a keyboard, a mouse, a microphone, and the like. The CPU 12 also executes programs stored in the hard disk 15, programs sent from satellites or networks and received through the communication unit 18 and inserted into the hard disk 15, and programs read from the recording medium 21 on the drive 19 and inserted into the hard disk 15. programs and programs loaded into random access memory (RAM) 14. The CPU 12 then executes the processes shown according to the flow or structure of the block diagram, which will be discussed below. Next, the CPU 12 outputs the processing result from the output unit 16 including a liquid crystal display (LCD) or a speaker through the input/output interface 20. Alternatively, the CPU 12 transmits the processing result from the communication unit 18 through the input/output interface 20 or records it to the hard disk 15.

在PC 1中,遵从IEEE 1394标准执行通信的IEEE 1394接口(I/F)22连接到输入/输出接口20。驱动器2通过1394电缆4连接到IEEE 1394接口22。CPU 12通过总线11、输入/输出接口20、IEEE 1394接口22以及1394电缆4访问驱动器2以从安置在驱动器2中的光盘3读取数据或将数据写入光盘。In the PC 1, an IEEE 1394 interface (I/F) 22 that performs communication in compliance with the IEEE 1394 standard is connected to the input/output interface 20. The drive 2 is connected to the IEEE 1394 interface 22 via a 1394 cable 4 . The CPU 12 accesses the drive 2 through the bus 11, the input/output interface 20, the IEEE 1394 interface 22, and the 1394 cable 4 to read data from or write data to the optical disc 3 set in the drive 2.

CPU 12执行OS以及各种可以预先存储在例如内建于PC 1上的硬盘15或ROM13等中的记录介质上的应用程序。The CPU 12 executes an OS and various application programs that can be stored in advance on a recording medium such as a hard disk 15 built in the PC 1 or a ROM 13 or the like.

可选地,程序可以暂时或永久存储(记录)在例如软盘、高密度只读存储器(CD-ROM)、磁光(MO)盘、数字化视频光盘(DVD)或磁盘等可拆卸的记录介质21上。可拆卸记录介质21也可称之为“打包的软件”。Alternatively, the program may be temporarily or permanently stored (recorded) on a removable recording medium 21 such as a floppy disk, a compact read-only memory (CD-ROM), a magneto-optical (MO) disk, a digital video disk (DVD), or a magnetic disk. superior. The removable recording medium 21 may also be referred to as "packaged software".

如上所述,程序可以从上述可拆卸记录介质21安装到PC 1上。可选地,程序可以从下载站点通过数字广播卫星有线或无线地传送到PC 1,例如通过一个局域网(LAN)或因特网的网络。在这种情况下,PC 1通过通信单元18接收程序并将其安装到内置的硬盘15上。As described above, the program can be installed on the PC 1 from the above-mentioned removable recording medium 21. Alternatively, the program may be wired or wirelessly transferred from the download site to the PC 1 via a digital broadcast satellite, such as via a local area network (LAN) or the Internet. In this case, the PC 1 receives the program through the communication unit 18 and installs it on the built-in hard disk 15.

图3图示了由图2所示的CPU 12所执行的程序。FIG. 3 illustrates programs executed by the CPU 12 shown in FIG. 2.

例如,至少有OS 30和应用程序31通过33安装在图2所示的硬盘15上。当PC 1加电时,CPU 12从硬盘15将OS 30加载到RAM 14上并执行它。响应操作输入单元17开始应用程序31、32,或33的请求,CPU 12将相应的应用程序31、32,或33从硬盘15加载到RAM 14上,并在OS 30的控制下执行它。For example, OS 30 and application program 31 are installed on the hard disk 15 shown in Figure 2 through 33 at least. When the PC 1 is powered on, the CPU 12 loads the OS 30 from the hard disk 15 onto the RAM 14 and executes it. In response to a request to start the application program 31, 32, or 33 by operating the input unit 17, the CPU 12 loads the corresponding application program 31, 32, or 33 from the hard disk 15 onto the RAM 14, and executes it under the control of the OS 30.

随后,响应来自应用程序31、32或33访问安置在驱动器2中的光盘3的请求,OS 30处理该访问请求。在驱动器2中,数据基于来自应用程序31、32或33的访问请求而记录在光盘3上。可选地,在驱动器2中,数据能基于来自应用程序31、32或33的访问请求从光盘3播放,并且数据能通过OS30而传送给产生访问请求的应用程序31、32或33。Subsequently, in response to a request from the application program 31, 32 or 33 to access the optical disc 3 set in the drive 2, the OS 30 processes the access request. In the drive 2, data is recorded on the optical disc 3 based on an access request from the application program 31, 32 or 33. Alternatively, in the drive 2, data can be played from the optical disc 3 based on an access request from the application 31, 32 or 33, and the data can be transferred through the OS 30 to the application 31, 32 or 33 that made the access request.

安装在如图2所示的硬盘15上的应用程序的数量并不限于3个,可以更多或更少。The number of application programs installed on the hard disk 15 shown in FIG. 2 is not limited to three, and can be more or less.

现在假定,在安装在硬盘15中的三个应用程序31、32和33当中,应用程序33从外部源读取AV数据,并编辑、记录和播放AV数据。因此,应用程序33也可以被称之为“AV应用程序33”。Assume now that, among the three application programs 31, 32, and 33 installed in the hard disk 15, the application program 33 reads AV data from an external source, and edits, records, and plays the AV data. Therefore, the application program 33 may also be called "AV application program 33".

AV应用程序33调用PD_API(PD_API.DLL)41,其是一个动态链接库(DLL),并通过PD_API 41产生一个访问光盘3的请求。PD_API 41是一个用来提供唯一应用程序接口(API)的DLL,这在以下涉及对光盘3的访问的内容中再讨论。The AV application program 33 calls PD_API (PD_API.DLL) 41, which is a dynamic link library (DLL), and generates a request for accessing the optical disc 3 by the PD_API 41. PD_API 41 is a DLL used to provide a unique application program interface (API), which is discussed later in relation to access to disc 3.

至于OS 30,可以使用

Figure C20051007930000091
,Linux,或微软公司的
Figure C20051007930000092
也可以使用其它的OS。在该实施例中,可以使用例如
Figure C20051007930000093
NT,2000,或
Figure C20051007930000095
XP的
Figure C20051007930000096
NT OS来作为OS 30。As for OS 30, you can use
Figure C20051007930000091
, Linux, or Microsoft's
Figure C20051007930000092
Other OS can also be used. In this example, one can use for example
Figure C20051007930000093
NT, 2000, or
Figure C20051007930000095
xp
Figure C20051007930000096
NT OS comes as OS 30.

图4图示了OS 30的结构的一个实例,即

Figure C20051007930000101
NT OS,更具体地,是OS 30中涉及访问驱动器2中的光盘3的部分。FIG. 4 illustrates an example of the structure of the OS 30, namely
Figure C20051007930000101
The NT OS, more specifically, is the part of the OS 30 involved in accessing the optical disc 3 in the drive 2 .

在图4中,示出了涉及应用程序31到33的OS 30的设备驱动器的层结构。In FIG. 4, a layer structure of a device driver of the OS 30 involving application programs 31 to 33 is shown.

可以是一个NT OS的OS 30通过基于微核技术和面向对象技术的子系统而执行单独的服务。can be a The OS 30 of the NT OS executes individual services through subsystems based on microkernel technology and object-oriented technology.

作为子系统之一的Win32子系统51提供各种应用程序接口(API)函数给应用程序31到33,并执行例如存储器管理、进程管理和画图等处理。The Win32 subsystem 51, one of the subsystems, provides various application program interface (API) functions to the application programs 31 to 33, and performs processing such as memory management, process management, and drawing.

更具体地,当从应用程序31、32或33调用包含输入/输出(I/O)的API函数时,Win32子系统51向NT I/O管理器52输出对应于该API函数的I/O请求。More specifically, when an API function involving input/output (I/O) is called from an application program 31, 32, or 33, the Win32 subsystem 51 outputs the I/O corresponding to the API function to the NT I/O manager 52. ask.

由Win32子系统51提供的API函数包括用来创建文件的函数CreateFile()、用来读取文件(记录在文件中的数据)的函数ReadFile()、用来写入文件(数据)的函数WriteFile()和用来执行其它进程的函数DeviceIoControl()。The API functions provided by the Win32 subsystem 51 include a function CreateFile() for creating a file, a function ReadFile() for reading a file (data recorded in a file), a function WriteFile for writing a file (data) () and the function DeviceIoControl() used to execute other processes.

NT I/O管理器52提供用来将I/O请求包(IRP)传送到层结构设备驱动器的服务。The NT I/O manager 52 provides services for delivering I/O request packets (IRPs) to layered device drivers.

IRP是包含有关请求设备驱动器的进程信息的包。IRP包括一个分类请求内容的代码、表示读取数据(文件)请求的IRP_MJ_READ、表示写入(记录)数据请求的IRP_MJ_WRITE、表示创建一个文件请求的IRP_MJ_CREATE和表示执行其它类型进程请求的IRP_MJ_DEVICE_CONTROL。在IRP_MJ_DEVICE_CONTROL IRP中,I/O控制(IOCTL)由用户定义的子码来具体限定。An IRP is a packet containing information about a process requesting a device driver. The IRP includes a code that classifies the content of the request, IRP_MJ_READ for a request to read data (file), IRP_MJ_WRITE for a request to write (record) data, IRP_MJ_CREATE for a request to create a file, and IRP_MJ_DEVICE_CONTROL for a request to execute other types of processes. In the IRP_MJ_DEVICE_CONTROL IRP, the I/O control (IOCTL) is specified by a user-defined subcode.

例如,NT I/O管理器52将从Win32子系统51来的基于CreatFile()的I/O请求转变成IRP_MJ_CREATE IRP。将ReadFile()和WriteFile()分别转换成IRP_MJ_READ IRP和IRP_MJ_WRITE IRP,而将DeviceIoControl()转换成IRP_MJ_DEVICE_CONTROL IRP。For example, NT I/O manager 52 converts the I/O request based on CreatFile () from Win32 subsystem 51 into IRP_MJ_CREATE IRP. Convert ReadFile() and WriteFile() to IRP_MJ_READ IRP and IRP_MJ_WRITE IRP, respectively, and DeviceIoControl() to IRP_MJ_DEVICE_CONTROL IRP.

Figure C20051007930000103
NT OS中,IRP在存储类的驱动器或更高的层中处理。exist
Figure C20051007930000103
In NT OS, IRPs are handled in storage-class drivers or higher.

在图4中,有三个对应于存储类驱动器层或更高的层、即,存储类型的驱动器PD存储器55、比存储类驱动器高一层并作为文件系统驱动器的PD_FS54和比文件系统驱动器高一层的作为文件系统过滤驱动器的PD过滤器53的设备驱动器。In Fig. 4, there are three layers corresponding to the storage class driver layer or higher, that is, the storage type driver PD memory 55, the PD_FS54 which is one layer higher than the storage class driver and is a file system driver, and one layer higher than the file system driver. Layer's device driver for the PD filter 53 as a file system filter driver.

因此,在该实施例中,NT I/O管理器52提供用来将IRP传送给PD过滤器53、PD_FS 54和PD存储器55的服务。Thus, in this embodiment, NT I/O Manager 52 provides services for passing IRPs to PD Filter 53, PD_FS 54 and PD Storage 55.

更具体地,NT I/O管理器52将来自Win32子系统51的I/O请求转换成一个相应的IRP,并将该IRP输出到例如PD过滤器53中。接着,PD过滤器53输出一个请求到NT I/O管理器以响应来自NT I/O管理器52的IRP。然后,NT I/O管理器52将来自PD过滤器53的请求转换成相应的IRP,并将其输出到PD_FS 54。随后,PD_FS 54输出一个请求到NT I/O管理器以响应来自NT I/O管理器52的IRP。接着NT I/O管理器52将来自PD_FS 54的请求转换成相应的IRP并将其输出到PD存储器55。More specifically, the NT I/O manager 52 converts the I/O request from the Win32 subsystem 51 into a corresponding IRP, and outputs the IRP to the PD filter 53, for example. Next, the PD filter 53 outputs a request to the NT I/O manager in response to the IRP from the NT I/O manager 52. Then, the NT I/O manager 52 converts the request from the PD filter 53 into a corresponding IRP, and outputs it to the PD_FS 54. Subsequently, the PD_FS 54 outputs a request to the NT I/O manager in response to the IRP from the NT I/O manager 52. The NT I/O manager 52 then converts the request from the PD_FS 54 into a corresponding IRP and outputs it to the PD memory 55.

PD过滤器53是一个用于驱动器2的文件系统过滤器,而驱动器2可以是一个比PD_FS 54要高的PD驱动器。PD过滤器53通过Win32子系统51和NT I/O管理器52将包含由应用程序31到33所提供的文件系统和其它请求的文件系统请求过滤,并将过滤后的结果和特定的请求通过NT I/O管理器52发送到PD_FS 54。PD filter 53 is a file system filter for drive 2, and drive 2 may be a higher PD driver than PD_FS 54. The PD filter 53 filters the file system request including the file system provided by the application program 31 to 33 and other requests through the Win32 subsystem 51 and the NT I/O manager 52, and passes the filtered result and the specific request through NT I/O Manager 52 sends to PD_FS 54.

PD过滤器53包括一个过滤器核心53A,其用来执行PD过滤器53的主进程,例如对来自应用程序31到33的请求进行过滤。PD过滤器53根据寄存器58中设置(存储的)信息对请求进行过滤,其中,寄存器58为寄存器。The PD filter 53 includes a filter core 53A for executing the main process of the PD filter 53 , such as filtering requests from the applications 31 to 33 . The PD filter 53 filters the request according to the information set (stored) in the register 58, wherein the register 58 is register.

用于驱动器2的PD_FS 54是一个文件系统驱动器,其管理已经记录或将要记录在安置在驱动器2中的光盘3(PD)上的文件。即,PD_FS 54通过基于用于表示管理记录在光盘3上的数据(文件)信息的文件系统的NT I/O管理器52输出一个来自PD过滤器53的读取或写入请求给PD存储器55。The PD_FS 54 for the drive 2 is a file system driver that manages files that have been recorded or will be recorded on the optical disc 3 (PD) set in the drive 2. That is, the PD_FS 54 outputs a read or write request from the PD filter 53 to the PD memory 55 through the NT I/O manager 52 based on the file system representing information for managing data (files) recorded on the optical disc 3 .

通常,文件系统驱动器具有一个对文件流(在文件上已记录或将要记录的数据)进行高速缓存的高速缓存功能和文件的元信息。通过使用该高速缓存功能,能迅速地取得高速缓存的文件流和元信息而无需物理访问光盘3。Generally, the file system driver has a cache function for caching the file stream (data recorded or to be recorded on the file) and the meta information of the file. By using this caching function, cached file streams and meta information can be quickly fetched without physically accessing the optical disc 3 .

Figure C20051007930000112
NT OS中,NT高速缓存管理器59具有一个高速缓存功能,同时PD_FS 54通过使用该NT高速缓存管理器59而提供高速缓存功能。exist
Figure C20051007930000112
In NT OS, the NT cache manager 59 has a cache function, while the PD_FS 54 provides the cache function by using the NT cache manager 59 .

PD_FS 54具有一个FS核心54A,该核心用来执行PD_FS 54的主进程。PD_FS 54 has a FS core 54A, which is used to execute the main process of PD_FS 54.

PD存储器55是一个存储类型的驱动器,其是用于驱动器2的真实的设备驱动器,并通过NT I/O管理器52将一个来自比PD存储器55的层要高的设备驱动器PD_FS 54中的IRP请求转换成小型计算机系统接口(SCSI)代码并将其输出到一个串行总线协议(SBP)2的驱动器56。The PD storage 55 is a storage type driver, which is a real device driver for the driver 2, and sends an IRP from the device driver PD_FS 54 higher than the layer of the PD storage 55 through the NT I/O manager 52. The request is converted to Small Computer System Interface (SCSI) code and output to a Serial Bus Protocol (SBP) 2 driver 56 .

将PD存储器55中的IPR转换成SCSI代码的原因是SCSI代码与在SBP2的驱动器56中处理的SBP2具有最大的兼容性。The reason for converting the IPR in the PD memory 55 to the SCSI code is that the SCSI code has the greatest compatibility with the SBP2 processed in the driver 56 of the SBP2.

SBP2驱动器56将来自存储器55的SCSI代码转换成与SBP2标准兼容的SBP2数据,并将该SBP2数据提供给1394驱动器57。The SBP2 driver 56 converts the SCSI code from the memory 55 into SBP2 data compatible with the SBP2 standard, and supplies the SBP2 data to the 1394 driver 57 .

在该实施例中,SBP2被用于能处理用于执行与1394总线驱动器57所控制的IEEE 1394标准所兼容的通信的文件系统的协议。然而,除了SBP2也可以使用别的协议。In this embodiment, SBP2 is used for a protocol capable of handling a file system for performing communications compatible with the IEEE 1394 standard controlled by the 1394 bus driver 57. However, other protocols may be used in addition to SBP2.

IEEE总线驱动器57控制IEEE 1394接口22(图2)以将来自SBP2驱动器56的SBP2数据发送到驱动器2或接收从光盘3读取的数据并从驱动器2发送。The IEEE bus driver 57 controls the IEEE 1394 interface 22 ( FIG. 2 ) to send SBP2 data from the SBP2 driver 56 to the drive 2 or to receive data read from the optical disc 3 and send it from the drive 2.

在该实施例中,在PC 1和驱动器2之间执行与IEEE 1394标准兼容的通信。然而,也可以执行除IEEE 1394通信外其它的通信,在这种情况下,除了1394总线驱动器57以外,还使用相应于在PC 1和驱动器2之间通信的总线驱动器。In this embodiment, communication compatible with the IEEE 1394 standard is performed between the PC 1 and the drive 2. However, communication other than IEEE 1394 communication may also be performed, and in this case, a bus driver corresponding to communication between the PC 1 and the driver 2 is used in addition to the 1394 bus driver 57.

在图4中,由AV应用程序33所使用的PD_API 41提供了唯一的API函数。更具体地,当唯一的API函数由AV应用程序33调用时,PD_API 41使用对应的由Win32子系统51提供的API函数DeviceIoControl()以通过NTI/O管理器52向PD过滤器53提供具有用户定义的IOCTL的IRP_MJ_DEVICE_CONTROL IRP。这样,PD_API 41控制PD过滤器53的唯一函数、即由IOCTL表示的函数。In FIG. 4, the PD_API 41 used by the AV application 33 provides a unique API function. More specifically, when the only API function is called by the AV application 33, the PD_API 41 uses the corresponding API function DeviceIoControl() provided by the Win32 subsystem 51 to provide the PD filter 53 with user The IRP_MJ_DEVICE_CONTROL IRP for the defined IOCTL. Thus, the PD_API 41 controls the only function of the PD filter 53, that is, the function indicated by the IOCTL.

包含PD_API 41的AV应用程序33通过记录在与使用驱动器2所需的PD过滤器53、PD_FS 54,和PD存储器55在一起的可拆卸记录介质21(图2)上而出售。在其上记录AV应用程序33、PD过滤器53、PD_FS 54,和PD存储器55的可拆卸记录介质21可以作为一个单独的单元而出售。可选地,可拆卸记录介质21可以作为包含在驱动器2中的驱动器2的附件出售。The AV application 33 containing the PD_API 41 is sold by being recorded on the removable recording medium 21 ( FIG. 2 ) together with the PD filter 53, PD_FS 54, and PD storage 55 required to use the drive 2. The removable recording medium 21 on which the AV application 33, the PD filter 53, the PD_FS 54, and the PD storage 55 are recorded can be sold as a single unit. Alternatively, the removable recording medium 21 may be sold as an accessory of the drive 2 contained in the drive 2 .

在图4中,应用程序31到33以及Win32子系统51都在用户模式下工作,而NT I/O管理器52、PD过滤器53、PD_FS 54、PD存储器55、SBP驱动器56和1394总线驱动器57均工作在内核模式下。In Fig. 4, applications 31 to 33 and Win32 subsystem 51 all work in user mode, while NT I/O manager 52, PD filter 53, PD_FS 54, PD memory 55, SBP driver 56 and 1394 bus driver 57 are working in kernel mode.

在图4中,NT I/O管理器52将IRP发送到作为文件系统过滤器驱动器的PD过滤器53和作为文件系统驱动器的PD_FS 54,以请求该文件系统过滤器驱动器或文件系统驱动器来执行特定的进程。

Figure C20051007930000131
NT OS的NT I/O管理器52不仅能发送IRP,而且还能发送FastIO给文件系统过滤器驱动器或文件系统驱动器来请求驱动器执行进程。In FIG. 4, NT I/O manager 52 sends an IRP to PD filter 53 as a file system filter driver and PD_FS 54 as a file system driver to request the file system filter driver or file system driver to perform specific process.
Figure C20051007930000131
The NT I/O manager 52 of the NT OS can not only send IRPs, but also send FastIOs to the file system filter driver or the file system driver to request the driver to execute a process.

即,NT I/O管理器52也提供用来将FastIO发送给文件系统过滤器驱动器或文件系统驱动器来请求它执行进程。That is, the NT I/O manager 52 also provides for sending FastIO to a file system filter driver or file system driver to request it to execute a process.

因此,

Figure C20051007930000132
NT OS的文件系统过滤器驱动器和文件系统驱动器通常同时支持IRP和FastIO。therefore,
Figure C20051007930000132
NT OS file system filter drivers and file system drivers usually support both IRP and FastIO.

根据FastIO,文件能直接从NT高速缓存管理器59读出或写入到NT高速缓存管理器。According to FastIO, files can be read directly from or written to the NT Cache Manager 59.

假定在该实施例中,在IRP和FastIO之间使用了IRP。但,FastIO也能用以下所描述的函数来执行。It is assumed that in this embodiment, IRP is used between IRP and FastIO. However, FastIO can also be implemented with the functions described below.

现根据图5的流程图说明全部的进程都通过如图4所示的在OS 30中响应来自应用程序31、32,或33的对光盘3的访问请求的PD过滤器53、PD_FS54、PD存储器55、SBP2驱动器56,和1394总线驱动器57而执行。Now according to the flow chart of Fig. 5, all processes are all passed through the PD filter 53, PD_FS54, PD memory in the OS 30 in response to the access request from the application program 31, 32, or 33 as shown in Fig. 4 55, SBP2 driver 56, and 1394 bus driver 57 to execute.

在以下说明及图5到25中,除非必要均省去对Win32子系统51和NT I/O管理器52的解释和描述。In the following description and FIGS. 5 to 25, explanations and descriptions of the Win32 subsystem 51 and the NT I/O manager 52 are omitted unless necessary.

当应用程序31、32,或33调用表示访问光盘3的请求的函数时,相应的请求会从Win32子系统51提供给NT I/O管理器52。接着,NT I/O管理器52将相应于来自Win32子系统51的请求的IRP提供给PD过滤器53。When an application 31, 32, or 33 calls a function representing a request to access the optical disc 3, the corresponding request is provided from the Win32 subsystem 51 to the NT I/O manager 52. Next, the NT I/O manager 52 supplies the IRP corresponding to the request from the Win32 subsystem 51 to the PD filter 53.

在步骤S1中,PD过滤器53从NT I/O管理器52接收IRP。接着,在步骤S2中,PD过滤器53将从NT I/O管理器52接收的IRP过滤。在步骤S3中,PD过滤器53将来自NT I/O管理器52的IRP提供给一个队列(在图4中未示出)并将其存储其中。随后,PD过滤器53读取存储在队列中的IRP并通过NT I/O管理器52将它提供给PD_FS 54。In step S1, the PD filter 53 receives the IRP from the NT I/O manager 52. Next, in step S2, the PD filter 53 filters the IRP received from the NT I/O manager 52. In step S3, the PD filter 53 supplies the IRP from the NT I/O manager 52 to a queue (not shown in FIG. 4 ) and stores it therein. Subsequently, the PD filter 53 reads the IRP stored in the queue and provides it to the PD_FS 54 through the NT I/O manager 52.

在步骤S4中,PD_FS 54执行用于使用由来自PD过滤器53的IRP所请求的数据中的NT高速缓存管理器59的高速缓存功能所需的高速缓存进程。在步骤S5中,PD_FS 54确定来自PD过滤器53的IRP所请求的数据是否已高速缓存在NT高速缓存管理器59中。In step S4, the PD_FS 54 executes the caching process required for using the caching function of the NT cache manager 59 in the data requested by the IRP from the PD filter 53. In step S5, the PD_FS 54 determines whether the data requested by the IRP from the PD filter 53 is already cached in the NT cache manager 59.

如果在步骤S5中确定了IRP所请求的数据高速缓存在了NT高速缓存管理器59中,则进程转到步骤S6。在步骤S6中,PD_FS 54接收了由来自NT高速缓存管理器59中的IRP所请求的数据,并通过PD过滤器53和Win32子系统51,将对已经调用了相应于IRP的API函数的应用程序31、32,或33的IR作出的应答返回。If it is determined in step S5 that the data requested by the IRP is cached in the NT cache manager 59, the process goes to step S6. In step S6, PD_FS 54 has received the requested data from the IRP in the NT cache manager 59, and through the PD filter 53 and the Win32 subsystem 51, the application that has called the API function corresponding to the IRP The response from the IR of program 31, 32, or 33 is returned.

如果在步骤S5中确定IRP所请求的数据没有被高速缓存在NT高速缓存管理器59中,则进程转到步骤S7。在步骤S7中,PD_FS 54将来自PD过滤器53的IRP通过NT I/O管理器52提供给PD存储器55。If it is determined in step S5 that the data requested by the IRP is not cached in the NT cache manager 59, the process goes to step S7. In step S7, the PD_FS 54 supplies the IRP from the PD filter 53 to the PD storage 55 through the NT I/O manager 52.

在步骤S8中,PD存储器55将来自PD_FS 54的IRP转换成相应的SCSI编码并将其提供给SBP2驱动器56。In step S8, the PD memory 55 converts the IRP from the PD_FS 54 into corresponding SCSI encoding and provides it to the SBP2 driver 56.

在步骤S9中,SBP2驱动器56将SCSI代码转换成SBP2数据并将其提供给1394总线驱动器57。In step S9 , the SBP2 driver 56 converts the SCSI code into SBP2 data and supplies it to the 1394 bus driver 57 .

在步骤S10中,1394总线驱动器57控制IEEE 1394接口22(图2)来将来自SBP2驱动器56的SBP2数据发送给驱动器2。In step S10, the 1394 bus driver 57 controls the IEEE 1394 interface 22 (FIG. 2) to send the SBP2 data from the SBP2 driver 56 to the driver 2.

接着,1394总线驱动器57等待一个对在步骤S10中从驱动器2发送的SBP2数据的应答。在步骤S11中,1394总线驱动器57接收应答并将其返回到已经发送了在步骤S1中通过SBP2驱动器56、PD存储器55、PD_FS 54、PD过滤器53,和Win32子系统51所接收的IRP的应用程序31、32,或33。Next, the 1394 bus driver 57 waits for a response to the SBP2 data sent from the driver 2 in step S10. In step S11, 1394 bus driver 57 receives the reply and returns it to the IRP that has been sent through SBP2 driver 56, PD memory 55, PD_FS 54, PD filter 53, and Win32 subsystem 51 in step S1. Application 31, 32, or 33.

在图4中,如果在应用程序31到33中,一个应用程序在另一个应用程序(例如,应用程序33)之前访问了光盘3,那么当应用程序33访问光盘3时还需要查询。应用程序33也必须等待对光盘3的访问。In FIG. 4, if one application program accesses the optical disc 3 before another application program (for example, the application program 33) among the application programs 31 to 33, an inquiry is also required when the application program 33 accesses the optical disc 3. The application 33 must also wait for access to the disc 3 .

在图4中,应用程序33是一个能将AV数据写入(记录)到光盘3或将AV数据从光盘3读取(播放)的AV应用程序。In FIG. 4 , the application program 33 is an AV application program capable of writing (recording) AV data to the optical disc 3 or reading (playing) AV data from the optical disc 3 .

如果驱动器2指定来读取或写入AV数据以实时响应只来自于AV应用程序33的访问,那么需要通过应用程序31或32对光盘3的访问来进行查询。同时,AV应用程序33也必须等待对光盘3的访问。结果,AV应用程序33实时地读取或写入AV数据就变得很困难。If the drive 2 is designated to read or write AV data in real time in response to access only from the AV application 33, access to the optical disc 3 by the application 31 or 32 is required for inquiry. At the same time, the AV application 33 must also wait for access to the optical disc 3 . As a result, it becomes difficult for the AV application 33 to read or write AV data in real time.

因此,PD过滤器53至少具有以下三个功能之一,并能实时且可靠地从光盘3读取AV数据或将AV数据写入到光盘3。Therefore, the PD filter 53 has at least one of the following three functions, and can read AV data from or write AV data to the optical disc 3 in real time and reliably.

在第一个功能中,PD过滤器53设置相应于来自应用程序31、32,或33的对光盘3的访问请求的IRP的特定优先级并将IRP与其优先级一起存储在一个队列中。接着,PD过滤器53根据IRP所设置的优先级处理存储在队列中的IRP。由于这样的结构,PD过滤器53可以预先处理表示来自AV应用程序33的访问请求的IRP,从而能确保AV应用程序33实时地读取和写入AV数据。In the first function, the PD filter 53 sets a specific priority of an IRP corresponding to an access request to the optical disc 3 from the application 31, 32, or 33 and stores the IRP with its priority in a queue. Next, the PD filter 53 processes the IRP stored in the queue according to the priority set by the IRP. Due to such a structure, the PD filter 53 can pre-process an IRP indicating an access request from the AV application 33, thereby being able to ensure that the AV application 33 reads and writes AV data in real time.

图6图示了实现上述第一个功能的PD过滤器53的结构实例。在图6中,还示出了应用程序31到33。FIG. 6 illustrates a structural example of the PD filter 53 that realizes the first function described above. In FIG. 6, application programs 31 to 33 are also shown.

Figure C20051007930000151
NT OS的OS 30,以所谓的“进程”为单位执行程序。为了执行进程,要给该进程指定至少一个线程,并且进程是在线程中执行的。for
Figure C20051007930000151
The OS 30 of the NT OS executes programs in units of so-called "processes". In order to execute a process, at least one thread must be assigned to the process, and the process is executed in the thread.

在图6中,应用程序31包含了两个进程71和72。进程71由两个线程71A和71B所执行,而进程72由一个线程72A所执行。In FIG. 6 , the application program 31 includes two processes 71 and 72 . Process 71 is executed by two threads 71A and 71B, while process 72 is executed by one thread 72A.

应用程序32包括一个进程73,并且进程73由两个线程73A和73B执行。The application program 32 includes one process 73, and the process 73 is executed by two threads 73A and 73B.

AV应用程序33包含两个进程74和75。进程74由两个线程74A和74B所执行,而进程75由一个线程75A所执行。进程75是PD_API 41的进程。The AV application 33 includes two processes 74 and 75 . Process 74 is executed by two threads 74A and 74B, while process 75 is executed by one thread 75A. Process 75 is the process of PD_API 41.

API函数对Win32子系统51的调用以线程为单位来执行。因此,在图6所示的结构中,API函数在线程71A、71B、72A、73A、73B、74A、74B和75A的每个中都能被调用。The calls of the API functions to the Win32 subsystem 51 are executed in units of threads. Therefore, in the structure shown in FIG. 6, the API function can be called in each of the threads 71A, 71B, 72A, 73A, 73B, 74A, 74B, and 75A.

从线程中调用API函数就是从由线程所执行的进程调用API函数。Calling an API function from a thread means calling the API function from a process executed by the thread.

当API函数在线程71A到75A之一中被调用时,相应的IRP从NT I/O管理器52提供给PD过滤器53。When the API function is called in one of the threads 71A to 75A, the corresponding IRP is supplied from the NT I/O manager 52 to the PD filter 53.

在PD过滤器53中,过滤器内核53A设置一个关于用于来自NT I/O管理器52的IRP的对光盘3的访问的特定优先级(以下也将其称之为“IRP优先级”)。In the PD filter 53, the filter core 53A sets a specific priority regarding the access to the optical disc 3 for the IRP from the NT I/O manager 52 (hereinafter also referred to as "IRP priority") .

Figure C20051007930000152
NT OS的OS 30,具有一个设置进程和线程的优先级并根据优先级执行进程和线程的标准的优先级函数。根据该优先级函数,PC 1的资源,例如,CPU 12,RAM 14,等,可以预先指定给由OS 30所设置的具有高优先级的进程和线程。for
Figure C20051007930000152
OS 30 of the NT OS has a standard priority function that sets the priority of processes and threads and executes processes and threads according to the priority. According to this priority function, the resources of PC 1, such as CPU 12, RAM 14, etc., can be pre-assigned to processes and threads with high priority set by OS 30.

因此,通过使用优先级函数,能设置AV应用程序33的进程74和75比应用程序31的进程71和72和应用程序32的进程73具有更高的优先级,从而能使得AV应用程序33能在应用程序31和32之前访问光盘3。Therefore, by using the priority function, the processes 74 and 75 of the AV application 33 can be set to have higher priority than the processes 71 and 72 of the application 31 and the process 73 of the application 32, so that the AV application 33 can Disc 3 is accessed before applications 31 and 32 .

然而,OS 30的优先级函数所影响的不仅仅是对光盘3的访问,还包括CPU 12的使用以及对RAM 14的访问。However, the priority function of the OS 30 affects not only the access to the disc 3, but also the use of the CPU 12 and the access to the RAM 14.

因此,如果通过使用优先级函数而给AV应用程序33的进程设置了较高的优先级,那么OS 30所提供的其它重要服务的进程就必须等待很长一段时间才能使用CPU 12或RAM 14。这就导致了重要服务的执行的中断,更糟的情况,还会导致PC 1的挂起。Therefore, if a higher priority is set to the process of the AV application program 33 by using the priority function, the process of other important services provided by the OS 30 must wait for a long time before using the CPU 12 or the RAM 14. This results in the interruption of the execution of important services, or worse, the hang of PC 1.

这样,在PD过滤器53中,过滤器内核53A设置IRP优先级,该优先级不取决于由标准优先级函数所设置的NT I/O管理器52提供的IRP的优先级。Thus, in the PD filter 53, the filter core 53A sets the IRP priority independent of the priority of the IRP provided by the NT I/O manager 52 as set by the standard priority function.

IPR的优先级仅仅是用于访问光盘3的优先级。因此,当为AV应用程序33设置一个更高的优先级时,该IRP优先级影响的仅仅是涉及访问光盘3的进程,而并不限定其它由OS 30所提供的服务的进程,例如CPU 12或RAM 14的使用。根据IRP的优先级,可以防止由OS 30所提供的重要的服务的中断或PC 1的挂起。The priority of the IPR is only the priority for accessing the disc 3 . Therefore, when a higher priority is set for the AV application program 33, what this IRP priority affects is only related to the process of accessing the optical disc 3, and does not limit the process of other services provided by the OS 30, such as the CPU 12 or RAM 14 usage. Depending on the priority of the IRP, interruption of important services provided by the OS 30 or suspension of the PC 1 can be prevented.

PD过滤器53设置了来自NT I/O管理器52的IRP的IRP优先级,并将该IRP提供给队列81A或81B并将其存储在其中。即,队列81A或81B将IRP与过滤核心53A所提供的IRP的优先级一起存储在其中。The PD filter 53 sets the IRP priority of the IRP from the NT I/O manager 52, and provides the IRP to the queue 81A or 81B and stores it there. That is, the queue 81A or 81B stores therein the IRP together with the priority of the IRP provided by the filter core 53A.

在图6所示的结构中,提供了两个队列81A或81B,假定在驱动器2中存在两卷。即,队列81A和81B与两个相应的卷关联。PD过滤器53提供响应与81A关联的卷的IRP给队列81,提供响应与81B关联的卷的IRP给队列81B。队列81A和81B在以下也可简称为“队列81”,除非有必要将这二者进行区分。In the structure shown in FIG. 6 , two queues 81A or 81B are provided, assuming that two volumes exist in the drive 2 . That is, queues 81A and 81B are associated with two corresponding volumes. PD filter 53 provides IRPs in response to volumes associated with 81A to queue 81 and IRPs in response to volumes associated with 81B to queue 81B. The queues 81A and 81B may also be simply referred to as "queue 81" hereinafter unless it is necessary to distinguish them.

PD过滤器53根据给IRP所设置的优先级处理存储在队列81中的IRP。即,PD过滤器53预先从队列81中读取具有一个高优先级的IRP,并通过NTI/O管理器52将其提供给PD_FS 54。The PD filter 53 processes the IRPs stored in the queue 81 according to the priority set to the IRPs. That is, the PD filter 53 reads an IRP with a high priority from the queue 81 in advance, and provides it to the PD_FS 54 through the NTI/O manager 52.

用于执行第一功能的进程的线程(与应用于第二功能和第三功能相同)在PD过滤器53的文件系统过滤驱动器层形成。存储IRP的队列81也通过该文件系统的过滤驱动器层形成。A thread (the same as that applied to the second function and the third function) for executing the process of the first function is formed at the file system filter driver layer of the PD filter 53 . A queue 81 for storing IRPs is also formed by the filter driver layer of the file system.

为了预先通过使用PD过滤器53先于来自应用程序31和32的IRP处理来自AV应用程序33的IRP到,PD过滤器53为具有寄存在PD过滤器53中的进程ID的IRP设置最高的IRP优先级,并为在PD过滤器53中没有寄存的进程ID的IRP设置最低的IRP优先级。In order to process the IRP from the AV application 33 ahead of the IRPs from the applications 31 and 32 by using the PD filter 53 in advance, the PD filter 53 sets the highest IRP for the IRP with the process ID registered in the PD filter 53 priority, and set the lowest IRP priority for IRPs that do not have a process ID registered in PD filter 53.

即,OS 30通过给进程指定唯一的进程ID而管理各个进程,并且来自每个进程的IRP(与由每个进程所调用的API函数所关联的IRP)具有唯一的进程ID。随后,如果为来自NT I/O管理器52所接收的特定进程中的IRP所提供的进程ID与寄存在PD过滤器53中的进程ID一致,那么PD过滤器53为该接收到的IRP设置最高的IRP优先级。如果用于该接收到的IRP的进程ID与寄存在PD过滤器53中的进程ID不同(或如果在PD过滤器53中没有寄存器进程ID),那么PD过滤器53为该IRP设置最低的IRP优先级。That is, the OS 30 manages each process by assigning a unique process ID to the process, and an IRP from each process (an IRP associated with an API function called by each process) has a unique process ID. Subsequently, if the process ID provided for an IRP in a particular process received from NT I/O manager 52 matches the process ID registered in PD filter 53, then PD filter 53 sets Highest IRP priority. If the process ID for the received IRP is different from the process ID registered in the PD filter 53 (or if there is no process ID registered in the PD filter 53), then the PD filter 53 sets the lowest IRP for the IRP priority.

表示IRP优先级的数据可以是例如5比特。在这种情况中,最高的IRP优先级是31,而最低的IRP优先级为0。The data representing the priority of the IRP can be, for example, 5 bits. In this case, the highest IRP priority is 31 and the lowest IRP priority is 0.

为了使用PD过滤器53的第一功能,当其被加载时,使用(加载)在AV应用程序33中的PD_API 41请求PD过滤器53寄存器进程75的进程ID,在加载PD_API 41时,是通过使用由Win32子系统51所提供的API函数DeviceIoControl()。即,当AV应用程序33开始通过AV应用程序33的进程75加载PD_API 41时,PD_API 41调用请求PD过滤器53寄存指定给进程75的进程ID的API函数DeviceIoControl()。In order to use the first function of the PD filter 53, when it is loaded, use (load) the PD_API 41 in the AV application 33 to request the process ID of the PD filter 53 register process 75, when loading the PD_API 41, pass The API function DeviceIoControl() provided by the Win32 subsystem 51 is used. That is, when the AV application 33 starts loading the PD_API 41 by the process 75 of the AV application 33, the PD_API 41 calls the API function DeviceIoControl() that requests the PD filter 53 to register the process ID assigned to the process 75.

当完成进程75时,PD_API 41调用请求PD过滤器53删除指定给进程75的进程ID的API函数DeviceIoControl()。When the process 75 is completed, the PD_API 41 calls the API function DeviceIoControl() that requests the PD filter 53 to delete the process ID assigned to the process 75.

因此,只要存在PD_API 41的进程75,最高的IRP优先级就在PD过滤器53中为进程75的IRP(与通过Win32子系统51所提供的API函数相关联的IRP)设置并通过进程75而调用(PD_API 41)。Therefore, as long as there is a process 75 of PD_API 41, the highest IRP priority is set in the PD filter 53 for the IRP of the process 75 (the IRP associated with the API function provided by the Win32 subsystem 51) and passed through the process 75 Call (PD_API 41).

图7示出了当PD过滤器53执行使用第一功能的进程时用来让PD_API 41控制PD过滤器53的API函数。图7所示的API函数提供给AV应用程序33。FIG. 7 shows an API function for the PD_API 41 to control the PD filter 53 when the PD filter 53 executes a process using the first function. The API functions shown in FIG. 7 are provided to the AV application 33.

在图7中,允许PD_API 41控制PD过滤器53的API函数包括两个函数,即,PdGetPriority()和PdSetPriority()。在这两个API函数PdGetPriority()和PdSetPriority()中,使用进程ID和IRP优先级作为参数。In FIG. 7, the API functions that allow the PD_API 41 to control the PD filter 53 include two functions, namely, PdGetPriority() and PdSetPriority(). In these two API functions PdGetPriority() and PdSetPriority(), process ID and IRP priority are used as parameters.

当API函数PdGetPriority()通过指定作为参数的进程ID来调用时,用于响应具有指定的进程ID的由PD过滤器53所设置的IRP优先级与该参数一起返回。在API函数PdGetPriority()中,当为具有该特定的进程ID的进程而由PD过滤器53所设置的IRP优先级的捕获成功时,将1作为返回值返回,而当IRP优先级的捕获失败时,将0作为返回值返回。When the API function PdGetPriority( ) is called by specifying a process ID as a parameter, the IRP priority set by the PD filter 53 for responding with the specified process ID is returned together with the parameter. In the API function PdGetPriority (), when the capture of the IRP priority set by the PD filter 53 for the process with the specific process ID is successful, 1 is returned as a return value, and when the capture of the IRP priority fails , returns 0 as the return value.

根据API函数PdGetPriority(),能确定由PD过滤器53而为来自一个特定的进程的IRP所设置的IRP优先级。According to the API function PdGetPriority( ), the IRP priority set by the PD filter 53 for the IRP from a specific process can be determined.

当API函数PdSetPriority()通过指定进程ID和IRP优先级作为参数而调用时,由为具有作为参数的特定的进程ID的进程而由PD过滤器53所设置的IRP优先级变为用作为参数的IRP优先级。在API函数PdSetPriority()中,当由PD过滤器53所设置的IRP优先级成功改变后,将1作为返回值返回,当IRP的优先级没有成功改变时,返回0。When the API function PdSetPriority() is called by designating a process ID and an IRP priority as parameters, the IRP priority set by the PD filter 53 for a process having a specific process ID as a parameter becomes used as a parameter IRP priority. In the API function PdSetPriority(), when the IRP priority set by the PD filter 53 is successfully changed, 1 is returned as a return value, and when the IRP priority is not successfully changed, 0 is returned.

根据API函数PdSetPriority(),能设置由PD过滤器53为来自具有寄存在PD过滤器53中的进程ID的进程中的IRP或来自具有没有寄存在PD过滤器53中的进程ID的进程中的IRP所设置的IRP优先级。According to the API function PdSetPriority(), it can be set by the PD filter 53 as an IRP from a process with a process ID registered in the PD filter 53 or from a process with a process ID not registered in the PD filter 53. The IRP priority set by the IRP.

当调用API函数PdGetPriority()时,PD_API 41调用请求PD过滤器53来发送由PD过滤器53所设置的IRP优先级的API函数DeviceIoControl()。When the API function PdGetPriority() is called, the PD_API 41 calls the API function DeviceIoControl() that requests the PD filter 53 to send the IRP priority set by the PD filter 53.

当调用API函数PdSetPriority()时,PD_API 41调用请求PD过滤器53来改变由PD过滤器53所设置的I RP优先级的API函数DeviceIoControl()。When the API function PdSetPriority() is called, the PD_API 41 calls the API function DeviceIoControl() that requests the PD filter 53 to change the IRP priority set by the PD filter 53.

正如以上所论述的,为了使用PD过滤器53的第一功能,PD_API 41调用表示寄存器进程ID的请求的API函数DeviceIoControl()和表示删除进程ID的请求的API函数DeviceIoControl(),而且如果需要,API函数DeviceIoControl()表示发送由PD过滤器53所设置的IRP优先级的请求而API函数DeviceIoControl()表示改变由PD过滤器53所设置的IRP优先级的请求。As discussed above, in order to use the first function of the PD filter 53, the PD_API 41 calls the API function DeviceIoControl() representing a request to register a process ID and the API function DeviceIoControl() representing a request to delete a process ID, and if necessary, The API function DeviceIoControl( ) represents a request to transmit the IRP priority set by the PD filter 53 and the API function DeviceIoControl( ) represents a request to change the IRP priority set by the PD filter 53 .

当调用API函数DeviceIoControl()时,Win32子系统51给NT I/O管理器52发送一个响应API函数DeviceIoControl()的请求。接着NT I/O管理器52将该请求转换成IRP_MJ_DEVICE_CONTROL IRP,并将其提供给PD过滤器53。When calling the API function DeviceIoControl (), the Win32 subsystem 51 sends a request to the NT I/O manager 52 in response to the API function DeviceIoControl (). The NT I/O manager 52 then converts the request into an IRP_MJ_DEVICE_CONTROL IRP and provides it to the PD filter 53.

如上所述,在IRP_MJ_DEVICE_CONTROL IRP中,用户所定义的IOCTL用子码来指明。As mentioned above, in the IRP_MJ_DEVICE_CONTROL IRP, the IOCTL defined by the user is indicated by the subcode.

图8图示出了当PD过滤器53通过使用第一功能来执行进程时在IRP_MJ_DEVICE_CONTROL中特定的用户定义的IOCTL。FIG. 8 illustrates a user-defined IOCTL specified in IRP_MJ_DEVICE_CONTROL when the PD filter 53 performs a process by using the first function.

在图8中,四个IOCTL(子码),即IOCTL_PD_SET_PROCESSID,IOCTL_PD_DELETE_PROCESSID,IOCTL_PD_SET_PRIORITY,和IOCTL_PD_GET_PRIORITY,都可以作为用户定义的IOCTL。In Figure 8, four IOCTLs (subcodes), namely IOCTL_PD_SET_PROCESSID, IOCTL_PD_DELETE_PROCESSID, IOCTL_PD_SET_PRIORITY, and IOCTL_PD_GET_PRIORITY, can be used as user-defined IOCTLs.

IOCTL_PD_SET_PROCESSID是作为响应表示寄存器进程ID的请求的API函数DeviceIoControl()的IRP_MJ_DEVICE_CONTROL的子码的IOCTL。表示寄存器进程ID的请求的API函数DeviceIoControl()使用进程ID来作为参数寄存,而且IOCTL_PD_SET_PROCESSID为请求PD过滤器53来将进程ID寄存到PD过滤器53中的请求的I OCTL。IOCTL_PD_SET_PROCESSID is an IOCTL that is a subcode of IRP_MJ_DEVICE_CONTROL of the API function DeviceIoControl( ) in response to a request indicating a register process ID. The API function DeviceIoControl() representing the request to register the process ID uses the process ID to register as a parameter, and IOCTL_PD_SET_PROCESSID is the IOCTL for requesting the PD filter 53 to register the process ID in the PD filter 53.

IOCTL_PD_DELETE_PROCESSID是作为响应表示删除进程ID的请求的API函数DeviceIoControl()的IRP_MJ_DEVICE_CONTROL的子码的IOCTL。表示删除进程ID的请求的API函数DeviceIoControl()使用进程ID来作为参数删除,而且IOCTL_PD_DELETE_PROCESSID为请求PD过滤器53来将进程ID从PD过滤器53中删除的请求的IOCTL。IOCTL_PD_DELETE_PROCESSID is an IOCTL that is a subcode of IRP_MJ_DEVICE_CONTROL of the API function DeviceIoControl( ) in response to a request indicating a process ID to be deleted. The API function DeviceIoControl( ) representing a request to delete a process ID uses the process ID as a parameter to delete, and IOCTL_PD_DELETE_PROCESSID is an IOCTL for a request to request the PD filter 53 to delete the process ID from the PD filter 53 .

IOCTL_PD_SET_PRI ORITY是作为响应表示改变由PD过滤器53所设置的IRP优先级的请求的API函数DeviceIoControl()的IRP_MJ_DEVICE_CONTROLIRP的子码的IOCTL。根据该IOCTL,将为具有该进程ID的IRP所设置的IRP优先级变为也作为API函数PdSetPriority()的参数的IRP优先级,其中前面的IRP优先级用作具有用来作为图7所示的响应表示改变由PD过滤器53所设置的IRP优先级的请求的API函数DeviceIoControl()的API函数PdSetPriority()的参数。IOCTL_PD_SET_PRI ORITY is an IOCTL that is a subcode of IRP_MJ_DEVICE_CONTROLIRP of the API function DeviceIoControl( ) in response to a request representing a change of the IRP priority set by the PD filter 53. According to this IOCTL, the IRP priority that will be set for the IRP with the process ID becomes the IRP priority that is also the parameter of the API function PdSetPriority(), where the previous IRP priority is used as the The response of is indicative of the parameter of the API function PdSetPriority() of the API function DeviceIoControl() of the request to change the IRP priority set by the PD filter 53 .

IOCTL_PD_GET_PRIORITY是作为响应表示获取由PD过滤器53所设置的进程ID的请求的API函数DeviceIoControl()的IRP_MJ_DEVICE_CONTROLIRP的子码的IOCTL。根据该IOCTL,请求具有这样的进程ID所设置的IRP优先级,其中进程ID用来作为图7所示的响应表示获取由PD过滤器53所设置的IRP优先级的请求的API函数DeviceIoControl()的API函数PdSetPriority()的参数。IOCTL_PD_GET_PRIORITY is an IOCTL that is a subcode of IRP_MJ_DEVICE_CONTROLIRP of the API function DeviceIoControl( ) in response to a request indicating acquisition of the process ID set by the PD filter 53 . According to this IOCTL, the request has the IRP priority set by the process ID used as the response shown in FIG. The parameter of the API function PdSetPriority().

作为IRP_MJ_DEVICE_CONTROL IRP的子码的用户定义的IOCTL通过使用由Win32子系统51所提供的API函数DeviceIoControl()而从子系统51发送到NT I/O管理器52,并通过NT I/O管理器52将其作为IRP_MJ_DEVICE_CONTROL IRP的子码。A user-defined IOCTL that is a subcode of the IRP_MJ_DEVICE_CONTROL IRP is sent from the subsystem 51 to the NT I/O manager 52 by using the API function DeviceIoControl() provided by the Win32 subsystem 51, and passed through the NT I/O manager 52 Use it as a subcode of the IRP_MJ_DEVICE_CONTROL IRP.

现结合图9中的流程图,来描述当PD过滤器53执行第一功能时,图6所示的AV应用程序33、PD_API 41,和PD过滤器53所执行的全部进程。Now in conjunction with the flowchart in FIG. 9, describe when the PD filter 53 performs the first function, the AV application program 33 shown in FIG. 6, the PD_API 41, and the entire process performed by the PD filter 53.

当启动AV应用程序33时,在步骤S21中,AV应用程序33通过进程75加载PD_API 41。接着,在步骤S31中,PD_API 41API函数DeviceIoControl(),该函数调用表示寄存已经加载了PD_API 41的进程75的进程ID的请求,以便将具有作为寄存器进程75的进程ID的请求的IOCTL的IOCTL_PD_SET_PROCESSID的IRP_MJ_DEVICE_CONTROL从NT I/O管理器52提供给PD过滤器53。When starting the AV application program 33, in step S21, the AV application program 33 loads the PD_API 41 through the process 75. Then, in step S31, PD_API 41 API function DeviceIoControl (), this function call represents the request of registering the process ID of the process 75 of PD_API 41, so that the IOCTL_PD_SET_PROCESSID of the IOCTL with the request of the process ID of the register process 75 will be IRP_MJ_DEVICE_CONTROL is supplied from the NT I/O manager 52 to the PD filter 53.

在步骤S41中,PD过滤器53从NT I/O管理器52接收的IRP并根据IRP的IOCTL_PD_SET_PROCESSID寄存PD_API 41的进程75的进程ID。In step S41, the PD filter 53 receives the IRP from the NT I/O manager 52 and registers the process ID of the process 75 of the PD_API 41 according to the IOCTL_PD_SET_PROCESSID of the IRP.

因此,随后,除非删除PD_API 41的进程75的进程ID,否则为来自进程75的IRP设置最高的IRP优先级,而给来自其它进程的IRP设置最低的IRP优先级。因此,在PD过滤器53中,来自进程75的IRP能优先处理。Therefore, subsequently, unless the process ID of process 75 of PD_API 41 is deleted, the highest IRP priority is set for IRPs from process 75, and the lowest IRP priority is set for IRPs from other processes. Therefore, in PD filter 53, IRPs from process 75 can be processed preferentially.

更具体地,如果在步骤S22中,比如说AV应用程序33调用表示读取文件请求的API函数ReadFile()作为访问光盘3的请求,那么在步骤S32中PD_API 41接收对API函数ReadFile()的调用。More specifically, if in step S22, for example AV application program 33 transfers the API function ReadFile () that reads the file request as the request of accessing optical disc 3, then in step S32, PD_API 41 receives the request to API function ReadFile () transfer.

在步骤S33中,为了响应对来自AV应用程序33的API函数ReadFile()的调用,PD_API 41调用Win32子系统51所提供的相同的API函数ReadFile(),接着,表示读取文件请求的IRP_MJ_READ IRP被从NT I/O管理器52提供给PD过滤器53。In step S33, in order to respond to the call from the API function ReadFile () of AV application program 33, PD_API 41 calls the same API function ReadFile () that Win32 subsystem 51 provides, then, represents the IRP_MJ_READ IRP of reading file request is supplied from the NT I/O manager 52 to the PD filter 53.

在步骤S42中,PD过滤器53从NT I/O管理器52接收的IRP_MJ_READ IRP,并为IRP_MJ_READ IRP设置IRP优先级。In step S42, the PD filter 53 receives the IRP_MJ_READ IRP from the NT I/O manager 52, and sets the IRP priority for the IRP_MJ_READ IRP.

更具体地,在步骤S42中由PD过滤器53所接收的IRP_MJ_READ IRP为来自PD_API 41的进程75的IRP。进程75的进程ID在步骤S41中被寄存在PD过滤器53中。因此,在步骤S42中由PD过滤器53从进程75所接收的IRP_MJ_READ IRP具有最高的IRP优先级。More specifically, the IRP_MJ_READ IRP received by the PD filter 53 in step S42 is the IRP of the process 75 from the PD_API 41. The process ID of the process 75 is registered in the PD filter 53 in step S41. Therefore, the IRP_MJ_READ IRP received by the PD filter 53 from the process 75 in step S42 has the highest IRP priority.

结果,在PD过滤器53中,只要没有其它具有最高IRP优先级的IRP就会立即处理来自PD_API 41的进程75中的IRP_MJ_READ IRP。As a result, in the PD filter 53, the IRP_MJ_READ IRP in the process 75 from the PD_API 41 will be processed immediately as long as there are no other IRPs with the highest IRP priority.

在步骤S43中,PD过滤器53优先将来自PD_API 41的进程75中的IRP_MJ_READ IRP提供给PD_FS 54。In step S43, the PD filter 53 preferentially provides the IRP_MJ_READ IRP from the process 75 of the PD_API 41 to the PD_FS 54.

接着,当AV应用程序33结束时,在步骤S23中,AV应用程序33请求PD_API 41的进程75来卸载PD_API 41。Next, when the AV application 33 ends, in step S23, the AV application 33 requests the process 75 of the PD_API 41 to unload the PD_API 41.

为了响应该请求,在步骤S34中,PD_API 41调用表示删除进程75的进程ID请求的API函数DeviceIoControl()以便具有指定为表示删除进程75的进程ID请求的IOCTL的IOCTL_PD_DELETE_PROCESSID的IRP_DEVICE_CONTROL IRP从NT I/O管理器52提供给PD过滤器53。In order to respond to this request, in step S34, PD_API 41 calls the API function DeviceIoControl () that represents the process ID request of deleting process 75 so as to have the IRP_DEVICE_CONTROL IRP of IOCTL_PD_DELETE_PROCESSID designated as the IOCTL that represents the process ID request of deleting process 75 from NT I/ O manager 52 supplies to PD filter 53 .

在步骤S44中,PD过滤器53从NT I/O管理器52接收IRP并根据IRP的IOCTL_PD_DELETE_PROCESSID而删除PD_API 41的进程75的进程ID。In step S44, the PD filter 53 receives the IRP from the NT I/O manager 52 and deletes the process ID of the process 75 of the PD_API 41 according to the IOCTL_PD_DELETE_PROCESSID of the IRP.

从而,在PD过滤器53中,IRP根据由OS 30的标准的优先级函数所设置的优先级而处理IRP。Thus, in the PD filter 53, the IRP is processed according to the priority set by the standard priority function of the OS 30.

图6所示的PD过滤器53执行第一功能的进程将在以下结合图10和11进行论述。The process by which the PD filter 53 shown in FIG. 6 performs the first function will be discussed below with reference to FIGS. 10 and 11 .

首先参考图10的流程图来论述从当由图6所示的具有第一功能的PD过滤器53接收IRP到当在队列81中存储IRP(用于将IRP输入到队列81中的进程)期间的进程。Firstly, the flow chart of FIG. 10 is used to discuss the period from when the IRP is received by the PD filter 53 having the first function shown in FIG. process.

为了响应对表示在驱动器2上通过应用程序31到33中的进程71到75之一执行涉及I/O的进程的API函数的调用,Win32子系统51输出一个请求给NT I/O管理器52,并且NT I/O管理器52将相应于API函数的IRP提供给PD过滤器53以响应从Win32子系统51所输出的请求。In response to a call to an API function representing the execution of a process involving I/O by one of the processes 71 to 75 in the application programs 31 to 33 on the driver 2, the Win32 subsystem 51 outputs a request to the NT I/O manager 52 , and the NT I/O manager 52 supplies the IRP corresponding to the API function to the PD filter 53 in response to a request output from the Win32 subsystem 51.

在PD过滤器53中,在步骤S51中,过滤器内核53A接收已经调用了来自NT I/O管理器52的API函数的进程所请求的IRP。在步骤S52中,过滤器内核53A确定IRP是否为具有指定为IOCTL的IOCTL_PD_SET_PROCESSID(图8)的IRP_MJ_DEVICE_CONTROL IRP。In the PD filter 53, in step S51, the filter core 53A receives an IRP requested by a process that has called an API function from the NT I/O manager 52. In step S52, filter core 53A determines whether the IRP is an IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_SET_PROCESSID (FIG. 8) specified as the IOCTL.

如果在步骤S52中确定在步骤S51中由过滤器内核53A所接收的IRP为具有指定为IOCTL的IOCTL_PD_SET_PROCESSID的IRP_MJ_DEVICE_CONTROLIRP,则进程跳到步骤S53。在步骤S53中,过滤器内核53A寄存(存储)包含在IRP中的进程ID,即,已经调用了相应于IRP的API函数的进程的进程ID,并且进程返回步骤S51。If it is determined in step S52 that the IRP received by the filter core 53A in step S51 is IRP_MJ_DEVICE_CONTROLIRP with IOCTL_PD_SET_PROCESSID specified as the IOCTL, the process jumps to step S53. In step S53, the filter core 53A registers (stores) the process ID contained in the IRP, that is, the process ID of the process which has called the API function corresponding to the IRP, and the process returns to step S51.

也就是说,具有指定为IOCTL的IOCTL_PD_SET_PROCESSID的IRP包含已经调用了相应于IRP的API函数的进程的进程ID,并且过滤器内核53A寄存该进程ID。由过滤器内核53A所寄存的进程ID以下也称之为“寄存的进程ID”。That is, the IRP with IOCTL_PD_SET_PROCESSID designated as IOCTL contains the process ID of the process that has called the API function corresponding to the IRP, and the filter core 53A registers the process ID. The process ID registered by the filter core 53A is also referred to as "registered process ID" hereinafter.

如果在步骤S52中确定进程所请求的IRP不是具有指定为IOCTL的IOCTL_PD_SET_PROCESSID的IRP,则进程转到步骤S54以确定IRP是否是具有规定为IOCTL的IOCTL_PD_DELETE_PROCESSID(图8)的IRP_MJ_DEVICE_CONTROL IRP。If it is determined in step S52 that the IRP requested by the process is not the IRP with the IOCTL_PD_SET_PROCESSID designated as the IOCTL, then the process goes to step S54 to determine whether the IRP is the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_DELETE_PROCESSID (FIG. 8) specified as the IOCTL.

如果在步骤S54中确定IRP为具有指定为IOCTL的IOCTL_PD_DELETE_PROCESSID的IRP,则进程转到步骤S55。在步骤S55中,过滤器内核53A删除所寄存的进程ID,并且进程返回到步骤S51。If it is determined in step S54 that the IRP is an IRP with IOCTL_PD_DELETE_PROCESSID designated as the IOCTL, the process goes to step S55. In step S55, the filter core 53A deletes the registered process ID, and the process returns to step S51.

如果在步骤S54中确定IRP不是具有规定为IOCTL的IOCTL_PD_DELETE_PROCESSID的IRP,则进程转到步骤S56以确定IRP是否是表示访问光盘3的请求的IRP。If it is determined in step S54 that the IRP is not an IRP having IOCTL_PD_DELETE_PROCESSID specified as an IOCTL, the process goes to step S56 to determine whether the IRP is an IRP representing a request to access the optical disc 3 .

如果在步骤S56中确定进程所请求的IRP不是表示访问请求的IRP,即,IRP为具有指定为表示改变由PD过滤器53所设置的IRP优先级请求的IOCTL的IOCTL_PD_SET_PRIORITY(图8)的IRP_MJ_DEVICE_CONTROL IRP或具有指定为表示获取由PD过滤器53所设置的IRP优先级的IOCTL的IOCTL_PD_GET_PRIORITY(图8)的IRP_MJ_DEVICE_CONTROL IRP,则进程转到步骤S57。在步骤S 57中,过滤器内核53A基于IRP而执行进程,并通过NT I/O管理器52和Win32子系统51将响应进程的结果返回给已调用了API函数的进程。接着,进程返回到步骤S51。If it is determined in step S56 that the IRP requested by the process is not an IRP representing an access request, that is, the IRP is an IRP_MJ_DEVICE_CONTROL IRP having IOCTL_PD_SET_PRIORITY (FIG. 8) designated as an IOCTL representing a request to change the IRP priority set by the PD filter 53. Or there is an IRP_MJ_DEVICE_CONTROL IRP designated as IOCTL_PD_GET_PRIORITY ( FIG. 8 ) of the IOCTL representing the acquisition of the IRP priority set by the PD filter 53, and the process goes to step S57. In step S57, the filter core 53A executes the process based on the IRP, and returns the result of the response process to the process that has called the API function by the NT I/O manager 52 and the Win32 subsystem 51. Then, the process returns to step S51.

如果进程所请求的IRP为具有指定为IOCTL的IOCTL_PD_SET_PRIORITY的IRP,则在步骤S57中,过滤器内核53A将为由具有在IOCTL_PD_SET_PRIORITY中特定的进程ID的进程所请求的IRP而设置的IRP优先级改变为也在IOCTL_PD_SET_PRIORITY中指定的IRP优先级。如果进程所请求的IRP为具有指定为IOCTL的IOCTL_PD_GET_PRIORITY的IRP,在步骤S57中,过滤器内核53A返回为由具有在IOCTL_PD_GET_PRIORITY中特定的进程ID的进程所请求的IRP而设置的IRP优先级作为响应。If the IRP requested by the process is the IRP with the IOCTL_PD_SET_PRIORITY specified as the IOCTL, then in step S57, the filter core 53A will change the IRP priority set for the IRP requested by the process with the process ID specified in the IOCTL_PD_SET_PRIORITY For the IRP priority also specified in IOCTL_PD_SET_PRIORITY. If the IRP requested by the process is the IRP with the IOCTL_PD_GET_PRIORITY specified as the IOCTL, in step S57, the filter core 53A returns the IRP priority set for the IRP requested by the process having the process ID specified in the IOCTL_PD_GET_PRIORITY as a response .

如果在步骤S56中确定进程所请求的IRP为表示访问请求的IRP,即,IRP为表示读取文件请求的IRP_MJ_READ IRP或表示写入文件请求的IRP_MJ_WRITE IRP,则进程转到步骤S58。在步骤S58中,过滤器内核53A确定包含在进程所请求的IRP中的进程ID,即,已经调用了相应于IRP的API函数的进程的进程ID,是否与寄存的进程ID一致。If in step S56, determine that the IRP requested by the process is the IRP representing the access request, that is, the IRP represents the IRP_MJ_READ IRP of the read file request or the IRP_MJ_WRITE IRP of the write file request, then the process proceeds to step S58. In step S58, the filter core 53A determines whether the process ID included in the IRP requested by the process, that is, the process ID of the process that has called the API function corresponding to the IRP, coincides with the registered process ID.

如果在步骤S58中确定包含在进程请求的IRP中的进程ID与寄存的进程ID不一致,则进程转到步骤S59。在步骤S59中,过滤器内核53A为进程所请求的IRP设置最低的IRP优先级并且进程转到步骤S61。If it is determined in step S58 that the process ID included in the IRP of the process request does not coincide with the registered process ID, the process goes to step S59. In step S59, the filter core 53A sets the lowest IRP priority for the IRP requested by the process and the process goes to step S61.

如果在步骤S58中确定包含在进程请求的IRP中的进程ID与寄存的进程ID一致,则进程转到步骤S60。在步骤S60中,过滤器内核53A为进程所请求的IRP设置最高的IRP优先级并且进程转到步骤S61。If it is determined in step S58 that the process ID contained in the IRP of the process request coincides with the registered process ID, the process goes to step S60. In step S60, the filter core 53A sets the highest IRP priority for the IRP requested by the process and the process goes to step S61.

在步骤S61中,过滤器内核53A将具有与在步骤S59或步骤S60中设置的IRP优先级的IRP输出到队列81并将其存储在其中,并等待另一个IRP。进程接着返回到步骤S51。In step S61, the filter core 53A outputs the IRP having the same priority as the IRP set in step S59 or step S60 to the queue 81 and stores it therein, and waits for another IRP. The process then returns to step S51.

在图10中,如果包含在进程请求的IRP中的进程ID与寄存的进程ID不同,则给IRP设置最低的IRP优先级。如果包含在IRP中的进程ID与寄存的进程ID相同,则给IRP设置最高的IRP优先级。然而,也可以给IRP设置IRP优先级的其它级别。In FIG. 10, if the process ID included in the IRP requested by the process is different from the registered process ID, the lowest IRP priority is set to the IRP. If the process ID contained in the IRP is the same as the registered process ID, the IRP is given the highest IRP priority. However, other levels of IRP priority may also be set for IRPs.

给具有特定进程ID的IRP设置IRP优先级,例如,具有与寄存的进程ID一致的进程ID的IRP,能通过图7所示的API函数PdSetPriority()而指定。Setting the IRP priority to an IRP with a specific process ID, for example, an IRP with a process ID identical to a registered process ID can be specified by the API function PdSetPriority() shown in FIG. 7 .

对于所寄存的进程ID来说,可以寄存多个进程ID。在这种情况中,一个唯一的IRP优先级能指定给每个寄存的ID,并且能为具有与所寄存的进程ID一致的进程ID的IRP指定给某个寄存的进程ID指定的IRP优先级。For the registered process ID, a plurality of process IDs may be registered. In this case, a unique IRP priority can be assigned to each registered ID, and an IRP with a process ID that matches a registered process ID can be assigned the IRP priority assigned to a registered process ID .

在存储于由图6所示的具有第一功能的PD过滤器53所产生的队列81中的IRP上的进程(用于从队列81输出一个IRP的进程)将在以下参考图11的流程进行描述。The process on the IRP stored in the queue 81 generated by the PD filter 53 having the first function shown in FIG. describe.

在PD过滤器53中,在步骤S71中,过滤器内核53A从存储在队列81中的IRP中寻找一个最高的IRP优先级。In the PD filter 53, the filter core 53A searches for a highest IRP priority among the IRPs stored in the queue 81 in step S71.

在步骤S72中,过滤器内核53A处理在步骤S71中所寻找到的具有最高IRP优先级的IRP,同时进程返回步骤S71。更具体地,在步骤S72中,过滤器内核53A预先从队列81中读取具有最高IRP优先级的IRP并通过NT I/O管理器52将它输出到PD_FS 54。In step S72, the filter core 53A processes the IRP with the highest IRP priority found in step S71, and the process returns to step S71. More specifically, in step S72, the filter core 53A reads the IRP with the highest IRP priority from the queue 81 in advance and outputs it to the PD_FS 54 through the NT I/O manager 52.

如果在步骤S71中寻找到多个具有最高IRP优先级的IRP,则过滤器内核53A根据OS 30的标准优先级函数或IRP存储到队列81中的时间而处理多个IRP。即,过滤器内核53A基于标准优先级函数或最早存储的IRP预先从队列81中读取来自具有最高优先级的进程中的IRP并将其输出到PD_FS 54。If a plurality of IRPs with the highest IRP priority are found in step S71, the filter core 53A processes the plurality of IRPs according to the standard priority function of the OS 30 or the time the IRPs are stored in the queue 81. That is, the filter core 53A pre-reads the IRPs from the process with the highest priority from the queue 81 and outputs them to the PD_FS 54 based on a standard priority function or the oldest stored IRP.

如上所论述的,在PD过滤器53中,为IRP设置与OS 30的标准优先级函数不同的IRP优先级。更具体地,具对于由有与寄存的进程ID一致的进程ID的进程而所请求的IRP,为该IRP设置最高的IRP优先级,而对于由具有与寄存的进程ID不一致的进程ID的进程所请求的IRP,为该IRP设置最低的IRP优先级。As discussed above, in the PD filter 53, IRPs are set with an IRP priority different from the standard priority function of the OS 30. More specifically, for an IRP requested by a process with a process ID that matches the registered process ID, set the highest IRP priority for that IRP, while for an IRP requested by a process with a process ID that is inconsistent with the registered process ID The requested IRP for which the lowest IRP priority is set.

接着,PD过滤器53队列81中存储提供的IRP优先级的IRP,并根据IRP优先级处理存储在队列81中的IRP。Next, the PD filter 53 stores the IRPs with the provided IRP priorities in the queue 81, and processes the IRPs stored in the queue 81 according to the IRP priorities.

在AV应用程序33中,当通过进程75加载PD_API 41时,PD_API 41请求PD过滤器53来寄存器进程75的进程ID,同时PD过滤器53寄存PD_API 41的进程75的进程ID。In the AV application 33, when the PD_API 41 is loaded by the process 75, the PD_API 41 requests the PD filter 53 to register the process ID of the process 75, and the PD filter 53 registers the process ID of the process 75 of the PD_API 41.

接着,AV应用程序33产生一个请求来通过PD_API 41的进程75访问光盘3。Next, the AV application program 33 generates a request to access the disc 3 by the process 75 of the PD_API 41.

因此,在PD过滤器53中,表示AV应用程序33访问光盘3的请求的IRP优先于应用程序31和32的IRP而执行。这样,AV应用程序33就不必等到执行完应用程序31或32的IRP或由应用程序31或32的IRP上的进程所引起的驱动器2中所需的寻址。结果,就可以避免AV应用程序33所产生的从光盘3读取数据或将数据写入到光盘3中的中断,并且从而能实时地将AV数据记录到光盘3上或从光盘3上播放。Therefore, in the PD filter 53 , the IRP indicating the AV application 33's request to access the optical disc 3 is executed prior to the IRPs of the applications 31 and 32 . Thus, the AV application 33 does not have to wait until the execution of the IRP of the application 31 or 32 or the addressing required in the driver 2 caused by the process on the IRP of the application 31 or 32 is completed. As a result, interruption of reading data from or writing data to the optical disc 3 by the AV application program 33 can be avoided, and thus AV data can be recorded to or played back from the optical disc 3 in real time.

为了实时地将AV数据记录在光盘3上或从光盘3上播放AV数据,仅仅需要表示AV应用程序33对光盘3的访问的请求的IRP在AV应用程序33记录或播放AV数据时预先处理。In order to record AV data on or play AV data from the optical disc 3 in real time, only an IRP indicating a request for access to the optical disc 3 by the AV application 33 needs to be preprocessed when the AV application 33 records or plays AV data.

在上描述实施例中,如参考图9所论述的,表示AV应用程序33对光盘3的访问的请求的IRP仅仅在PD过滤器53加载PD_API 41时预先处理。In the above-described embodiment, as discussed with reference to FIG. 9 , an IRP representing a request for access to the optical disc 3 by the AV application 33 is preprocessed only when the PD filter 53 loads the PD_API 41.

因此,除了在AV应用程序33开始加载PD_API 41时开始而在AV应用程序33完成时卸载PD_API 41外,PD_API 41也可以在AV应用程序33记录或播放AV数据的操作开始时加载而在记录或播放操作完成时卸载。Therefore, in addition to starting when the AV application 33 starts loading the PD_API 41 and unloading the PD_API 41 when the AV application 33 is completed, the PD_API 41 can also be loaded when the AV application 33 starts recording or playing AV data and is not used during recording or playback. Unloads when the playback operation completes.

以下将描述用于可靠地实时读取和写入AV数据的PD过滤器53的第二功能。The second function of the PD filter 53 for reliably reading and writing AV data in real time will be described below.

更具体地,根据第二功能,PD过滤器53设置一个表示代表从应用程序31到33对光盘3访问的请求的IRP进程是否被允许或禁止的暂停标志,同时将来自应用程序31到33的IRP存储在队列81中。接着PD过滤器53根据暂停标志处理存储在队列81中的IRP。由于这样的结构,PD过滤器53中断来自除AV应用程序33外其它应用程序的IRP的处理,而只处理来自应用程序33的IRP。结果,应用程序33能实时且可靠地读取或写入AV数据。More specifically, according to the second function, the PD filter 53 sets a pause flag representing whether the IRP process representing the request for access to the optical disk 3 from the application programs 31 to 33 is allowed or prohibited, IRPs are stored in queue 81. The PD filter 53 then processes the IRPs stored in the queue 81 according to the pause flag. Due to such a structure, the PD filter 53 interrupts the processing of IRPs from applications other than the AV application 33 and only processes IRPs from the application 33 . As a result, the application program 33 can read or write AV data in real time and reliably.

就是说,通过使用第二功能,PD过滤器53进入以下两种状态之一:根据暂停标志仅仅允许处理特定的IRP而不处理其它IRP的中断状态和所有IRP都能处理的运行状态。That is, by using the second function, the PD filter 53 enters one of the following two states: an interrupt state in which only a specific IRP is allowed to be processed without processing other IRPs according to the suspend flag, and a running state in which all IRPs can be processed.

具有以上所述的第二功能的PD过滤器53的结构举例来说,如图6所示。For example, the structure of the PD filter 53 having the above-mentioned second function is shown in FIG. 6 .

更具体地,在具有第二功能的PD过滤器53中,除了寄存器进程ID以及为I RP设置IRP优先级外,过滤器内核53A还设置暂停标志。过滤器内核53A还根据IRP优先级以及暂停标志,处理存储在队列81中的IRP。More specifically, in the PD filter 53 having the second function, in addition to registering the process ID and setting the IRP priority for the IRP, the filter core 53A also sets the pause flag. The filter core 53A also processes the IRPs stored in the queue 81 according to the IRP priority and the pause flag.

为了使用PD过滤器53的第二功能,AV应用程序33所使用的PD_API 41提供了用于给AV应用程序33设置PD过滤器53是中断状态或运行状态的API函数。In order to use the second function of the PD filter 53, the PD_API 41 used by the AV application 33 provides an API function for setting the PD filter 53 to the AV application 33 in an interrupted state or in a running state.

图12图示了当PD过滤器53执行使用第二功能的进程时允许PD_API 41控制PD过滤器53的API函数。图12所示的API函数提供给了AV应用程序33。FIG. 12 illustrates API functions that allow the PD_API 41 to control the PD filter 53 when the PD filter 53 executes a process using the second function. The API functions shown in FIG. 12 are provided to the AV application 33.

在图12中,省略了以上所述的用于控制PD过滤器53的API函数。In FIG. 12, the API functions for controlling the PD filter 53 described above are omitted.

在图12中,用于允许PD_API 41控制PD过滤器53的API函数包括了两个函数,即,PdPauseOtherAppIrp()和PdRunOtherAppIrp()。In FIG. 12, API functions for allowing the PD_API 41 to control the PD filter 53 include two functions, namely, PdPauseOtherAppIrp() and PdRunOtherAppIrp().

根据API函数PdPauseOtherAppIrp(),PD过滤器53处于中断状态以仅仅处理特定的IRP而中断其它的IRP。根据API函数PdRunOtherAppIrp(),PD过滤器53处于运行状态以处理所有的IRP。According to the API function PdPauseOtherAppIrp(), the PD filter 53 is in a pause state to only process a specific IRP and pause other IRPs. According to the API function PdRunOtherAppIrp(), the PD filter 53 is in the running state to process all IRPs.

API函数PdPauseOtherAppIrp()和PdRunOtherAppIrp()都使用了特定卷的卷名作为参数。The API functions PdPauseOtherAppIrp() and PdRunOtherAppIrp() both take the volume name of a specific volume as a parameter.

通过指定作为参数的卷名而调用API函数PdPauseOtherAppIrp(),PD过滤器53处于中断状态以仅仅处理在表示访问由作为参数的卷名而指定的卷的请求的IRP中的特定IRP并中断其它IRP的处理。By calling the API function PdPauseOtherAppIrp() by specifying the volume name as a parameter, the PD filter 53 is in an interrupt state to process only a specific IRP among IRPs expressing a request to access the volume specified by the volume name as a parameter and to interrupt other IRPs processing.

通过指定作为参数的卷名而调用API函数PdRunOtherAppIrp(),PD过滤器53处于运行状态以处理所有的表示访问由作为参数的卷名而指定的卷的请求的IRP。By calling the API function PdRunOtherAppIrp( ) specifying the volume name as a parameter, the PD filter 53 is in a running state to process all IRPs indicating a request to access the volume specified by the volume name as a parameter.

PD过滤器53能为每个卷,即,每个与相应的卷关联的队列,设置处于中断状态或运行状态。例如,在PD过滤器53中,在队列81A和81B中设置中断状态或运行状态。The PD filter 53 can be set for each volume, that is, each queue associated with the corresponding volume, to be in the interrupted state or the running state. For example, in the PD filter 53, the interrupt status or the running status is set in the queues 81A and 81B.

但为了简明起见,相同的状态,即中断状态或运行状态,都可以为队列81A和81B设置。But for simplicity, the same state, ie interrupted state or running state, can be set for both queues 81A and 81B.

在API函数PdPauseOtherAppIrp()中,如果PD过滤器53已经成功地设置为中断状态,则将1作为返回值返回,而如果PD过滤器53没有成功设置为中断状态,则将0作为返回值返回。类似地,在API函数PdRunOtherAppIrp()中,如果PD过滤器53已经成功地设置为运行状态,则将1作为返回值返回,而如果PD过滤器53没有成功设置为运行状态,则将0作为返回值返回。In the API function PdPauseOtherAppIrp(), if the PD filter 53 has been successfully set to the pause state, 1 is returned as the return value, and if the PD filter 53 is not successfully set to the pause state, 0 is returned as the return value. Similarly, in the API function PdRunOtherAppIrp(), if the PD filter 53 has been successfully set to the running state, then 1 is returned as the return value, and if the PD filter 53 is not successfully set to the running state, then 0 is returned as value returned.

当调用API函数PdPauseOtherAppIrp()时,PD_API 41调用请求PD过滤器53处于中断状态的API函数DeviceIoControl()。When the API function PdPauseOtherAppIrp() is called, the PD_API 41 calls the API function DeviceIoControl() that requests the PD filter 53 to be in the interrupted state.

当调用API函数PdRunOtherAppIrp()时,PD_API 41调用使PD过滤器53处于运行状态的API函数DeviceIoControl()。When the API function PdRunOtherAppIrp() is called, the PD_API 41 calls the API function DeviceIoControl() that makes the PD filter 53 in the running state.

当调用API函数DeviceIoControl()时,Win32子系统51输出一个响应API函数DeviceIoControl()的请求给NT I/O管理器52,并且NT I/O管理器52将该请求转换成IRP_MJ_DEVICE_CONTROL IRP并将其提供给PD过滤器53。When calling the API function DeviceIoControl (), the Win32 subsystem 51 outputs a request in response to the API function DeviceIoControl () to the NT I/O manager 52, and the NT I/O manager 52 converts the request into an IRP_MJ_DEVICE_CONTROL IRP and converts it Provided to PD filter 53.

如上所述,在IRP_MJ_DEVICE_CONTROL中,IOCTL指定为用户定义的子码。As mentioned above, in IRP_MJ_DEVICE_CONTROL, IOCTL is specified as a user-defined subcode.

图13图示了当PD过滤器53执行使用第二功能的进程时在IRP_MJ_DEVICE_CONTROL中指定的用户所定义的IOCTL。FIG. 13 illustrates a user-defined IOCTL specified in IRP_MJ_DEVICE_CONTROL when the PD filter 53 executes a process using the second function.

如图12,在图13中,并未示出以上所论述的用户所定义的IOCTL。As in FIG. 12, in FIG. 13, the user-defined IOCTL discussed above is not shown.

在图13中,两个TOCTL子码,即,IOCTL_PD_PAUSE_OTHERAPPIRP和IOCTL_PD_RUN_OTHERAPPIRP,都可以作为用户所定义的IOCTL。In FIG. 13, two TOCTL subcodes, namely, IOCTL_PD_PAUSE_OTHERAPPIRP and IOCTL_PD_RUN_OTHERAPPIRP, can be used as user-defined IOCTLs.

IOCTL_PD_RUN_OTHERAPPIRP为响应表示将PD过滤器53设置为处于中断状态的请求的API函数DeviceIoControl()的IRP_MJ_DEVICE_CONTROL IRP的字码的IOCTL。IOCTL_PD_RUN_OTHERAPPIRP is the IOCTL of the character code of the IRP_MJ_DEVICE_CONTROL IRP of the API function DeviceIoControl() that responds to the request representing that the PD filter 53 is set to the interrupted state.

IOCTL_PD_PAUSE_OTHERAPPIRP为响应表示将PD过滤器53设置为处于运行状态的请求的API函数DeviceIoControl()的IRP_MJ_DEVICE_CONTROL IRP的子码的IOCTL。IOCTL_PD_PAUSE_OTHERAPPIRP is an IOCTL of a subcode of the IRP_MJ_DEVICE_CONTROL IRP of the API function DeviceIoControl( ) that responds to a request indicating that the PD filter 53 is set in the running state.

用户所定义的IOCTL,即IRP_MJ_DEVICE_CONTROL IRP的子码,通过使用由Win32子系统51所提供的API函数DeviceIoControl()从Win32系统51传送到NT I/O管理器52,并被NT I/O管理器52指定为IRP_MJ_DEVICE_CONTROL IRP的子码。The IOCTL defined by the user, i.e. the subcode of the IRP_MJ_DEVICE_CONTROL IRP, is transmitted from the Win32 system 51 to the NT I/O manager 52 by using the API function DeviceIoControl () provided by the Win32 subsystem 51, and is used by the NT I/O manager 52 is designated as the subcode of the IRP_MJ_DEVICE_CONTROL IRP.

现将参考图14的流程图描述当PD过滤器53执行第二功能时图6所示的AV应用程序33、PD_API 41,以及PD过滤器53的全部进程。The entire process of the AV application 33, the PD_API 41 shown in FIG. 6, and the PD filter 53 when the PD filter 53 executes the second function will now be described with reference to the flowchart of FIG.

为了响应用户操作输入单元17(图2)所产生的将AV数据记录在光盘3上或从光盘3播放AV数据的请求,在步骤S91中,AV应用程序33调用API函数PdPauseOtherAppIrp()。In response to a request for recording AV data on or playing AV data from the optical disc 3 generated by the user operating the input unit 17 (FIG. 2), the AV application 33 calls the API function PdPauseOtherAppIrp() in step S91.

在步骤S101中,PD_API 41从AV应用程序33接收对API函数PdPauseOtherAppIrp()的调用。接着,在步骤S102中,PD_API 41调用表示为响应对API函数PdPauseOtherAppIrp()的调用而让PD_API 41调用请求PD过滤器53处于中断状态的API函数DeviceIoControl()以便具有作为表示PD过滤器53处于中断状态的具有IOCTL的IOCTL_PD_PAUSE_OTHERAPPIRP的IRP_MJ_DEVICE_CONTROL IRP从NT I/O管理器52提供给PD过滤器53。In step S101, the PD_API 41 receives a call to the API function PdPauseOtherAppIrp() from the AV application 33. Next, in step S102, the PD_API 41 calls the API function DeviceIoControl() indicating that the PD_API 41 calls the request PD filter 53 to be in the interrupted state in response to the calling of the API function PdPauseOtherAppIrp() so as to have The IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_PAUSE_OTHERAPPIRP of the state is supplied from the NT I/O manager 52 to the PD filter 53 .

在步骤S111中,PD过滤器53从NT I/O管理器52接收IRP并根据IOCTL_PD_PAUSE_OTHERAPPIRP将暂停标志设置为1,从而使得PD过滤器53能在中断状态下操作。In step S111, the PD filter 53 receives the IRP from the NT I/O manager 52 and sets the pause flag to 1 according to the IOCTL_PD_PAUSE_OTHERAPPIRP, thereby enabling the PD filter 53 to operate in an interrupted state.

在中断状态下,PD过滤器53中断除了PD_API 41的进程75外其它所有的进程请求的IRP的处理而仅仅处理PD_API 41的进程75所请求的IRP。In the interrupt state, the PD filter 53 interrupts the processing of the IRP requested by all other processes except the process 75 of the PD_API 41 and only processes the requested IRP of the process 75 of the PD_API 41.

如果,在步骤S92中,AV应用程序33调用表示作为访问光盘3的请求的读取文件的请求的API函数ReadFile(),则在步骤S103中PD_API 41接收对API函数ReadFile()的调用。If, in step S92, the AV application 33 calls the API function ReadFile( ) representing a request to read a file as a request to access the optical disc 3, then the PD_API 41 receives a call to the API function ReadFile( ) in step S103.

在步骤S104中,为了响应对来自AV应用程序33的API函数ReadFile()的调用,PD_API 41调用相同的API函数ReadFile()以便表示读取文件请求的IRP_MJ_READ IRP从NT I/O管理器52提供给PD过滤器53。In step S104, in response to the call to the API function ReadFile() from the AV application 33, the PD_API 41 calls the same API function ReadFile() so that the IRP_MJ_READ IRP representing the read file request is provided from the NT I/O manager 52 to PD filter 53.

在步骤S112中,PD过滤器53从NT I/O管理器52接收IRP_MJ_READ IRP。在步骤S113中,PD过滤器53存储在步骤S112中接收到的IRP,即,队列81(图6)中,PD_API 41的进程75所请求的IRP。接着,PD过滤器53从队列81读取IRP并将它提供给PD_FS 54。In step S112, the PD filter 53 receives the IRP_MJ_READ IRP from the NT I/O manager 52. In step S113, the PD filter 53 stores the IRP received in step S112, that is, the IRP requested by the process 75 of the PD_API 41 in the queue 81 (FIG. 6). Next, PD filter 53 reads the IRP from queue 81 and provides it to PD_FS 54.

如上所述,会立即处理AV应用程序33的进程75的IRP。As mentioned above, the IRP of the process 75 of the AV application 33 is processed immediately.

另一方面,如果除了AV应用程序33外的应用程序31和32的进程71到73在步骤S81到S83中调用了表示作为访问光盘3的请求的读取文件请求的API函数ReadFile(),则表示读取文件请求的IRP_MJ_READ IRP就从NT I/O管理器52提供给PD过滤器53。On the other hand, if the processes 71 to 73 of the application programs 31 and 32 other than the AV application program 33 call the API function ReadFile() representing a read file request as a request to access the optical disc 3 in steps S81 to S83, then The IRP_MJ_READ IRP representing the read file request is provided to the PD filter 53 from the NT I/O manager 52.

在步骤S114到S116中,PD过滤器53接收了响应在步骤S81到S83中调用的API函数ReadFile()的IRP,并将该IRP存储在队列81中。In steps S114 to S116 , the PD filter 53 receives an IRP in response to the API function ReadFile( ) called in steps S81 to S83 , and stores the IRP in the queue 81 .

在这种情况中,由于PD过滤器53处于中断状态,因此在步骤S114到S116中PD过滤器53不能处理存储在队列81中的IRP,该IRP即除AV应用程序33的进程75外的进程71到73的IRP。也就是说,在PD过滤器53中,来自应用程序31的进程71和72中的IRP以及应用程序32的应用程序73依然存储在队列81中而并未提供给PD_FS 54。In this case, since the PD filter 53 is in the interrupted state, the PD filter 53 cannot process the IRP stored in the queue 81, which is a process other than the process 75 of the AV application 33, in steps S114 to S116. 71 to 73 IRPs. That is, in the PD filter 53, the IRPs from the processes 71 and 72 of the application 31 and the application 73 of the application 32 are still stored in the queue 81 and not provided to the PD_FS 54.

接着,为了响应停止记录在光盘3上的AV数据的播放操作或完成用户操作输入单元17而完成AV应用程序33的请求,AV应用程序33在步骤S93中调用API函数PdRunOtherAppIrp()。Next, in response to the request of the AV application 33 to stop the playback operation of the AV data recorded on the optical disc 3 or to complete the user's operation of the input unit 17, the AV application 33 calls the API function PdRunOtherAppIrp() in step S93.

在步骤S105中,PD_API 41接收AV应用程序33对API函数PdRunOtherAppIrp()的调用。接着,在步骤S106中,PD_API 41调用请求PD过滤器53为运行状态来响应对API函数PdRunOtherAppIrp()的调用的API函数DeviceIoControl(),以便请求PD过滤器53为运行状态的IOCTL具有指定为IOCTL的IOCTL_PD_RUN_OTHERAPPIRP的IRP_MJ_DEVICE_CONTROLIRP从NT I/O管理器52提供给PD过滤器53。In step S105, the PD_API 41 receives a call from the AV application 33 to the API function PdRunOtherAppIrp(). Then, in step S106, the PD_API 41 calls the request PD filter 53 to respond to the API function DeviceIoControl () of the calling of the API function PdRunOtherAppIrp (), so that the IOCTL that requests the PD filter 53 to be the running state has an IOCTL designated as the IOCTL IRP_MJ_DEVICE_CONTROLIRP of IOCTL_PD_RUN_OTHERAPPIRP is supplied from NT I/O manager 52 to PD filter 53.

在步骤S117中,PD过滤器53从NT I/O管理器52接收IRP并根据表示运行状态的IOCTL_PD_RUN_OTHERAPPIRP为0而复位暂停标志,从而允许PD过滤器53在运行状态下运行。In step S117, the PD filter 53 receives the IRP from the NT I/O manager 52 and resets the suspend flag according to the IOCTL_PD_RUN_OTHERAPPIRP representing the running state being 0, thereby allowing the PD filter 53 to run in the running state.

接着,PD过滤器53开始(重新开始)处理除了PD_API 41的进程75外的进程的IRP。Next, the PD filter 53 starts (restarts) processing IRPs of processes other than the process 75 of the PD_API 41.

在这种情况下,在PD过滤器53中,在步骤S114到S116中所接收的进程71到73的IRP依旧存储在队列81中而不被处理。In this case, in the PD filter 53, the IRPs of the processes 71 to 73 received in steps S114 to S116 are still stored in the queue 81 without being processed.

接着,在步骤S118到S120中,PD过滤器53读取存储在队列81中的进程71到73的IRP,并将其提供给PD_FS 54。Next, in steps S118 to S120, the PD filter 53 reads the IRPs of the processes 71 to 73 stored in the queue 81, and supplies them to the PD_FS 54.

接着,在步骤S84中,当除了AV应用程序33外的应用程序31到32的进程71到73中的一个调用表示作为访问光盘3的请求的读取文件的请求的API函数ReadFile()时,表示读取文件请求的IRP_MJ_READ IRP就从NT I/O管理器52提供给PD过滤器53。Next, in step S84, when one of the processes 71 to 73 of the application programs 31 to 32 other than the AV application program 33 calls the API function ReadFile() representing a request to read a file as a request to access the optical disc 3, The IRP_MJ_READ IRP representing the read file request is provided to the PD filter 53 from the NT I/O manager 52.

在步骤S121中,PD过滤器53接收I RP来响应由进程71到73之一在步骤S84中所调用的API函数ReadFile()并将其IRP存储在队列81中。In step S121, the PD filter 53 receives the IRP in response to the API function ReadFile() called by one of the processes 71 to 73 in step S84 and stores its IRP in the queue 81.

在这种情况下,由于PD过滤器53处于运行状态,则在步骤S122中,其读取在步骤S121中存储在队列81中的IRP并将其提供给PD_FS 54。In this case, since the PD filter 53 is in the running state, then in step S122, it reads the IRP stored in the queue 81 in step S121 and supplies it to the PD_FS 54.

如上所述,当PD过滤器53处于中断状态时,其仅仅从AV应用程序33输出IRP给PD_FS 54。当PD过滤器53从中断状态转到运行状态时,其也输出除了AV应用程序33外其它的应用程序的IRP给PD_FS 54。As described above, when the PD filter 53 is in the interrupt state, it only outputs IRPs from the AV application 33 to the PD_FS 54. When the PD filter 53 changes from the interrupt state to the running state, it also outputs the IRPs of other application programs except the AV application program 33 to the PD_FS 54.

图6所示的由PD过滤器53所执行的进程将在以下参考图15和16进行描述。The process performed by the PD filter 53 shown in FIG. 6 will be described below with reference to FIGS. 15 and 16 .

首先,将参考图15的流程图来论述从当由图6所示的提供第二功能的PD过滤器53所接收的IRP到存储在队列81中的IRP的进程(用于将IRP输入到队列81中的进程)。First, the process from the IRP received by the PD filter 53 that provides the second function shown in FIG. 6 to the IRP stored in the queue 81 will be discussed with reference to the flowchart of FIG. 81 process).

在图15中,所执行的进程类似于图10的流程图所描述的进程,除了用于设置暂停标志的步骤S156到S159。In FIG. 15, the process performed is similar to that described in the flowchart of FIG. 10 except for steps S156 to S159 for setting the pause flag.

为了响应表示由应用程序31到33的进程71到75之一而在驱动器2上执行有关I/O的进程的请求的API函数的调用,Win32子系统51输出一个请求给NT I/O管理器52,而NT I/O管理器52将相应于API的函数的IRP提供给PD过滤器53以响应从Win32子系统51输出的请求。In response to a call of an API function representing a request to perform an I/O-related process on the driver 2 by one of the processes 71 to 75 of the application programs 31 to 33, the Win32 subsystem 51 outputs a request to the NT I/O manager 52, and the NT I/O manager 52 provides the IRP corresponding to the function of the API to the PD filter 53 in response to the request output from the Win32 subsystem 51.

在PD过滤器53中,在步骤S151中,过滤器内核53A接收由已经调用了NT I/O管理器52的AIP函数所请求的IRP。在步骤S152中,过滤器内核53A确定IRP是否是具有指定为IOCTL的IOCTL_PD_SET_PROCESSID(图8)的IRP_MJ_DEVICE_CONTROL IRP。In the PD filter 53, in step S151, the filter core 53A receives the IRP requested by the AIP function of the NT I/O manager 52 that has been called. In step S152, the filter core 53A determines whether the IRP is an IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_SET_PROCESSID (FIG. 8) specified as the IOCTL.

如果在步骤S152中确定在步骤S151中由过滤器内核53A所接收的IRP是指定为IOCTL的IOCTL_PD_SET_PROCESSID的IRP_MJ_DEVICE_CONTROL IRP,则进程转到步骤S153。在步骤S153中,过滤器内核53A寄存(存储)包含在IRP中的进程ID,即,已经调用了相应于IRPAPI函数的进程的进程ID,并等待另一个IRP。接着进程返回步骤S151。If it is determined in step S152 that the IRP received by the filter core 53A in step S151 is the IRP_MJ_DEVICE_CONTROL IRP specified as the IOCTL_PD_SET_PROCESSID of the IOCTL, the process goes to step S153. In step S153, the filter core 53A registers (stores) the process ID contained in the IRP, that is, the process ID of the process which has called the function corresponding to the IRPAPI, and waits for another IRP. Then the process returns to step S151.

也就是说,在步骤S153中,已经调用的相应于在步骤S151中由过滤器内核53A所接收的IRPAPI函数的进程的进程ID被寄存(寄存的进程ID)。That is, in step S153, the process ID of the process corresponding to the IRPAPI function received by the filter core 53A in step S151 that has been called is registered (registered process ID).

如果在步骤S152中确定进程所请求的IRP不是具有指定为IOCTL的IOCTL_PD_SET_PROCESSID的IRP_MJ_DEVICE_CONTROL IRP,则进程转到步骤S154以确定IRP是否是具有指定为IOCTL的IOCTL_PD_DELETE_PROCESSID(图8)的IRP_MJ_DEVICE_CONTROL IRP。If it is determined in step S152 that the IRP requested by the process is not the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_SET_PROCESSID designated as the IOCTL, the process goes to step S154 to determine whether the IRP is the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_DELETE_PROCESSID (FIG. 8) designated as the IOCTL.

如果在步骤S154中确定IRP是具有指定为IOCTL的IOCTL_PD_DELETE_PROCESSID的IRP,则进程转到步骤S155。在步骤S155中,过滤器内核53A删除寄存的进程ID并等待另一个IRP。接着进程转到步骤S11。If it is determined in step S154 that the IRP is an IRP with IOCTL_PD_DELETE_PROCESSID designated as the IOCTL, the process goes to step S155. In step S155, the filter core 53A deletes the registered process ID and waits for another IRP. Then the process goes to step S11.

如果在步骤S154中确定IRP不是具有指定为IOCTL的IOCTL_PD_DELETE_PROCESSID的IRP,则进程转到步骤S156以确定IRP是否是具有指定为IOCTL的IOCTL_PD_PAUSE_PROCESSID(图13)的IRP_MJ_DEVICE_CONTROL IRP。If it is determined in step S154 that the IRP is not the IRP with the IOCTL_PD_DELETE_PROCESSID designated as the IOCTL, the process goes to step S156 to determine whether the IRP is the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_PAUSE_PROCESSID (FIG. 13) designated as the IOCTL.

如果在步骤S156中确定进程所请求的IRP是具有指定为IOCTL的IOCTL_PD_PAUSE_OTHERAPPIER的IRP,则进程转到步骤S157。在步骤S157中,过滤器内核53A设置暂停标志,其是一个为1的变量,表示中断状态,并等待另一个IRP。接着进程转到步骤S151。过滤器内核53A(PD过滤器53)接着在中断状态下运行。If it is determined in step S156 that the IRP requested by the process is the IRP with IOCTL_PD_PAUSE_OTHERAPPIER specified as the IOCTL, the process goes to step S157. In step S157, the filter core 53A sets the suspend flag, which is a variable of 1, indicating an interrupt status, and waits for another IRP. Then the process goes to step S151. The filter core 53A (PD filter 53 ) then operates in the interrupted state.

如果在步骤S156中确定进程所请求的IRP不是具有指定为IOCTL的IOCTL_PD_PAUSE_OTHERAPPIER的IRP,则进程转到步骤S158以确定进程请求的IRP是否是具有指定为IOCTL的IOCTL_PD_RUN_OTHERAPPIER(图13)的IRP_MJ_DEVICE_CONTROL IRP。If it is determined in step S156 that the IRP requested by the process is not the IRP with the IOCTL_PD_PAUSE_OTHERAPPIER designated as the IOCTL, the process goes to step S158 to determine whether the IRP requested by the process is the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_RUN_OTHERAPPIER (FIG. 13) designated as the IOCTL.

如果在步骤S158中确定进程所请求的IRP是具有指定为IOCTL的IOCTL_PD_RUN_OTHERAPPIER的IRP,则进程转到步骤S159。在步骤S159中,过滤器内核53A重设暂停标志为表示运行状态的0,并等待另一个IRP。接着进程转到步骤S151。过滤器内核53A接着在运行状态下运行。If it is determined in step S158 that the IRP requested by the process is the IRP with IOCTL_PD_RUN_OTHERAPPIER specified as the IOCTL, the process goes to step S159. In step S159, the filter core 53A resets the suspend flag to 0 indicating the running state, and waits for another IRP. Then the process goes to step S151. Filter core 53A then runs in the run state.

如果在步骤S158中确定进程所请求的IRP不是具有指定为IOCTL的IOCTL_PD_RUN_OTHERAPPIER的IRP,则进程转到步骤S160以确定IRP是否是表示对光盘3访问的请求的IRP。If it is determined in step S158 that the IRP requested by the process is not the IRP with IOCTL_PD_RUN_OTHERAPPIER specified as the IOCTL, the process goes to step S160 to determine whether the IRP is an IRP indicating a request for access to the optical disc 3 .

如果在步骤S160中确定进程请求的IRP不是表示访问请求的IRP,即,IRP为表示由PD过滤器53所设置的改变IRP优先级请求的具有指定为IOCTL的IOCTL_PD_SET_PRIORITY(图8)的IRP_MJ_DEVICE_CONTROL IRP或表示由PD过滤器53所设置的获取IRP优先级请求的具有指定为IOCTL的IOCTL_PD_GET_PRIORITY(图8)的IRP_MJ_DEVICE_CONTROL IRP,则进程转到步骤S161。在步骤S161中,如同图10中的步骤S57,过滤器内核53A基于IRP执行进程,并返回作为响应的进程结果给通过NT I/O管理器52和Win子系统51而调用了API函数的进程,并等待另一个IRP。接着进程返回步骤S151。If it is determined in step S160 that the IRP requested by the process is not an IRP representing an access request, that is, the IRP is an IRP_MJ_DEVICE_CONTROL IRP representing an IOCTL_PD_SET_PRIORITY ( FIG. 8 ) designated as an IOCTL that represents a request to change the IRP priority set by the PD filter 53 or An IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_GET_PRIORITY (FIG. 8) designated as an IOCTL representing a get IRP priority request set by the PD filter 53, the process goes to step S161. In step S161, like step S57 among Fig. 10, filter core 53A executes the process based on IRP, and returns the process result as response to the process that has called the API function through NT I/O manager 52 and Win subsystem 51 , and wait for another IRP. Then the process returns to step S151.

如果在步骤S160中确定进程请求的IRP是表示访问请求的IRP,即,IRP为表示读取文件请求的IRP_MJ_READ IRP或表示写入文件请求的IRP_MJ_WRITE IRP,则进程转到步骤S162。在步骤S162中,过滤器内核53A确定进程ID是否包含在进程所请求的IRP中,即,已经调用相应于该IRP的API函数的进程的进程ID是否与寄存的进程ID一致。If in step S160, determine that the IRP of process request is the IRP that represents access request, that is, IRP is the IRP_MJ_READ IRP that represents read file request or the IRP_MJ_WRITE IRP that represents write file request, then process goes to step S162. In step S162, the filter core 53A determines whether the process ID is included in the IRP requested by the process, that is, whether the process ID of the process that has called the API function corresponding to the IRP coincides with the registered process ID.

如果在步骤S162中确定包含在进程所请求的 RP中的进程ID与寄存的进程ID不一致,则进程转到步骤S163。在步骤S163中,过滤器内核53A为进程请求的IRP设置最低的IRP优先级,同时进程转到步骤S165。If it is determined in step S162 that the process ID contained in the RP requested by the process is inconsistent with the registered process ID, the process goes to step S163. In step S163, the filter core 53A sets the lowest IRP priority for the IRP requested by the process, and the process goes to step S165.

如果在步骤S162中确定包含在进程所请求的IRP中的进程ID与寄存的进程ID一致,则进程转到步骤S164。在步骤S164中,过滤器内核53A为进程请求的IRP设置最高的IRP优先级,同时进程转到步骤S165。If it is determined in step S162 that the process ID contained in the IRP requested by the process coincides with the registered process ID, the process goes to step S164. In step S164, the filter core 53A sets the highest IRP priority for the IRP requested by the process, and the process goes to step S165.

在步骤S165中,过滤器内核53A输出提供有由在步骤S163或S164中设置的IRP优先级的IRP给队列81并将其存储在其中,同时等待另一个IRP。接着进程转到步骤S151。In step S165, the filter core 53A outputs the IRP provided with the IRP priority set in step S163 or S164 to the queue 81 and stores it therein while waiting for another IRP. Then the process goes to step S151.

由图6所示执行第二功能的PD过滤器53存储于队列81上的IRP所执行的进程(用于从队列81输出一个IRP的进程)将在以下参考图16的流程图来描述。The process performed by the IRP stored on the queue 81 by the PD filter 53 performing the second function shown in FIG. 6 (the process for outputting an IRP from the queue 81) will be described below with reference to the flowchart of FIG.

在PD过滤器53中,在步骤S171中,过滤器内核53A确定暂停标志是否设置为1。In the PD filter 53, in step S171, the filter core 53A determines whether the suspend flag is set to 1 or not.

如果在步骤S171中确定暂停标志设置为1,即,PD过滤器53处于中断状态,则进程转到步骤S172以确定是否为队列81设置最高的IRP优先级。If it is determined in step S171 that the suspend flag is set to 1, that is, the PD filter 53 is in the interrupted state, the process goes to step S172 to determine whether the highest IRP priority is set for the queue 81 .

如果在步骤S172中为队列81设置最高的IRP优先级,即,具有与寄存的进程ID一致的进程ID的进程所请求的IRP存储在队列81中,则进程转到步骤S173中。在步骤S173中,过滤器内核53A处理存储在队列81中具有最高IRP优先级的IRP,同时进程返回到步骤S171。也就是说,在步骤S173中,过滤器内核53A从队列81读取具有最高IRP优先级的IRP并通过NT I/O管理器52将其输出到PD_FS 54。If the highest IRP priority is set for the queue 81 in step S172, ie, an IRP requested by a process having a process ID identical to the registered process ID is stored in the queue 81, the process goes to step S173. In step S173, the filter core 53A processes the IRP having the highest IRP priority stored in the queue 81, and the process returns to step S171. That is, in step S173, the filter core 53A reads the IRP with the highest IRP priority from the queue 81 and outputs it to the PD_FS 54 through the NT I/O manager 52.

如果在步骤S172中确定具有最高IRP优先级的IRP没有存储在队列81中,即,具有与寄存的进程ID一致的进程ID的进程所请求的IRP没有存储在队列81中,则进程跳过步骤S173而返回到步骤S171。If it is determined in step S172 that the IRP with the highest IRP priority is not stored in the queue 81, that is, the IRP requested by the process with the process ID consistent with the registered process ID is not stored in the queue 81, the process skips the step S173 and return to step S171.

因此,如果PD过滤器53处于中断状态,则由具有与所寄存的进程ID不同的进程ID的进程所请求的IRP不会输出到PD_FS 54。Therefore, if the PD filter 53 is in the interrupted state, an IRP requested by a process having a process ID different from the registered process ID is not output to the PD_FS 54.

如果在步骤S171中确定暂停标志重新复位为0,即PD过滤器53处于运行状态,则进程转到步骤S174。If it is determined in step S171 that the suspend flag is reset to 0 again, that is, the PD filter 53 is in the running state, the process goes to step S174.

更具体地,如同步骤S71,在步骤S174中,过滤器内核53A从存储在队列81中的IRP中寻找最高的IRP优先级。More specifically, like step S71 , in step S174 , the filter core 53A searches for the highest IRP priority among the IRPs stored in the queue 81 .

如同步骤S72,在步骤S175中,过滤器内核53A处理在步骤S174中寻找到的具有最高IRP优先级的IRP,同时进程转到步骤S171。更具体地,在步骤S175中,过滤器内核53A优先从队列81中读取具有最高IRP优先级的IRP并通过NT I/O管理器52将其输出到PD_FS 54。Like step S72, in step S175, the filter core 53A processes the IRP with the highest IRP priority found in step S174, while the process goes to step S171. More specifically, in step S175, the filter core 53A preferentially reads the IRP with the highest IRP priority from the queue 81 and outputs it to the PD_FS 54 through the NT I/O manager 52.

因此,当PD过滤器53处于运行状态时,如在图11中,PD过滤器53从队列81中读取IRP并将其输出到PD_FS 54。Therefore, when the PD filter 53 is in the running state, as in FIG. 11 , the PD filter 53 reads the IRP from the queue 81 and outputs it to the PD_FS 54.

如上所论述的,在PD过滤器53中,为具有与所寄存的进程ID相同的进程ID的进程设置最高的IRP优先级,而为具有与所寄存的进程ID不同的进程ID的进程设置最低的IRP优先级。As discussed above, in the PD filter 53, the highest IRP priority is set for a process with the same process ID as the registered process ID, and the lowest is set for a process with a different process ID than the registered process ID. The IRP priority.

PD过滤器53存储由在队列81中的IRP优先级所提供的IRP。如果PD过滤器53处于运行状态,则根据IRP优先级处理存储在队列81中的IRP。如果PD过滤器53处于中断状态,则在存储于队列81中的IRP中仅仅处理最高IRP优先级所提供的IRP,即,具有与所寄存的进程ID相同的进程ID的进程所请求的IRP。The PD filter 53 stores the IRPs provided by the IRP priorities in the queue 81 . If the PD filter 53 is in the running state, the IRPs stored in the queue 81 are processed according to the IRP priority. If the PD filter 53 is in the interrupt state, only the IRP provided by the highest IRP priority, that is, the IRP requested by the process having the same process ID as the registered process ID, is processed among the IRPs stored in the queue 81 .

因此,在AV应用程序33(图6)中,由进程75所加载的PD_API 41请求PD过滤器53寄存器进程75的进程ID。因此,当AV应用程序33记录或播放AV数据时,PD_API 41请求PD过滤器53处于中断状态。根据这样的安排,在PD过滤器53中,为PD_API 41的进程75所请求的IRP设置最高的IRP优先级,同时只有最高IRP优先级提供的IRP,即,只是PD_API 41的进程75所请求的IRP,能被处理和输出给PD_FS 54。Therefore, in the AV application 33 (FIG. 6), the PD_API 41 loaded by the process 75 requests the PD filter 53 to register the process ID of the process 75. Therefore, when the AV application 33 records or plays AV data, the PD_API 41 requests the PD filter 53 to be in an interrupted state. According to this arrangement, in the PD filter 53, the highest IRP priority is set for the IRP requested by the process 75 of the PD_API 41, and only the IRP provided with the highest IRP priority, i.e., only the one requested by the process 75 of the PD_API 41 IRP, can be processed and output to PD_FS 54.

因此,只处理PD_API 41的进程75所请求的IRP。这样,就不需要AV应用程序33等待直到关于来自应用程序31或32的IRP处理完成或由应用程序31或32的IRP的进程在驱动器2上产生一个寻址请求。从而,能阻止AV应用程序33从光盘3读取数据或向光盘3写入数据的中断,因此,AV数据能实时地将AV数据记录在光盘3上或从光盘3上播放。Therefore, only IRPs requested by process 75 of PD_API 41 are processed. Thus, there is no need for the AV application 33 to wait until processing of the IRP from the application 31 or 32 is completed or an address request is generated on the drive 2 by the progress of the IRP from the application 31 or 32. Thereby, the interruption of the AV application 33 reading data from or writing data to the optical disc 3 can be prevented, and therefore, AV data can be recorded on or played back from the optical disc 3 in real time.

根据第一功能,如果PD_API 41的进程75所请求的IRP没有存储在队列81中,则应用程序31和32的IRP可能从PD过滤器53输出到PD_FS 54。相反地,根据第二功能,如果PD过滤器53设置为中断状态,则即便当PD_API41的进程75所请求的IRP没有存储在队列81中,应用程序31和32的IRP也不会从PD过滤器53输出到PD_FS 54。According to the first function, if the IRP requested by the process 75 of the PD_API 41 is not stored in the queue 81, the IRPs of the applications 31 and 32 may be output from the PD filter 53 to the PD_FS 54. Conversely, according to the second function, if the PD filter 53 is set to the interrupt state, even when the IRP requested by the process 75 of the PD_API41 is not stored in the queue 81, the IRPs of the applications 31 and 32 will not be received from the PD filter. 53 output to PD_FS 54.

在图15和16的流程图中,在PD过滤器53处于中断状态时,只有最高IRP优先级所提供的IRP作为特定的IRP输出给PD_FS 54。可选地,只有具有与所寄存的进程ID一致的进程ID的IRP才可以作为特定的IRP输出到PD_FS 54。即,在PD过滤器53中,只有与所寄存的进程ID相同的IRP才可以输出到PD_FS 54而无需设置IRP优先级。In the flowcharts of FIGS. 15 and 16, when the PD filter 53 is in the interrupt state, only the IRP provided by the highest IRP priority is output to the PD_FS 54 as a specific IRP. Alternatively, only IRPs with process IDs consistent with registered process IDs can be output to PD_FS 54 as specific IRPs. That is, in the PD filter 53, only the IRPs identical to the registered process ID can be output to the PD_FS 54 without setting the IRP priority.

用于可靠而实时地读取和写入AV数据的PD第三功能将在过滤器53的以下描述。The PD third function for reliably and real-time reading and writing of AV data will be described below of the filter 53 .

更具体地,根据第三功能,PD过滤器53具有一个一个用来打开或关闭除了AV应用程序33外,即,来自应用程序31和32,的应用程序的IRP的输出到PD_FS 54的功能开关,从而阻止应用程序31或32的IRP输出到PD_FS54。通过使用该功能,PD过滤器53向PD_FS 54只输出AV应用程序33的IRP而不输出应用程序31或32的IRP,从而确保了AV应用程序33能实时地读取和写入AV数据。More specifically, according to the third function, the PD filter 53 has a function switch for turning on or off the output of IRPs of applications other than the AV application 33, that is, from the applications 31 and 32, to the PD_FS 54 , thereby preventing the IRP of the application program 31 or 32 from outputting to the PD_FS54. By using this function, the PD filter 53 outputs only the IRP of the AV application 33 and not the IRP of the application 31 or 32 to the PD_FS 54, thereby ensuring that the AV application 33 can read and write AV data in real time.

图17示出了执行上述第三功能的PD过滤器53的结构实例。FIG. 17 shows a structural example of the PD filter 53 that performs the third function described above.

在图17中,PD过滤器53的过滤器内核53A具有一个用来打开或关闭应用程序31或32的IRP向PD_FS 54输出的开关101。In FIG. 17, the filter core 53A of the PD filter 53 has a switch 101 for turning on or off the output of the IRP of the application program 31 or 32 to the PD_FS 54.

当OS 30运行或当光盘3安置在驱动器2中时,开关101根据存储在寄存器58中的开关设置信息打开或关闭。在相应于驱动器2的卷安置好后很难改变开关101的状态。When the OS 30 is running or when the optical disc 3 is set in the drive 2, the switch 101 is turned on or off according to the switch setting information stored in the register 58. It is difficult to change the state of the switch 101 after the volume corresponding to the drive 2 is installed.

当AV应用程序33安装时开关设置信息存储在寄存器58中。也就是说,当安装AV应用程序33时,引导用户来选择是否将开关101打开或关闭。用户所选择的开关101的状态存储在寄存器58中作为开关设置信息。存储在寄存器58中的开关设置信息可以在安装AV应用程序33之后为AV应用程序33在选择屏幕上进行改变。The switch setting information is stored in the register 58 when the AV application 33 is installed. That is, when the AV application 33 is installed, the user is guided to select whether to turn the switch 101 on or off. The state of the switch 101 selected by the user is stored in the register 58 as switch setting information. The switch setting information stored in the register 58 can be changed on the selection screen for the AV application 33 after the AV application 33 is installed.

当打开开关101时,PD过滤器53向PD_FS 54输出所有的应用程序(图17中的应用程序31到33)的IRP。When the switch 101 is turned on, the PD filter 53 outputs the IRPs of all the applications (applications 31 to 33 in FIG. 17 ) to the PD_FS 54.

当开关101关闭时,PD过滤器53只从AV应用程序33的PD_API 41输出IRP,并对其它的应用程序31和32屏相应于蔽安置在驱动器2中的光盘3的卷上的文件系统,从而阻止应用程序31或32的IRP输出到PD_FS 54。When the switch 101 was closed, the PD filter 53 only output the IRP from the PD_API 41 of the AV application program 33, and screened the file system on the volume of the optical disc 3 installed in the drive 2 correspondingly to other application programs 31 and 32, Thereby preventing the IRP of the application program 31 or 32 from outputting to the PD_FS 54.

在这种情况下,为了响应除了PD_API 41外其它进程来的IRP,开关101返回状态值,其表示虽然卷已安置好,但仅仅能读取而在卷中并无文件或目录。In this case, in response to IRPs from other processes except PD_API 41, switch 101 returns a status value, which represents that although the volume has been placed, it can only be read and there are no files or directories in the volume.

根据这样的结构,当开关101关闭时,安置在驱动器2中的光盘3作为不提供文件或目录的卷来处理因此很难停止,拒绝,或格式化

Figure C20051007930000341
浏览器上的文件。According to such a structure, when the switch 101 is turned off, the optical disc 3 set in the drive 2 is handled as a volume that does not provide files or directories so it is difficult to stop, reject, or format.
Figure C20051007930000341
file on the browser.

现参考图18的流程图描述使用第三功能的在图17中示出的PD过滤器53所进行的处理。Processing performed by the PD filter 53 shown in FIG. 17 using the third function will now be described with reference to the flowchart of FIG. 18 .

当OS 30开始或当光盘3安置在驱动器2中时,在步骤S191中,过滤器内核53A从寄存器58获取开关设置信息。When the OS 30 starts or when the optical disc 3 is set in the drive 2, the filter core 53A acquires switch setting information from the register 58 in step S191.

在步骤S192中,过滤器内核53A根据开关设置信息打开或关闭开关101。In step S192, the filter core 53A turns on or off the switch 101 according to the switch setting information.

过滤器内核53A接着等待应用程序31到33之一的一个IRP,并在步骤S193中接收该IRP。The filter core 53A then waits for an IRP from one of the application programs 31 to 33, and receives the IRP in step S193.

在步骤S194中,过滤器内核53A确定在步骤S193中接收的IRP是否是AV应用程序33的PD_API 41的一个IRP。如果在S194中确定在步骤S193中接收到的IRP是来自AV应用程序33的IRP,则进程转到步骤S195。在步骤S195中,过滤器内核53A输出该IRP给PD_FS 54并等待来自应用程序31到33之一中的另一个IRP。接着进程转到步骤S193。In step S194, the filter core 53A determines whether the IRP received in step S193 is an IRP of the PD_API 41 of the AV application 33. If it is determined in S194 that the IRP received in step S193 is the IRP from the AV application 33, the process goes to step S195. In step S195, the filter core 53A outputs the IRP to the PD_FS 54 and waits for another IRP from one of the applications 31 to 33. Then the process goes to step S193.

如果在S194中确定在步骤S913中接收到的IRP不是来自AV应用程序33的IRP,即,在步骤S193中接收到的IRP来自于应用程序31或32,则进程转到步骤S196以确定开关101是否关闭。If it is determined in S194 that the IRP received in step S913 is not the IRP from the AV application 33, that is, the IRP received in step S193 is from the application 31 or 32, then the process goes to step S196 to determine that the switch 101 Whether to close.

如果在步骤S196中确定开关101不是关闭的,即,开关101是打开的,则进程转到步骤S195。在步骤S195中,过滤器内核53A输出在步骤S193中接收到的IRP给PD_FS 54并等待另一个来自于应用程序31到33之一的IRP。接着进程转到步骤S193。If it is determined in step S196 that the switch 101 is not off, that is, the switch 101 is on, the process goes to step S195. In step S195, the filter core 53A outputs the IRP received in step S193 to the PD_FS 54 and waits for another IRP from one of the applications 31 to 33. Then the process goes to step S193.

如果在步骤S196中确定开关101是关闭的,则进程转到步骤S197。在步骤S197中,开关101返回一个文件系统的匿名回复,在其中文件系统是匿名的,即,对应用程序31或32来说表示虽然安装了卷,但在读取时无无文件或目录的状态,其是在步骤S193中接收到的IRP的输出源。接着开关101等待另一个来自于应用程序31到33之一的IRP。接着进程转到步骤S193,此时进程做类似地重复。If it is determined in step S196 that the switch 101 is off, the process goes to step S197. In step S197, the switch 101 returns an anonymous reply of the file system, in which the file system is anonymous, that is, to the application 31 or 32, indicating that although the volume is mounted, there is no file or directory when reading. Status, which is the output source of the IRP received in step S193. The switch 101 then waits for another IRP from one of the applications 31-33. Then the process goes to step S193, at which time the process is similarly repeated.

如上所述,在PD过滤器53中,当开关101关闭时,只有应用程序33的IRP输出到PD_FS 54。这样,就不必让AV应用程序33一直等到关于应用程序31或32的IRP处理完成或由应用程序31或32的IRP的进程在驱动器2上产生一个寻址请求。因此,能阻止AV应用程序33从光盘3读取数据或向光盘3写入数据的中断,因此,AV数据能实时地将AV数据记录在光盘3上或从光盘3上播放。As described above, in the PD filter 53, when the switch 101 is closed, only the IRP of the application 33 is output to the PD_FS 54. Thus, there is no need for the AV application 33 to wait until the processing of the IRP with respect to the application 31 or 32 is completed or an address request is generated on the drive 2 by the progress of the IRP of the application 31 or 32. Therefore, the interruption of the AV application 33 reading data from or writing data to the optical disc 3 can be prevented, and therefore, AV data can be recorded on or played back from the optical disc 3 in real time.

在步骤S194中关于是否IRP是AV应用程序33的IRP的确定可以预先通过将进程75的进程ID寄存在PD过滤器53中以及确定该IRP的进程ID是否与所寄存的进程ID一致而进行确定。The determination as to whether the IRP is the IRP of the AV application 33 in step S194 may be determined in advance by registering the process ID of the process 75 in the PD filter 53 and determining whether the process ID of the IRP coincides with the registered process ID. .

在上述描述的实施例中,第一到第三功都能在PD过滤器53中执行。但其也可以在PD_FS 54中执行。In the embodiments described above, the first to third functions can all be performed in the PD filter 53 . But it can also be implemented in PD_FS 54.

PD_FS 54(图4)执行为使用用于由IRP从PD过滤器53请求的数据的NT高速缓存管理器59的高速缓存功能而请求的高速缓存处理,如图5中的步骤S4所论述的。The PD_FS 54 ( FIG. 4 ) performs the cache processing requested for using the caching function of the NT cache manager 59 for data requested by the IRP from the PD filter 53, as discussed in step S4 in FIG. 5 .

如果来自PD过滤器53的IRP所请求的数据高速缓存在NT高速缓存管理器59中,则其从PD_FS 54返回到PD过滤器53。如果来自PD过滤器53的IRP所请求的数据没有高速缓存在NT高速缓存管理器59中,则其从PD_FS 54输出到PD存储器55。If the data requested by the IRP from PD Filter 53 is cached in NT Cache Manager 59, it is returned from PD_FS 54 to PD Filter 53. If the data requested by the IRP from PD Filter 53 is not cached in NT Cache Manager 59, it is output from PD_FS 54 to PD Memory 55.

因此,如由果IRP所请求的数据高速缓存在NT高速缓存管理器59中,则该高速缓存进程会产生一个额外的开销,即,通过执行该高速缓存进程的例程,由CPU 12(图2)将其与PC 1对照而无需高速缓存功能。Therefore, if the data cache requested by the IRP is cached in the NT cache manager 59, then the cache process will generate an additional overhead, that is, by executing the routine of the cache process, by the CPU 12 (FIG. 2) Contrast it with PC 1 without caching capabilities.

该开销延迟了从PD_FS 54到PD存储器55的IRP的输出,这进一步阻止了实时地记录或播放AV数据。因此需要在从AV应用程序33输出IRP时不产生延迟。This overhead delays the output of the IRP from the PD_FS 54 to the PD memory 55, which further prevents recording or playback of AV data in real time. Therefore, it is necessary that no delay occurs when outputting the IRP from the AV application 33 .

这样的延迟可以通过不使用高速缓存功能而阻止。Such delays can be prevented by not using the cache function.

如果根本不使用高速缓存功能,则来自PD过滤器53的所有IRP都会从PD_FS 54输出到PD存储器55。即,来自应用程序31到33来的所有IRP都会通过PD_FS 54从PD过滤器53输出到PD存储器55。If the cache function is not used at all, all IRPs from the PD filter 53 will be output from the PD_FS 54 to the PD memory 55. That is, all IRPs from applications 31 to 33 will be output from PD filter 53 to PD memory 55 through PD_FS 54.

更具体地,在这种情况下,不仅是来自AV应用程序33的IRP,而且来自AV应用程序33之外其它应用程序,即,来自应用程序31和32的IRP也会通过PD_FS 54从PD过滤器53输出到PD存储器55。这样,就会由于读取由应用程序31或32所请求的数据而产生一个寻址。More specifically, in this case, not only IRPs from AV application 33, but also from applications other than AV application 33, i.e., IRPs from applications 31 and 32 are also filtered from PD via PD_FS 54 The device 53 outputs to the PD memory 55. Thus, an addressing will result from reading the data requested by the application 31 or 32 .

该寻址的产生妨碍了实时读取来自AV应用程序33的IRP的AV数据。The occurrence of this addressing prevents real-time reading of AV data from the IRP of the AV application 33 .

当使用高速缓存功能时,如果来自应用程序31或32的IRP所请求的数据高速缓存在NT高速缓存管理器59中,则所高速缓存的数据从PD_FS 54返回到PD过滤器53。在这种情况下,能阻止由从光盘3读取来自应用程序31或32的IRP所请求的数据在驱动器2上所产生的寻址。When using the cache function, if the data requested by the IRP from the application 31 or 32 is cached in the NT cache manager 59, the cached data is returned from the PD_FS 54 to the PD filter 53. In this case, the addressing generated on the drive 2 by reading the data requested by the IRP from the application program 31 or 32 from the optical disc 3 can be prevented.

这样,在AV应用程序33中,由执行高速缓存处理而产生的延迟能通过不使用高速缓存功能而防止。结果,能更好地实时记录或播放AV数据。Thus, in the AV application 33, a delay caused by performing cache processing can be prevented by not using the cache function. As a result, AV data can be better recorded or played back in real time.

相反地,在除了AV应用程序33外的应用程序31和32中,由于使用了高速缓存功能而导致了在驱动器2中的寻址的减少。结果,也能提高实时地记录或播放AV数据。In contrast, in the applications 31 and 32 other than the AV application 33, the addressing in the drive 2 is reduced due to the use of the cache function. As a result, it is also possible to record or play back AV data with improved real-time.

因此,在PD过滤器53中,来自应用程序31和32的IRP通过使用高速缓存功能而处理。另一方面,对于来自AV应用程序33的IRP,执行用于设置是否使用高速缓存功能的高速缓存器ON/OFF功能以便来自AV应用程序33的IRP能根据高速缓存功能的设置值来进行处理。Therefore, in the PD filter 53, IRPs from the applications 31 and 32 are processed by using the cache function. On the other hand, for the IRP from the AV application 33, a cache ON/OFF function for setting whether to use the cache function is performed so that the IRP from the AV application 33 can be processed according to the setting value of the cache function.

图19图示了执行该高速缓存器ON/OFF功能的PD过滤器53的结构的一个实例。FIG. 19 illustrates an example of the structure of the PD filter 53 that performs this cache ON/OFF function.

该高速缓存器ON/OFF功能仅仅提供给AV应用程序33,其加载PD_API 41,并且应用程序31和32总是使用该高速缓存功能。即,该高速缓存器ON/OFF功能与应用程序31和32相关。因此,图19中仅仅示出了提供高速缓存器ON/OFF功能的AV应用程序33。This cache ON/OFF function is provided only to the AV application 33, which loads the PD_API 41, and the applications 31 and 32 always use this cache function. That is, the cache ON/OFF function is associated with the application programs 31 and 32 . Therefore, only the AV application 33 providing the cache ON/OFF function is shown in FIG. 19 .

在图19中,PD过滤器53具有一个命令缓冲器111。该命令缓冲器111暂时存储来自AV应用程序33的PD_API 41中的IRP,即,从NT I/O管理器52输出IRP作为由PD_API 41调用API函数的结果。In FIG. 19 , the PD filter 53 has a command buffer 111 . The command buffer 111 temporarily stores the IRP in the PD_API 41 from the AV application 33, that is, the IRP output from the NT I/O manager 52 as a result of calling the API function by the PD_API 41.

在图19所示的PD过滤器53中,过滤器内核53A设置高速缓存功能是否由AV应用程序33的PD_API 41来使用,并根据所设置的结果处理来自存储在命令缓冲器111中的AV应用程序33中的IRP。In the PD filter 53 shown in FIG. 19 , the filter core 53A sets whether the cache function is used by the PD_API 41 of the AV application 33, and processes the AV application from the command buffer 111 according to the set result. IRP in program 33.

更具体地,如果使用高速缓存功能,则过滤器内核53A控制向PD_FS 54输出存储在命令缓冲器111中的AV应用程序33中的IRP以便在PD_FS 54中使用高速缓存功能。More specifically, if the cache function is used, the filter core 53A controls output to the PD_FS 54 of the IRP stored in the AV application 33 in the command buffer 111 in order to use the cache function in the PD_FS 54.

如果没有使用高速缓存功能,则过滤器内核53A控制向PD_FS 54输出来自存储在命令缓冲器111中的AV应用程序33中的IRP以便IRP直接输出给PD存储器而无需使用在PD_FS 54中的高速缓存功能。If the cache function is not used, the filter core 53A controls to output to the PD_FS 54 the IRP from the AV application 33 stored in the command buffer 111 so that the IRP is directly output to the PD memory without using the cache in the PD_FS 54 Function.

图20示出了当使用缓存器ON/OFF功能时用于让PD_API 41控制PD过滤器53的API函数。该API函数被输出到AV应用程序33。FIG. 20 shows an API function for letting the PD_API 41 control the PD filter 53 when the buffer ON/OFF function is used. This API function is output to the AV application 33 .

在图20中,API函数包括四个函数,即,PdOpenFile()、PdcloseFile()、PdReadFile(),和PdWriteFile()。In FIG. 20, the API functions include four functions, namely, PdOpenFile(), PdcloseFile(), PdReadFile(), and PdWriteFile().

以上所述的四个函数都是用来执行文件处理的文件流API函数。API函数与在Win32子系统51中所提供的那四个函数类似。The four functions described above are all file stream API functions used to perform file processing. The API functions are similar to those four functions provided in the Win32 subsystem 51 .

也就是说,PD_API 41分别把由Win32子系统51所提供的文件流API函数提供给了唯一的文件流API函数,例如PdOpenFile()、PdCloseFile()、PdReadFile(),和PdWriteFile()。That is, the PD_API 41 provides the file stream API functions provided by the Win32 subsystem 51 to unique file stream API functions, such as PdOpenFile(), PdCloseFile(), PdReadFile(), and PdWriteFile(), respectively.

API函数PdOpenFile()为一个表示打开文件请求的API函数,它使用作为参数的要打开的文件的文件名(包括路径名),文件打开时的打开模式(例如,只读模式),以及表示是否使用高速缓存功能的高速缓存信息作为参数。The API function PdOpenFile() is an API function representing a request to open a file. It uses as parameters the file name (including the path name) of the file to be opened, the opening mode (for example, read-only mode) when the file is opened, and whether Use the cache information of the cache function as an argument.

通过指定作为参数的文件名,打开模式,以及高速缓存信息调用API函数PdOpenFile(),可以以由参数所指定的打开模式打开由参数指定的文件名的文件。此外,API函数PdOpenFile()允许PD过滤器53的过滤器内核53A根据作为参数的高速缓存信息而设置是否使用高速缓存功能。在API函数PdOpenFile()中,当成功打开文件时,打开的文件的文件句柄作为返回值而返回,而当打开文件失败时,将0xffffffff作为返回值返回。0x表示以后的值为十六进制。By calling the API function PdOpenFile() by specifying the file name, open mode, and cache information as parameters, the file with the file name specified by the parameter can be opened in the open mode specified by the parameter. Furthermore, the API function PdOpenFile( ) allows the filter core 53A of the PD filter 53 to set whether to use the cache function according to the cache information as a parameter. In the API function PdOpenFile(), when the file is successfully opened, the file handle of the opened file is returned as the return value, and when the file fails to be opened, 0xffffffff is returned as the return value. 0x indicates that the subsequent values are in hexadecimal.

API函数PdCloseFile()为表示关闭文件请求的API函数,它使用要关闭的文件的文件句柄作为参数。通过指定作为参数的要关闭的文件的句柄而调用API函数PdCloseFile(),可以关闭由文件句柄所指定的文件。在API函数PdCloseFile()中,当成功关闭文件时,将返回1作为返回值,而当关闭文件失败时,返回0作为返回值。The API function PdCloseFile() is an API function representing a request to close a file, and it uses the file handle of the file to be closed as a parameter. The file specified by the file handle can be closed by calling the API function PdCloseFile() by specifying the handle of the file to be closed as a parameter. In the API function PdCloseFile(), when the file is successfully closed, 1 will be returned as the return value, and when the file close fails, 0 will be returned as the return value.

API函数PdReadFile()为表示从一个文件读取数据的请求的API函数,它使用要从其中读取数据的文件的文件句柄、指向暂时存储从文件中读出的数据的缓冲器的缓冲器指针,以及表示从文件中读取的数据的尺寸的字节数作为参数。通过指定作为参数的文件句柄、缓冲器指针,和字节数而调用API函数PdReadFile(),能读取由文件句柄所指定的文件的所指定的字节数的数据并将其存储在由缓冲器指针所指向的存储区域中。在API函数PdReadFile()中,当成功读取数据时,将读取的数据的字节数作为返回值返回,当读取数据失败时,将0作为返回值返回。API函数PdReadFile()响应Win32子系统51所提供的API函数PdReadFile()。The API function PdReadFile() is an API function representing a request to read data from a file, and it uses a file handle of a file from which data is to be read, a buffer pointer pointing to a buffer temporarily storing data read from the file , and a number of bytes representing the size of the data to read from the file as an argument. By calling the API function PdReadFile() by specifying the file handle, buffer pointer, and number of bytes as parameters, the data of the specified number of bytes of the file specified by the file handle can be read and stored in the buffer in the storage area pointed to by the register pointer. In the API function PdReadFile(), when the data is read successfully, the number of bytes of the read data is returned as the return value, and when the data read fails, 0 is returned as the return value. The API function PdReadFile() responds to the API function PdReadFile() provided by the Win32 subsystem 51 .

API函数PdWriteFile()是表示将数据写入到一个文件中的请求的API函数,它使用将要写入数据的文件的文件句柄、指向用于暂时存储要写入文件的数据的缓冲器的缓冲器指针,以及表示要写入文件的数据的尺寸的字节数作为参数。通过通过指定作为参数的文件句柄、缓冲器指针,和字节数而调用API函数PdWriteFile(),能写入由文件句柄所指定的文件的所指定的字节数的数据并将其存储在由缓冲器指针所指向的存储区域中。在API函数PdWriteFile()中,当成功读取数据时,将读取的数据的字节数作为返回值返回,当读取数据失败时,将0作为返回值返回。API函数PdWriteFile()响应Win32子系统51所提供的API函数PdWriteFile()。The API function PdWriteFile() is an API function indicating a request to write data into a file, and it uses a file handle of the file to be written to, a buffer pointing to a buffer for temporarily storing data to be written to the file pointer, and as arguments a number of bytes representing the size of the data to be written to the file. By calling the API function PdWriteFile() by specifying the file handle, buffer pointer, and number of bytes as parameters, data of the specified number of bytes of the file specified by the file handle can be written and stored in the file specified by the file handle. In the memory area pointed to by the buffer pointer. In the API function PdWriteFile(), when the data is successfully read, the number of bytes of the read data is returned as the return value, and when the reading of the data fails, 0 is returned as the return value. The API function PdWriteFile( ) responds to the API function PdWriteFile( ) provided by the Win32 subsystem 51 .

当调用API函数PdOpenFile()、PdCloseFile()、PdReadFile(),或PdWriteFile()时,PD_API 41调用相应的由Win32子系统51所提供的API函数DeviceIoControl()。When calling the API functions PdOpenFile(), PdCloseFile(), PdReadFile(), or PdWriteFile(), the PD_API 41 calls the corresponding API function DeviceIoControl() provided by the Win32 subsystem 51.

接着,Win32子系统51输出一个请求给NT I/O管理器52来响应API函数DeviceIoControl(),而NT I/O管理器52将该请求转换成IRP_MJ_DEVICE_CONTROL IRP并将其提供给PD过滤器53。Next, the Win32 subsystem 51 outputs a request to the NT I/O manager 52 in response to the API function DeviceIoControl(), and the NT I/O manager 52 converts the request into an IRP_MJ_DEVICE_CONTROL IRP and provides it to the PD filter 53.

如上所示,在IRP_MJ_DEVICE_CONTROL中,IOCTL由用户定义的子码而指定。As shown above, in IRP_MJ_DEVICE_CONTROL, IOCTL is specified by user-defined subcode.

图21图示了当调用PdOpenFile()、PdCloseFile()、PdReadFile(),和PdWriteFile()时,由IRP_MJ_DEVICE_CONTROL所指定的用户所定义的IOCTL。Figure 21 illustrates the user-defined IOCTL specified by IRP_MJ_DEVICE_CONTROL when PdOpenFile(), PdCloseFile(), PdReadFile(), and PdWriteFile() are called.

在图21中,四个IOCTL(子码)即,图20所示的分别相应于API函数的PdOpenFile()、PdCloseFile()、PdReadFile(),和PdWriteFile()的IOCTL_PD_OPEN_FILE、IOCTL_PD_CLOSE_FILE、IOCTL_PD_READ_FILE,和IOCTL_PD_WRITE_FILE都可以作为用户定义的IOCTL。In FIG. 21, four IOCTLs (subcodes), namely, IOCTL_PD_OPEN_FILE, IOCTL_PD_CLOSE_FILE, IOCTL_PD_READ_FILE, and IOCTL_PD_WRITE_FILE corresponding to PdOpenFile(), PdCloseFile(), PdReadFile(), and PdWriteFile() of the API functions shown in FIG. 20 Both can be used as user-defined IOCTL.

IOCTL_PD_OPEN_FILE为IOCTL,其是一个与响应API函数PdOpenFile()而调用的请求打开一个文件的API函数DeviceIoControl()相关联的IRP_MJ_DEVICE_CONTROL IRP的子码。IOCTL_PD_OPEN_FILE is an IOCTL that is a subcode of the IRP_MJ_DEVICE_CONTROL IRP associated with the API function DeviceIoControl() that requests to open a file called in response to the API function PdOpenFile().

IOCTL_PD_CLOSE_FILE为IOCTL,其是一个与响应API函数PdCloseFile()而调用的请求关闭一个文件的API函数DeviceIoControl()相关联的IRP_MJ_DEVICE_CONTROL IRP的子码。IOCTL_PD_CLOSE_FILE is an IOCTL that is a subcode of the IRP_MJ_DEVICE_CONTROL IRP associated with the API function DeviceIoControl() that requests to close a file called in response to the API function PdCloseFile().

IOCTL_PD_READ_FILE为IOCTL,其是一个与响应API函数PdReadFile()而调用的请求读取一个文件的API函数DeviceIoControl()相关联的IRP_MJ_DEVICE_CONTROL IRP的子码。IOCTL_PD_READ_FILE is an IOCTL that is a subcode of the IRP_MJ_DEVICE_CONTROL IRP associated with the API function DeviceIoControl() that requests to read a file called in response to the API function PdReadFile().

IOCTL_PD_WRITE_FILE为IOCTL,其是一个与响应API函数PdWriteFile()而调用的请求将数据写入一个文件的API函数DeviceIoControl()相关联的IRP_MJ_DEVICE_CONTROL IRP的子码。IOCTL_PD_WRITE_FILE is an IOCTL that is a subcode of the IRP_MJ_DEVICE_CONTROL IRP associated with the API function DeviceIoControl() that requests data to be written to a file called in response to the API function PdWriteFile().

如上所描述的,用户所定义的IRP_MJ_DEVICE_CONTROL IRP的子码IOCTL,通过使用由Win32子系统51所提供的API函数DeviceIoControl()而发送到NT I/O管理器52并由NT I/O管理器52指定为IRP_MJ_DEVICE_CONTROL IRP的子码。As described above, the subcode IOCTL of the IRP_MJ_DEVICE_CONTROL IRP defined by the user is sent to the NT I/O manager 52 by using the API function DeviceIoControl () provided by the Win32 subsystem 51 and is controlled by the NT I/O manager 52 Specified as a subcode of the IRP_MJ_DEVICE_CONTROL IRP.

在过滤器53执行高速缓存器ON/OFF功能时,AV应用程序33的全部进程,图19所示的PD_API 41、PD过滤器53,以及PD_FS 54将在以下参考图22的流程图进行描述。When the filter 53 performs the cache ON/OFF function, the entire process of the AV application 33, the PD_API 41 shown in FIG. 19, the PD filter 53, and the PD_FS 54 will be described below with reference to the flowchart of FIG. 22.

如果不使用高速缓存功能而执行从光盘3读取AV数据或将AV数据写入光盘3,则在步骤S201中,AV应用程序33调用请求通过使用表示高速缓存功能不用做参数的高速缓存信息(高速缓存关闭)而打开文件的API函数PdOpenFile()。If reading of AV data from the optical disc 3 or writing of AV data to the optical disc 3 is performed without using the cache function, then in step S201, the AV application 33 invokes the request by using the cache information indicating that the cache function is not used as a parameter ( Cache is closed) and the API function PdOpenFile() to open the file.

在步骤S211中,PD_API 41接收从AV应用程序33对API函数PdOpenFile()的调用。接着,在步骤S212中,为响应对API函数PdOpenFile()的调用,PD_API 41调用请求打开文件的API函数DeviceIoControl()。随后,NT I/O管理器52提供具有指定为请求PD过滤器53打开一个文件的IOCTL的IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP。在这种情况下,IOCTL_PD_OPEN_FILE包含表示不使用高速缓存功能的高速缓存信息。In step S211, the PD_API 41 receives a call from the AV application 33 to the API function PdOpenFile(). Then, in step S212, in response to the calling of the API function PdOpenFile (), the PD_API 41 calls the API function DeviceIoControl () of requesting to open the file. Subsequently, the NT I/O manager 52 provides the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_OPEN_FILE designated as the IOCTL requesting the PD filter 53 to open a file. In this case, IOCTL_PD_OPEN_FILE contains cache information indicating that the cache function is not used.

在步骤S221中,PD过滤器53从NT I/O管理器52接收IRP并将高速缓存标志重置为0以表示根据IRP的IOCTL_PD_OPEN_FILE没有使用高速缓存功能。因此,在AV应用程序33中通过指定为参数的高速缓存信息(高速缓存关闭)而请求打开的文件不需要使用高速缓存功能(高速缓存关闭状态)就可以处理。In step S221, the PD filter 53 receives the IRP from the NT I/O manager 52 and resets the cache flag to 0 to indicate that the cache function is not used according to the IOCTL_PD_OPEN_FILE of the IRP. Therefore, a file requested to be opened by the cache information (cache off state) specified as a parameter in the AV application 33 can be processed without using the cache function (cache off state).

在高速缓存关闭的状态中,为分别响应PD_API 41对PdOpenFile()、PdcloseFile()、PdReadFile(),和PdWriteFile()的,PD过滤器调用53直接输出给PD_FS 54与API函数DeviceIoControl()相关联的具有指定为IOCTL的IOCTL_PD_OPEN_FILE,IOCTL_PD_CLOSE_FILE,IOCTL_PD_READ_FILE,和IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROLIRP。因此,PD过滤器53控制PD_API 41的IRP的输出以便PD_API 41的IRP所请求的数据能不使用高速缓存功能函数而被读出或写入。In the cache-closed state, in response to PD_API 41 for PdOpenFile(), PdcloseFile(), PdReadFile(), and PdWriteFile() respectively, the PD filter call 53 is directly output to PD_FS 54 in association with the API function DeviceIoControl() An IRP_MJ_DEVICE_CONTROLIRP with IOCTL_PD_OPEN_FILE specified as IOCTL, IOCTL_PD_CLOSE_FILE, IOCTL_PD_READ_FILE, and IOCTL_PD_WRITE_FILE. Therefore, the PD filter 53 controls the output of the IRP of the PD_API 41 so that the data requested by the IRP of the PD_API 41 can be read or written without using the cache function.

也就是说,在步骤S221中,在设置高速缓存关闭状态之后,PD过滤器53直接输出从NT I/O管理器52所接收的具有作为IOCTL的IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP给PD_FS 54。That is, in step S221, after setting the cache off state, the PD filter 53 directly outputs the IRP_MJ_DEVICE_CONTROL IRP received from the NT I/O manager 52 with IOCTL_PD_OPEN_FILE as the IOCTL to the PD_FS 54.

在步骤S231中,PD_FS 54从PD过滤器53接收具有IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP并将其输出给PD存储器55。接着,打开光盘3上的文件。In step S231, the PD_FS 54 receives the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_OPEN_FILE from the PD filter 53 and outputs it to the PD memory 55. Next, open the file on disc 3.

随后,如果,在步骤S202中,AV应用程序33调用作为访问光盘3的请求的请求打开或写入一个文件(文件流)的API函数PdReadFile()和PdWriteFile(),则在步骤S213中PD_API 41接收对API函数PdReadFile()和PdWriteFile()的调用。Subsequently, if, in step S202, the AV application program 33 calls API functions PdReadFile () and PdWriteFile () that are opened or written to a file (file stream) as a request for accessing the optical disc 3, then in step S213 the PD_API 41 Receive calls to the API functions PdReadFile() and PdWriteFile().

在步骤S214中,为分别响应来自AV应用程序33的API函数PdReadFile()和PdWriteFile(),PD_API 41调用请求读取或写入一个文件的API函数DeviceIoControl()以便将具有指定为请求读取文件的IOCTL的IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或具有指定为请求写入文件的IOCTL的IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP从NT I/O管理器52提供到PD过滤器53。In step S214, for responding to API function PdReadFile () and PdWriteFile () from AV application program 33 respectively, PD_API 41 call request reads or writes API function DeviceIoControl () of a file so that will have designated as request read file The IRP_MJ_DEVICE_CONTROL IRP of the IOCTL_PD_READ_FILE of the IOCTL or the IRP_MJ_DEVICE_CONTROL IRP of the IOCTL_PD_WRITE_FILE of the IOCTL designated as a request to write a file is supplied from the NT I/O manager 52 to the PD filter 53.

在步骤S223中,PD过滤器53从NT I/O管理器52接收IRP_MJ_DEVICE_CONTROL IRP。在步骤S224中,PD过滤器53将IRP_MJ_DEVICE_CONTROL IRP输出到PD_FS 54。In step S223, the PD filter 53 receives the IRP_MJ_DEVICE_CONTROL IRP from the NT I/O manager 52. In step S224, the PD filter 53 outputs the IRP_MJ_DEVICE_CONTROL IRP to the PD_FS 54.

如上所述,处于高速缓存关闭状态的PD过滤器53直接将IRP_MJ_DEVICE_CONTROL IRP从PD_API 41输出到PD_FS 54。As mentioned above, the PD filter 53 in the cache off state directly outputs the IRP_MJ_DEVICE_CONTROL IRP from the PD_API 41 to the PD_FS 54.

因此,在该情况下,在步骤S224中,PD过滤器53直接输出具有指定为请求读取文件的IOCTL的IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROLIRP或具有指定为请求写入文件的IOCTL的IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP给PD_FS 54。Therefore, in this case, in step S224, the PD filter 53 directly outputs the IRP_MJ_DEVICE_CONTROL IRP having the IOCTL_PD_READ_FILE designated as the IOCTL requesting to read the file or the IRP_MJ_DEVICE_CONTROL IRP having the IOCTL_PD_WRITE_FILE designated as the IOCTL requesting to write the file to the PD_FS 54.

在步骤S232中,PD_FS 54从PD过滤器53接收IRP_MJ_DEVICE_CONTROLIRP。In step S232, the PD_FS 54 receives the IRP_MJ_DEVICE_CONTROLIRP from the PD filter 53.

为响应调用由Win32子系统51所提供的API函数PdReadFile()和PdWriteFile(),PD_FS 54将NT高速缓存管理器59的高速缓存功能提供给从NT I/O管理器52输出到PD过滤器53的IRP_MJ_READ IRP或IRP_MJ_WRITEIRP。相反地,PD_FS 54并不给IRP_MJ_DEVICE_CONTROL IRP提供高速缓存功能。In response to calling the API functions PdReadFile() and PdWriteFile() provided by the Win32 subsystem 51, the PD_FS 54 provides the cache function of the NT cache manager 59 to output from the NT I/O manager 52 to the PD filter 53 IRP_MJ_READ IRP or IRP_MJ_WRITEIRP. In contrast, PD_FS 54 does not provide caching for IRP_MJ_DEVICE_CONTROL IRPs.

因此,在步骤S232中,PD_FS 54直接将IRP_MJ_DEVICE_CONTROL IRP从PD过滤器53输出到PD存储器55。也就是说,不使用高速缓存功能。Therefore, in step S232, the PD_FS 54 directly outputs the IRP_MJ_DEVICE_CONTROL IRP from the PD filter 53 to the PD memory 55. That is, the cache function is not used.

随后,如果,在步骤S203中,AV应用程序33调用请求关闭在步骤S201中打开的文件的API函数PdCloseFile(),PD_API 41接收在步骤S215中由AV应用程序33所调用的API函数PdCloseFile()。接着,在步骤S216中,为响应对API函数PdCloseFile()的调用,PD_API 41调用请求文件关闭的API函数DeviceIoControl()以便将具有指定为请求关闭文件的IOCTL的IOCTL_PD_CLOSE_FILE的IRP_MJ_DEVICE_CONTROL IRP从NT I/O管理器52提供给PD过滤器53。Subsequently, if, in step S203, the API function PdCloseFile () of the file that AV application program 33 calls requests to close in step S201, PD_API 41 receives the API function PdCloseFile () that is called by AV application program 33 in step S215 . Then, in step S216, in response to the calling of the API function PdCloseFile (), the PD_API 41 calls the API function DeviceIoControl () that requests the file to be closed so that the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_CLOSE_FILE that is designated as the IOCTL that requests to close the file is sent from the NT I/O The manager 52 supplies to the PD filter 53 .

在步骤S225中,PD过滤器53从NT I/O管理器52接收IRP。在步骤S226中,PD过滤器53直接将IRP输出给PD_FS 54。In step S225, the PD filter 53 receives the IRP from the NT I/O manager 52. In step S226, the PD filter 53 directly outputs the IRP to the PD_FS 54.

在步骤S233中,PD_FS 54从PD过滤器53接收具有指定为IOCTL的IOCTL_PD_CLOSE_FILE的IRP_MJ_DEVICE_CONTROL IRP,并将其输出给PD存储器55。接着,关闭光盘3上的文件。In step S233, the PD_FS 54 receives the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_CLOSE_FILE designated as the IOCTL from the PD filter 53, and outputs it to the PD memory 55. Next, close the file on disc 3.

另一方面,如果在步骤S241中,使用高速缓存功能来执行从光盘3读取AV数据或将AV数据写入到光盘3,则AV应用程序33调用请求通过使用表示将高速缓存功能用作参数的高速缓存信息(高速缓存开启)而打开文件的API函数PdOpenFile()。On the other hand, if in step S241, the reading of AV data from or writing of AV data to the optical disc 3 is performed using the cache function, the AV application 33 calls the request by using the cache function as a parameter The API function PdOpenFile() to open the file with the cache information (cache open).

在步骤S251中,PD_API 41接收由AV应用程序33对API函数PdOpenFile()的调用。接着,在步骤S252中,为响应对API函数PdOpenFile()的调用PD_API 41调用请求打开文件的API函数DeviceIoControl()以便将具有指定为请求PD过滤器53打开一个文件的IOCTL的IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP从NT I/O管理器52提供到PD过滤器53。在这种情况下,IOCTL_PD_OPEN_FILE包含表示使用高速缓存功能的高速缓存信息。In step S251, the PD_API 41 receives a call from the AV application 33 to the API function PdOpenFile(). Next, in step S252, in response to calling PD_API 41 to the API function PdOpenFile (), the API function DeviceIoControl () of requesting to open a file is called so that the IRP_MJ_DEVICE_CONTROL IRP of the IOCTL_PD_OPEN_FILE having the IOCTL designated as requesting the PD filter 53 to open a file is sent from NT I/O manager 52 supplies to PD filter 53. In this case, IOCTL_PD_OPEN_FILE contains cache information indicating that the cache function is used.

在步骤S261中,PD过滤器53从NT I/O管理器52接收IRP并将高速缓存标志置为1以表示根据IRP的IOCTL_PD_OPEN_FILE使用高速缓存功能。因此,在AV应用程序33中通过将高速缓存信息(高速缓存开启)指定为参数而请求打开的文件使用高速缓存功能(高速缓存开启状态)就可以处理。In step S261, the PD filter 53 receives the IRP from the NT I/O manager 52 and sets the cache flag to 1 to indicate that the cache function is used according to the IOCTL_PD_OPEN_FILE of the IRP. Therefore, a file requested to be opened by specifying cache information (cache on) as a parameter in the AV application 33 can be processed using the cache function (cache on state).

在高速缓存开启的状态下,PD过滤器53控制由PD_API 41的IRP所请求的数据来通过使用高速缓存功能读取或写入。In the cache-on state, the PD filter 53 controls data requested by the IRP of the PD_API 41 to be read or written by using the cache function.

也就是说,在步骤S261中,设置高速缓存开启状态后,PD过滤器53将从NT I/O管理器52所接收的具有指定作为IOCTL的IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP输出给PD_FS 54。That is, in step S261, after setting the cache open state, the PD filter 53 outputs the IRP_MJ_DEVICE_CONTROL IRP received from the NT I/O manager 52 with the IOCTL_PD_OPEN_FILE specified as the IOCTL to the PD_FS 54.

在步骤S271中,PD_FS 54接收具有指定作为IOCTL的IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP并将其输出给PD存储器55。接着,打开光盘3上的文件。In step S271, the PD_FS 54 receives the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_OPEN_FILE specified as the IOCTL and outputs it to the PD memory 55. Next, open the file on disc 3.

随后,如果,在步骤S242中,AV应用程序33调用作为访问光盘3的请求的请求打开或写入一个文件)的API函数PdReadFile()和PdWriteFile(),则在步骤S253中PD_API 41接收对API函数PdReadFile()和PdWriteFile()的调用。Subsequently, if, in step S242, the AV application program 33 calls the API functions PdReadFile () and PdWriteFile () as a request to access the optical disc 3 (a request to open or write a file), then in step S253 the PD_API 41 receives a reference to the API Calls of the functions PdReadFile() and PdWriteFile().

在步骤S254中,为分别响应来自AV应用程序33的对API函数PdReadFile()和PdWriteFile()的调用,PD_API 41调用请求读取或写入一个文件的API函数DeviceIoControl()以便将具有指定为请求读取文件的IOCTL的IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或具有指定为请求写入文件的IOCTL的IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROLIRP从NT I/O管理器52提供到PD过滤器53。In step S254, in response to the calling of API functions PdReadFile () and PdWriteFile () from the AV application program 33, the PD_API 41 calls the API function DeviceIoControl () that requests to read or write a file so as to specify as the request The IRP_MJ_DEVICE_CONTROL IRP of the IOCTL_PD_READ_FILE of the IOCTL that reads a file or the IRP_MJ_DEVICE_CONTROL IRP of the IOCTL_PD_WRITE_FILE with an IOCTL designated as a request to write a file is supplied from the NT I/O manager 52 to the PD filter 53.

在步骤S263中,PD过滤器53从NT I/O管理器52接收IRP_MJ_DEVICE_CONTROL IRP。在步骤S264中,PD过滤器53将IRP_MJ_DEVICE_CONTROL IRP输出到PD_FS 54。In step S263, the PD filter 53 receives the IRP_MJ_DEVICE_CONTROL IRP from the NT I/O manager 52. In step S264, the PD filter 53 outputs the IRP_MJ_DEVICE_CONTROL IRP to the PD_FS 54.

在这种情况下,在高速缓存开启状态下的PD过滤器53转换具有IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或具有IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP,并将该转换的IRP输出给PD_FS 54。In this case, the PD filter 53 in the cache-on state converts the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_READ_FILE or the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_WRITE_FILE, and outputs the converted IRP to the PD_FS 54.

在步骤S264中,为响应对请求读取由Win32子系统51所提供的文件的API函数ReadFile()的调用,具有IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP被转换成从NT I/O管理器52输出到PD过滤器53的IRP_MJ__READ。该IRP_MJ__READ接着输出到PD_FS 54。In step S264, in response to a call to the API function ReadFile() that requests to read a file provided by the Win32 subsystem 51, an IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_READ_FILE is converted to be output from the NT I/O manager 52 to the PD filter 53 IRP_MJ__READ. The IRP_MJ__READ is then output to PD_FS 54.

为响应对请求写入由Win32子系统51所提供的文件的API函数WriteFile()的调用,具有IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROLIRP被转换成从NT I/O管理器52输出到PD过滤器53的IRP_MJ_WRITE。该IRP_MJ_WRITE接着输出到PD_FS 54。IRP_MJ_DEVICE_CONTROLIRP with IOCTL_PD_WRITE_FILE is converted into IRP_MJ_WRITE output from the NT I/O manager 52 to the PD filter 53 in response to a call to the API function WriteFile() requesting to write to a file provided by the Win32 subsystem 51. This IRP_MJ_WRITE is then output to PD_FS 54.

在步骤S272中,PD_FS 54从PD过滤器53接收的IRP_MJ_READ或IRP_MJ_WRITE。In step S272, the PD_FS 54 receives the IRP_MJ_READ or IRP_MJ_WRITE from the PD filter 53.

如以上所述,PD_FS 54通过NT高速缓存管理器59提供高速缓存功能给IOCTL_MJ_READ或IOCTL_MJ_WRITE。As mentioned above, the PD_FS 54 provides the cache function to IOCTL_MJ_READ or IOCTL_MJ_WRITE through the NT cache manager 59.

在步骤S272中,PD_FS 54通过使用高速缓存功能读取或写入由从PD过滤器53所接收的IRP_MJ_READ或IRP_MJ_WRITE。In step S272, the PD_FS 54 reads or writes the IRP_MJ_READ or IRP_MJ_WRITE received by the slave PD filter 53 by using the cache function.

更具体地,如果来自从PD过滤器53的IRP_MJ_READ IRP所请求读取的数据高速缓存在NT高速缓存管理器59中,则PD_FS 54返回所高速缓存的数据给PD过滤器53作为响应。如果由IRP_MJ_READ IRP所请求的数据没有高速缓存在NT高速缓存管理器59中,则PD_FS 54从PD过滤器53将IRP_MJ_READIRP输出到PD存储器55。More specifically, if the data read from the IRP_MJ_READ IRP request from the PD filter 53 is cached in the NT cache manager 59, the PD_FS 54 returns the cached data to the PD filter 53 as a response. If the data requested by the IRP_MJ_READ IRP is not cached in the NT cache manager 59, the PD_FS 54 outputs the IRP_MJ_READ IRP from the PD filter 53 to the PD memory 55.

随后,如果在步骤S243中,AV应用程序33调用了请求关闭在步骤S241中打开的文件的API函数PdCloseFile(),则PD_API 41在步骤S255中接收来自AV应用程序33对API函数PdCloseFile()的调用。接着,在步骤S256中,为响应对API函数PdCloseFile()的调用PD_API 41调用请求关闭文件的API函数DeviceIoControl()以便将请求文件关闭的具有IOCTL_PD_CLOSE_FILE的IRP_MJ_DEVICE_CONTROL IRP从NT I/O管理器52提供到PD过滤器53。Subsequently, if in step S243, AV application program 33 has called the API function PdCloseFile () that request closes the file opened in step S241, then PD_API 41 receives in step S255 from AV application program 33 to API function PdCloseFile () transfer. Next, in step S256, in response to the calling of the API function PdCloseFile (), the PD_API 41 calls the API function DeviceIoControl () that requests to close the file so that the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_CLOSE_FILE that the request file is closed is provided from the NT I/O manager 52 to PD filter 53.

在步骤S265中,PD过滤器53接收来自NT I/O管理器52的IRP。在步骤S266中,PD过滤器53输出IRP给PD_FS 54。The PD filter 53 receives the IRP from the NT I/O manager 52 in step S265. In step S266, the PD filter 53 outputs the IRP to the PD_FS 54.

在步骤S273中,PD_FS 54从PD过滤器53接收具有IOCTL_PD_CLOSE_FILE的IRP_MJ_DEVICE_CONTROL IRP,并将其输出给PD过滤器55。这样,将关闭光盘3上的文件。In step S273, the PD_FS 54 receives the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_CLOSE_FILE from the PD filter 53, and outputs it to the PD filter 55. This will close the file on disc 3.

根据例如可以是PC 1或驱动器2的性能(例如,CPU 12的时钟频率或驱动器2最差寻址时间)或用户的操作,可以确定是否使用了高速缓存功能,这在用作调用请求打开一个文件的API函数PdOpenFile()的参数的高速缓存信息中表明了。Depending on, for example, the performance of the PC 1 or the drive 2 (for example, the clock frequency of the CPU 12 or the worst seek time of the drive 2 ) or the user's operation, it can be determined whether the cache function is used, which is used as a call request to open a It is indicated in the cache information of the parameter of the API function PdOpenFile() of the file.

图19所示的通过使用高速缓存器ON/OFF功能而由PD过滤器53执行的进程将在以下参考图23的流程图进行描述。The process performed by the PD filter 53 by using the cache ON/OFF function shown in FIG. 19 will be described below with reference to the flowchart of FIG. 23 .

为了响应应用程序31到33的进程71到75中的一个对表示请求执行对驱In response to one of the processes 71 to 75 of the application programs 31 to 33 requesting to perform the drive

动器2涉及I/O的进程的请求的API函数的调用,NT I/O管理器52将相应于该API函数的IRP提供给PD过滤器53。The NT I/O manager 52 provides the IRP corresponding to the API function to the PD filter 53 by calling the API function of the request of the process related to the I/O by the actuator 2.

在该实施例中,由应用程序31到33所调用的API函数(包括PD_API 41)包括由Win32子系统51所提供的API函数和由PD_API 41所提供的API函数。In this embodiment, the API functions (including PD_API 41) called by the application programs 31 to 33 include the API functions provided by the Win32 subsystem 51 and the API functions provided by the PD_API 41.

为响应对由Win32子系统51所提供的API函数的调用,Win32子系统51输出一个相应于该API函数的请求给NT I/O管理器52,同时NT I/O管理器52将相应于该API函数的IRP提供给PD过滤器53。为响应对由PD_API 41所提供的API函数的调用,PD_API 41调用相应的API函数DeviceIoControl()。接着,为响应API函数DeviceIoCont rol(),Win32子系统51输出一个请求给NT I/O管理器52,同时NT I/O管理器52将相应的IRP提供给PD过滤器53。In response to the calling of the API function provided by the Win32 subsystem 51, the Win32 subsystem 51 outputs a request corresponding to the API function to the NT I/O manager 52, and the NT I/O manager 52 will respond to the request corresponding to the API function. The IRP of the API function is supplied to the PD filter 53 . In response to calls to API functions provided by PD_API 41, PD_API 41 calls the corresponding API function DeviceIoControl(). Then, in response to the API function DeviceIoControl(), the Win32 subsystem 51 outputs a request to the NT I/O manager 52, and the NT I/O manager 52 provides the corresponding IRP to the PD filter 53.

因此,无论由应用程序31到33中的一个所调用的API函数是否是由Win32子系统51所提供的API函数还是由PD_API 41所提供的API函数,相应于该API函数的IRP都最终从NT I/O管理器52提供给PD过滤器53。Therefore, no matter whether the API function called by one of the application programs 31 to 33 is the API function provided by the Win32 subsystem 51 or the API function provided by the PD_API 41, the IRP corresponding to the API function is finally transferred from the NT The I/O manager 52 supplies to the PD filter 53 .

在步骤S301中,PD过滤器53接收NT I/O管理器52所提供的IRP并将其存储在命令缓冲器111中。接着,在步骤S302中,过滤器内核53A确定在步骤S301中存储在命令缓冲器111中的IRP是否是具有指定为IOCTL的IOCTL_PD_OPEN_FILE的IRP_MJ_DEVICE_CONTROL IRP。In step S301, the PD filter 53 receives the IRP provided by the NT I/O manager 52 and stores it in the command buffer 111. Next, in step S302, the filter core 53A determines whether the IRP stored in the command buffer 111 in step S301 is an IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_OPEN_FILE designated as IOCTL.

如上所述,IOCTL_PD_OPEN_FILE包含了高速缓存信息。As mentioned above, IOCTL_PD_OPEN_FILE contains cache information.

如果在步骤S 302中确定存储在命令缓冲器111中的IRP为具有指定为IOCTL的IOCTL_PD_OPEN_FILE的IRP,则进程转到步骤S303以确定在IOCTL_PD_OPEN_FILE中由IRP所指定的的高速缓存信息是否表示使用了高速缓存功能。If it is determined in step S302 that the IRP stored in the command buffer 111 is an IRP with the IOCTL_PD_OPEN_FILE designated as IOCTL, the process goes to step S303 to determine whether the cache information specified by the IRP in the IOCTL_PD_OPEN_FILE indicates that the IRP is used. cache function.

如果在步骤S303中确定高速缓存信息表示使用了高速缓存功能,则进程转到步骤S304。在步骤S304中,过滤器内核53A设置为变量的高速缓存标志为1,以表示使用了高速缓存信息(高速缓存开启状态)。If it is determined in step S303 that the cache information indicates that the cache function is used, the process goes to step S304. In step S304, the filter core 53A sets the cache flag of the variable to 1 to indicate that the cache information is used (cache on state).

如果在步骤S303中确定表示没有使用高速缓存功能的高速缓存信息,则进程转到步骤S305。在步骤S305中,过滤器内核53A设置高速缓存标志为0以表示没有使用高速缓存信息(高速缓存关闭状态)。If it is determined in step S303 that there is no cache information indicating that the cache function is used, the process goes to step S305. In step S305, the filter core 53A sets the cache flag to 0 to indicate that the cache information is not used (cache off state).

在步骤S306中,过滤器内核53A输出存储在命令缓冲器111中的具有IOCTL_PD_OPEN_FILE的IRP给PD_FS 54并等待另一个IRP。进程接着返回步骤S301。In step S306, the filter core 53A outputs the IRP with IOCTL_PD_OPEN_FILE stored in the command buffer 111 to the PD_FS 54 and waits for another IRP. The process then returns to step S301.

在这种情况下,PD_FS 54接收来自过滤器内核53A的IRP并将其输出到PD存储器55。接着,打开文件。In this case, PD_FS 54 receives the IRP from filter core 53A and outputs it to PD memory 55. Next, open the file.

如果在步骤S302中确定存储在命令缓冲器111中的IRP不是具有指定为IOCTL的IOCTL_PD_OPEN_FILE的IRP,则进程转到步骤S307以确定存储在命令缓冲器111中的IRP是否是请求关闭一个文件的具有指定为IOCTL的IOCTL_PD_CLOSE_FILE的IRP_MJ_DEVICE_CONTROL IRP。If it is determined in step S302 that the IRP stored in the command buffer 111 is not the IRP with the IOCTL_PD_OPEN_FILE designated as IOCTL, then the process goes to step S307 to determine whether the IRP stored in the command buffer 111 is a request to close a file with IRP_MJ_DEVICE_CONTROL IRP specified as IOCTL_PD_CLOSE_FILE of the IOCTL.

如果在步骤S307中确定存储在命令缓冲器111中的IRP为具有IOCTL_PD_CLOSE_FILE的IRP,则进程转到S308。在步骤S308中,过滤器内核53A输出具有IOCTL_PD_CLOSE_FILE的IRP给PD_FS 54并等待另一个IRP。接着进程返回步骤S301。If it is determined in step S307 that the IRP stored in the command buffer 111 is an IRP with IOCTL_PD_CLOSE_FILE, the process goes to S308. In step S308, the filter core 53A outputs an IRP with IOCTL_PD_CLOSE_FILE to the PD_FS 54 and waits for another IRP. Then the process returns to step S301.

在这种情况下,PD_FS 54接收具有IOCTL_PD_CLOSE_FILE的IRP并将其输出到PD存储器55。接着,关闭文件。In this case, PD_FS 54 receives the IRP with IOCTL_PD_CLOSE_FILE and outputs it to PD storage 55. Next, close the file.

如果在步骤S307中确定存储在命令缓冲器111中的IRP不是具有IOCTL_PD_CLOSE_FILE的IRP,则进程转到S 309以确定存储在命令缓冲器111中的IRP_MJ_DEVICE_CONTROL IRP是否是具有IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或具有IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP。If it is determined in step S307 that the IRP stored in the command buffer 111 is not the IRP with IOCTL_PD_CLOSE_FILE, then the process goes to S309 to determine whether the IRP_MJ_DEVICE_CONTROL IRP stored in the command buffer 111 is the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_READ_FILE or the IRP with IOCTL_PD_WRITE_FILE IRP_MJ_DEVICE_CONTROL IRP.

如果在步骤S309中确定存储在命令缓冲器111中的IRP不是具有IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或具有IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP,则进程转到步骤S310。在步骤S310中,过滤器内核53A输出存储在命令缓冲器111中的IRP给PD_FS54并等待另一个IRP。接着进程返回步骤S301。If it is determined in step S309 that the IRP stored in the command buffer 111 is not the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_READ_FILE or the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_WRITE_FILE, the process goes to step S310. In step S310, the filter core 53A outputs the IRP stored in the command buffer 111 to the PD_FS 54 and waits for another IRP. Then the process returns to step S301.

如果在步骤S309中确定存储在命令缓冲器111中的IRP为具有IOCTL_PD_READ_FILE或IOCTL_PD_WRITE_FILE的IRP,则进程转到步骤S311以确定高速缓存标志是否为1。If it is determined in step S309 that the IRP stored in the command buffer 111 is an IRP with IOCTL_PD_READ_FILE or IOCTL_PD_WRITE_FILE, the process goes to step S311 to determine whether the cache flag is 1 or not.

如果在步骤S311中确定高速缓存标志为1,即,PD过滤器53的过滤器内核53A处于高速缓存开启状态,则进程转到步骤S312。在步骤S312中,过滤器内核53A转换存储在命令缓冲器111中的IRP。If it is determined in step S311 that the cache flag is 1, that is, the filter core 53A of the PD filter 53 is in the cache-on state, the process goes to step S312. In step S312 , the filter core 53A converts the IRP stored in the command buffer 111 .

也就是说,在这种情况下,存储在命令缓冲器111中的IRP为请求读取一个文件的具有指定为IOCTL的IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或请求写入一个文件的具有指定为IOCTL的IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP。That is, in this case, the IRP stored in the command buffer 111 is an IRP_MJ_DEVICE_CONTROL IRP requesting to read a file with IOCTL_PD_READ_FILE designated as IOCTL or an IRP_MJ_DEVICE_CONTROL requesting to write a file with IOCTL_PD_WRITE_FILE designated as IOCTL IRPs.

如果存储在命令缓冲器111中的IRP为请求读取文件的具有指定为IOCTL的IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP,则在步骤S312中,为响应由Win32子系统51所提供的对API函数ReadFile()的调用,过滤器内核53A将IRP_MJ_DEVI CE_CONTROL IRP转换为从NT I/O管理器52输出到PD过滤器53的IRP_MJ_READ IRP。If the IRP stored in the command buffer 111 is the IRP_MJ_DEVICE_CONTROL IRP with the IOCTL_PD_READ_FILE designated as the IOCTL for the request to read the file, then in step S312, in response to the call to the API function ReadFile () provided by the Win32 subsystem 51 , the filter core 53A converts the IRP_MJ_DEVICE_CONTROL IRP into the IRP_MJ_READ IRP output from the NT I/O manager 52 to the PD filter 53.

如果存储在命令缓冲器111中的IRP为具有指定为IOCTL的IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP,则在步骤S312中,为响应由Win32子系统51所提供的对API函数WriteFile()的调用,过滤器内核53A将IRP_MJ_DEVICE_CONTROL IRP转换为从NT I/O管理器52输出到PD过滤器53的IRP_MJ_WRITE IRP。If the IRP stored in the command buffer 111 is an IRP_MJ_DEVICE_CONTROL IRP with an IOCTL_PD_WRITE_FILE designated as an IOCTL, then in step S312, in response to a call to the API function WriteFile() provided by the Win32 subsystem 51, the filter core 53A Convert the IRP_MJ_DEVICE_CONTROL IRP to the IRP_MJ_WRITE IRP output from the NT I/O manager 52 to the PD filter 53.

接着,在步骤S313中,过滤器内核53A将在步骤S312中所转换的IRP,即,IRP_MJ_READ或IRP_MJ_WRITE,输出给PD_FS 54,并等待另一个IRP。接着进程返回到步骤S301。Next, in step S313, the filter core 53A outputs the IRP converted in step S312, ie, IRP_MJ_READ or IRP_MJ_WRITE, to the PD_FS 54, and waits for another IRP. Then the process returns to step S301.

在这种情况下,PD_FS 54接收来自过滤器内核53A的IRP_MJ_READ或IRP_MJ_WRITE,并使用高速缓存功能来读取或写入由IRP所请求的数据。In this case, the PD_FS 54 receives IRP_MJ_READ or IRP_MJ_WRITE from the filter core 53A, and uses the cache function to read or write the data requested by the IRP.

如上所述,PD_FS 54通过NT高速缓存管理器59将高速缓存功能提供给IRP_MJ_READ或IRP_MJ_WRITE。As mentioned above, the PD_FS 54 provides the cache function to IRP_MJ_READ or IRP_MJ_WRITE through the NT cache manager 59.

因此,如果从过滤器内核53A接收到的IRP为IRP_MJ_READ,则PD_FS 54核对IRP请求读取的数据是否高速缓存在NT高速缓存管理器59中。如果该数据高速缓存在NT高速缓存管理器59中,则PD_FS 54返回该高速缓存的数据给PD过滤器53作为响应。如果IRP_MJ_READ所请求的数据没有高速缓存在NT高速缓存管理器59中,则PD_FS 54将IRP_MJ_READ IRP输出给PD存储器55。Therefore, if the IRP received from the filter core 53A is IRP_MJ_READ, the PD_FS 54 checks whether the data read by the IRP request is cached in the NT cache manager 59. If the data is cached in the NT cache manager 59, then the PD_FS 54 returns the cached data to the PD filter 53 as a response. If the data requested by the IRP_MJ_READ is not cached in the NT cache manager 59, the PD_FS 54 outputs the IRP_MJ_READ IRP to the PD memory 55.

PD存储器55包括用来读取或写入数据的读/写缓冲器(未示出)。该读/写缓冲器的尺寸等于所使用的分页的尺寸,例如4KB,而可以一次读取或写入的数据的最大量由该读/写缓冲器的尺寸所限定。The PD memory 55 includes a read/write buffer (not shown) for reading or writing data. The size of the read/write buffer is equal to the size of the page used, eg 4KB, and the maximum amount of data that can be read or written at one time is limited by the size of the read/write buffer.

因此,如果由来自过滤器内核53A的IRP_MJ_READ所请求读取的数据的尺寸超出了该读/写缓冲器的尺寸,则PD_FS 54将IRP_MJ_READ IRP分成多个具有读/写缓冲器尺寸的请求读取的数据的IRP_MJ_READ IRP,并将这些IRP输出到PD存储器55。将相同的提供给来自过滤器内核53A的IRP_MJ_WRITE。Therefore, if the size of the data read requested by the IRP_MJ_READ from the filter core 53A exceeds the size of the read/write buffer, the PD_FS 54 divides the IRP_MJ_READ IRP into multiple request reads with the size of the read/write buffer IRP_MJ_READ IRP of the data, and output these IRPs to the PD memory 55. The same is provided to the IRP_MJ_WRITE from filter core 53A.

如果在步骤S311中确定高速缓存标志不是1,即,高速缓存标志为0并且PD过滤器53的过滤器内核53A处于高速缓存关闭状态,则进程转到步骤S314。在步骤S314中,过滤器内核53A直接输出给PD_FS 54存储在命令缓冲器111中的IRP,即,请求读取文件的具有IOCTL_PD_READ_FILE的IRP_MJ_DEVICE_CONTROL IRP或请求写入文件的具有IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP,并等待另一个IRP。随后进程转到步骤S301。If it is determined in step S311 that the cache flag is not 1, that is, the cache flag is 0 and the filter core 53A of the PD filter 53 is in the cache off state, the process goes to step S314. In step S314, the filter kernel 53A directly outputs to the IRP stored in the command buffer 111 by the PD_FS 54, that is, an IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_READ_FILE requesting to read a file or an IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_WRITE_FILE requesting to write a file, and waits for Another IRP. Then the process goes to step S301.

在这种情况下,PD_FS 54接收具有IOCTL_PD_READ_FILE或IOCTL_PD_WRITE_FILE的IRP_MJ_DEVICE_CONTROL IRP,并立即将该IRP输出到PD存储器55而无需使用高速缓存功能。In this case, the PD_FS 54 receives the IRP_MJ_DEVICE_CONTROL IRP with IOCTL_PD_READ_FILE or IOCTL_PD_WRITE_FILE, and immediately outputs the IRP to the PD memory 55 without using the cache function.

如以上所述,一次读取或写入的最大数据量通过PD存储器55的读/写高速缓存的尺寸而限定。As described above, the maximum amount of data read or written at one time is limited by the size of the read/write cache of the PD memory 55 .

因此,如果在步骤S314中要输出给PD_FS 54的由IRP_MJ_DEVICE_CONTROL IRP所请求的要读取或写入的数据量超出了读/写高速缓存的尺寸,则过滤器内核53A将IRP_MJ_DEVICE_CONTROL IRP分成多个请求具有读/写高速缓存尺寸的将要读取或写入的数据的IRP_MJ_DEVICE_CONTROL IRP,并将这些IRP输出给PD_FS 54。Therefore, if the amount of data to be read or written requested by the IRP_MJ_DEVICE_CONTROL IRP to be output to the PD_FS 54 in step S314 exceeds the size of the read/write cache, the filter core 53A divides the IRP_MJ_DEVICE_CONTROL IRP into multiple requests IRP_MJ_DEVICE_CONTROL IRPs of data to be read or written with read/write cache size and output these IRPs to PD_FS 54.

可以选择是否高速缓存功能仅仅为具有用户所定义的图21所示的IOCTL码的IRP_MJ_DEVICE_CONTROL IRP而由高速缓存器ON/OFF功能使用。为响应图20所示的对仅仅由PD_API 41所提供的API函数的调用,该具有IOCTL的IRP从NT I/O管理器52输出到PD过滤器53。It can be selected whether or not the cache function is used by the cache ON/OFF function only for IRP_MJ_DEVICE_CONTROL IRPs with user-defined IOCTL codes shown in FIG. 21. The IRP with IOCTL is output from the NT I/O manager 52 to the PD filter 53 in response to a call to an API function provided only by the PD_API 41 shown in FIG. 20 .

因此,在该实施例中,能使用高速缓存器ON/OFF功能的应用程序限制AV应用程序33加载PD_API 41。Therefore, in this embodiment, the application that can use the cache ON/OFF function restricts the AV application 33 to load the PD_API 41.

如果在AV应用程序33中没有使用高速缓存功能,则能阻止由于在IRP上的高速缓存处理的额外开销而导致的在处理AV应用程序33的IRP上的延迟,从而使得AV应用程序33实时记录或播放AV数据的操作得以提高。If the cache function is not used in the AV application 33, the delay in processing the IRP of the AV application 33 due to the overhead of the cache processing on the IRP can be prevented, thereby allowing the AV application 33 to record in real time Or the operation of playing back AV data can be improved.

另一方面,其它的应用程序31和32请求通过直接调用Win32子系统51所提供的API函数ReadFile()或WriteFile()来读取或写入数据。因此,应用程序31和32也总是使用高速缓存功能来读取或写入数据。On the other hand, other application programs 31 and 32 request to read or write data by directly calling the API function ReadFile( ) or WriteFile( ) provided by the Win32 subsystem 51 . Therefore, the applications 31 and 32 also always use the cache function to read or write data.

通过使用高速缓存功能,从应用程序31或32的IRP到PD存储器55或PD_FS 54的输出频率降低了。因此可能阻止由于应用程序31或32的IRP请求读取或写入数据而导致在驱动器2中寻址的发生。同时也可能阻止在应用程序31或32的IRP请求读取或写入数据之后由AV应用程序33的IRP请求读取或写入数据而导致的在驱动器2中的寻址。结果,使得AV应用程序33实时记录或播放AV数据的操作得以提高。By using the cache function, the output frequency of the IRP from the application program 31 or 32 to the PD memory 55 or PD_FS 54 is reduced. It is thus possible to prevent addressing from taking place in the drive 2 due to an IRP request by the application 31 or 32 to read or write data. It is also possible to prevent addressing in the drive 2 caused by an IRP request of the AV application 33 to read or write data after an IRP request of the application 31 or 32 to read or write data. As a result, the operation of causing the AV application 33 to record or play back AV data in real time is improved.

以上所述的第一到第三函数中的任一均可与高速缓存器ON/OFF功能合并。Any of the first to third functions described above may be combined with the cache ON/OFF function.

图24示出了当第一和第二函数与高速缓存器ON/OFF功能合并时PD过滤器53的结构实例。FIG. 24 shows a structural example of the PD filter 53 when the first and second functions are combined with the cache ON/OFF function.

在图24中,通过使用第一函数,PD过滤器53能为表示来自应用程序31到33之一的访问光盘3的请求的IRP设置IRP优先级,并将该IRP优先级所提供的IRP存储在队列81中。接着,PD过滤器53根据为I RP所设置的IRP优先级读取存储在队列81中的IRP,并将该IRP输出给PD_FS 54。In FIG. 24, by using the first function, the PD filter 53 can set the IRP priority for the IRP representing a request to access the optical disc 3 from one of the application programs 31 to 33, and store the IRP provided by the IRP priority. In queue 81. Next, the PD filter 53 reads the IRP stored in the queue 81 according to the IRP priority set for the IRP, and outputs the IRP to the PD_FS 54.

可选地,通过使用第二函数,PD过滤器53设置暂停标志,该暂停标志标志表示请求访问光盘3的IRP进程是否被允许或是被禁止,同时PD过滤器53将来自应用程序31到33的IRP存储在队列81中。接着,PD过滤器53根据暂停标志读取存储在队列81中的IRP并将其输出给PD_FS 54。Optionally, by using the second function, the PD filter 53 sets a suspend flag, which indicates whether the IRP process requesting access to the optical disc 3 is allowed or prohibited, and the PD filter 53 will receive the information from the applications 31 to 33 The IRPs are stored in queue 81. Next, the PD filter 53 reads the IRP stored in the queue 81 according to the pause flag and outputs it to the PD_FS 54.

此外,PD过滤器53设置AV应用程序33的IRP是否使用高速缓存功能,并且当输出IRP给PD_FS 54时,PD过滤器53根据以上的设置来处理IRP。In addition, the PD filter 53 sets whether the IRP of the AV application 33 uses the cache function, and when outputting the IRP to the PD_FS 54, the PD filter 53 processes the IRP according to the above setting.

图25示出了当第三函数与高速缓存器ON/OFF功能合并时PD过滤器53的结构实例。FIG. 25 shows a configuration example of the PD filter 53 when the third function is combined with the cache ON/OFF function.

在图25中,通过使用第三函数,PD过滤器53具有用来功能性地打开或关闭向PD_FS 54输出除了AV应用程序33外的其它应用程序,即,应用程序31或32,的IRP的开关101,并且根据存储在寄存器58中的开关设置信息来打开或关闭开关101,从而控制输出给PD_FS 54的来自应用程序31和32的IRP。In FIG. 25, by using the third function, the PD filter 53 has a function to functionally turn on or off the output of an IRP to the PD_FS 54 of an application other than the AV application 33, that is, the application 31 or 32. switch 101, and the switch 101 is turned on or off according to the switch setting information stored in the register 58, thereby controlling the IRPs from the applications 31 and 32 output to the PD_FS 54.

此外,PD过滤器53设置AV应用程序33是否使用了高速缓存功能,并且当输出IRP给PD_FS 54时,PD过滤器53根据以上的设置来处理IRP。In addition, the PD filter 53 sets whether the AV application 33 uses the cache function, and when outputting the IRP to the PD_FS 54, the PD filter 53 processes the IRP according to the above setting.

如上所述,通过将第一到第三功能与高速缓存器ON/OFF功能合并,能阻止由应用程序31或32访问光盘3所导致的寻址,从而确保AV应用程序33实时地记录或播放AV数据的操作。As described above, by combining the first to third functions with the cache ON/OFF function, addressing caused by the application 31 or 32 accessing the optical disk 3 can be prevented, thereby ensuring that the AV application 33 records or plays back in real time Operation of AV data.

在以上所述实施例中,光盘3可以用做记录或播放数据的记录介质。但,也可以使用其它任何类型的记录介质,如硬盘或其它光盘状的能由记录或播放数据而产生寻址的记录介质。In the above-described embodiments, the optical disc 3 can be used as a recording medium for recording or playing data. However, any other type of recording medium can be used, such as a hard disk or other optical disk-like recording medium capable of being addressed by recording or playing back data.

在本说明书中,由各个步骤所形成的让PC 1执行各种类型进程的程序不需要按流程图所描述的顺序执行。它们可以并行或单独执行(例如,并行处理或对象处理)。In this specification, the programs for the PC 1 to execute various types of processes formed by various steps do not need to be executed in the order described in the flow chart. They can be executed in parallel or individually (eg, parallel processing or object processing).

可以理解的是,本领域的技术人员可以在所附权利要求或其等同的范围内根据需要或其它的因素而对本发明作出各种修改、组合、近似组合,或选择。It can be understood that those skilled in the art can make various modifications, combinations, approximate combinations, or selections to the present invention according to needs or other factors within the scope of the appended claims or their equivalents.

Claims (8)

1.一种用于处理来自应用程序对记录介质进行访问的访问请求的信息处理装置,包括:1. An information processing apparatus for processing an access request from an application program for accessing a recording medium, comprising: 设置装置,用于设置专用于来自该应用程序的该访问请求的优先级或表示是否允许对来自该应用程序的访问请求进行处理的许可信息;Setting means for setting the priority dedicated to the access request from the application program or permission information indicating whether to allow the access request from the application program to be processed; 队列控制装置,用于将被提供有优先级或许可信息的访问请求存储在队列中;queue control means for storing access requests provided with priority or permission information in a queue; 访问请求处理装置,用于根据优先级或许可信息处理存储在队列中的访问请求;和access request processing means for processing access requests stored in the queue according to priority or permission information; and 高速缓存功能设置装置,用来设置是否使用高速缓存功能,The cache function setting device is used to set whether to use the cache function, 其中,该访问请求处理装置根据是否使用高速缓存功能而处理访问请求Wherein, the access request processing device processes the access request according to whether the cache function is used 2.根据权利要求1的信息处理装置,其中,设置装置将来自一规定应用程序的访问请求的优先级设置得高于来自另一个应用程序的访问请求的优先级。2. The information processing apparatus according to claim 1, wherein the setting means sets the priority of an access request from a prescribed application higher than that of an access request from another application. 3.根据权利要求1的信息处理装置,其中,访问请求处理装置只有当许可信息表示允许对访问请求进行处理时,才连续处理来自规定应用程序的访问请求以及处理来自其它应用程序的访问请求。3. The information processing apparatus according to claim 1, wherein the access request processing means continuously processes access requests from a prescribed application and processes access requests from other applications only when the permission information indicates that processing of access requests is permitted. 4.根据权利要求1的信息处理装置,其中,访问请求处理装置根据是否使用高速缓存功能而处理来自规定应用程序的访问请求。4. The information processing apparatus according to claim 1, wherein the access request processing means processes an access request from a prescribed application depending on whether or not to use a cache function. 5.根据权利要求1的信息处理装置,其中,信息处理装置是一个用来过滤访问请求以及将所过滤的访问请求传送到文件系统驱动器的过滤驱动器。5. The information processing apparatus according to claim 1, wherein the information processing apparatus is a filter driver for filtering access requests and transmitting the filtered access requests to the file system driver. 6.根据权利要求1的信息处理装置,其中,从记录介质读出或写入到记录介质的数据至少包括音频-视频数据。6. The information processing apparatus according to claim 1, wherein the data read from or written to the recording medium includes at least audio-video data. 7.根据权利要求1的信息处理装置,其中,在记录介质的记录区域中,在具有至少预定尺寸的连续空闲区域中,最接近于刚刚暂时记录数据的记录区域的空闲区域被保留同时数据存储在该保留的空闲区域中。7. The information processing apparatus according to claim 1, wherein, in the recording area of the recording medium, among continuous free areas having at least a predetermined size, a free area closest to a recording area where data is temporarily recorded just now is reserved while data is stored in that reserved free area. 8.一种用于处理来自应用程序对记录介质进行访问的访问请求的信息处理方法,包括以下步骤:8. An information processing method for processing an access request from an application program for accessing a recording medium, comprising the following steps: 设置专用于来自该应用程序的该访问请求的优先级或表示是否允许对来自该应用程序的访问请求进行处理的许可信息;Set the priority dedicated to the access request from the application or permission information indicating whether to allow the access request from the application to be processed; 将提供有优先级或许可信息的访问请求存储在队列中;和store access requests provided with priority or permission information in a queue; and 根据优先级或许可信息处理存储在队列中的访问请求;和process access requests stored in queues based on priority or permission information; and 设置是否使用高速缓存功能,Set whether to use the cache function, 其中,根据是否使用高速缓存功能而处理访问请求。Among them, the access request is processed according to whether or not the cache function is used.
CNB2005100793004A 2004-04-15 2005-04-15 Information processing apparatus and method, program, and program recording medium Expired - Fee Related CN100429637C (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP119852/04 2004-04-15
JP2004119852A JP4345559B2 (en) 2004-04-15 2004-04-15 Information processing apparatus, information processing method, program, and program recording medium
JP119853/04 2004-04-15

Publications (2)

Publication Number Publication Date
CN1734433A CN1734433A (en) 2006-02-15
CN100429637C true CN100429637C (en) 2008-10-29

Family

ID=35333276

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100793004A Expired - Fee Related CN100429637C (en) 2004-04-15 2005-04-15 Information processing apparatus and method, program, and program recording medium

Country Status (2)

Country Link
JP (1) JP4345559B2 (en)
CN (1) CN100429637C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4941034B2 (en) 2007-03-20 2012-05-30 富士通株式会社 Access control apparatus and access control method
CN102123202A (en) * 2011-01-26 2011-07-13 惠州Tcl移动通信有限公司 Method and device for backing up various messages of mobile phone
CN103019859B (en) * 2012-12-05 2018-02-16 北京普泽创智数据技术有限公司 A kind of method and system to service request scheduling
WO2023008008A1 (en) 2021-07-30 2023-02-02 株式会社ソフトギア Information processing program, information processing device, and information processing method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4791623A (en) * 1986-04-03 1988-12-13 Optotech, Inc. File management system for use in an optical data storage system
US6223243B1 (en) * 1997-06-12 2001-04-24 Nec Corporation Access control method with plural users having I/O commands prioritized in queues corresponding to plural memory units
US6347344B1 (en) * 1998-10-14 2002-02-12 Hitachi, Ltd. Integrated multimedia system with local processor, data transfer switch, processing modules, fixed functional unit, data streamer, interface unit and multiplexer, all integrated on multimedia processor
CN1344413A (en) * 1999-11-10 2002-04-10 皇家菲利浦电子有限公司 Record carrier, device for playing back record carrier, method for playing back record carrier, device for recording record carrier and method for recording record carrier
US6378036B2 (en) * 1999-03-12 2002-04-23 Diva Systems Corporation Queuing architecture including a plurality of queues and associated method for scheduling disk access requests for video content
JP2004005895A (en) * 2002-04-05 2004-01-08 Sony Corp Recording controller and recording control method, program, and recording medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4791623A (en) * 1986-04-03 1988-12-13 Optotech, Inc. File management system for use in an optical data storage system
US6223243B1 (en) * 1997-06-12 2001-04-24 Nec Corporation Access control method with plural users having I/O commands prioritized in queues corresponding to plural memory units
US6347344B1 (en) * 1998-10-14 2002-02-12 Hitachi, Ltd. Integrated multimedia system with local processor, data transfer switch, processing modules, fixed functional unit, data streamer, interface unit and multiplexer, all integrated on multimedia processor
US6378036B2 (en) * 1999-03-12 2002-04-23 Diva Systems Corporation Queuing architecture including a plurality of queues and associated method for scheduling disk access requests for video content
CN1344413A (en) * 1999-11-10 2002-04-10 皇家菲利浦电子有限公司 Record carrier, device for playing back record carrier, method for playing back record carrier, device for recording record carrier and method for recording record carrier
JP2004005895A (en) * 2002-04-05 2004-01-08 Sony Corp Recording controller and recording control method, program, and recording medium

Also Published As

Publication number Publication date
JP2005301854A (en) 2005-10-27
JP4345559B2 (en) 2009-10-14
CN1734433A (en) 2006-02-15

Similar Documents

Publication Publication Date Title
TWI465936B (en) File system and methods for managing files according to application
US7069350B2 (en) Data transfer control system, electronic instrument, and data transfer control method
JP7191967B2 (en) NVMe-based data reading method, apparatus and system
US7000077B2 (en) Device/host coordinated prefetching storage system
US7769920B2 (en) Information processing apparatus, information processing method, and program and recording medium used therewith
JP4907226B2 (en) System having a device that uses resources of an external device
JP4634477B2 (en) Media file playback without interruption
US20100198998A1 (en) I/o controller and descriptor transfer method
US6269420B1 (en) Information recording/reproducing apparatus reducing disk access frequency to file management area and sharply accelerating record processing and reproduction processing
KR20050100561A (en) Information storage device, information storage method, and program product for information storage processing
KR101125929B1 (en) Information processing apparatus and method, and program recording medium
CN100429637C (en) Information processing apparatus and method, program, and program recording medium
EP1631911B1 (en) Method and device for transferring data between a main memory and a storage device
JP4502375B2 (en) File system and control method thereof
JP4232678B2 (en) Information processing apparatus, information processing method, program, and program recording medium
EP0996885B1 (en) Data storage apparatus and access method thereof
JP2018520398A (en) Improved transmission of multimedia streams
JP2006059201A (en) Data transfer system and interface
TW200809597A (en) Method and system for device to request and operate an external buffer provided from the host
JP3105883B2 (en) Communication device and method
JPH10320259A (en) Write-once CD sharing system
JPH03111959A (en) External device controller
JP2003196129A (en) File transfer system, file transfer device and file transfer method
JP2009259060A (en) Stream data recording / reproducing apparatus
JPH10171689A (en) Video server device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081029

Termination date: 20150415

EXPY Termination of patent right or utility model