CN106168960B - A kind of the adjustment device and its method of adjustment of data resource - Google Patents
A kind of the adjustment device and its method of adjustment of data resource Download PDFInfo
- Publication number
- CN106168960B CN106168960B CN201610506934.1A CN201610506934A CN106168960B CN 106168960 B CN106168960 B CN 106168960B CN 201610506934 A CN201610506934 A CN 201610506934A CN 106168960 B CN106168960 B CN 106168960B
- Authority
- CN
- China
- Prior art keywords
- data
- tables
- interim
- marker
- identifier
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/252—Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of adjustment device of operation data resource and its methods of adjustment, are related to mobile application back-end data resource management field.A kind of adjustment device of data resource, comprising: database module, data point reuse logging modle, condition setting module and data point reuse module, in which: database module, table, tables of data have the marker for mark data attribute for storing data;Data point reuse logging modle, the sorting position of the data and adjustment that need to adjust in the tables of data for recording the database module;Condition setting module, for the condition of trigger data adjustment to be arranged;Data point reuse module is adjusted for the data to database module tables of data.A kind of Adjusted Option of the data resource under big data quantity is proposed through the invention, it can solve big data quantity and lower the excessive problem of entire data resource system resource occupation, database processing ability is improved, guarantees the normal work of database, runs timely updating for result.
Description
Technical field
The present invention relates to mobile application back-end data resource management field more particularly to a kind of adjustment of operation data resource
Device and its method of adjustment.
Background technique
APP, service is needed to survey the project of API and background management system resource backstage, especially application shop etc., after
The operation sequence in Taiwan investment source occupies important position.But the data volume of usually this background system management is huge, if
Conventionally, by the data operation of the tenth myriabit originally to first, then needing 100,000 data of database processing;It is logical
Operation will not only once in normal situation, frequent operation modification, so that database data volume to be treated is multiplied, this
The burden of database can be aggravated significantly, and gently then response speed sharp fall, heavy then database directly collapse.It is prior, it answers
Data after needing timely to read operation with shop API.
So how to guarantee that application shop API runs the timeliness of result under big data quantity, and guarantee again simultaneously
The database of change operation works normally, and improves database processing ability, is a technical problem.
Summary of the invention
It is a primary object of the present invention to propose a kind of Adjusted Option of the data resource under big data quantity, it is intended to solve big
Adjust operation data resource under data volume, improve database processing ability, guarantee the normal work of database, run result and
Shi Gengxin.
To achieve the above object, a kind of adjustment device of data resource provided by the invention, described device include: database
Module, data point reuse logging modle, condition setting module and data point reuse module, in which:
The database module, table, the tables of data have the marker for mark data attribute for storing data;
The data point reuse logging modle, the data for needing to adjust in the tables of data for recording the database module and
The sorting position of adjustment;
The condition setting module, for the condition of trigger data adjustment to be arranged;
The data point reuse module, for when meeting the condition of trigger data adjustment of the condition setting module setting
The data of the database module tables of data are adjusted according to the data that the data point reuse logging modle records.
Further, the data table data includes operation data and non-operation data;The marker is used for mark data
Attribute, identifying the data with first identifier symbol respectively is non-operation data, and second identifier symbol is come to identify the data be fortune
Seek data.
Further, the data point reuse logging modle is when carrying out data attribute adjustment, by the operation for the data that need to be adjusted
Marker is revised as second identifier symbol by first identifier symbol, and serial number is changed to specified serial number, using static overall variable set
Record data table name to be adjusted;
Correspondingly, the data point reuse module carries out the detailed process of data table data adjustment are as follows:
Read the data table name of the record in the static overall variable set;
Reading from the database module and runing marker in corresponding tables of data is the non-operation data that first identifier accords with,
And it is ranked up in interim table automatically according to setting means, wherein the interim table is stored in the database module, described
The data format of interim tableau format and tables of data is consistent;
Operation in tables of data is read from the database module and is identified as the operation data that second identifier accords with, by its specified sequence
Number position is inserted into interim table in the position of appointed sequence number;
The data in tables of data are emptied, replicates in the data to data table in interim table, empties the data in interim table.
Further, when thering are multiple data attributes to change in the same tables of data, the data point reuse logging modle by
A that the operation marker of non-operation data to be changed will be needed to be revised as second identifier symbol by first identifier symbol, serial number is changed to refer to
Fixed serial number, until change in need data complete change until, it is to be adjusted using static overall variable set record
Data table name;
Correspondingly, the data point reuse module carries out the detailed process of data table data adjustment are as follows:
Read the data table name of the record in the static overall variable set;
Reading from the database module and runing marker in corresponding tables of data is the non-operation data that first identifier accords with,
And it is ranked up in interim table automatically according to setting means, wherein the interim table is stored in the database module, described
The data format of interim tableau format and tables of data is consistent;
All operations in tables of data, which are read, from the database module is identified as the operation data that second identifier accords with;
All operations in tables of data, which are read, from the database module is identified as the operation data and progress that second identifier accords with
Compare, is ranked up by the sequence of serial number from small to large;
Operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, insertion one
Data sequence number adds 1 automatically after a operation data;
After the completion of data insertion all in tables of data, the data in tables of data, the data in the interim table of duplication are emptied
Into tables of data, the data in interim table are emptied.
Further, when the data attribute for having multiple and different tables of data will change, the data point reuse logging modle is first located
The data attribute change in the same tables of data is managed, the operation marker of non-operation data to be changed will be needed by the first mark one by one
Know symbol and be revised as second identifier symbol, serial number is changed to specified serial number, until in the tables of data change in need data
Until completing change;Then handle another tables of data with same method again, until change in need data list processing
Until completion, using static overall variable set record data table name to be adjusted;
Correspondingly, the data point reuse module carries out the detailed process of data table data adjustment are as follows:
A, a tables of data of the record in static overall variable set is read from memory module;
B, reading operation marker in tables of data from database module is the non-operation data that first identifier accords with, and according to setting
Determine mode to be ranked up in interim table automatically, wherein the interim table is stored in the database module, the interim table
The data format of format and tables of data is consistent;
C, it reads to run in tables of data from database module and is identified as the operation data of second identifier symbol and is compared, press
The sequence of serial number from small to large is ranked up;
D, operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into
Data sequence number adds 1 automatically after one operation data;
E, the data in tables of data are emptied, in the data to data table in the interim table of duplication, empty the data in interim table;
Above a to the e operating process is repeated, until the tables of data recorded in static overall variable set terminates this when being empty
Operation.
A kind of method of adjustment of data resource, which comprises
The condition that step 1, setting trigger data adjust;
The sorting position of the data and adjustment that need to adjust in step 2, the tables of data of database of record;
The sorting position pair of step 3, the data and adjustment that are adjusted as needed when meeting the condition of trigger data adjustment
The data of tables of data are adjusted.
Further, the data table data includes operation data and non-operation data;The operation marker, for marking
Know data attribute, identifying the data with first identifier symbol respectively is non-operation data, and second identifier accords with to identify the number
According to being operation data.
Further, in the step 2, the data point reuse logging modle will need to change when carrying out data attribute change
Data operation marker by first identifier symbol be revised as second identifier symbol, serial number is changed to specified serial number, using static state
Global variable set record data table name to be adjusted;
Correspondingly, in the step 3, the detailed process of adjustment data are as follows:
Read the data table name of the record in the static overall variable set;
The non-operation data that marker is first identifier symbol is runed in corresponding tables of data from reading in database, and according to
Setting means is ranked up in interim table automatically, wherein the data format of the interim tableau format and tables of data is consistent
's;
It is identified as the operation data that second identifier accords with from operation in tables of data is read in database, by its appointed sequence number position
It is inserted into interim table in the position of appointed sequence number;
The data in tables of data are emptied, replicates in the data to data table in interim table, empties the data in interim table.
Further, in the step 2, when thering are multiple data attributes to change in the same tables of data, the data tune
Complete record module will need the operation marker of non-operation data to be changed to be revised as second identifier symbol by first identifier symbol one by one,
Serial number is changed to specified serial number, until change in need data complete change until, using static overall variable set
Record data table name to be adjusted;
Correspondingly, in the step 3, the detailed process of adjustment data are as follows:
Read the data table name of the record in the static overall variable set;
The non-operation data that marker is first identifier symbol is runed in corresponding tables of data from reading in database, and according to
Setting means is ranked up in interim table automatically, wherein the data format of the interim tableau format and tables of data is consistent
's;
The operation data that second identifier accords with is identified as from all operations in tables of data are read in database;
From in database read tables of data in it is all operation be identified as second identifier accord with operation data and be compared, press
The sequence of serial number from small to large is ranked up;
Operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, insertion one
Data sequence number adds 1 automatically after a operation data;
After the completion of data insertion all in tables of data, the data in tables of data, the data in the interim table of duplication are emptied
Into tables of data, the data in interim table are emptied.
Further, in the step 2, when the data attribute for having multiple and different tables of data will change, the data point reuse
Logging modle first handles the change of the data in the same tables of data, will need the operation marker of non-operation data to be changed one by one
Second identifier symbol is revised as by first identifier symbol, serial number is changed to specified serial number, until institute's change in need in the tables of data
Until data more complete change;Then handle another tables of data with same method again, until change in need number
Until completing according to list processing, all data table names to be adjusted are recorded using static overall variable set one by one;
Correspondingly, in the step 3, the detailed process of adjustment data are as follows:
A, a tables of data of the record in the static overall variable set is read;
It b, is the non-operation data that first identifier accords with from operation marker in tables of data is read in database, and according to setting
Mode is ranked up in interim table automatically, wherein the data format of the interim tableau format and tables of data is consistent;
C, from database read tables of data in operation be identified as second identifier accord with operation data and be compared, sequentially
Sequence number from small to large is ranked up;
D, operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into
Data sequence number adds 1 automatically after one operation data;
E, the data in tables of data are emptied, in the data to data table in the interim table of duplication, empty the data in interim table;
Above a to the e operating process is repeated, until the tables of data recorded in static overall variable set terminates this when being empty
Operation.
Compared with prior art, the Adjusted Option of the data resource under a kind of big data quantity proposed by the present invention, using
An operation identification field is added in the tables of data of backstage resource database comes whether some data in mark data table are operation
Data, the data table name to be adjusted in a program with static overall variable Set set record, and a timed task is set to touch
The adjustment of database data table data is sent out, and when carrying out specific adjustment operation, operation data tune is carried out using interim table
Whole operation waits adjustment to empty the data in tables of data after the completion, then the data in interim table is copied in tables of data, finally
The technological means of the data in interim table is emptied, the position that can timely notify API operation to update will frequently run operation
Caused by data volume update be accumulated to together, data more new sort is periodically carried out by timed task.It thus is avoided that frequent
Update causes database performance to decline or collapse;Meanwhile it being cached using interim table and needing the data updated will not be to former data
Table has an impact.So can solve adjustment resource operation data under big data quantity using technical solution of the present invention, improving
Database processing ability guarantees the normal work of database, runs timely updating for result.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the method for adjustment for data resource that first embodiment of the invention provides;
Fig. 2 is the schematic diagram for the change data resource that first embodiment of the invention provides;
Fig. 3 is the signal of the static overall variable set record that provides of first embodiment of the invention data table name to be adjusted
Figure;
Fig. 4 is that the data resource that first embodiment of the invention provides adjusts schematic diagram;
Fig. 5 is a kind of flow chart of the method for adjustment for data resource that second embodiment of the invention provides;
Fig. 6 is a kind of flow chart of the method for adjustment for data resource that third embodiment of the invention provides;
Fig. 7 is a kind of structural schematic diagram of the adjustment device for data resource that fourth embodiment of the invention provides.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of methods of adjustment of the data resource under big data quantity.In the present invention, in backstage resource
The data of database include operation data and non-operation data, and addition is identified for the operation of mark data attribute in tables of data
Whether position, be operation data for some data in mark data table, identify the data right and wrong with first identifier symbol respectively
Operation data, second identifier symbol is come to identify the data be operation data, in each embodiment described below mentioned, first
Identifier is 0, and second identifier symbol is 1, i.e., if operation marker is 0, indicates that the data are non-operation datas, if operation mark
Knowing position is 1, indicates that the data are operation datas;The adjustment that one timed task carrys out trigger data library data table data is set,
When carrying out specific adjustment operation, the data table name to be adjusted in a program with static overall variable Set set record;Using one
Data format carries out the operation of operation data adjustment with the consistent interim table of above-mentioned tables of data format, and adjustment is waited to empty after the completion
Data in tables of data, then the data in interim table are copied in tables of data, finally empty the data in interim table.
Based on the method for adjustment of the above-mentioned resource operation data of the present invention, each embodiment of the method for the present invention is proposed.
Please refer to Fig. 1 to Fig. 4.First embodiment of the invention provides a kind of adjustment side of the data resource under big data quantity
Method, this method comprises:
Step 1, addition is used for the operation marker of mark data attribute in database data table, and utilizes operation mark
The attribute of position change data table data.Include:
Step 1.1, addition is used for the operation marker of mark data attribute in tables of data.Include:
The tables of data has data table name, and data include operation data and non-operation data;Fortune is added in tables of data
Marker is sought, is used for mark data attribute, it is operation data that operation marker, which is 1 expression data, and operation marker indicates number for 0
According to for non-operation data.
Step 1.2 utilizes the attribute of operation marker change data table data.Include:
The operation marker of non-operation data to be changed will be needed to be changed to 1 by 0, the non-operation data in tables of data is become
More operation data.For example, by the non-operation data A in tables of data a, (operation marker is 0, and serial number m) is changed to serial number
For the operation data (usual operation data default is sorted according to download or other attributes) of n, specific operation process is: will
The operation marker of data A is revised as 1 from 0, and serial number is changed to n by m, and data A can be completed and be changed to transport from non-operation data
Seek data.As shown in Figure 2.
Step 2, the adjustment that timed task trigger data library data table data is set, to reach database operation resource
Adjustment.Include:
Timed task is set before carrying out data point reuse.The adjustment opportunity of database data table data is by preset timing
Task triggers (such as every progress database operation resource adjustment in 30 minutes), starts basis after triggering and is adjusted in tables of data
Data.It is following (as shown in Figure 4) that it adjusts process:
Step 1.1 records data table name to be adjusted.Using static overall variable set record data table name to be adjusted,
Set set is usually used in static overall variable set.As shown in Figure 3.
For example, the entitled tables of data a of tables of data to be adjusted, then record tables of data a with Set set.
Step 1.2, read static overall variable set (Set set) in record tables of data and carry out data point reuse.
Include:
The tables of data of the record in static overall variable set (Set set) is read, such as: tables of data a;
The non-operation data that operation marker is 0 in tables of data a is read, and certainly according to setting means (such as default behavior)
It moves and is ranked up in interim table b;
The operation data that operation in tables of data a is identified as 1 is read, is inserted into interim table b middle finger by its appointed sequence number position
In the position of sequencing number;For example, operation data A is inserted into the position that appointed sequence number in interim table b is n, n+ in the present embodiment
1 later data sequence number adds 1 automatically;
Empty the data in tables of data a to be adjusted;
It replicates in the data to data table a in interim table b;
Empty the data in interim table b.
Referring to Fig. 5.Second embodiment of the invention provides a kind of method of adjustment of the data resource under big data quantity, is applicable in
When thering are multiple non-operation datas to be changed to operation data in the same tables of data, this method comprises:
Step S1, the non-operation data in tables of data to be adjusted is changed to operation data.
By multiple non-operation data A, B, the C in tables of data a (operation marker is 0, and serial number is respectively m-1, m, m+1)
It is changed to the operation data of serial number n-1, n, n+1, specific operation process is: by the operation marker of data A, B, C by 0 modification
It is 1, serial number is changed to specified n-1, n, n+1 by m, and data A, B, C can be completed from non-operation data and be changed to operation data.
Step S2, tables of data a title to be adjusted with static overall variable Set set record;
Step S3, the tables of data a of the record in static overall variable Set set is read;
Step S4, the data in tables of data a are read, and data are adjusted again in interim table b according to setting means
It is whole;Detailed process is:
The non-operation data that operation marker is 0 in tables of data a is read, and according to setting means automatically in interim table b
It is ranked up;
It reads and runs the operation data for being identified as 1 in tables of data a and be compared, carried out by the sequence of serial number from small to large
Sequence;
Operation data is inserted respectively into interim table b in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into
Data sequence number adds 1 automatically after one operation data;
Step S5, after the completion of operation data insertion all in tables of data a, the number in tables of data a to be adjusted is emptied
According in the data to data table a in, the interim table b of duplication, the data in interim table b are emptied.
Referring to Fig. 6.Third embodiment of the invention provides a kind of method of adjustment of the data resource under big data quantity, is applicable in
When thering is the non-operation data of one or more of multiple and different tables of data to be changed to operation data, this method comprises:
Step B1, the non-operation data in tables of data to be adjusted is changed to operation data.
(operation marker is 0 to the desired non-operation data A by tables of data, and serial number m) is changed to the operation number of serial number n
According to specific operation process is: the operation marker of data A being revised as 1 from 0, serial number is changed to specified n by m, can be completed
Data A is changed to operation data from non-operation data.
Step B2, data table name to be adjusted with static overall variable Set set record.
Step B3, the tables of data of the record in static overall variable Set set is read;
Step B4, judge whether static overall variable set Set is empty.If set Set is sky, terminate this adjustment
Process is transferred to step B5 if set Set is not sky.
Step B5, the data in tables of data are read, and data are readjusted in interim table according to setting means;
Detailed process is:
Read the tables of data of the record in static overall variable Set set;
Read tables of data in operation marker be 0 non-operation data, and according to setting means automatically in interim table b into
Row sequence;
It reads and runs the operation data for being identified as 1 in tables of data and be compared, carried out by the sequence of serial number from small to large
Sequence;
Operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, insertion one
Data sequence number adds 1 automatically after a operation data;For example, operation data A is inserted into appointed sequence number in interim table in the present embodiment
For the position of n, n+1 later data sequence numbers add 1 automatically;
Step B6, the data in tables of data are emptied, in the data to data table in the interim table of duplication, are emptied in interim table
Data.
Step B3 to step B6 is repeated, until the tables of data recorded in static overall variable Set set terminates this when being empty
Secondary adjustment process.
Referring to Fig. 7.Fourth embodiment of the invention provides a kind of adjustment device of the data resource under big data quantity, the dress
Set includes: database module 10, data point reuse logging modle 20, condition setting module 30 and data point reuse module 40, in which:
Database module 10, for storing backstage resource data table and interim table;The tables of data, which has, is used for mark data
The operation marker of attribute;
Data point reuse logging modle 20, the number of the tables of data for changing the database module 10 using operation marker
According to attribute;
Condition setting module 30, for timed task to be arranged.
Data point reuse module 40, the timed task trigger data library tables of data number for being arranged according to condition setting module 30
According to adjustment.
Database module 10, for storing backstage resource data table and interim table;The tables of data has data table name, number
According to including operation data and non-operation data;There is operation marker in tables of data, be used for mark data attribute, i.e., for marking
Know whether some data in the tables of data are operation data, identifying the data with first identifier symbol respectively is non-operation number
Identifying the data according to, second identifier symbol is operation data;The data format of the interim tableau format and tables of data is one
It causes.Specifically, it is operation data that operation marker, which is 1 expression data, and it is non-operation number that operation marker, which is 0 expression data,
According to.
Data point reuse logging modle 20, the number of the tables of data for changing the database module 10 using operation marker
According to attribute, i.e., for the non-operation data in the tables of data to be adjusted of database module 10 to be changed to operation data.Carry out
When Data Data attribute, the operation marker for the data that need to be changed is revised as 1 by 0, serial number is changed to specified serial number
Complete the change of data and serial number.For example, by the non-operation data A in tables of data a, (operation marker is 0, and serial number m) becomes
The operation marker of data A is then revised as 1 from 0 by the more operation data of serial number n, and serial number is changed to n by m, can be completed
Data A is changed to operation data from non-operation data.
Further, when there are multiple non-operation datas to be changed to operation data in the same tables of data, one by one need to
The operation marker of non-operation data to be changed is changed to 1 by 0, and serial number is changed to specified serial number, until change in need
Until data more complete change.
Further, when there is the non-operation data of one or more of multiple and different tables of data to be changed to operation data
When, the method for the above individual data table change is referred to handle, it may be assumed that first handles one or more of same tables of data
Non- operation data change, it may be assumed that the operation marker of non-operation data to be changed will be needed to be changed to 1 by 0 one by one, serial number is changed to
Specified serial number, until in the tables of data change in need data complete change until;Then again at same method
Manage another tables of data, until change in need data list processing complete until.
Data point reuse module 40, the timed task trigger data library tables of data number for being arranged according to condition setting module 30
According to adjustment.
The adjustment opportunity of data table data is triggered by timed task (such as every 30 minutes progress database operation resource tune
It is whole), start to carry out database data adjustment after triggering.Specific adjustment process is as follows:
Using static overall variable set record data table name to be adjusted, static overall variable set is usually used
Set set.When there are multiple and different tables of data to be adjusted, all data table names to be adjusted are recorded one by one with Set set.
Read the data table name to be adjusted of the record in static overall variable Set set;
It is read from database module 10 and runs the non-operation data that marker is 0 in corresponding tables of data, and according to setting
Mode (such as default behavior) is ranked up in interim table automatically;
The operation data that operation in tables of data is identified as 1 is read from database module 10, is inserted by its appointed sequence number position
Into interim table in the position of appointed sequence number;For example, operation data A is inserted into the position that appointed sequence number in interim table b is n, n
+ 1 later data sequence number adds 1 automatically;
The data in tables of data to be adjusted are emptied, replicates in the data to data table in interim table, empties in interim table
Data.
Further, when there is multiple non-operation datas to be changed to operation data in the same tables of data, for example, data
Table a has these non-operation datas of A, B, C to need to be changed to operation data, and the method more than all having pressed will run marker
1 is changed to by 0 and all specifies ordinal position.At this point, " reading to run in tables of data from database module 10 and be identified as above-mentioned
1 operation data is inserted into interim table b in the position of appointed sequence number by its appointed sequence number position " operation in, using sequentially
Sequence number from small to large is inserted into, i.e. concrete operations are:
The operation data that all operations in tables of data a are identified as 1 is read from database module 10;
From database module 10 read tables of data in it is all operation be identified as 1 operation data and be compared, by serial number
Sequence from small to large is ranked up;
Operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, insertion one
Data sequence number adds 1 automatically after a operation data;
After the completion of operation data insertion all in tables of data, the data in tables of data to be adjusted are emptied, duplication is faced
When table b in data to data table a in, empty the data in interim table b.
Further, when have the non-operation data of one or more of multiple and different tables of data to be changed to operation number
According to mode of operation is as follows: first completing a tables of data by the method processing for the operation data resource for adjusting same tables of data above
In operation data resource adjustment, then again with same method handle the operation data in other tables of data to be adjusted money
The adjustment in source, until it is in need adjustment operation data resource tables of data adjustment until.Specific operation process is:
A, all data table names to be adjusted are recorded using static overall variable set one by one, static overall variable set is general
It is to be gathered using Set.
B, a tables of data of the record in static overall variable Set set is read;
C, the non-operation data that operation marker is 0 in tables of data is read from database module 10, and according to setting means
Automatically it is ranked up in interim table;
D, from database module 10 read tables of data in operation be identified as 1 operation data and be compared, by serial number from
It is small to be ranked up to big sequence;
E, operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into
Data sequence number adds 1 automatically after one operation data;
F, the data in tables of data are emptied, in the data to data table in the interim table of duplication, empty the data in interim table.
Above b to the f operating process is repeated, until the tables of data recorded in static overall variable Set set terminates when being empty
This operation.
The Adjusted Option of data resource under a kind of big data quantity proposed by the present invention, using in backstage resource database
An operation identification field is added in tables of data and comes whether some data in mark data table are operation data, in a program with quiet
The state global variable Set set record data table name to be adjusted, and a timed task is set and carrys out trigger data library tables of data number
According to adjustment carry out the operation of operation data adjustment using interim table, wait and adjusted and when carrying out specific adjustment operation
The data in tables of data are emptied after, then the data in interim table are copied in tables of data, finally empty the number in interim table
According to technological means, can timely notify API operation update position, will frequently run operation caused by data volume update
It is accumulated to together, data more new sort is periodically carried out by timed task.It thus is avoided that frequent update causes database
It can decline or collapse;Meanwhile it being cached using interim table and the data updated is needed not have an impact to former tables of data.So
Using technical solution of the present invention, it can solve adjustment resource operation data under big data quantity, improve database processing ability, protect
The normal work for demonstrate,proving database, runs timely updating for result.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (8)
1. a kind of adjustment device of data resource, which is characterized in that described device includes: database module, data point reuse record
Module, condition setting module and data point reuse module, in which:
The database module, table, the tables of data have the operation marker for mark data attribute for storing data,
Data in the tables of data include operation data and non-operation data;
The data point reuse logging modle, for the operation marker of non-operation data to be changed will to be needed to be repaired by first identifier symbol
It being changed to second identifier symbol, serial number is changed to specified serial number, wherein the first identifier is accorded with for identifying non-operation data, the
Two identifiers are for identifying operation data;
The condition setting module, for the condition of trigger data adjustment to be arranged;
The data point reuse module, in the condition of trigger data adjustment for meeting condition setting module setting, root
The data for the tables of data that the database module stores are adjusted according to the data that the data point reuse logging modle records;
The data for the tables of data that the data according to data point reuse logging modle record store the database module
It is adjusted, comprising:
The data that operation marker in tables of data is first identifier symbol are read, and are first identifier symbol by the operation marker
Data are ranked up in interim table;
The data that operation marker in tables of data is second identifier symbol are read, and are second identifier symbol according to the operation marker
The corresponding appointed sequence number of data insert it into corresponding position in the interim table;
The data in the tables of data are emptied, are replicated in the data to data table in the interim table.
2. device as described in claim 1, which is characterized in that
The data point reuse logging modle is when carrying out data attribute adjustment, by the operation marker for the data that need to be adjusted by first
Identifier is revised as second identifier symbol, and serial number is changed to specified serial number, to be adjusted using static overall variable set record
Data table name;
Correspondingly, the data point reuse module carries out the detailed process of data table data adjustment are as follows:
Read the data table name of the record in the static overall variable set;
Reading from the database module and runing marker in corresponding tables of data is the non-operation data that first identifier accords with, and is pressed
It is ranked up in interim table automatically according to setting means, wherein the interim table is stored in the database module, described interim
The data format of tableau format and tables of data is consistent;
Operation in tables of data is read from the database module and is identified as the operation data that second identifier accords with, by its appointed sequence number position
It sets and is inserted into interim table in the position of appointed sequence number;
The data in tables of data are emptied, replicates in the data to data table in interim table, empties the data in interim table.
3. device as described in claim 1, which is characterized in that
When having multiple data attributes to change in the same tables of data, the data point reuse logging modle will need to change one by one
The operation marker of non-operation data second identifier symbol is revised as by first identifier symbol, serial number is changed to specified serial number, directly
To change in need data complete change until, using static overall variable set record data table name to be adjusted;
Correspondingly, the data point reuse module carries out the detailed process of data table data adjustment are as follows:
Read the data table name of the record in the static overall variable set;
Reading from the database module and runing marker in corresponding tables of data is the non-operation data that first identifier accords with, and is pressed
It is ranked up in interim table automatically according to setting means, wherein the interim table is stored in the database module, described interim
The data format of tableau format and tables of data is consistent;
All operations in tables of data, which are read, from the database module is identified as the operation data that second identifier accords with;
All operations are identified as the operation data of second identifier symbol and are compared from database module reading tables of data,
It is ranked up by the sequence of serial number from small to large;
Operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into a fortune
Data sequence number adds 1 automatically after battalion's data;
After the completion of data insertion all in tables of data, the data in tables of data, the data in the interim table of duplication to number are emptied
According to the data in table, emptied in interim table.
4. device as described in claim 1, which is characterized in that
When the data attribute for having multiple and different tables of data will change, the data point reuse logging modle first handles the same data
Data attribute change in table will need the operation marker of non-operation data to be changed to be revised as the by first identifier symbol one by one
Two identifiers, serial number are changed to specified serial number, until in the tables of data change in need data complete change until;
Then handle another tables of data with same method again, until change in need data list processing complete until, use
Static overall variable set record data table name to be adjusted;
Correspondingly, the data point reuse module carries out the detailed process of data table data adjustment are as follows:
A, a tables of data of the record in static overall variable set is read from memory module;
B, reading operation marker in tables of data from database module is the non-operation data that first identifier accords with, and according to setting side
Formula is ranked up in interim table automatically, wherein the interim table is stored in the database module, the interim tableau format
It is consistent with the data format of tables of data;
C, it reads to run in tables of data from database module and is identified as the operation data of second identifier symbol and is compared, by serial number
Sequence from small to large is ranked up;
D, operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into one
Data sequence number adds 1 automatically after operation data;
E, the data in tables of data are emptied, in the data to data table in the interim table of duplication, empty the data in interim table;
Above a to the e operating process is repeated, until the tables of data recorded in static overall variable set terminates this behaviour when being empty
Make.
5. a kind of method of adjustment of data resource, which is characterized in that the described method includes:
The condition of data point reuse in step 1, setting trigger data table, the data in the tables of data include operation data and non-fortune
Seek data;
Step 2 will need the operation marker of non-operation data to be changed to be revised as second identifier symbol, serial number by first identifier symbol
It is changed to specified serial number, wherein the first identifier symbol is for identifying non-operation data, and second identifier symbol is for identifying operation
Data;
Step 3, meet trigger data adjustment condition when, the sorting position of the data and adjustment that adjust as needed is to data
The data of table are adjusted;
The data for the tables of data that the data according to data point reuse logging modle record store the database module
It is adjusted, comprising:
The data that operation marker in tables of data is first identifier symbol are read, and are first identifier symbol by the operation marker
Data are ranked up in interim table;
The data that operation marker in tables of data is second identifier symbol are read, and are second identifier symbol according to the operation marker
The corresponding appointed sequence number of data insert it into corresponding position in the interim table;
The data in the tables of data are emptied, are replicated in the data to data table in the interim table.
6. method as claimed in claim 5, which is characterized in that in the step 2, the data point reuse logging modle is being carried out
When data attribute changes, the operation marker for the data that need to be changed is revised as second identifier symbol by first identifier symbol, serial number is more
It is changed to specified serial number, using static overall variable set record data table name to be adjusted;
Correspondingly, in the step 3, the detailed process of adjustment data are as follows:
Read the data table name of the record in the static overall variable set;
The non-operation data that marker is first identifier symbol is runed in corresponding tables of data from reading in database, and according to setting
Mode is ranked up in interim table automatically, wherein the data format of the interim tableau format and tables of data is consistent;
It is identified as the operation data that second identifier accords with from operation in tables of data is read in database, is inserted by its appointed sequence number position
Into interim table in the position of appointed sequence number;
The data in tables of data are emptied, replicates in the data to data table in interim table, empties the data in interim table.
7. method as claimed in claim 5, which is characterized in that in the step 2, when there is multiple data in the same tables of data
When attribute will change, the data point reuse logging modle will need the operation marker of non-operation data to be changed by first one by one
Identifier is revised as second identifier symbol, and serial number is changed to specified serial number, until the data of institute's change in need are completed to be changed to
Only, the data table name to be adjusted using static overall variable set record;
Correspondingly, in the step 3, the detailed process of adjustment data are as follows:
Read the data table name of the record in the static overall variable set;
The non-operation data that marker is first identifier symbol is runed in corresponding tables of data from reading in database, and according to setting
Mode is ranked up in interim table automatically, wherein the data format of the interim tableau format and tables of data is consistent;
The operation data that second identifier accords with is identified as from all operations in tables of data are read in database;
From in database read tables of data in it is all operation be identified as second identifier accord with operation data and be compared, by serial number
Sequence from small to large is ranked up;
Operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into a fortune
Data sequence number adds 1 automatically after battalion's data;
After the completion of data insertion all in tables of data, the data in tables of data, the data in the interim table of duplication to number are emptied
According to the data in table, emptied in interim table.
8. method as claimed in claim 5, which is characterized in that in the step 2, when the data category for having multiple and different tables of data
Property when changing, the data point reuse logging modle first handles the change of the data in the same tables of data, will need to change one by one
The operation marker of non-operation data second identifier symbol is revised as by first identifier symbol, serial number is changed to specified serial number, directly
Into the tables of data change in need data complete change until;Then another data is handled with same method again
Table, until change in need data list processing complete until, recorded one by one using static overall variable set and need to be adjusted
Entire data table name;
Correspondingly, in the step 3, the detailed process of adjustment data are as follows:
A, a tables of data of the record in the static overall variable set is read;
It b, is the non-operation data that first identifier accords with from operation marker in tables of data is read in database, and according to setting means
Automatically it is ranked up in interim table, wherein the data format of the interim tableau format and tables of data is consistent;
C, from database read tables of data in operation be identified as second identifier accord with operation data and be compared, by serial number from
It is small to be ranked up to big sequence;
D, operation data is inserted respectively into interim table in the position of appointed sequence number one by one by the sequence to have sorted, is inserted into one
Data sequence number adds 1 automatically after operation data;
E, the data in tables of data are emptied, in the data to data table in the interim table of duplication, empty the data in interim table;
Above a to the e operating process is repeated, until the tables of data recorded in static overall variable set terminates this behaviour when being empty
Make.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610506934.1A CN106168960B (en) | 2016-06-30 | 2016-06-30 | A kind of the adjustment device and its method of adjustment of data resource |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610506934.1A CN106168960B (en) | 2016-06-30 | 2016-06-30 | A kind of the adjustment device and its method of adjustment of data resource |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106168960A CN106168960A (en) | 2016-11-30 |
CN106168960B true CN106168960B (en) | 2019-06-18 |
Family
ID=58064675
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610506934.1A Active CN106168960B (en) | 2016-06-30 | 2016-06-30 | A kind of the adjustment device and its method of adjustment of data resource |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106168960B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110020227B (en) * | 2017-10-31 | 2021-10-15 | 北京国双科技有限公司 | Data sorting method and device |
CN110955696B (en) * | 2019-11-12 | 2022-10-14 | 中国经济信息社有限公司 | Data reading method, device, equipment and storage medium |
CN113505131A (en) * | 2021-07-20 | 2021-10-15 | 北京电解智科技有限公司 | Method and device for adjusting data sorting |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101510207A (en) * | 2009-02-26 | 2009-08-19 | 中兴通讯股份有限公司 | Tree menu dynamic maintenance method and apparatus based on web page |
CN102207936A (en) * | 2010-03-30 | 2011-10-05 | 国际商业机器公司 | Method and system for indicating content change of electronic document |
US8433692B2 (en) * | 2010-08-02 | 2013-04-30 | Oracle International Corporation | Effective dating for entity attributes and relationships |
CN103544323A (en) * | 2013-11-08 | 2014-01-29 | 中国农业银行股份有限公司 | Data updating method and device |
CN104317963A (en) * | 2014-11-14 | 2015-01-28 | 中国建设银行股份有限公司 | Method and device for processing data |
-
2016
- 2016-06-30 CN CN201610506934.1A patent/CN106168960B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101510207A (en) * | 2009-02-26 | 2009-08-19 | 中兴通讯股份有限公司 | Tree menu dynamic maintenance method and apparatus based on web page |
CN102207936A (en) * | 2010-03-30 | 2011-10-05 | 国际商业机器公司 | Method and system for indicating content change of electronic document |
US8433692B2 (en) * | 2010-08-02 | 2013-04-30 | Oracle International Corporation | Effective dating for entity attributes and relationships |
CN103544323A (en) * | 2013-11-08 | 2014-01-29 | 中国农业银行股份有限公司 | Data updating method and device |
CN104317963A (en) * | 2014-11-14 | 2015-01-28 | 中国建设银行股份有限公司 | Method and device for processing data |
Also Published As
Publication number | Publication date |
---|---|
CN106168960A (en) | 2016-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7117294B1 (en) | Method and system for archiving and compacting data in a data storage array | |
CN101859425A (en) | Method and device for providing application list | |
CN106168960B (en) | A kind of the adjustment device and its method of adjustment of data resource | |
CN104765794B (en) | A kind of method for partitioning database and device | |
CN103678556A (en) | Method for processing column-oriented database and processing equipment | |
CN103186622B (en) | The update method of index information and device in a kind of text retrieval system | |
KR101740271B1 (en) | Method and device for constructing on-line real-time updating of massive audio fingerprint database | |
CN110109910A (en) | Data processing method and system, electronic equipment and computer readable storage medium | |
US8296650B2 (en) | Technique to improve data entry efficiency in a user interface | |
CN106649412A (en) | Data processing method and device | |
CN110287152A (en) | A kind of method and relevant apparatus of data management | |
CN109814971A (en) | Desktop application icon arrangement method, electronic device and storage medium | |
CN114968942A (en) | Data processing method, prediction method, device, storage medium and program product | |
CN110209680A (en) | Data-updating method, device and electronic device based on Hive external table | |
CN111984666A (en) | Database access method and device, computer readable storage medium and computer equipment | |
CN111488483B (en) | Method, device, terminal and non-transitory computer readable storage medium for updating a library | |
CN113760902A (en) | Data splitting method, device, equipment, medium and program product | |
CN108646987A (en) | A kind of management method of file volume, device, storage medium and terminal | |
CN110389714A (en) | Method, apparatus and computer storage medium for data input and output | |
CN111259017A (en) | Order retrieval method, computer device and storage medium | |
JPH08305724A (en) | Device for managing design supporting information document | |
CN102467376A (en) | Modification method and device for character information | |
CN110704051B (en) | Unity interface data binding method | |
CN114065288A (en) | Method and device for auditing data change SQL statement | |
CN108197022A (en) | Automatic software test method, system and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |