Summary of the invention
The embodiment of the present invention is to be solved technical problem is that the process simplifying client calls read-only device,
Improve host computer system operational efficiency.
One aspect of the present invention provides a kind of method calling read-only device, and described method includes: at internal memory
Space is described read-only device distributes data area, for depositing the data of described read-only device;To visitor
Family machine sends the address of described data area, in order to client computer according to the address of described data area from described
Data area obtains the data of described read-only device.
Further, described is that described read-only device distributes data area in memory headroom, is used for depositing
The data of described read-only device, including: the read-only device call request that subscribing client sends, described tune
The mark of described read-only device is comprised with request;Mark according to described read-only device determines whether
It is assigned with data area for described read-only device, when being not yet described read-only device distribution data area,
Call the primary driving of described read-only device;The request of distribution data area is sent, for dividing to memory headroom
Joining data area to deposit the data of described read-only device, the request of described distribution data area comprises read-only setting
Standby mark;
Described method farther includes: receive the address of the described data area that memory headroom returns.
Additionally, be described read-only device be assigned with data area time, obtain described data area
Address.
Additionally, described method farther includes: the relevant information of read-only device described in record client calls.
Additionally, described method farther includes: the end receiving the transmission of described client computer is called described read-only
The request of equipment, the client computer carrying the request of sending in the request of described read-only device is called in described end
Mark and the mark of described read-only device;Call according to described end in the request of described read-only device only
Client computer described in the identification record of reading equipment terminates to call the relevant information of described read-only device.
Additionally, the method also includes:
Relevant information and/or the client computer of read-only device described in the client calls according to described record terminate
The relevant information calling described read-only device determines do not have other client computer to be called by described data area
Described read-only device, and terminate calling the primary driving of described read-only device, discharge described data area.
Another aspect of the present invention additionally provides a kind of method calling read-only device, and described method includes: to
Main frame sends read-only device call request, carries the mark of read-only device in the call request of described read-only device
Know, so that described main frame calls the primary driving of described read-only device, and in memory headroom, distribute data
The data of described read-only device are deposited in region;Receive the address of the described data area that described main frame sends;
Address according to described data area obtains the data of described read-only device from described data area.
Additionally, described method also includes: send the request terminating to call read-only device, described knot to main frame
Bundle calls the mark carrying described read-only device in the request of described read-only device;So that main frame is according to institute
State the mark terminating to call the read-only device in the request of described read-only device and terminate calling described read-only set
Standby primary driving, and discharge described data area.
A kind of main process equipment for calling read-only device of further aspect of the present invention, described main process equipment bag
Include: data area allocation unit, for being described read-only device distribution data area in memory headroom,
For depositing the data of described read-only device;Transmitting element, for sending described data area to client computer
Address, in order to client computer obtains described read-only according to the address of described data area from described data area
The data of equipment.
Additionally, described main process equipment also includes: receive unit, for read-only the setting of subscribing client transmission
Standby call request, described call request comprises the mark of described read-only device;Control unit, for basis
The mark of described read-only device determines whether to be that described read-only device is assigned with data area;Map single
Unit, determines not yet for described for the relevant information of read-only device described in the client calls according to record
During reading equipment distribution data area, call the primary driving of described read-only device;Described data area is distributed
Unit specifically for: to memory headroom send distribution data area request, in order to described memory headroom is
The data of described read-only device, wherein said distribution data are deposited in described read-only device distribution data area
Region request comprises the mark of described read-only device;And receive the described data area that memory headroom returns
Address.
Additionally, described data area allocation unit is further used for, in described control unit according to record
The relevant information of client calls read-only device determines to be that described read-only device is assigned with data area
Time, obtain the address of described data area.
Additionally, described control unit is further used for recording the relevant letter of read-only device described in client calls
Breath.
Additionally, described reception unit is additionally operable to: the end receiving the transmission of described client computer is called described read-only
The request of equipment, comprises mark and the mark of described read-only device of the client computer of the request of sending in this request
Know;Described control unit is additionally operable to: that calls in the request of described read-only device according to described end is read-only
Client computer described in the identification record of equipment terminates to call the relevant information of described read-only device, according to described note
Relevant information and/or the client computer of the client calls read-only device of record terminate to call described read-only device
Relevant information determines does not has other client computer to call described read-only device by described data area;Described reflect
Penetrate unit and be additionally operable to terminate calling the primary driving of described read-only device;Described data area allocation unit is released
Put described data area.
According to embodiments of the present invention, by distributing data area for read-only device, in order to multiple clients
When machine calls this read-only device, these client computer can be set up with this data area respectively and be connected, and directly
The data of read-only device are obtained from this data area.Thus avoid each client computer directly to be grasped by main frame
Make this read-only device, and carried out data relay by main frame, thus simplify that multiple client calls is read-only to be set
Standby process, improves running efficiency of system.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out
Clearly and completely describe, it is clear that described embodiment be a part of embodiment of the present invention rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making wound
The every other embodiment obtained under the property made work premise, broadly falls into the scope of protection of the invention.
Virtual machine in the embodiment of the present invention may operate on processor, it is also possible to is performed by processor
The method of the embodiment of the present invention.Multiple virtual machine can be run on same processor and can also run one
Virtual machine.In embodiments of the present invention, for sake of convenience, by the virtual machine with read-only device direct correlation
It is referred to as main frame, and other virtual machines such as virtual machine being obtained the data of read-only device by main frame are referred to as visitor
Family machine.
When multi-client shares read-only device, due to read-only device in the data of synchronization to client computer
For be indiscriminate, i.e. different client computer required read-only device data are identical, the most permissible
Directly the data of read-only device are passed to client computer, carry out the transfer of data without main frame.The present invention
Embodiment, based on such design, can simplify the process of client calls read-only device in this way,
Reduce system resources consumption, improve system effectiveness.
Fig. 1 is the flow chart of the method for the embodiment of the present invention.As it is shown in figure 1, it is read-only in client calls
During equipment, the method for the embodiment of the present invention includes:
110: main frame is that described read-only device distributes data area in memory headroom, is used for depositing described
The data of read-only device.Read-only device can include but be not limited only to gather the photographic head of image, collection
The mike of sound, CD drive, it is also possible to be temperature sensor, humidity collection instrument etc. some be not required to
Want the data acquisition equipment that data input.
Then, method includes:
120: send the address of described data area to client computer, in order to client computer is according to described data field
The address in territory obtains the data of described read-only device from described data area.
According to embodiments of the present invention, by distributing data area for read-only device, in order to multiple clients
When machine calls this read-only device, these client computer can be set up with this data area respectively and be connected, and directly
The data of read-only device are obtained from this data area.Thus avoid each client computer directly to be grasped by main frame
Make this read-only device, and carried out data relay by main frame, thus simplify that multiple client calls is read-only to be set
Standby process, improves running efficiency of system.
Specific implementation below in conjunction with the embodiment of the present invention describes in further detail present invention enforcement
The principle of example.
Fig. 2 is the flow chart of an object lesson of the embodiment of the present invention.In fig. 2, with photographic head it is
Example illustrates the method for client calls read-only device.As in figure 2 it is shown, client calls read-only device
Method includes:
210: the read-only device call request that main frame subscribing client sends, described call request comprises institute
State the mark of read-only device.Here, main frame subscribing client calls the request of photographic head, this request bag
Mark containing photographic head.
220: main frame determines whether to be that described read-only device is assigned with according to the mark of read-only device
Data area.It is to say, main frame determines whether that other client computer are calling this photographic head.
Concrete, can be according to whether there is the relevant information of the client calls read-only device of record in main frame
Determine whether to be that described read-only device is assigned with data area, if it has, be described read-only
Equipment is assigned with data area, if it is not, be not yet that described read-only device distributes data area.This
Outward, main frame can also be according to the relevant information of the described read-only device of record, it is determined whether be described
Read-only device is assigned with data area.Such as, the mark, read-only for this of read-only device described in host record
Whether the address of data area of equipment distribution, the size of this data area, this data area are released.
If detecting host have recorded address and the size information of the data area distributed for described read-only device, and
This data area is not released, then it is assumed that be that described read-only device is assigned with data area, if should
Data area is released, then it is assumed that be not yet that described read-only device distributes data area.
Further, when being not yet described read-only device distribution data area, described method arrival 230:
Main frame calls the primary driving of described read-only device.It is to say, main frame calls the primary driving of photographic head.
Primary driving mentioned here refers to the driving of the read-only device run on main frame.It is being read-only
In the case of equipment (such as photographic head) is assigned with data area, method jumps directly to notify client computer
Step 250.
Then, 240: send the request of distribution data area to memory headroom, it is used for distributing data area
Depositing the data of described read-only device, the request of wherein said distribution data area comprises the mark of read-only device,
So that memory headroom is described read-only device distributes memory space.Further, described distribution data field
Territory request can also comprise the data area size information of distribution, in order in memory headroom, distribution is certain
The data of read-only device (such as photographic head) are deposited in the data area of capacity.
Then, 250: main frame receives the address of the data area that memory headroom returns, and to described client
Machine sends the address of described data area, in order to described client computer according to the address of described data area from
Described data area obtains the data of described read-only device.Such as, storage photographic head is sent to client computer
The address of the data area of data so that client computer according to the address of described data area from described data field
Territory obtains the data of the photographic head of storage.According to other embodiments of the invention, it is also possible to described client computer
Send the size information of described data area.Client computer is receiving the number for photographic head distribution that main frame sends
After the address in region, set up with described data area and be connected, later when needs call photographic head,
Photographic head data are directly obtained from this data area.
Hereafter, 260: the relevant information of host record client calls read-only device (such as photographic head).
Such as, host record read-only device (such as photographic head) mark, for read-only device distribution data field
The address in territory, the information such as size of this data area;Or, in simple cases, shooting will be called
The Number of Clients of head adds one;Or only record the mark of the client computer calling read-only device (such as photographic head).
Fig. 3 be the embodiment of the present invention object lesson in terminate to call the process of read-only device.Such as Fig. 3 institute
Showing, the method terminating to call read-only device includes:
310: the request of described read-only device is called in the end that subscribing client sends.Such as, main frame connects
The request of photographic head is called in the end receiving client computer transmission.This request terminating to call described read-only device
In comprise the mark of client computer and the mark of described photographic head of the request of sending.
320: main frame calls the mark of read-only device in the request of described read-only device according to described end
Record described client computer and terminate to call the relevant information of described read-only device.Such as, host record terminates to adjust
Read-only device (such as photographic head) mark, for read-only device distribution data area address,
The information such as the size of this data area;Or, client calls read-only device relevant of aforementioned record
Information is added the identification information terminating to call;Or, in simple cases, photographic head will be called
Number of Clients subtracts one;Or the methods such as the mark of the client computer calling read-only device of deletion record.
330: according to relevant information and/or the client computer of read-only device described in the client calls of described record
The relevant information terminating to call described read-only device determines do not have other client computer by described data area
Call described read-only device, and terminate calling the primary driving of described read-only device, discharge described data field
Territory.According to embodiments of the present invention, can according to the relevant information of the client calls photographic head of host record,
Client computer terminates to call the relevant information of photographic head and determines whether still have client computer calling photographic head.
Or, in simple cases, whether main frame is equal to according to the number of the client computer calling photographic head
Zero judges whether still have client computer calling photographic head.Client computer described here is calling shooting
Head refers to obtain photographic head data by described data area.
340: main frame terminates calling the primary driving of described read-only device.
350: main frame is released to the data area that described read-only device (such as: photographic head) distributes, and
Record discharges the information of described data area.
Fig. 4 is the flow chart of the method for the embodiment of the present invention.Embodiment illustrated in fig. 4 is for going out from client computer
Send out the principle that point illustrates the method for the embodiment of the present invention.
As shown in Figure 4, the method for the embodiment of the present invention includes:
410: client computer sends read-only device call request, the call request of described read-only device to main frame
In carry the mark of read-only device so that described main frame according to the mark of described read-only device call described only
The primary driving of reading equipment, and in memory headroom, distribute the number that described read-only device is deposited in data area
According to;
420: client computer receives the address of the described data area that described main frame sends;
430: client computer obtains described read-only set according to the address of described data area from described data area
Standby data.
According to embodiments of the present invention, method can further include:
440: client computer sends the request terminating to call read-only device to main frame, described end is called described
The request of read-only device is carried the mark of described read-only device, in order to main frame calls according to described end
The mark of the read-only device in the request of described read-only device terminates calling the primary of described read-only device and drives
Dynamic, and discharge described data area.
According to embodiments of the present invention, by distributing data area for read-only device, in multiple client calls
During this read-only device, these client computer can be set up with this data area respectively and be connected, and directly from this number
Obtain the data of read-only device according to region, avoid carrying out data by the main frame of directly this read-only device of operation
Transfer, simplifies the process of multiple client calls read-only device, improves running efficiency of system.Fig. 5
It it is the schematic block diagram of the main process equipment 500 of the method realizing the embodiment of the present invention.As it is shown in figure 5,
Main process equipment 500 includes: data area allocation unit 510, and being used for is described read-only in memory headroom
Equipment distribution data area, for depositing the data of described read-only device;Transmitting element 520, for
Client computer sends the address of described data area, in order to client computer according to the address of described data area from institute
State data area and obtain the data of described read-only device.
Fig. 6 is the schematic diagram that the main process equipment of the embodiment of the present invention refines further.Such as Fig. 6 institute
Showing, main process equipment 500 also includes: receive unit 530, the read-only device sent for subscribing client
Call request, described call request comprises the mark of described read-only device;Control unit 540, for root
Determine whether to be that described read-only device is assigned with data area according to the mark of described read-only device;Map
Unit 550, for control unit 540 according to the relevant letter of read-only device described in the client calls of record
When breath determines not yet for described read-only device distribution data area, call the primary driving of described read-only device;
Described data area allocation unit 510 is asked specifically for sending distribution data area to memory headroom, with
Being easy to described memory headroom is that described read-only device distribution data area is to deposit the number of described read-only device
According to, the request of wherein said distribution data area comprises the mark of described read-only device;And it is empty to receive internal memory
Between the address of described data area that returns.
Additionally, described data area allocation unit 510 is further used in control unit 540 according to record
The relevant information of client calls read-only device determine to be that described read-only device is assigned with data field
During territory, obtain the address of described data area.
Described control unit 540 is further used for recording the relevant information of read-only device described in client calls.
The sign that such as records described read-only device, the address of the data area distributed for described read-only device and should
The size information etc. of data area;Or, in simple cases, use is imaged by control unit 540
The Number of Clients of head adds one;Or only record the mark of the client computer calling read-only device (such as photographic head)
Know.According to other embodiments of the invention, transmitting element 520 can also send described number to described client computer
Size information according to region.
According to embodiments of the present invention, described reception unit 530 is additionally operable to receive the knot that described client computer sends
Bundle calls the request of described read-only device, comprises mark and the institute of the client computer of the request of sending in this request
State the mark of read-only device;Described control unit 540 is additionally operable to: call described read-only according to described end
Client computer described in the identification record of the read-only device in the request of equipment terminates to call described read-only device
Relevant information, relevant information and/or client computer according to the client calls read-only device of described record terminate
The relevant information calling described read-only device determines do not have other client computer to be called by described data area
Described read-only device;The mark of the described read-only device that such as record end is called, for described read-only device
The data area of distribution, the information such as size of this data area;Or, the client computer at aforementioned record is adjusted
With the relevant information of read-only device is added the identification information terminating to call;Or, in simple cases,
The Number of Clients calling photographic head is subtracted one;Or delete to send and terminate to call asking of described read-only device
The mark of the client computer asked.Described map unit 550 is additionally operable to terminate calling the primary of described read-only device
Drive, and described data area allocation unit 510 discharges described data area.
Additionally, described control unit 540 is further used for record discharges the information of described data area.
Ordinary skill people personnel are appreciated that method and system disclosed herein is merely illustrative
Character, and the process that method is comprised is not limited to the order described in literary composition, but can be according to specifically
Need and the convenience of technology realization is adjusted.In addition to the above-mentioned content enumerated, according to specifically
The needs of application scenario, described method and system can also include other processes and module.
Those of ordinary skill in the art are it is to be appreciated that combine each of the embodiments described herein description
The unit of example and algorithm steps, it is possible to come real with electronic hardware, computer software or the combination of the two
Existing, in order to clearly demonstrate the interchangeability of hardware and software, the most according to function one
As property describe composition and the step of each example.These functions are held with hardware or software mode actually
OK, application-specific and the design constraint of technical scheme are depended on.Professional and technical personnel can be to each
Specifically should be used for using different methods to realize described function, but this realization is it is not considered that surpass
Go out the scope of the present invention.
The method described in conjunction with the embodiments described herein or the step of algorithm can use hardware, process
The software module that device performs, or the combination of the two implements.Software module can be placed in random access memory
(RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable
In ROM, depositor, hard disk, moveable magnetic disc, CD-ROM or technical field well known to any
In the storage medium of other form.
Although having shown that and describing some embodiments of the present invention, it is understood by one skilled in the art that
Without departing from the principles and spirit of the present invention, these embodiments can be carried out various amendment, this
The amendment of sample should fall within the scope of the present invention.