Summary of the invention
The embodiment of the present invention provides a kind of date storage method for SAAS pattern and device, and overcome existing scheme and can not meet user to current business efficient operation, and problem that can not be to the convenient inquiry of historical data.
The embodiment of the present invention provides a kind of method of the building database for SAAS pattern, comprising:
Set up Production database, for backing up in realtime;
Set up historical data base, for storing history data, described historical data is: the data before a period of time starting from current time of appointment.
Preferably, the real time business data of described Production database specifically for producing in storing in current 1 year time;
Described historical data base is specifically for storing the data of (N-1) before of current time year.
Preferably, the Production database of described foundation and the historical data base of described foundation adopt same user account operation system to enter use.
Preferably, described method also comprises:
Be provided for the data transformation engine of multi-tenant data isolation, for described Production database and historical data base being belonged to different tenants' data, carry out isolated operation.
The embodiment of the present invention also provides a kind of date storage method for SAAS pattern, comprising:
By the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database;
Data by before a period of time starting from current time of described appointment, store in historical data base.
Preferably, described method also comprises:
When the query statement getting data, the time that the data of inquiry produce as required, enter in described Production database or historical data base and inquire about.
Preferably, described in get the query statement to data, the time that the data of inquiry produce as required, enter in described Production database or historical data base and inquire about, specifically comprise:
When the query statement getting data, the time that the data of inquiry produce as required, enter in described Production database or historical data base and inquire about, wherein said historical data base and described Production database adopt same user account operation system to enter use.
Preferably, described method also comprises:
Regularly the Data Migration in described Production database is entered to described historical data base.
Preferably, described method also comprises:
The data that many tenants are produced are divided into: tenant data, share data, and half share data, and respectively corresponding with tenant data table, share tables of data, half sharing table manages mode;
The described data that many tenants are produced are divided into: tenant data, share data, and half share data, and respectively corresponding with tenant data table, share tables of data, half sharing table manages mode, specifically comprise:
By the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database, and the tenant data in generating database, share data, and half shares data and have respectively different signs; Described different identification is for the data isolation between many tenants;
Described data before a period of time starting from current time of described appointment are stored in historical data base, specifically comprise:
Data by before a period of time starting from current time of described appointment, store in historical data base, and the tenant data in historical data base, share data, and half shared data have respectively different signs; Described different identification is for the data isolation between many tenants.
The embodiment of the present invention has also been carried a kind of storage data set, comprising: production data library unit, and historical data library unit,
Described production data library unit, for by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database;
Described historical data library unit, for by the data before a period of time starting from current time of described appointment, stores in historical data base.
Preferably, described device also comprises:
Query unit, for when getting the query statement to data, the time that the data of inquiry produce as required, enters in the described historical data base of described Production database or the same user account operation system of described Production database and inquires about.
Preferably, described device also comprises:
Migration data unit, for regularly entering described historical data base by the Data Migration of described Production database.
Preferably, described device also comprises:
Date Conversion Unit, is divided into for the data that many tenants are produced: tenant data, share data, and half share data, and respectively corresponding with tenant data table, share tables of data, half sharing table manages mode;
Described production data library unit, specifically for by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database, and the tenant data in generating database, share data, and half shared data has respectively different signs; Described different identification is for the data isolation between many tenants;
Described historical data library unit, specifically for by the data before a period of time starting from current time of described appointment, store in historical data base, and the tenant data in historical data base, share data, and half shared data has respectively different signs; Described different identification is for the data isolation between many tenants.
As can be seen from the above technical solutions, the method that the embodiment of the present invention provides, by setting up two databases, be Production database and historical data base, store respectively current real time data, and historical data, the situation that middle historical data can not separately be processed compared to existing technology, this programme has alleviated the burden of system greatly, has improved the speed that storage data are processed.
Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Embodiment mono-
The embodiment of the present invention provides a kind of method of the building database for SAAS pattern, and as shown in Figure 1, the method comprises:
Step 101, sets up Production database, for backing up in realtime.Wherein, to the SAAS data that produce in the near future, carry out real-time back-up storage in Production database, be convenient to current business to carry out the operations such as inquiry efficiently.Here said recent, be often referred to 1 year, but be not limited to 1 year, can arrange according to concrete application demand.
Wherein, it will be appreciated that the method for building database in this programme is for SAAS pattern, in SAAS pattern, data are all large data, wherein, large data (big data), or claim flood tide data, and refer to related data quantity huge to seeing through current main flow Software tool, reaching acquisition, management, processing within reasonable time, also arranging and become the information that helps the more positive object of enterprise management decision-making.
The scheme that the embodiment of the present invention provides, exactly for the large data of SAAS pattern and the technical scheme proposing.
Step 102, sets up historical data base, and for storing history data, described historical data is: the data before a period of time starting from current time of appointment.Wherein, said historical data can be understood as the data of non-recent generation, is often referred to data in the past of current time, if the current time is 2013, the data before the current time, refer to and comprise 2012 and data before, can think historical data.
Wherein, the real time data of the Production database of foundation specifically for producing in storing in current 1 year time, the historical data base of foundation is specifically for storing the data of (N-1) before of current time year; The amount of capacity of the Production database of setting up is N/mono-(that is: 1/N) of total volume, and the amount of capacity of the historical data base of foundation is the N of total volume/(N-1) (that is: (N-1)/N).
Preferably, on the above-mentioned basis of having set up Production database and historical data base, the method that the present embodiment provides can also comprise:
Step 103, is provided for the data transformation engine that multi-tenant data is isolated.This data transformation engine can be carried out isolated operation to belonging to different tenants' data in Production database and historical data base.To meet the safety and efficiency requirement of multi-tenant data management.
Wherein, the data transformation engine for multi-tenant data isolation arranging in step 103, can be specifically the KSQL data transformation engine of Kingdee.
This data transformation engine arranging in step 103, can many tenants' of storage data be divided and be identified, for example, the multi-tenant data of database is divided into: tenant data, share data, and half share data, respectively corresponding with: tenant data table, share tables of data, half sharing table manages mode, can be specifically:
For different tenant data tables, when database manipulation, different tenant data tables increase corresponding different identification, this sign specifically can: FDBID=#dbid# represents;
For different tenants' shared tables of data, when database manipulation, can not add sign, if do not added FDBID;
For different tenants' half sharing table, when database manipulation, the sign of data is shared in the expression half that can add setting, for example: add (FDBID=#dbid#OR FDBID=0) to represent.
By increasing above-mentioned steps 103, a plurality of tenants, share the pattern of a database, reduced greatly the use cost of database, overcome the problem of a plurality of tenant data service efficiencies and safety simultaneously.
Preferably, the Production database of foundation and the historical data base of foundation adopt same user account to enter.
The method of a kind of building database that the embodiment of the present invention one provides, set up two databases, be Production database and historical data base, store respectively current real time data, and historical data, the situation that middle historical data can not separately be processed compared to existing technology, this programme has alleviated the burden of system greatly, has improved the speed that storage data are processed.
Embodiment bis-
The embodiment of the present invention provides a kind of date storage method, this storage means is on the basis based on building database in above-described embodiment one, carries out data storage.As shown in Figure 2, the method comprises:
Step 201, by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database.
Wherein, said " a period of time starting from current time of appointment " can be the year starting from current time, can be also under current time within 1 year, (for example, the current time is 2013 years, a year under current time, just refers to the whole year in 2013); Also it can be other a period of time starting from current time.Arranging during this period of time can be oversize, proper with year, if the time is oversize, storage data volume is too huge, and impact is to the data manipulation speed of storing in database.
Step 202, the data by before a period of time starting from current time of above-mentioned appointment, store in historical data base.
Wherein, can think in embodiments of the present invention, the data of the generation before a period of time starting from current time of appointment, are historical datas, by history data store in historical data base.
The data of the storage in historical data base can be in nearly 10 years, and do not comprise the data in current time.Only the explanation of being convenient to understanding herein, the not restriction to the embodiment of the present invention, designer can be according to demand, and the time that the data that are stored in historical data base are belonged to is designed.
A kind of method of storing data that the embodiment of the present invention two provides, because the data that different time sections is produced store respectively two databases having set up into, be Production database and historical data base, store respectively current real time data, and historical data, the situation that middle historical data can not separately be processed compared to existing technology, this programme has alleviated the burden of system greatly, has improved the speed that storage data are processed.
Preferably, for the ease of user's inquiry, the method can also comprise:
Step 203, when the query statement getting data, the time that the data of inquiry produce as required, enters in described Production database or historical data base and inquires about.
Wherein, the time that the data of said inquiry as required produce, enter in described Production database or historical data base and inquire about, can be understood as:
The data that need inquiry, the time that has corresponding data to produce, the time producing with these data, can judge is data in Production database, or data in historical data base.Because in data and historical data base, data are also that the asynchronism(-nization) producing with data is divided in Production database.
Wherein, if all adopt same user account to enter in Production database and historical data base, above-mentioned steps 203 specifically can comprise:
When the query statement getting data, the time that the data of inquiry produce as required, enter in described Production database or historical data base and inquire about, wherein said historical data base and described Production database adopt same user account operation system to enter use.
By arranging in Production database and historical data base, all adopt same user account to enter, reduced the operation that user enters disparate databases, provide more excellent user to experience.
Preferably, because data in Production database are on the increase, be unfavorable for fast query, therefore, the method can also comprise:
Step 204, regularly enters historical data base by the Data Migration in Production database.
Participate in shown in Fig. 3, it is example that the present embodiment of take is specifically applied in SAAS system, owing to having set up respectively Production database and historical data base, production data library storage is by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment, historical data base store historical data, regularly by the Data Migration in Production database to historical data base, alleviate the burden of Production database, utilize Production database to carry out inquiry rapidly and efficiently.
A kind of date storage method illustrating by above-described embodiment two, owing to setting up two databases, be Production database and historical data base, store respectively current real time data, and historical data, reduced greatly the data volume of Production database, only preserve in principle enterprise's 1 annual data, the 1/N of data volume only have to(for) the system of operation N, efficiency and the service feature of being convenient to production data real-time synchronization carrying out safety backup promote, history library independently facilitate security maintenance and can be in SAAS system direct convenient enquiry of historical data (a set of up-to-date product of a SAAS system deployment maintenance).
Preferably, while storing for multi-tenant data, in order to guarantee the security between data, and follow-uply can inquire efficiently data, the method can also comprise:
Step 200, the data that many tenants are produced are divided into: tenant data, share data, and half share data, and respectively corresponding with tenant data table, share tables of data, half sharing table manages mode;
Above-mentioned steps 201, by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database, specifically can also comprise:
By the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database, and the tenant data in generating database, share data, and half shares data and have respectively different signs; Described different identification is for the data isolation between many tenants.
Above-mentioned steps 202, the data by before a period of time starting from current time of above-mentioned appointment, store in historical data base, specifically comprise:
Data by before a period of time starting from current time of above-mentioned appointment, store in historical data base, and the tenant data in historical data base, share data, and half shared data have respectively different signs; Described different identification is for the data isolation between many tenants.
Embodiment tri-
The embodiment of the present invention provides a kind of data storage device, and as shown in Figure 4, this device comprises: production data library unit 401, and historical data library unit 402,
Production data library unit 401, for by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database;
Wherein, said " a period of time starting from current time of appointment " can be the year starting from current time, can be also under current time within 1 year, (for example, the current time is 2013 years, a year under current time, just refers to the whole year in 2013); Also it can be other a period of time starting from current time.Arranging during this period of time can be oversize, proper with year, if the time is oversize, storage data volume is too huge, and impact is to the data manipulation speed of storing in database.
Historical data library unit 402, for by the data before a period of time starting from current time of described appointment, stores in historical data base.
Wherein, can think in embodiments of the present invention, the data of the generation before a period of time starting from current time of appointment, are historical datas, by history data store in historical data base.
The data of the storage in historical data library unit can be in nearly 10 years, and do not comprise the data in current time.Only the explanation of being convenient to understanding herein, the not restriction to the embodiment of the present invention, designer can be according to demand, and the time that the data that are stored in historical data base are belonged to is designed.
A kind of device of storing data that the embodiment of the present invention three provides, because the data that different time sections is produced store respectively two databases having set up into, be Production database and historical data base, store respectively current real time data, and historical data, the situation that middle historical data can not separately be processed compared to existing technology, this programme has alleviated the burden of system greatly, has improved the speed that storage data are processed.
Preferably, for the ease of user's inquiry, this device can also comprise: query unit 403,
Query unit 403, for when getting the query statement to data, the time that the data of inquiry produce as required, enters in the described historical data base of described Production database or the same user account operation system of described Production database and inquires about.
By arranging in Production database and historical data base, all adopt same user account to enter, reduced the operation that user enters disparate databases, provide more excellent user to experience.
Preferably, because data in production data library unit are on the increase, be unfavorable for fast query, therefore, this device can also comprise: migration data unit 404,
Migration data unit 404, for regularly entering described historical data base by the Data Migration of described Production database.
A kind of data storage device illustrating by above-described embodiment three, owing to setting up two databases, be Production database and historical data base, store respectively current real time data, and historical data, reduced greatly the data volume of Production database, only preserve in principle enterprise's 1 annual data, the 1/N of data volume only have to(for) the system of operation N, efficiency and the service feature of being convenient to production data real-time synchronization carrying out safety backup promote, history library independently facilitate security maintenance and can be in SAAS system direct convenient enquiry of historical data (a set of up-to-date product of a SAAS system deployment maintenance).
Preferably, this data storage device, also comprises: Date Conversion Unit 400, for the data that many tenants are produced, be divided into: tenant data, share data, and half share data, and respectively corresponding with tenant data table, share tables of data, half sharing table manages mode;
Described production data library unit 401, specifically for by the data that produce in real time, and the data that produce in a period of time starting from current time of appointment are stored in Production database, and the tenant data in generating database, share data, and half shared data has respectively different signs; Described different identification is for the data isolation between many tenants;
With historical data library unit 402, specifically for by the data before a period of time starting from current time of above-mentioned appointment, store in historical data base, and the tenant data in historical data base, share data, and half shared data has respectively different signs; Described different identification is for the data isolation between many tenants.
One of ordinary skill in the art will appreciate that all or part of step realizing in above-described embodiment method is to come the hardware that instruction is relevant to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
Above a kind of date storage method provided by the present invention and device are described in detail, for one of ordinary skill in the art, thought according to the embodiment of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.