CN107295046B - User migration method and device - Google Patents

User migration method and device Download PDF

Info

Publication number
CN107295046B
CN107295046B CN201610203110.7A CN201610203110A CN107295046B CN 107295046 B CN107295046 B CN 107295046B CN 201610203110 A CN201610203110 A CN 201610203110A CN 107295046 B CN107295046 B CN 107295046B
Authority
CN
China
Prior art keywords
target user
data
data center
user
bound
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
CN201610203110.7A
Other languages
Chinese (zh)
Other versions
CN107295046A (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.)
Alibaba Singapore Holdings Pte 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 CN201610203110.7A priority Critical patent/CN107295046B/en
Publication of CN107295046A publication Critical patent/CN107295046A/en
Application granted granted Critical
Publication of CN107295046B publication Critical patent/CN107295046B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/148Migration or transfer of sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The present disclosure relates to the field of network communication technologies, and in particular, to a method and a device for migrating a user, so as to solve a problem that usage of a global user is affected when the user is migrated to a newly added data center. After determining to add the data center, determining a target user belonging to the newly added data center; according to the binding relationship, all user data of the target users in the original data center bound by each target user are synchronized to the newly added data center; and after all the user data of the target user in the original data center are synchronized to the newly added data center, controlling the original data center to stop writing the user data of the target user, and replacing the original data center bound with the target user in the binding relationship with the newly added data center. According to the embodiment of the disclosure, before all data of the target user are determined to be synchronized to the newly added data center, the target user only needs to be stopped writing data in the data center for a short time, and other global users cannot be influenced.

Description

User migration method and device
Technical Field
The present disclosure relates to the field of network communication technologies, and in particular, to a method and a device for user migration.
Background
With the development of internet technology, users of the internet are more and more, and the distribution is more and more extensive. Especially, most of the users of large internet companies are distributed in a wide geographical area, and more large internet companies develop business towards the world, so that the network service provided by the large internet companies faces the mass users distributed around the world.
With the increase of users of internet companies and the wider and wider distribution of users, in order to better meet the needs of users, the internet companies need to provide a plurality of data centers, the plurality of data centers simultaneously provide network services to the outside, each data center serves a part of users, and all the users served by the data centers are globally all the users. In the multi-data center architecture of the internet company, an important part is the binding relationship between the user and the home data center. Moreover, with the increasing of internet users, the multi-data center architecture of the internet company often adds new data centers, and after the new data centers are added, users need to be allocated to the new data centers.
At present, when a data center is newly added in a multi-data center architecture, all global data centers are often stopped from external service, and the use of all global users is affected. And in the process of suspending all data center services, generating a binding relationship between a new data center and a user belonging to the data center, and migrating the user belonging to the new data center. And after the completion of the migration of the users belonging to the newly added data center is manually confirmed, starting all the data centers including the newly added data center to provide services to the outside.
In summary, when a user is migrated to a newly added data center, external services of all global data centers need to be stopped, which affects the use of all global users.
Disclosure of Invention
The present disclosure provides a user migration method and device, which are used to solve the problem that when a user is migrated to a newly added data center, external services of all global data centers need to be stopped, which affects the use of all global users.
Based on the foregoing problem, an embodiment of the present disclosure provides a method for user migration, including:
after the data center is determined to be added, stopping changing the binding relationship between the users and the data center, and determining all target users belonging to the newly added data center;
according to the binding relationship, all user data of the target users in the original data center bound by each target user are synchronized to the newly added data center;
and for any target user, after all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center, controlling the original data center bound by the target user to stop writing the user data of the target user, and replacing the original data center bound with the target user in the binding relationship with the newly added data center.
According to the embodiment of the disclosure, when the data center is determined to be newly added, the binding relationship between the user and the data center is temporarily stopped to be changed, and the target user to be migrated to the newly added data center is determined. After the target user is determined, the binding relationship of other users in the data center can be changed, and other users are not affected any more. When the target user is migrated to the newly added data center, all user data of the target user needs to be synchronized to the newly added data center, and the target user is stopped from writing data, so that the target user is migrated.
Optionally, after the controlling the original data center bound to the target user stops writing the user data of the target user, before replacing the original data center bound to the target user in the binding relationship with the newly added data center, the method further includes:
and determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
According to the embodiment of the disclosure, before the target user is migrated to the newly added data center, it is determined that the synchronization of all user data of the target user to the newly added data center is completed, so that the consistency of the user data of the target user in the original data center and the newly added data center can be ensured.
Optionally, all the user data of the target users in the original data center bound by each target user includes incremental data and stock data;
and according to the binding relationship, synchronizing all the user data of the target users in the original data center bound by each target user to the newly added data center, including:
synchronizing the incremental data and the stock data of the target users in the original data center bound by each target user to the newly added data center;
the incremental data of the target user is newly added or changed data after all user data of the target user in an original data center bound by the target user is synchronized to the newly added data center; the inventory data of the target user is data generated before all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center.
The embodiment of the disclosure divides all user data of the target user into incremental data and stock data; and all incremental data and all stock data of the target user are synchronized to the newly added data center, so that all user data generated by the target user in the original data center are all synchronized to the newly added data center.
Optionally, the synchronizing the incremental data and the stock data of the target user in the original data center bound to each target user to the newly added data center includes:
aiming at any target user, synchronizing the incremental data of the target user in the original data center bound by the target user to the newly added data center through an incremental data synchronization program between the original data center bound by the target user and the newly added data center;
after the incremental data of the target user in the original data center bound by the target user is synchronized to the newly added data center, the stock data of the target user in the original data center bound by the target user is synchronized to the newly added data center through a stock data synchronization program between the original data center bound by the target user and the newly added data center.
Since the incremental data of the embodiment of the present disclosure is executed by the incremental data synchronization program between the original data center and the newly added data center, the stock data is executed by the stock data synchronization program between the original data center and the newly added data center, and the stock data of the target user is synchronized after the synchronization of the incremental data of the target user is started. The embodiment of the disclosure provides a method for synchronizing incremental data and stock data, so that the incremental data and the stock data of a target user are all synchronized to a newly added data center.
Optionally, before the controlling the original data center bound by the target user to stop writing the user data of the target user, the method further includes:
for any target user, determining that all stock data of the target user in an original data center bound by the target user are synchronously finished;
the determining that the all user data of the target user in the original data center bound with the target user is completed synchronously comprises:
and if it is determined that all the incremental data of the target user in the original data center bound with the target user are completed synchronously, determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
After determining that all stock data of the target user in the original data center are synchronized to the newly-added data center, the original data center stops all data of the target user, so that the influence on the target user can be reduced to the maximum extent; and after the stock data synchronization is completed, the original data center is controlled to stop writing the user data of the target user, and whether the incremental data are completed synchronously can be judged only after the user data of the target user are stopped being written, so that after the incremental data are completed synchronously, the stock data can be determined to be completed synchronously, namely, all the user data of the target user are determined to be completed synchronously.
Optionally, whether all the stock data of the target user in the original data center bound by the target user is completed synchronously is judged according to the following modes:
judging whether all stock data synchronization programs between the original data center and the newly added data center bound by the target user are executed or not;
if yes, determining that all stock data of the target user in the original data center bound by the target user are completed synchronously;
otherwise, determining that all the inventory data of the target user in the original data center bound by the target user are not synchronously finished.
The embodiment of the disclosure provides a method for judging whether all stock data of the target user in the original data center are synchronized to the newly added data center, so that whether all stock data of the target user in the original data center are synchronized to the newly added data center can be accurately judged.
Optionally, the controlling the original data center bound by the target user to stop writing the user data of the target user includes:
judging whether all stock data of the target user in the original data center bound by the target user is finished synchronously within a set time length;
if yes, controlling the original data center bound by the target user to stop writing the user data of the target user;
otherwise, continuously judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished within the next set time length until all the stock data of the target user in the original data center bound by the target user are synchronously finished.
In the embodiment of the disclosure, the original data center stops the target user from writing all data within a set time, and before the target user stops writing all data, it is further required to ensure that all stock data of the target user in the original data center is synchronized to the newly-added data center, so that the influence of the migration process of the target user on the target user is reduced to the maximum extent.
Optionally, whether all the incremental data of the target user in the original data center bound by the target user are completed synchronously is judged according to the following modes:
acquiring the sites of all incremental data synchronization programs between the original data center and the newly added data center bound by the target user;
judging whether all the sites of all the incremental data synchronization programs are later than the time point when the original data center bound by the target user stops writing the user data of the target user;
if yes, determining that all the incremental data of the target user in the original data center bound by the target user are completed synchronously;
otherwise, returning to the step of acquiring all incremental data synchronization program sites between the original data center and the newly added data center bound by the target user.
The embodiment of the disclosure provides a method for accurately judging the completion of the synchronization of all incremental data corresponding to the target user, so that all the incremental data corresponding to the target user are ensured to be synchronized to the newly added data center before the target user migrates from the original data center to the newly added data center.
Optionally, the determining, within a set time period, whether all the stock data of the target user in the original data center bound by the target user is completed synchronously includes:
determining an idle period corresponding to the target user according to the historical access data corresponding to the target user;
selecting a period of time from the idle time period, taking the period of time as the set time, and judging whether all stock data of the target user in the original data center bound by the target user is synchronously finished within the set time.
The embodiment of the disclosure selects a set time length in the idle time period of the target user to judge whether stock data is finished or not, and stops writing for the target user after determining that the stock data is synchronously finished, so that the stock data is ensured to be synchronously finished when writing is stopped, the writing stop time length for the target user is reduced, the migration process is transparent to the target user, and the influence on the target user is greatly reduced.
On the other hand, an embodiment of the present disclosure further provides an apparatus for migrating a user, including:
the determining module is used for stopping changing the binding relationship between the user and the data center after determining to add the data center, and determining all target users belonging to the newly added data center;
the synchronization module is used for synchronizing all user data of the target users in the original data center bound by each target user to the newly added data center according to the binding relationship;
and the processing module is used for controlling the original data center bound by the target user to stop writing the user data of the target user into the original data center bound by the target user after all the user data of the target user in the original data center bound by the target user are synchronized to the newly added data center aiming at any target user, and replacing the original data center bound with the target user in the binding relationship with the newly added data center.
Optionally, the processing module is further configured to:
and determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
Optionally, all the user data of the target users in the original data center bound by each target user includes incremental data and stock data;
the synchronization module is specifically configured to:
synchronizing the incremental data and the stock data of the target users in the original data center bound by each target user to the newly added data center; the incremental data of the target user is newly added or changed data after all user data of the target user in an original data center bound by the target user is synchronized to the newly added data center; the inventory data of the target user is data generated before all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center.
Optionally, the synchronization module is specifically configured to:
aiming at any target user, synchronizing the incremental data of the target user in the original data center bound by the target user to the newly added data center through an incremental data synchronization program between the original data center bound by the target user and the newly added data center; after the incremental data of the target user in the original data center bound by the target user is synchronized to the newly added data center, the stock data of the target user in the original data center bound by the target user is synchronized to the newly added data center through a stock data synchronization program between the original data center bound by the target user and the newly added data center.
Optionally, the processing module is further configured to:
for any target user, determining that all stock data of the target user in an original data center bound by the target user are synchronously finished;
and if it is determined that all the incremental data of the target user in the original data center bound with the target user are completed synchronously, determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
Optionally, the processing module is further configured to:
judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished according to the following modes:
judging whether all stock data synchronization programs between the original data center and the newly added data center bound by the target user are executed or not; if yes, determining that all stock data of the target user in the original data center bound by the target user are completed synchronously; otherwise, determining that all the inventory data of the target user in the original data center bound by the target user are not synchronously finished.
Optionally, the processing module is specifically configured to:
judging whether all stock data of the target user in the original data center bound by the target user is finished synchronously within a set time length; if yes, controlling the original data center bound by the target user to stop writing the user data of the target user; otherwise, continuously judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished within the next set time length until all the stock data of the target user in the original data center bound by the target user are synchronously finished.
Optionally, the processing module is further configured to:
judging whether all the incremental data of the target user in the original data center bound by the target user are synchronously finished according to the following modes:
acquiring the sites of all incremental data synchronization programs between the original data center and the newly added data center bound by the target user; judging whether all the sites of all the incremental data synchronization programs are later than the time point when the original data center bound by the target user stops writing the user data of the target user; if yes, determining that all the incremental data of the target user in the original data center bound by the target user are completed synchronously; otherwise, returning to the step of acquiring all incremental data synchronization program sites between the original data center and the newly added data center bound by the target user.
Optionally, the processing module is specifically configured to:
determining an idle period corresponding to the target user according to the historical access data corresponding to the target user; selecting a period of time from the idle time period, taking the period of time as the set time, and judging whether all stock data of the target user in the original data center bound by the target user is synchronously finished within the set time.
Drawings
FIG. 1 is a flow chart of a method for migrating a user according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a method for synchronizing incremental data and inventory data, respectively, according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for determining whether all incremental data of a target user in an original IDC are synchronized to a newly added IDC according to an embodiment of the present disclosure;
FIG. 4A is a schematic diagram of a method for determining incremental data synchronization procedure sites according to an embodiment of the present disclosure;
FIG. 4B is a schematic diagram of a method for determining incremental data synchronization procedure sites between an original IDC and a newly added IDC according to an embodiment of the present disclosure;
fig. 4C is a schematic diagram of a first method for determining whether all incremental data of a target user in an original IDC is completed synchronously according to an embodiment of the present disclosure;
fig. 4D is a schematic diagram of a second method for determining whether all incremental data of a target user in an original IDC is completed synchronously according to the embodiment of the present disclosure;
fig. 4E is a schematic diagram of a third method for determining whether all incremental data of a target user in an original IDC is completed synchronously according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating an overall method for migrating a user according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a device for migrating a user according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort fall within the scope of protection of the present disclosure.
After determining to add the data center, the embodiment of the disclosure stops changing the binding relationship between the user and the data center, and determines all target users belonging to the newly added data center; according to the binding relationship, all user data of the target users in the original data center bound by each target user are synchronized to the newly added data center; and for any target user, after all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center, controlling the original data center bound by the target user to stop writing the user data of the target user, and replacing the original data center bound with the target user in the binding relationship with the newly added data center.
According to the embodiment of the disclosure, when the data center is determined to be newly added, the binding relationship between the user and the data center is temporarily stopped to be changed, and the target user to be migrated to the newly added data center is determined. After the target user is determined, the binding relationship of other users in the data center can be changed, and other users are not affected any more. When the target user is migrated to the newly added data center, all user data of the target user needs to be synchronized to the newly added data center, and the target user is stopped from writing data, so that the target user is migrated.
The embodiment of the disclosure can be applied to a scene that a plurality of data centers provide services for users. In this scenario, an important component in this scenario is to record the mapping relationship of the user to its nearest data center, i.e. to determine the relationship between the user and the data center to which the user belongs. With the increasing number of users or the increasing development of services, a problem often faced is to add new data centers in the original multi-data center architecture. After the data center is newly added, users are allocated to the newly added data center, and the users belonging to the newly added data center are migrated to the newly added data center.
The embodiment of the disclosure takes the user determined to be migrated to the newly added data center as a target user. In the process of migrating the target user to the newly added data center, an important step is to synchronize the data of the target user to the newly added data center. And after all the data of the target user are determined to be synchronized to the newly added data center, binding the target user with the newly added data center, and completing the migration of the target user.
After determining the new data center, the control center of the embodiment of the disclosure stops dynamic changes of all global users, wherein the dynamic changes of the users are the data centers to which the changed users belong.
After the newly added data center is determined, the control center also needs to generate a binding relationship between the latest data center and the user of the home data center according to all the data centers including the newly added data center, so as to determine the target user bound with the newly added data center.
Specifically, the embodiments of the present disclosure may employ, but are not limited to, the following ways when generating the binding relationship between the latest data center and the user of the home data center.
1. Based on a Domain Name System (DNS) technology, a Domain Name is resolved to a nearby data center according to a geographical area to which an IP (internet protocol) address field of a user belongs, and the data center to which the user belongs is determined.
2. And determining a home location to which the user ID (Identity) is continuously resolved by the DNS according to the big data analysis, and taking the data center of the home location as the data center to which the user belongs.
It should be noted that the two ways of generating the binding relationship between the latest data center and the user of the home data center in the embodiment of the disclosure are only examples of generating the binding relationship between the latest data center and the user of the home data center in the embodiment of the disclosure, and any way capable of generating the binding relationship between the latest data center and the user of the home data center is applicable to the disclosure.
After the binding relationship between the latest data center and the user of the home data center is generated, the target user bound with the newly added data center is determined.
It should be noted that, according to the binding relationship between the latest data center generated by all the data centers including the new data center and the user of the home data center, the embodiment of the disclosure only changes the home relationship of a part of users from the original data center (hereinafter referred to as the original data center) to the new data center, compared with the binding relationship between the original data center and the user of the home data center.
The Data Center of the embodiment of the disclosure may be an IDC (Internet Data Center), and may also be other centers for storing Data. For convenience of description, the data center is an IDC as an example. It should be noted that the processing method of the data center being another center for storing data is the same as the processing method of the data center being an IDC, and is not described herein again.
The IDC of the embodiment of the present disclosure is specifically an internet data center, in which a certain number of network servers are stored, and specific internet software is deployed on the network servers to provide network services to users of the internet.
Embodiments of the present disclosure are described in further detail below with reference to the drawings.
As shown in fig. 1, an embodiment of the present disclosure provides a user migration method, including:
step 101, after determining to add the IDCs, stopping changing the binding relationship between the users and the IDCs, and determining all target users belonging to the newly added IDCs;
step 102, according to the binding relationship, synchronizing all user data of the target user in the original IDC bound by each target user to the newly added IDC;
step 103, for any target user, after all user data of the target user in the original IDC bound by the target user are synchronized to the new IDC, controlling the original IDC bound by the target user to stop writing the user data of the target user, and replacing the original IDC bound by the target user in the binding relationship with the new IDC.
The embodiment of the disclosure takes the user needing to be migrated from the original IDC to the newly added IDC as the target user.
For any target user, the migration of the target user comprises the steps of synchronizing the user data of the target user to the newly added IDC, binding the target user with the newly added IDC, and providing network service for the target user by the IDC to which the target user belongs, namely the original IDC before the target user is bound with the newly added IDC.
The embodiment of the disclosure divides the data of the target user into increment data and stock data.
The incremental data of the target user is newly added or changed data after all user data of the target user in the original IDC bound by the target user is synchronized to the newly added IDC;
and the stock data of the target user is data generated before all user data of the target user in the original IDC bound by the target user is synchronized to the newly added IDC.
For example, the user a is a target user, and the user a needs to be migrated from the original IDC to the new IDC. It is determined that user a starts data synchronization at 00:00: 00. After 00:00:00, all data operated by user a is incremental data, wherein the operation of user a on the data includes, but is not limited to, adding, updating, deleting, reading data. Before 00:00:00, all data generated by the user a is called stock data, wherein the data generated by the user a comprises all data operated by the user a, namely all data added, updated, deleted and read by the user a before 00:00: 00.
Optionally, in the embodiment of the present disclosure, all user data of the target user in the original IDC bound to each target user is synchronized to the new IDC, that is, the incremental data and the stock data of the target user in the original IDC bound to each target user are synchronized to the new IDC.
In the embodiment of the disclosure, synchronizing all user data of the target user in the original IDC bound to the target user to the new IDC means synchronizing incremental data of the target user in the original IDC bound to the target user to the new IDC.
That is, when all user data of the target user are synchronized to the newly added IDC, the incremental data of the target user are synchronized to the newly added IDC first, and after the synchronization of the incremental data is started, stock data of the target user is synchronized to the newly added IDC, so that all user data of the target user in the original IDC are synchronized to the newly added IDC.
Specifically, for the incremental data of the target user, the embodiment of the present disclosure synchronizes to the newly added IDC in the following manner.
And aiming at any target user, synchronizing the incremental data of the target user in the original IDC bound by the target user to the newly added IDC through an incremental data synchronization program between the original IDC bound by the target user and the newly added IDC.
When the incremental data of the target user is synchronized between the original IDC and the newly added IDC, the incremental data of the target user of the original IDC is synchronized into the newly added IDC through all incremental data synchronization programs between the original IDC and the newly added IDC based on a binlog/redolog data synchronization mechanism.
The embodiment of the disclosure includes one or more incremental data synchronization programs between the original IDC and the newly added IDC, each incremental data synchronization data executes a specific type of user data, and when the original IDC is different, the incremental data synchronization programs between the original IDC and the newly added IDC are different.
For example, for a target user a, an IDC to which the user a originally belongs is IDC1, IDC3 is a newly added IDC, and three incremental data synchronization programs are included between IDC1 and IDC3, which are respectively: a first incremental data synchronization procedure, a second incremental data synchronization procedure, and a third incremental data synchronization procedure. Wherein the first incremental data synchronization procedure is performed to synchronize the commodity incremental data of user A in IDC1 to IDC 3; the second incremental data synchronization program performs the synchronization of the user comment incremental data of the user A in the IDC1 to the IDC 3; the third incremental data synchronization routine performs the synchronization of user A's order incremental data in IDC1 to IDC 3.
For another example, for the target user a, the IDC to which the user a originally belongs is IDC1, IDC3 is a newly added IDC, and three incremental data synchronization programs are included between IDC1 and IDC3, which are respectively: a first incremental data synchronization procedure, a second incremental data synchronization procedure, and a third incremental data synchronization procedure. Aiming at a target user B, the IDC to which the user B originally belongs is IDC2, IDC3 is newly added IDC, and three incremental data synchronization programs are included between IDC2 and IDC3, wherein the three incremental data synchronization programs are respectively as follows: a fourth incremental data synchronization program, a fifth incremental data synchronization program, and a sixth incremental data synchronization program. And the first incremental data synchronization program, the second incremental data synchronization program, the third incremental data synchronization program, the fourth incremental data synchronization program, the fifth incremental data synchronization program, and the sixth incremental data synchronization program are incremental data synchronization programs different from each other.
Specifically, for the stock data of the target user, the embodiment of the disclosure synchronizes to the newly added IDC in the following manner.
After the incremental data of the target user in the original IDC bound by the target user is synchronized to the newly added IDC, the stock data of the target user in the original IDC bound by the target user is synchronized to the newly added IDC through a stock data synchronization program between the original IDC bound by the target user and the newly added IDC.
According to the embodiment of the disclosure, through the stock data synchronization program between the original IDC and the newly added IDC, the stock data of the target user in the original IDC is synchronized to the newly added IDC.
For example, when the user a is the target user, the original IDC to which the user a belongs is IDC1, and the newly added IDC is IDC 3. As shown in FIG. 2, user A's user data is synchronized from IDC1 to IDC3 at time t 0. Then after time t0, user a generated data in IDC1 as incremental data and before time t0, user a generated data in IDC1 as inventory data, where time t0 is 00:00: 00.
After time 00:00:00 arrives at t0, user A's incremental data in IDC1 is synchronized to IDC 3. After time t1, user A's inventory data in IDC1 is synchronized to IDC3, where time t1 is 00:01: 00.
It should be noted that the stock data synchronization program and the incremental data synchronization program of the embodiment of the present disclosure are different data synchronization programs.
When the stock data synchronization program of the embodiment of the disclosure executes the stock data synchronization between the original IDC and the newly added IDC, the stock data synchronization program reads the stock data with the fixed size from the original IDC each time according to the time sequence corresponding to the stock data in the original IDC, and synchronizes the stock data with the fixed size read each time to the newly added IDC until all the stock data in the original IDC are synchronized to the newly added IDC, and then the execution of the stock data synchronization program is completed.
The unit of the stock data is not definite, and the unit of the stock data is different according to different data types. For example, when stock data is stored in the form of each piece of data, the stock data of a fixed size is the stock data of a fixed number; or the fixed size inventory data may also be fixed capacity inventory data.
It should be noted that, when determining the size of the stock data read from the original IDC each time by the stock data synchronization program, the size may be determined according to the performance of the stock data synchronization program and the required efficiency of the stock data synchronization.
The embodiment of the disclosure includes one or more stock data synchronization programs between the original IDC and the newly added IDC, each of which executes user data of a specific type, and when the original IDC is different, the stock data synchronization programs between the original IDC and the newly added IDC are different.
For example, for a target user a, an IDC to which the user a originally belongs is IDC1, IDC3 is a newly added IDC, and three stock data synchronization programs are included between IDC1 and IDC3, which are respectively: a first inventory data synchronization program, a second inventory data synchronization program, and a third inventory data synchronization program. Wherein the first stock data synchronization procedure is performed to synchronize the commodity stock data of the user a in the IDC1 to the IDC 3; the second inventory data synchronization program executes to synchronize the user comment inventory data of the user A in the IDC1 to the IDC 3; the third inventory data synchronization routine performs to synchronize the order inventory data of user A in IDC1 to IDC 3.
For another example, for the target user a, the IDC to which the user a originally belongs is IDC1, IDC3 is a newly added IDC, and three stock data synchronization programs are included between IDC1 and IDC3, which are respectively: a first inventory data synchronization program, a second inventory data synchronization program, and a third inventory data synchronization program. Aiming at a target user B, the IDC to which the user B originally belongs is IDC2, IDC3 is newly added IDC, and three stock data synchronization programs are included between IDC2 and IDC3, wherein the three stock data synchronization programs are respectively as follows: a fourth inventory data synchronization program, a fifth inventory data synchronization program, and a sixth inventory data synchronization program. And the first stock data synchronizing program, the second stock data synchronizing program, the third stock data synchronizing program, the fourth stock data synchronizing program, the fifth stock data synchronizing program, and the sixth stock data synchronizing program are mutually different stock data synchronizing programs.
According to the embodiment of the disclosure, before the target user is bound to the newly added IDC, all user data of the target user in the original IDC need to be synchronized to the newly added IDC, and all user data comprise incremental data and stock data. Therefore, before binding the target user with the new IDC, it is necessary to determine whether all incremental data of the target user in the original IDC are synchronized to the new IDC, and whether all stock data of the target user in the original IDC are synchronized to the new IDC. The following description will be made separately.
Firstly, judging whether all stock data of a target user in an original IDC are synchronous to a newly added IDC.
The embodiment of the disclosure judges whether all stock data of the target user in the original IDC bound by the target user is synchronously finished according to the following modes:
judging whether all stock data synchronization programs between the original IDC and the newly added IDC bound by the target user are executed or not; if yes, determining that all stock data of the target user in the original IDC bound by the target user are completed synchronously; otherwise, determining that all the inventory data of the target user in the original IDC bound by the target user are not completed synchronously.
The method comprises the steps that one or more stock data synchronization programs are included between an original IDC and a newly added IDC, when whether all stock data of a target user in the original IDC are synchronized to the newly added IDC or not is judged, whether all stock data synchronization programs between the original IDC and the newly added IDC are executed or not is judged, and if all stock data synchronization programs between the original IDC and the newly added IDC are executed completely, all stock data of the target user in the original IDC bound by the target user are determined to be synchronously completed; and if at least one of all stock data synchronization programs between the original IDC and the newly-added IDC is not executed, determining that all the stock data of the target user in the original IDC bound by the target user are not synchronously completed.
For example, for a target user a, an IDC to which the user a originally belongs is IDC1, IDC3 is a newly added IDC, and three stock data synchronization programs are included between IDC1 and IDC3, which are respectively: a first inventory data synchronization program, a second inventory data synchronization program, and a third inventory data synchronization program. Wherein the first stock data synchronization procedure is performed to synchronize the commodity stock data of the user a in the IDC1 to the IDC 3; the second inventory data synchronization program executes to synchronize the user comment inventory data of the user A in the IDC1 to the IDC 3; the third inventory data synchronization routine performs to synchronize the order inventory data of user A in IDC1 to IDC 3. When judging whether all stock data of the user A in the IDC1 are synchronized to the IDC3, respectively judging whether the first stock data synchronization program, the second stock data synchronization program and the third stock data synchronization program are completely executed, and if the first stock data synchronization program, the second stock data synchronization program and the third stock data synchronization program are completely executed, determining that all stock data of the user A in the IDC1 are synchronized to the IDC 3; if any of the first, second, and third inventory data synchronization programs is not completed, it is determined that all of the inventory data of the user a at the IDC1 is not all synchronized to the IDC 3.
And secondly, judging whether all incremental data of the target user of the original IDC bound by the target user are synchronously finished.
As shown in fig. 3, the embodiment of the present disclosure determines whether all incremental data of the target user of the original IDC bound by the target user is completed synchronously according to the following manner.
Step 301, controlling the original IDC bound by the target user to stop writing user data of the target user;
step 302, acquiring all incremental data synchronization program sites between an original IDC and the newly added IDC bound by a target user;
step 303, judging whether all the positions of all the incremental data synchronization programs are later than the time point when the original IDC bound by the target user stops writing the user data of the target user, if so, executing step 304, and if not, executing step 302;
and step 304, determining that all the incremental data of the target user in the original IDC bound by the target user are completed synchronously.
The embodiment of the disclosure judges whether all incremental data of the target user are synchronized to the newly added IDC or not after the target user is stopped writing the user data in the original IDC by stopping the target user from writing the user data in the original IDC. And if the fact that all the incremental data of the target user are not synchronized is determined, continuing to stop the target user from writing all the data in the original IDC, and continuously judging whether all the incremental data of the target user are synchronized until all the incremental data of the target user are determined to be synchronized.
The stop writing of embodiments of the present disclosure may also be referred to as stop updating. Specifically, writing data includes, but is not limited to, the following operations:
adding data, modifying data, deleting data and reading data.
In addition, when the original IDC is controlled to stop writing the user data of the target user, the embodiment of the disclosure adopts an SQL (Structured Query Language) interception mode, and throws an exception after the SQL is intercepted to roll back the transaction to realize writing stop.
In the embodiment of the disclosure, the time point when the original IDC stops writing the user data of the target user is not any time point, and in order to reduce the influence on the user to the maximum extent, the embodiment of the disclosure determines the time point when the original IDC stops writing all the data of the target user in the following manner.
Judging whether all stock data of the target user in the original IDC bound by the target user is synchronously finished within a set time length; if so, controlling the original IDC bound by the target user to stop writing the user data of the target user; otherwise, continuously judging whether all stock data of the target user in the original IDC bound by the target user are synchronously finished within the next set time length until all stock data of the target user in the original IDC bound by the target user are synchronously finished.
After the embodiment of the disclosure determines that all stock data of the target user are synchronous, the controller IDC stops writing the user data of the target user. If the original IDC is controlled to stop writing the user data of the target user when all stock data of the target user are not synchronously finished, and the incremental data of the target user are determined to be synchronously finished, but the stock data are not synchronously finished, waiting time is needed to wait for all stock data of the target user to be synchronously finished. Therefore, after the embodiment of the disclosure determines that all stock data of the target user are synchronized, the controller IDC stops writing the user data of the target user, so that the waiting time is reduced to the maximum extent, and the influence on the target user is reduced.
The embodiment of the disclosure determines the set time length according to the following mode.
Optionally, determining an idle period corresponding to the target user according to the historical access data corresponding to the target user; selecting a period of time from the idle time period, taking the period of time as the set time, and judging whether all stock data of the target user in the original IDC bound by the target user is synchronously finished within the set time.
Specifically, the set time period is determined according to the following steps.
1. Acquiring historical access data of a target user within a certain time length, wherein the certain time length can be one month;
2. analyzing the acquired historical access data of the target user within a certain time, wherein the data analysis process mainly comprises the step of determining the time of each access of the target user;
3. determining a time range within which a user does not access within a 24-hour period all day according to an analysis result of historical access data within a certain time length, and taking the time range as an idle time period corresponding to the target user;
4. and selecting a period of time from the idle time period, and taking the period of time as the set time, wherein the selected set time can be any period of time of the idle time period.
For example, when the set time length corresponding to the target user A is determined, according to the obtained historical access data of the target user A, analyzing the obtained historical access data of the target user A, determining that the target user A cannot access in the time period from 00:00:00 to 00:10:00, taking the time period from 00:00:00 to 00:10:00 as the idle time period of the target user A, selecting the time period from 00:00:00 to 00:05:00 as the set time length corresponding to the target user A in the idle time period from 00:00: 00:00 to 00:10:00, judging whether the stock data of the target user is synchronously finished in the set time length, and if the synchronous finishing is finished, stopping writing the user data of the target user; and if the target user does not synchronously finish the stock data, judging again in the next time length from 00:00:00 to 00:05: 00.
Or, the idle time periods of all target users are obtained by analyzing historical access data of all target users within a certain time. Grouping the target users according to the idle time periods of all the target users, grouping the target users with the idle time periods close to each other into a group, determining a public idle time period according to the idle time periods of the group of target users, and selecting a period of time as the set time period corresponding to the group of target users in the public idle time period.
In implementation, if all stock data of the target user in the original IDC are determined to be synchronized to the newly added IDC within the set time length corresponding to the target user, the original IDC is controlled to stop writing all data of the target user.
And if it is determined that all stock data of the target user in the original IDC are not synchronized to the newly added IDC within the set time length corresponding to the target user, continuing to judge in the idle time period of the next target user.
It should be noted that the set time length of the target user in the embodiment of the present disclosure is a time length with a period of 24 hours. For example, the set time duration corresponding to the target user is 00:00:00-00:10:00, and the time period of 00:00:00-00:10:00 every day is the set time duration corresponding to the target user.
In an embodiment of the present disclosure, a location of the incremental data synchronization program is a time point corresponding to data executed by the incremental data synchronization program at the current time, where the time point corresponding to the data is a time point of a last operation performed on the data, and the operation performed on the data includes, but is not limited to, the following operations:
adding data, updating data, deleting data and reading data.
In the embodiment of the disclosure, through the incremental data synchronization program, a certain delay exists in the process of synchronizing the incremental data corresponding to the target user from the original IDC to the newly added IDC. When the position of the incremental data synchronization program is determined, the time point corresponding to the data executed by the data synchronization program at the current moment is used as the position of the incremental data synchronization program. For example, as shown in fig. 4A, when the current time T0 is 00:10:10, and the time T1 corresponding to the data executed by the incremental data synchronization program is determined to be 00:10:05, the location of the incremental data synchronization program is determined to be 00:10: 05.
The method comprises the steps that one or more incremental data synchronization programs are included between an original IDC and a newly added IDC, when whether incremental data synchronization of a target user in the original IDC is completed or not is judged, all incremental data synchronization program sites between the original IDC and the newly added IDC need to be obtained, and the earliest site is selected from all the determined incremental data synchronization program sites.
For example, four incremental data synchronization programs are included between the original IDC and the newly added IDC, which are a first incremental data synchronization program, a second incremental data synchronization program, a third incremental data synchronization program and a fourth incremental data synchronization program, respectively. As shown in fig. 4B, it is assumed that the current time T0 is 12:10:10, and a point T1 at which the first incremental data synchronization program is acquired is 12:10: 08; the point t2 for acquiring the second incremental data synchronization program is 12:10: 05; the site t3 for acquiring the third incremental data synchronization program is 12:10: 09; the site for acquiring the fourth incremental data synchronization program is 12:09: 56; the earliest site, i.e., site 12:09:56 of the fourth incremental data synchronization program, is selected from the acquired sites of the four incremental data synchronization programs.
After the earliest site in the sites of all incremental data synchronization programs between the original IDC and the newly added IDC is selected, whether the incremental data synchronization of the target user in the original IDC is completed or not is judged by comparing the earliest site in the sites of all the incremental data synchronization programs with the time point when the original IDC stops writing all data of the target user; if the earliest position point in the positions of all incremental data synchronization programs is later than the time point when the original IDC stops writing all data of the target user, determining that all incremental data of the target user in the original IDC are synchronized; and if the earliest position in the positions of all incremental data synchronization programs is not later than the time point when the original IDC stops writing all data of the target user, determining that all the incremental data of the target user in the original IDC are not synchronized.
For example, as shown in fig. 4C, at 12:10:00 the original IDC stops writing all data of the target user, the time point T1 at which the original IDC stops writing all data of the target user is 12:10: 00. And four incremental data synchronization programs are included between the original IDC and the newly added IDC, namely a first incremental data synchronization program, a second incremental data synchronization program, a third incremental data synchronization program and a fourth incremental data synchronization program. After the original IDC stopped writing all the data of the target user, assume that the sites of the respective incremental data synchronization programs were acquired at time T0, and time T0 is 12:10: 10. The site t1 for acquiring the first incremental data synchronization program is 12:10: 00; the point t2 for acquiring the second incremental data synchronization program is 12:10: 05; the site t3 for acquiring the third incremental data synchronization program is 12:10: 03; the point t4 at which the fourth incremental data synchronization procedure is acquired is 12:09: 56. The earliest locus, i.e., the locus t4 of the fourth incremental data synchronization program, is selected from the acquired loci of the four incremental data synchronization programs. By comparing the earliest position T4 among the positions of the four incremental data synchronization procedures with the time point T1 at which the original IDC stopped writing all data of the target user, it is determined that the earliest position T4 is earlier than the time point T1 at which the original IDC stopped writing all data of the target user, and it is determined that all the incremental data of the target user in the original IDC was not synchronized.
For another example, as shown in fig. 4D, when the original IDC stops writing all data of the target user at 12:10:00, the time point T1 when the original IDC stops writing all data of the target user is 12:10: 00. And four incremental data synchronization programs are included between the original IDC and the newly added IDC, namely a first incremental data synchronization program, a second incremental data synchronization program, a third incremental data synchronization program and a fourth incremental data synchronization program. After the original IDC stopped writing all the data of the target user, assume that the sites of the respective incremental data synchronization programs were acquired at time T0, and time T0 is 12:10: 10. The site t1 for acquiring the first incremental data synchronization program is 12:10: 02; the point t2 for acquiring the second incremental data synchronization program is 12:10: 05; the site t3 for acquiring the third incremental data synchronization program is 12:10: 03; the point t4 at which the fourth incremental data synchronization procedure is acquired is 12:10: 06. The earliest site, i.e., the site t1 of the first incremental data synchronization program, is selected from the sites of the four acquired incremental data synchronization programs. And determining that the synchronization of all incremental data of the target user in the original IDC is completed by comparing the earliest position T1 of the positions of the four incremental data synchronization programs with the time point T1 of the original IDC stopping writing all data of the target user and determining that the earliest position T1 is later than the time point T1 of the original IDC stopping writing all data of the target user.
It should be noted that, when it is determined that the earliest position among the positions of all incremental data synchronization procedures is equal to the time point at which the original IDC stops writing all the data of the target user, it is determined that all the incremental data of the target user in the original IDC is not synchronized.
For example, as shown in fig. 4E, when the original IDC stops writing all data of the target user at 12:10:00, the time point T1 when the original IDC stops writing all data of the target user is 12:10: 00. And four incremental data synchronization programs are included between the original IDC and the newly added IDC, namely a first incremental data synchronization program, a second incremental data synchronization program, a third incremental data synchronization program and a fourth incremental data synchronization program. After the original IDC stopped writing all the data of the target user, assume that the sites of the respective incremental data synchronization programs were acquired at time T0, and time T0 is 12:10: 10. The site t1 for acquiring the first incremental data synchronization program is 12:10: 00; the point t2 for acquiring the second incremental data synchronization program is 12:10: 05; the site t3 for acquiring the third incremental data synchronization program is 12:10: 03; the point t4 at which the fourth incremental data synchronization procedure is acquired is 12:10: 06. The earliest site, i.e., the site t1 of the first incremental data synchronization program, is selected from the sites of the four acquired incremental data synchronization programs. By comparing the earliest position T1 among the positions of the four incremental data synchronization procedures with the time point T1 at which the original IDC stopped writing all data of the target user, it is determined that the earliest position T1 is equal to the time point T1 at which the original IDC stopped writing all data of the target user, and it is determined that all incremental data of the target user in the original IDC was not synchronized.
It should be noted that, when acquiring all the sites of the data synchronization program between the original IDC and the new IDC, the embodiments of the present disclosure acquire all the sites of the incremental data synchronization program between the original IDC and the new IDC at the same time.
As shown in fig. 5, an overall flowchart of a method for migrating a user is provided in an embodiment of the present disclosure.
Step 501, after the IDCs are determined to be added, the binding relationship between the user and the IDCs is stopped to be changed, and all target users belonging to the newly added IDCs are determined;
step 502, aiming at any target user, synchronizing the incremental data of the target user in the original IDC bound by the target user to the newly added IDC through an incremental data synchronization program between the original IDC bound by the target user and the newly added IDC;
step 503, synchronizing the stock data of the target user in the original IDC bound by the target user to the newly added IDC through a stock data synchronization program between the original IDC bound by the target user and the newly added IDC;
step 504, within a set time length, judging whether all stock data synchronization programs between the original IDC bound by the target user and the newly added IDC are executed, if so, executing step 506, otherwise, executing step 505;
step 505, continuously judging whether all stock data of the target user in the original IDC bound by the target user are synchronously finished within the next set time length until all stock data of the target user in the original IDC bound by the target user are synchronously finished;
step 506, controlling the original IDC bound by the target user to stop writing the user data of the target user;
step 507, acquiring all incremental data synchronization program sites between the original IDC and the newly added IDC bound by the target user;
step 508, judging whether all the positions of the incremental data synchronization program are later than the time point when the original IDC bound by the target user stops writing the user data of the target user, if so, executing step 509, and if not, executing step 507;
step 509, determining that all the incremental data of the target user in the original IDC bound by the target user are completed synchronously;
and 510, replacing the original IDC bound with the target user in the binding relationship with the newly added IDC.
Based on the same inventive concept, the embodiment of the present disclosure further provides a device for migrating a user, and as the principle of the device for solving the problem is similar to the method for migrating a user in the embodiment of the present disclosure, the implementation of the device may refer to the implementation of the method, and repeated parts are not described again.
As shown in fig. 6, an embodiment of the present disclosure further provides an apparatus for migrating a user, including:
the determining module 601 is configured to, after determining to add a data center, stop changing the binding relationship between a user and the data center, and determine all target users belonging to the newly added data center;
a synchronization module 602, configured to synchronize, according to the binding relationship, all user data of the target user in the original data center bound by each target user to the newly added data center;
a processing module 603, configured to, for any target user, control, after all user data of the target user in the original data center bound by the target user are synchronized to the new data center, the original data center bound by the target user to stop writing the user data of the target user, and replace, in the binding relationship, the original data center bound by the target user with the new data center.
Optionally, the processing module 603 is further configured to:
and determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
Optionally, all the user data of the target users in the original data center bound by each target user includes incremental data and stock data;
the synchronization module 602 is specifically configured to:
synchronizing the incremental data and the stock data of the target users in the original data center bound by each target user to the newly added data center; the incremental data of the target user is newly added or changed data after all user data of the target user in an original data center bound by the target user is synchronized to the newly added data center; the inventory data of the target user is data generated before all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center.
Optionally, the synchronization module 602 is specifically configured to:
aiming at any target user, synchronizing the incremental data of the target user in the original data center bound by the target user to the newly added data center through an incremental data synchronization program between the original data center bound by the target user and the newly added data center; after the incremental data of the target user in the original data center bound by the target user is synchronized to the newly added data center, the stock data of the target user in the original data center bound by the target user is synchronized to the newly added data center through a stock data synchronization program between the original data center bound by the target user and the newly added data center.
Optionally, the processing module 603 is further configured to:
for any target user, determining that all stock data of the target user in an original data center bound by the target user are synchronously finished;
and if it is determined that all the incremental data of the target user in the original data center bound with the target user are completed synchronously, determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
Optionally, the processing module 603 is further configured to:
judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished according to the following modes:
judging whether all stock data synchronization programs between the original data center and the newly added data center bound by the target user are executed or not; if yes, determining that all stock data of the target user in the original data center bound by the target user are completed synchronously; otherwise, determining that all the inventory data of the target user in the original data center bound by the target user are not synchronously finished.
Optionally, the processing module 603 is specifically configured to:
judging whether all stock data of the target user in the original data center bound by the target user is finished synchronously within a set time length; if yes, controlling the original data center bound by the target user to stop writing the user data of the target user; otherwise, continuously judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished within the next set time length until all the stock data of the target user in the original data center bound by the target user are synchronously finished.
Optionally, the processing module 603 is further configured to:
judging whether all the incremental data of the target user in the original data center bound by the target user are synchronously finished according to the following modes:
acquiring the sites of all incremental data synchronization programs between the original data center and the newly added data center bound by the target user; judging whether all the sites of all the incremental data synchronization programs are later than the time point when the original data center bound by the target user stops writing the user data of the target user; if yes, determining that all the incremental data of the target user in the original data center bound by the target user are completed synchronously; otherwise, returning to the step of acquiring all incremental data synchronization program sites between the original data center and the newly added data center bound by the target user.
Optionally, the processing module 603 is specifically configured to:
determining an idle period corresponding to the target user according to the historical access data corresponding to the target user; selecting a period of time from the idle time period, taking the period of time as the set time, and judging whether all stock data of the target user in the original data center bound by the target user is synchronously finished within the set time.
The present disclosure is described above with reference to block diagrams and/or flowchart illustrations of methods, apparatus (systems) and/or computer program products according to embodiments of the disclosure. It will be understood that one block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, and/or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer and/or other programmable data processing apparatus, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the present disclosure may also be embodied in hardware and/or in software (including firmware, resident software, micro-code, etc.). Still further, the present disclosure may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this disclosure, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the disclosure.
It will be apparent to those skilled in the art that various changes and modifications can be made in the present disclosure without departing from the spirit and scope of the disclosure. Thus, if such modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to encompass such modifications and variations.

Claims (16)

1. A method for migrating users, the method comprising:
after the data center is determined to be added, stopping changing the binding relationship between the users and the data center, and determining all target users belonging to the newly added data center;
according to the binding relationship, all user data of the target users in the original data center bound by each target user are synchronized to the newly added data center; all user data of the target users in the original data center bound by each target user comprises incremental data and stock data;
for any target user, after all user data of the target user in an original data center bound by the target user are synchronized to the newly added data center, and all stock data of the target user in the original data center bound by the target user are synchronously completed, controlling the original data center bound by the target user to stop writing in the user data of the target user, and replacing the original data center bound with the target user in the binding relationship with the newly added data center;
the incremental data of the target user is newly added or changed data after all user data of the target user in an original data center bound by the target user is synchronized to the newly added data center; the inventory data of the target user is data generated before all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center.
2. The method according to claim 1, wherein after the original data center controlling the target user to bind stops writing the user data of the target user, and before the original data center bound to the target user in the binding relationship is replaced with the new data center, further comprising:
and determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
3. The method of claim 2, wherein the synchronizing the incremental data and the inventory data of the target users in the original data center bound by each of the target users to the newly added data center comprises:
aiming at any target user, synchronizing the incremental data of the target user in the original data center bound by the target user to the newly added data center through an incremental data synchronization program between the original data center bound by the target user and the newly added data center;
after the incremental data of the target user in the original data center bound by the target user is synchronized to the newly added data center, the stock data of the target user in the original data center bound by the target user is synchronized to the newly added data center through a stock data synchronization program between the original data center bound by the target user and the newly added data center.
4. The method of claim 3, wherein before the controlling the origin data center bound by the target user to stop writing the user data of the target user, further comprising:
for any target user, determining that all stock data of the target user in an original data center bound by the target user are synchronously finished;
the determining that the all user data of the target user in the original data center bound with the target user is completed synchronously comprises:
and if it is determined that all the incremental data of the target user in the original data center bound with the target user are completed synchronously, determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
5. The method of claim 4, wherein determining whether all of the inventory data for the target user in the origin data center to which the target user is bound is completed synchronously is performed according to:
judging whether all stock data synchronization programs between the original data center and the newly added data center bound by the target user are executed or not;
if yes, determining that all stock data of the target user in the original data center bound by the target user are completed synchronously;
otherwise, determining that all the inventory data of the target user in the original data center bound by the target user are not synchronously finished.
6. The method of claim 5, wherein the controlling the origin data center bound by the target user to stop writing the user data of the target user comprises:
judging whether all stock data of the target user in the original data center bound by the target user is finished synchronously within a set time length;
if yes, controlling the original data center bound by the target user to stop writing the user data of the target user;
otherwise, continuously judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished within the next set time length until all the stock data of the target user in the original data center bound by the target user are synchronously finished.
7. The method of claim 4, wherein determining whether all of the incremental data of the target user in the original data center bound by the target user is completed synchronously is performed according to:
acquiring the sites of all incremental data synchronization programs between the original data center and the newly added data center bound by the target user;
judging whether all the sites of all the incremental data synchronization programs are later than the time point when the original data center bound by the target user stops writing the user data of the target user;
if yes, determining that all the incremental data of the target user in the original data center bound by the target user are completed synchronously;
otherwise, returning to the step of acquiring all incremental data synchronization program sites between the original data center and the newly added data center bound by the target user.
8. The method of claim 6, wherein the determining whether all of the inventory data of the target user in the original data center bound by the target user is completed synchronously within a set time period comprises:
determining an idle period corresponding to the target user according to the historical access data corresponding to the target user;
selecting a period of time from the idle time period, taking the period of time as the set time, and judging whether all stock data of the target user in the original data center bound by the target user is synchronously finished within the set time.
9. An apparatus for migrating users, comprising:
the determining module is used for stopping changing the binding relationship between the user and the data center after determining to add the data center, and determining all target users belonging to the newly added data center;
the synchronization module is used for synchronizing all user data of the target users in the original data center bound by each target user to the newly added data center according to the binding relationship; all user data of the target users in the original data center bound by each target user comprises incremental data and stock data;
a processing module, configured to, for any target user, after all user data of the target user in an original data center bound by the target user is synchronized to the newly added data center, and all stock data of the target user in the original data center bound by the target user is completed synchronously, control the original data center bound by the target user to stop writing user data of the target user in the original data center bound by the target user, and replace the original data center bound by the target user in the binding relationship with the newly added data center;
the incremental data of the target user is newly added or changed data after all user data of the target user in an original data center bound by the target user is synchronized to the newly added data center; the inventory data of the target user is data generated before all user data of the target user in the original data center bound by the target user are synchronized to the newly added data center.
10. The device of claim 9, wherein the processing module is further to:
and determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
11. The device of claim 10, wherein the synchronization module is specifically configured to:
aiming at any target user, synchronizing the incremental data of the target user in the original data center bound by the target user to the newly added data center through an incremental data synchronization program between the original data center bound by the target user and the newly added data center; after the incremental data of the target user in the original data center bound by the target user is synchronized to the newly added data center, the stock data of the target user in the original data center bound by the target user is synchronized to the newly added data center through a stock data synchronization program between the original data center bound by the target user and the newly added data center.
12. The device of claim 11, wherein the processing module is further to:
for any target user, determining that all stock data of the target user in an original data center bound by the target user are synchronously finished;
and if it is determined that all the incremental data of the target user in the original data center bound with the target user are completed synchronously, determining that all the user data of the target user in the original data center bound with the target user are completed synchronously.
13. The device of claim 12, wherein the processing module is further to:
judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished according to the following modes:
judging whether all stock data synchronization programs between the original data center and the newly added data center bound by the target user are executed or not; if yes, determining that all stock data of the target user in the original data center bound by the target user are completed synchronously; otherwise, determining that all the inventory data of the target user in the original data center bound by the target user are not synchronously finished.
14. The device of claim 13, wherein the processing module is specifically configured to:
judging whether all stock data of the target user in the original data center bound by the target user is finished synchronously within a set time length; if yes, controlling the original data center bound by the target user to stop writing the user data of the target user; otherwise, continuously judging whether all the stock data of the target user in the original data center bound by the target user are synchronously finished within the next set time length until all the stock data of the target user in the original data center bound by the target user are synchronously finished.
15. The device of claim 12, wherein the processing module is further to:
judging whether all the incremental data of the target user in the original data center bound by the target user are synchronously finished according to the following modes:
acquiring the sites of all incremental data synchronization programs between the original data center and the newly added data center bound by the target user; judging whether all the sites of all the incremental data synchronization programs are later than the time point when the original data center bound by the target user stops writing the user data of the target user; if yes, determining that all the incremental data of the target user in the original data center bound by the target user are completed synchronously; otherwise, returning to the step of acquiring all incremental data synchronization program sites between the original data center and the newly added data center bound by the target user.
16. The device of claim 14, wherein the processing module is specifically configured to:
determining an idle period corresponding to the target user according to the historical access data corresponding to the target user; selecting a period of time from the idle time period, taking the period of time as the set time, and judging whether all stock data of the target user in the original data center bound by the target user is synchronously finished within the set time.
CN201610203110.7A 2016-03-31 2016-03-31 User migration method and device Active CN107295046B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610203110.7A CN107295046B (en) 2016-03-31 2016-03-31 User migration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610203110.7A CN107295046B (en) 2016-03-31 2016-03-31 User migration method and device

Publications (2)

Publication Number Publication Date
CN107295046A CN107295046A (en) 2017-10-24
CN107295046B true CN107295046B (en) 2020-06-05

Family

ID=60087310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610203110.7A Active CN107295046B (en) 2016-03-31 2016-03-31 User migration method and device

Country Status (1)

Country Link
CN (1) CN107295046B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101243469A (en) * 2005-08-22 2008-08-13 微软公司 Digital license migration from first platform to second platform
CN101398770A (en) * 2007-09-30 2009-04-01 赛门铁克公司 System for and method of migrating one or more virtual machines
CN102075515A (en) * 2010-11-23 2011-05-25 深圳Tcl新技术有限公司 Transfer method of user account number information
CN102819535A (en) * 2011-06-10 2012-12-12 戴尔产品有限公司 Data block migration
US8595192B1 (en) * 2010-12-01 2013-11-26 Symantec Corporation Systems and methods for providing high availability to instance-bound databases
GB2506177A (en) * 2012-09-25 2014-03-26 Ibm Method of migrating an operating system executing an application
CN104484469A (en) * 2014-12-31 2015-04-01 天津南大通用数据技术股份有限公司 Expansion method for supporting non-halt of multi-hash map database cluster system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101243469A (en) * 2005-08-22 2008-08-13 微软公司 Digital license migration from first platform to second platform
CN101398770A (en) * 2007-09-30 2009-04-01 赛门铁克公司 System for and method of migrating one or more virtual machines
CN102075515A (en) * 2010-11-23 2011-05-25 深圳Tcl新技术有限公司 Transfer method of user account number information
US8595192B1 (en) * 2010-12-01 2013-11-26 Symantec Corporation Systems and methods for providing high availability to instance-bound databases
CN102819535A (en) * 2011-06-10 2012-12-12 戴尔产品有限公司 Data block migration
GB2506177A (en) * 2012-09-25 2014-03-26 Ibm Method of migrating an operating system executing an application
CN104484469A (en) * 2014-12-31 2015-04-01 天津南大通用数据技术股份有限公司 Expansion method for supporting non-halt of multi-hash map database cluster system

Also Published As

Publication number Publication date
CN107295046A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN109739929B (en) Data synchronization method, device and system
JP3779263B2 (en) Conflict resolution for collaborative work systems
EP3564835B1 (en) Data redistribution method and apparatus, and database cluster
CN110247984B (en) Service processing method, device and storage medium
CN110673941B (en) Migration method of micro-services in multiple computer rooms, electronic equipment and storage medium
CN109254825A (en) A kind of method and device for receiving pipe virtual hard disk
WO2014023000A1 (en) Distributed data processing method and apparatus
TW201434300A (en) Service migration across cluster boundaries
CN108833610B (en) Information updating method, device and system
CN107704550B (en) File migration method and device and computer readable storage medium
US9401957B2 (en) System and method for synchronization between servers
CN106339387B (en) Increase the method for data synchronization and device of server in a kind of data-base cluster newly
CN106775498A (en) A kind of data cached synchronous method and system
CN103701817A (en) Method and device for generating configuration file
CN114691290A (en) Cross-cloud-platform application migration system and method and disaster recovery method
JPWO2014142217A1 (en) Information processing system and application transfer method
EP3786802A1 (en) Method and device for failover in hbase system
CN103327112A (en) Desktop synchronization method based on cloud storage and device for realizing desktop synchronization
CN112069152B (en) Database cluster upgrading method, device, equipment and storage medium
CN107295046B (en) User migration method and device
CN113297159A (en) Data storage method and device
CN101833585A (en) Database server operation control system, method and device
CN110113217B (en) Micro-service management method, device, management platform and storage medium
CN113656496A (en) Data processing method and system
CN107295043B (en) Method and equipment for migrating users

Legal Events

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

Effective date of registration: 20240311

Address after: # 04-08, Lai Zanda Building 1, 51 Belarusian Road, Singapore

Patentee after: Alibaba Singapore Holdings Ltd.

Country or region after: Singapore

Address before: Cayman Islands Grand Cayman capital building, a four storey No. 847 mailbox

Patentee before: ALIBABA GROUP HOLDING Ltd.

Country or region before: Cayman Islands