CN107168767B - Data processing method and device of storage equipment - Google Patents

Data processing method and device of storage equipment Download PDF

Info

Publication number
CN107168767B
CN107168767B CN201610130845.1A CN201610130845A CN107168767B CN 107168767 B CN107168767 B CN 107168767B CN 201610130845 A CN201610130845 A CN 201610130845A CN 107168767 B CN107168767 B CN 107168767B
Authority
CN
China
Prior art keywords
data
sector
virtual machine
storage device
instruction
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
CN201610130845.1A
Other languages
Chinese (zh)
Other versions
CN107168767A (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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201610130845.1A priority Critical patent/CN107168767B/en
Publication of CN107168767A publication Critical patent/CN107168767A/en
Application granted granted Critical
Publication of CN107168767B publication Critical patent/CN107168767B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data processing method and a data processing device of a storage device, wherein the method comprises the following steps: receiving a first reading instruction of a virtual machine for reading specified sector data in a storage device; acquiring the appointed sector data and the associated data of the appointed sector data from the storage device through a terminal according to a first reading instruction; storing the designated sector data and the associated data in a cache, and returning the designated sector data to the virtual machine; receiving a second reading instruction for reading the associated data by the virtual machine; and returning the matched associated data in the cache to the virtual machine according to the second reading instruction. The data processing method and the data processing device of the storage equipment provided by the invention avoid the situation that the virtual machine can acquire data from the storage equipment through multiple network interactions and directly return the matched data stored in the cache to the virtual machine, save the time consumed by the multiple network interactions and accelerate the data processing speed.

Description

Data processing method and device of storage equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method and apparatus for a storage device.
Background
With the development of mobile internet, more and more enterprise office and personal applications are migrated to a virtualization environment, and data processing is directly performed on a virtual machine in the virtualization environment. In a virtualization technology environment, a storage device accessed on a terminal needs to be mapped into a virtual machine, and the virtual machine can process data stored in the storage device. However, in the process of processing the data of the storage device by the virtual machine, multiple network interactions are required to obtain the data in the data of the storage device and further process the obtained data, and the excessive network interactions cause the data processing process of the storage device to consume a long time.
Disclosure of Invention
In view of the above, it is necessary to provide a data processing method for a storage device, which addresses the problem that data processing for a storage device takes a long time.
A data processing method of a storage device, comprising:
receiving a first reading instruction of a virtual machine for reading specified sector data in a storage device;
acquiring appointed sector data and associated data of the appointed sector data from the storage device through the terminal according to the first reading instruction;
storing the data of the designated sector and the associated data in a cache, and returning the data of the designated sector to the virtual machine;
receiving a second reading instruction for reading the associated data by the virtual machine;
and returning the matched associated data in the cache to the virtual machine according to the second reading instruction.
In one embodiment, before receiving the first read instruction for the virtual machine to read the stored data, the method further includes:
receiving data read by a terminal from a partition table and a boot sector in a storage device;
storing the read data in a cache;
receiving a third read instruction of the virtual machine for reading a partition table and a boot sector of the storage device;
and sending the read data in the cache to the virtual machine according to the third read instruction.
In one embodiment, before receiving the data read by the terminal from the partition table and the boot sector in the storage device, the method further includes:
and identifying the transmission protocol and the file system type of the storage equipment through the terminal, verifying the transmission protocol, and reading the partition table and the boot sector corresponding to the file system type after the verification is passed.
In one embodiment, before receiving a first read instruction for reading data of a specified sector in a storage device by a virtual machine, the method further includes:
receiving a write-in instruction which is sent by a virtual machine and used for executing write-in operation on storage equipment;
storing the write-in data of the virtual machine into a cache, and returning a result of successful data write-in to the virtual machine;
and writing the written data in the cache into the designated sector of the storage device through the terminal according to the writing instruction.
In one embodiment, the method further comprises:
monitoring a network transmission state;
and adjusting the storage capacity of the cache according to the network transmission state.
The data processing method of the storage device receives a first reading instruction of a virtual machine for reading specified sector data in the storage device, acquires the specified sector data and associated data of the specified sector data from the storage device through a terminal according to the first reading instruction, stores the acquired specified sector data and associated data of the specified sector data in a cache, directly searches matched associated data in the cache after receiving a second reading instruction of the virtual machine for reading the associated data, and returns the searched associated data to the virtual machine. Therefore, the virtual machine is prevented from acquiring data from the storage device through multiple network interactions, the matched data stored in the cache is directly returned to the virtual machine, time consumed by multiple network interactions is saved, and the data processing speed is increased.
A data processing apparatus of a storage device, the apparatus comprising:
a first instruction receiving module, configured to receive a first reading instruction for reading data of a designated sector in a storage device by a virtual machine;
the data acquisition module is used for acquiring the data of the designated sector and the associated data of the designated sector from the storage equipment through the terminal according to the first reading instruction;
the first data return module is used for storing the data of the designated sector and the associated data in a cache and returning the data of the designated sector to the virtual machine;
the second instruction receiving module is used for receiving a second reading instruction for reading the associated data by the virtual machine;
and the second data returning module is used for returning the matched associated data in the cache to the virtual machine according to the second reading instruction.
In one embodiment, the apparatus further comprises:
the data receiving module is used for receiving data read by the terminal from the partition table and the boot sector in the storage device;
the data cache module is used for storing the read data in a cache;
a third instruction receiving module, configured to receive a third read instruction for reading the partition table and the boot sector of the storage device by the virtual machine;
and the data sending module is used for sending the data read in the cache to the virtual machine according to the third reading instruction.
In one embodiment, the apparatus further comprises:
and the storage equipment identification module identifies the transmission protocol and the file system type of the storage equipment through the terminal, verifies the transmission protocol, and reads the partition table and the guide sector corresponding to the file system type after the verification is passed.
In one embodiment, the apparatus further comprises:
the write-in instruction receiving module is used for receiving a write-in instruction which is sent by the virtual machine and used for executing write-in operation on the storage equipment;
the data storage module is used for storing the write-in data of the virtual machine into a cache and returning a result of successful data write-in to the virtual machine;
and the data writing module is used for writing the written data in the cache into the specified sector of the storage device through the terminal according to the writing instruction.
In one embodiment, the apparatus further comprises:
the network monitoring module is used for monitoring the network transmission state;
and the cache adjusting module is used for adjusting the storage capacity of the cache according to the network transmission state.
The data processing device of the storage equipment receives a first reading instruction of a virtual machine for reading specified sector data in the storage equipment, acquires the specified sector data and associated data of the specified sector data from the storage equipment through a terminal according to the first reading instruction, stores the acquired specified sector data and associated data of the specified sector data in a cache, directly searches matched associated data in the cache after receiving a second reading instruction of the virtual machine for reading the associated data, and returns the searched associated data to the virtual machine. Therefore, the virtual machine is prevented from acquiring data from the storage device through multiple network interactions, the matched data stored in the cache is directly returned to the virtual machine, time consumed by multiple network interactions is saved, and the data processing speed is increased.
Drawings
FIG. 1 is a diagram of an application environment of a data processing system for a storage device in one embodiment;
FIG. 2 is a schematic diagram of the internal architecture of a data processing system including a storage device in one embodiment;
FIG. 3 is a flowchart illustrating a data processing method of a storage device according to an embodiment;
FIG. 4 is a flowchart illustrating a data processing method of a storage device according to another embodiment;
FIG. 5 is a flowchart illustrating the steps of reading a partition table and a boot sector in one embodiment;
FIG. 6 is a flowchart illustrating the steps of reading a partition table and a boot sector in another embodiment;
FIG. 7 is a flowchart illustrating the steps of writing data to a storage device in one embodiment;
FIG. 8 is a flowchart illustrating the steps for writing data to a storage device in another embodiment;
FIG. 9 is a flow diagram illustrating steps for adjusting the storage capacity of a cache, according to one embodiment;
FIG. 10 is a block diagram showing a configuration of a data processing apparatus of a storage device according to an embodiment;
FIG. 11 is a block diagram showing a configuration of a data processing apparatus of a storage device in another embodiment;
FIG. 12 is a block diagram showing a configuration of a data processing apparatus of a storage device in a further embodiment;
FIG. 13 is a block diagram showing a configuration of a data processing apparatus of a storage device in another embodiment;
fig. 14 is a block diagram showing a configuration of a data processing apparatus of the storage device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
FIG. 1 is a diagram of an application environment of a data processing system of a storage device including a terminal 110, a storage device 120, and a server 130 in one embodiment. The storage device 120 is connected to an interface of the terminal 110, a virtual machine runs on the server 130, the terminal 110 is connected to the server 130 through a network, the terminal 110 can access the virtual machine on the server 130, and the server 130 may specifically be a plurality of servers. The storage device 120 is a device with a data storage function, and may specifically be a usb disk, a memory card, a magnetic disk, a hard disk, a mobile phone with a storage function, a tablet computer, and the like.
Referring to fig. 3, in the data processing system of the storage device, an acceleration agent and a communication agent are run on the terminal 110 and the virtual machine running on the server 130, the acceleration agent is used to increase the speed of mapping the storage device to the virtual machine and the data transmission speed between the storage device and the virtual machine, and the communication agent is used to enable the virtual machine and the terminal 110 to communicate via the network. The protocol checker is configured to detect whether the transport protocol type of the storage device 120 is supported, and after the protocol checker detects that the transport protocol type of the storage device 120 is supported, the acceleration agent starts to run.
As shown in fig. 3, in one embodiment, a data processing method of a storage device is provided, which is exemplified by the server 130 of the data processing system of the storage device in fig. 1. The method specifically comprises the following steps:
step 302, a first read instruction for a virtual machine to read specified sector data in a storage device is received.
Specifically, after the terminal 110 accesses the storage device, the terminal 110 logs in to the virtual machine on the server 130, and after the storage device 120 is mapped to the virtual machine, the virtual machine obtains the sector information of the storage device 120 and the information of the data stored in the sector. After the storage device 120 is mapped to the virtual machine, when the virtual machine reads the specified sector data in the storage device 120, the virtual machine sends a first read instruction to the server 130, where the first read instruction includes a sector location or a data identifier of the data to be read. The sector position may be a sector number, and the data identifier may be a name of a file to which the data belongs or a key for reading the data.
And 304, acquiring the specified sector data and the associated data of the specified sector data from the storage device through the terminal according to the first reading instruction.
Specifically, after receiving the first reading instruction sent by the virtual machine, the server 130 analyzes the first reading instruction, modifies the data size requested by the first reading instruction to increase the requested data size, and sends the modified first reading instruction to the terminal 110. The terminal 110 analyzes the modified first reading instruction, and reads corresponding data in the storage device 120 according to the data storage location or the data identifier obtained by the analysis, where the read data includes specified sector data and associated data of the specified sector data. The associated data of the designated sector data may specifically be data belonging to the same file as the designated sector data, and these associated data may be stored in different sectors; the associated data may also be data stored in a sector adjacent to the designated sector.
In an embodiment, the server 130 receives a first reading instruction sent by the virtual machine, analyzes the first reading instruction, searches a storage location or a data identifier of associated data of the data to be read in the data of the partition table and the boot sector according to an analysis result, and puts the storage location or the data identifier of the associated data into the first reading instruction to send to the terminal 110.
Step 306, storing the data of the designated sector and the associated data in the cache, and returning the data of the designated sector to the virtual machine.
Specifically, the terminal 110 transmits the read designated sector data and the associated data of the designated sector to the server 130, and the server 130 stores the received designated sector data and the associated data of the designated sector data in the cache and simultaneously transmits the designated sector data to the virtual machine. When the server 130 is a plurality of servers, the cache may specifically be a cache pool formed by calling caches of the respective servers.
Step 308, receiving a second reading instruction for the virtual machine to read the associated data.
Specifically, when the virtual machine needs to process the associated data, a second read instruction is sent to the server, where the second read instruction is used to read the associated data, where the second read instruction includes a sector position or an associated data identifier of the associated data to be read in the storage device 120.
And step 310, returning the matched associated data in the cache to the virtual machine according to the second reading instruction.
Specifically, the server 130 receives the second reading instruction, and analyzes the second reading instruction to obtain a sector position of the associated data to be read or an associated data identifier. The server 130 searches the matched associated data in the cache according to the sector position or the associated data identifier of the associated data, and the data with the same sector position or data identifier is the matched associated data. After finding the matched associated data, the server 130 directly extracts the matched associated data in the cache, and returns the matched associated data to the virtual machine.
In one embodiment, referring to fig. 4, in step 402, the server 130 receives a first read command of the virtual machine; in step 404, the server 130 requests data from the storage device 120 through the terminal 110 according to the first reading instruction; in step 406, the server 130 receives the specified sector data and the associated data of the specified sector data read by the terminal 110 from the virtual machine acquired in the storage device 120, and stores the data in the cache; in step 408, the server 130 returns the specified sector data to the virtual machine; in step 410, the server 130 returns the associated data in the cache to the virtual machine according to the second read instruction sent by the virtual machine.
In this embodiment, a first read instruction for reading specified sector data in a storage device by a virtual machine is received, associated data of the specified sector data and the specified sector data is obtained from the storage device through a terminal according to the first read instruction, the obtained associated data of the specified sector data and the specified sector data is stored in a cache, after a second read instruction for reading associated data by the virtual machine is received, matched associated data is directly searched in the cache, and the searched associated data is returned to the virtual machine. Therefore, the virtual machine is prevented from acquiring data from the storage device through multiple network interactions, the matched data stored in the cache is directly returned to the virtual machine, time consumed by multiple network interactions is saved, and the data processing speed is increased.
As shown in fig. 5, in an embodiment, step 302 further includes the step of reading the partition table and the boot sector:
step 502, identifying the transmission protocol and the file system type of the storage device through the terminal, verifying the transmission protocol, and reading the partition table and the boot sector corresponding to the file system type after the verification is passed.
Specifically, when the storage device 120 accesses to the interface of the terminal 110, the terminal 110 identifies the storage device, extracts the transmission protocol used by the storage device 120, and verifies the extracted transmission protocol. Specifically, a protocol support list may be established in the terminal 110, a transmission protocol supported by the terminal 110 is stored in the protocol support list, whether a corresponding transmission protocol exists is searched in the protocol support list, and if the corresponding transmission protocol exists, it is indicated that the terminal 110 supports the transmission protocol of the storage device 120, and the verification is passed; if the terminal 110 does not support the transmission protocol of the storage device 120, the authentication is not passed. The Transport Protocol may specifically be a BOT Protocol (Bulk Transport Protocol), an MTP Protocol (Media Transport Protocol), or a USAP Protocol (USB Attach SCSI Protocol).
After the terminal 110 verifies the transmission protocol of the storage device 120, the terminal 110 identifies the file system type of the storage device 120, and parses the partition table and the boot sector of the identified file system. The file system type may be any one of FAT32, NTFS, NTFST32, EXT2, EXT3, and XFS, and may be other file system types.
In step 504, the data read by the terminal from the partition table and the boot sector in the storage device is received.
Specifically, the terminal 110 reads the data in the partition table and the boot sector to obtain the data in the partition table and the boot sector. The partition table records a plurality of small subsets called partitions, and records data such as sector positions stored in each partition, and when data is processed, the plurality of partitions can be processed in order according to the partition table. The boot sector records sector information of the storage device 120, and the sector information may specifically include at least one of a size of each storage space, a number of sectors per track, a total number of sectors, and a number of heads.
Step 506, the read data is stored in a cache.
Step 508, receiving a third read instruction for the virtual machine to read the partition table and the boot sector of the storage device.
Specifically, when the terminal 110 maps the storage device 120 onto the virtual machine, the virtual machine detects the storage device 120, and the virtual machine sends a third read instruction for reading the partition table and the boot sector of the storage device 120 to the storage device 120 through the server 130.
And step 510, sending the read data in the cache to the virtual machine according to the third read instruction.
Specifically, the server 130 intercepts and captures the third read instruction, analyzes the third read instruction, searches the partition table and the data of the boot sector read by the terminal 110 in the cache according to the result obtained by the analysis, and directly returns the searched data to the virtual machine to complete the mapping process from the storage device 120 to the virtual machine.
In one embodiment, referring to fig. 6, in step 602, server 130 receives data that terminal 110 reads partition tables and boot sectors of storage device 120, and stores the received data in a cache; in step 604, server 130 receives an instruction of a virtual machine to read a partition table and a boot sector of storage device 120; in step 606, server 130 sends the data of the partition table and the boot sector in the cache to the virtual machine.
In this embodiment, when the storage device 120 is accessed in the terminal 110, the terminal 110 verifies the transmission protocol of the storage device 120, and after the verification is passed, directly reads the partition table and the data of the boot sector of the storage device 120, and the server 130 stores the partition table and the data of the boot sector in the cache. After receiving the instruction for the virtual machine to read the partition table and the boot sector, the server 130 directly returns the data of the partition table and the boot sector from the cache to the virtual machine, so as to complete the mapping from the storage device 120 to the virtual machine. In this way, multiple network interactions of the virtual machine and the storage device 120 are avoided, time consumed by the multiple network interactions is saved, and the mapping speed of the storage device 120 to the virtual machine is increased.
As shown in fig. 7 and fig. 8, in an embodiment, step 302 further includes a step of writing data to the storage device:
step 702, receiving a write instruction sent by the virtual machine to perform a write operation on the storage device.
Specifically, when the virtual machine performs data writing operation on the storage device 120, the virtual machine may issue a write instruction, where the write instruction may specifically include a sector location in the storage device 120 where the write operation is performed.
Step 704, storing the write data of the virtual machine in the cache, and returning a result of successful data write to the virtual machine.
Specifically, the server 130 obtains write data that the virtual machine needs to write into the storage device 120 according to the write instruction, or the server 130 receives the write data sent by the virtual machine, and the server 130 stores the write data in a cache and sends a result of successful data writing to the virtual machine.
In one embodiment, if the server 130 receives an instruction for reading the write data by the virtual machine, the read data may be directly searched in the cache, and the searched write data is returned to the virtual machine.
And step 706, writing the write data in the cache into the designated sector of the storage device through the terminal according to the write command.
Specifically, the server 130 sends the write command and the write data in the cache to the terminal 110, the terminal 110 analyzes the write command, obtains information of a write sector of the storage device 120 through analysis of the write command, and the terminal determines the sector according to the information of the write sector and writes the write data into the determined sector.
In one embodiment, when monitoring that the network transmission speed is greater than the preset threshold, the server 130 extracts the write data in the cache, and writes the write data in the designated sector of the storage device through the terminal according to the write command.
In this embodiment, when the virtual machine performs a write operation on the storage device, after the virtual machine sends a write instruction, the server 130 stores the write data of the virtual machine in the cache, and simultaneously returns a result of successful data write to the virtual machine, and then writes the write data into a specified sector in the storage device through the terminal. Therefore, the situation that the virtual machine and the storage device 120 need to perform network interaction for many times to write data into the storage device 120 is avoided, and the data writing speed is guaranteed on the premise of guaranteeing the data accuracy.
As shown in fig. 9, in an embodiment, the data processing method of the storage device further includes the step of adjusting the buffer capacity:
step 902, monitoring a network transmission state.
Specifically, the server 130 monitors the network transmission state when performing the writing operation according to the writing instruction, and may specifically detect the network transmission speed, that is, the amount of data transmitted by the network in a time unit, and may specifically detect the network transmission quality.
And 904, adjusting the storage capacity of the cache according to the network transmission state.
Specifically, when the server 130 monitors that the network transmission speed is fast, the storage capacity of the cache is increased or decreased, when the network transmission speed is slow, the storage capacity of the cache is decreased or increased, the server 130 adjusts the storage capacity of the cache according to the network transmission state, it is ensured that the storage capacity of the cache is enough for storing complete data when the network transmission is unstable, and data cannot be updated or lost due to the fact that the storage capacity of the cache is small is avoided.
In this embodiment, the server 130 adjusts the storage capacity of the cache according to the network transmission state, so that when the write-in data of the virtual machine is asynchronously cached, the cache has enough storage capacity to store the write-in data, and the situations that the data cannot be updated and the data is lost due to insufficient storage capacity of the cache are avoided.
As shown in fig. 10, in one embodiment, there is provided a data processing apparatus 1000 of a storage device, the apparatus comprising: a first instruction receiving module 1002, a data obtaining module 1004, a first data returning module 1006, a second instruction receiving module 1008, and a second data returning module 1010.
The first instruction receiving module 1002 is configured to receive a first read instruction for reading data of a designated sector in a storage device by a virtual machine.
A data obtaining module 1004, configured to obtain, by the terminal, the specified sector data and associated data of the specified sector data from the storage device according to the first read instruction.
A first data return module 1006 for storing the specified sector data and associated data in a cache and returning the specified sector data to the virtual machine.
The second instruction receiving module 1008 is configured to receive a second reading instruction that the virtual machine reads the associated data.
And a second data returning module 1010, configured to return the matched associated data in the cache to the virtual machine according to the second read instruction.
In this embodiment, a first read instruction for reading specified sector data in a storage device by a virtual machine is received, associated data of the specified sector data and the specified sector data is obtained from the storage device through a terminal according to the first read instruction, the obtained associated data of the specified sector data and the specified sector data is stored in a cache, after a second read instruction for reading associated data by the virtual machine is received, matched associated data is directly searched in the cache, and the searched associated data is returned to the virtual machine. Therefore, the virtual machine is prevented from acquiring data from the storage device through multiple network interactions, the matched data stored in the cache is directly returned to the virtual machine, time consumed by multiple network interactions is saved, and the data processing speed is increased.
As shown in fig. 11, in an embodiment, the data processing apparatus 1000 of the storage device further includes: a data receiving module 1012, a data caching module 1014, a third instruction receiving module 1016, and a data sending module 1018.
A data receiving module 1012, configured to receive data read by the terminal from the partition table and the boot sector in the storage device.
And a data caching module 1014 for storing the read data in a cache.
A third instruction receiving module 1016, configured to receive a third read instruction for the virtual machine to read the partition table and the boot sector of the storage device.
And a data sending module 1018, configured to send the data read in the cache to the virtual machine according to the third read instruction.
In this embodiment, the server 130 stores the partition table and the data of the boot sector read by the terminal in the cache, and after receiving the instruction of the virtual machine to read the partition table and the boot sector, the server 130 directly returns the data of the partition table and the boot sector from the cache to the virtual machine, so as to complete mapping from the storage device 120 to the virtual machine. In this way, multiple network interactions of the virtual machine and the storage device 120 are avoided, time consumed by the multiple network interactions is saved, and the mapping speed of the storage device 120 to the virtual machine is increased.
As shown in fig. 12, in an embodiment, the data processing apparatus 1000 of the storage device specifically further includes: storage device identification module 1020.
The storage device identification module 1020 identifies a transmission protocol and a file system type of the storage device through the terminal, verifies the transmission protocol, and reads the partition table and the boot sector corresponding to the file system type after the verification is passed.
In this embodiment, the terminal 110 may support a transmission protocol and a file system type of the storage device, and verify the transmission protocol to ensure that the partition table and the boot sector corresponding to the file system type can be correctly read.
As shown in fig. 13, in an embodiment, the data processing apparatus 1000 of the storage device further includes: a write command receiving module 1022, a data storage module 1024, and a data writing module 1026.
The write command receiving module 1022 is configured to receive a write command sent by the virtual machine to perform a write operation on the storage device.
And the data storage module 1024 is configured to store the write data of the virtual machine in the cache, and return a result of successful data write to the virtual machine.
And a data writing module 1026, configured to write the written data in the cache into a specified sector of the storage device through the terminal according to the writing instruction.
In this embodiment, when the virtual machine performs a write operation on the storage device, after the virtual machine sends a write instruction, the server 130 stores the write data of the virtual machine in the cache, and simultaneously returns a result of successful data write to the virtual machine, and then writes the write data into a specified sector in the storage device through the terminal. Therefore, the situation that the virtual machine and the storage device 120 need to perform network interaction for many times to write data into the storage device 120 is avoided, and the data writing speed is improved.
As shown in fig. 14, in an embodiment, the data processing apparatus 1000 of the storage device specifically further includes: a network monitoring module 1028 and a cache adjustment module 1030.
And the network monitoring module is used for monitoring the network transmission state.
And the cache adjusting module is used for adjusting the storage capacity of the cache according to the network transmission state.
In this embodiment, the server 130 adjusts the storage capacity of the cache according to the network transmission state, so that when the write-in data of the virtual machine is asynchronously cached, the cache has enough storage capacity to store the write-in data, and the situations that the data cannot be updated and the data is lost due to insufficient storage capacity of the cache are avoided.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A data processing method of a storage device, the method comprising:
receiving data read by a terminal from a partition table and a boot sector in a storage device; storing the read data in a cache;
receiving a reading instruction of a virtual machine for reading a partition table and a boot sector of a storage device; sending the read data in the cache to the virtual machine according to the reading instruction;
receiving a first reading instruction of a virtual machine for reading specified sector data in storage equipment accessed by a terminal; the first read instruction comprises a sector location of data to be read;
analyzing the first reading instruction, searching a storage position of associated data of the data to be read in data read from a partition table and a guide sector in a storage device according to an analysis result, and putting the storage position of the associated data into the first reading instruction;
acquiring the appointed sector data and the associated data of the appointed sector data from the storage equipment through a terminal according to a first reading instruction placed in the storage position; the associated data is data stored in a sector adjacent to the designated sector;
storing the designated sector data and the associated data in a cache, and returning the designated sector data to the virtual machine;
receiving a second reading instruction for reading the associated data by the virtual machine; the second read instruction comprises a sector position of the associated data to be read;
and returning the matched associated data in the cache to the virtual machine according to the sector position in the second read instruction.
2. The method of claim 1, wherein the partition table records the division of data into many small subsets called partitions and the location of the sectors stored by each partition; the sector information of the storage device is recorded in the boot sector.
3. The method of claim 1, wherein the receiving terminal further comprises, before the data read from the partition table and the boot sector in the storage device:
identifying a transmission protocol and a file system type of a storage device through a terminal, verifying the transmission protocol, and reading a partition table and a boot sector corresponding to the file system type after the verification is passed.
4. The method of claim 1, wherein before receiving the first read instruction for the virtual machine to read the data of the specified sector in the storage device, the method further comprises:
receiving a write-in instruction which is sent by the virtual machine and used for executing write-in operation on the storage equipment;
storing the write-in data of the virtual machine into the cache, and returning a result of successful data write-in to the virtual machine;
and writing the written data in the cache into a specified sector of the storage device through the terminal according to the writing instruction.
5. The method of claim 4, further comprising:
monitoring a network transmission state;
and adjusting the storage capacity of the cache according to the network transmission state.
6. A data processing apparatus of a storage device, the apparatus comprising:
the data receiving module is used for receiving data read by the terminal from the partition table and the boot sector in the storage device;
the data cache module is used for storing the read data in a cache;
a third instruction receiving module, configured to receive a reading instruction for reading the partition table and the boot sector of the storage device by the virtual machine;
the data sending module is used for sending the read data in the cache to the virtual machine according to the reading instruction;
a first instruction receiving module, configured to receive a first reading instruction for reading sector data specified in a storage device accessed by a terminal by a virtual machine; the first read instruction comprises a sector location of data to be read;
a data obtaining module, configured to obtain, by a terminal, the specified sector data and associated data of the specified sector data from the storage device according to a sector position in the first read instruction; the associated data is data stored in a sector adjacent to the designated sector;
the first data returning module is used for storing the specified sector data and the associated data in a cache and returning the specified sector data to the virtual machine;
a second instruction receiving module, configured to receive a second reading instruction that the virtual machine reads the associated data; the second read instruction comprises a sector position of the associated data to be read;
and the second data returning module is used for returning the matched associated data in the cache to the virtual machine according to the sector position in the second reading instruction.
7. The apparatus of claim 6, wherein the partition table records the data divided into many small subsets called partitions, and records the location of the sectors stored in each partition; the sector information of the storage device is recorded in the boot sector.
8. The apparatus of claim 6, further comprising:
and the storage equipment identification module identifies the transmission protocol and the file system type of the storage equipment through the terminal, verifies the transmission protocol, and reads the partition table and the guide sector corresponding to the file system type after the verification is passed.
9. The apparatus of claim 6, further comprising:
a write instruction receiving module, configured to receive a write instruction, which is sent by the virtual machine and used for executing a write operation on the storage device;
the data storage module is used for storing the write-in data of the virtual machine into the cache and returning a result of successful data write-in to the virtual machine;
and the data writing module is used for writing the written data in the cache into a specified sector of the storage device through the terminal according to the writing instruction.
10. The apparatus of claim 9, further comprising:
the network monitoring module is used for monitoring the network transmission state;
and the cache adjusting module is used for adjusting the storage capacity of the cache according to the network transmission state.
CN201610130845.1A 2016-03-08 2016-03-08 Data processing method and device of storage equipment Active CN107168767B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610130845.1A CN107168767B (en) 2016-03-08 2016-03-08 Data processing method and device of storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610130845.1A CN107168767B (en) 2016-03-08 2016-03-08 Data processing method and device of storage equipment

Publications (2)

Publication Number Publication Date
CN107168767A CN107168767A (en) 2017-09-15
CN107168767B true CN107168767B (en) 2020-07-10

Family

ID=59848692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610130845.1A Active CN107168767B (en) 2016-03-08 2016-03-08 Data processing method and device of storage equipment

Country Status (1)

Country Link
CN (1) CN107168767B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719103A (en) * 2009-11-25 2010-06-02 成都市华为赛门铁克科技有限公司 Memory device and information processing method based on same
CN103389884A (en) * 2013-07-29 2013-11-13 华为技术有限公司 Method for processing input/output request, host, server and virtual machine
CN103593147A (en) * 2013-11-07 2014-02-19 华为技术有限公司 Data reading method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069587B2 (en) * 2011-10-31 2015-06-30 Stec, Inc. System and method to cache hypervisor data
US9218193B2 (en) * 2013-07-12 2015-12-22 International Business Machines Corporation Distributed virtual machine image management for cloud computing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719103A (en) * 2009-11-25 2010-06-02 成都市华为赛门铁克科技有限公司 Memory device and information processing method based on same
CN103389884A (en) * 2013-07-29 2013-11-13 华为技术有限公司 Method for processing input/output request, host, server and virtual machine
CN103593147A (en) * 2013-11-07 2014-02-19 华为技术有限公司 Data reading method and device

Also Published As

Publication number Publication date
CN107168767A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN108459826B (en) Method and device for processing IO (input/output) request
US10564880B2 (en) Data deduplication method and apparatus
US9710283B2 (en) System and method for pre-storing small data files into a page-cache and performing reading and writing to the page cache during booting
CN109445685B (en) User mode file system processing method
JPWO2004104838A1 (en) Data access response system, storage system, client device, cache device, and access method to data access response system
CN108628542B (en) File merging method and controller
US9430492B1 (en) Efficient scavenging of data and metadata file system blocks
CN107203480B (en) Data prefetching method and device
CN103399823A (en) Method, equipment and system for storing service data
CN103049224A (en) Method, device and system for importing data into physical tape
CN103136215A (en) Data read-write method and device of storage system
WO2021226822A1 (en) Log write method and apparatus, electronic device, and storage medium
CN104407990B (en) A kind of disk access method and device
CN111803917A (en) Resource processing method and device
CN105654972A (en) Exchangeable caddy and optical disc juke box-orientated fast self-checking method and device
CN113553325A (en) Synchronization method and system for aggregation objects in object storage system
US11520818B2 (en) Method, apparatus and computer program product for managing metadata of storage object
CN107168767B (en) Data processing method and device of storage equipment
CN113297267A (en) Data caching and task processing method, device, equipment and storage medium
CN103488772A (en) Method, system and equipment for caching files through external storage
US20230409235A1 (en) File system improvements for zoned storage device operations
US11416155B1 (en) System and method for managing blocks of data and metadata utilizing virtual block devices
CN104539746B (en) A kind of method, nas head and SAN accessing data
CN114647658A (en) Data retrieval method, device, equipment and machine-readable storage medium
CN103064926A (en) Data processing method and device

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
CB02 Change of applicant information

Address after: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building A1 layer

Applicant after: SANGFOR TECHNOLOGIES Inc.

Address before: Nanshan District Xueyuan Road in Shenzhen city of Guangdong province 518000 No. 1001 Nanshan Chi Park building A1 layer

Applicant before: Sangfor Technologies Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant