CN113190177B - Data storage method, terminal equipment, server and system - Google Patents
Data storage method, terminal equipment, server and system Download PDFInfo
- Publication number
- CN113190177B CN113190177B CN202110519219.2A CN202110519219A CN113190177B CN 113190177 B CN113190177 B CN 113190177B CN 202110519219 A CN202110519219 A CN 202110519219A CN 113190177 B CN113190177 B CN 113190177B
- Authority
- CN
- China
- Prior art keywords
- storage space
- target
- identification information
- target storage
- file system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure provides a data storage method, terminal equipment, a server and a system, and relates to the technical field of data processing; when the disconnection of the target network is determined, executing the operation indicated by the target operation instruction on a check disk; when the successful connection is determined after the target network is disconnected, acquiring first current file system information in the target storage space and second current file system information on the check disk; and synchronizing the second current file system information in the target storage space when the first current file system information and the second current file system information are determined to be inconsistent. According to the method and the device, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
Description
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a data storage method, terminal equipment, a server and a system.
Background
At present, storage devices based on ISCSI protocol have been widely used, for example, in data storage, data backup, and disaster recovery in different places.
In the related art, a terminal device is connected with a storage device through a network, and when the terminal device executes a data writing instruction, data is written into the storage device; when reading data, the data is read from the memory device and displayed.
However, in the above-mentioned technology, if the network is disconnected, the terminal device cannot be connected to the storage device, and therefore, data cannot be read and written on the storage device, which results in that the data in the storage device cannot be stored in the period from disconnection to restoration of the network. Therefore, after the network is restored, a situation may occur in which the terminal device cannot read the data in the storage device, and the reliability of data reading is reduced.
Disclosure of Invention
The embodiment of the disclosure provides a data storage method, terminal equipment, a server and a system, which can solve the problem that the reliability of data reading is reduced in the prior art. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a data storage method applied to a terminal device, where a check disc is configured on the terminal device, the method including:
Detecting a target operation instruction; the target operation instruction is used for indicating to write target data or read target data;
when the disconnection of the target network is determined, executing the operation indicated by the target operation instruction on the check disk; the target network is a network in which the terminal equipment is connected with a target storage space in the storage server;
when the successful connection is determined after the target network is disconnected, acquiring first current file system information in the target storage space and second current file system information on the check disk;
and synchronizing the second current file system information in the target storage space when the first current file system information and the second current file system information are determined to be inconsistent.
The embodiment of the disclosure provides a data storage method, wherein a check disc is configured on a terminal device, and when the terminal device is determined to be disconnected with a target storage space in a storage server, an operation indicated by a target operation instruction is executed on the check disc, namely target data is read or written on the check disc; when the network is determined to be disconnected and the connection is restored, the first current file system information in the target storage space is compared with the second current file system information on the check disk, when the first current file system information and the second current file system information are determined to be inconsistent, the data in the target storage space is indicated to be lost, and at the moment, the second current file system information on the check disk is synchronized in the target storage space. Therefore, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
In one embodiment, before the detecting the target operation instruction, the method further includes:
acquiring a connection request; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc;
sending the connection request to the storage server;
receiving attribute information of the target storage space sent by the storage server;
and displaying the target storage space according to the attribute information of the target storage space.
In one embodiment, the detection target operation instruction includes:
acquiring a first current file system in the target storage space and a second current file system on the check disk;
and detecting the target operation instruction when the first current file system is determined to be consistent with the second current file system.
In one embodiment, the target operation instruction is configured to instruct writing of target data, and the method further includes:
and writing the target data in the check disk and the target storage space when the target network is not disconnected.
In one embodiment, the target operation instruction is configured to instruct to read target data, and the method further includes:
And when the target network is not disconnected, reading the target data from the target storage space.
According to a second aspect of embodiments of the present disclosure, there is provided a data storage method applied to a storage server, the method including:
receiving a connection request sent by terminal equipment; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc;
when the target storage space is searched according to the identification information of the target storage space, acquiring the reference identification information of the check disc stored in the target storage space;
when the reference identification information is determined to be non-empty, determining whether the identification information of the check disc is identical to the reference identification information;
when the identification information of the check disc is identical to the reference identification information, establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space;
and sending the attribute information of the target storage space to the terminal equipment, so that the terminal equipment displays the target storage space according to the attribute information of the target storage space.
The embodiment of the disclosure provides a data storage method, when a storage server receives a connection request which is sent by a terminal device and carries an IP address of the storage server, identification information of a target storage space and identification information of a check disk, a corresponding target storage space is searched in a database according to the identification information of the target storage space, when the corresponding target storage space is searched, reference identification information of the check disk in the target storage space is acquired again, whether the reference identification information is empty is determined, when the reference identification information is determined not to be empty, the reference identification information is compared with the acquired identification information of the check disk, when the reference identification information is determined to be identical with the acquired identification information of the check disk, network connection between the terminal device and the target storage space of the storage server is established according to the IP address of the storage server and the identification information of the target storage space, and after the network connection is successful, attribute information of the target storage space is transmitted to the terminal device, and the terminal device is enabled to display the target storage space. The terminal equipment is provided with a check disk, when the terminal equipment is determined to be normally connected with a target network of a target storage space in the storage server, target data are written in the target storage space and the check disk, and the data are read in the target storage space; when the disconnection of the target network is determined, reading target data or writing the target data on the check disk; when the network is determined to be disconnected and the connection is restored, the first current file system information in the target storage space is compared with the second current file system information on the check disk, when the first current file system information and the second current file system information are determined to be inconsistent, the data in the target storage space is indicated to be lost, and at the moment, the second current file system information on the check disk is synchronized in the target storage space. Therefore, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
In one embodiment, before the receiving the connection request sent by the terminal device, the method further includes:
creating the target storage space;
distributing corresponding identification information for the target storage space;
and correspondingly storing the target storage space and the identification information of the target storage space.
In one embodiment, further comprising:
and when the target storage space is not found according to the identification information of the target storage space, sending a connection failure message to the terminal equipment.
In one embodiment, further comprising:
and sending a connection failure message to the terminal equipment when the identification information of the check disc is not identical to the reference identification information.
In one embodiment, further comprising:
before sending the attribute information of the target storage space to the terminal equipment, the method further comprises the following steps:
when the reference identification information is determined to be empty, the identification information of the check disc is determined to be the reference identification information, and the identification information of the check disc is stored correspondingly to the target storage space;
and establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space.
According to a third aspect of the embodiments of the present disclosure, there is provided a terminal device, including:
the detection module is used for detecting a target operation instruction; the target operation instruction is used for indicating to write target data or read target data;
the execution module is used for executing the operation indicated by the target operation instruction on the check disk when the disconnection of the target network is determined; the target network is a network in which the terminal equipment is connected with a target storage space in the storage server;
the first acquisition module is used for acquiring first current file system information in the target storage space and second current file system information on the check disk when the target network is determined to be successfully connected after the target network is disconnected;
and the synchronization module is used for synchronizing the second current file system information in the target storage space when the first current file system information and the second current file system information are not consistent.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage server comprising:
the first receiving module is used for receiving a connection request sent by the terminal equipment; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc;
The second acquisition module is used for acquiring the reference identification information of the check disc stored in the target storage space when the target storage space is searched according to the identification information of the target storage space;
the determining module is used for determining whether the identification information of the check disc is identical with the reference identification information or not when the reference identification information is determined to be non-empty;
the establishing module is used for establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space when the identification information of the check disc is identical to the reference identification information;
and the first sending module is used for sending the attribute information of the target storage space to the terminal equipment so that the terminal equipment displays the target storage space according to the attribute information of the target storage space.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a data storage system, including the terminal device according to any one of the embodiments and the storage server according to any one of the embodiments.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart of a data storage method provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of a data storage method provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of a data storage method provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart of a data storage method provided by an embodiment of the present disclosure;
FIG. 5 is an interaction diagram of a data storage method provided by an embodiment of the present disclosure;
fig. 6a is a block diagram of a terminal device according to an embodiment of the present disclosure;
fig. 6b is a block diagram of a terminal device according to an embodiment of the present disclosure;
fig. 6c is a block diagram of a terminal device according to an embodiment of the present disclosure;
fig. 6d is a block diagram of a terminal device according to an embodiment of the present disclosure;
fig. 6e is a block diagram of a terminal device according to an embodiment of the present disclosure;
FIG. 7a is a block diagram of a storage server provided by an embodiment of the present disclosure;
FIG. 7b is a block diagram of a storage server provided by an embodiment of the present disclosure;
FIG. 7c is a block diagram of a storage server provided by an embodiment of the present disclosure;
FIG. 7d is a block diagram of a storage server provided by an embodiment of the present disclosure;
FIG. 7e is a block diagram of a storage server provided by an embodiment of the present disclosure;
FIG. 8 is a block diagram of a data storage system provided by an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The embodiment of the disclosure provides a data storage method, which is applied to a terminal device, wherein the terminal device is configured with a check Disk, the check Disk is a common Hard Disk, for example, an HDD (Hard Disk Drive), an SSD (Solid State Disk Drive), and the like, and the terminal device is a computer provided with a windows system or a linux system or an unix system, as shown in fig. 1, and the method comprises the following steps:
The target operation instruction is used for indicating writing target data or reading target data.
For example, a client software is installed on the terminal device, where the client software is a software developed based on the ISCSI protocol and used for logging in to connect to a target storage space created by the storage server, and the client software detects each operation instruction in real time, and the target operation instruction may be an instruction for writing target data or an instruction for reading target data.
And 102, executing the operation indicated by the target operation instruction on the check disk when the target network is determined to be disconnected.
The target network is a network in which the terminal equipment is connected with a target storage space in the storage server.
When the target operation instruction is detected, whether the target network connected between the terminal equipment and the target storage space of the storage server is normally connected or not is firstly determined, and when the target network is determined to be disconnected, the operation indicated by the target operation instruction cannot be executed in the target storage space, and all the detected operations corresponding to the target operation instruction are redirected to the check disk, namely, the operation indicated by the target operation instruction is executed only on the check disk. The operation executed by the target operation instruction comprises a target data writing operation or a target data reading operation, namely when the target network is disconnected, only target data is read on the check disc, and the target data read in the check disc is returned to an operating system of the terminal equipment for normal display by using a disc recovery algorithm. When writing target data on the check disk, a disk backup algorithm is used to write the target data on the check disk. The disk recovery algorithm is to invert the data of the check disk according to binary bits, and the disk backup algorithm is to invert the data of the target storage space according to binary bits.
For example, when the target network is disconnected and then restored, the first current file system information in the target storage space and the second current file system information on the check disc need to be acquired, where the first current file system information includes a first current file system attribute, a first current sector storage location, a first current file size, and a first current file timestamp, and the second current file system information includes a second current file system attribute, a second current sector storage location, a second current file size, and a second current file timestamp.
When the first current file system information and the second current file system information are acquired, comparing each piece of information in the first current file system information with each piece of information corresponding to the second current file system information, and when each piece of information in the first current file system information is determined to be consistent with each piece of information corresponding to the second current file system information, indicating that the data stored in the target storage space is consistent with the data stored in the check disk; when the information in the first current file system information is determined to have information inconsistent with the corresponding information in the second current file system information, the data stored in the target storage space is inconsistent with the data stored in the check disk, and at the moment, the second current file system information is required to be synchronized into the target storage space according to a disk recovery algorithm, so that the data in the target storage space and the data in the check disk are ensured to be kept synchronized.
The embodiment of the disclosure provides a data storage method, wherein a check disc is configured on a terminal device, and when the terminal device is determined to be disconnected with a target storage space in a storage server, an operation indicated by a target operation instruction is executed on the check disc, namely target data is read or written on the check disc; when the network is determined to be disconnected and the connection is restored, the first current file system information in the target storage space is compared with the second current file system information on the check disk, when the first current file system information and the second current file system information are determined to be inconsistent, the data in the target storage space is indicated to be lost, and at the moment, the second current file system information on the check disk is synchronized in the target storage space. Therefore, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
The embodiment of the disclosure provides a data storage method, which is applied to a terminal device, wherein a check disc is configured on the terminal device, as shown in fig. 2, and the method comprises the following steps:
The connection request carries an IP (Internet Protocol Address ) address of the storage server, identification information of a target storage space and identification information of a check disk.
The terminal device is provided with a client software, the client software displays a connection interface, a user can input the IP address of the storage server, the identification information of the target storage space and the identification information of the check disk on the connection interface, and then clicks a connection key to enable the terminal device to acquire a connection request carrying the IP address of the storage server, the identification information of the target storage space and the identification information of the check disk, and send the connection request to the storage server.
When receiving a connection request sent by a terminal device, a storage server analyzes the connection request, acquires an IP address of the storage server, identification information of a target storage space and identification information of a check disk, searches a corresponding target storage space in a database according to the identification information of the target storage space, acquires reference identification information of the check disk in the target storage space when searching the corresponding target storage space, determines whether the reference identification information is empty, compares the reference identification information with the acquired identification information of the check disk when determining that the reference identification information is not empty, establishes network connection between the terminal device and the target storage space of the storage server according to the IP address of the storage server and the identification information of the target storage space when determining that the reference identification information is identical to the acquired identification information of the check disk, and sends attribute information of the target storage space to the terminal device after the network connection is successful.
And 203, receiving attribute information of the target storage space sent by the storage server.
And 204, displaying the target storage space according to the attribute information of the target storage space.
For example, when the terminal device receives the attribute information of the target storage space sent by the storage server, the virtual disk driver module in the client software analyzes the attribute information of the target storage space to obtain the size of the target storage space, LUN (Logical Unit Number ) information of the target storage space, and loads the target storage space into one or more disk block devices, and at this time, on the client operating system, the corresponding target storage space of the storage server can be seen.
The target operation instruction is used for indicating writing target data or reading target data.
Optionally, acquiring a first current file system in the target storage space and a second current file system on the check disk; and detecting the target operation instruction when the first current file system is determined to be consistent with the second current file system.
After the target storage space is displayed, the terminal equipment needs to verify the availability of the target storage space, namely, a first current file system in the target storage space and a second current file system in a check disk are acquired, each piece of information in the first current file system is correspondingly compared with each piece of information in the second current file system, when each piece of information in the first current file system is determined to be consistent with each piece of information corresponding to each piece of information in the second current file system, the target storage space is indicated to be normally used, namely, data can be read and written in the target storage space normally, and the data can be checked, so that a target operation instruction can be detected at the moment; when the information in the first current file system is determined to have information inconsistent with the corresponding information in the second current file system, the target storage space cannot be normally used at present, and the second current file system needs to be synchronized into the target storage space to enable the target storage space to be normally used, so that the data in the target storage space and the data in the check disk are synchronized.
And 206, writing the target data in both the check disk and the target storage space when the target network is not disconnected and the target operation instruction is used for indicating to write the target data.
For example, when the terminal device determines that the target network is normally connected, and detects an operation instruction for writing target data, the terminal device writes the target data in two parts, one part is written in the target storage space, and the other part is written in the test disc by using a disc backup algorithm.
For example, when the terminal device determines that the target network is normally connected, and when an operation instruction for reading target data is detected, the target data is read from the target storage space and returned to an operating system of the terminal device for display.
And step 208, when the disconnection of the target network is determined, executing the operation indicated by the target operation instruction on the check disk.
The target network is a network in which the terminal equipment is connected with a target storage space in the storage server.
For example, when the terminal device determines that the target network is disconnected, the operation indicated by the target operation instruction cannot be executed in the target storage space, and only the operation indicated by the target operation instruction is executed on the check disk. I.e. writing or reading target data only on the parity disk when the target network is disconnected.
For example, when the target network is disconnected and then the connection is restored, the first current file system information in the target storage space and the second current file system information on the check disk need to be acquired.
When the first current file system information and the second current file system information are acquired, comparing each piece of information in the first current file system information with each piece of information corresponding to the second current file system information, and when each piece of information in the first current file system information is determined to be consistent with each piece of information corresponding to the second current file system information, indicating that the data stored in the target storage space is consistent with the data stored in the check disk; when the information in the first current file system information is determined to have information inconsistent with the corresponding information in the second current file system information, the data stored in the target storage space is inconsistent with the data stored in the check disk, and at the moment, the second current file system information is required to be synchronized into the target storage space according to a disk recovery algorithm, so that the data in the target storage space and the data in the check disk are ensured to be kept synchronized.
The embodiment of the disclosure provides a data storage method, wherein a verification disk is configured on a terminal device, when the terminal device is determined to be normally connected with a target network of a target storage space in a storage server, target data are written on the target storage space and the verification disk, and the data are read in the target storage space; when the disconnection of the target network is determined, reading target data or writing the target data on the check disk; when the network is determined to be disconnected and the connection is restored, the first current file system information in the target storage space is compared with the second current file system information on the check disk, when the first current file system information and the second current file system information are determined to be inconsistent, the data in the target storage space is indicated to be lost, and at the moment, the second current file system information on the check disk is synchronized in the target storage space. Therefore, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
The embodiment of the disclosure provides a data storage method, applied to a storage server, wherein the storage server is a common storage server in the market, and is provided with storage management software based on an ISCSI (Internet Small Computer System Interface, small computer system interface) protocol, as shown in fig. 3, the method comprises the following steps:
The connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc.
When receiving a connection request sent by a terminal device, a storage server analyzes the connection request to obtain an IP address of the storage server, identification information of a target storage space and identification information of a check disc, wherein a generation algorithm of the identification information of the check disc is as follows: and obtaining a hardware identification number of the check disc, and encrypting the hardware identification number through an MD5 algorithm to obtain identification information of the check disc, wherein the MD5 algorithm is an algorithm specified in a protocol.
For example, the storage server searches the corresponding target storage space in the database according to the identification information of the target storage space, and when the corresponding target storage space is found, acquires the reference identification information of the check disc stored in the target storage space, and determines whether the reference identification information is empty.
For example, when it is determined that the reference identification information is not empty, that is, is not empty, it is described that the connection request is not received for the first time, and it is required to determine whether the identification information of the check disc is identical to or not to the reference identification information.
And 304, when the identification information of the check disc is identical to the reference identification information, establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space.
For example, when it is determined that the identification information of the check disc is identical to the reference identification information, a network connection between the terminal device and the target storage space of the storage server is established according to the IP address of the storage server and the identification information of the target storage space.
After the network connection is successful, the storage server sends the attribute information of the target storage space to the terminal device, so that a virtual disk driver module in client software of the terminal device analyzes the attribute information of the target storage space to obtain the size of the target storage space, LUN information of the target storage space loads the target storage space into one or more disk block devices, and at the moment, the corresponding target storage space of the storage server can be seen on a client operating system.
An embodiment of the present disclosure provides a data storage method, applied to a storage server, as shown in fig. 4, including the following steps:
For example, the storage server creates a target storage space with a certain capacity according to the requirement, and the specific creation method may refer to a storage space creation method in the prior art, which is not described herein in detail.
For example, when the storage server creates the target storage space, the storage server allocates corresponding identification information for the target storage space, that is, the identification information of the target storage space, where the identification information is IQN information, and the IQN information is used to identify unique names of the single ISCSI target and the initiator.
And step 403, correspondingly storing the target storage space and the identification information of the target storage space.
For example, when the target storage space is created and the identification information of the target storage space is allocated, the correspondence relationship between the target storage space and the identification information of the target storage space is stored in the database.
The connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc.
It should be noted that, according to the different determination results of the reference identifier information, the following steps are also different, and when the reference identifier information is determined to be non-empty, step 407 and steps 409 to 411 are performed; upon determining that the reference identification information is empty, steps 408 to 411 are performed.
And 408, when the reference identification information is determined to be empty, storing the identification information of the check disk in correspondence with the target storage space.
For example, when the reference identification information is determined to be empty, it is described that the storage server receives the connection request for the first time, and at this time, the correspondence between the identification information of the check disc in the connection request and the identification information of the target storage space and the correspondence between the identification information of the check disc in the connection request and the target storage space are stored in the database.
And 409, transmitting the attribute information of the target storage space to the terminal equipment, so that the terminal equipment displays the target storage space according to the attribute information of the target storage space.
And step 410, when the target storage space is not found according to the identification information of the target storage space, sending a connection failure message to the terminal equipment.
When the storage server does not find the target storage space according to the identification information of the target storage space, the storage server indicates that the storage space is not divided for the terminal equipment, at the moment, a connection failure message is sent to the terminal equipment, and when the connection failure message is received, the terminal equipment displays a prompt message of user operation failure to a user, so that the user can know the prompt message conveniently.
When the storage server determines that the identification information of the check disc is different from the reference identification information, the storage server indicates that the user logs in the storage server by using different terminal equipment, at the moment, a connection failure message is sent to the terminal equipment, and when the terminal equipment receives the connection failure message, a prompt message of user operation failure is displayed to the user, so that the user can know the prompt message conveniently.
The embodiment of the disclosure provides a data storage method, when a storage server receives a connection request which is sent by a terminal device and carries an IP address of the storage server, identification information of a target storage space and identification information of a check disk, a corresponding target storage space is searched in a database according to the identification information of the target storage space, when the corresponding target storage space is searched, reference identification information of the check disk in the target storage space is acquired again, whether the reference identification information is empty is determined, when the reference identification information is determined not to be empty, the reference identification information is compared with the acquired identification information of the check disk, when the reference identification information is determined to be identical with the acquired identification information of the check disk, network connection between the terminal device and the target storage space of the storage server is established according to the IP address of the storage server and the identification information of the target storage space, and after the network connection is successful, attribute information of the target storage space is transmitted to the terminal device, and the terminal device is enabled to display the target storage space. The terminal equipment is provided with a check disk, when the terminal equipment is determined to be normally connected with a target network of a target storage space in the storage server, target data are written in the target storage space and the check disk, and the data are read in the target storage space; when the disconnection of the target network is determined, reading target data or writing the target data on the check disk; when the network is determined to be disconnected and the connection is restored, the first current file system information in the target storage space is compared with the second current file system information on the check disk, when the first current file system information and the second current file system information are determined to be inconsistent, the data in the target storage space is indicated to be lost, and at the moment, the second current file system information on the check disk is synchronized in the target storage space. Therefore, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
The embodiment of the disclosure provides a data storage method applied to a storage server and a terminal device, as shown in fig. 5, the method comprises the following steps:
The connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc.
It should be noted that, according to the difference in the result of the determination of the reference identifier information, the following steps are also different, and when the reference identifier information is determined to be non-empty, steps 507 to 508, and steps 510 to 518 are performed; upon determining that the reference identification information is empty, steps 509 to 518 are performed.
It should be noted that, according to the difference between the comparison result of the identification information of the check disc and the reference identification information, the following steps are also different, and when it is determined that the identification information of the check disc is identical to the reference identification information, steps 508, 510 to 511, and 513 to 519 are performed; upon determining that the identification information of the verification disc is not identical to the reference identification information, step 512 is performed.
And 508, when the storage server determines that the identification information of the check disc is the same as the reference identification information, establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space.
And step 511, the terminal equipment displays the target storage space according to the attribute information of the target storage space.
And step 512, when the identification information of the check disc is not identical to the reference identification information, sending a connection failure message to the terminal equipment.
The target operation instruction is used for indicating writing target data or reading target data.
When the first current file system is inconsistent with the second current file system, the second current file system is synchronized into the target storage space, and the consistency of the target storage space and the data in the check disk is maintained.
It should be noted that, according to the different connection results of the target network, the following steps are also different, and when it is determined that the target network is not disconnected, steps 515 and 516 are performed; upon determining that the target network is disconnected, steps 517 through 519 are performed.
And step 516, when the terminal equipment determines that the target network is not disconnected, and the target operation instruction is used for indicating to read target data, the target data is read from the target storage space.
And 517, when the terminal equipment determines that the target network is disconnected, executing the operation indicated by the target operation instruction on the check disc.
The target network is a network in which the terminal equipment is connected with a target storage space in the storage server.
And 518, when the terminal equipment determines that the target network is successfully connected after disconnection, acquiring the first current file system information in the target storage space and the second current file system information on the check disk.
When the first current file system information is determined to be consistent with the second current file system information, the network disconnection time is short, and the writing operation of the data is not affected.
The embodiment of the disclosure provides a data storage method, wherein a verification disk is configured on a terminal device, when the terminal device is determined to be normally connected with a target network of a target storage space in a storage server, target data are written on the target storage space and the verification disk, and the data are read in the target storage space; when the disconnection of the target network is determined, reading target data or writing the target data on the check disk; when the network is determined to be disconnected and the connection is restored, the first current file system information in the target storage space is compared with the second current file system information on the check disk, when the first current file system information and the second current file system information are determined to be inconsistent, the data in the target storage space is indicated to be lost, and at the moment, the second current file system information on the check disk is synchronized in the target storage space. Therefore, even if the network disconnection occurs, after the network is restored, the terminal equipment can normally read the data from the storage server, so that the reliability of data reading is improved.
Based on the data storage method described in the above embodiments, the following are embodiments of the apparatus of the present disclosure, which may be used to perform the embodiments of the method of the present disclosure.
The embodiment of the present disclosure provides a terminal device, as shown in fig. 6a, the terminal device 60 includes: the device comprises a detection module 601, an execution module 602, a first acquisition module 603 and a synchronization module 604.
The detection module 601 is configured to detect a target operation instruction; the target operation instruction is used for indicating to write target data or read target data;
an execution module 602, configured to execute, on the check disk, an operation indicated by the target operation instruction when it is determined that the target network is disconnected; the target network is a network in which the terminal equipment is connected with a target storage space in the storage server;
a first obtaining module 603, configured to obtain, when it is determined that the target network has been successfully connected after disconnection, first current file system information in the target storage space and second current file system information on the check disk;
and a synchronization module 604, configured to synchronize the second current file system information in the target storage space when it is determined that the first current file system information and the second current file system information are not consistent.
In one embodiment, as shown in fig. 6b, the terminal device 60 further includes a third obtaining module 605, a second sending module 606, a second receiving module 607, and a display module 608.
Wherein, the third obtaining module 605 is configured to obtain a connection request; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc.
The second sending module 606 is configured to send the connection request to the storage server.
The second receiving module 607 is configured to receive attribute information of the target storage space sent by the storage server.
The display module 608 is configured to display the target storage space according to the attribute information of the target storage space.
In one embodiment, as shown in fig. 6c, the detection module 601 includes an acquisition submodule 6011 and a detection submodule 6012.
The acquiring submodule 6011 is configured to acquire a first current file system in the target storage space and a second current file system on the check disk.
The detection submodule 6012 is configured to detect the target operation instruction when it is determined that the first current file system is consistent with the second current file system.
In one embodiment, as shown in fig. 6d, the target operation instruction is used to instruct to write target data, and the terminal device further includes a writing module 609.
The writing module 609 is configured to write the target data in both the check disk and the target storage space when it is determined that the target network is not disconnected.
In one embodiment, as shown in fig. 6e, the target operation instruction is used to instruct to read target data, and the terminal device further includes a reading module 610.
The reading module 610 is configured to read the target data from the target storage space when it is determined that the target network is not disconnected.
The disclosed embodiment provides a storage server, as shown in fig. 7a, the storage server 70 includes: a first receiving module 701, a second obtaining module 702, a first determining module 703, a setting up module 704 and a first sending module 705.
The first receiving module 701 is configured to receive a connection request sent by a terminal device; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc;
a second obtaining module 702, configured to obtain, when the target storage space is found according to the identification information of the target storage space, reference identification information of a check disc stored in the target storage space;
A first determining module 703, configured to determine whether the identification information of the check disc is the same as the reference identification information when it is determined that the reference identification information is not empty;
an establishing module 704, configured to establish a connection between the terminal device and the storage server according to the IP address of the storage server and the identification information of the target storage space when it is determined that the identification information of the check disc is the same as the reference identification information;
and a first sending module 705, configured to send attribute information of the target storage space to the terminal device, so that the terminal device displays the target storage space according to the attribute information of the target storage space.
In one embodiment, as shown in FIG. 7b, the storage server further comprises a creation module 706, an allocation module 707, and a storage module 708.
Wherein, the creating module 706 is configured to create the target storage space.
The allocation module 707 is configured to allocate corresponding identification information to the target storage space.
The storage module 708 is configured to store the target storage space and identification information of the target storage space correspondingly.
In one embodiment, as shown in fig. 7c, the storage server further comprises a third sending module 709.
The third sending module 709 is configured to send a connection failure message to the terminal device when the target storage space is not found according to the identification information of the target storage space.
In one embodiment, as shown in fig. 7d, the storage server further comprises a fourth sending module 710.
The fourth sending module 710 is configured to send a connection failure message to the terminal device when it is determined that the identification information of the check disc is not identical to the reference identification information.
In one embodiment, as shown in fig. 7e, the storage server further comprises a second determination module 711 and a setup module 712.
The second determining module 711 is configured to determine, when it is determined that the reference identification information is empty, the identification information of the check disc as the reference identification information, and store the identification information of the check disc in correspondence with the target storage space.
And the establishing module 712 is configured to establish a connection between the terminal device and the storage server according to the IP address of the storage server and the identification information of the target storage space.
Fig. 8 is a frame diagram of a data storage system according to an embodiment of the present disclosure, where the data storage system shown in fig. 8 includes a terminal device 801 according to any one of the embodiments and a storage server 802 according to any one of the embodiments.
Based on the data storage method described in the above embodiment corresponding to fig. 1, the embodiment of the present disclosure further provides a computer readable storage medium, for example, a non-transitory computer readable storage medium may be a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data storage method described in the corresponding embodiment of fig. 1, which is not described herein.
Based on the data storage method described in the above-described embodiment corresponding to fig. 3, the present disclosure further provides a computer readable storage medium, for example, the non-transitory computer readable storage medium may be a read-only memory, a random access memory, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data storage method described in the embodiment corresponding to fig. 3, which is not described herein.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims (7)
1. A data storage method, applied to a storage server, comprising:
receiving a connection request sent by terminal equipment; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc;
when the target storage space is searched according to the identification information of the target storage space, acquiring the reference identification information of the check disc stored in the target storage space;
when the reference identification information is determined to be non-empty, determining whether the identification information of the check disc is identical to the reference identification information;
When the identification information of the check disc is identical to the reference identification information, establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space;
transmitting attribute information of the target storage space to the terminal equipment, so that the terminal equipment displays the target storage space according to the attribute information of the target storage space;
when the normal connection of the terminal equipment and a target network of a target storage space in a storage server is determined, writing target data on the target storage space and a check disk, and reading the data in the target storage space;
when the disconnection of the target network is determined, reading target data or writing the target data on the check disk;
when the network is determined to be disconnected and the connection is restored, comparing the first current file system information in the target storage space with the second current file system information on the check disk, and synchronizing the second current file system information on the check disk in the target storage space when the first current file system information and the second current file system information are determined to be inconsistent; and detecting a target operation instruction when the first current file system is determined to be consistent with the second current file system, wherein the target operation instruction is used for indicating writing target data or reading target data.
2. The method according to claim 1, further comprising, prior to the receiving the connection request sent by the terminal device:
creating the target storage space;
distributing corresponding identification information for the target storage space;
and correspondingly storing the target storage space and the identification information of the target storage space.
3. The method as recited in claim 1, further comprising:
and when the target storage space is not found according to the identification information of the target storage space, sending a connection failure message to the terminal equipment.
4. The method as recited in claim 1, further comprising:
and sending a connection failure message to the terminal equipment when the identification information of the check disc is not identical to the reference identification information.
5. The method according to claim 1, wherein before transmitting the attribute information of the target storage space to the terminal device, further comprising:
when the reference identification information is determined to be empty, the identification information of the check disc is determined to be the reference identification information, and the identification information of the check disc is stored correspondingly to the target storage space;
And establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space.
6. A storage server applied to the method of any one of claims 1 to 5, characterized in that the storage server comprises:
the first receiving module is used for receiving a connection request sent by the terminal equipment; the connection request carries the IP address of the storage server, the identification information of the target storage space and the identification information of the check disc;
the second acquisition module is used for acquiring the reference identification information of the check disc stored in the target storage space when the target storage space is searched according to the identification information of the target storage space;
the determining module is used for determining whether the identification information of the check disc is identical with the reference identification information or not when the reference identification information is determined to be non-empty;
the establishing module is used for establishing connection between the terminal equipment and the storage server according to the IP address of the storage server and the identification information of the target storage space when the identification information of the check disc is identical to the reference identification information;
And the first sending module is used for sending the attribute information of the target storage space to the terminal equipment so that the terminal equipment displays the target storage space according to the attribute information of the target storage space.
7. A data storage system comprising a terminal device and the storage server of claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110519219.2A CN113190177B (en) | 2021-05-12 | 2021-05-12 | Data storage method, terminal equipment, server and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110519219.2A CN113190177B (en) | 2021-05-12 | 2021-05-12 | Data storage method, terminal equipment, server and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113190177A CN113190177A (en) | 2021-07-30 |
CN113190177B true CN113190177B (en) | 2023-07-14 |
Family
ID=76981525
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110519219.2A Active CN113190177B (en) | 2021-05-12 | 2021-05-12 | Data storage method, terminal equipment, server and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113190177B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113900988A (en) * | 2021-11-11 | 2022-01-07 | 中广核工程有限公司 | Drawing and data processing method, device, computer equipment and storage medium |
CN114138566B (en) * | 2022-02-07 | 2022-04-29 | 苏州浪潮智能科技有限公司 | Data storage method and device of virtual machine, virtual machine and storage medium |
CN117041305B (en) * | 2023-10-10 | 2024-01-23 | 成都秦川物联网科技股份有限公司 | Offline data management method, device and medium for gas flowmeter based on Internet of things |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407814A (en) * | 2014-11-21 | 2015-03-11 | 华为技术有限公司 | Method and device for data double writing |
CN107329859A (en) * | 2017-06-29 | 2017-11-07 | 杭州宏杉科技股份有限公司 | A data protection method and storage device |
CN109213639A (en) * | 2018-08-23 | 2019-01-15 | 郑州云海信息技术有限公司 | A kind of storage and disaster tolerance method and device |
CN109614054A (en) * | 2018-12-20 | 2019-04-12 | 广州鼎甲计算机科技有限公司 | The read method and system of data |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7299266B2 (en) * | 2002-09-05 | 2007-11-20 | International Business Machines Corporation | Memory management offload for RDMA enabled network adapters |
CN101119383B (en) * | 2007-09-19 | 2010-07-21 | 杭州华三通信技术有限公司 | Method and apparatus of establishing iSCSI conversation for objective terminal and initiating terminal |
CN102012793B (en) * | 2010-11-12 | 2013-01-23 | 浪潮(北京)电子信息产业有限公司 | Mirror image implementing method and device |
US11422907B2 (en) * | 2013-08-19 | 2022-08-23 | Microsoft Technology Licensing, Llc | Disconnected operation for systems utilizing cloud storage |
CN107229425B (en) * | 2017-06-02 | 2020-05-19 | 浙江宇视科技有限公司 | A data storage method and device |
CN108572793B (en) * | 2017-10-18 | 2021-09-10 | 北京金山云网络技术有限公司 | Data writing and data recovery method and device, electronic equipment and storage medium |
-
2021
- 2021-05-12 CN CN202110519219.2A patent/CN113190177B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407814A (en) * | 2014-11-21 | 2015-03-11 | 华为技术有限公司 | Method and device for data double writing |
CN107329859A (en) * | 2017-06-29 | 2017-11-07 | 杭州宏杉科技股份有限公司 | A data protection method and storage device |
CN109213639A (en) * | 2018-08-23 | 2019-01-15 | 郑州云海信息技术有限公司 | A kind of storage and disaster tolerance method and device |
CN109614054A (en) * | 2018-12-20 | 2019-04-12 | 广州鼎甲计算机科技有限公司 | The read method and system of data |
Also Published As
Publication number | Publication date |
---|---|
CN113190177A (en) | 2021-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113190177B (en) | Data storage method, terminal equipment, server and system | |
US20100138687A1 (en) | Recording medium storing failure isolation processing program, failure node isolation method, and storage system | |
CN109308239B (en) | Method and apparatus for outputting information | |
US8856592B2 (en) | Mechanism to provide assured recovery for distributed application | |
US10282120B2 (en) | Method, apparatus and system for inserting disk | |
US20240419354A1 (en) | Disk processing method and system, and electronic device | |
CN110377456A (en) | A kind of management method and device of virtual platform disaster tolerance | |
CN113946276B (en) | Disk management method, device and server in cluster | |
CN111796978A (en) | Interface detection method, device, system, equipment and storage medium | |
CN105550230B (en) | The method for detecting and device of distributed memory system node failure | |
CN107864209B (en) | Data writing method and device and server | |
CN111930569A (en) | System and method for backup and recovery of whole machine | |
EP3697024B1 (en) | Data processing method, device and distributed storage system | |
US20250138736A1 (en) | Logical volume construction method and apparatus, and device, readable storage medium and program product | |
CN116302352A (en) | Cluster disaster recovery processing method and device, electronic equipment and storage medium | |
CN112306753A (en) | Data restoration method, device and system | |
CN108845772B (en) | A kind of hard disk failure processing method, system, device and computer storage medium | |
KR20110062327A (en) | Storage management server-based script management method and a computer-readable recording medium recording a program for realizing the same | |
CN116737466B (en) | Backup processing methods, devices, systems, electronic equipment and readable storage media | |
CN111381770B (en) | A data storage switching method, device, device and storage medium | |
US11217324B2 (en) | Validating data in storage systems | |
CN117270792A (en) | Data migration method, device, equipment and storage medium | |
CN116382961A (en) | Method and device for positioning operating system fault, electronic equipment and storage medium | |
CN107229535B (en) | Multi-copy storage method, storage device and data reading method for data block | |
CN118550761A (en) | Synchronous remote copying method and device for storage system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |