Data migration method and apparatus based on unitized architecture, and electronic device

By real-time monitoring and dynamically adjusting the number of units, and selecting migrated data shards based on the data sharding sequence number and priority, the problem of large data migration under the unitized architecture is solved, and business processing efficiency is improved and business downtime is reduced.

WO2024244422A1PCT designated stage expired Publication Date: 2024-12-05BANK OF CHINA
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/140450
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-31
Filing Date
2023-12-20
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

Under the unitized architecture, when data increases or decreases, the existing technology needs to be resliced ​​and redistributed, resulting in an increase in the overall data migration, resulting in slower upgrade of the business system and long shutdowns, which increases the pressure of business processing.

Method used

By monitoring the data volume and traffic of each unit in real time, dynamically increase or decrease the units, and select target data fragments for migration according to the serial number and priority of the data fragments, reducing the overall data migration volume and improving business processing efficiency.

Benefits of technology

It effectively reduces the amount of data migration under the unitized architecture, shortens the downtime of the application system, improves business processing efficiency, and reduces the pressure of upgrading the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023140450_05122024_PF_FP_ABST
    Figure CN2023140450_05122024_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a data migration method and apparatus based on a unitized architecture, and an electronic device, applicable to the field of distribution. The method comprises: on the basis of a unitized architecture, when a unit performs service processing, monitoring a data volume and traffic of each unit in a first device room; adding at least one unit to the first device room according to the data volume and traffic; acquiring a serial number of each data slice in each unit; determining a target data slice according to the serial number of each data slice in each unit; and migrating service data corresponding to the target data slice to the unit added to the first device room. The method of the present application can reduce the overall data migration amount, thereby shortening the downtime of an application system under a unitized architecture, and improving the service processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Data migration method, device and electronic device based on unitized architecture

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 31, 2023, with application number 2023106378041 and application name “Data migration method, device and electronic device based on unitized architecture”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of distributed systems, and in particular to a data migration method, device, and electronic device based on a unitized architecture. Background Art

[0003] A modular architecture uses units as the basic unit of deployment, with multiple units deployed across all computer rooms throughout the site. Each unit is a self-contained collection capable of completing all business operations, and each unit operates on a subset of the total data to perform business processing. In a modular architecture, as units process business, and as data increases or decreases over time, the number of units in the computer room within the modular architecture needs to be adjusted, and data migration needs to be performed.

[0004] In the prior art, when the amount of data increases or decreases, it is necessary to add or reduce the number of units, re-shard all existing data, redistribute the data shards and units, and then migrate the data corresponding to the data shards.

[0005] However, in the above method, when data shards and units are redistributed, the overall data migration volume increases, resulting in slower business system upgrades and longer business downtime, which in turn increases the business processing pressure of the business system.

[0006] Summary of the Invention

[0007] The present application provides a data migration method, device and electronic device based on a unitized architecture to solve the problem of slow business system upgrades due to an increase in the overall data migration volume.

[0008] In a first aspect, the present application provides a data migration method based on a unitized architecture, the method comprising:

[0009] Based on the unitized architecture, during the unit's business processing, the data volume and traffic of each unit in the first computer room are monitored; wherein the first computer room includes at least one unit; the data volume is the business data volume in the database connected to each unit at the current moment; and the traffic is the total number of accesses to the business system deployed by each unit at the current moment;

[0010] According to the data volume and the traffic flow, at least one unit is added to the first computer room;

[0011] Obtaining a serial number of each data shard in each of the units; wherein each data shard is obtained by sharding the business data in the database; and determining a target data shard based on the serial number of each data shard in each of the units; wherein the target data shard is the data shard to be migrated;

[0012] Migrate the business data corresponding to the target data shard to the unit added to the first computer room.

[0013] In one example, adding at least one unit to the first computer room based on the data volume and the traffic flow includes:

[0014] For each of the units in the first computer room, if it is monitored that the data volume of the unit is greater than or equal to a first preset data volume, N units are added to the first computer room; wherein N is a positive integer greater than or equal to 1; the total number of units in the first computer room to which the N units are added is less than or equal to the value represented by the first parameter; the first parameter is used to indicate the maximum number of units that the first computer room can include.

[0015] In one example, at least one unit is added to the first computer room based on the data volume and the traffic, further comprising:

[0016] If it is determined that the monitored flow of each of the units is greater than or equal to the first preset flow, M units are added to the first computer room; wherein M is a positive integer greater than or equal to 1; and the total number of units in the first computer room to which the M units are added is less than or equal to the value represented by the first parameter.

[0017] In one example, the unit includes at least one data set, the data set includes P data shards, where P is a positive integer greater than 1; determining a target data shard according to a sequence number of each data shard in each unit includes:

[0018] For each of the units, determine the Pth data shard and the P-1th data shard in the data set in the unit as target data shards;

[0019] Alternatively, for each of the units, the P-th data fragment, the P-1-th data fragment, and the P-2-th data fragment in the data set in the unit are determined as target data fragments.

[0020] In one example, the data slices in the unit have priorities; the priorities are determined based on the service type, user information, and time information of the data slices; and determining the target data slice according to the sequence number of each data slice in each unit includes:

[0021] For each of the units, according to the priorities of the data slices in the unit, a data slice with the highest priority is determined as the target data slice.

[0022] In one example, migrating the business data corresponding to the target data shard to the unit added to the first computer room includes:

[0023] According to the number of units added to the first computer room, the target data shards are evenly divided into the units added to the first computer room;

[0024] For each target data shard, the business data corresponding to the target data shard is migrated to the database corresponding to the unit where the target data shard is located.

[0025] In one example, it also includes:

[0026] Deleting at least one unit from the first computer room according to the data volume and the traffic;

[0027] Determine all data shards corresponding to the deleted units in the first computer room as the target data shards;

[0028] Migrate the target data shards to the remaining units in the first computer room; and migrate the business data corresponding to each of the data migration shards to the database corresponding to the unit where each of the target data shards is located.

[0029] In one example, deleting at least one unit from the first computer room based on the data volume and the traffic includes:

[0030] For each of the units in the first computer room, if the data volume of the unit is monitored to be less than or equal to the second preset flow, K new units are deleted for the first computer room; wherein K is a positive integer greater than or equal to 1; the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter; the second parameter is used to indicate the minimum number of units that the first computer room can include.

[0031] In one example, deleting at least one unit from the first computer room based on the data volume and the traffic flow further includes:

[0032] For each of the units in the first computer room, if the flow of the unit is monitored to be less than or equal to the second preset flow, L new units are deleted for the first computer room; where L is a positive integer greater than or equal to 1; and the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter.

[0033] In one example, the unitized architecture further includes a second computer room; wherein the second computer room is a disaster recovery computer room of the first computer room; all units in the second computer room correspond one-to-one to all units in the first computer room; and the method further includes:

[0034] Based on the unitized architecture, the configuration information of the first computer room is updated; and the configuration information of the second computer room is updated; wherein the configuration information includes first information and second information; the first information is the corresponding information between each of the units and each of the data shards; the second information is the corresponding information between each of the data shards and each of the databases.

[0035] In a second aspect, the present application provides a data migration device based on a unitized architecture, the device comprising:

[0036] The monitoring unit is configured to monitor the data volume and traffic of each unit in the first computer room based on the unitized architecture while the unit is processing business; wherein the first computer room includes at least one unit; the data volume is the amount of business data in the database connected to each unit at the current moment; and the traffic is the total number of accesses to the business system deployed by each unit at the current moment;

[0037] an adding unit, configured to add at least one unit to the first computer room according to the data volume and the traffic;

[0038] An acquiring unit, configured to acquire a serial number of each data shard in each of the units; wherein each of the data shards is obtained by sharding the business data in the database;

[0039] A first determining unit is configured to determine a target data shard according to a sequence number of each data shard in each unit; wherein the target data shard is a data shard that needs to be migrated;

[0040] The first migration unit is used to migrate the business data corresponding to the target data shard to the unit added to the first computer room.

[0041] In one example, the adding unit includes:

[0042] The first adding module is used to add N units to the first computer room for each of the units in the first computer room if the data volume of the unit is greater than or equal to a first preset data volume; wherein N is a positive integer greater than or equal to 1; the total number of units in the first computer room to which the N units are added is less than or equal to a value represented by a first parameter; and the first parameter is used to indicate the maximum number of units that can be included in the first computer room.

[0043] In one example, the adding unit further includes:

[0044] The second adding module is used to add M units to the first computer room if it is determined that the monitored flow of each of the units is greater than or equal to the first preset flow; wherein M is a positive integer greater than or equal to 1; and the total number of units in the first computer room to which the M units are added is less than or equal to the value represented by the first parameter.

[0045] In one example, the unit includes at least one data set, the data set includes P data slices, where P is a positive integer greater than 1; the first determining unit includes:

[0046] A first determining module is configured to determine, for each unit, a P-th data shard and a P-1-th data shard in the data set in the unit as target data shards;

[0047] The second determining module is used to determine, for each of the units, the Pth data fragment, the P-1th data fragment, and the P-2th data fragment in the data set in the unit as target data fragments.

[0048] In one example, the data slices in the unit have priorities; the priorities are determined based on a service type of the data slices, user information, and time information of the data slices; and the first determining unit further includes:

[0049] The third determining module is configured to determine, for each of the units, based on the priorities of the data slices in the unit, a data slice with the highest priority as a target data slice.

[0050] In one example, the first migration unit includes:

[0051] a partitioning module, configured to evenly partition the target data shards into the units added to the first computer room according to the number of units added to the first computer room;

[0052] The migration module is used to migrate the business data corresponding to each target data slice to the database corresponding to the unit where the target data slice is located.

[0053] In one example, the apparatus further includes:

[0054] a deleting unit, configured to delete at least one unit from the first computer room according to the data volume and the traffic;

[0055] A second determining unit is configured to determine all data shards corresponding to the deleted units in the first computer room as the target data shards;

[0056] The second migration unit is used to migrate the target data shards to the remaining units in the first computer room; and migrate the business data corresponding to each of the data migration shards to the database corresponding to the unit where each of the target data shards is located.

[0057] In one example, the deletion unit includes:

[0058] The first deletion module is used to delete K new units for each of the units in the first computer room if the data volume of the unit is monitored to be less than or equal to a second preset flow rate; wherein K is a positive integer greater than or equal to 1; the total number of units remaining in the first computer room is less than or equal to a value represented by a second parameter; and the second parameter is used to indicate the minimum number of units that can be included in the first computer room.

[0059] In one example, the deletion unit further includes:

[0060] The second deletion module is used to delete L new units for each of the units in the first computer room if the flow of the unit is monitored to be less than or equal to the second preset flow; wherein L is a positive integer greater than or equal to 1; and the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter.

[0061] In one example, the unitized architecture further includes a second computer room; wherein the second computer room is a disaster recovery computer room of the first computer room; all units in the second computer room correspond one-to-one to all units in the first computer room; and the apparatus further includes:

[0062] An update unit is used to update the configuration information of the first computer room based on the unitized architecture; and to update the configuration information of the second computer room; wherein the configuration information includes first information and second information; the first information is the corresponding information between each of the units and each of the data shards; the second information is the corresponding information between each of the data shards and each of the databases.

[0063] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0064] The memory stores computer-executable instructions;

[0065] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.

[0066] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0067] In a fifth aspect, the present application provides a computer program product, comprising: a computer program, the computer program being stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program so that the electronic device executes the method described in the first aspect.

[0068] The present application provides a data migration method, device and electronic equipment based on a unitized architecture. First, multiple units are set up in a computer room under the unitized architecture. For each unit in the computer room, a new unit is added to the computer room by real-time monitoring of the data volume and application access volume corresponding to each unit; then the last data shard in the pre-sorted data shards of each unit is divided out as the data shard in the new unit, and the data corresponding to the data shard in the new unit is migrated; further, by only migrating the data corresponding to the data shard with the last serial number, the overall data migration amount under the unitized architecture is reduced, thereby reducing the downtime of the application system under the unitized architecture and improving business processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0070] FIG1 is a schematic diagram of an application scenario provided by this application;

[0071] FIG2 is a schematic diagram of a unitized architecture provided by the present application;

[0072] FIG3 is a schematic diagram of a flow chart of a data migration method based on a unitized architecture according to an embodiment of the present application;

[0073] FIG4 is a flow chart of another data migration method based on a unitized architecture provided in an embodiment of the present application;

[0074] FIG5 is a schematic diagram of the distribution of data shards in a unitized architecture provided in an embodiment of the present application;

[0075] FIG6 is a schematic diagram of the distribution of data shards after unit expansion in a unitized architecture provided by an embodiment of the present application;

[0076] FIG7 is a schematic diagram of the structure of a data migration device based on a unitized architecture provided in an embodiment of the present application;

[0077] FIG8 is a schematic structural diagram of another data migration device based on a unitized architecture provided in an embodiment of the present application;

[0078] FIG9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0079] Fig. 10 is a block diagram of an electronic device according to an exemplary embodiment.

[0080] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0081] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0082] First, let’s explain the terms involved in this application:

[0083] Unitization: Units are used as the basic units of deployment. Several units are deployed in all computer rooms of the entire site. The number of units in each computer room is not fixed. Any unit is deployed with all the applications required by the system. The data of each unit is a part of the full data divided according to a certain dimension.

[0084] Computer room: A data center where applications can be deployed. A region has one or more computer rooms.

[0085] Unit: refers to a self-contained collection that can complete all business operations. This collection includes all services required for all businesses and the data allocated to this unit.

[0086] Data sharding: The full amount of data in the application system is divided into several parts according to a certain algorithm. Each part is called a shard, and each unit contains several shards.

[0087] Figure 1 is a schematic diagram of an application scenario provided by this application. As shown in Figure 1, this scenario includes a terminal device 101, a computer room 102, and a disaster recovery computer room 103. A client can use terminal device 101 to send an access request to the business system deployed in computer room 102. After receiving the access request, server 102 processes the request and returns the access processing result to terminal device 101. If a computer room failure occurs, the access request initiated by the client on terminal device 101 is sent to the business system deployed in disaster recovery computer room 103 for processing, and the access processing result is returned to terminal device 101.

[0088] A modular architecture uses units as the basic unit of deployment. Several units are deployed in all computer rooms across the site, with a variable number of units in each room. Each unit hosts all the applications required by the system and is a self-contained set capable of completing all business operations. The data in each unit represents a portion of the full data set partitioned along a specific dimension. As units process business within a modular architecture, as data increases or decreases over time, the number of units in the computer room needs to be adjusted, and data migration may be necessary.

[0089] In one example, Figure 2 is a schematic diagram of a unitized architecture provided by the present application. As shown in Figure 2, the enterprise-level unitized architecture is intended to provide a unified architecture for numerous application systems of large enterprises. For example, the application system decided in advance uses 4 units, including unit 1, unit 2, unit 3 and unit 4. Each unit corresponds to 10 data shards, which also corresponds to the database. Each data shard has a serial number. However, as time goes by, under this unitized architecture, when the amount of data that needs to be operated by each unit increases, it is necessary to add new units in the computer room, and then re-shard all existing data, and then redistribute the data shards and units, and then migrate the data corresponding to the data shards.

[0090] In another example, in a unitized architecture, when the amount of data that each unit needs to operate decreases, the number of units in the computer room needs to be reduced, and then all existing data needs to be re-sharded, and then the data shards and units need to be redistributed, and then the data corresponding to the data shards need to be migrated to the remaining units.

[0091] However, in the above method, when data shards and units are redistributed, the overall data migration volume increases, resulting in slower application system upgrades under the unitized architecture and longer application system downtime, thereby increasing the business processing pressure of the application system.

[0092] The data migration method, device and electronic device based on the unitized architecture provided in this application are intended to solve the above technical problems of the prior art.

[0093] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0094] It should be noted that the data migration method, device and electronic device based on the unitized architecture of the present application can be used in distributed fields, and can also be used in any field other than the distributed field. The application field of the data migration method, device and electronic device based on the unitized architecture of the present application is not limited.

[0095] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0096] FIG3 is a flow chart of a data migration method based on a unitized architecture according to an embodiment of the present application. As shown in FIG3 , the method includes:

[0097] S301. Based on the unitized architecture, the data volume and traffic of each unit in the first computer room are monitored during the unit's business processing; wherein the first computer room includes at least one unit; the data volume is the amount of business data in the database connected to each unit at the current moment; and the traffic is the total amount of access to the business system deployed by each unit at the current moment.

[0098] Exemplarily, the execution subject of this embodiment may be an electronic device.

[0099] For example, in a pre-configured enterprise-level modular architecture, a unit is used as the basic unit of deployment. Several units are deployed in a computer room, and each unit hosts all the required application systems. Within this modular architecture, each unit contains four modules: a context module, a sharding module, a forwarding module, and a unit module. The context module stores transaction message information and the shard number of the next shard to which each message is forwarded; the forwarding module determines which unit to forward a transaction to; the sharding module determines which database to use for the transaction data; and the unit module stores the correspondence between shards and units and information about the entire unit. During business operations and processing, the unit manipulates data in the corresponding database and receives service access requests from the business system deployed by the unit to complete the corresponding business operations. To adapt to ever-changing business scenarios, based on electronic devices, the context module for each unit needs to monitor the current amount of business data in the database connected to the unit and the total number of accesses to the business system deployed by each unit in real time or periodically to understand the current working status of each unit.

[0100] S302: Add at least one unit to the first computer room according to the data volume and traffic.

[0101] For example, in order to make timely adjustments to the number of existing units, after obtaining the data volume and application access traffic corresponding to each unit at the current moment, the data volume and application access traffic corresponding to each unit can be judged and analyzed. If it is confirmed that the data or traffic corresponding to the current operation of the unit is excessive, the unit capacity of the computer room where the unit is located can be expanded based on the existing units, that is, the unit module can add at least one unit to the computer room. Alternatively, the current business needs can be obtained, and based on the specific physical equipment performance and specific business volume of the computer room, for example, if the current business demand is large and far exceeds the business volume that the equipment in the computer room can carry, multiple units can be added to the computer room.

[0102] S303. Obtain the serial number of each data shard in each unit; wherein each data shard is obtained by sharding the business data in the database; and determine the target data shard based on the serial number of each data shard in each unit; wherein the target data shard is the data shard that needs to be migrated.

[0103] For example, for an application system deployed in a computer room under a unitized architecture, the sharding module will pre-cut the full amount of data of the application system into several parts according to a certain algorithm when storing the data. Each part is called a data shard. Each unit contains several data shards. All data shards are pre-sorted. Each data shard has a corresponding serial number. The data is stored in the database, and the sharding module will match each data shard with the data in the database one by one. After the computer room is expanded, it is necessary to obtain the serial numbers of all data shards in each unit. After obtaining the serial number of each data shard, the corresponding serial number can be extracted according to the serial number of each data shard, such as by random extraction, and then the data shard corresponding to the extracted serial number is selected, and the selected data shard is determined as the target data shard, that is, the data shard to be migrated.

[0104] In an example, for the full data of the application system under the unitized architecture, there are a total of 1,000 data items. Two units are deployed and split into 10 data shards, that is, each unit contains 5 data shards, and each data shard corresponds to 100 data. All data shards are sorted in advance, and each data shard has a corresponding serial number, that is, 1 to 10. A preset number of serial numbers can be randomly drawn, for example, 3 serial numbers 2, 3 and 8 are drawn, then the data shard corresponding to the drawn serial number is selected, and the selected data shard is determined as the target data shard, that is, the data shard to be migrated.

[0105] S304: Migrate the business data corresponding to the target data shard to the unit added to the first computer room.

[0106] For example, after determining the data shards that need to be migrated, based on the electronic device, the data shards that need to be migrated will first be divided into newly added units. According to the one-to-one correspondence between the data shards and the business data in the database, the business data in the database corresponding to the data shards will be migrated to the database corresponding to the newly added units, so as to complete the migration of a smaller amount of data in a timely manner and improve the business processing capability.

[0107] In this embodiment, a data migration method based on a unitized architecture is provided. Under the unitized architecture, a plurality of units are set up in a computer room. For each unit in the computer room, a new unit is added to the computer room by real-time monitoring of the data volume and application access volume corresponding to each unit. Then, the pre-sorted data shards of each unit are selected and divided out as data shards in the new unit, and the data corresponding to the data shards in the new unit are migrated. Furthermore, by migrating only the data corresponding to the data shards within a preset score range, the overall data migration amount under the unitized architecture is reduced, thereby reducing the downtime of the application system under the unitized architecture and improving business processing efficiency.

[0108] FIG4 is a flow chart of another data migration method based on a unitized architecture according to an embodiment of the present application. As shown in FIG4 , the method includes:

[0109] S401. Based on the unitized architecture, the data volume and traffic of each unit in the first computer room are monitored during the unit's business processing; wherein the first computer room includes at least one unit; the data volume is the amount of business data in the database connected to each unit at the current moment; and the traffic is the total amount of access to the business system deployed by each unit at the current moment.

[0110] For example, this step may refer to step 301 and will not be described in detail.

[0111] S402. For each unit in the first computer room, if it is monitored that the data volume of the unit is greater than or equal to a first preset data volume, N units are added to the first computer room; wherein N is a positive integer greater than or equal to 1; the total number of units in the first computer room to which N units are added is less than or equal to a value represented by a first parameter; the first parameter is used to indicate the maximum number of units that can be included in the first computer room.

[0112] For example, in order to make timely adjustments to the number of existing units in the computer room, after obtaining the data volume corresponding to each unit at the current moment, the electronic device can judge and analyze the data volume corresponding to each unit, and compare the currently obtained data volume corresponding to the unit with the first preset data volume according to the pre-set preset data volume, that is, the first preset data volume. If the currently obtained data volume of the unit is greater than or equal to the preset data volume, it means that there is a unit in the current computer room with too much data volume, and it is necessary to expand the unit capacity of the computer room, that is, to add at least one unit to the computer room.

[0113] If the current business demand is large, far exceeding the business volume that the equipment in the computer room can carry, N units are added to the computer room; where N is a positive integer greater than or equal to 1; in order to prevent the number of units in the computer room from increasing indefinitely, the electronic equipment pre-sets a first parameter in the computer room to indicate the maximum number of units that the computer room can include. Therefore, when N new units are added, the total number of units in the computer room to which N units are added should be less than or equal to the maximum number of units that the computer room can include.

[0114] S403. If it is determined that the monitored flow of each unit is greater than or equal to the first preset flow, M units are added to the first computer room; wherein M is a positive integer greater than or equal to 1; and the total number of units in the first computer room to which M units are added is less than or equal to the value represented by the first parameter.

[0115] For example, in order to make timely adjustments to the number of existing units in the computer room, after obtaining the application access traffic corresponding to each unit at the current moment, the electronic device can judge and analyze the traffic corresponding to each unit, and compare the currently obtained traffic corresponding to the unit with the preset traffic according to the pre-set preset traffic, that is, the first preset traffic. If the currently obtained traffic of the unit is greater than or equal to the preset traffic, it means that there is a unit in the current computer room that is being accessed by too many applications, and it is necessary to expand the unit capacity of the computer room, that is, to add at least one unit to the computer room.

[0116] If the current business demand is large, far exceeding the business volume that the equipment in the computer room can carry, M units are added to the computer room; where M is a positive integer greater than or equal to 1; in order to prevent the number of units in the computer room from increasing indefinitely, the electronic equipment pre-sets a first parameter in the computer room to indicate the maximum number of units that the computer room can include. Therefore, when M new units are added, the total number of units in the computer room to which M units are added should be less than or equal to the maximum number of units that the computer room can include.

[0117] S404. Obtain the serial number of each data shard in each unit; wherein each data shard is obtained by sharding the business data in the database.

[0118] Exemplarily, Figure 5 is a distribution diagram of data shards in a unitized architecture provided in an embodiment of the present application. As shown in Figure 5, under the unitized architecture, it currently includes unit 1, unit 2, unit 3 and unit 4. For each unit, it contains 4 modules, namely, a context module, a sharding module, a forwarding module and a unit module. The context module is used to save transaction message information and the shard number of the next shard to which each message information is forwarded; the forwarding module is used to determine to which unit the transaction is forwarded; the sharding module is used to determine which database is used for the data corresponding to this transaction; the unit module is used to store the correspondence between shards and units, and store information about the entire unit. For the application system deployed in the computer room under this unitized architecture, the full data of the application system will be pre-cut into several parts according to a certain algorithm when the data is stored. Each part is called a data shard, and each unit contains several data shards. For example, each unit contains ten shards, that is, the full data of the entire enterprise is divided into 80 shards according to a certain algorithm and then corresponds to a specific unit. The data is stored in the database, and each data shard corresponds one-to-one with the data in the database. All data shards are sorted in advance, and each data shard has a corresponding serial number and is saved in the unit. The serial number corresponding to the data shard in each unit is obtained.

[0119] After step S404, any one of step S405, step S406 and step S407 may be executed.

[0120] S405 . For each unit, determine the Pth data shard and the P-1th data shard in the data set in the unit as target data shards.

[0121] In one example, the unit includes at least one data set, and the data set includes P data slices, where P is a positive integer greater than 1.

[0122] Illustratively, after step S404, each unit is connected to a corresponding database, which includes at least one corresponding data set, and each data set contains P data shards, where P is a positive integer greater than 1. After obtaining the sequence number of each data shard, the values ​​corresponding to the sequence numbers of these data shards can be arranged from small to large according to the sequence number of each data shard, that is, 1, 2, 3, ..., P. Then, based on the preset number of 2, the values ​​corresponding to the Pth and P-1th sequence numbers of the last sequence in the arrangement can be selected. Then, based on the one-to-one correspondence between sequence numbers and data shards, the data shard corresponding to the selected sequence number can be determined as the target data shard to be migrated.

[0123] In an example, after obtaining the serial number of each data shard, the values ​​corresponding to the serial numbers of these data shards can be arranged from small to large according to the serial number of each data shard, that is, 1, 2, 3,..., 40. Then, based on the preset number of 2, the values ​​corresponding to the 40th and 39th serial numbers in the last arrangement in the arrangement can be selected, and the data shard corresponding to the selected serial number can be determined as the target data shard to be migrated.

[0124] In another example, after obtaining the serial number of each data shard, the values ​​corresponding to the serial numbers of these data shards can be arranged from small to large according to the serial number of each data shard, that is, 1, 2, 3, ..., 80. Then, according to the preset number of 2, these data shards can be pre-divided into two batches, that is, 1, 2, 3, ..., 40 and 41, 42, 43, ..., 80. Then, according to the preset number of selections of 2, the value corresponding to the 40th serial number of the last arrangement in the two arrangements and the value corresponding to the 80th can be selected, and the data shards corresponding to the selected serial numbers can be determined as the target data shards to be migrated.

[0125] S406 . For each unit, determine the Pth data shard, the P-1th data shard, and the P-2th data shard in the data set in the unit as target data shards.

[0126] In one example, the unit includes at least one data set, and the data set includes P data slices, where P is a positive integer greater than 1.

[0127] Exemplarily, after step S404, each unit is connected to a corresponding database, which includes at least one corresponding data set, and each data set contains P data shards, where P is a positive integer greater than 1. After obtaining the sequence number of each data shard, the values ​​corresponding to the sequence numbers of these data shards can be arranged from small to large according to the sequence number of each data shard, that is, 1, 2, 3, ..., P. Then, based on the preset number of 3, the values ​​corresponding to the Pth, P-1th, and P-2th sequence numbers of the last sequence in the arrangement can be selected. Then, based on the one-to-one correspondence between sequence numbers and data shards, the data shard corresponding to the selected sequence number can be determined as the target data shard to be migrated.

[0128] In an example, after obtaining the serial number of each data shard, the values ​​corresponding to the serial numbers of these data shards can be arranged from small to large according to the serial number of each data shard, that is, 1, 2, 3, ..., 40. Then, based on the preset number of 3, the values ​​corresponding to the 40th, 39th and 38th serial numbers in the last arrangement in the arrangement can be selected, and the data shards corresponding to the selected serial numbers can be determined as the target data shards to be migrated.

[0129] In another example, after obtaining the serial number of each data shard, the values ​​corresponding to the serial numbers of these data shards can be arranged from small to large according to the serial number of each data shard, that is, 1, 2, 3, ..., 90. Then, according to the preset number of 3, these data shards can be pre-divided into three batches, that is, 1, 2, 3, ..., 30, 31, 32, 33, ..., 60, and 61, 62, 63, ..., 90. Then, according to the preset number of selections of 3, the values ​​corresponding to the 30th, 60th, and 90th serial numbers of the last arrangement in the three arrangements can be selected, and the data shards corresponding to the selected serial numbers can be determined as the target data shards to be migrated.

[0130] S407 . For each unit, determine the data slice with the highest priority as the target data slice according to the priorities of the data slices in the unit.

[0131] In one example, the priority is determined based on the service type of the data slice, user information, and time information of the data slice.

[0132] For example, after the entire system data is sharded, in order to determine the data shard to be migrated in each data shard in multiple units, the priority of each data shard can be predetermined based on the business type of the data shard, user information, and time information of the data shard. Optionally, the data shards can also be prioritized according to the priority of the business type of the data corresponding to the data shard. For each data shard, if the processing priority of the business type of the data corresponding to the data shard is high, the priority of the data shard is also high; otherwise, the priority of the data shard is also low. Optionally, the priority between data shards can be determined based on the customer information corresponding to the data corresponding to the data shard. For each data shard, if the customer level corresponding to the data corresponding to the data shard is high, the priority of the data shard is also high; otherwise, the priority of the data shard is also low. Optionally, the priority of each data slice can be divided according to the generation time of each data slice. For each data slice, if the generation time of the data slice is earlier, the priority of the data slice is also high; otherwise, the priority of the data slice is also low.

[0133] Exemplarily, after step S404, the priority of each pre-divided data shard can be obtained, and based on the preset number of data shards, multiple data shards with the highest priority are selected; for example, if there are two data shards to be migrated, then from the multiple data shards with determined priorities, the two data shards with the highest priority are determined, which are the target data shards to be migrated.

[0134] S408. According to the number of units added to the first computer room, evenly divide the target data shards into the units added to the first computer room.

[0135] For example, based on the equipment performance of the current computer room and the current business demand, after determining that at least one unit has been added, the number of multiple target data shards can be evenly divided according to the number of units to be added and the target data shards to be migrated, and the evenly divided target data shards can be migrated to each newly added unit.

[0136] In an example, Figure 6 is a distribution diagram of data shards after unit expansion in a unitized architecture provided in an embodiment of the present application. As shown in Figure 6, based on the equipment performance of the current computer room and the current business demand, the current computer room includes unit 1, unit 2, unit 3 and unit 4. After determining that one unit is added, the computer room includes unit 1, unit 2, unit 3, unit 4 and unit 5. According to the determination of the number of units added of 1 and the number of target data shards to be migrated of 2, all the 2 target data shards to be migrated are migrated to the unit.

[0137] In another example, after determining that two units are added based on the equipment performance of the current computer room and the current business demand, and based on the determination that the number of added units is 2 and the number of target data shards to be migrated is 4, the number of multiple target data shards can be evenly divided according to the number of units, and each unit is allocated to 2 data shards, and the evenly divided target data shards are migrated to each newly added unit.

[0138] S409 . For each target data shard, migrate the business data corresponding to the target data shard to the database corresponding to the unit where the target data shard is located.

[0139] Exemplarily, each newly added unit is connected to a different database. After the target data shard to be migrated is divided into each newly added unit, for each target data shard, based on the correspondence between the pre-stored data and the data shards in each existing unit, the data corresponding to the target data shard is migrated to the database corresponding to the newly added unit where the target data shard is located.

[0140] S410: Delete at least one unit from the first computer room according to the data volume and traffic.

[0141] In one example, step S410 includes: for each unit in the first computer room, if the data volume of the unit is monitored to be less than or equal to the second preset flow, deleting K new units for the first computer room; wherein K is a positive integer greater than or equal to 1; the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter; the second parameter is used to indicate the minimum number of units that can be included in the first computer room.

[0142] Alternatively, step S410 includes: for each unit in the first computer room, if the flow of the unit is monitored to be less than or equal to a second preset flow, deleting L new units for the first computer room; wherein L is a positive integer greater than or equal to 1; and the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter.

[0143] For example, in order to adjust the number of existing units in a timely manner, after obtaining the data volume and application access traffic corresponding to each unit at the current moment, the data volume and application access traffic corresponding to each unit can be judged and analyzed. If it is confirmed that the data or traffic corresponding to the current operation of the unit is too small, the unit capacity of the computer room where the unit is located can be reduced based on the existing units. That is, the unit module deletes at least one unit from the computer room. Alternatively, the current business demand can be obtained, and based on the specific physical equipment performance and specific business volume of the computer room, for example, if the current business demand is not high, multiple units can be deleted from the computer room.

[0144] Specifically, in order to timely adjust the number of units in the computer room, after obtaining the data volume corresponding to each unit at the current moment, the electronic device can determine and analyze the data volume corresponding to each unit. Based on a pre-set preset data volume, i.e., a second preset data volume, the currently obtained data volume corresponding to the unit is compared with the second preset data volume. If the currently obtained data volume of the unit is less than or equal to the preset data volume, it indicates that there is a unit in the current computer room with too little data volume, and it is necessary to reduce the unit capacity of the computer room, that is, to delete at least one unit from the computer room. If the current business demand is small, K units are deleted from the computer room; where K is a positive integer greater than or equal to 1. To prevent the unlimited deletion of units in the computer room, the electronic device pre-sets a second parameter in the computer room to indicate the minimum number of units that the computer room can include. Therefore, when deleting K new units, the total number of units in the computer room from which K units are deleted should be greater than or equal to the minimum number of units that the computer room can include.

[0145] Specifically, in order to timely adjust the number of units in the computer room, after obtaining the application access traffic corresponding to each unit at the current moment, the electronic device can judge and analyze the traffic corresponding to each unit, and compare the traffic corresponding to the unit with the second preset traffic according to the preset traffic, i.e., the second preset traffic. If the currently obtained data volume of the unit is less than or equal to the preset traffic, it means that there are too few application systems deployed in the unit in the current computer room, and it is necessary to reduce the unit capacity of the computer room, that is, delete at least one unit from the computer room. If the current business demand is small, L units are deleted from the computer room at this time; where L is a positive integer greater than or equal to 1; in order to prevent the number of units in the computer room from being deleted without limit, the electronic device pre-sets a second parameter in the computer room to indicate the minimum number of units that the computer room can include. Therefore, when deleting L new units, the total number of units in the computer room from which L units are deleted should be greater than or equal to the minimum number of units that the computer room can include.

[0146] S411. Determine all data shards corresponding to the deleted units in the first computer room as target data shards.

[0147] Illustratively, after determining the unit to be deleted in the computer room, the data shard corresponding to the unit to be deleted is determined as the data shard to be migrated based on the correspondence between each unit and each data shard.

[0148] S412: Migrate the target data shards to the remaining units in the first computer room; and migrate the business data corresponding to each data migration shard to the database corresponding to the unit where each target data shard is located.

[0149] Exemplarily, after determining the data shards to be migrated, each data shard can be allocated to the remaining units. Optionally, random allocation can be performed, or the target data shards to be migrated can be migrated to the remaining units with lower data volume or lower traffic according to the data volume or traffic corresponding to other remaining units. Optionally, the target data shards can be migrated to the remaining units where the data shards adjacent to the target data shard sequence number are located according to the sequence number of each target data shard, so as to ensure the continuity of the sequence numbers of the data shards.

[0150] S413. Based on the unitized architecture, update the configuration information of the first computer room; and update the configuration information of the second computer room; wherein the configuration information includes first information and second information; the first information is the corresponding information between each unit and each data shard; the second information is the corresponding information between each data shard and each database.

[0151] In one example, the unitized architecture further includes a second computer room; wherein the second computer room is a disaster recovery computer room of the first computer room; and all units in the second computer room correspond one-to-one to all units in the first computer room.

[0152] For example, to ensure business continuity in the event of a computer room failure, this modular architecture also includes a second computer room, which serves as a disaster recovery for the aforementioned computer room. This means that both computer rooms act as disaster recovery for each other. Furthermore, each unit in these two mutually-recoverable computer rooms also serves as a disaster recovery unit for the other. For example, if there are two units, Unit 1 and Unit 2, Unit 1 serves as a disaster recovery unit for Unit 2, and Unit 2 serves as a disaster recovery unit for Unit 1. If Unit 1 fails, traffic from Unit 1 can be directly switched to Unit 2; if Unit 2 fails, traffic can be directly switched to Unit 1.

[0153] For example, after completing the data migration corresponding to the unit expansion or reduction, it is necessary to update the corresponding configuration information in a timely manner, including reconfiguring the corresponding information of the unit and the shard in the business component unit module, and reconfiguring the corresponding information of the shard and the database in the business component shard module.

[0154] In this embodiment, based on the above embodiment, the data volume and flow of each unit are obtained in real time, and the obtained data volume and flow of each unit are compared with the preset amount to perform unit scaling; after the unit is scaled up or down, the data shard sequence number preset for the data shard can be used to select the data shard with the last digit of the data shard sequence as the data shard to be migrated, or the data shard with a high priority can be selected as the data shard to be migrated to complete the data migration; furthermore, on the one hand, by dynamically adjusting the number of units according to the data volume and flow of each unit, resource utilization can be maximized; on the other hand, by splitting and recycling the data shards with the last few digits of the data shard sequence number, or migrating the data corresponding to the data shard with a high priority; furthermore, by only migrating the data corresponding to the data shards within the preset number range, the overall data migration amount under the unitized architecture is reduced, thereby reducing the downtime of the application system under the unitized architecture and improving business processing efficiency.

[0155] FIG7 is a schematic diagram of the structure of a data migration device based on a unitized architecture according to an embodiment of the present application. As shown in FIG7 , the device 500 includes:

[0156] Monitoring unit 501 is used to monitor the data volume and traffic of each unit in the first computer room based on the unitized architecture while the unit is processing business. The first computer room includes at least one unit. The data volume is the amount of business data in the database connected to each unit at the current moment. The traffic is the total amount of access to the business system deployed by each unit at the current moment.

[0157] The adding unit 502 is used to add at least one unit to the first computer room according to the data volume and flow.

[0158] The acquisition unit 503 is used to obtain the serial number of each data slice in each unit; wherein each data slice is obtained by slicing the business data in the database.

[0159] The first determining unit 504 is configured to determine a target data shard according to the sequence number of each data shard in each unit; wherein the target data shard is a data shard that needs to be migrated.

[0160] The first migration unit 505 is used to migrate the business data corresponding to the target data shard to the unit added in the first computer room.

[0161] The device of this embodiment can execute the technical solution in the above method. Its specific implementation process and technical principles are the same and will not be repeated here.

[0162] FIG8 is a schematic diagram of the structure of another data migration device based on a unitized architecture according to an embodiment of the present application. As shown in FIG8 , the device 600 includes:

[0163] Monitoring unit 601 is used to monitor the data volume and traffic of each unit in the first computer room based on the unitized architecture while the unit is processing business. The first computer room includes at least one unit. The data volume is the amount of business data in the database connected to each unit at the current moment. The traffic is the total amount of access to the business system deployed by each unit at the current moment.

[0164] The adding unit 602 is used to add at least one unit to the first computer room according to the data volume and flow.

[0165] The acquisition unit 603 is used to obtain the serial number of each data slice in each unit; wherein each data slice is obtained by slicing the business data in the database.

[0166] The first determining unit 604 is configured to determine a target data shard according to the sequence number of each data shard in each unit; wherein the target data shard is a data shard that needs to be migrated.

[0167] The first migration unit 605 is used to migrate the business data corresponding to the target data shard to the unit added in the first computer room.

[0168] In one example, the adding unit 602 includes:

[0169] The first adding module 6021 is used to add N units to the first computer room for each unit in the first computer room if the data volume of the unit is greater than or equal to the first preset data volume; wherein N is a positive integer greater than or equal to 1; the total number of units in the first computer room to which N units are added is less than or equal to the value represented by the first parameter; the first parameter is used to indicate the maximum number of units that can be included in the first computer room.

[0170] In one example, the adding unit 602 further includes:

[0171] The second adding module 6022 is used to add M units to the first computer room if it is determined that the monitored flow of each unit is greater than or equal to the first preset flow; wherein M is a positive integer greater than or equal to 1; and the total number of units in the first computer room to which M units are added is less than or equal to the value represented by the first parameter.

[0172] In one example, the unit includes at least one data set, and the data set includes P data slices, where P is a positive integer greater than 1; the first determining unit 604 includes:

[0173] The first determining module 6041 is configured to determine, for each unit, the Pth data fragment and the P-1th data fragment in the data set in the unit as target data fragments.

[0174] The second determination module 6042 is configured to determine, for each unit, the Pth data fragment, the P-1th data fragment, and the P-2th data fragment in the data set in the unit as target data fragments.

[0175] In one example, the data slices in the unit have priorities; the priorities are determined based on the service type of the data slices, user information, and time information of the data slices; the first determining unit 604 further includes:

[0176] The third determining module 6043 is configured to determine, for each unit, based on the priorities of the data slices in the unit, the data slice with the highest priority as the target data slice.

[0177] In one example, the first migration unit 605 includes:

[0178] The division module 6051 is used to divide the target data slices evenly into the units added in the first computer room according to the number of units added in the first computer room.

[0179] The migration module 6052 is used to migrate the business data corresponding to each target data shard to the database corresponding to the unit where the target data shard is located.

[0180] In one example, the apparatus 600 further includes:

[0181] A deletion unit 606 is configured to delete at least one unit from the first computer room based on the data volume and traffic flow;

[0182] The second determining unit 607 is configured to determine all data shards corresponding to the deleted units in the first computer room as target data shards.

[0183] The second migration unit 608 is used to migrate the target data shards to the remaining units in the first computer room; and migrate the business data corresponding to each data migration shard to the database corresponding to the unit where each target data shard is located.

[0184] In one example, the deletion unit 606 includes:

[0185] The first deletion module 6061 is used to delete K new units for each unit in the first computer room if the data volume of the unit is monitored to be less than or equal to the second preset flow rate; wherein K is a positive integer greater than or equal to 1; the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter; the second parameter is used to indicate the minimum number of units that can be included in the first computer room.

[0186] In one example, the deleting unit 606 further includes:

[0187] The second deletion module 6062 is used to delete L new units for each unit in the first computer room if the flow of the unit is monitored to be less than or equal to the second preset flow; wherein L is a positive integer greater than or equal to 1; and the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter.

[0188] In one example, the unitized architecture further includes a second computer room; wherein the second computer room is a disaster recovery computer room of the first computer room; all units in the second computer room correspond one-to-one to all units in the first computer room; and the apparatus 600 further includes:

[0189] Update unit 609 is used to update the configuration information of the first computer room based on the unitized architecture; and update the configuration information of the second computer room; wherein the configuration information includes first information and second information; the first information is the corresponding information between each unit and each data shard; the second information is the corresponding information between each data shard and each database.

[0190] The device of this embodiment can execute the technical solution in the above method. Its specific implementation process and technical principles are the same and will not be repeated here.

[0191] Figure 9 is a structural diagram of an electronic device provided in an embodiment of the present application. As shown in Figure 9, the electronic device 700 includes: a memory 701, a processor 702; a memory 701; and a memory for storing instructions executable by the processor 702, for example, computer-executable instructions.

[0192] The processor 702 is configured to execute the method provided in the above embodiment.

[0193] The electronic device 700 further includes a receiver 703 and a transmitter 704. The receiver 703 is used to receive instructions and data sent by other devices, and the transmitter 704 is used to send instructions and data to external devices.

[0194] FIG10 is a block diagram of an electronic device according to an exemplary embodiment. The electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0195] The electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .

[0196] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.

[0197] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk, or optical disk.

[0198] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0199] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display and a touch panel. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0200] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 88 further includes a speaker for outputting audio signals.

[0201] The input / output interface 812 provides an interface between the processing component 802 and peripheral interface modules, such as a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0202] The sensor assembly 814 includes one or more sensors for providing various aspects of status confirmation information for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect changes in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0203] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near-field communication module to facilitate short-range communication. For example, the near-field communication module can be implemented based on radio frequency identification technology, infrared data association technology, ultra-wideband technology, Bluetooth technology, and other technologies.

[0204] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits, digital signal processors, digital signal processing devices, programmable logic devices, field programmable gate arrays, controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.

[0205] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including computer-executable instructions. The computer-executable instructions can be executed by the processor 820 of the electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a random access memory, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0206] An embodiment of the present application also provides a non-transitory computer-readable storage medium, which enables the electronic device to perform the above method when the computer execution instructions in the storage medium are executed by the processor of the electronic device.

[0207] According to an embodiment of the present application, the present application also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0208] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0209] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data migration method based on a unitized architecture. It is characterized in that The method comprises: Based on the unitized architecture, during the process of business processing by the unit, the data volume and flow of each unit in the first computer room are monitored; wherein the first computer room includes at least one unit; the data volume is the business data volume in the database connected to each unit at the current moment; the flow is the total amount of access to the business system deployed by each unit at the current moment; According to the data volume and the traffic, adding at least one unit to the first computer room; Obtaining the serial number of each data shard in each of the units; wherein each of the data shards is obtained after sharding the business data in the database; and determining the target data shard according to the serial number of each of the data shards in each of the units; wherein the target data shard is the data shard that needs to be migrated; The business data corresponding to the target data shard is migrated to the unit added to the first computer room.

2. The method according to claim 1, It is characterized in that According to the data volume and the traffic, at least one unit is added to the first computer room, including: For each of the units in the first computer room, if it is monitored that the data volume of the unit is greater than or equal to the first preset data volume, N units are added to the first computer room; wherein N is a positive integer greater than or equal to 1; the total number of units in the first computer room to which the N units are added is less than or equal to the value represented by the first parameter; the first parameter is used to indicate the maximum number of units that the first computer room can include.

3. The method according to claim 2, It is characterized in that According to the data volume and the traffic, at least one unit is added to the first computer room, further comprising: If it is determined that the monitored flow rate of each of the units is greater than or equal to the first preset flow rate, M units are added to the first computer room; wherein M is a positive integer greater than or equal to 1; and the total number of units in the first computer room to which the M units are added is less than or equal to the value represented by the first parameter.

4. The method according to any one of claims 1 to 3, It is characterized in that The unit includes at least one data set, and the data set includes P data slices, where P is a positive integer greater than 1; determining a target data slice according to the sequence number of each data slice in each of the units, including: For each of the units, determine the Pth data shard and the P-1th data shard in the data set in the unit as the target data shards; Alternatively, for each of the units, the Pth data shard, the P-1th data shard, and the P-2th data shard in the data set in the unit are determined as the target data shards.

5. The method according to any one of claims 1 to 4, It is characterized in that The data slices in the unit have priorities; the priorities are determined based on the service type of the data slices, user information, and time information of the data slices; Determining a target data slice according to the sequence number of each of the data slices in each of the units includes: For each of the units, according to the priorities of the data slices in the unit, determine the data slice with the highest priority as the target data slice.

6. The method according to any one of claims 1 to 5, It is characterized in that Migrating the business data corresponding to the target data shard to the unit added in the first computer room includes: According to the number of units added in the first computer room, evenly divide the target data shards into the units added in the first computer room; For each of the target data slices, the business data corresponding to the target data slice is migrated to the database corresponding to the unit where the target data slice is located.

7. The method according to any one of claims 1 to 6, It is characterized in that Also includes: Deleting at least one unit from the first computer room according to the data volume and the traffic; Determine all data shards corresponding to the deleted units in the first computer room as the target data shards; Migrating the target data shards to the remaining units in the first computer room; The business data corresponding to each of the data migration shards is migrated to the database corresponding to the unit where each of the target data shards is located.

8. The method according to claim 7, It is characterized in that Deleting at least one unit from the first computer room according to the data volume and the traffic volume includes: For each of the units in the first computer room, if the data volume of the unit is monitored to be less than or equal to the second preset flow, K new units are deleted for the first computer room; wherein K is a positive integer greater than or equal to 1; the total number of units remaining in the first computer room is less than or equal to the value represented by the second parameter; the second parameter is used to indicate the minimum number of units that can be included in the first computer room.

9. The method according to claim 8, It is characterized in that According to the data volume and the traffic, at least one unit is deleted from the first computer room, further comprising: For each of the units in the first computer room, if the flow of the unit is monitored to be less than or equal to the second preset flow, L new units are deleted for the first computer room; wherein L is a positive integer greater than or equal to 1; and the total number of remaining units in the first computer room is less than or equal to the value represented by the second parameter.

10. The method according to any one of claims 1 to 9, It is characterized in that The unitized architecture further includes a second computer room; wherein the second computer room is a disaster recovery computer room of the first computer room; all units in the second computer room correspond one-to-one to all units in the first computer room; the method further includes: Based on the unitized architecture, update the configuration information of the first computer room; and update the configuration information of the second computer room; wherein the configuration information includes first information and second information; the first information is each of the units and each The corresponding information between the data shards; the second information is the corresponding information between each of the data shards and each of the databases.

11. A data migration device based on a unitized architecture, It is characterized in that The device comprises: The monitoring unit is used to monitor the data volume and flow of each unit in the first computer room based on the unitized architecture during the unit's business processing; wherein the first computer room includes at least one unit; the data volume is the business data volume in the database connected to each unit at the current moment; the flow is the total access volume of the business system deployed by each unit at the current moment; An adding unit, used for adding at least one unit to the first computer room according to the data volume and the traffic; An acquisition unit, used to acquire the serial number of each data slice in each of the units; wherein each of the data slices is obtained after slicing the business data in the database; A first determining unit, configured to determine a target data shard according to a sequence number of each of the data shards in each of the units; wherein the target data shard is a data shard that needs to be migrated; The first migration unit is used to migrate the business data corresponding to the target data shard to the unit added in the first computer room.

12. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 10 when executed by a processor.

14. A computer program product, It is characterized in that The computer program product comprises: a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Data processing method and device

    CN110674108A

  • Space arrangement method and device for distributed database, equipment and storage medium

    CN111831752A

  • Data redistribution method, electronic equipment and storage medium

    CN112765262A

  • Data backup method and device

    CN114661526A

  • Data migration method and device based on unitized architecture and electronic equipment

    CN116644057A