CN103514164B - Data migration method and system - Google Patents

Data migration method and system Download PDF

Info

Publication number
CN103514164B
CN103514164B CN201210201198.0A CN201210201198A CN103514164B CN 103514164 B CN103514164 B CN 103514164B CN 201210201198 A CN201210201198 A CN 201210201198A CN 103514164 B CN103514164 B CN 103514164B
Authority
CN
China
Prior art keywords
internal memory
data migration
identifier
lock
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210201198.0A
Other languages
Chinese (zh)
Other versions
CN103514164A (en
Inventor
李铮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201210201198.0A priority Critical patent/CN103514164B/en
Publication of CN103514164A publication Critical patent/CN103514164A/en
Application granted granted Critical
Publication of CN103514164B publication Critical patent/CN103514164B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms

Landscapes

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

Abstract

This application provides a kind of data migration method, comprise the following steps: intercept application server received data migration request, and obtain the identifier of Data Migration both sides included in Data Migration request;Judge whether application server internal memory comprises the internal memory lock of described Data Migration both sides' identifier, if having, the most respectively two identifier application respective internal memory locks, otherwise, then create the internal memory lock of said two identifier;Utilize the internal memory corresponding identifier of lock locking that application is arrived, Data Migration request is sent to data base, waits the request of this Data Migration of database processing;Obtaining the instruction that this Data Migration request has been processed by data base, release the locking to Data Migration both sides' identifier of the internal memory lock, releasing memory is locked.Present invention also provides a kind of data mover system realizing preceding method.The data migration method of the application and system, it is possible to process the most concurrent connection request, improve the stability of system and data base.

Description

Data migration method and system
Technical field
The application relates to microcomputer data processing field, particularly relates to a kind of Data Migration side Method and system.
Background technology
Along with the development of network technology, in network storage data usually because network operation need into Row Data Migration.Such as, another data base is moved to from a data base.In some cases, When carrying out Data Migration, the record migrating both sides needs correspondence amendment, and such as, certain data is from number After moving out according to storehouse, this data base needs to delete this data, or revises this data, and receives this number According to data base, then need increase these data or revise the former data that these data are corresponding.In order to keep away Exempt from that mistake occurs, when the data in certain record are currently being used, need this record is locked Fixed, only after this has used, the data of this record just can be used again.
In some network operation, the most a certain record is likely to occur and waits wherein in a large number Data carry out the operation migrated, and at present, data are mainly passed through in the common Data Migration management of industry The Database lock in storehouse realizes.Before Data Migration is carried out every time, it is necessary first to obtain data base even Connect, then pinned the data in the record of Data Migration both sides by locking statement.If wall scroll record When needing the Data Migration carrying out a large amount of number of times at short notice, this record because be currently being used and Locked, then this Data Migration request recording follow-up wait then can take substantial amounts of data base even Connect, complete the most one by one this record all of Data Migration request after, quilt could be discharged The data base taken connects.Because single record Data Migration number of times is excessive, in fact it could happen that wait number More and more longer according to the queue migrated, the connection number of the data base taken also can be continuously increased, if whole Individual process duration is longer, then being likely to occur the data base that can use, to connect number fewer and feweri, Cause data base's pressure excessive and instability occurs, the situations such as system crash finally occur.
Summary of the invention
The application provides a kind of data migration method and system, it is possible to solves to take data base and connects too much Cause data base unstable and the problem of system crash.
In order to solve the problems referred to above, this application discloses a kind of data migration method, including following step Rapid:
Intercept application server received data migration request, and obtain the request of described Data Migration Included in the identifier of Data Migration both sides;
Judge whether application server internal memory comprises the internal memory of described Data Migration both sides' identifier Lock, if having, the most respectively said two identifier application respective internal memory lock, otherwise, then create The internal memory lock of said two identifier;
Utilize the internal memory corresponding identifier of lock locking that application is arrived, the request of described Data Migration is sent to Data base, waits the request of this Data Migration of database processing;
Obtain the instruction that this Data Migration request has been processed by data base, release internal memory and lock institute Stating the locking of Data Migration both sides' identifier, releasing memory is locked.
Further, the described said two identifier application respective internal memory lock that is respectively includes:
Obtain the currently used state of internal memory lock corresponding to described identifier, if being currently being used, then Waiting, if being not used by, then application obtains this internal memory lock.
Further, the described said two identifier application respective internal memory lock that is respectively also includes:
Add up the waiting time of internal memory lock corresponding to described identifier application, if exceeding waiting time threshold Value, then refuse the request of this Data Migration.
Further, the request of this Data Migration of described database processing includes:
Obtain the Database lock of Data Migration both sides' identifier in the request of this Data Migration;
Use Database lock that described Data Migration both sides' identifier is locked;
According to migrating numerical value, the data in both sides' identifier are modified and preserve;
Release the Database lock locking to Data Migration both sides' identifier.
Further, described identifier is stored in the form of corresponding internal memory lock employing mapping table and answers With in server memory.
Further, described being respectively after the said two respective internal memory of identifier application is locked also is wrapped Include:
Judge to apply for the Data Migration request that the internal memory that described identifier is corresponding is locked and is waited for Whether quantity exceedes application threshold value, otherwise the most then refuses the request of this Data Migration, then continue Wait until acquisition internal memory lock.
In order to solve the problems referred to above, disclosed herein as well is a kind of data mover system, including:
Blocking module, is used for intercepting application server received data migration request, and obtains institute State the identifier of Data Migration both sides included in Data Migration request;
Internal memory lock acquisition module, is used for judging that whether comprising described data in application server internal memory moves Move the internal memory lock of both sides' identifier, if having, in the most respectively the application of said two identifier is respective Deposit lock, otherwise, then create the internal memory lock of said two identifier;
Locking module, for the internal memory corresponding identifier of lock locking utilizing application to arrive, by described data Migration request is sent to data base, waits the request of this Data Migration of database processing;
Release module, for obtaining the instruction that this Data Migration request has been processed by data base, Releasing the locking to described Data Migration both sides' identifier of the internal memory lock, releasing memory is locked.
Further, described internal memory lock acquisition module includes:
Internal memory lock use state acquiring unit, for obtaining working as of internal memory lock corresponding to described identifier Front use state, if being currently being used, then waits, if being not used by, then application obtains this internal memory Lock.
Further, described internal memory lock acquisition module also includes:
Waiting time statistic unit, for adding up the wait of internal memory lock corresponding to described identifier application Time, if exceeding waiting time threshold value, then refuse the request of this Data Migration.
Further, described system also includes:
Mapping table sets up module, for setting up mapping table in application server internal memory to store identification Number with corresponding internal memory lock.
Further, described system also includes:
Data Migration number of requests statistical module, for judging to apply for the internal memory that described identifier is corresponding Whether the Data Migration number of requests locked and be waited for exceedes application threshold value, the most then refuse This Data Migration request absolutely.
Compared with prior art, the application includes advantages below:
The data migration method of the application and system, come same identifier by the internal memory lock set up Concurrent Data Migration request processes.Because the internal memory lock of this same identifier can only supply every time One data migration request uses, then remaining concurrent data migration request then needs to wait previous Data Migration request could obtain after making to be finished.That is, the request of each Data Migration is required for Internal memory carries out arrangement wait, after obtaining internal memory lock one by one, can be set up by application server Connection with data base.Therefore, even if there being the most concurrent Data Migration to ask, also it is required for Application server internal memory waits, is cleared one by one, thus decreases and data base's connection is taken Amount, improves the stability of data base.Even if it addition, the most concurrent Data Migration request occurring When causing application server internal memory unaffordable, it is also possible to by increasing the number of application server The mode of amount solves, and can't impact data base, thus substantially increase the steady of system Qualitative, it is to avoid system crash.
Secondly, except using the mode increasing application server or application server internal memory to improve Outside disposal ability to concurrent data migration request, the application also uses in direct application server The internal memory lock mode that carries out configuring to improve system processing power.Each internal memory is i.e. set and locks institute Allow the quantity of concurrent data migration request, if it exceeds setting value, the most directly refuse follow-up number According to migration request, until the Data Migration request waited is new less than could again accept after setting value Data Migration request application internal memory lock.By this kind of mode, it is not necessary to increase application server quantity, Or the capacity of application server internal memory, it is possible to reduce unnecessary cost, can ensure that number simultaneously Do not taken by substantial amounts of concurrent data migration request according to the connection in storehouse, improve data base and system Stability.
It addition, for internal memory lock and the incidence relation of identifier, use the form of mapping table to be stored in In application server, either obtain the internal memory lock of single identifier, or to internal memory lock or knowledge The operations such as alias is modified, deletion, all without affecting whole mapping table.At each Data Migration In request, increasing an internal memory lock, the duration of its additional process time increased can shorten to Microsecond grade, this time is negligible for whole Data Migration handling process.With Time, when single identifier concurrent data migration request quantity is more, because decreasing data base Connect takies, and can improve the response speed of data base, such that it is able to be greatly shortened whole data The time of migration process flow process, improve the response speed of system.
Certainly, the arbitrary product implementing the application is not necessarily required to reach all the above excellent simultaneously Point.
Accompanying drawing explanation
Fig. 1 is the system architecture diagram of the Data Migration realization of the application;
Fig. 2 is the flow chart of the data migration method embodiment one of the application;
Fig. 3 is the flow chart of the data migration method embodiment two of the application;
Fig. 4 is the data migration method effectiveness comparison figure of the application;
Fig. 5 is the structural representation of the data mover system embodiment one of the application;
Fig. 6 is the structural representation of the data mover system embodiment two of the application.
Detailed description of the invention
Understandable for enabling the above-mentioned purpose of the application, feature and advantage to become apparent from, below in conjunction with attached The application is described in further detail by figure and detailed description of the invention.
The data migration method of the application and system are for passing through client to application server to user The Data Migration request submitted to processes, and the most concurrent Data Migration request is locked by internal memory Mode intercept in the application server, it is to avoid take too much data base and connect, thus improve system The response speed of system and stability.The data mover system of the application can be arranged on application service Inside device, it is also possible to as standalone module, the mode with application server data interaction is used to realize Data Migration.
With reference to Fig. 1, it is shown that realize the system architecture diagram of the Data Migration of the application.Data Migration system System is arranged between application server and data base as standalone module, please to concurrent Data Migration Ask and process.Data migration method and system to the application are described in detail below.
With reference to Fig. 2, it is shown that a kind of data migration method embodiment one of the application, including following step Rapid:
Step 101, intercepts application server received data migration request, and obtains described number Identifier according to the Data Migration both sides included in migration request.
After user submits to Data Migration to ask by client, background application server can receive this Data Migration is asked, and accesses data base with Database by the way of being connected, data base In realize Data Migration.Wherein, Data Migration request can comprise the identification of Data Migration both sides Number, migrate the data such as numerical value.The data mover system of the application is by logarithm in the application server Intercept according to migration request, such that it is able to obtain the identifier of Data Migration both sides.
Step 102, it is judged that whether comprise described Data Migration both sides in application server internal memory and identify Number internal memory lock, if having, the most respectively said two identifier application respective internal memory lock, instead It, then create the internal memory lock of said two identifier.
It is line-locked right that internal memory lock refers to enter Data Migration identifier in application server internal memory As, each identifier is unique corresponding internal memory lock in an application server, and each internal memory is locked Can only be used by a data migration request every time.After getting an identifier, first determine whether Whether internal memory includes the internal memory lock that this identifier is uniquely corresponding, if not having, then in needing to utilize Depositing lock creation module is that this identifier creates internal memory lock, if having, then be this identifier application its Unique corresponding internal memory lock.In general, if an identifier had carried out Data Migration, Application server internal memory so then has its unique corresponding internal memory lock, if an identifier is Carry out Data Migration for the first time, then in application server internal memory then may in have this identifier corresponding Internal memory is locked, and now, then needs to create internal memory lock for this identifier.
Because same identifier may be submitted for repeatedly Data Migration (i.e. in the same time Single identifier concurrent data migration request quantity is more), then, it is possible to multiple data occur Migration request all includes this identifier.Since internal memory lock only one of which, now, it is necessary to many This identifier in individual data migration request fights for internal memory lock.That is, it needs to internal memory lock is carried out Shen Please.
Concrete, application process i.e. can occur according to Data Migration request to use the form of queue The sequencing of time waits one by one.Concrete, internal memory lock status can be set, such as, use Not using two states, or lock and non-locking, concrete can set according to practical situation Fixed, as long as can represent whether internal memory lock can be used.For some identifier application internal memory lock Detailed process is as follows:
Obtain the currently used state of internal memory lock corresponding to described identifier, if being currently being used, then Waiting, if being not used by, then application obtains this internal memory lock.
It is appreciated that in order to avoid the waiting time is long, and does not responds in client, preferably Ground, can arrange waiting time threshold value, adds up the wait of internal memory lock corresponding to described identifier application Time, if exceeding waiting time threshold value, then refuse the request of this Data Migration.Can be directly to visitor Family end returns mistake or prompting client end response time-out etc..
It addition, because Data Migration can comprise the identifier of Data Migration both sides in asking, may Occur that an identifier application is locked to internal memory, and another one identifier does not applies for the feelings to internal memory lock Condition.In order to ensure smoothly completing of data migration operation, two identifiers are needed all to apply for internal memory Subsequent operation just can be carried out after lock.Therefore, if only an identifier application is locked to internal memory, additionally During one identifier application, the waiting time is long, it would however also be possible to employ the aforesaid mode returning mistake is entered Row processes, i.e. if waiting time during any one application of two identifiers exceed threshold value, then Return mistake.
Step 103, utilizes the internal memory corresponding identifier of lock locking that application is arrived, by described Data Migration Request is sent to data base, waits the request of this Data Migration of database processing.
Both sides' identifier in Data Migration is asked all is applied for internal memory locking, and by internal memory lock locking After, at this point it is possible to according to normal flow, application server is set up to database request and is connected, etc. Pending data storehouse processes the request of this Data Migration, i.e. carries out data migration operation.
Now, if data base connects just occupied, then need to wait, if it is not, can Directly to carry out data migration operation.The detailed process of this Data Migration of database processing request For:
Obtain the Database lock of Data Migration both sides' identifier in the request of this Data Migration;
Use Database lock that the identifier of Data Migration both sides is locked;
Then according to migration numerical value, the data in both sides' identifier are modified and preserve;
Finally release the Database lock locking to the identifier of Data Migration both sides.
So far, the process that this Data Migration is asked by data base completes.Wherein, Database lock with Internal memory lock is similar, and identifier one_to_one corresponding, if it is not, re-use after Chuan Jianing.
Such as, in actual process, it is assumed that Data Migration request is transfer request, and identifier is Refer to transfer accounts the account of both sides, migrates numerical value and refers to transfer amounts, then aforementioned process can be by such as Under type describes:
If a account needs to transfer accounts 100 yuan to b account, then processing procedure is: first with a A account is locked by Database lock corresponding to account, and Database lock corresponding to b account is to b Account locks;Then, the account balance in a account deducts 100 yuan, in the account of b account Plus 100 yuan in the remaining sum of family, and amended data are preserved;To both sides' account data After revising and preserving, data base can release Database lock a account and the locking of b account, and releases Put respective Database lock, if other transfer request include a account or b account, then can be A account or Database lock corresponding to b account use after being released.
Step 104, after this Data Migration request has been processed by data base, releases internal memory lock Locking to described Data Migration both sides' identifier, releasing memory is locked.
After releasing the locking to both sides' identifier of the internal memory lock, the use state of internal memory lock can be revised, I.e. releasing memory lock, thus internal memory lock is distributed to the identification in the Data Migration request waited Number.
It is appreciated that in aforementioned data moving method, is come same identification by the internal memory lock set up The request of number concurrent Data Migration processes.Because the internal memory lock of this same identifier can only every time For a data migration request, then before remaining concurrent data migration request then needs to wait One Data Migration request could obtain after making to be finished.That is, the request of each Data Migration is required for In internal memory, carry out arrangement wait, after obtaining internal memory lock one by one, can be built by application server The vertical connection with data base.Therefore, even if there being the most concurrent Data Migration to ask, also it is required for Application server internal memory waits, is cleared one by one, thus decreases and data base's connection is accounted for Consumption, improves the stability of data base.Even if it addition, occurring that the most concurrent Data Migration please Time derivation cause application server internal memory is unaffordable, it is also possible to by increasing application server The mode of quantity solves, and can't impact data base, thus substantially increase system Stability, it is to avoid system crash.
Preferably, except using the mode increasing application server or application server internal memory to carry Outside the high disposal ability to concurrent data migration request, it is also possible to directly interior in application server Deposit lock to configure, each internal memory be i.e. set and lock the quantity of allowed concurrent data migration request, If it exceeds setting value, the Data Migration request that the most directly refusal is follow-up, until the data waited are moved Move request less than could again accept new Data Migration request application internal memory lock after setting value.
With reference to Fig. 3, it is shown that the data migration method embodiment two of the application, in the step of embodiment one Can also comprise the following steps between rapid 102 and step 103:
Step 301, it is judged that apply for the number that the internal memory that described identifier is corresponding is locked and is waited for Whether exceed application threshold value according to migration request quantity, the most then refuse the request of this Data Migration, Otherwise, then continue waiting for until obtaining internal memory lock.
By this kind of mode, it is not necessary to increase application server quantity, or application server internal memory Capacity, it is possible to reduce unnecessary cost, can ensure that the connection of data base is the most substantial amounts of simultaneously Concurrent data migration request takies, and improves data base and the stability of system.
Preferably for aforesaid data migration method embodiment one and two, for internal memory lock and knowledge The incidence relation of alias, can be to use the form storage of mapping table, the internal memory of the most each identifier Lock uses supports that concurrent Hash mapping preserves, and so, either obtains the interior of single identifier Deposit lock, or to operations such as internal memory lock or identifier is modified, deletions, whole all without impact Individual mapping table.Mapping table can only preserve and carrying out a small amount of identifier of Data Migration process i.e. Can.In each Data Migration is asked, increase an internal memory lock, during the extra process that it is increased Between duration can shorten to Microsecond grade, this time is for whole Data Migration handling process It is negligible.Meanwhile, when single identifier concurrent data migration request quantity is more, because of For decreasing, data base's connection is taken, the response speed of data base can be improved, such that it is able to It is greatly shortened the time of whole Data Migration handling process, improves the response speed of system.
Below, in conjunction with instantiation, preceding method is described in detail.In this example, data are moved Shifting is operation of transferring accounts, and identifier herein is account.Assume that a certain application has four application clothes Business device and a data base, set up the connection with data base by transfer request by application server Pass to data base, and carried out, by data base, process of transferring accounts.
Assume that (account c) has 40 concurrent transfer request to certain account simultaneously, namely the most in short-term In or simultaneously, have 40 accounts and be required for carrying out, with account c, operation of transferring accounts.Can be Other account is transferred accounts to account c, it is also possible to be that account c is transferred accounts to other account, or the two is held concurrently Have.In this example, propose by 40 accounts simultaneously and carry out as a example by account c carries out transfer request Explanation.If according to processing mode of transferring accounts before, then four application servers then may be simultaneously Submit the request connected of setting up to data base to, and send each please from transferring accounts of receiving of client Ask.Because 40 transfer request all include account c, and in data base for account c only One Database lock, namely a transfer request can only be processed every time, remaining transfer request then needs Wait one by one, these transfer request waited can take data base and connect.If follow-up continuation Now include the concurrent transfer request of account c, then will necessarily occur that taking data base in a large number connects Situation, consequently, it is possible to cause data base's pressure to increase, even occur collapse.
If using the data migration method of the application, by arranging in each application server internal memory Internal memory is locked, it is assumed that 40 transfer request have been evenly distributed to four by the way of load balancing and have answered With in server, then each application server can receive ten transfer request.Assume each answering Internal memory lock by the account having contained the both sides that transfer accounts in server.Now, each application clothes Ten transfer request in business device all can apply for obtaining the internal memory lock of both sides' account of transferring accounts, because account C is only one of which internal memory lock in each application server, in the case of internal memory lock is not used by, In ten transfer request, only one of which can get the internal memory lock of account c, and remaining nine then need Wait in line.Now, each application server is only a transfer request foundation with data base's Connect, then, the data base taken connects number and is up to four.It can be seen that the application's turns Account method is by the way of arranging internal memory lock in the application server, and the process that will wait in line shifts Arrive in application server internal memory, thus to data base when greatly reducing single account concurrent request The pressure brought.Application server internal memory is utilized to process concurrent request, even if internal memory cannot bear also The pressure that the request of sending out brings, it is also possible to by increasing application server internal memory or increasing application service The method of device, thus add stability and the anti-pressure ability of system.
With reference to Fig. 4, it is shown that single identifier concurrent data migration request quantity is the loudest with system Relation table between Ying Shi, wherein, vertical coordinate represents Mean Time of Systemic Response, and unit is millisecond (ms), abscissa represents single identifier concurrent data migration request quantity, and unit is individual.Real Line represents the data using internal memory lock to be combined with Database lock, and dotted line represents only with Database lock Data.It can be seen that when single identifier concurrent data migration request negligible amounts, in using Deposit lock be combined compared to only with Database lock with Database lock for, when can increase the response of system Between, but the response time difference of the two is less, it can be considered that impact is little.But, with The increase of single identifier concurrent data migration request quantity, use internal memory lock to tie with Database lock The mode closed can be substantially reduced the response time of system, and concurrent data migration request quantity is more Many, its system response time that can reduce is the most.That is, the data migration method pair of the application When single identifier concurrent data migration request quantity is more, there is more significantly effect.
With reference to Fig. 5, it is shown that the data mover system embodiment one of the application, including blocking module 10, internal memory lock acquisition module 20, locking module 30 and release module 40.Data mover system can To be arranged on inside application server, it is also possible to as independent module, use and application server Carry out the mode of data interaction to realize Data Migration.
Blocking module 10, is used for intercepting application server received data migration request, and obtains The identifier of the Data Migration both sides included in the request of described Data Migration.
Internal memory lock acquisition module 20, is used for judging whether to comprise in application server internal memory described data Migrating the internal memory lock of both sides' identifier, if having, the most respectively said two identifier application is respective Internal memory is locked, otherwise, then create the internal memory lock of said two identifier.
Preferably, internal memory lock acquisition module includes that internal memory locks use state acquiring unit, is used for obtaining The currently used state of the internal memory lock that described identifier is corresponding, if being currently being used, then waits, if Be not used by, then application obtains this internal memory lock.
It is appreciated that this internal memory lock acquisition module can also include waiting time statistic unit, is used for Add up the waiting time of internal memory lock corresponding to described identifier application, if exceeding waiting time threshold value, Then refuse the request of this Data Migration.
Locking module 30, for the internal memory corresponding identifier of lock locking utilizing application to arrive, by described number It is sent to data base according to migration request, waits the request of this Data Migration of database processing.
Release module 40, for obtaining the finger that this Data Migration request has been processed by data base Order, releases the locking to described Data Migration both sides' identifier of the internal memory lock, and releasing memory is locked.
Preferably, this system also includes that mapping table sets up module, in application server internal memory Set up mapping table and lock with corresponding internal memory to store identifier.
With reference to Fig. 6, it is shown that the data mover system embodiment two of the application, this system also includes number According to migration request quantity statistics module 60, it is used for judging to apply for that the internal memory that described identifier is corresponding is locked also Whether the Data Migration number of requests being waited for exceedes application threshold value, the most then refuse this Secondary data migration request, otherwise, then continue waiting for until obtaining internal memory lock.
Each embodiment in this specification all uses the mode gone forward one by one to describe, each embodiment emphasis Illustrate is all the difference with other embodiments, identical similar part between each embodiment See mutually.For system embodiment, due to itself and embodiment of the method basic simlarity, So describe is fairly simple, relevant part sees the part of embodiment of the method and illustrates.
Those skilled in the art are it should be appreciated that embodiments herein can be provided as method, be System or computer program.Therefore, the application can use complete hardware embodiment, the softest Part embodiment or the form of the embodiment in terms of combining software and hardware.And, the application can adopt It is used in one or more computer-usable storage medium wherein including computer usable program code (including but not limited to disk memory, CD-ROM, optical memory etc.) upper calculating implemented The form of machine program product.
Above data migration method provided herein and system are described in detail, herein In apply specific case principle and the embodiment of the application be set forth, above example Explanation be only intended to help and understand the present processes and core concept thereof;Simultaneously for ability The those skilled in the art in territory, according to the thought of the application, in specific embodiments and applications All will change, in sum, this specification content should not be construed as the limit to the application System.

Claims (11)

1. a data migration method, it is characterised in that comprise the following steps:
Intercept application server received data migration request, and obtain the request of described Data Migration Included in the identifier of Data Migration both sides;
Judge whether application server internal memory comprises the internal memory of described Data Migration both sides' identifier Lock, if having, the most respectively said two identifier application respective internal memory lock, otherwise, then create The internal memory lock of said two identifier;
Utilize the internal memory corresponding identifier of lock locking that application is arrived, the request of described Data Migration is sent to Data base, waits the request of this Data Migration of database processing;
Obtain the instruction that this Data Migration request has been processed by data base, release internal memory and lock institute Stating the locking of Data Migration both sides' identifier, releasing memory is locked.
2. data migration method as claimed in claim 1, it is characterised in that described respectively institute State two identifier application respective internal memory locks to include:
Obtain the currently used state of internal memory lock corresponding to described identifier, if being currently being used, then Waiting, if being not used by, then application obtains this internal memory lock.
3. data migration method as claimed in claim 2, it is characterised in that described respectively institute State two identifier application respective internal memory locks also to include:
Add up the waiting time of internal memory lock corresponding to described identifier application, if exceeding waiting time threshold Value, then refuse the request of this Data Migration.
4. data migration method as claimed in claim 1, it is characterised in that at described data base Manage the request of this Data Migration to include:
Obtain the Database lock of Data Migration both sides' identifier in the request of this Data Migration;
Use Database lock that described Data Migration both sides' identifier is locked;
According to migrating numerical value, the data in both sides' identifier are modified and preserve;
Release the Database lock locking to Data Migration both sides' identifier.
5. data migration method as claimed in claim 1, it is characterised in that described identifier with Corresponding internal memory lock uses the form of mapping table to be stored in application server internal memory.
6. the data migration method as described in any one of claim 1 to 5, it is characterised in that institute State the respectively respective internal memory of said two identifier application also to include after locking:
Judge to apply for the Data Migration request that the internal memory that described identifier is corresponding is locked and is waited for Whether quantity exceedes application threshold value, the most then refuse the request of this Data Migration;Otherwise, then continue Continuous waiting until obtains internal memory lock.
7. a data mover system, it is characterised in that including:
Blocking module, is used for intercepting application server received data migration request, and obtains institute State the identifier of Data Migration both sides included in Data Migration request;
Internal memory lock acquisition module, is used for judging that whether comprising described data in application server internal memory moves Move the internal memory lock of both sides' identifier, if having, in the most respectively the application of said two identifier is respective Deposit lock, otherwise, then create the internal memory lock of said two identifier;
Locking module, for the internal memory corresponding identifier of lock locking utilizing application to arrive, by described data Migration request is sent to data base, waits the request of this Data Migration of database processing;
Release module, for obtaining the instruction that this Data Migration request has been processed by data base, Releasing the locking to described Data Migration both sides' identifier of the internal memory lock, releasing memory is locked.
8. data mover system as claimed in claim 7, it is characterised in that described internal memory lock obtains Delivery block includes:
Internal memory lock use state acquiring unit, for obtaining working as of internal memory lock corresponding to described identifier Front use state, if being currently being used, then waits, if being not used by, then application obtains this internal memory Lock.
9. data mover system as claimed in claim 8, it is characterised in that described internal memory lock obtains Delivery block also includes:
Waiting time statistic unit, for adding up the wait of internal memory lock corresponding to described identifier application Time, if exceeding waiting time threshold value, then refuse the request of this Data Migration.
10. data mover system as claimed in claim 7, it is characterised in that described system is also Including:
Mapping table sets up module, for setting up mapping table in application server internal memory to store identification Number with corresponding internal memory lock.
11. data mover systems as described in any one of claim 7 to 10, it is characterised in that Described system also includes:
Data Migration number of requests statistical module, for judging to apply for the internal memory that described identifier is corresponding Whether the Data Migration number of requests locked and be waited for exceedes application threshold value, the most then refuse This Data Migration request absolutely.
CN201210201198.0A 2012-06-15 2012-06-15 Data migration method and system Active CN103514164B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210201198.0A CN103514164B (en) 2012-06-15 2012-06-15 Data migration method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210201198.0A CN103514164B (en) 2012-06-15 2012-06-15 Data migration method and system

Publications (2)

Publication Number Publication Date
CN103514164A CN103514164A (en) 2014-01-15
CN103514164B true CN103514164B (en) 2016-12-21

Family

ID=49896905

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210201198.0A Active CN103514164B (en) 2012-06-15 2012-06-15 Data migration method and system

Country Status (1)

Country Link
CN (1) CN103514164B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183852B (en) * 2015-09-08 2018-05-22 网易(杭州)网络有限公司 A kind of database migration method and apparatus
CN106570027B (en) * 2015-10-10 2020-08-25 阿里巴巴集团控股有限公司 Transactional task processing method and device
CN106204217A (en) * 2016-07-08 2016-12-07 腾讯科技(深圳)有限公司 The methods, devices and systems of resource numerical value transfer, the method and apparatus of resource numerical value transfer request
CN108572870B (en) * 2017-11-23 2020-11-06 北京金山云网络技术有限公司 Data acquisition method, device, electronic equipment, storage medium and system
CN111026734B (en) * 2019-12-10 2020-11-13 北京北龙云海网络数据科技有限责任公司 Database management method, system, device and storage medium
CN115757345A (en) * 2022-11-17 2023-03-07 天翼数字生活科技有限公司 Mass data smooth migration method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740978A (en) * 2004-08-23 2006-03-01 华为技术有限公司 Method for realing sharing internal stored data base and internal stored data base system
CN1858745A (en) * 2006-04-05 2006-11-08 华为技术有限公司 Processing method for realizing consistency of internal storage data and data bank data service
CN102369518A (en) * 2011-08-31 2012-03-07 华为技术有限公司 Method for managing computer system memory, memory management unit and computer system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4139632B2 (en) * 2002-06-28 2008-08-27 株式会社日立製作所 Database management method and system
US8244988B2 (en) * 2009-04-30 2012-08-14 International Business Machines Corporation Predictive ownership control of shared memory computing system data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740978A (en) * 2004-08-23 2006-03-01 华为技术有限公司 Method for realing sharing internal stored data base and internal stored data base system
CN1858745A (en) * 2006-04-05 2006-11-08 华为技术有限公司 Processing method for realizing consistency of internal storage data and data bank data service
CN102369518A (en) * 2011-08-31 2012-03-07 华为技术有限公司 Method for managing computer system memory, memory management unit and computer system

Also Published As

Publication number Publication date
CN103514164A (en) 2014-01-15

Similar Documents

Publication Publication Date Title
CN103514164B (en) Data migration method and system
CN110612705B (en) Method for service deployment under server-free architecture and function management platform
US11340672B2 (en) Persistent reservations for virtual disk using multiple targets
CN112596960B (en) Distributed storage service switching method and device
CN106453360B (en) Distributed block storing data access method and system based on iSCSI protocol
CN106503058B (en) A kind of data load method, terminal and computing cluster
CN103634379B (en) Management method for distributed storage space and distributed storage system
CN106534308B (en) Method and device for solving data block access hot spot in distributed storage system
CN106648909A (en) Management method and device for dish lock and system
CN113010496B (en) Data migration method, device, equipment and storage medium
CN103312624A (en) Message queue service system and method
JP2019528490A (en) System and method for efficient diversion of connections in a multitenant database environment
CN103729236A (en) Method for limiting resource using limit of cloud computing users
CN107872517A (en) A kind of data processing method and device
CN105893320A (en) Remote task function calling method oriented at multi-core processor
CN106960011A (en) Metadata of distributed type file system management system and method
CN106533961A (en) Flow control method and device
EP2318914A1 (en) Method and apparatus for audit logging and role based security using one-way proxy architecture
CN110231977A (en) Processing method, device, storage medium and the electronic device of database
CN101378329A (en) Distributed business operation support system and method for implementing distributed business
CN112596669A (en) Data processing method and device based on distributed storage
CN104391876A (en) Static data storing and querying method and system
CN108132759A (en) A kind of method and apparatus that data are managed in file system
CN104219163A (en) Load balancing method for node dynamic forward based on dynamic replication method and virtual node method
CN101471955A (en) Method for writing equipment data in dual-controller network storage circumstance

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20191209

Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands

Patentee after: Innovative advanced technology Co., Ltd

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Co., Ltd.

TR01 Transfer of patent right