CN101132418B - Method and apparatus for client logoff in iSCSI system - Google Patents

Method and apparatus for client logoff in iSCSI system Download PDF

Info

Publication number
CN101132418B
CN101132418B CN2007101516718A CN200710151671A CN101132418B CN 101132418 B CN101132418 B CN 101132418B CN 2007101516718 A CN2007101516718 A CN 2007101516718A CN 200710151671 A CN200710151671 A CN 200710151671A CN 101132418 B CN101132418 B CN 101132418B
Authority
CN
China
Prior art keywords
file
client
memory device
self
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2007101516718A
Other languages
Chinese (zh)
Other versions
CN101132418A (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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2007101516718A priority Critical patent/CN101132418B/en
Publication of CN101132418A publication Critical patent/CN101132418A/en
Application granted granted Critical
Publication of CN101132418B publication Critical patent/CN101132418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This invention discloses a log-out method for UE in the iSCSI system including the following steps: a UE calculates operation of files stored on a storing device, when the UE receives a request of logout, it judges if operation is made to files on the storing device, if not, said UE logs out from the storing file. This invention also provides UE in the iSCSCI system.

Description

The cancellation method and the equipment of client in a kind of iSCSI system
Technical field
The present invention relates to communication technical field, relate in particular to the cancellation method and the equipment of client in a kind of iSCSI system.
Background technology
What portable data storage device used now is very frequent, as PDA (Personal DigitalAssistant, personal digital assistant), smart mobile phone, portable computer etc., what much carry in them is important data, if lose consequence SCSI (the Small Computer System Interface that to bring immeasurable loss and can't estimate, small computer system interface) standards system has defined the process of read-write operation between applied host machine and the external equipment, and external equipment comprises disk, tape, CD, printer, scanner etc.The reference model of SCSI standards system is a typical client-server model, in the SCSI architecture, usually client is called Initiator (originating end), and Initiator sends service request, as applied host machine; Server is called Target (destination end), and Target receives, the respond services request, as external equipment.Can use different physical connection modes to come communication between Initiator and the Target.
ISCSI (Internet SCSI, Internet Small Computer Systems Interface) be a kind of based on TCP (Transmission Control Protocol, transmission control protocol)/IP (Internet Procotol, Internet Protocol) SCSI host-host protocol, promptly Initiator and Target utilize the internet to transmit scsi command and data.At present, the iSCSI agreement is mainly used in the transfer of data of applied host machine and storage system, and typical applied environment is illustrated in fig. 1 shown below.Wherein, the integrated iSCSI Initiator module of applied host machine, an integrated iSCSI Target module in the storage system.Client in the iSCSI message, sends to storage system to scsi command and/or data encapsulation by IP network, and storage system is handled each iSCSI message, takes out data wherein and is written in the storage medium.
Problems of the prior art are, after part Initiator signs in to Target, do reading and writing data intact after, can't finish by the logout function on the Initiator (process that refers to Initiator or Target and the other side's break link or dialogue), report has data reading and writing can't the logout mistake.Come out and do not do data protection and some Initiator is direct logout, may cause data corruption.Usually only restart Initiator end equipment or restart Target end equipment and can finish the logout operation.
Reason that can't logout comprises: Initiator end file system is being used as the local disk use by the end of the Target on iSCSI carry resource, Initiator end file system can be visited the own data of file system on the Target end hard disk frequently, cause Initiator to find that reading and writing data is arranged always, do not allow user logout in order to prevent the imperfect mistake of data.Restarting the Target end can impact other user, and reads and writes data at every turn and all will restart Initiator and bring in other work that logout also will influence the user.In addition, do not do the data completeness and detect, the destruction that the Initiator of direct logout may cause the Target end data.
Summary of the invention
The invention provides the cancellation method and the equipment of client in a kind of iSCSI system, under the situation about not being destroyed that guarantees data integrity, safety is finished the cancellation of client and memory device timely and is operated.
For achieving the above object, the invention provides the cancellation method of client in a kind of iSCSI system, may further comprise the steps:
Connect memory device, obtain the mount point of resource in client self file system on the described memory device;
Client is added up the operation of file on the memory device; Specifically comprise: when detecting self file system, judge whether the path of described file is described mount point, be then to continue, otherwise do not carry out any operation and end the operation of file;
Path to described file is judged, judges that whether file path is the file or folder of file system to self creating, if then do not carry out any operation and end, otherwise continues;
Operation to described file is counted;
When described client receives de-registration request, judge whether to exist operation to file on the described memory device according to described statistics;
When described operation did not exist, described client was nullified from described memory device.
Wherein, describedly judge that whether file path is file system the step of the file or folder self created is specially:
Add up in advance for the related file or folder of self creating of self file system read-write;
When detecting self file system, judge whether the path of described file relates to the described related file or folder of adding up in advance of self creating of self file system read-write to the operation of file.
Wherein, the described step that the operation of file is counted is specially:
With the count increments of counter, the counting with described counter during EO successively decreased when file was operated, described operation comprise opening, close, create, deleting of file at least or copy in one or more.
When described client receives de-registration request, judge whether to exist step to be specially to the operation of file on the described memory device according to described statistics:
Judge whether described counting is zero, and the operation that is judged as file on the described memory device when being zero does not exist, otherwise is judged as the operation of existence to file on the described memory device.
The present invention also provides the client in a kind of iSCSCI system, be used to realize and memory device between the cancellation operation, it is characterized in that, comprising:
Statistic unit is used for the file operation that this client is carried out on memory device is added up, the basis for estimation during as cancellation;
Judging unit is used for when client receives de-registration request, and according to the statistics of described statistic unit, can judgement nullify operation; Judged result is for can nullify the time, and the notifier processes unit carries out the cancellation from the described memory device;
Processing unit when being used to receive the notice of described judging unit, is nullified from described memory device;
Described statistic unit further comprises:
Whether the first file path judging unit, the path of the file that is used to judge that this client is operated on described memory device are memory device at the mount point of self client, are then to notify the second file path judging unit, otherwise do not carry out any operation;
The second file path judging unit, whether the path of the file that is used to judge that this client is operated on memory device is the file or folder of file system to self creating, and is then not carry out any operation, otherwise the notifications count unit;
Counting unit, be used for the operation of file is counted, with count increments, counting successively decreases during EO when operating, represent that the file on the described memory device is not had operation when counting is zero, otherwise expression there is operation to carry out to the file on the described memory device.
Wherein, described client also comprises: the mount point acquiring unit is used for obtaining the mount point of described memory device in self file system, and described mount point information is offered the judgement that described statistic unit is used for file path.
Wherein, described client also comprises: shielding path setting unit is used for preestablishing for the related file or folder of self creating of self file system read-write, as the content of carrying out required shielding in the file operation statistics; When described statistic unit was added up the operation of file, the operation of the file of all needs shieldings that relates to described setting was all got rid of and is not charged to statistics.
Compared with prior art, the present invention has the following advantages:
Under the situation about not being destroyed that guarantees data integrity, safety is finished the cancellation operation of client and memory device timely, realized the differentiation of normal data read-write and file system data read-write, shielded the false judgment that the reading and writing data of file system causes for client when cancellation.
Description of drawings
Fig. 1 is the schematic diagram of iSCSI protocol application network environment in the prior art;
Fig. 2 is the cancellation method flow chart of client in the iSCSCI system among the present invention;
Fig. 3 is another flow chart of the cancellation method of client in the iSCSCI system among the present invention;
Fig. 4 is the structural representation of client in the iSCSCI system among the present invention.
Embodiment
The cancellation method of client may further comprise the steps as shown in Figure 2 in a kind of iSCSCI of the present invention system:
Step s201, client connect memory device, obtain the mount point of memory device in self system.
Step s202, client are added up the operation of file on the memory device.
This statistics need be distinguished normal data read-write and file system data read-write, reads and writes the false judgment that causes with the shielding file system data when nullifying.
This method of distinguishing is specially: preestablish for the related file or folder of self file system read-write, as the content of carrying out required shielding in the file operation statistics.When the operation of file was added up, the operation of the file or folder of every needs shielding that relates to this setting was all got rid of and is not charged to statistics.
Step s203, when receiving de-registration request, client judges whether to exist the operation to file on the memory device according to statistics.
Step s204, operation be not when existing, and client is nullified from memory device.
Below in conjunction with concrete application scenarios embodiments of the present invention are described.Wherein client is that Initiator represents that memory device is represented with Target.
Among the present invention, the cancellation method of client may further comprise the steps as shown in Figure 3 in a kind of iSCSCI system:
Step s301, Initiator start the back and obtain the mount point of Target resource in operating system by file system.
The implication of this mount point is meant: when showing as a new hard disk or new node device in the operating system of Target resource at Initiator, the path of this hard disk or node device is the mount point of Target resource in Initiator operating system
Step s302, Initiator obtain file system to the real time information of file operation (comprise and open, close, create, delete and action such as copy).By using the processing of filter Driver on FSD Monitoring Files or the kernel code of revised file system all can realize this purpose to operating system.
Step s303, Initiator judge the path of source file and file destination, judge whether file path is Initiator resource mount point, if file path is not under the Initiator resource mount point, do not carry out any operation, if file path is under the Initiator mount point, continue following steps.
Step s304, Initiator judge the path of source file and file destination, judge that whether file path is the file or folder of file system to self creating, if then do not carry out any operation, otherwise continues following steps.
The file here need be got rid of the operational motion of the file that the Initiator file system creates self on the resource mount point, it normally causes the main cause that Initiator can't logout.With NTFS (NewTechnology File System, New Technology File System) system is an example, it can create System volume information (system's label information), Recycle (recycle bin), MSOCache files such as (local installation sources) on the resource mount point, when even the Initiator file system is not carried out any operation to the Target resource the user, also can read and write, may cause the Initiator can't logout these files.Therefore, need set in advance, when operation count is added up, to get rid of for the path of these files or file.
Step s305, operation is counted.
A kind of execution mode of the principle of this counting can for: when file is operated with count increments, during EO the counting successively decrease.For example, when opening file at every turn or creating file, counting is added 1, during each close file counting is subtracted 1.During each copied files, copy begins counting is added 1, and copied files finishes counting is subtracted 1.During each deleted file, deletion begins counting is added 1, and deletion finishes counting is subtracted 1.For the alternative document operation, adopt similar method of counting.
Step s306, when the user when the manual logout of Initiator, Initiator judges above-mentioned file operation counting, if counting carried out step s307 greater than 0 o'clock, otherwise carries out step s308.
Step s307, counting illustrate that greater than 0 o'clock file is operated, and does not allow logout and end, and is imperfect to prevent the data that logout causes.
Step s308, counting equal at 0 o'clock, and Initiator calling system function is forced the change of all cache is write Target end memory device, and sends the logout order to Target.
Step s309, Target send the logout response, finish the logout operation.
Cancellation method by client in the iSCSCI provided by the invention system, under the situation about not being destroyed that guarantees data integrity, safety is finished the cancellation operation of client and memory device timely, realized the differentiation of normal data read-write and file system data read-write, shielded the false judgment that the reading and writing data of file system causes for client when cancellation.
The present invention also provides the client in a kind of iSCSCI system, be used to realize and memory device between normal cancellation operation, its structure comprises as shown in Figure 4:
Statistic unit 10 is used for the file operation that this client is carried out is added up the basis for estimation when nullifying as client on memory device.Concrete, this statistic unit 10 further comprises: the first file path judging unit 11, whether the path of the file that is used to judge that this client is operated on memory device is memory device at the mount point of self client, be then to notify the second file path judging unit 12, otherwise do not carry out any operation; The file or folder whether second file path judging unit 12, the path of the file that is used to judge that this client is operated on memory device are created for self file system is then not carry out any operation, otherwise notifications count unit 13; Counting unit 13 is used for the operation of file is counted, and with count increments, counting successively decreases during EO when operating, and counting is to represent not have operation at 0 o'clock, otherwise expression operates in and carries out.
Judging unit 20 is connected with processing unit 30 with statistic unit 10, is used for when client receives de-registration request, and according to the statistics of statistic unit 10, can judgement carry out the cancellation operation of client; Judged result is for can nullify the time, and notifier processes unit 30 carries out the cancellation of client from the memory device.
Processing unit 30 is connected with judging unit 20, when being used to receive the notice of judging unit 20, this client is nullified from memory device.
Also comprise: mount point acquiring unit 40 is used for obtaining the mount point of memory device in self client file system, and this mount point information is offered the judgement that statistic unit 10 is used for file path.
Shielding path setting unit 50 is used for preestablishing for the related file or folder of self file system read-write, as the content of carrying out required shielding in the file operation statistics.When the operation of 10 pairs of files of statistic unit was added up, every operation that relates to the file or folder of the needs shielding that this shielding path setting unit 50 is set was all got rid of and is not charged to statistics.
Client terminal device by client in the iSCSCI provided by the invention system, under the situation about not being destroyed that guarantees data integrity, safety is finished the cancellation operation of client and memory device timely, realized the differentiation of normal data read-write and file system data read-write, shielded the false judgment that the reading and writing data of file system causes for client when cancellation.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, but the former is better execution mode under a lot of situation.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium, comprises that some instructions are with so that the equipment in iSCSCI system is carried out the described method of each embodiment of the present invention.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (7)

1. the cancellation method of client in the Internet Small Computer Systems Interface iSCSI system is characterized in that, comprises the steps:
Connect memory device, obtain the mount point of resource in client self file system on the described memory device;
Client is added up the operation of file on the memory device; Specifically comprise: when detecting self file system, judge whether the path of described file is described mount point, be then to continue, otherwise do not carry out any operation and end the operation of file; Path to described file is judged, judges that whether file path is the file or folder of file system to self creating, if then do not carry out any operation and end, otherwise continues;
Operation to described file is counted;
When described client receives de-registration request, judge whether to exist operation to file on the described memory device according to described statistics;
When described operation did not exist, described client was nullified from described memory device.
2. the cancellation method of client in the iSCSI system according to claim 1 is characterized in that, describedly judges that whether file path is file system the step of the file or folder self created is specially:
Add up in advance for the related file or folder of self creating of self file system read-write;
When detecting self file system, judge whether the path of described file relates to the described related file or folder of adding up in advance of self creating of self file system read-write to the operation of file.
3. the cancellation method of client in the iSCSI system according to claim 1 is characterized in that the described step that the operation of file is counted is specially:
With the count increments of counter, the counting with described counter during EO successively decreased when file was operated, described operation comprise opening, close, create, deleting of file at least or copy in one or more.
4. as the cancellation method of client in the iSCSI system as described in the claim 3, it is characterized in that, when described client receives de-registration request, judge whether to exist step to be specially the operation of file on the described memory device according to described statistics:
Judge whether described counting is zero, and the operation that is judged as file on the described memory device when being zero does not exist, otherwise is judged as the operation of existence to file on the described memory device.
5. the client in the iSCSCI system, be used to realize and memory device between the cancellation operation, it is characterized in that, comprising:
Statistic unit is used for the file operation that this client is carried out on memory device is added up, the basis for estimation during as cancellation;
Judging unit is used for when client receives de-registration request, and according to the statistics of described statistic unit, can judgement nullify operation; Judged result is for can nullify the time, and the notifier processes unit carries out the cancellation from the described memory device;
Processing unit when being used to receive the notice of described judging unit, is nullified from described memory device;
Described statistic unit further comprises:
Whether the first file path judging unit, the path of the file that is used to judge that this client is operated on described memory device are memory device at the mount point of self client, are then to notify the second file path judging unit, otherwise do not carry out any operation;
The second file path judging unit, whether the path of the file that is used to judge that this client is operated on memory device is the file or folder of file system to self creating, and is then not carry out any operation, otherwise the notifications count unit;
Counting unit, be used for the operation of file is counted, with count increments, counting successively decreases during EO when operating, represent that the file on the described memory device is not had operation when counting is zero, otherwise expression there is operation to carry out to the file on the described memory device.
6. as the client in the iSCSCI system as described in the claim 5, it is characterized in that, described client also comprises: the mount point acquiring unit, be used for obtaining the mount point of described memory device, and described mount point information is offered the judgement that described statistic unit is used for file path in self file system.
7. as the client in the iSCSCI system as described in the claim 5, it is characterized in that, described client also comprises: shielding path setting unit, be used for preestablishing, as the content of carrying out required shielding in the file operation statistics for the related file or folder of self creating of self file system read-write; When described statistic unit was added up the operation of file, the operation of the file of all needs shieldings that relates to described setting was all got rid of and is not charged to statistics.
CN2007101516718A 2007-09-26 2007-09-26 Method and apparatus for client logoff in iSCSI system Active CN101132418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101516718A CN101132418B (en) 2007-09-26 2007-09-26 Method and apparatus for client logoff in iSCSI system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101516718A CN101132418B (en) 2007-09-26 2007-09-26 Method and apparatus for client logoff in iSCSI system

Publications (2)

Publication Number Publication Date
CN101132418A CN101132418A (en) 2008-02-27
CN101132418B true CN101132418B (en) 2010-11-24

Family

ID=39129541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101516718A Active CN101132418B (en) 2007-09-26 2007-09-26 Method and apparatus for client logoff in iSCSI system

Country Status (1)

Country Link
CN (1) CN101132418B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1633131A (en) * 2005-01-14 2005-06-29 清华大学 A method for implementing iSCSI memory system
CN1991806A (en) * 2005-12-26 2007-07-04 联想(北京)有限公司 Method for safety load-off of USB apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1633131A (en) * 2005-01-14 2005-06-29 清华大学 A method for implementing iSCSI memory system
CN1991806A (en) * 2005-12-26 2007-07-04 联想(北京)有限公司 Method for safety load-off of USB apparatus

Also Published As

Publication number Publication date
CN101132418A (en) 2008-02-27

Similar Documents

Publication Publication Date Title
CN104268055B (en) The monitoring method and device of a kind of program exception
KR101074624B1 (en) Method and system for protecting abusinng based browser
CN111782416B (en) Data reporting method, device, system, terminal and computer readable storage medium
CN110347341B (en) Data clearing method and control equipment
CN101587522B (en) Method and system for identifying script virus
CN103268183A (en) Processing method and device for information report
CN111240892B (en) Data backup method and device
CN110413432B (en) Information processing method, electronic equipment and storage medium
CN105893471B (en) Data processing method and electronic equipment
KR101421136B1 (en) Method and apparatus for modeling computer program behavior for behavioral detection of malicious program
CN111930703A (en) Automatic log file capturing method and device and computer equipment
EP2479962A1 (en) Method and mobile terminal for recycling short messages
CN105630636A (en) Dynamical recovery method and device for operating system of intelligent electronic device
CN103067246A (en) Method and apparatus used for processing file received based on instant communication service
KR101130088B1 (en) Malware detecting apparatus and its method, recording medium having computer program recorded
CN106682512B (en) Method, device and system for preventing program from being modified
CN101132418B (en) Method and apparatus for client logoff in iSCSI system
CN111884883A (en) Quick auditing processing method for service interface
CN109445909A (en) Backup method, system, terminal and the storage medium of virtual-machine data
KR101889222B1 (en) Portable storage device perfoming a malignant code detection and method for the same
CN106528658B (en) The lookup method and device of application file
CN116150111A (en) Method, device and medium for saving kernel crash log and electronic equipment
CN110427280B (en) Cache management method, system, computer equipment and storage medium
CN113485872A (en) Fault processing method and device and distributed storage system
CN109426589B (en) File repair method and 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
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.

CP03 Change of name, title or address