Movatterモバイル変換


[0]ホーム

URL:


CN109783494A - Date storage method and relevant apparatus - Google Patents

Date storage method and relevant apparatus
Download PDF

Info

Publication number
CN109783494A
CN109783494ACN201811645304.8ACN201811645304ACN109783494ACN 109783494 ACN109783494 ACN 109783494ACN 201811645304 ACN201811645304 ACN 201811645304ACN 109783494 ACN109783494 ACN 109783494A
Authority
CN
China
Prior art keywords
data
database
target
sub
storage
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.)
Pending
Application number
CN201811645304.8A
Other languages
Chinese (zh)
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.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co LtdfiledCriticalShenzhen Intellifusion Technologies Co Ltd
Priority to CN201811645304.8ApriorityCriticalpatent/CN109783494A/en
Publication of CN109783494ApublicationCriticalpatent/CN109783494A/en
Pendinglegal-statusCriticalCurrent

Links

Landscapes

Abstract

Translated fromChinese

本申请公开了一种数据存储方法及相关装置,应用于云服务器,该方法包括:确定待存储的目标数据的数据量和确定数据库集群中的M个第一数据库当前总的第一剩余存储容量,M个第一数据库为事先设定允许存储目标类型的数据的数据库,目标类型包括目标数据的类型;在确定数据库集群中的M个第一数据库总共的第一剩余存储容量小于目标数据的数据量时,确定N个第二数据库,N个第二数据库为事先设定允许存储目标类型的数据的备用数据库,M和N均正整数;将目标数据存入M个第一数据库和N个第二数据库。采用本申请实施例可提高数据存储的空间。

The present application discloses a data storage method and a related device, which are applied to a cloud server. The method includes: determining the data volume of target data to be stored and determining the current total first remaining storage capacity of M first databases in a database cluster , the M first databases are databases that are set in advance to allow data of the target type to be stored, and the target type includes the type of the target data; after determining that the total first remaining storage capacity of the M first databases in the database cluster is smaller than the data of the target data When the amount of data is determined, N second databases are determined, and the N second databases are standby databases set in advance to allow the storage of target type data, and M and N are both positive integers; the target data is stored in the M first databases and the N Second database. By adopting the embodiments of the present application, the data storage space can be improved.

Description

Date storage method and relevant apparatus
Technical field
This application involves electronic technology field more particularly to a kind of date storage methods and relevant apparatus.
Background technique
With the development of communication technology, we enter the big data era of data explosion, the data that information exchange generatesIt measures more and more huger.Currently, common data storage method is the data for needing to store to be stored in local terminal, and local is eventuallyThe capacity of end data storage is limited.Although the memory capacity of the terminals such as mobile phone, computer is still pursued in constantly dilatationThe not upper increased speed of data.Therefore, how to store so huge data is problem to be solved.
Summary of the invention
The embodiment of the present application provides a kind of date storage method and relevant apparatus, for improving the space of data storage.
In a first aspect, the embodiment of the present application provides a kind of date storage method, it is applied to Cloud Server, data-storage systemAllowing the storage equipment accessed including the Cloud Server and the Cloud Server, the storage equipment includes data-base cluster,This method comprises:
It determines the data volume of target data to be stored and determines that M first database in the data-base cluster is currentThe first total residual storage capacity, the M first database are that the data for the data for allowing to store target type are previously setLibrary, the target type include the type of the target data;
Determining the first residual storage capacity of M first database in the data-base cluster in total less than the meshWhen marking the data volume of data, determine that N number of second database, N number of second database are to be previously set to allow to store the meshMark the standby database of the data of type, the M and the equal positive integer of the N;
The target data is stored in the M first database and N number of second database.
Second aspect, the embodiment of the present application provide a kind of data storage device, are applied to Cloud Server, data-storage systemAllowing the storage equipment accessed including the Cloud Server and the Cloud Server, the storage equipment includes data-base cluster,Described device includes determination unit and storage unit, in which:
The determination unit, for determining the data volume of target data to be stored and determining in the data-base clusterCurrent the first total residual storage capacity of M first database, the M first database are to be previously set to allow to store targetThe database of the data of type, the target type include the type of the target data;In determining the data-base clusterM first database the first residual storage capacity in total when being less than the data volume of the target data, determine N number of second numberAccording to library, N number of second database is the standby database that the data for allowing to store the target type are previously set, the MWith the equal positive integer of the N;
The storage unit, for the target data to be stored in the M first database and N number of second dataLibrary.
The third aspect, the embodiment of the present application provide a kind of Cloud Server, including processor, memory, communication interface, andOne or more programs, one or more of programs are stored in the memory, and are configured by the processorIt executes, described program is included the steps that for executing the instruction in the method according to claim 1 to 5.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, wherein above-mentioned computer-readableStorage medium is for storing computer program, wherein above-mentioned computer program is executed by processor, to realize that the application such as is implementedStep some or all of described in method described in example first aspect.
5th aspect, the embodiment of the present application provide a kind of computer program product, wherein above-mentioned computer program productNon-transient computer readable storage medium including storing computer program, above-mentioned computer program are operable to make to calculateStep some or all of described in method of the machine execution as described in the embodiment of the present application first aspect.The computer program producesProduct can be a software installation packet.
As can be seen that in the embodiment of the present application, target data to be stored being stored in cloud database, can be solvedThe certainly problem of local storage space deficiency, meanwhile, it is greater than in the data volume for determining target data to be stored and permission is previously setWhen storing current total first residual storage capacity of M first database of target data, determining to be previously set allows storage meshTarget data is stored in M first database and N number of second database, further by N number of the second spare database for marking dataExpanding data memory space.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show belowThere is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only thisSome embodiments of application for those of ordinary skill in the art without creative efforts, can be withIt obtains other drawings based on these drawings.
Fig. 1 is a kind of structural schematic diagram of data-storage system provided by the embodiments of the present application;
Fig. 2 is a kind of flow diagram of date storage method provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another date storage method provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of Cloud Server provided by the embodiments of the present application;
Fig. 5 is a kind of data storage device provided by the embodiments of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present applicationAttached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is onlyThe embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill peopleMember's every other embodiment obtained without making creative work, all should belong to the model of the application protectionIt encloses.
It is described in detail separately below.
The description and claims of this application and term " first ", " second ", " third " and " in the attached drawingFour " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and itAny deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, beSystem, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or listMember, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodimentsIt is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identicalEmbodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly andImplicitly understand, embodiment described herein can be combined with other embodiments.
Referring to Fig. 1, Fig. 1 is that the embodiment of the present application provides a kind of structural schematic diagram of data-storage system, in this ShenPlease be in embodiment, which includes: the storage equipment that Cloud Server and the Cloud Server allow to access, which setsStandby includes data-base cluster and application program cluster.
Cloud Server (Elastic Compute Service, ECS) is that one kind is simple and efficient, processing capacity can elasticity stretchThe calculating service of contracting.More stable, the safe application of energy rapid build, promotes O&M efficiency, reduces IT cost.It is in one group of collectionThe part of the multiple similar unique host come is marked off on group's server.Every server in cluster has one of cloud hostMirror back-up.When wherein a machine breaks down, system can access the backup on other machines automatically, to ensure numberAccording to safety and stablization.It has the independent operating system of independent IP., memory, bandwidth etc., in function as serverWith in application method also with server striking resemblances.
Data-base cluster refers to using at least one database server, constitutes a virtual centralized database logic and reflectsPicture provides transparent data service as single database system.
Application program cluster is at least one application program, it is opened to complete a certain or a few particular taskHair runs on the computer program on operating system, and the application program in application program cluster in the application can be taken by cloudDevice calling be engaged in manage the database in the data-base cluster.
The working principle of the data-storage system of the embodiment of the present application are as follows: Cloud Server determines target data to be storedData volume;Cloud Server determines current the first total residual storage capacity of M first database in data-base cluster;In determinationWhen the first residual storage capacity of M first database in total in data-base cluster is less than the data volume of target data, cloud clothesBusiness device determines N number of second database;Target data is stored in M first database and N number of second database by Cloud Server.UsingThe space of data storage can be improved in the embodiment of the present application.
It describes in detail below to the embodiment of the present application.
Referring to Fig. 2, Fig. 2 is that the embodiment of the present application provides a kind of flow diagram of date storage method, it is applied toCloud Server, data-storage system includes the storage equipment that the Cloud Server and the Cloud Server allow to access, described to depositStoring up equipment includes data-base cluster, which includes:
Step 201: determining the data volume of target data to be stored.
Wherein, data volume refers to the size of the target data, the unit of data volume for example can be B, KB, MB, GB,TB, B refer to byte (byte).
Further, before the data volume for determining target data to be stored, the method also includes: receive storage instituteThe store instruction of target data is stated, the store instruction carries the network association of the target data communicated with the Cloud ServerDiscuss information;The network port is created based on the store instruction;The target data is received by the network port.
Wherein, network communication protocol is a kind of network all-purpose language, for connection different operating system and different hardware systemThe internet of structure draws offer communication and supports, is a kind of network all-purpose language.Such as common network communication protocol has super textThis transport protocol (Hypertext Transfer Protocol, HTTP), security socket layer hypertext transfer protocol (HyperText Transfer Protocol over Secure Socket Layer, HTTPS), File Transfer Protocol (FileTransfer Protocol, FTP), Simple Mail Transfer protocol (Simple Mail Transfer Protocol, SMTP),Post Office Protocol,Version 3 (Post Office Protocol-Version 3, POP3), Mail Access Protocol (Internet MailAccess Protocol, IMAP), etc..
Wherein, the network port refers to the outlet of Cloud Server and extraneous Communication, and different network communication protocols is correspondingDifferent network of network ports.
Step 202: determine current the first total residual storage capacity of M first database in the data-base cluster,The M first database is the database that the data for allowing to store target type are previously set, and the target type includes instituteState the type of target data.
Further, current the first total remaining storage appearance of M first database in the data-base cluster is being determinedBefore amount, the method also includes: the type of the target data, the target data are determined based on the network communication protocolType comprise at least one of the following: HTTP type, HTTPS type, FTP type, SMTP type, POP3 type, IMAP type;Type based on the target data distributes M first database.
Step 203: determining that the first residual storage capacity of M first database in the data-base cluster in total is smallWhen the data volume of the target data, determine that N number of second database, N number of second database are to be previously set to allow to depositStore up the standby database of the data of the target type, the M and the equal positive integer of the N.
Specifically, a specific implementation of N number of second database of the determination are as follows: determine N number of based on the first formulaTwo databases, first formula are as follows: A+B >=C, wherein the A is that current the first total residue of the M first database is depositedCapacity is stored up, the B is current the second total residual storage capacity of N number of second database, and the C is the mesh to be storedMark the data volume of data.
Step 204: the target data is stored in the M first database and N number of second database.
It should be noted that step 201 and step 202 may be performed simultaneously;Step 201 can also be first carried out, then is executedStep 202;Step 202 can also be first carried out, then executes step 201;Herein with no restrictions.
As can be seen that in the embodiment of the present application, target data to be stored being stored in cloud database, can be solvedThe certainly problem of local storage space deficiency, meanwhile, it is greater than in the data volume for determining target data to be stored and permission is previously setWhen storing current total first residual storage capacity of M first database of target data, determining to be previously set allows storage meshTarget data is stored in M first database and N number of second database, further by N number of the second spare database for marking dataExpanding data memory space.
In the implementation of the application, the storage equipment further includes application program cluster, and the Cloud Server is logicalIt crosses and calls application program in the application program cluster to manage the database in the data-base cluster, determining that needs depositBefore the data volume of the target data of storage, the method also includes:
Pass through the health status of application program cluster and the data-base cluster described in probe in detecting;
Determine that the health status of the application program cluster and the data-base cluster is good.
Further, in the first case, the health status of the application program cluster and the data-base cluster is determinedGood, first situation includes: that the network port exists and can respond, memory source is sufficient, handle count is unique and one is a pair ofIt answers.
Wherein, the network port in front it is stated that be no longer described in detail herein.
Wherein, memory source is one of the important indicator for measuring Cloud Server computing capability.Own in application program clusterThe operation of application program all carry out in memory, therefore influence of the performance of memory to computer is very big.
Wherein, handle count is that Windows is used to identify by the unique integral for the object that application program is established or is used,Windows identifies such as Application Instance, window, control, bitmap, graphical device interface using various handles(Graphics Device Interface, GDI) object etc..
Further, the health status by application program cluster described in probe in detecting and the data-base cluster itAfterwards, the method also includes:
It determines that the health status of the application program cluster and/or the data-base cluster is not good, then restarts described answerWith program cluster and the data-base cluster.
As can be seen that in the embodiment of the present application, before determining the data volume for needing the target data stored, first corresponding toCarry out the detection of health status with program cluster and data library cluster, determine data storage be well in health status under intoRow, can prevent loss of data.
In the implementation of the application, each first database and corresponding one first volume of each second databaseNumber, it is described that the target data is stored in the M first database and N number of second database, comprising:
The target data is divided into P sub- target datas, corresponding one second number of each sub-goal data, the PFor the integer greater than 1;
Number mapping relations are established, the number mapping relations are for establishing (M+N) a first number and P second numberMapping relations, in the number mapping relations, at least one corresponding second number of each first number;
The P sub- target data correspondences are stored into its corresponding database based on the number mapping relations.
Specifically, the specific implementation that the target data is divided into P sub- target datas are as follows: described in determiningThe memory capacity of M first database and N number of the smallest database of second database residual storage capacity, by the targetData are divided into P sub- target datas, the data volume of each sub-goal data and the M first database and described N number of secondThe memory capacity of the smallest database of database residual storage capacity is equal.
It illustrates, it is assumed that M first database and N number of the smallest database of second database residual storage capacity are depositedStorage capacity is a, and the data volume of target data to be stored is b, then target data is divided into P sub- target datas, each specific itemThe data volume for marking data is a, wherein P=b/a.
Specifically, another specific implementation that the target data is divided into P sub- target datas are as follows: determine instituteThe residual storage capacity of each database in M first database and N number of second database is stated, based on the M theThe target data is divided into P by the residual storage capacity of each database in one database and N number of second databaseSub-goal data, the data volume of each sub-goal data respectively correspond the M first database and N number of second dataThe residual storage capacity of a database in library.
It illustrates, it is assumed that the residual storage capacity of first database in M first database and N number of second databaseFor a, the residual storage capacity of second database is b, and the residual storage capacity of third database is c ... ..., the P numberResidual storage capacity according to library is p, and the data volume of target data to be stored is x, then target data is divided into P sub- number of targetsAccording to the data volume of first sub- target data is a, and the data volume of first sub- target data is b, the sub- target data of thirdData volume is c, and the data volume of first sub- target data is p, wherein x=a+b+c ...+p.
It should be noted that the target data is divided into the implementation of P sub- target datas in addition to theory exemplified aboveExcept bright two kinds, can also there is other implementations, for example, etc. the realization side that is divided than the implementation of division, equal differenceFormula, no longer citing is described in detail herein.
For example, at least one corresponding second number of each first number, it is assumed that there are 1 first database, 2 theTwo databases, the first number of first database are A, and the first number of the second database is B and C, by the target data pointAt 5 sub- target datas, 5 sub- target datas are respectively D1, D2, D3, D4 and D5, then at least one database can store toA few sub- target data.Table 1 is the number mapping relations citing of the first number of one kind and the second number.
Table 1
As can be seen that in the embodiment of the present application, by target data piecemeal, being stored, capable of being dropped based on number mapping relationsThe risk that low target data are integrally all lost, while improving the speed of data storage.
In the implementation of the application, in the number mapping relations, the corresponding first number j of the second number i, instituteStating the first number j is to determine that the cryptographic Hash h is that the second number i is corresponding by default hash function and cryptographic Hash hThe cryptographic Hash of sub-goal data k, the second number i are one of them in the P second number, the first number jFor one of them in (M+N) a first number.
Wherein, default hash function can be j=h% (M+N), and wherein % is complementation, and the j is the h divided by (M+N)Remainder.Default hash function can also have other forms, we are without limitation herein.
Further, before establishing number mapping relations, the method also includes: based on a sub- target data of the PMajor key determines the cryptographic Hash h of the P sub- target datas.
Wherein, major key is one or more fields of sub-goal data, its value is for uniquely identifying the sub-goal numberAccording to.The major key can be the second number i, or the field of sub-goal data described in other energy unique identifications, herein notIt limits.
As can be seen that in the embodiment of the present application, target data is stored the energy into multiple databases based on hash functionThe risk that target data is integrally all lost enough is reduced, while improving the speed of data storage.
It is described that the target data is stored in the M first database and the N in the implementation of the applicationAfter a second database, the method also includes:
Determine that the default backup number Q of the target data, the Q are positive integer;
Determine the second residual storage capacity of the M first database and N number of second database currently in total;
If second residual storage capacity is greater than or equal to Q times of the target data amount, by the P sub-goalQ*P backup sub-goal data of data are stored to the M first database and N number of second database, each backupThe database of sub-goal data storage is different from the database of its corresponding sub-goal data storage, and each sub-goal data are correspondingQ backup sub-goal data storage database it is different.
Wherein, presetting equipment score Q can be 1,2,3 or other values, be not limited thereto.
It illustrating, it is assumed that the first number there are 1 first database, 2 the second databases, first database is A,First number of the second database is B and C, and presetting backup number is 2, and the target data is divided into 5 sub- target datas, specific itemMark data are respectively D10, D20, D30, D40 and D50, and the sub-goal data stored in A are D10 and D40, the specific item stored in BMark data are D20 and D50, and the sub-goal data stored in C are D30, and 10 backup sub-goal data of the backup number areD11, D12, D21, D22, D31, D32, D41, D42, D51, D52 cannot store D10 by taking sub-goal data D10 as an example again in ABackup sub-goal number D11 and D12, while D11 and D12 can not be stored in same database, and as shown in table 2, table 2 is oneThe number mapping table of kind the first number and the second number.
Table 2
First numberSecond number
AD10、D40、D21、D51、D32
BD20、D50、D31、D12、D42
CD30、D11、D41、D22、D52
Further, the second residue of the M first database and N number of second database currently in total is being determinedAfter memory capacity, the method also includes:
If second residual storage capacity is greater than or equal to Q times of the target data amount, it is determined that K third dataLibrary, the K third database are the standby database that the data for allowing to store the target type are previously set, and the K isPositive integer;
Q*P backup sub-goal data of the P sub- target datas are stored to the M first database, the NA second database and the K third database, it is corresponding that the database of each backup sub-goal data storage is different from itsThe database of sub-goal data storage, the database that the corresponding Q backup sub-goal data of each sub-goal data store is mutually notIt is identical.
As can be seen that in the embodiment of the present application, target data is made a backup store at most a database, Mei GebeiThe database of one's share of expenses for a joint undertaking target data storage is different from the database of its corresponding sub-goal data storage, each sub-goal data pairThe database for the backup sub-goal data storage answered is different, and can reduce database causes to count because of certain reason delay machinesAccording to the risk of loss.
Referring to Fig. 3, Fig. 3 is a kind of flow diagram of date storage method provided by the embodiments of the present application, it is applied toCloud Server, data-storage system includes the storage equipment that the Cloud Server and the Cloud Server allow to access, described to depositStorage equipment includes data-base cluster and application program cluster, and the Cloud Server is by calling answering in the application program clusterThe database in the data-base cluster is managed with program, which includes:
Step 301: passing through the health status of application program cluster and the data-base cluster described in probe in detecting.
Step 302: determining whether the health status of the application program cluster and the data-base cluster is good.
If it is not, thening follow the steps 303;
If so, thening follow the steps 304.
Step 303: restarting the application program cluster and the data-base cluster.
Step 304: determining the data volume of target data to be stored.
Step 305: determine current the first total residual storage capacity of M first database in the data-base cluster,The M first database is the database that the data for allowing to store target type are previously set, and the target type includes instituteState the type of target data.
Step 306: determining that the first residual storage capacity of M first database in the data-base cluster in total is smallWhen the data volume of the target data, determine that N number of second database, N number of second database are to be previously set to allow to depositStore up the standby database of the data of the target type, the M and the equal positive integer of the N.
Step 307: the target data is divided into P sub- target datas, each first database and each second dataCorresponding one first number in library, corresponding one second number of each sub-goal data, the P is the integer greater than 1.
Step 308: establishing number mapping relations, the number mapping relations are for establishing (M+N) a first number and PThe mapping relations of second number, in the number mapping relations, at least one corresponding second number of each first number.
Step 309: being stored the P sub- target data correspondences to its corresponding data based on the number mapping relationsIn library.
Step 310: determining that the default backup number Q of the target data, the Q are positive integer;
Step 311: determining that the second residue of the M first database and N number of second database currently in total is depositedStore up capacity.
Step 312: if second residual storage capacity is greater than or equal to Q times of the target data amount, by the PQ*P backup sub-goal data of a sub- target data are stored to the M first database and N number of second database,The database of each backup sub-goal data storage is different from the database of its corresponding sub-goal data storage, each sub-goalThe database of the corresponding Q backup sub-goal data storage of data is different.
It should be noted that the specific implementation process of the present embodiment can be found in specific implementation described in above method embodimentProcess no longer describes herein.
It is consistent with above-mentioned Fig. 2 and embodiment shown in Fig. 3, referring to Fig. 4, Fig. 4 is provided by the embodiments of the present application oneThe structural schematic diagram of kind Cloud Server, as shown in figure 4, the Cloud Server includes central processor CPU, graphics processor GPU, depositsReservoir, communication interface and one or more programs, wherein said one or multiple programs are stored in above-mentioned memory,And it is configured to be executed by above-mentioned CPU, above procedure includes the instruction for executing following steps:
It determines the data volume of target data to be stored and determines that M first database in the data-base cluster is currentThe first total residual storage capacity, the M first database are that the data for the data for allowing to store target type are previously setLibrary, the target type include the type of the target data;
Determining the first residual storage capacity of M first database in the data-base cluster in total less than the meshWhen marking the data volume of data, determine that N number of second database, N number of second database are to be previously set to allow to store the meshMark the standby database of the data of type, the M and the equal positive integer of the N;
The target data is stored in the M first database and N number of second database.
As can be seen that in the embodiment of the present application, target data to be stored being stored in cloud database, can be solvedThe certainly problem of local storage space deficiency, meanwhile, it is greater than in the data volume for determining target data to be stored and permission is previously setWhen storing current total first residual storage capacity of M first database of target data, determining to be previously set allows storage meshTarget data is stored in M first database and N number of second database, further by N number of the second spare database for marking dataExpanding data memory space.
In the implementation of the application, the storage equipment further includes application program cluster, and the Cloud Server is logicalIt crosses and calls application program in the application program cluster to manage the database in the data-base cluster, it is described determining to needBefore the data volume of the target data of storage, above procedure includes the instruction for being also used to execute following steps:
Pass through the health status of application program cluster and the data-base cluster described in probe in detecting;
Determine that the health status of the application program cluster and the data-base cluster is good.
In the implementation of the application, each first database and corresponding one first volume of each second databaseNumber, in terms of the target data is stored in the M first database and N number of second database, above procedure includesSpecifically for executing the instruction of following steps:
The target data is divided into P sub- target datas, corresponding one second number of each sub-goal data, the PFor the integer greater than 1;
Number mapping relations are established, the number mapping relations are for establishing (M+N) a first number and P second numberMapping relations, in the number mapping relations, at least one corresponding second number of each first number;
The P sub- target data correspondences are stored into its corresponding database based on the number mapping relations.
In the implementation of the application, in the number mapping relations, the corresponding first number j of the second number i, instituteStating the first number j is to determine that the cryptographic Hash h is that the second number i is corresponding by default hash function and cryptographic Hash hThe cryptographic Hash of sub-goal data k, the second number i are one of them in the P second number, the first number jFor one of them in (M+N) a first number.
In the implementation of the application, the target data is being stored in the M first database and described N number ofAfter second database, above procedure includes the instruction for being also used to execute following steps:
Determine that the default backup number Q of the target data, the Q are positive integer;
Determine the second residual storage capacity of the M first database and N number of second database currently in total;
If second residual storage capacity is greater than or equal to Q times of the target data amount, by the P sub-goalQ*P backup sub-goal data of data are stored to the M first database and N number of second database, each backupThe database of sub-goal data storage is different from the database of its corresponding sub-goal data storage, and each sub-goal data are correspondingQ backup sub-goal data storage database it is different.
It should be noted that the specific implementation process of the present embodiment can be found in specific implementation described in above method embodimentProcess no longer describes herein.
The embodiment of the present application can carry out the division of functional unit according to the method example to Cloud Server, for example, canWith each functional unit of each function division of correspondence, two or more functions can also be integrated in a processing unitIn.The integrated unit both can take the form of hardware realization, can also realize in the form of software functional units.It needsIt is noted that be schematical, only a kind of logical function partition to the division of unit in the embodiment of the present application, it is practical realIt is current that there may be another division manner.
It is below the application Installation practice, the application Installation practice is realized for executing the application embodiment of the methodMethod.Referring to Fig. 5, Fig. 5 is a kind of data storage device provided by the embodiments of the present application, which is characterized in that be applied to cloudServer, data-storage system include the storage equipment that the Cloud Server and the Cloud Server allow to access, the storageEquipment includes data-base cluster, and described device includes determination unit 501 and storage unit 502, in which:
The determination unit 501, for determining the data volume of target data to be stored and determining in the data-base clusterCurrent the first total residual storage capacity of M first database, the M first database is to be previously set to allow storage meshThe database of the data of type is marked, the target type includes the type of the target data;Determining the data-base clusterIn M first database the first residual storage capacity in total when being less than the data volume of the target data, determine N number of secondDatabase, N number of second database is the standby database that the data for allowing to store the target type are previously set, describedM and the equal positive integer of the N;
The storage unit 502, for the target data to be stored in the M first database and N number of second numberAccording to library.
As can be seen that in the embodiment of the present application, target data to be stored being stored in cloud database, can be solvedThe certainly problem of local storage space deficiency, meanwhile, it is greater than in the data volume for determining target data to be stored and permission is previously setWhen storing current total first residual storage capacity of M first database of target data, determining to be previously set allows storage meshTarget data is stored in M first database and N number of second database, further by N number of the second spare database for marking dataExpanding data memory space.
In the implementation of the application, the storage equipment further includes application program cluster, and the Cloud Server is logicalIt crosses and calls application program in the application program cluster to manage the database in the data-base cluster, determining that needs depositBefore the data volume of the target data of storage, described device further includes detection unit 503, in which:
Detection unit 503, for the healthy shape by application program cluster and the data-base cluster described in probe in detectingState;
Determination unit 501 is also used to determine that the health status of the application program cluster and the data-base cluster is goodIt is good.
In the implementation of the application, each first database and corresponding one first volume of each second databaseNumber, described that the target data is stored in the M first database and N number of second database aspect, the storage is singleMember 502 includes segmentation module, creation module and memory module, in which:
The segmentation module, for the target data to be divided into P sub- target datas, each sub-goal data are one correspondingSecond number, the P are the integer greater than 1;
The creation module, for establishing number mapping relations, the number mapping relations are compiled for establishing (M+N) a firstMapping relations number with the second number of P, in the number mapping relations, at least one corresponding second volume of each first numberNumber;
The memory module is right to its for being stored the P sub- target datas correspondences based on the number mapping relationsIn the database answered.
In the implementation of the application, in the number mapping relations, the corresponding first number j of the second number i, instituteStating the first number j is to determine that the cryptographic Hash h is that the second number i is corresponding by default hash function and cryptographic Hash hThe cryptographic Hash of sub-goal data k, the second number i are one of them in the P second number, the first number jFor one of them in (M+N) a first number.
In the implementation of the application, the target data is being stored in the M first database and described N number ofAfter second database, which is also used to determine the default backup number Q of the target data, and the Q is positive wholeNumber;Determine the second residual storage capacity of the M first database and N number of second database currently in total;
The storage unit 502, if being also used to the target data that second residual storage capacity is greater than or equal to Q timesAmount then stores Q*P backup sub-goal data of the P sub- target datas to the M first database and described N number ofSecond database, the database of each backup sub-goal data storage are different from the data of its corresponding sub-goal data storageThe database in library, the corresponding Q backup sub-goal data storage of each sub-goal data is different.
It should be noted that determination unit 501 and detection unit 503 can realize that storage unit 502 can lead to by processorCross memory realization.
The embodiment of the present application also provides a kind of computer storage medium, wherein computer storage medium storage is for electricityThe computer program of subdata exchange, the computer program make computer execute any as recorded in above method embodimentSome or all of method step.
The embodiment of the present application also provides a kind of computer program product, and above-mentioned computer program product includes storing calculatingThe non-transient computer readable storage medium of machine program, above-mentioned computer program are operable to that computer is made to execute such as above-mentioned sideSome or all of either record method step in method embodiment.The computer program product can be a software installationPacket.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series ofCombination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence becauseAccording to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also knowIt knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the applicationIt is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodimentPoint, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another wayIt realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of said units, it is only a kind ofLogical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or canTo be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutualCoupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,It can be electrical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multipleIn network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent productWhen, it can store in a computer-readable access to memory.According to such understanding, the technical solution of the application substantially orPerson says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software productsReveal and, which is stored in a memory, including some instructions are used so that a computer equipment(can be personal computer, server or network equipment etc.) executes all or part of each embodiment above method of the applicationStep.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memoryThe various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is canIt is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memoryMay include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English:Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application andEmbodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas;At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the applicationThere is change place, in conclusion the contents of this specification should not be construed as limiting the present application.

Claims (10)

CN201811645304.8A2018-12-292018-12-29Date storage method and relevant apparatusPendingCN109783494A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201811645304.8ACN109783494A (en)2018-12-292018-12-29Date storage method and relevant apparatus

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201811645304.8ACN109783494A (en)2018-12-292018-12-29Date storage method and relevant apparatus

Publications (1)

Publication NumberPublication Date
CN109783494Atrue CN109783494A (en)2019-05-21

Family

ID=66499621

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201811645304.8APendingCN109783494A (en)2018-12-292018-12-29Date storage method and relevant apparatus

Country Status (1)

CountryLink
CN (1)CN109783494A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110879764A (en)*2019-11-142020-03-13浪潮(北京)电子信息产业有限公司Bitmap setting method, device and equipment and readable storage medium
CN112512084A (en)*2019-09-162021-03-16中磊电子股份有限公司Base station and data transmission adjusting method
CN112527559A (en)*2020-12-092021-03-19广州技象科技有限公司Internet of things data backup method and device
CN116186078A (en)*2023-03-152023-05-30中国华能集团有限公司北京招标分公司Data retrieval method and system
CN118466863A (en)*2024-07-122024-08-09之江实验室 Data storage method, device, storage medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103914522A (en)*2014-03-202014-07-09电子科技大学Data block merging method applied to deleting duplicated data in cloud storage
US8856483B1 (en)*2010-09-212014-10-07Amazon Technologies, Inc.Virtual data storage service with sparse provisioning
CN106708428A (en)*2016-11-212017-05-24平安科技(深圳)有限公司Data virtual storage method and apparatus
CN108667917A (en)*2018-04-242018-10-16厦门集微科技有限公司A kind of method, apparatus, computer storage media and terminal for realizing data storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8856483B1 (en)*2010-09-212014-10-07Amazon Technologies, Inc.Virtual data storage service with sparse provisioning
CN103914522A (en)*2014-03-202014-07-09电子科技大学Data block merging method applied to deleting duplicated data in cloud storage
CN106708428A (en)*2016-11-212017-05-24平安科技(深圳)有限公司Data virtual storage method and apparatus
CN108667917A (en)*2018-04-242018-10-16厦门集微科技有限公司A kind of method, apparatus, computer storage media and terminal for realizing data storage

Cited By (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112512084A (en)*2019-09-162021-03-16中磊电子股份有限公司Base station and data transmission adjusting method
CN110879764A (en)*2019-11-142020-03-13浪潮(北京)电子信息产业有限公司Bitmap setting method, device and equipment and readable storage medium
CN110879764B (en)*2019-11-142022-04-22浪潮(北京)电子信息产业有限公司 A bitmap setting method, apparatus, device and readable storage medium
CN112527559A (en)*2020-12-092021-03-19广州技象科技有限公司Internet of things data backup method and device
CN112527559B (en)*2020-12-092021-10-08广州技象科技有限公司Internet of things data backup method and device
CN116186078A (en)*2023-03-152023-05-30中国华能集团有限公司北京招标分公司Data retrieval method and system
CN118466863A (en)*2024-07-122024-08-09之江实验室 Data storage method, device, storage medium and electronic device
CN118466863B (en)*2024-07-122024-10-01之江实验室Data storage method and device, storage medium and electronic equipment

Similar Documents

PublicationPublication DateTitle
CN109783494A (en)Date storage method and relevant apparatus
CN112528850A (en)Human body recognition method, device, equipment and storage medium
CN112084366B (en)Method, apparatus, device and storage medium for retrieving image
CN110113200A (en)The correlating method of chain-circuit system and log system, device and storage medium
CN109299334B (en)Data processing method and device of knowledge graph
CN114201278B (en)Task processing method, task processing device, electronic equipment and storage medium
CN112860811B (en) Method, device, electronic device and storage medium for determining blood relationship of data
CN110069495A (en)Date storage method, device and terminal device
CN112784739B (en)Model training method, key point positioning method, device, equipment and medium
CN112633276A (en)Training method, recognition method, device, equipment and medium
CN109376743A (en)Image processing method, device, image recognition apparatus and storage medium
WO2021218063A1 (en)Method and apparatus for assigning parameter with value on the basis of name mapping, and computer device
CN112559631A (en)Data processing method and device of distributed graph database and electronic equipment
CN109088788A (en)Data processing method, device, equipment and computer readable storage medium
CN109522332A (en)Customer profile data merging method, device, equipment and readable storage medium storing program for executing
CN109739433A (en)The method and terminal device of data processing
CN112070487A (en)AI-based RPA process generation method, apparatus, device and medium
CN110781410A (en)Community detection method and device
CN109656898A (en)Distributed large-scale complex community detection method and device based on node degree
CN117195118A (en)Data anomaly detection method, device, equipment and medium
CN116860996A (en) Three-dimensional knowledge graph construction method, device, equipment and storage medium
CN115118466A (en)Strategy generation method and device, electronic equipment and storage medium
CN110309328A (en) Data storage method, device, electronic device and storage medium
CN107766487A (en)Loading method and system, service terminal, the memory of vector tile data
CN109271122A (en)A kind of document display method based on double-display screen, device and equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20190521

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp