CN109460182B - Data storage and reading method and device - Google Patents

Data storage and reading method and device Download PDF

Info

Publication number
CN109460182B
CN109460182B CN201710795265.9A CN201710795265A CN109460182B CN 109460182 B CN109460182 B CN 109460182B CN 201710795265 A CN201710795265 A CN 201710795265A CN 109460182 B CN109460182 B CN 109460182B
Authority
CN
China
Prior art keywords
data
stored
local access
access server
information
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
CN201710795265.9A
Other languages
Chinese (zh)
Other versions
CN109460182A (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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN201710795265.9A priority Critical patent/CN109460182B/en
Priority to PCT/CN2018/104255 priority patent/WO2019047875A1/en
Publication of CN109460182A publication Critical patent/CN109460182A/en
Application granted granted Critical
Publication of CN109460182B publication Critical patent/CN109460182B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

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

Abstract

The embodiment of the invention provides a data storage and reading method and device. In the invention, after the data to be stored is successfully stored locally, the information of successful storage is sent to the first client, then the data to be stored which is successfully stored is transferred to the cloud storage system, and the cloud storage system stores the data to be stored again. Because the time for directly storing the data to be stored in the local is far shorter than the time for storing the data in the cloud storage system, the waiting time for the user to see the successfully stored information through the client is reduced, and the user experience is improved.

Description

Data storage and reading method and device
Technical Field
The invention relates to the technical field of cloud storage, in particular to a data storage and reading method and device.
Background
At present, the process of storing data to a cloud storage system by a client is generally as follows: the client sends the data to be stored to the cloud storage system, the cloud storage system receives the data to be stored, the data to be stored is stored in an erasure code coding mode, after the data to be stored is successfully stored, information of successful storage is sent to the client, and the client displays the information of successful storage so that a user can know that the data to be stored is successfully stored.
The process of storing the data to be stored by adopting an erasure code coding mode comprises the following steps: dividing data to be stored into data fragments, encoding each data fragment, and storing the encoded data fragments at different positions of a cloud storage system, for example: the data are stored in different storage nodes of the cloud storage system.
Since the data is required to be sliced when being stored in the erasure code coding mode, and then the sliced data segments are respectively stored, a long time is required to be consumed for storing the data, so that the waiting time for the user to check the successfully stored information through the client is long, and the user experience is poor.
Disclosure of Invention
The embodiment of the invention aims to provide a data storage method and a data reading method and device so as to improve user experience. The specific technical scheme is as follows:
a data storage method is applied to a local access server, and comprises the following steps:
receiving target information sent by a first client, wherein the target information comprises data to be stored;
locally storing the data to be stored;
after the data to be stored is stored locally successfully, sending information of successful storage to the first client so that the first client can display the information of successful storage;
and sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
Optionally, the step of locally storing the data to be stored includes:
determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored;
judging whether the first destination address is the address of the local access server;
if yes, storing the data to be stored in the local access server;
if not, the data to be stored is sent to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
Optionally, the step of storing the data to be stored in the local access server includes:
and storing the data to be stored into a solid state disk of the local access server.
Optionally, after the step of storing the data to be stored in the local access server, the method further includes:
determining other local access servers in the same group with the local access server according to the identification information of the local access server and pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
Optionally, after the step of sending the successfully stored data to be stored to the cloud storage system to enable the cloud storage system to store the data to be stored, the method further includes:
deleting the data to be stored in the local access server and the other local access servers.
Optionally, the target information further includes request information, and after the step of sending the successfully stored data to be stored to the cloud storage system so that the cloud storage system stores the data to be stored, the method further includes:
judging whether the request information is feedback request information or not;
if yes, determining a second destination address contained in the feedback request information;
and encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
A data storage apparatus for use with a local access server, the apparatus comprising:
the first receiving module is used for receiving target information sent by a first client, wherein the target information comprises data to be stored;
the storage module is used for locally storing the data to be stored;
the sending module is used for sending information of successful storage to the first client after the data to be stored is stored locally successfully so that the first client can display the information of successful storage;
and the transfer module is used for sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
Optionally, the storage module includes:
a first destination address determining unit, configured to determine, according to the identification information of the data to be stored, a first destination address corresponding to the data to be stored;
the judging unit is used for judging whether the first destination address is the address of the local access server or not, if so, triggering the first storage unit, and if not, triggering the second storage unit;
the first storage unit is used for storing the data to be stored to the local access server;
the second storage unit is configured to send the data to be stored to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
Optionally, the first storage unit is specifically configured to:
and storing the data to be stored into a solid state disk of the local access server.
Optionally, the apparatus further comprises:
the other local access server determining module is used for determining other local access servers in the same group as the local access server according to the identification information of the local access server and pre-stored grouping information after the data to be stored is stored in the local access server, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and the copying module is used for copying the data to be stored to the determined other local access servers so as to enable the other local access servers to store the copied data to be stored respectively.
Optionally, the apparatus further comprises:
and the deleting module is used for deleting the data to be stored in the local access server and the other local access servers after the successfully stored data to be stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored.
Optionally, the target information further includes request information, and the apparatus further includes:
the feedback request information judging module is used for judging whether the request information is feedback request information or not after the successfully stored data to be stored is sent to the cloud storage system so that the cloud storage system stores the data to be stored, and if so, triggering the second destination address determining module;
the second destination address determining module is configured to determine a second destination address included in the feedback request information;
and the encryption module is used for encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
A data reading method is applied to a local access server, and comprises the following steps:
receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read;
determining whether the data to be read is transferred to a cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information;
and if the data to be read is transferred to a cloud storage system, sending the identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system, and sending the received data to be read to the client.
Optionally, before the step of determining whether the data to be read has been transferred to the cloud storage system according to the identification information and the pre-stored index information table, the method further includes:
determining a destination address corresponding to the data to be read according to the identification information;
judging whether the destination address is the address of the local access server or not;
and if so, determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table.
Optionally, after the step of determining whether the destination address is an address of the local access server, the method further includes:
and if the address of the local access server is not the address of the local access server, sending the identification information to the local access server corresponding to the destination address, so that the local access server corresponding to the destination address finds the data to be read according to the identification information, and sends the found data to be read to the client.
A data reading apparatus applied to a local access server, the apparatus comprising:
the second receiving module is used for receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read;
the determining module is used for determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information;
the reading module is used for sending the identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system and sending the received data to be read to the client if the data is transferred to the cloud storage system.
Optionally, the apparatus further comprises:
a destination address determining module, configured to determine, according to the identification information, a destination address corresponding to the data to be read before determining whether the data to be read has been transferred to the cloud storage system according to the identification information and a pre-stored index information table;
and the self address judging module is used for judging whether the destination address is the address of the local access server or not, and if so, triggering the determining module.
Optionally, the apparatus further comprises:
and the searching module is used for sending the identification information to the local access server corresponding to the destination address after judging whether the destination address is the address of the local access server or not, so that the local access server corresponding to the destination address searches the data to be read according to the identification information, and sends the searched data to be read to the client.
An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing any of the above-described data storage method steps and/or any of the above-described data reading method steps when executing the computer program stored in the memory.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out any of the above-mentioned data storage method steps and/or carries out any of the above-mentioned data reading method steps.
In the embodiment of the invention, target information sent by a first client is received, the target information comprises data to be stored, the data to be stored is stored locally, after the data to be stored is stored locally successfully, information of successful storage is sent to the first client so that the first client displays the information of successful storage, and the data to be stored which is successfully stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored. In the invention, after the data to be stored is successfully stored locally, the information of successful storage is sent to the first client, then the data to be stored which is successfully stored is transferred to the cloud storage system, and the cloud storage system stores the data to be stored again. Because the time for directly storing the data to be stored in the local is far shorter than the time for storing the data in the cloud storage system, the waiting time for the user to see the successfully stored information through the client is reduced, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a load access cluster according to an embodiment of the present invention;
FIG. 2 is a first flowchart illustrating a data storage method according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a data storage method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a third flowchart of a data storage method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a local access server provided in the implementation of the present invention;
FIG. 6 is a schematic diagram illustrating a fourth flowchart of a data storage method according to an embodiment of the present invention;
FIG. 7 is a schematic flow chart of a data storage method according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a data storage device provided in the present invention;
FIG. 9 is a schematic diagram of a first structure of an electronic device provided in the present invention;
FIG. 10 is a first flowchart illustrating a data reading method according to an embodiment of the present invention;
FIG. 11 is a second flowchart illustrating a data reading method according to an embodiment of the present invention;
FIG. 12 is a third flowchart illustrating a data reading method according to an embodiment of the present invention;
FIG. 13 is a schematic structural diagram of a data reading apparatus according to an embodiment of the present invention;
fig. 14 is a schematic diagram of a second structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems of the prior art, embodiments of the present invention provide a data storage method and apparatus and a data reading method and apparatus.
It should be noted that, in order to solve the problem in the related art, as shown in fig. 1, in the embodiment of the present invention, a plurality of load access clusters are locally provided in advance, each local load access cluster is provided with a plurality of groups of local access servers, the number of local access servers in each group is the same, and data synchronization operation is performed between the groups.
First, a data storage method provided by an embodiment of the present invention is described below.
As shown in fig. 2, a data storage method provided in an embodiment of the present invention is applied to a local access server, and may include:
s101: and receiving target information sent by the first client, wherein the target information comprises data to be stored.
When a first client needs to access a cluster to store data to a cloud storage system through a certain target load, target information including the data to be stored is sent to a certain local access server in the target load access cluster, and the local access server receives the target information.
The process of sending the target information to the local access server by the first client is as follows:
the first client determines the address of the local access server corresponding to the target load access cluster according to the domain name of the target load access cluster and the corresponding relation between the domain name of the load access cluster and the address of the local access server stored in advance, and sends target information to the local access server corresponding to the determined address.
Because the domain name of the pre-stored load access cluster and the address of the local access server are in a one-to-one correspondence relationship, only the address of the uniquely corresponding local access server can be obtained under the condition that the domain name of the target load access cluster is obtained, namely, each load access cluster only provides a unique access entrance.
In addition, when the pre-stored correspondence between the domain name of the load access cluster and the address of the local access server is stored in the first client, the first client may directly determine the address of the local access server corresponding to the target load access cluster.
When a pre-stored correspondence between a domain name of a load access cluster and an address of a local access server is stored in a certain load access cluster, a first client needs to send request information including the domain name of a target load access cluster to the load access cluster in which the correspondence between the domain name of the load access cluster and the address of the local access server is stored, so as to obtain the address of the local access server corresponding to the target load access cluster.
S102: the data to be stored is stored locally.
And when the local access server receives the target information sent by the first client, locally storing the data to be stored included in the target information, wherein the local access server is a local load access cluster.
S103: and after the local storage of the data to be stored is successful, sending information of successful storage to the first client so that the first client displays the information of successful storage.
When the local storage of the data to be stored is successful, the information of successful storage is immediately sent to the first client, and the first client can display the information of successful storage after receiving the information of successful storage, so that a user can know that the data to be stored is successfully stored.
S104: and sending the successfully stored data to be stored to the cloud storage system so that the cloud storage system stores the data to be stored.
Since the data to be stored is successfully stored only in the local load access cluster, in order to store the data to be stored in the cloud storage system, the successfully stored data to be stored needs to be sent to the cloud storage system after the data to be stored is successfully stored locally.
After receiving the data to be stored, the cloud storage system can store the data to be stored in an erasure code coding mode, wherein the process of storing the data to be stored in the erasure code coding mode by the cloud storage system is as follows: the data to be stored are divided into data segments, each data segment is coded, and the coded data segments are stored in different positions of the cloud storage system.
Thus, the hierarchical storage of data is realized, wherein the hierarchical storage refers to: the data are stored in a local load access cluster, and then are transferred to a cloud storage system.
It should be noted that it is reasonable that the data to be stored may be sent to the cloud storage system immediately after the data to be stored is successfully stored in the load access cluster, or may be sent to the cloud storage system again when the load access cluster is idle.
In the embodiment of the invention, target information sent by a first client is received, the target information comprises data to be stored, the data to be stored is stored locally, after the data to be stored is stored locally successfully, information of successful storage is sent to the first client so that the first client displays the information of successful storage, and the data to be stored which is successfully stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored. In the invention, after the data to be stored is successfully stored locally, the information of successful storage is sent to the first client, then the data to be stored which is successfully stored is transferred to the cloud storage system, and the cloud storage system stores the data to be stored again. Because the time for directly storing the data to be stored in the local is far shorter than the time for storing the data in the cloud storage system, the waiting time for the user to see the successfully stored information through the client is reduced, and the user experience is improved.
On the basis of the method shown in fig. 2, as shown in fig. 3, wherein steps S101, S103 and S104 are all the same as those in fig. 2, step S102 in fig. 3 may include:
s1021: and determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored.
Because each load access cluster provides a unique access entrance, the local access server receiving the target information sent by the first client is not necessarily the location where the data to be stored is to be stored, so that after the local access server receives the target information sent by the first client, the first destination address corresponding to the data to be stored needs to be determined.
It should be noted that each local access server in the load access cluster stores a corresponding relationship between the hash value of the data to be stored and the address of the local access server, and therefore, after the local access server receives the target information sent by the first client, the hash value of the data to be stored can be calculated according to the identification information of the data to be stored.
After the hash value is calculated, determining a first destination address of the local access server corresponding to the calculated hash value, namely a first destination address corresponding to the data to be stored according to the calculated hash value and the corresponding relation between the stored hash value of the data to be stored and the address of the local access server.
S1022: and judging whether the first destination address is the address of the local access server, if so, executing step S1023, and if not, executing step S1024.
After the first destination address corresponding to the data to be stored is determined, it is further determined whether the location where the data to be stored is the local access server according to the first destination address, and therefore, it is determined whether the first destination address is the address of the local access server, and according to the determination result, the subsequent steps are executed.
S1023: and storing the data to be stored to the local access server.
When the first destination address is judged to be the address of the local access server, it is indicated that the position where the data to be stored is the local access server, that is, the local access server receives the target information sent by the first client, and at this time, the data to be stored can be stored in the local access server.
The storing the data to be stored in the local access server may include:
and storing the data to be stored in the solid state disk of the local access server.
Since the storage rate of the solid state disk is higher than that of a common hard disk, in order to further increase the data storage speed, the data to be stored can be stored in the solid state disk of the local access server.
S1024: and sending the data to be stored to a local access server corresponding to the first destination address so that the local access server corresponding to the first destination address stores the data to be stored.
When the first destination address is judged not to be the address of the local access server, it is indicated that the location where the data to be stored is not itself, that is, not the local access server that receives the target information sent by the first client, and at this time, the data to be stored needs to be sent to the local access server corresponding to the first destination address.
And after receiving the data to be stored, the local access server corresponding to the first destination address stores the data to be stored.
After receiving the data to be stored, the local access server corresponding to the first destination address stores the data to be stored, which may include:
and after receiving the data to be stored, the local access server corresponding to the first destination address stores the data to be stored in the solid state disk of the local access server corresponding to the first destination address.
Therefore, the data storage speed is improved in a mode of storing the data to be stored in the solid state disk.
In the embodiment of the invention, when the first destination address is the address of the local access server, the data to be stored is stored in the local access server, and when the first destination address is not the address of the local access server, the data to be stored is stored in the local access server corresponding to the first destination address, so that the data to be stored is stored in the local load access cluster.
On the basis of the method shown in fig. 3, as shown in fig. 4, where steps S101-S104 are all the same as fig. 3, after step S1023 in fig. 4, the method may further include:
s1025: and determining other local access servers in the same group with the local access server according to the identification information of the local access server and the pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group.
In order to prevent the data to be stored from being lost when the data to be stored is stored in the local access server and is not transferred to the cloud storage system, the data to be stored can be subjected to copy storage.
Because each load access cluster is provided with a plurality of groups of local access servers, the copy storage mode of the data to be stored can be the same group copy, namely, the data to be stored is copied to other local access servers in the same group.
After the multiple groups of local access servers are set in each load access cluster, grouping information is stored in each local access server, where the grouping information includes a correspondence between identification information of the local access server and a group, for example: local access servers 1, 2 and 3 correspond to group a and local access servers 4 and 5 correspond to group B.
Therefore, after the data to be stored is stored in the local access server, other local access servers in the same group with the local access server can be determined according to the identification information of the local access server and the pre-stored grouping information.
S1026: and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
After other local access servers in the same group with the local access server are determined, the data to be stored can be copied to the determined other local access servers, and after the other local access servers receive the copied data to be stored, the copied data to be stored are respectively stored.
Therefore, the copy storage of the data to be stored is completed, so that even if the data to be stored in the local access server is lost, the data to be stored can be obtained from other local access servers in the same group and can be transferred to the cloud storage system.
For example: assuming that the identification information of the local access server is 1, the pre-stored grouping information is: the local access servers 1, 2 and 3 correspond to a group A, the local access servers 4 and 5 correspond to a group B, and the data to be stored is M;
according to the identification information 1 of the local access server and the pre-stored grouping information, determining that other local access servers in the same group with the local access server 1 are: local access servers 2 and 3;
copying the data M to be stored to the determined other local access servers 2 and 3;
the local access server 2 receives the copied data M to be stored and stores the copied data M to be stored, and the local access server 3 receives the copied data M to be stored and stores the copied data M to be stored.
Therefore, the data to be stored is copied to other local access servers in the same group with the local access server, so that the situation that the data to be stored cannot be transferred to the cloud storage system due to the loss of the data to be stored when the data to be stored is stored in the local access server and is not transferred to the cloud storage system is prevented.
The following describes embodiments of the present invention in detail from the perspective of modules included in the local access server:
as shown in fig. 5, the local access server includes a PS module, a DSS module, a DDS module, a repeater module, and a GMS module, where the PS module is an agent service module, and is configured to provide a cloud storage protocol service to the outside, for example: the aritos object storage protocol service, amazon S3 object storage protocol service.
The DSS module is a data storage/reading service module and is used for storing/reading data; the DDS module is a data unloading service module and is used for unloading data from the local to the cloud storage system; the repeater module is a data copying module and is used for copying local data to other local access servers; the GMS module is an access group management service module and is used for performing Hash calculation according to the identification information of the data to be stored and determining the position of the data to be stored.
The process of storing the data to be stored through each module of the local access server is as follows:
the first client sends target information to the PS module, the PS module sends identification information of data to be stored to the GMS module, the GMS module calculates a hash value of the data to be stored according to the received identification information, and determines a first destination address of the local access server corresponding to the calculated hash value, namely the first destination address corresponding to the data to be stored according to the calculated hash value and a corresponding relation between the stored hash value of the data to be stored and the address of the local access server. And sending the determined first destination address to the PS module.
The PS module judges whether the first destination address is the address of the PS module, if so, the data to be stored is sent to the DSS module, the DSS module stores the received data to be stored and sends the data to be stored to the repeater module, the repeater module sends a request for acquiring other local access servers of the same group to the GMS module, the GMS module sends the addresses of the other local access servers of the same group to the repeater module, and the repeater module duplicates the data to be stored to the other local access servers of the same group, so that the other local access servers respectively store the duplicated data to be stored.
And if the PS module judges that the first destination address is not the address of the local access server, the data to be stored is sent to the DSS module, and the DSS module sends the received data to be stored to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
After the data to be stored is stored locally successfully, the DSS module sends a message of successful storage to the PS module, the PS module sends information of successful storage to the first client so that the first client can display the information of successful storage, then the DSS module sends the data to be stored which is successfully stored to the DDS module, and the DDS module stores the received data to be stored which is successfully stored to the cloud storage system.
On the basis of the method shown in fig. 4, as shown in fig. 6, where steps S101-S104 are the same as those in fig. 4, after step S104 in fig. 6, the method may further include:
s105: and deleting the data to be stored in the local access server and other local access servers.
After the data to be stored, which is stored in the load access cluster, is transferred to the cloud storage system, in order to save the storage space of the load access cluster, the data to be stored, which is stored in the local access server and other local access servers, may be deleted.
Since there may be a case that the second client requests the first client to access the target information to the cloud storage system through a certain target load, at this time, the second client may request the first client to notify that the first client has successfully stored the data to be stored after successfully storing the data, and therefore, the target information may further include request information, as shown in fig. 7 based on the method shown in fig. 2, where steps S101 to S104 are all the same as those in fig. 2, and after step S104 in fig. 7, the method may further include:
s106: and judging whether the request information is feedback request information, if so, executing the step S107, and if not, not performing any processing.
In order to know whether the data to be stored is the data to be stored entrusted to the first client side by the second client side, after the successfully stored data to be stored is transferred to the cloud storage system, whether the request information is the feedback request information needs to be judged, and the subsequent steps are executed according to the judgment result.
S107: and determining a second destination address contained in the feedback request information.
When the request information is judged to be the feedback request information, the data to be stored is that the second client entrusts the first client to store, and at this time, a second destination address contained in the feedback request information needs to be determined.
S108: and encrypting the successful storage information of the data to be stored by using a preset private key, and sending the successful storage information of the encrypted data to be stored to a second client corresponding to a second destination address, so that the second client sends public key request information to the local access server after receiving the successful storage information of the encrypted data to be stored, and decrypts the successful storage information of the encrypted data to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
In order to prevent the information of successful storage of the data to be stored from being intercepted by a malicious program when the information of successful storage of the data to be stored is fed back to the second client, the information of successful storage of the data to be stored needs to be encrypted.
The local access server generates a preset private key and a preset public key according to a preset encryption rule, the preset private key is used for encryption, and the preset public key is used for decryption, so that before the information of successful storage of the data to be stored is sent, the information of successful storage of the data to be stored can be encrypted by using the preset private key, and the encrypted information of successful storage of the data to be stored is sent to the second client corresponding to the second destination address.
After receiving the encrypted data storage success information to be stored, the second client needs to send public key request information to the local access server in order to open the received information, the local access server sends a preset public key to the second client after receiving the public key request information, and after receiving the preset public key fed back by the local access server, the second client decrypts the encrypted data storage success information to be stored by using the preset public key, so that the fact that the data to be stored is successfully stored is obtained.
It should be noted that, when the preset private key or the preset public key is revealed, the local access server regenerates the preset private key and the preset public key to replace the revealed preset private key or preset public key, thereby ensuring the security of the encrypted information.
With respect to the above method embodiment, as shown in fig. 8, an embodiment of the present invention further provides a data storage apparatus, which is applied to a local access server, where the apparatus includes:
a first receiving module 201, configured to receive target information sent by a first client, where the target information includes data to be stored;
a storage module 202, configured to store the data to be stored locally;
the sending module 203 is configured to send information of successful storage to the first client after the data to be stored is stored locally successfully, so that the first client displays the information of successful storage;
the unloading module 204 is configured to send the successfully stored data to be stored to the cloud storage system, so that the cloud storage system stores the data to be stored.
In the embodiment of the invention, target information sent by a first client is received, the target information comprises data to be stored, the data to be stored is stored locally, after the data to be stored is stored locally successfully, information of successful storage is sent to the first client so that the first client displays the information of successful storage, and the data to be stored which is successfully stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored. In the invention, after the data to be stored is successfully stored locally, the information of successful storage is sent to the first client, then the data to be stored which is successfully stored is transferred to the cloud storage system, and the cloud storage system stores the data to be stored again. Because the time for directly storing the data to be stored in the local is far shorter than the time for storing the data in the cloud storage system, the waiting time for the user to see the successfully stored information through the client is reduced, and the user experience is improved.
In an implementation manner of the present invention, the storage module 202 may include:
a first destination address determining unit, configured to determine, according to the identification information of the data to be stored, a first destination address corresponding to the data to be stored;
the judging unit is used for judging whether the first destination address is the address of the local access server or not, if so, triggering the first storage unit, and if not, triggering the second storage unit;
the first storage unit is used for storing the data to be stored to the local access server;
the second storage unit is configured to send the data to be stored to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
In an implementation manner of the present invention, the first storage unit may be specifically configured to:
and storing the data to be stored into a solid state disk of the local access server.
In one implementation manner of the present invention, the apparatus may further include:
the other local access server determining module is used for determining other local access servers in the same group as the local access server according to the identification information of the local access server and pre-stored grouping information after the data to be stored is stored in the local access server, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and the copying module is used for copying the data to be stored to the determined other local access servers so as to enable the other local access servers to store the copied data to be stored respectively.
In one implementation manner of the present invention, the apparatus may further include:
and the deleting module is used for deleting the data to be stored in the local access server and the other local access servers after the successfully stored data to be stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored.
In an implementation manner of the present invention, the target information further includes request information, and the apparatus may further include:
the feedback request information judging module is used for judging whether the request information is feedback request information or not after the successfully stored data to be stored is sent to the cloud storage system so that the cloud storage system stores the data to be stored, and if so, triggering the second destination address determining module;
the second destination address determining module is configured to determine a second destination address included in the feedback request information;
and the encryption module is used for encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, including: a first processor 901, a first communication interface 902, a first memory 903 and a first communication bus 904, wherein the first processor 901, the first communication interface 902 and the first memory 903 are communicated with each other through the first communication bus 904,
a first memory 903 for storing computer programs;
the first processor 901 is configured to implement the following steps when executing the computer program stored in the first memory 903:
receiving target information sent by a first client, wherein the target information comprises data to be stored;
locally storing the data to be stored;
after the data to be stored is stored locally successfully, sending information of successful storage to the first client so that the first client can display the information of successful storage;
and sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
In the embodiment of the invention, target information sent by a first client is received, the target information comprises data to be stored, the data to be stored is stored locally, after the data to be stored is stored locally successfully, information of successful storage is sent to the first client so that the first client displays the information of successful storage, and the data to be stored which is successfully stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored. In the invention, after the data to be stored is successfully stored locally, the information of successful storage is sent to the first client, then the data to be stored which is successfully stored is transferred to the cloud storage system, and the cloud storage system stores the data to be stored again. Because the time for directly storing the data to be stored in the local is far shorter than the time for storing the data in the cloud storage system, the waiting time for the user to see the successfully stored information through the client is reduced, and the user experience is improved.
In an implementation manner of the present invention, the step of locally storing the data to be stored includes:
determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored;
judging whether the first destination address is the address of the local access server;
if yes, storing the data to be stored in the local access server;
if not, the data to be stored is sent to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
In an implementation manner of the present invention, the step of storing the data to be stored in the local access server includes:
and storing the data to be stored into a solid state disk of the local access server.
In an implementation manner of the present invention, after the step of storing the data to be stored in the local access server, the method further includes:
determining other local access servers in the same group with the local access server according to the identification information of the local access server and pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
In an implementation manner of the present invention, after the step of sending the successfully stored data to be stored to a cloud storage system, so that the cloud storage system stores the data to be stored, the method further includes:
deleting the data to be stored in the local access server and the other local access servers.
In an implementation manner of the present invention, the target information further includes request information, and after the step of sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored, the method further includes:
judging whether the request information is feedback request information or not;
if yes, determining a second destination address contained in the feedback request information;
and encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
The first communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The first communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The first communication interface is used for communication between the electronic equipment and other equipment.
The first Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the first memory may also be at least one memory device located remotely from the processor.
The first Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:
receiving target information sent by a first client, wherein the target information comprises data to be stored;
locally storing the data to be stored;
after the data to be stored is stored locally successfully, sending information of successful storage to the first client so that the first client can display the information of successful storage;
and sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
In the embodiment of the invention, target information sent by a first client is received, the target information comprises data to be stored, the data to be stored is stored locally, after the data to be stored is stored locally successfully, information of successful storage is sent to the first client so that the first client displays the information of successful storage, and the data to be stored which is successfully stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored. In the invention, after the data to be stored is successfully stored locally, the information of successful storage is sent to the first client, then the data to be stored which is successfully stored is transferred to the cloud storage system, and the cloud storage system stores the data to be stored again. Because the time for directly storing the data to be stored in the local is far shorter than the time for storing the data in the cloud storage system, the waiting time for the user to see the successfully stored information through the client is reduced, and the user experience is improved.
In an implementation manner of the present invention, the step of locally storing the data to be stored includes:
determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored;
judging whether the first destination address is the address of the local access server;
if yes, storing the data to be stored in the local access server;
if not, the data to be stored is sent to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
In an implementation manner of the present invention, the step of storing the data to be stored in the local access server includes:
and storing the data to be stored into a solid state disk of the local access server.
In an implementation manner of the present invention, after the step of storing the data to be stored in the local access server, the method further includes:
determining other local access servers in the same group with the local access server according to the identification information of the local access server and pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
In an implementation manner of the present invention, after the step of sending the successfully stored data to be stored to a cloud storage system, so that the cloud storage system stores the data to be stored, the method further includes:
deleting the data to be stored in the local access server and the other local access servers.
In an implementation manner of the present invention, the target information further includes request information, and after the step of sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored, the method further includes:
judging whether the request information is feedback request information or not;
if yes, determining a second destination address contained in the feedback request information;
and encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
A data reading method provided in an embodiment of the present invention is described below.
As shown in fig. 10, a data reading method provided in an embodiment of the present invention is applied to a local access server, and may include:
s301: and receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read.
After data is stored in the cloud storage system through the target load access cluster, when a client wants to read the stored data, a data reading request including identification information of the data to be read is sent to a certain local access server in the target load access cluster, and the local access server receives the data reading request.
The process of sending the data reading request to the local access server by the client is as follows:
the client determines the address of the local access server corresponding to the target load access cluster according to the domain name of the target load access cluster and the corresponding relation between the domain name of the load access cluster and the address of the local access server stored in advance, and sends the data reading request to the local access server corresponding to the determined address.
Because the domain name of the pre-stored load access cluster and the address of the local access server are in a one-to-one correspondence relationship, only the address of the uniquely corresponding local access server can be obtained under the condition that the domain name of the target load access cluster is obtained, namely, each load access cluster only provides a unique access entrance.
In addition, when the corresponding relationship between the domain name of the pre-stored load access cluster and the address of the local access server is stored in the client, the client can directly determine the address of the local access server corresponding to the target load access cluster.
When a pre-stored correspondence between a domain name of a load access cluster and an address of a local access server is stored in a certain load access cluster, a first client needs to send request information including the domain name of a target load access cluster to the load access cluster in which the correspondence between the domain name of the load access cluster and the address of the local access server is stored, so as to obtain the address of the local access server corresponding to the target load access cluster.
S302: and determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information.
When data is stored, although the data is transferred to the cloud storage system through the load access cluster, when a data reading request sent by a client is received, the load access cluster does not necessarily transfer the data to the cloud storage system, and therefore after the data reading request sent by the client is received, it is necessary to determine whether the data to be read is transferred to the cloud storage system.
Since the local access server stores the identification information of the data and the corresponding transfer information into the index information table, the manner of determining whether the data to be read is transferred to the cloud storage system may be: according to the identification information and a pre-stored index information table, the transfer information corresponding to the identification information is found, and whether the data to be read is transferred to the cloud storage server or not is determined according to the found transfer information.
S303: and if the data is transferred to the cloud storage system, sending identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system, and sending the received data to be read to the client.
If the data to be read is transferred to the cloud storage system, the identification information of the data to be read is sent to the cloud storage system, the cloud storage system finds the storage position corresponding to the identification information according to the received identification information and the corresponding relation between the pre-stored identification information and the storage position, then the data to be read is obtained from the storage position, and the obtained data to be read is fed back to the local access server.
The local access server receives the data to be read fed back by the cloud storage system and sends the received data to be read to the client, so that the data to be read is read.
In the embodiment of the invention, a data reading request sent by a client is received, the data reading request comprises identification information of data to be read, whether the data to be read is transferred to a cloud storage system or not is determined according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information, if the data to be read is transferred to the cloud storage system, the identification information is sent to the cloud storage system, the data to be read fed back by the cloud storage system is received, and the received data to be read is sent to the client. In the invention, after a data reading request sent by a client is received, whether the data to be read is transferred to a cloud storage system is judged, if so, the data to be read is requested to the cloud storage system, and after the data to be read fed back by the cloud storage system is received, the received data to be read is sent to the client, so that the data to be read is read from the cloud storage system.
On the basis of the method shown in fig. 10, as shown in fig. 11, wherein steps S301 to S303 are the same as those in fig. 10, before step S302 in fig. 10, the method may further include:
S302A: and determining a destination address corresponding to the data to be read according to the identification information.
Because each load access cluster provides a unique access entry, the local access server receiving the data reading request including the identification information of the data to be read sent by the client does not necessarily have to forward the data to be read to the local access server of the cloud storage system, so that after the local access server receives the data reading request sent by the client, the target address corresponding to the data to be read needs to be determined, that is, the address of the local access server forwarding the data to be read to the cloud storage system is determined.
It should be noted that each local access server in the load access cluster stores a corresponding relationship between a hash value of stored data and an address of the local access server, and therefore, after the local access server receives a data reading request sent by a client, the hash value of the data to be read needs to be calculated according to identification information of the data to be read.
After the hash value is calculated, the destination address of the local access server corresponding to the calculated hash value, namely the destination address corresponding to the data to be read, is determined according to the calculated hash value and the correspondence between the stored hash value of the stored data and the address of the local access server.
S302B: and judging whether the destination address is the address of the local access server, and if so, executing the step S302.
After the destination address corresponding to the data to be read is determined, it is further determined whether the local access server that transfers the data to be read to the cloud storage system is the local access server according to the destination address, and therefore, it is necessary to determine whether the destination address is an address of the local access server, and if so, step S302 is executed.
In the embodiment of the invention, when the destination address is the address of the local access server, the data to be read is read from the cloud storage system through the local access server.
On the basis of the method shown in fig. 11, as shown in fig. 12, where steps S301 to S303 are all the same as those in fig. 11, after the step S302B in fig. 12 is determined as no, the method may further include:
s304: and sending the identification information to a local access server corresponding to the destination address so that the local access server corresponding to the destination address finds the data to be read according to the identification information and sends the found data to be read to the client.
When the destination address is judged not to be the local access server, it is stated that the local access server that transfers the data to be read to the cloud storage system is not itself, and at this time, the identification information needs to be sent to the local access server corresponding to the destination address.
And after receiving the identification information, the local access server corresponding to the destination address can find the data to be read according to the identification information and send the found data to be read to the client.
The process of finding the data to be read by the local access server corresponding to the destination address according to the identification information and sending the found data to be read to the client may be as follows:
and the local access server corresponding to the destination address determines whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information.
And if the data is transferred to the cloud storage system, sending identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system, and sending the received data to be read to the client.
And if the data is not transferred to the cloud storage system, searching the data to be read from the cloud storage system according to the identification information, and sending the searched data to be read to the client.
In the embodiment of the invention, when the destination address is not the address of the local access server, the identification information is sent to the local access server corresponding to the destination address, and the data to be read is read from the cloud storage system through the local access server corresponding to the destination address.
The following describes embodiments of the present invention in detail from the perspective of modules included in the local access server:
as shown in fig. 5, the process of reading the data to be read by each module of the local access server is as follows:
the client sends a data reading request to the PS module, the PS module sends identification information of data to be read to the GMS module, the GMS module calculates the hash value of the data to be read according to the received identification information, and determines the destination address of the local access server corresponding to the calculated hash value, namely the destination address corresponding to the data to be read according to the calculated hash value and the corresponding relation between the stored hash value of the stored data and the address of the local access server. And sends the determined destination address to the PS module.
The PS module judges whether the destination address is the address of the PS module, if so, the identification information of the data to be read is sent to the DSS module, and the DSS module determines whether the data to be read is transferred to the cloud storage system according to the identification information and a pre-stored index information table.
If the data is transferred to the cloud storage system, the DSS module sends the identification information to the DDS module, the DDS module sends the identification information to the cloud storage system, the cloud storage system searches the data to be read after receiving the identification information and feeds the data to be read back to the DDS module, the DDS module receives the data to be read back from the cloud storage system and sends the data to be read back to the DSS module, the DSS module sends the data to be read back to the PS module, and then the PS module sends the data to be read back to the client.
If the data is not transferred to the cloud storage system, the DSS module finds the data to be read from the DSS module according to the identification information, sends the found data to be read to the PS module, and then the PS module sends the data to be read to the client.
And if the PS module judges that the destination address is not the address of the PS module, the identification information of the data to be read is sent to the DSS module, and the DSS module sends the received identification information to the local access server corresponding to the destination address, so that the local access server corresponding to the destination address searches the data to be read according to the identification information and sends the searched data to be read to the client.
With respect to the above method embodiment, as shown in fig. 13, an embodiment of the present invention further provides a data reading apparatus, which is applied to a local access server, where the apparatus may include:
a second receiving module 1301, configured to receive a data reading request sent by a client, where the data reading request includes identification information of data to be read;
a determining module 1302, configured to determine whether the data to be read has been transferred to a cloud storage system according to the identification information and a pre-stored index information table, where a corresponding relationship between the identification information and transfer information is stored in the index information table;
and the reading module 1303 is configured to send the identification information to a cloud storage system if the data is transferred to the cloud storage system, receive the data to be read fed back by the cloud storage system, and send the received data to be read to the client.
In the embodiment of the invention, a data reading request sent by a client is received, the data reading request comprises identification information of data to be read, whether the data to be read is transferred to a cloud storage system or not is determined according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information, if the data to be read is transferred to the cloud storage system, the identification information is sent to the cloud storage system, the data to be read fed back by the cloud storage system is received, and the received data to be read is sent to the client. In the invention, after a data reading request sent by a client is received, whether the data to be read is transferred to a cloud storage system is judged, if so, the data to be read is requested to the cloud storage system, and after the data to be read fed back by the cloud storage system is received, the received data to be read is sent to the client, so that the data to be read is read from the cloud storage system.
In one implementation manner of the present invention, the apparatus may further include:
a destination address determining module, configured to determine, according to the identification information, a destination address corresponding to the data to be read before determining whether the data to be read has been transferred to the cloud storage system according to the identification information and a pre-stored index information table;
and the self address judging module is used for judging whether the destination address is the address of the local access server or not, and if so, triggering the determining module.
In one implementation manner of the present invention, the apparatus may further include:
and the searching module is used for sending the identification information to the local access server corresponding to the destination address after judging whether the destination address is the address of the local access server or not, so that the local access server corresponding to the destination address searches the data to be read according to the identification information, and sends the searched data to be read to the client.
An embodiment of the present invention further provides an electronic device, as shown in fig. 14, including: a second processor 1401, a second communication interface 1402, a second memory 1403 and a second communication bus 1404, wherein the second processor 1401, the second communication interface 1402 and the second memory 1403 are communicated with each other through the second communication bus 1404,
a second memory 1403 for storing a computer program;
the second processor 1401, when executing the computer program stored in the second memory 1403, is configured to implement the following steps:
receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read;
determining whether the data to be read is transferred to a cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information;
and if the data to be read is transferred to a cloud storage system, sending the identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system, and sending the received data to be read to the client.
In the embodiment of the invention, a data reading request sent by a client is received, the data reading request comprises identification information of data to be read, whether the data to be read is transferred to a cloud storage system or not is determined according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information, if the data to be read is transferred to the cloud storage system, the identification information is sent to the cloud storage system, the data to be read fed back by the cloud storage system is received, and the received data to be read is sent to the client. In the invention, after a data reading request sent by a client is received, whether the data to be read is transferred to a cloud storage system is judged, if so, the data to be read is requested to the cloud storage system, and after the data to be read fed back by the cloud storage system is received, the received data to be read is sent to the client, so that the data to be read is read from the cloud storage system.
In an implementation manner of the present invention, before the step of determining whether the data to be read has been transferred to the cloud storage system according to the identification information and a pre-stored index information table, the method further includes:
determining a destination address corresponding to the data to be read according to the identification information;
judging whether the destination address is the address of the local access server or not;
and if so, determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table.
In an implementation manner of the present invention, after the step of determining whether the destination address is an address of the local access server, the method further includes:
and if the address of the local access server is not the address of the local access server, sending the identification information to the local access server corresponding to the destination address, so that the local access server corresponding to the destination address finds the data to be read according to the identification information, and sends the found data to be read to the client.
In addition, it should be noted that, when the second processor 1401 is further configured to execute the computer program stored in the second memory 1403, it implements the following data storage method steps:
receiving target information sent by a first client, wherein the target information comprises data to be stored;
locally storing the data to be stored;
after the data to be stored is stored locally successfully, sending information of successful storage to the first client so that the first client can display the information of successful storage;
and sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
In an implementation manner of the present invention, the step of locally storing the data to be stored includes:
determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored;
judging whether the first destination address is the address of the local access server;
if yes, storing the data to be stored in the local access server;
if not, the data to be stored is sent to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
In an implementation manner of the present invention, the step of storing the data to be stored in the local access server includes:
and storing the data to be stored into a solid state disk of the local access server.
In an implementation manner of the present invention, after the step of storing the data to be stored in the local access server, the method further includes:
determining other local access servers in the same group with the local access server according to the identification information of the local access server and pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
In an implementation manner of the present invention, after the step of sending the successfully stored data to be stored to a cloud storage system, so that the cloud storage system stores the data to be stored, the method further includes:
deleting the data to be stored in the local access server and the other local access servers.
In an implementation manner of the present invention, the target information further includes request information, and after the step of sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored, the method further includes:
judging whether the request information is feedback request information or not;
if yes, determining a second destination address contained in the feedback request information;
and encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
The second communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The second communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The second communication interface is used for communication between the electronic equipment and other equipment.
The second Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the second memory may also be at least one memory device located remotely from the processor.
The second Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:
receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read;
determining whether the data to be read is transferred to a cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information;
and if the data to be read is transferred to a cloud storage system, sending the identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system, and sending the received data to be read to the client.
In the embodiment of the invention, a data reading request sent by a client is received, the data reading request comprises identification information of data to be read, whether the data to be read is transferred to a cloud storage system or not is determined according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information, if the data to be read is transferred to the cloud storage system, the identification information is sent to the cloud storage system, the data to be read fed back by the cloud storage system is received, and the received data to be read is sent to the client. In the invention, after a data reading request sent by a client is received, whether the data to be read is transferred to a cloud storage system is judged, if so, the data to be read is requested to the cloud storage system, and after the data to be read fed back by the cloud storage system is received, the received data to be read is sent to the client, so that the data to be read is read from the cloud storage system.
In an implementation manner of the present invention, before the step of determining whether the data to be read has been transferred to the cloud storage system according to the identification information and a pre-stored index information table, the method further includes:
determining a destination address corresponding to the data to be read according to the identification information;
judging whether the destination address is the address of the local access server or not;
and if so, determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table.
In an implementation manner of the present invention, after the step of determining whether the destination address is an address of the local access server, the method further includes:
and if the address of the local access server is not the address of the local access server, sending the identification information to the local access server corresponding to the destination address, so that the local access server corresponding to the destination address finds the data to be read according to the identification information, and sends the found data to be read to the client.
In addition, it should be noted that, when being executed by a processor, the computer program further realizes the following data storage method steps:
receiving target information sent by a first client, wherein the target information comprises data to be stored;
locally storing the data to be stored;
after the data to be stored is stored locally successfully, sending information of successful storage to the first client so that the first client can display the information of successful storage;
and sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored in an erasure code coding mode.
In an implementation manner of the present invention, the step of locally storing the data to be stored includes:
determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored;
judging whether the first destination address is the address of the local access server;
if yes, storing the data to be stored in the local access server;
if not, the data to be stored is sent to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
In an implementation manner of the present invention, the step of storing the data to be stored in the local access server includes:
and storing the data to be stored into a solid state disk of the local access server.
In an implementation manner of the present invention, after the step of storing the data to be stored in the local access server, the method further includes:
determining other local access servers in the same group with the local access server according to the identification information of the local access server and pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
In an implementation manner of the present invention, after the step of sending the successfully stored data to be stored to a cloud storage system, so that the cloud storage system stores the data to be stored, the method further includes:
deleting the data to be stored in the local access server and the other local access servers.
In an implementation manner of the present invention, the target information further includes request information, and after the step of sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored, the method further includes:
judging whether the request information is feedback request information or not;
if yes, determining a second destination address contained in the feedback request information;
and encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. A data storage method is applied to a local access server in a target load access cluster, wherein the target load cluster is one of a plurality of load access clusters which are locally arranged in advance, and the method comprises the following steps:
receiving target information sent by a first client, wherein the target information comprises data to be stored; wherein the process of the first client sending the target information to the local access server in the target load access cluster includes: the first client determines the address of a local access server corresponding to the target load access cluster according to the domain name of the target load access cluster and the corresponding relation between the domain name of the pre-stored load access cluster and the address of the local access server, and sends the target information to the local access server corresponding to the determined address;
locally storing the data to be stored;
after the data to be stored is stored locally successfully, sending information of successful storage to the first client so that the first client can display the information of successful storage; the information of successful storage is used for enabling a user to know that the data to be stored is successfully stored;
and sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
2. The method of claim 1, wherein the step of locally storing the data to be stored comprises:
determining a first destination address corresponding to the data to be stored according to the identification information of the data to be stored;
judging whether the first destination address is the address of the local access server;
if yes, storing the data to be stored in the local access server;
if not, the data to be stored is sent to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
3. The method of claim 2, wherein the step of storing the data to be stored in the local access server comprises:
and storing the data to be stored into a solid state disk of the local access server.
4. The method of claim 2, wherein after the step of storing the data to be stored to the local access server, the method further comprises:
determining other local access servers in the same group with the local access server according to the identification information of the local access server and pre-stored grouping information, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and copying the data to be stored to the determined other local access servers so that the other local access servers respectively store the copied data to be stored.
5. The method according to claim 4, wherein after the step of sending the successfully stored data to be stored to a cloud storage system to cause the cloud storage system to store the data to be stored, the method further comprises:
deleting the data to be stored in the local access server and the other local access servers.
6. The method according to claim 1, wherein the target information further includes request information, and after the step of sending the successfully stored data to be stored to a cloud storage system to enable the cloud storage system to store the data to be stored, the method further includes:
judging whether the request information is feedback request information or not;
if yes, determining a second destination address contained in the feedback request information;
and encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
7. A data storage apparatus, applied to a local access server in a target load access cluster, where the target load cluster is one of a plurality of load access clusters locally set in advance, the apparatus comprising:
the first receiving module is used for receiving target information sent by a first client, wherein the target information comprises data to be stored; wherein the process of the first client sending the target information to the local access server in the target load access cluster includes: the first client determines the address of a local access server corresponding to the target load access cluster according to the domain name of the target load access cluster and the corresponding relation between the domain name of the pre-stored load access cluster and the address of the local access server, and sends the target information to the local access server corresponding to the determined address; the storage module is used for locally storing the data to be stored;
the sending module is used for sending information of successful storage to the first client after the data to be stored is stored locally successfully so that the first client can display the information of successful storage; the information of successful storage is used for enabling a user to know that the data to be stored is successfully stored;
and the transfer module is used for sending the successfully stored data to be stored to a cloud storage system so that the cloud storage system stores the data to be stored.
8. The apparatus of claim 7, wherein the storage module comprises:
a first destination address determining unit, configured to determine, according to the identification information of the data to be stored, a first destination address corresponding to the data to be stored;
the judging unit is used for judging whether the first destination address is the address of the local access server or not, if so, triggering the first storage unit, and if not, triggering the second storage unit;
the first storage unit is used for storing the data to be stored to the local access server;
the second storage unit is configured to send the data to be stored to the local access server corresponding to the first destination address, so that the local access server corresponding to the first destination address stores the data to be stored.
9. The apparatus of claim 8, wherein the first storage unit is specifically configured to:
and storing the data to be stored into a solid state disk of the local access server.
10. The apparatus of claim 8, further comprising:
the other local access server determining module is used for determining other local access servers in the same group as the local access server according to the identification information of the local access server and pre-stored grouping information after the data to be stored is stored in the local access server, wherein the grouping information comprises the corresponding relation between the identification information of the local access server and the group;
and the copying module is used for copying the data to be stored to the determined other local access servers so as to enable the other local access servers to store the copied data to be stored respectively.
11. The apparatus of claim 10, further comprising:
and the deleting module is used for deleting the data to be stored in the local access server and the other local access servers after the successfully stored data to be stored is sent to a cloud storage system so that the cloud storage system stores the data to be stored.
12. The apparatus of claim 7, wherein the target information further comprises request information, the apparatus further comprising:
the feedback request information judging module is used for judging whether the request information is feedback request information or not after the successfully stored data to be stored is sent to the cloud storage system so that the cloud storage system stores the data to be stored, and if so, triggering the second destination address determining module;
the second destination address determining module is configured to determine a second destination address included in the feedback request information;
and the encryption module is used for encrypting the successful data storage information to be stored by using a preset private key, and sending the successful data storage information to be stored to a second client corresponding to the second destination address, so that the second client sends public key request information to the local access server after receiving the successful data storage information to be stored, and decrypts the successful data storage information to be stored by using the preset public key after receiving the preset public key fed back by the local access server.
13. A data reading method is applied to a local access server in a target load access cluster, wherein the target load cluster is one of a plurality of load access clusters which are locally set in advance, and the method comprises the following steps:
receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read; the process of sending a data reading request to the local access server by the client is as follows: determining the address of a local access server corresponding to the target load access cluster according to the domain name of the target load access cluster and the corresponding relation between the domain name of the pre-stored load access cluster and the address of the local access server, and sending a data reading request to the local access server corresponding to the determined address;
determining whether the data to be read is transferred to a cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information;
and if the data to be read is transferred to a cloud storage system, sending the identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system, and sending the received data to be read to the client.
14. The method according to claim 13, wherein before the step of determining whether the data to be read has been transferred to the cloud storage system according to the identification information and a pre-stored index information table, the method further comprises:
determining a destination address corresponding to the data to be read according to the identification information;
judging whether the destination address is the address of the local access server or not;
and if so, determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table.
15. The method of claim 14, wherein after the step of determining whether the destination address is the address of the local access server, the method further comprises:
and if the address of the local access server is not the address of the local access server, sending the identification information to the local access server corresponding to the destination address, so that the local access server corresponding to the destination address finds the data to be read according to the identification information, and sends the found data to be read to the client.
16. A data reading apparatus, which is applied to a local access server in a target load access cluster, where the target load cluster is one of a plurality of load access clusters locally set in advance, and the apparatus includes:
the second receiving module is used for receiving a data reading request sent by a client, wherein the data reading request comprises identification information of data to be read; the process of sending a data reading request to the local access server by the client is as follows: determining the address of a local access server corresponding to the target load access cluster according to the domain name of the target load access cluster and the corresponding relation between the domain name of the pre-stored load access cluster and the address of the local access server, and sending a data reading request to the local access server corresponding to the determined address; the determining module is used for determining whether the data to be read is transferred to the cloud storage system or not according to the identification information and a pre-stored index information table, wherein the index information table stores the corresponding relation between the identification information and the transfer information;
the reading module is used for sending the identification information to the cloud storage system, receiving the data to be read fed back by the cloud storage system and sending the received data to be read to the client if the data is transferred to the cloud storage system.
17. The apparatus of claim 16, further comprising:
a destination address determining module, configured to determine, according to the identification information, a destination address corresponding to the data to be read before determining whether the data to be read has been transferred to the cloud storage system according to the identification information and a pre-stored index information table;
and the self address judging module is used for judging whether the destination address is the address of the local access server or not, and if so, triggering the determining module.
18. The apparatus of claim 17, further comprising:
and the searching module is used for sending the identification information to the local access server corresponding to the destination address after judging whether the destination address is the address of the local access server or not, so that the local access server corresponding to the destination address searches the data to be read according to the identification information, and sends the searched data to be read to the client.
CN201710795265.9A 2017-09-06 2017-09-06 Data storage and reading method and device Active CN109460182B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710795265.9A CN109460182B (en) 2017-09-06 2017-09-06 Data storage and reading method and device
PCT/CN2018/104255 WO2019047875A1 (en) 2017-09-06 2018-09-06 Method and device for storing and reading data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710795265.9A CN109460182B (en) 2017-09-06 2017-09-06 Data storage and reading method and device

Publications (2)

Publication Number Publication Date
CN109460182A CN109460182A (en) 2019-03-12
CN109460182B true CN109460182B (en) 2020-10-30

Family

ID=65605958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710795265.9A Active CN109460182B (en) 2017-09-06 2017-09-06 Data storage and reading method and device

Country Status (2)

Country Link
CN (1) CN109460182B (en)
WO (1) WO2019047875A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125030B (en) * 2019-12-18 2023-09-22 北京数衍科技有限公司 Data storage method, device and server
EP4087212A4 (en) * 2020-01-17 2023-01-04 Huawei Technologies Co., Ltd. Method and apparatus for cloning file system
CN114760356A (en) * 2020-12-29 2022-07-15 北京金山云网络技术有限公司 Data reading request processing method and device and data reading request processing system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694860A (en) * 2012-05-25 2012-09-26 北京邦诺存储科技有限公司 Method, equipment and system for data processing of cloud storage
CN104966023A (en) * 2015-03-10 2015-10-07 深圳市腾讯计算机系统有限公司 Data protection system, method and apparatus
CN106921648A (en) * 2016-11-15 2017-07-04 阿里巴巴集团控股有限公司 Date storage method, application server and remote storage server

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8452932B2 (en) * 2010-01-06 2013-05-28 Storsimple, Inc. System and method for efficiently creating off-site data volume back-ups
CN105791353B (en) * 2014-12-23 2020-03-17 深圳市腾讯计算机系统有限公司 Distributed data storage method and system based on erasure codes
CN106161637A (en) * 2016-07-21 2016-11-23 广州杰赛科技股份有限公司 A kind of cloud backup method and device
CN106484322A (en) * 2016-09-12 2017-03-08 华为技术有限公司 A kind of method of carry file system, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694860A (en) * 2012-05-25 2012-09-26 北京邦诺存储科技有限公司 Method, equipment and system for data processing of cloud storage
CN104966023A (en) * 2015-03-10 2015-10-07 深圳市腾讯计算机系统有限公司 Data protection system, method and apparatus
CN106921648A (en) * 2016-11-15 2017-07-04 阿里巴巴集团控股有限公司 Date storage method, application server and remote storage server

Also Published As

Publication number Publication date
WO2019047875A1 (en) 2019-03-14
CN109460182A (en) 2019-03-12

Similar Documents

Publication Publication Date Title
US8619986B2 (en) Systems and methods for secure communication using a communication encryption bios based upon a message specific identifier
JP2022511616A (en) Business processing methods, equipment, electronic devices and computer programs based on blockchain systems
KR20160139493A (en) Method and apparatus for managing encryption keys for cloud service
US20200380091A1 (en) Method, electronic device, computer program, and system for secure data sharing using blockchain network
CN109460182B (en) Data storage and reading method and device
CN109241754B (en) Cloud file repeated data deleting method based on block chain
CN106664308B (en) Device authentication prior to enrollment
CN113261024A (en) Method for routing to mesh network content using block chaining techniques
CN112835885B (en) Processing method, device and system for distributed form storage
US10146455B2 (en) Device, system and method for storing data
CN111988262B (en) Authentication method, authentication device, server and storage medium
CN111371889A (en) Message processing method and device, Internet of things system and storage medium
US10936674B2 (en) Policy-based trusted peer-to-peer connections
CN109284633B (en) Data processing method and data processing device for block chain network system
US10491458B2 (en) System and method for reporting peer-to-peer transfer events
EP3346671B1 (en) Service processing method and equipment
CN114491657A (en) Model protection method, data processing method, device, equipment and medium
CN112995988B (en) Network port distribution method and device based on multiple network ports of wireless network equipment
CN114567483B (en) Data transmission method and device and electronic equipment
CN112242904B (en) File information processing method and equipment
CN111611577B (en) Authentication method, authentication device, authentication system, electronic equipment and computer readable storage medium
CN112995285B (en) Distributed KV storage system based on block technology
CN117493026B (en) Multi-host and multi-computing quick link memory device system and application device thereof
CN114531455B (en) Multi-cloud secure storage method based on edge assistance
CN111783154B (en) Old people electronic license generation method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant