CN105511813A - Method, device and system for accessing server disk - Google Patents

Method, device and system for accessing server disk Download PDF

Info

Publication number
CN105511813A
CN105511813A CN201510921157.2A CN201510921157A CN105511813A CN 105511813 A CN105511813 A CN 105511813A CN 201510921157 A CN201510921157 A CN 201510921157A CN 105511813 A CN105511813 A CN 105511813A
Authority
CN
China
Prior art keywords
server
terminal
disk
data content
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510921157.2A
Other languages
Chinese (zh)
Inventor
艾菲
覃冠日
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Beijing Qianxin Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Beijing Qianxin Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Beijing Qianxin Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510921157.2A priority Critical patent/CN105511813A/en
Publication of CN105511813A publication Critical patent/CN105511813A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from or digital output to record carriers, e.g. RAID, emulated record carriers, networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from or digital output to record carriers, e.g. RAID, emulated record carriers, networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device

Abstract

The invention discloses a method, a device and a system for accessing a server disk and relates to the technical field of internet in order to solve the problem that a large number of terminals access the server disk simultaneously. The method comprises steps as follows: a terminal accesses a server memory and reads data content; if the data content is stored in the server memory, a server returns the data content in the server memory to the terminal; if the data content is not stored in the server memory, the terminal requests the server for locking; if the server does not lock another terminal, the server starts a locking program to lock the terminal; the terminal after locking accesses the server disk and reads the data content; if the server locks another terminal, the terminal requests the server for locking again after the another terminal is unlocked. The method, the device and the system for accessing the server disk are mainly applied to an intranet management process of an enterprise.

Description

Method, the Apparatus and system of access services device disk
Technical field
The present invention relates to Internet technical field, particularly relate to a kind of method, Apparatus and system of access services device disk.
Background technology
The situation of the same resource of multiple terminal to server requests is usually there is in corporate intranet.Such as, employee's computer upgrades virus base to server request, or acquisition request monitoring configuration information.In prior art, the data resource of terminal request is stored on the disk of server usually, and different terminals connects with server respectively, access services device disk, reads the data resource needed.
Because each terminal is independent of server initiation disk access requests, therefore the read-write pressure of server disk is very huge.For reducing the read-write pressure of server disk, people improve existing access mode: the data resource that terminal needs is buffered in server memory by server, when terminal request data resource, server reads this data resource and returns to terminal from internal memory.This mode effectively can reduce the number of times of terminal access server disk.But the mode reading data resource from server memory also exists certain problem: server memory cannot carry out persistence to data, when after server cleaning internal memory, the data resource of terminal request no longer exists.According to existing implementation, terminal still needs access services device disk to read.This will cause great amount of terminals at simultaneously access services device disk in a flash, can cause larger impact to server disk.
Summary of the invention
The invention provides a kind of method, Apparatus and system of access services device disk, the problem of great amount of terminals simultaneously access services device disk can be solved.
For solving the problem, first aspect, the invention provides a kind of method of access services device disk, the method is applied to end side, and the method comprises:
Access services device internal memory, reads data content;
If server memory does not preserve data content, then lock to server request;
If server does not lock to other-end, then access services device disk after locking, reads data content;
If server locks to other-end, then wait for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
Second aspect, present invention also offers a kind of method of access services device disk, the method is applied to server side, and the method comprises:
The request of data that receiving terminal sends, request of data is used for the data content of request server side;
If preserve data content in server memory, then the data content in server memory is returned to terminal;
If do not preserve data content in server memory, then start the program that locks and terminal is locked, to make the terminal access server disk be under locking state, obtain data content, and the other-end wait do not locked is locked;
Wherein, the program that locks only allows a terminal access server disk on synchronization.
The third aspect, present invention also offers a kind of device of access services device disk, this device is positioned at end side, and this device comprises:
Read-write cell, for access services device internal memory, reads data content;
Request unit, for when server memory does not preserve data content, locks to server request;
Read-write cell, for when server does not lock to other-end, access services device disk after locking, reads data content;
Request unit, for when server locks to other-end, waits for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
Fourth aspect, present invention also offers a kind of device of access services device disk, this device is positioned at server side, and this device comprises:
Receiving element, for the request of data that receiving terminal sends, request of data is used for the data content of request server side;
Transmitting element, for when preserving data content in server memory, returns to terminal by the data content in server memory;
Add solution lock unit, for when not preserving data content in server memory, starting the program that locks and terminal is locked, to make the terminal access server disk be under locking state, obtain data content, and the other-end wait do not locked is locked;
Wherein, the program that locks only allows a terminal access server disk on synchronization.
5th aspect, present invention also offers a kind of system of access services device disk, this system comprises terminal and server, wherein:
This terminal comprises the device of above-mentioned third aspect indication;
This server comprises the device of above-mentioned fourth aspect indication.
Method, the Apparatus and system of access services device disk provided by the invention, can when terminal needs the data content of request server side, first make terminal access server memory, if preserve this data content in server memory, then data content is returned to terminal by server; If do not store this data content in server memory, then terminal access server disk.Before access services device disk, first terminal will lock to server request, and terminal is ability access services device disk after locking only, otherwise waiting for server asks after unlocking other-end to lock again.The present invention by the terminal quantity of the degree limiting access server disk that locks, synchronization can only allow a terminal access server disk.Compared with prior art, no matter the terminal quantity of access services device disk has how many, on synchronization, the terminal quantity of request call server disk I/O mouth all can not more than one, and therefore the present invention effectively can eliminate great amount of terminals and access the impact caused server disk simultaneously.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the method flow diagram of the first access services device disk that the embodiment of the present invention provides;
Fig. 2 shows the method flow diagram of the second access services device disk that the embodiment of the present invention provides;
Fig. 3 shows the method flow diagram of the third access services device disk that the embodiment of the present invention provides;
Fig. 4 shows the method flow diagram of the 4th kind of access services device disk that the embodiment of the present invention provides;
Fig. 5 shows the composition frame chart of the device of the first access services device disk that the embodiment of the present invention provides;
Fig. 6 shows the composition frame chart of the device of the second access services device disk that the embodiment of the present invention provides;
Fig. 7 shows the composition frame chart of the device of the third access services device disk that the embodiment of the present invention provides;
Fig. 8 shows the system schematic of a kind of access services device disk that the embodiment of the present invention provides.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Embodiments provide a kind of method of access services device disk, the method is applied to end side.As shown in Figure 1, the method comprises:
101, access services device internal memory, reads data content.
When terminal needs to (virus base that such as will upgrade) during certain data content of server request, terminal to server initiates transmission control protocol (TransmissionControlProtocol, be called for short TCP) connect, after three-way handshake, complete TCP establishment of connection between server and terminal, terminal to server sends the request of data of carrying data content mark.Server is searched should the data content of content identification at internal memory, if be cached with this data content, then the data content found is returned to terminal by server.If do not have this data content of buffer memory, then terminal performs step 102, and request locks and access services device disk.
In the present embodiment, if server does not have the corresponding data content of buffer memory, server can send a notice based on TCP connection to terminal, informs in terminal server internal memory and does not store this data content, and terminal starts execution step 102 according to this notice.Or server also can not notify to terminal server, terminal initiating not receive data content in the preset duration after request of data, then automatically performs step 102.
If 102 server memory do not preserve data content, then lock to server request.
Server side is disposed a set of program that locks, this program is used for locking to the terminal of access services device disk, only having can access services device disk by the terminal that locks, then cannot access services device disk by the terminal (such as waiting for the terminal locked) locked.In the present embodiment, the program that locks of server only allows a terminal access server disk on synchronization.Effectively can prevent great amount of terminals access services device disk simultaneously thus.
In a kind of implementation of the present embodiment, the program of locking is spin lock program.Spin lock provides a kind of mechanism of resource being carried out to mutual exclusion use, namely at any time, can only allow at most keeper's access resources, also just says, a performance element can only be had at most at any time to obtain and lock.
If 103 servers do not lock to other-end, then access services device disk after locking, reads data content.
The program free time if locked, namely current do not have other-end to lock access services device disk, then server performs the program that locks and locks to asking the terminal locked.After completing and locking, terminal is allowed to access services device disk, to the data content therefrom reading corresponding content mark.
If 104 servers lock to other-end, then wait for that other-end locks to server request after unlocking again.
If the program that locks is occupied, namely current exist other-end and use and to lock service access server disk, then server does not respond the locking request of terminal.Before not receiving the response that locks, terminal is in the state of continuous wait, and waiting for server unlocks the locking request of rear this terminal of response to other-end.
When after the access that the other-end locked completes server disk, server unlocks the same, the program that locks after the unblock free time, and server equity terminal to be locked locks, to make the terminal access server disk after locking.
When there being multiple terminal wait to lock, server can respond according to asking the locking request of sequencing to each terminal locked, and also can carry out according to the priority height of terminal or marking height the response that locks.Wherein, marking refers to the marking for business that end side provides, and user can give a mark to request of data according to the business demand of self, and mark is higher, and to represent business more urgent.Mark is together sent to server when reported data request by terminal.
The method of the access services device disk that the embodiment of the present invention provides, can when terminal needs the data content of request server side, first make terminal access server memory, if preserve this data content in server memory, then data content is returned to terminal by server; If do not store this data content in server memory, then terminal access server disk.Before access services device disk, first terminal will lock to server request, and terminal is ability access services device disk after locking only, otherwise waiting for server asks after unlocking other-end to lock again.The embodiment of the present invention by the terminal quantity of the degree limiting access server disk that locks, synchronization can only allow a terminal access server disk.Compared with prior art, no matter the terminal quantity of access services device disk has how many, on synchronization, the terminal quantity of request call server disk I/O mouth all can not more than one, and therefore the embodiment of the present invention effectively can be eliminated great amount of terminals and access the impact caused server disk simultaneously.
Further, the embodiment of the present invention additionally provides a kind of method of access services device disk, and the method is applied to server side.As shown in Figure 2, the method comprises:
201, the request of data of receiving terminal transmission.
Setting up after TCP is connected with terminal, the request of data that server receiving terminal sends, carries the content identification that terminal needs the data content of request, for the data content of request server side in this request of data.Server searches the data content of terminal needs according to this content identification.
When there being multiple terminal to server to send request of data, server responds terminal according to the sequencing receiving request of data.Certainly, in some implementations, server also can determine response order according to the priority height of terminal, or determines response order according to terminal scoring height.Marking refers to the marking for business that end side provides, and user can give a mark to request of data according to the business demand of self, and mark is higher, and to represent business more urgent.Mark is together sent to server when reported data request by terminal.
If preserve data content in 202 server memory, then the data content in server memory is returned to terminal.
Server is after receiving request of data, and in internal memory, first search the data content of corresponding content mark, if be cached with this data content in internal memory, then server responds terminal, and the data content found is returned to terminal.
When there being multiple terminal request data content, server can respond each terminal one by one according to order such as request sequencing or priority etc., and the data content of buffer memory is sent to each terminal.Also when there is parallel processing condition, all terminals can be responded simultaneously.
If do not preserve data content in 203 server memory, then start the program that locks and terminal is locked.
In a kind of implementation of the present embodiment, the program of locking is spin lock program.When multiple terminal request data content, and when the data content of request is not buffered in server memory, server locks to some terminals, makes its access services device disk, and makes other-end be in waiting status by locking mechanisms.To the selection mode of certain terminal can be:
1, according to the sequencing receiving request of data, the terminal corresponding to the request of data received at first locks.
2, according to terminal PRI order from high to low, the terminal the highest to priority locks.
3, according to marking order from high to low, the highest terminal of marking is locked.
In the present embodiment, the program that locks only allows a terminal access server disk on synchronization.The while of can ensureing there is multiple terminal thus, the situation of access services device disk occurs.
Complete the access of server disk in the terminal that locks, after obtaining data content, server unlocks this terminal, then locks to next terminal, makes next terminal access server disk.Can determine according to the sortord provided in above-mentioned 1,2 or 3 selection of next terminal, the present embodiment repeats no more this.
The method of the access services device disk that the embodiment of the present invention provides, can when terminal needs the data content of request server side, first make terminal access server memory, if preserve this data content in server memory, then data content is returned to terminal by server; If do not store this data content in server memory, then terminal access server disk.Before access services device disk, first terminal will lock to server request, and terminal is ability access services device disk after locking only, otherwise waiting for server asks after unlocking other-end to lock again.The embodiment of the present invention by the terminal quantity of the degree limiting access server disk that locks, synchronization can only allow a terminal access server disk.Compared with prior art, no matter the terminal quantity of access services device disk has how many, on synchronization, the terminal quantity of request call server disk I/O mouth all can not more than one, and therefore the embodiment of the present invention effectively can be eliminated great amount of terminals and access the impact caused server disk simultaneously.
Further, as the refinement of method shown in Fig. 1 or Fig. 2, the embodiment of the present invention additionally provides a kind of method of access services device disk, and the method relates to terminal and server both sides.As shown in Figure 3, the method comprises:
301, terminal access server memory, reads data content.
If preserve data content in 302 server memory, then the data content in server memory is returned to terminal by server.
If 303 server memory do not preserve data content, then terminal to server request locks.
Can in the face of two kinds of situations when terminal to server request locks, the program that locks of first server side is taken by other-end, performs step 304 in this case; It two is that the program that locks of server side is not taken by other-end, performs step 305 in this case to step 309.
If 304 servers lock to other-end, then terminal wait other-end locks to server request after unlocking again.
When the program of locking is taken by other-end, server does not respond the locking request of terminal, and terminal is in the state of continuous wait, after waiting for that other-end unlocks, and takes turns to when locking to this terminal, performs step 305 to step 309.
Further, may run into such problem in practical application: the terminal quantity to server request data content is more, the time that certain terminal wait locks may be very long, and the longer stand-by period cannot be received by terminal side service service quality.Therefore in a kind of improved procedure of the present embodiment, if if still successfully do not locked after waiting for a period of time, so terminal can abandon wait for, prevent TCP from connecting thus take for a long time and user indefinite duration wait.Certain this mode is unsuccessfully that cost realizes with request of data.Concrete, server can when terminal request locks, and for terminal starts a timer, record terminal locks initial to current waiting time from request.When waiting time exceedes default maximum wait duration (such as 1 minute, or 30 seconds), server stops timing, sends one cancel the notice waited for this terminal.Terminal is no longer waited for after receiving notice and being locked, forward end return data request failure.
Or terminal starts a timer when request locks, record terminal locks initial to current waiting time from request.Also do not receive the response that locks of server when waiting time exceedes default maximum wait duration, terminal to server sends the notice cancelled and waiting for, and forward end return data request failure.
If 305 servers do not lock to other-end, the startup of server program that locks locks to terminal.
306, terminal access services device disk after locking, reads data content.
307, after reading data content, terminal notification server unlocks, so that server locks to other-end.
308, server unlocks terminal.
309, server equity other-end to be locked locks.
In the present embodiment, when the overlong time that terminal wait locks, terminal can initiatively or passive wait of abandoning lock, what prevent TCP from connecting thus takies and the wait in indefinite duration of user for a long time.
Further, as the refinement of method shown in Fig. 1 or Fig. 2, the embodiment of the present invention additionally provides a kind of method of access services device disk, and the method relates to terminal and server both sides.With method shown in Fig. 3 unlike, in the method, after the terminal of first access services device disk reads data content, this data content is written in server memory.Thus, other-end just directly can obtain data content by access services device internal memory, and locks without the need to request or waiting for server.As shown in Figure 4, the method comprises:
401, terminal access server memory, reads data content.
If preserve data content in 402 server memory, then the data content in server memory is returned to terminal by server.
If 403 server memory do not preserve data content, then terminal to server request locks.
If 404 servers lock to other-end, then terminal access services device internal memory again.
In scheme shown in Fig. 3, if server locks to other-end, then terminal wait server is to the unblock of other-end, the access services that then locks device disk.And in the present embodiment, the data content obtained from disk after the terminal of first request msg content completes the access to server disk, can be buffered in server memory by server.To wait for that the terminal locked directly obtains this data content from server memory, and need not conduct interviews to server disk again, reduce the access times of server disk thus, reduce the load pressure of server disk further.
Concrete, when when terminal request locks, the program that locks of server is occupied, terminal can voluntarily or the notice access services device internal memory again returned according to server.If other-end obtains this data content from server disk after step 401, so this data content can be written in server memory by server.At this moment terminal again access services device internal memory just can get this newly-increased data content.
If have data content newly-increased in 405 server memory, then terminal reads data content.
406, terminal cancellation locks to server request again.
After get this data content from server memory, terminal is without the need to waiting for the access services device disk that locks again, and therefore terminal cancellation locks to server request again.
If still do not preserve data content in 407 server memory, then terminal locks to server request again.
If still do not preserve data content in server memory, then represent that this terminal is the terminal of first this data content of request.For getting data content, terminal must lock to server request, with access services device disk.
If 408 servers do not lock to other-end, the startup of server program that locks locks to terminal.
409, terminal access services device disk after locking, reads data content.
410, after the access completed server disk in terminal, the data content read from server disk is written in server memory by server.
Thus, when the same data content of follow-up other-end request, this data content can be obtained by performing step 401, and without the need to performing step 402 to step 410.
Further, as the realization to method shown in Fig. 1, Fig. 3 and Fig. 4, the embodiment of the present invention additionally provides a kind of device of access services device disk, and this device is positioned at end side, or still sets up data interaction relation with terminal independent of terminal.As shown in Figure 5, this device comprises: read-write cell 51 and request unit 52.Wherein,
Read-write cell 51, for access services device internal memory, reads data content;
Request unit 52, for when server memory does not preserve data content, locks to server request;
Read-write cell 51, for when server does not lock to other-end, access services device disk after locking, reads data content;
Request unit 52, for when server locks to other-end, waits for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
Further, read-write cell 51, for:
After other-end unlocks, access services device internal memory again;
There is data content if newly-increased in server memory, then read data content;
Request unit 52, locks to server request again for cancelling.
Further, request unit 52, for when still not preserving data content in server memory, locks to server request again.
Further, request unit 52, at access services device disk, after reading data content, announcement server unlocks, so that server locks to other-end.
Further, request unit 52 asks the program of locking performed to be spin lock program.
The device of the access services device disk that the embodiment of the present invention provides, can when terminal needs the data content of request server side, first make terminal access server memory, if preserve this data content in server memory, then data content is returned to terminal by server; If do not store this data content in server memory, then terminal access server disk.Before access services device disk, first terminal will lock to server request, and terminal is ability access services device disk after locking only, otherwise waiting for server asks after unlocking other-end to lock again.The embodiment of the present invention by the terminal quantity of the degree limiting access server disk that locks, synchronization can only allow a terminal access server disk.Compared with prior art, no matter the terminal quantity of access services device disk has how many, on synchronization, the terminal quantity of request call server disk I/O mouth all can not more than one, and therefore the embodiment of the present invention effectively can be eliminated great amount of terminals and access the impact caused server disk simultaneously.
Further, as the realization to method shown in Fig. 2, Fig. 3 and Fig. 4, the embodiment of the present invention additionally provides a kind of device of access services device disk, and this device is positioned at server side, or still sets up data interaction relation with server independent of server.As shown in Figure 6, this device comprises: receiving element 61, transmitting element 62, add separate lock unit 63.Wherein,
Receiving element 61, for the request of data that receiving terminal sends, request of data is used for the data content of request server side;
Transmitting element 62, for when preserving data content in server memory, returns to terminal by the data content in server memory;
Add and separate lock unit 63, for when not preserving data content in server memory, starting the program that locks and terminal being locked, to make the terminal access server disk be under locking state, obtain data content, and the other-end wait do not locked is locked;
Wherein, the program that locks only allows a terminal access server disk on synchronization.
Further, as shown in Figure 7, this device comprises read-write cell 64 further, for complete the access to server disk in terminal after, be written in server memory by the data content read from server disk, to make to clamp on, the other-end locked reads data content from server memory.
Further, add separate lock unit 63 for:
After the access that terminal completes server disk, terminal is unlocked;
The other-end that equity is to be locked locks.
Further, adding the program of locking of separating lock unit 63 execution is spin lock program.
The device of the access services device disk that the embodiment of the present invention provides, can when terminal needs the data content of request server side, first make terminal access server memory, if preserve this data content in server memory, then data content is returned to terminal by server; If do not store this data content in server memory, then terminal access server disk.Before access services device disk, first terminal will lock to server request, and terminal is ability access services device disk after locking only, otherwise waiting for server asks after unlocking other-end to lock again.The embodiment of the present invention by the terminal quantity of the degree limiting access server disk that locks, synchronization can only allow a terminal access server disk.Compared with prior art, no matter the terminal quantity of access services device disk has how many, on synchronization, the terminal quantity of request call server disk I/O mouth all can not more than one, and therefore the embodiment of the present invention effectively can be eliminated great amount of terminals and access the impact caused server disk simultaneously.
Further, as the realization to method shown in above-mentioned Fig. 1 to Fig. 4, the embodiment of the present invention additionally provides a kind of system of access services device disk, and as shown in Figure 8, this system comprises terminal 81 and server 82, wherein:
Terminal 81 comprises the device shown in above-mentioned Fig. 5, or still sets up data interaction relation with this device independent of this device;
Server 82 comprises the device shown in above-mentioned Fig. 6 or Fig. 7, or still sets up data interaction relation with this device independent of this device.
The system of the access services device disk that the embodiment of the present invention provides, can when terminal needs the data content of request server side, first make terminal access server memory, if preserve this data content in server memory, then data content is returned to terminal by server; If do not store this data content in server memory, then terminal access server disk.Before access services device disk, first terminal will lock to server request, and terminal is ability access services device disk after locking only, otherwise waiting for server asks after unlocking other-end to lock again.The embodiment of the present invention by the terminal quantity of the degree limiting access server disk that locks, synchronization can only allow a terminal access server disk.Compared with prior art, no matter the terminal quantity of access services device disk has how many, on synchronization, the terminal quantity of request call server disk I/O mouth all can not more than one, and therefore the embodiment of the present invention effectively can be eliminated great amount of terminals and access the impact caused server disk simultaneously.
Embodiments of the invention disclose:
A kind of method of A1, access services device disk, described method is applied to end side, it is characterized in that, described method comprises:
Access services device internal memory, reads data content;
If server memory does not preserve described data content, then lock to described server request;
If server does not lock to other-end, then access services device disk after locking, reads described data content;
If server locks to other-end, then wait for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
A2, method according to A1, is characterized in that, after other-end unlocks, described method comprises further:
Access services device internal memory again;
There is described data content if newly-increased in server memory, then read described data content;
Cancel and again locking to server request.
A3, method according to A2, is characterized in that, describedly again locks to server request, comprising:
If still do not preserve described data content in server memory, then again lock to server request.
A4, method according to A1, it is characterized in that, at access services device disk, after reading described data content, described method comprises further:
Announcement server unlocks, so that server locks to other-end.
A5, method according to any one of A1 to 4, is characterized in that, described in the program of locking be spin lock program.
A kind of method of B6, access services device disk, described method is applied to server side, it is characterized in that, described method comprises:
The request of data that receiving terminal sends, described request of data is used for the data content of request server side;
If preserve described data content in server memory, then the described data content in server memory is returned to described terminal;
If do not preserve described data content in server memory, then start the program that locks to lock to described terminal, to make the described terminal access server disk be under locking state, obtain described data content, and the other-end wait do not locked is locked;
Wherein, the program that locks described in only allows a terminal access server disk on synchronization.
B7, method according to B6, it is characterized in that, described method comprises further:
After the access that described terminal completes server disk, be written in server memory by the described data content read from server disk, to make to clamp on, the other-end locked reads described data content from server memory.
B8, method according to B6, it is characterized in that, described method comprises further:
After the access that described terminal completes server disk, described terminal is unlocked;
The other-end that equity is to be locked locks.
B9, method according to any one of B6 to 8, is characterized in that, described in the program of locking be spin lock program.
The device of C10, a kind of access services device disk, described device is positioned at end side, it is characterized in that, described device comprises:
Read-write cell, for access services device internal memory, reads data content;
Request unit, for when server memory does not preserve described data content, locks to described server request;
Described read-write cell, for when server does not lock to other-end, after locking, access services device disk, reads described data content;
Described request unit, for when server locks to other-end, waits for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
C11, device according to C10, is characterized in that, described read-write cell, for:
After other-end unlocks, access services device internal memory again;
There is described data content if newly-increased in server memory, then read described data content;
Described request unit, locks to server request again for cancelling.
C12, device according to C11, is characterized in that, described request unit is used for when still not preserving described data content in server memory, again locks to server request.
C13, device according to C10, is characterized in that, described request unit, and at access services device disk, after reading described data content, announcement server unlocks, so that server locks to other-end.
C14, device according to any one of C10 to 13, is characterized in that, the program of locking that described request unit requests performs is spin lock program.
The device of D15, a kind of access services device disk, described device is positioned at server side, it is characterized in that, described device comprises:
Receiving element, for the request of data that receiving terminal sends, described request of data is used for the data content of request server side;
Transmitting element, for when preserving described data content in server memory, returns to described terminal by the described data content in server memory;
Add solution lock unit, for when not preserving described data content in server memory, starting the program that locks and described terminal being locked, to make the described terminal access server disk be under locking state, obtain described data content, and the other-end wait do not locked is locked;
Wherein, the program that locks described in only allows a terminal access server disk on synchronization.
D16, device according to D15, it is characterized in that, described device comprises read-write cell further, for after the access that completes server disk in described terminal, be written in server memory by the described data content read from server disk, to make to clamp on, the other-end locked reads described data content from server memory.
D17, device according to D15, is characterized in that, described in add separate lock unit for:
After the access that described terminal completes server disk, described terminal is unlocked;
The other-end that equity is to be locked locks.
D18, device according to any one of D15 to 17, is characterized in that, described in add separate lock unit perform described in the program of locking be spin lock program.
The system of E19, a kind of access services device disk, described system comprises terminal and server, wherein:
Described terminal comprises the device according to any one of C10 to C14;
Described server comprises the device according to any one of D15 to D18.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
Be understandable that, the correlated characteristic in said method and device can reference mutually.In addition, " first ", " second " in above-described embodiment etc. are for distinguishing each embodiment, and do not represent the quality of each embodiment.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions of the some or all parts in the denomination of invention (as determined the device of website internal chaining grade) that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.

Claims (10)

1. a method for access services device disk, described method is applied to end side, it is characterized in that, described method comprises:
Access services device internal memory, reads data content;
If server memory does not preserve described data content, then lock to described server request;
If server does not lock to other-end, then access services device disk after locking, reads described data content;
If server locks to other-end, then wait for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
2. method according to claim 1, is characterized in that, after other-end unlocks, described method comprises further:
Access services device internal memory again;
There is described data content if newly-increased in server memory, then read described data content;
Cancel and again locking to server request.
3. method according to claim 2, is characterized in that, describedly again locks to server request, comprising:
If still do not preserve described data content in server memory, then again lock to server request.
4. method according to claim 1, is characterized in that, at access services device disk, after reading described data content, described method comprises further:
Announcement server unlocks, so that server locks to other-end.
5. method according to any one of claim 1 to 4, is characterized in that, described in the program of locking be spin lock program.
6. a method for access services device disk, described method is applied to server side, it is characterized in that, described method comprises:
The request of data that receiving terminal sends, described request of data is used for the data content of request server side;
If preserve described data content in server memory, then the described data content in server memory is returned to described terminal;
If do not preserve described data content in server memory, then start the program that locks to lock to described terminal, to make the described terminal access server disk be under locking state, obtain described data content, and the other-end wait do not locked is locked;
Wherein, the program that locks described in only allows a terminal access server disk on synchronization.
7. method according to claim 6, is characterized in that, described method comprises further:
After the access that described terminal completes server disk, be written in server memory by the described data content read from server disk, to make to clamp on, the other-end locked reads described data content from server memory.
8. a device for access services device disk, described device is positioned at end side, it is characterized in that, described device comprises:
Read-write cell, for access services device internal memory, reads data content;
Request unit, for when server memory does not preserve described data content, locks to described server request;
Described read-write cell, for when server does not lock to other-end, after locking, access services device disk, reads described data content;
Described request unit, for when server locks to other-end, waits for that other-end locks to server request after unlocking again;
Wherein, the program that locks of server only allows a terminal access server disk on synchronization.
9. a device for access services device disk, described device is positioned at server side, it is characterized in that, described device comprises:
Receiving element, for the request of data that receiving terminal sends, described request of data is used for the data content of request server side;
Transmitting element, for when preserving described data content in server memory, returns to described terminal by the described data content in server memory;
Add solution lock unit, for when not preserving described data content in server memory, starting the program that locks and described terminal being locked, to make the described terminal access server disk be under locking state, obtain described data content, and the other-end wait do not locked is locked;
Wherein, the program that locks described in only allows a terminal access server disk on synchronization.
10. a system for access services device disk, described system comprises terminal and server, wherein:
Described terminal comprises device as claimed in claim 8;
Described server comprises device as claimed in claim 9.
CN201510921157.2A 2015-12-11 2015-12-11 Method, device and system for accessing server disk Pending CN105511813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510921157.2A CN105511813A (en) 2015-12-11 2015-12-11 Method, device and system for accessing server disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510921157.2A CN105511813A (en) 2015-12-11 2015-12-11 Method, device and system for accessing server disk

Publications (1)

Publication Number Publication Date
CN105511813A true CN105511813A (en) 2016-04-20

Family

ID=55719833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510921157.2A Pending CN105511813A (en) 2015-12-11 2015-12-11 Method, device and system for accessing server disk

Country Status (1)

Country Link
CN (1) CN105511813A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109407987A (en) * 2018-10-18 2019-03-01 北京奇艺世纪科技有限公司 A kind of method for reading data and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364230A (en) * 2008-09-24 2009-02-11 金蝶软件(中国)有限公司 Concurrent access control method and device
US20110225373A1 (en) * 2010-03-11 2011-09-15 Hitachi, Ltd. Computer system and method of data cache management
CN103761240A (en) * 2013-12-12 2014-04-30 北京奇虎科技有限公司 Database access method and database access device
CN105138587A (en) * 2015-07-31 2015-12-09 小米科技有限责任公司 Data access method, apparatus and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364230A (en) * 2008-09-24 2009-02-11 金蝶软件(中国)有限公司 Concurrent access control method and device
US20110225373A1 (en) * 2010-03-11 2011-09-15 Hitachi, Ltd. Computer system and method of data cache management
CN103761240A (en) * 2013-12-12 2014-04-30 北京奇虎科技有限公司 Database access method and database access device
CN105138587A (en) * 2015-07-31 2015-12-09 小米科技有限责任公司 Data access method, apparatus and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109407987A (en) * 2018-10-18 2019-03-01 北京奇艺世纪科技有限公司 A kind of method for reading data and device

Similar Documents

Publication Publication Date Title
KR100625595B1 (en) Parallel Logging Method of Transaction Processing System
US20140081927A1 (en) Data node fencing in a distributed file system
KR20060079078A (en) Server queuing system and method
AU2003225991B2 (en) Retry technique for multi-tier network communication systems
US20110283366A1 (en) Method and system for preventing browser-based abuse
US10609123B2 (en) Hybrid quorum policies for durable consensus in distributed systems
US20170185678A1 (en) Crawler system and method
US20120303761A1 (en) Breakpoint continuous transmission method
CN105119973A (en) User information processing method and user information processing server
CN104219235A (en) Distributed transaction requesting method and device
CN102135895B (en) System upgrading method and system
US7877757B2 (en) Work item event monitor for procession of queued events
CN105373563B (en) Database switching method and device
US20020059316A1 (en) Method and apparatus for improving message availability in a subsystem which supports shared message queues
CN105511813A (en) Method, device and system for accessing server disk
JP2011520169A (en) Method and device for accessing a directory
JP3730545B2 (en) Service control application execution method and system
CN111818117A (en) Data updating method and device, storage medium and electronic equipment
CN103581349A (en) Domain name resolution method and device
CN106330988A (en) Resending method and apparatus for hypertext transfer request, and client
CN108897859A (en) A kind of metadata retrieval method, apparatus, equipment and computer readable storage medium
CN108256014A (en) Page display method and device
US10462258B2 (en) Resource download method, electronic device, and apparatus
CN108512930B (en) Shared file management method, device, server and storage medium
CN105471881A (en) Method, device and system for locking and unlocking requests

Legal Events

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

Application publication date: 20160420

RJ01 Rejection of invention patent application after publication