WO2019214694A1 - Method for storing data, and method, device, and system for reading data - Google Patents
Method for storing data, and method, device, and system for reading data Download PDFInfo
- Publication number
- WO2019214694A1 WO2019214694A1 PCT/CN2019/086285 CN2019086285W WO2019214694A1 WO 2019214694 A1 WO2019214694 A1 WO 2019214694A1 CN 2019086285 W CN2019086285 W CN 2019086285W WO 2019214694 A1 WO2019214694 A1 WO 2019214694A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- block unit
- virtual
- data
- file
- storage
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004590 computer program Methods 0.000 claims description 6
- 238000013500 data storage Methods 0.000 abstract description 9
- 238000004891 communication Methods 0.000 abstract description 8
- 230000002093 peripheral effect Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/064—Management of blocks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/0662—Virtualisation aspects
- G06F3/0664—Virtualisation aspects at device level, e.g. emulation of a storage device or system
Definitions
- the present application relates to the field of communications, and in particular, to a method for storing data, a method, device, and system for reading data.
- the terminal can manage at least one camera device, and each camera device can transmit the captured data to its corresponding terminal.
- the storage space in the terminal is limited. For this reason, relatively inexpensive block devices are currently deployed on the server side to store data in the terminal.
- the block device is provided with a large-capacity disk, and the terminal can send the data to be stored to the block device connected to the server, and the block device stores the data and stores the data on the local disk. Since the reliability of the block device is not high, the data storage block device causes the storage reliability of the data to be low.
- the embodiment of the present application provides a method for storing data, a method, device, and system for reading data.
- the technical solution is as follows:
- the present application provides a method of storing data, the method comprising:
- the connection Receiving, by the connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk, where the first virtual file is in the server a virtual file, the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal, and the connection is a connection between the terminal and the server;
- the determining, according to the start address and the first virtual file, the offset addresses of the first storage block unit and the to-be-stored data in the first storage block unit including:
- the method further includes:
- the second virtual file corresponding to the second virtual disk is created in the server.
- the method further includes:
- the present application provides a method of reading data, the method comprising:
- a read command sent by the terminal, where the read command includes a data amount of data to be read and a start address of the data to be read in the first virtual disk, where A virtual file is a virtual file in the server, the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal, and the connection is a connection between the terminal and the server. ;
- the determining, according to the starting address and the first virtual file, the offset addresses of the first storage block unit and the to-be-read data in the first storage block unit including:
- the method further includes:
- the second virtual file corresponding to the second virtual disk is created in the server.
- the method further includes:
- the present application provides an apparatus for storing data, the apparatus comprising:
- a receiving module configured to receive, by using a connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk, the first virtual
- the file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;
- a determining module configured to determine, according to the starting address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, the first virtual
- the disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit;
- a storage module configured to store the to-be-stored data in the first storage block unit according to the offset address.
- the determining module includes:
- An obtaining unit configured to acquire, according to the file identifier of the first virtual file, at least one unit identifier corresponding to the first virtual disk from a correspondence between a file identifier and a unit identifier stored in the cloud storage platform;
- a determining unit configured to determine, according to the starting address and a capacity of the storage block unit, a first storage block unit and the to-be-stored data in the first storage block unit from a corresponding storage block unit of each unit identifier Offset address.
- the device further includes:
- a creating module configured to create a second virtual file corresponding to the second virtual disk in the server when the terminal creates the second virtual disk.
- the device further includes:
- An application module configured to apply, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and identify a file identifier of the second virtual file and each storage block in the at least one storage unit
- the unit identifier of the unit corresponds to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- the present application provides an apparatus for reading data, the apparatus comprising:
- a receiving module configured to receive, by using a connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes an amount of data of the data to be read and a start of the data to be read in the first virtual disk
- the first virtual file is a virtual file in the server
- the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal
- a determining module configured to determine, according to the starting address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit, the first The virtual disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit;
- a reading module configured to read the data to be read from the first storage block unit according to the offset address and the data amount
- a sending module configured to send the to-be-read data to the terminal.
- the determining module includes:
- an obtaining unit configured to acquire, according to the file identifier of the first virtual file, the at least one unit identifier corresponding to the first virtual disk from the correspondence between the file identifier and the unit identifier stored in the cloud storage platform;
- a determining unit configured to determine, according to the starting address and a capacity of the storage block unit, a first storage block unit from the corresponding storage block unit and a data to be read in the first storage block unit The offset address in .
- the device further includes:
- a creating module configured to create a second virtual file corresponding to the second virtual disk in the server when the terminal creates the second virtual disk.
- the device further includes:
- An application module configured to apply, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and store the file identifier of the second virtual file and each of the at least one storage block unit
- the unit identifier of the block unit corresponds to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- the application provides a system for storing data, the system comprising:
- the server is configured to receive, by using a connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk,
- the first virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;
- the server is further configured to determine, according to the start address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, where a virtual disk corresponding to at least one memory block unit in the cloud storage platform, the first memory block unit being one of the at least one memory block unit; storing the data to be stored according to the offset address In the first memory block unit.
- the application provides a system for reading data, the system comprising:
- the server is configured to receive, by using a connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes an amount of data to be read data and the to-be-read data is in the first virtual disk a starting address, the first virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;
- the server is further configured to determine, according to the start address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit,
- the first virtual disk corresponds to at least one storage block unit in the cloud storage platform, the first storage block unit is one of the at least one storage block unit; according to the offset address and the data amount, Reading the data to be read in the first storage block unit; and sending the data to be read to the terminal.
- the present application provides a computer readable storage medium having stored therein a computer program, the computer program being executed by a processor to implement any of the first aspect or the first aspect
- An exemplary method step or the computer program is executed by a processor to implement any of the exemplary method steps of the first aspect or the first aspect.
- the first virtual file corresponds to the connection of the terminal
- determining the cloud storage platform according to the first virtual file and the starting address in the storage command And an offset address of the first storage block unit for storing data to be stored and the data to be stored in the first storage block unit, according to the offset address, storing the data to be stored in the first storage block unit.
- the data to be stored is stored in the cloud storage platform, and the reliability of the storage data of the cloud storage platform is high, thereby improving the reliability of the data storage.
- FIG. 1 is a schematic structural diagram of a system provided by an embodiment of the present application.
- FIG. 2 is a flowchart of a method for storing data according to an embodiment of the present application
- FIG. 3 is a flowchart of another method for storing data according to an embodiment of the present application.
- FIG. 5 is a flowchart of another method for reading data according to an embodiment of the present application.
- FIG. 6 is a schematic structural diagram of an apparatus for reading data according to an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of an apparatus for reading data according to an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a system according to an embodiment of the present disclosure.
- FIG. 9 is a schematic structural diagram of a device according to an embodiment of the present application.
- an embodiment of the present application provides a storage system, where the storage system includes:
- Terminal 1 server 2 and cloud storage platform 3.
- the terminal 1 includes at least one virtual disk.
- the server 2 includes a kernel layer and a user layer.
- the kernel layer includes at least one virtual kernel device
- the user layer includes at least one virtual user device
- each virtual user device corresponds to one virtual file.
- Each virtual core device corresponds to one virtual user device in the user layer and one virtual disk in the corresponding terminal 1. Therefore, each virtual user device also corresponds to a virtual disk on the terminal 1, and the virtual file of each virtual user device corresponds to a virtual disk on the terminal 1.
- the cloud storage platform 3 includes at least one storage block unit corresponding to each of the at least one virtual disk.
- At least one connection is established between the terminal 1 and the server 2, and the at least one connection is a long connection.
- the virtual disk corresponds to a connection between the terminal 1 and the server 2, and a virtual kernel device, a virtual user device, and a virtual file corresponding to the virtual disk in the server 2, the virtual core
- the device, the virtual user device, and the virtual file all correspond to the one connection.
- the virtual disk is not the physical disk actually existing in the terminal 1, and the actual storage space corresponding to the virtual disk is located in the cloud storage platform 3, that is, the actual storage space corresponding to the virtual disk is the virtual disk in the cloud storage platform 3.
- mapping between the file identifier and the unit identifier is saved in the cloud storage platform 3, and the correspondence is used to save the correspondence between the file identifier of the virtual file corresponding to the virtual disk and the unit identifier of each storage block unit corresponding to the virtual disk. relationship.
- the cloud storage platform 3 includes a metadata cluster 31 and a storage cluster 32.
- the metadata cluster 31 stores a correspondence between a file identifier and a unit identifier.
- the storage cluster 32 includes at least one storage block unit corresponding to each virtual disk. .
- the embodiment of the present application provides a method for storing data, which may be applied to the system shown in FIG. 1 , and the execution of the method may be a server in the system, including:
- Step 201 Receive a storage command sent by the terminal by using a connection corresponding to the first virtual file, where the storage command includes a data to be stored and a starting address of the data to be stored in the first virtual disk.
- the first virtual file is a virtual file in the server
- the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal
- the connection is a connection between the terminal and the server.
- Step 202 Determine, according to the start address and the first virtual file, an offset address of the first storage block unit and the data to be stored in the first storage block unit.
- the first virtual disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit.
- Step 203 Store the data to be stored in the first storage block unit according to the offset address.
- the first virtual file corresponds to the connection of the terminal
- determining the cloud storage platform according to the first virtual file and the starting address in the storage command And an offset address of the first storage block unit for storing data to be stored and the data to be stored in the first storage block unit, according to the offset address, storing the data to be stored in the first storage block unit.
- the data to be stored is stored in the cloud storage platform, and the reliability of the storage data of the cloud storage platform is high, thereby improving the reliability of the data storage.
- an embodiment of the present application provides a method for storing data, which may be applied to the system shown in FIG. 1, including:
- Step 301 The terminal creates a second virtual disk, establishes a connection corresponding to the second virtual disk with the server, and sends a create command to the server, where the create command includes the capacity of the second virtual disk.
- the user can trigger the terminal to create a second virtual disk and set the capacity of the second virtual disk in the terminal.
- the terminal can obtain the capacity of the second virtual disk set by the user, create a second virtual disk, establish a connection corresponding to the second virtual disk with the server, and send a create command to the server through the connection, the creation command includes the second The capacity of the virtual disk.
- the second virtual disk created by the terminal is not the physical disk actually existing on the terminal. Therefore, in this embodiment, the terminal may not include a disk.
- Step 302 The server receives the creation command, creates a second virtual file corresponding to the second virtual disk, and sets a second virtual file corresponding to the connection.
- the server can receive the creation command through the connection, create a virtual kernel device corresponding to the second virtual disk at the kernel layer thereof, and create a virtual user device corresponding to the second virtual disk and the second virtual file at the user layer thereof, and associate the connection with the virtual device.
- the virtual kernel device associates the virtual kernel device with the virtual user device and associates the virtual user device with the second virtual file.
- the operating system installed by the server may be a Linux system, and the virtual kernel device and the virtual user device may be created by using the provided targetcli command.
- the virtual kernel device can be used as a lun device, and the lun device is a block device, and the virtual user device acts as a UIO device.
- the second virtual file created by the server is not the file actually existing on the server.
- the server only the file identifier of the second virtual file can be used as the second virtual file.
- the disk may not be included in the server.
- Step 303 The server applies for at least one storage block unit corresponding to the second virtual disk in the cloud storage platform according to the capacity of the second virtual disk.
- the cloud storage platform includes a metadata cluster and a storage cluster.
- the storage cluster includes a large number of storage block units, and each storage block unit has the same capacity.
- the memory block unit can be an object.
- the method may be: the server calculates the number of the storage block units corresponding to the second virtual disk according to the capacity of the second virtual disk and the capacity of the storage block unit, and applies the storage block unit from the storage cluster of the cloud storage platform according to the number.
- the applied storage block unit is a storage block unit corresponding to the second virtual disk.
- the capacity of the second virtual disk is 30G
- the capacity of each storage block unit in the storage cluster of the cloud storage platform is 5G
- the second is calculated according to the capacity 30G of the second virtual disk and the capacity 5G of the storage block unit.
- the number of the storage block units corresponding to the virtual disk is six, and six storage block units are applied from the storage cluster of the cloud storage platform, and the six storage block units are the storage block units corresponding to the second virtual disk.
- Step 304 The server saves the file identifier of the second virtual file and the unit identifier of each storage block unit corresponding to the second virtual disk in the corresponding relationship between the file identifier and the unit identifier of the cloud storage platform.
- the metadata cluster of the cloud storage platform stores the correspondence between the file identifier and the unit identifier. Therefore, in this step, the server may save the file identifier of the second virtual file and the unit identifier of each storage block unit corresponding to the second virtual disk in the correspondence between the file identifier and the unit identifier in the metadata cluster.
- the steps of 301 to 304 above may be repeatedly performed, creating a plurality of virtual disks on the terminal and creating a virtual file corresponding to each virtual disk at the server.
- the user can store data to a virtual disk of the terminal.
- the virtual disk is called the first virtual disk, and the data is called data to be stored. Then store the data to be stored in the first virtual disk as follows.
- Step 305 The terminal acquires a starting address of the data to be stored and the data to be stored in the first virtual disk, and sends a storage command to the server by using a connection corresponding to the first virtual disk, where the storage command includes data to be stored and the starting address.
- the user may input the data to be stored to the terminal, and may also input the starting address of the data to be stored in the first virtual disk to the terminal.
- the terminal may save the occupied space capacity of the first virtual disk.
- the data to be stored may be determined according to the occupied space capacity. The starting address in the first virtual disk.
- Step 306 The server receives, by using the connection, a storage command sent by the terminal, where the storage command includes a data to be stored and a starting address of the data to be stored in the first virtual disk, and determines a first virtual file corresponding to the connection.
- the first virtual file is a virtual file corresponding to the first virtual disk in the server. And the first virtual file has a corresponding file identifier.
- the server receives the storage command via a virtual kernel device associated with the connection, the virtual kernel device entering the storage command into the virtual user device.
- the server then retrieves the storage command from the virtual user device.
- the command sent by the terminal to the server is first received by the virtual kernel device of the kernel layer, and the server does not know whether the command is a read command or a storage command.
- the virtual core device enters the command into its corresponding virtual user device.
- the server can obtain the command from the virtual user device, and identify whether the command is a read command or a storage command, and obtain a virtual file corresponding to the virtual user device as the first virtual file.
- Step 307 The server determines, according to the start address and the first virtual file, an offset address of the first storage block unit and the data to be stored in the first storage block unit.
- the server acquires, according to the file identifier of the first virtual file, the at least one unit identifier corresponding to the first virtual disk from the correspondence between the file identifier and the unit identifier stored by the cloud storage platform; according to the start address and the storage block unit
- the capacity determines an offset address of the first memory block unit and the data to be stored in the first memory block unit from the memory block unit corresponding to each unit identifier.
- the capacity of each memory block unit in the cloud storage platform may be equal. It is assumed that the starting address of the data to be stored in the first virtual disk is at the position of 7G, and the capacity of each storage block unit is 5G. Thus, according to the start address and the capacity of the storage block unit, the determined first storage block unit is the second storage block unit corresponding to the first virtual disk and the offset address of the data to be stored in the first storage block unit is 2G. s position.
- Step 308 The server stores the data to be stored in the first storage block unit according to the offset address.
- the server may store the data to be stored in the second storage block unit corresponding to the first virtual disk according to the location of the 2G.
- the server passes the first
- the virtual kernel device corresponding to the virtual disk receives the storage command, and the virtual kernel device inputs the storage command to the corresponding virtual user device, and the server obtains the storage command from the virtual user device, according to the first virtual file corresponding to the virtual user device.
- Determining, in the storage command, a first storage block unit for storing data to be stored in the cloud storage platform and an offset address of the data to be stored in the first storage block unit, according to the offset address The data to be stored is stored in the first memory block unit. In this way, the data to be stored is stored in the cloud storage platform, and the reliability of the storage data of the cloud storage platform is high, thereby improving the reliability of the data storage.
- the embodiment of the present application provides a method for reading data, which may be applied to the system shown in FIG. 1 , and the execution of the method may be a server in the system, including:
- Step 401 The read command sent by the terminal is received by the connection corresponding to the first virtual file, where the read command includes the data amount of the data to be read and the start address of the data to be read in the first virtual disk.
- the first virtual file is a virtual file in the server
- the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal
- the connection is a connection between the terminal and the server.
- Step 402 Determine an offset address of the first memory block unit and the data to be read in the first memory block unit according to the start address and the first virtual file.
- the first virtual disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit.
- Step 403 Read data to be read from the first storage block unit according to the offset address and the data amount.
- Step 404 Send data to be read to the terminal.
- the first virtual file corresponds to the connection of the terminal
- determining the cloud storage according to the first virtual file and the starting address in the read command And a offset address of the first memory block unit for storing data to be read and the data to be read in the first memory block unit in the platform, and reading data in the first memory block unit according to the offset address.
- This can support the storage of data in the cloud storage platform, and the storage reliability of the cloud storage platform is higher, thereby improving the reliability of the data storage.
- an embodiment of the present application provides a method for reading data, which may be applied to the system shown in FIG. 1, including:
- Steps 501 to 504 are the same as steps 301 to 304, respectively, and will not be described in detail herein.
- the user may input the starting address of the data to be read in the first virtual disk and the data amount of the data to be read to the terminal, where the first virtual disk is a terminal. Any of the virtual disks in .
- Step 505 The terminal acquires a starting address of the data to be read in the first virtual disk and a data amount of the data to be read, and sends a read command to the server by using a connection corresponding to the first virtual disk, where the read command includes a to-be-read Take the starting address and amount of data.
- the user can directly input the starting address and the amount of data of the data to be read in the first virtual disk to the terminal.
- the terminal receives the start address of the data to be read input by the user in the first virtual disk and the data amount of the data to be read, determines a connection corresponding to the first virtual disk, and sends a read to the server through the determined connection.
- the read command includes a start address and a data amount of data to be stored.
- Step 506 The server receives, by using the connection, a read command sent by the terminal, where the read command includes a start address and a data amount of the data to be read in the first virtual disk, and determines a first virtual file corresponding to the connection.
- the first virtual file is a virtual file corresponding to the first virtual disk in the server. And the first virtual file has a corresponding file identifier.
- the server receives the read command via a virtual core device associated with the connection, and the virtual kernel device then inputs the read command to the virtual user device. The server then obtains the read command from the virtual user device.
- the command sent by the terminal to the server is first received by the virtual kernel device of the kernel layer, and the server does not know whether the command is a read command or a storage command.
- the virtual core device enters the command into its corresponding virtual user device.
- the server can obtain the command from the virtual user device, and identify whether the command is a read command or a storage command, and obtain a virtual file corresponding to the virtual user device as the first virtual file.
- Step 507 The server determines, according to the start address and the first virtual file, an offset address of the first storage block unit and the data to be read in the first storage block unit.
- the server acquires, according to the file identifier of the first virtual file, the at least one unit identifier corresponding to the first virtual disk from the correspondence between the file identifier and the unit identifier stored by the cloud storage platform; according to the start address and the storage block unit
- the capacity determines an offset address of the first memory block unit and the data to be read in the first memory block unit from the corresponding memory block unit of each unit identifier.
- the capacity of each memory block unit in the cloud storage platform may be equal. It is assumed that the starting address of the data to be stored in the first virtual disk is at the position of 7G, and the capacity of each storage block unit is 5G. Thus, according to the start address and the capacity of the storage block unit, the determined first storage block unit is the second storage block unit corresponding to the first virtual disk and the offset address of the data to be read in the first storage block unit is 2G location.
- Step 508 The server reads the data to be read from the first storage block unit according to the offset address and the data amount of the data to be read, and sends the data to be read to the terminal.
- the server can read 2M of data to be read from the second storage block unit corresponding to the first virtual disk according to the location of the 2G, and send the to-be-readed to the terminal through the connection. data.
- the first virtual file corresponds to the connection of the terminal
- determining the cloud storage according to the first virtual file and the starting address in the read command And a offset address of the first memory block unit for storing data to be read and the data to be read in the first memory block unit in the platform, and reading data in the first memory block unit according to the offset address.
- This can support the storage of data in the cloud storage platform, and the storage reliability of the cloud storage platform is higher, thereby improving the reliability of the data storage.
- an embodiment of the present application provides an apparatus 600 for storing data, where the apparatus 600 includes:
- the receiving module 601 is configured to receive, by using a connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk, where the first The virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;
- a determining module 602 configured to determine, according to the starting address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, the first The virtual disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit;
- the storage module 603 is configured to store the to-be-stored data in the first storage block unit according to the offset address.
- the determining module 602 includes:
- An obtaining unit configured to acquire, according to the file identifier of the first virtual file, at least one unit identifier corresponding to the first virtual disk from a correspondence between a file identifier and a unit identifier stored in the cloud storage platform;
- a determining unit configured to determine, according to the starting address and a capacity of the storage block unit, a first storage block unit and the to-be-stored data in the first storage block unit from a corresponding storage block unit of each unit identifier Offset address.
- the device 600 further includes:
- a creating module configured to create a second virtual file corresponding to the second virtual disk in the server when the terminal creates the second virtual disk.
- the device 600 further includes:
- An application module configured to apply, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and identify a file identifier of the second virtual file and each storage block in the at least one storage unit
- the unit identifier of the unit corresponds to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- the first virtual file corresponds to the connection of the terminal
- determining the cloud storage platform according to the first virtual file and the starting address in the storage command And an offset address of the first storage block unit for storing data to be stored and the data to be stored in the first storage block unit, according to the offset address, storing the data to be stored in the first storage block unit.
- the data to be stored is stored in the cloud storage platform, and the reliability of the storage data of the cloud storage platform is high, thereby improving the reliability of the data storage.
- an embodiment of the present application provides an apparatus 700 for reading data, where the apparatus 700 includes:
- the receiving module 701 is configured to receive, by using a connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes an amount of data of the data to be read and the data to be read in the first virtual disk a first virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;
- a determining module 702 configured to determine, according to the starting address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit, where a virtual disk corresponding to at least one memory block unit in the cloud storage platform, the first memory block unit being one of the at least one memory block unit;
- the reading module 703 is configured to read the data to be read from the first storage block unit according to the offset address and the data amount;
- the sending module 704 is configured to send the to-be-read data to the terminal.
- the determining module 702 includes:
- An obtaining unit configured to acquire, according to the file identifier of the first virtual file, at least one unit identifier corresponding to the first virtual disk from a correspondence between a file identifier and a unit identifier stored in the cloud storage platform;
- a determining unit configured to determine, according to the starting address and a capacity of the storage block unit, a first storage block unit from the corresponding storage block unit and a data to be read in the first storage block unit The offset address in .
- the device 700 further includes:
- a creating module configured to create a second virtual file corresponding to the second virtual disk in the server when the terminal creates the second virtual disk.
- the device 700 further includes:
- An application module configured to apply, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and store the file identifier of the second virtual file and each of the at least one storage block unit
- the unit identifier of the block unit corresponds to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- the first virtual file corresponds to the connection of the terminal
- determining the cloud storage according to the first virtual file and the starting address in the read command And a offset address of the first memory block unit for storing data to be read and the data to be read in the first memory block unit in the platform, and reading data in the first memory block unit according to the offset address.
- This can support the storage of data in the cloud storage platform, and the storage reliability of the cloud storage platform is higher, thereby improving the reliability of the data storage.
- the foregoing apparatus 600 and the foregoing apparatus 700 may be located in the same device.
- the two may be located in the server in the embodiment shown in FIG. 1.
- an embodiment of the present application provides a system 800, where the system 800 includes:
- the server 803 is configured to receive, by using a connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk.
- the first virtual file is a virtual file in the server
- the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal
- the server 803 is further configured to Determining, by the start address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, where the first virtual disk is in the cloud storage platform Corresponding to at least one memory block unit, the first memory block unit being one of the at least one memory block unit; storing the to-be-stored data in the first memory block unit according to the offset address .
- the server 803 is configured to receive, by using a connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes an amount of data to be read data and the to-be-read data is in the first virtual disk.
- a starting address in the first virtual file is a virtual file in the server
- the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal; and the server 803.
- the method is further configured to determine, according to the start address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit, where the first a virtual disk corresponding to at least one memory block unit in the cloud storage platform, the first memory block unit being one of the at least one memory block unit; according to the offset address and the data amount, from the Reading the data to be read in the first storage block unit; and transmitting the data to be read to the terminal.
- FIG. 9 is a block diagram showing the structure of an apparatus 900 provided by an exemplary embodiment of the present invention.
- the device 900 includes a processor 901 and a memory 902.
- Processor 901 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like.
- the processor 901 can be implemented by at least one of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). achieve.
- the processor 901 may also include a main processor and a coprocessor.
- the main processor is a processor for processing data in an awake state, which is also called a CPU (Central Processing Unit); the coprocessor is A low-power processor for processing data in standby.
- the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and rendering of content that needs to be displayed on the display screen.
- the processor 901 may further include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
- AI Artificial Intelligence
- Memory 902 can include one or more computer readable storage media, which can be non-transitory. Memory 902 can also include high speed random access memory, as well as non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer readable storage medium in the memory 902 is configured to store at least one instruction for execution by the processor 901 to implement one of the methods provided by the method embodiments of the present application. A method of storing data or a method of reading data.
- apparatus 900 can also optionally include: a peripheral device interface 903 and at least one peripheral device.
- the processor 901, the memory 902, and the peripheral device interface 903 can be connected by a bus or a signal line.
- Each peripheral device can be connected to the peripheral device interface 903 via a bus, signal line or circuit board.
- the peripheral device includes at least one of a radio frequency circuit 904, a touch display screen 905, a camera 906, an audio circuit 907, a positioning component 908, and a power source 909.
- the peripheral device interface 903 can be used to connect at least one peripheral device associated with an I/O (Input/Output) to the processor 901 and the memory 902.
- processor 901, memory 902, and peripheral interface 903 are integrated on the same chip or circuit board; in some other embodiments, any of processor 901, memory 902, and peripheral interface 903 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
- the radio frequency circuit 904 is configured to receive and transmit an RF (Radio Frequency) signal, also called an electromagnetic signal. Radio frequency circuit 904 communicates with the communication network and other communication devices via electromagnetic signals. The radio frequency circuit 904 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. Radio frequency circuit 904 can communicate with other devices via at least one wireless communication protocol.
- RF Radio Frequency
- the wireless communication protocols include, but are not limited to, the World Wide Web, a metropolitan area network, an intranet, generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks.
- the radio frequency circuit 904 may also include NFC (Near Field Communication) related circuits, which is not limited in this application.
- the display screen 905 is used to display a UI (User Interface).
- the UI can include graphics, text, icons, video, and any combination thereof.
- display 905 is a touch display
- display 905 also has the ability to acquire touch signals over the surface or surface of display 905.
- the touch signal can be input to the processor 901 as a control signal for processing.
- the display screen 905 can also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards.
- the display screen 905 can be one, setting the front panel of the device 900; in other embodiments, the display screen 905 can be at least two, respectively disposed on different surfaces of the device 900 or in a folded design; In still other embodiments, display screen 905 can be a flexible display screen disposed on a curved surface or folded surface of device 900. Even the display screen 905 can be set to a non-rectangular irregular pattern, that is, a profiled screen.
- the display screen 905 can be prepared by using an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
- Camera component 906 is used to capture images or video.
- camera assembly 906 includes a front camera and a rear camera.
- the front camera is placed on the front panel of the unit and the rear camera is placed on the back of the unit.
- the rear camera is at least two, which are respectively a main camera, a depth camera, a wide-angle camera, and a telephoto camera, so as to realize the background blur function of the main camera and the depth camera, and the main camera Combine with a wide-angle camera for panoramic shooting and VR (Virtual Reality) shooting or other integrated shooting functions.
- camera assembly 906 can also include a flash.
- the flash can be a monochrome temperature flash or a two-color temperature flash.
- the two-color temperature flash is a combination of a warm flash and a cool flash that can be used for light compensation at different color temperatures.
- the audio circuit 907 can include a microphone and a speaker.
- the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 901 for processing, or to the radio frequency circuit 904 for voice communication.
- the microphones may be plural, and are respectively disposed at different parts of the device 900.
- the microphone can also be an array microphone or an omnidirectional acquisition microphone.
- the speaker is then used to convert electrical signals from processor 901 or radio frequency circuit 904 into sound waves.
- the speaker can be a conventional film speaker or a piezoelectric ceramic speaker.
- audio circuit 907 can also include a headphone jack.
- the location component 908 is used to locate the current geographic location of the device 900 to implement navigation or LBS (Location Based Service).
- the positioning component 908 can be a positioning component based on a GPS (Global Positioning System) of the United States, a Beidou system of China, or a Galileo system of Russia.
- Power source 909 is used to power various components in device 900.
- the power source 909 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery.
- the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery.
- a wired rechargeable battery is a battery that is charged by a wired line
- a wireless rechargeable battery is a battery that is charged by a wireless coil.
- the rechargeable battery can also be used to support fast charging technology.
- device 900 also includes one or more sensors 910.
- the one or more sensors 910 include, but are not limited to, an acceleration sensor 911, a gyro sensor 912, a pressure sensor 913, a fingerprint sensor 914, an optical sensor 915, and a proximity sensor 916.
- the acceleration sensor 911 can detect the magnitude of the acceleration on the three coordinate axes of the coordinate system established by the device 900.
- the acceleration sensor 911 can be used to detect components of gravity acceleration on three coordinate axes.
- the processor 901 can control the touch display screen 905 to display the user interface in a landscape view or a portrait view according to the gravity acceleration signal collected by the acceleration sensor 911.
- the acceleration sensor 911 can also be used for the acquisition of game or user motion data.
- the gyro sensor 912 can detect the body direction and the rotation angle of the device 900, and the gyro sensor 912 can cooperate with the acceleration sensor 911 to collect the user's 3D motion on the device 900.
- the processor 901 can implement functions such as motion sensing (such as changing the UI according to the user's tilting operation), image stabilization at the time of shooting, game control, and inertial navigation, based on the data collected by the gyro sensor 912.
- the pressure sensor 913 can be disposed on a side border of the device 900 and/or a lower layer of the touch display screen 905.
- the pressure sensor 913 When the pressure sensor 913 is disposed on the side frame of the device 900, the user's holding signal to the device 900 can be detected, and the processor 901 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913.
- the operability control on the UI interface is controlled by the processor 901 according to the user's pressure on the touch display screen 905.
- the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
- the fingerprint sensor 914 is configured to collect the fingerprint of the user, and the processor 901 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the identity of the user according to the collected fingerprint. Upon identifying that the identity of the user is a trusted identity, the processor 901 authorizes the user to perform related sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying and changing settings, and the like.
- Fingerprint sensor 914 can be provided with the front, back or side of device 900. When the device 900 is provided with a physical button or vendor logo, the fingerprint sensor 914 can be integrated with a physical button or vendor logo.
- Optical sensor 915 is used to collect ambient light intensity.
- the processor 901 can control the display brightness of the touch display screen 905 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is raised; when the ambient light intensity is low, the display brightness of the touch display screen 905 is lowered.
- the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 915.
- Proximity sensor 916 also referred to as a distance sensor, is typically disposed on the front panel of device 900. Proximity sensor 916 is used to capture the distance between the user and the front of device 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front side of the device 900 is gradually decreasing, the touch screen 905 is controlled by the processor 901 to switch from the bright screen state to the screen state; when the proximity sensor 916 detects When the distance between the user and the front side of the device 900 gradually becomes larger, the processor 901 controls the touch display screen 905 to switch from the state of the screen to the bright state.
- FIG. 9 does not constitute a limitation to device 900, and may include more or fewer components than those illustrated, or some components may be combined, or different component arrangements may be employed.
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
Description
Claims (19)
- 一种存储数据的方法,其特征在于,所述方法包括:A method of storing data, the method comprising:通过第一虚拟文件对应的连接接收终端发送的存储命令,所述存储命令包括待存储数据和所述待存储数据在第一虚拟磁盘中的起始地址,所述第一虚拟文件是服务器中的一个虚拟文件,所述第一虚拟磁盘是所述第一虚拟文件在所述终端中对应的虚拟磁盘;Receiving, by the connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk, where the first virtual file is in the server a virtual file, the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待存储数据在所述第一存储块单元中的偏移地址,所述第一虚拟磁盘在云存储平台中对应至少一个存储块单元,所述第一存储块单元是所述至少一个存储块单元中的一个;Determining, by the start address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, where the first virtual disk is in a cloud storage platform Corresponding to at least one memory block unit, the first memory block unit being one of the at least one memory block unit;根据所述偏移地址,将所述待存储数据存储在所述第一存储块单元中。And storing the to-be-stored data in the first storage block unit according to the offset address.
- 如权利要求1所述的方法,其特征在于,所述根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待存储数据在所述第一存储块单元中的偏移地址,包括:The method according to claim 1, wherein said determining, according to said start address and said first virtual file, said first memory block unit and said data to be stored are in said first memory block unit Offset address, including:根据所述第一虚拟文件的文件标识,从云存储平台存储的文件标识与单元标识的对应关系中获取所述第一虚拟磁盘对应的至少一个单元标识;Obtaining, according to the file identifier of the first virtual file, the at least one unit identifier corresponding to the first virtual disk from the correspondence between the file identifier and the unit identifier stored in the cloud storage platform;根据所述起始地址和存储块单元的容量,从每个单元标识对应的存储块单元中确定第一存储块单元和所述待存储数据在所述第一存储块单元中的偏移地址。And determining, according to the starting address and the capacity of the storage block unit, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit from the corresponding storage block unit.
- 如权利要求1或2所述的方法,其特征在于,所述方法还包括:The method of claim 1 or 2, wherein the method further comprises:当所述终端创建第二虚拟磁盘时,在所述服务器中创建所述第二虚拟磁盘对应的第二虚拟文件。When the terminal creates the second virtual disk, the second virtual file corresponding to the second virtual disk is created in the server.
- 如权利要求3所述的方法,其特征在于,所述在所述服务器中创建所述第二虚拟磁盘对应的第二虚拟文件之后,还包括:The method of claim 3, after the creating the second virtual file corresponding to the second virtual disk in the server, further comprising:在所述云存储平台中申请所述第二虚拟磁盘对应的至少一个存储块单元,将所述第二虚拟文件的文件标识和所述至少一个存储单元中的每个存储块单元的单元标识对应保存在所述云存储平台中的文件标识与单元标识的对应关系 中。Applying, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and correspondingly, a file identifier of the second virtual file and a unit identifier of each storage block unit in the at least one storage unit The correspondence between the file identifier and the unit identifier in the cloud storage platform is saved.
- 一种读取数据的方法,其特征在于,所述方法包括:A method of reading data, the method comprising:通过第一虚拟文件对应的连接接收终端发送的读取命令,所述读取命令包括待读取数据的数据量和所述待读取数据在第一虚拟磁盘中的起始地址,所述第一虚拟文件是服务器中的一个虚拟文件,所述第一虚拟磁盘是所述第一虚拟文件在所述终端中对应的虚拟磁盘;Receiving, by the connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes a data amount of data to be read and a start address of the data to be read in the first virtual disk, where A virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待读取数据在所述第一存储块单元中的偏移地址,所述第一虚拟磁盘在云存储平台中对应至少一个存储块单元,所述第一存储块单元是所述至少一个存储块单元中的一个;Determining, according to the start address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit, the first virtual disk being in a cloud storage Corresponding to at least one memory block unit in the platform, the first memory block unit being one of the at least one memory block unit;根据所述偏移地址和所述数据量,从所述第一存储块单元中读取所述待读取数据;Reading the data to be read from the first storage block unit according to the offset address and the data amount;向所述终端发送所述待读取数据。Sending the data to be read to the terminal.
- 如权利要求5所述的方法,其特征在于,所述根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待读取数据在所述第一存储块单元中的偏移地址,包括:The method according to claim 5, wherein said determining, according to said start address and said first virtual file, said first memory block unit and said data to be read are in said first memory block unit The offset address in, including:根据所述第一虚拟文件的文件标识,从云存储平台存储的文件标识与单元标识的对应关系中获取所述第一虚拟磁盘对应的至少一个单元标识;Obtaining, according to the file identifier of the first virtual file, the at least one unit identifier corresponding to the first virtual disk from the correspondence between the file identifier and the unit identifier stored in the cloud storage platform;根据所述起始地址和存储块单元的容量,从每个单元标识对应的存储块单元中确定第一存储块单元和所述待读取数据在所述第一存储块单元中的偏移地址。Determining, according to the starting address and a capacity of the storage block unit, a first memory block unit and an offset address of the data to be read in the first memory block unit from a corresponding memory block unit .
- 如权利要求5或6所述的方法,其特征在于,所述方法还包括:The method of claim 5 or claim 6, wherein the method further comprises:当所述终端创建第二虚拟磁盘时,在所述服务器中创建所述第二虚拟磁盘对应的第二虚拟文件。When the terminal creates the second virtual disk, the second virtual file corresponding to the second virtual disk is created in the server.
- 如权利要求7所述的方法,其特征在于,所述在所述服务器中创建所述第二虚拟磁盘对应的第二虚拟文件之后,还包括:The method of claim 7, wherein after the creating the second virtual file corresponding to the second virtual disk in the server, the method further comprises:在所述云存储平台中申请所述第二虚拟磁盘对应的至少一个存储块单元, 将所述第二虚拟文件的文件标识和所述至少一个存储块单元中的每个存储块单元的单元标识对应保存在所述云存储平台中的文件标识与单元标识的对应关系中。Applying, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and identifying a file identifier of the second virtual file and a unit identifier of each storage block unit in the at least one storage block unit Corresponding to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- 一种存储数据的装置,其特征在于,所述装置包括:An apparatus for storing data, the apparatus comprising:接收模块,用于通过第一虚拟文件对应的连接接收终端发送的存储命令,所述存储命令包括待存储数据和所述待存储数据在第一虚拟磁盘中的起始地址,所述第一虚拟文件是服务器中的一个虚拟文件,所述第一虚拟磁盘是所述第一虚拟文件在所述终端中对应的虚拟磁盘;a receiving module, configured to receive, by using a connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk, the first virtual The file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;确定模块,用于根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待存储数据在所述第一存储块单元中的偏移地址,所述第一虚拟磁盘在云存储平台中对应至少一个存储块单元,所述第一存储块单元是所述至少一个存储块单元中的一个;a determining module, configured to determine, according to the starting address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, the first virtual The disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit;存储模块,用于根据所述偏移地址,将所述待存储数据存储在所述第一存储块单元中。And a storage module, configured to store the to-be-stored data in the first storage block unit according to the offset address.
- 如权利要求9所述的装置,其特征在于,所述确定模块包括:The apparatus of claim 9, wherein the determining module comprises:获取单元,用于根据所述第一虚拟文件的文件标识,从云存储平台存储的文件标识与单元标识的对应关系中获取所述第一虚拟磁盘对应的至少一个单元标识;An obtaining unit, configured to acquire, according to the file identifier of the first virtual file, at least one unit identifier corresponding to the first virtual disk from a correspondence between a file identifier and a unit identifier stored in the cloud storage platform;确定单元,用于根据所述起始地址和存储块单元的容量,从每个单元标识对应的存储块单元中确定第一存储块单元和所述待存储数据在所述第一存储块单元中的偏移地址。a determining unit, configured to determine, according to the starting address and a capacity of the storage block unit, a first storage block unit and the to-be-stored data in the first storage block unit from a corresponding storage block unit of each unit identifier Offset address.
- 如权利要求9或10所述的装置,其特征在于,所述装置还包括:The device of claim 9 or 10, wherein the device further comprises:创建模块,用于当所述终端创建第二虚拟磁盘时,在所述服务器中创建所述第二虚拟磁盘对应的第二虚拟文件。And a creating module, configured to create a second virtual file corresponding to the second virtual disk in the server when the terminal creates the second virtual disk.
- 如权利要求11所述的装置,其特征在于,所述装置还包括:The device of claim 11 wherein said device further comprises:申请模块,用于在所述云存储平台中申请所述第二虚拟磁盘对应的至少一个存储块单元,将所述第二虚拟文件的文件标识和所述至少一个存储单元中的 每个存储块单元的单元标识对应保存在所述云存储平台中的文件标识与单元标识的对应关系中。An application module, configured to apply, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and identify a file identifier of the second virtual file and each storage block in the at least one storage unit The unit identifier of the unit corresponds to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- 一种读取数据的装置,其特征在于,所述装置包括:A device for reading data, characterized in that the device comprises:接收模块,用于通过第一虚拟文件对应的连接接收终端发送的读取命令,所述读取命令包括待读取数据的数据量和所述待读取数据在第一虚拟磁盘中的起始地址,所述第一虚拟文件是服务器中的一个虚拟文件,所述第一虚拟磁盘是所述第一虚拟文件在所述终端中对应的虚拟磁盘;a receiving module, configured to receive, by using a connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes an amount of data of the data to be read and a start of the data to be read in the first virtual disk An address, the first virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;确定模块,用于根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待读取数据在所述第一存储块单元中的偏移地址,所述第一虚拟磁盘在云存储平台中对应至少一个存储块单元,所述第一存储块单元是所述至少一个存储块单元中的一个;a determining module, configured to determine, according to the starting address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit, the first The virtual disk corresponds to at least one storage block unit in the cloud storage platform, and the first storage block unit is one of the at least one storage block unit;读取模块,用于根据所述偏移地址和所述数据量,从所述第一存储块单元中读取所述待读取数据;a reading module, configured to read the data to be read from the first storage block unit according to the offset address and the data amount;发送模块,用于向所述终端发送所述待读取数据。And a sending module, configured to send the to-be-read data to the terminal.
- 如权利要求13所述的装置,其特征在于,所述确定模块包括:The apparatus of claim 13 wherein said determining module comprises:获取单元,用于根据所述第一虚拟文件的文件标识,从云存储平台存储的文件标识与单元标识的对应关系中获取所述第一虚拟磁盘对应的至少一个单元标识;An obtaining unit, configured to acquire, according to the file identifier of the first virtual file, at least one unit identifier corresponding to the first virtual disk from a correspondence between a file identifier and a unit identifier stored in the cloud storage platform;确定单元,用于根据所述起始地址和存储块单元的容量,从每个单元标识对应的存储块单元中确定第一存储块单元和所述待读取数据在所述第一存储块单元中的偏移地址。a determining unit, configured to determine, according to the starting address and a capacity of the storage block unit, a first storage block unit from the corresponding storage block unit and a data to be read in the first storage block unit The offset address in .
- 如权利要求13或14所述的装置,其特征在于,所述装置还包括:The device according to claim 13 or 14, wherein the device further comprises:创建模块,用于当所述终端创建第二虚拟磁盘时,在所述服务器中创建所述第二虚拟磁盘对应的第二虚拟文件。And a creating module, configured to create a second virtual file corresponding to the second virtual disk in the server when the terminal creates the second virtual disk.
- 如权利要求15所述的装置,其特征在于,所述装置还包括:The device of claim 15 wherein said device further comprises:申请模块,用于在所述云存储平台中申请所述第二虚拟磁盘对应的至少一个存储块单元,将所述第二虚拟文件的文件标识和所述至少一个存储块单元中 的每个存储块单元的单元标识对应保存在所述云存储平台中的文件标识与单元标识的对应关系中。An application module, configured to apply, in the cloud storage platform, at least one storage block unit corresponding to the second virtual disk, and store the file identifier of the second virtual file and each of the at least one storage block unit The unit identifier of the block unit corresponds to the correspondence between the file identifier and the unit identifier stored in the cloud storage platform.
- 一种存储数据的系统,其特征在于,所述系统包括:A system for storing data, characterized in that the system comprises:终端、服务器和云存储平台;Terminal, server and cloud storage platforms;所述服务器,用于通过第一虚拟文件对应的连接接收所述终端发送的存储命令,所述存储命令包括待存储数据和所述待存储数据在第一虚拟磁盘中的起始地址,所述第一虚拟文件是所述服务器中的一个虚拟文件,所述第一虚拟磁盘是所述第一虚拟文件在所述终端中对应的虚拟磁盘;The server is configured to receive, by using a connection corresponding to the first virtual file, a storage command sent by the terminal, where the storage command includes data to be stored and a starting address of the to-be-stored data in the first virtual disk, The first virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;所述服务器,还用于根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待存储数据在所述第一存储块单元中的偏移地址,所述第一虚拟磁盘在所述云存储平台中对应至少一个存储块单元,所述第一存储块单元是所述至少一个存储块单元中的一个;根据所述偏移地址,将所述待存储数据存储在所述第一存储块单元中。The server is further configured to determine, according to the start address and the first virtual file, an offset address of the first storage block unit and the to-be-stored data in the first storage block unit, where a virtual disk corresponding to at least one memory block unit in the cloud storage platform, the first memory block unit being one of the at least one memory block unit; storing the data to be stored according to the offset address In the first memory block unit.
- 一种读取数据的系统,其特征在于,所述系统包括:A system for reading data, characterized in that the system comprises:终端、服务器和云存储平台;Terminal, server and cloud storage platforms;所述服务器,用于通过第一虚拟文件对应的连接接收所述终端发送的读取命令,所述读取命令包括待读取数据的数据量和所述待读取数据在第一虚拟磁盘中的起始地址,所述第一虚拟文件是所述服务器中的一个虚拟文件,所述第一虚拟磁盘是所述第一虚拟文件在所述终端中对应的虚拟磁盘;The server is configured to receive, by using a connection corresponding to the first virtual file, a read command sent by the terminal, where the read command includes an amount of data to be read data and the to-be-read data is in the first virtual disk a starting address, the first virtual file is a virtual file in the server, and the first virtual disk is a virtual disk corresponding to the first virtual file in the terminal;所述服务器,还用于根据所述起始地址和所述第一虚拟文件,确定第一存储块单元和所述待读取数据在所述第一存储块单元中的偏移地址,所述第一虚拟磁盘在所述云存储平台中对应至少一个存储块单元,所述第一存储块单元是所述至少一个存储块单元中的一个;根据所述偏移地址和所述数据量,从所述第一存储块单元中读取所述待读取数据;向所述终端发送所述待读取数据。The server is further configured to determine, according to the start address and the first virtual file, an offset address of the first storage block unit and the to-be-read data in the first storage block unit, The first virtual disk corresponds to at least one storage block unit in the cloud storage platform, the first storage block unit is one of the at least one storage block unit; according to the offset address and the data amount, Reading the data to be read in the first storage block unit; and sending the data to be read to the terminal.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至4任一所述的方法步骤或所述计算机程序被处理器执行时实现如权利要求5至8任一所述的方法步骤。A computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program being executed by a processor to implement the method steps or the method of any one of claims 1 to 4. The method steps of any one of claims 5 to 8 are implemented when the computer program is executed by a processor.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810437833.2A CN110471613B (en) | 2018-05-09 | 2018-05-09 | Data storage method, data reading method, device and system |
CN201810437833.2 | 2018-05-09 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019214694A1 true WO2019214694A1 (en) | 2019-11-14 |
Family
ID=68468478
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/086285 WO2019214694A1 (en) | 2018-05-09 | 2019-05-09 | Method for storing data, and method, device, and system for reading data |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110471613B (en) |
WO (1) | WO2019214694A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112199427A (en) * | 2020-09-24 | 2021-01-08 | 中国建设银行股份有限公司 | Data processing method and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060155667A1 (en) * | 2004-12-10 | 2006-07-13 | Microsoft Corporation | Systems and methods for attaching a virtual machine virtual hard disk to a host machine |
CN103795806A (en) * | 2013-12-25 | 2014-05-14 | 天津火星科技有限公司 | Method for achieving cloud storage for mobile terminal |
CN105338027A (en) * | 2014-07-30 | 2016-02-17 | 杭州海康威视系统技术有限公司 | Method, system and device for cloud storage of video data |
CN105827669A (en) * | 2015-01-04 | 2016-08-03 | 中国移动通信集团江苏有限公司 | Virtual storage method, virtual storage equipment and virtual storage system for terminals |
CN107092437A (en) * | 2016-02-17 | 2017-08-25 | 杭州海康威视数字技术股份有限公司 | Data write-in, read method and device, cloud storage system |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4349871B2 (en) * | 2003-09-09 | 2009-10-21 | 株式会社日立製作所 | File sharing apparatus and data migration method between file sharing apparatuses |
US8725782B2 (en) * | 2011-04-25 | 2014-05-13 | Microsoft Corporation | Virtual disk storage techniques |
CN103593147B (en) * | 2013-11-07 | 2016-08-17 | 华为技术有限公司 | A kind of method and device of digital independent |
CN104778129B (en) * | 2014-01-14 | 2021-08-27 | 中兴通讯股份有限公司 | Method and device for realizing virtual storage of mobile terminal |
CN105260142B (en) * | 2015-11-03 | 2018-09-18 | 宁波市科技园区明天医网科技有限公司 | A kind of cloud storage area medical device for image and operation method |
US10540165B2 (en) * | 2016-02-12 | 2020-01-21 | Nutanix, Inc. | Virtualized file server rolling upgrade |
CN106648464B (en) * | 2016-12-22 | 2020-01-21 | 柏域信息科技(上海)有限公司 | Multi-node mixed block cache data reading and writing method and system based on cloud storage |
-
2018
- 2018-05-09 CN CN201810437833.2A patent/CN110471613B/en active Active
-
2019
- 2019-05-09 WO PCT/CN2019/086285 patent/WO2019214694A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060155667A1 (en) * | 2004-12-10 | 2006-07-13 | Microsoft Corporation | Systems and methods for attaching a virtual machine virtual hard disk to a host machine |
CN103795806A (en) * | 2013-12-25 | 2014-05-14 | 天津火星科技有限公司 | Method for achieving cloud storage for mobile terminal |
CN105338027A (en) * | 2014-07-30 | 2016-02-17 | 杭州海康威视系统技术有限公司 | Method, system and device for cloud storage of video data |
CN105827669A (en) * | 2015-01-04 | 2016-08-03 | 中国移动通信集团江苏有限公司 | Virtual storage method, virtual storage equipment and virtual storage system for terminals |
CN107092437A (en) * | 2016-02-17 | 2017-08-25 | 杭州海康威视数字技术股份有限公司 | Data write-in, read method and device, cloud storage system |
Also Published As
Publication number | Publication date |
---|---|
CN110471613B (en) | 2021-01-12 |
CN110471613A (en) | 2019-11-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110308956B (en) | Application interface display method and device and mobile terminal | |
CN110971930A (en) | Live virtual image broadcasting method, device, terminal and storage medium | |
CN110333834B (en) | Frame frequency adjusting method and device, display device and computer readable storage medium | |
US20220164159A1 (en) | Method for playing audio, terminal and computer-readable storage medium | |
WO2020001564A1 (en) | Method, apparatus, and system for processing tasks | |
CN110740340B (en) | Video live broadcast method and device and storage medium | |
WO2022134632A1 (en) | Work processing method and apparatus | |
WO2019205735A1 (en) | Data transmission method and apparatus, and display screen and display apparatus | |
CN111897465B (en) | Popup display method, device, equipment and storage medium | |
CN112256320A (en) | Version number generation method, device, terminal and storage medium | |
CN111265885B (en) | Resource display method, resource sending method, device, equipment and storage medium | |
CN110797042A (en) | Audio processing method, device and storage medium | |
CN109783176B (en) | Page switching method and device | |
CN111385525B (en) | Video monitoring method, device, terminal and system | |
CN113269877B (en) | Method and electronic equipment for acquiring room layout plan | |
CN111324293B (en) | Storage system, data storage method, data reading method and device | |
CN112181915B (en) | Method, device, terminal and storage medium for executing service | |
WO2019214694A1 (en) | Method for storing data, and method, device, and system for reading data | |
CN111008083A (en) | Page communication method and device, electronic equipment and storage medium | |
CN112669884B (en) | Audio data processing method, device, equipment and storage medium | |
CN114594885A (en) | Application icon management method, device and equipment and computer readable storage medium | |
CN110708582B (en) | Synchronous playing method, device, electronic equipment and medium | |
CN113843814A (en) | Control system, method, device and storage medium for mechanical arm equipment | |
CN108881715B (en) | Starting method and device of shooting mode, terminal and storage medium | |
CN111158791A (en) | Configuration file updating method, device and system and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19799976 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19799976 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19799976 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 17/05/2021) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19799976 Country of ref document: EP Kind code of ref document: A1 |