Account set data migration method, computer equipment and computer storage medium

By monitoring the number of available threads and memory resources of computer equipment in real time, dynamically configuring the number of threads to reasonably allocate resources, solving the problems of insufficient resources and inefficiency in the migration of books and data, and achieving stable and efficient migration of books and data.

CN119597213APending Publication Date: 2025-03-11SHENZHEN KINGDEE ACCOUNT WORRY-FREE NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411632816.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When customers switch financial systems, the migration of account data may lead to long time-consuming, network connection timeout, insufficient server resources or even downtime. The existing methods of using fixed thread pools or artificially configure thread pools have problems such as inefficiency and high cost.

Method used

By monitoring the current available thread count and memory resources of the computer device in real time, dynamically configure the number of threads to reasonably allocate resources, ensuring the stability and efficiency of account data migration.

Benefits of technology

It realizes the stability and efficiency of account data migration, avoids the shortage of resources and high load caused by fixed or artificially configured threads, reduces costs and improves processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597213A_ABST
    Figure CN119597213A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an account set data migration method, computer equipment and a computer storage medium. The computer equipment determines the thread count allocated to each account set level according to the current available memory resources and the current available thread count, so that the actual condition of the account set data is considered in the configuration of the thread count, and the situation that the thread count is configured too much or too little due to the fact that the actual condition of the account set data is not considered in the thread count configuration is avoided; afterwards, account set data migration can be performed based on the allocated thread count for each account set level. Therefore, the thread count can be dynamically configured in real time based on the current available thread count and the current available memory resources of the computer equipment, the problems of overhigh load, downtime or low processing efficiency caused by fixed configuration and manual configuration of the thread count when the computer equipment processes account set data migration are avoided, reasonable configuration of the threads can be realized, and the processing efficiency of the computer equipment is improved. And stability and high efficiency of account set data migration are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing, and specifically to an account set data migration method, computer equipment and computer storage medium. Background Art

[0002] When customers switch financial systems, they often need to migrate account data. During the data migration process, if the account data is too large or the memory occupied is too large, the data migration process will take a long time and the network connection will time out. Therefore, it is necessary to improve the efficiency and stability of account migration.

[0003] The migration of account data can be processed based on threads. The existing method controls the migration of account data by threads by fixing the number of threads in the thread pool or manually setting the configuration of the thread pool. However, when the amount of account data is large, the number of threads in the fixed thread pool may cause insufficient server processing resources or even cause the server to crash. Manual configuration of the thread pool requires manpower and is costly. Summary of the invention

[0004] The embodiments of the present application provide an account data migration method, a computer device, and a computer storage medium. The number of threads can be configured in real time and dynamically based on the current number of available threads and the current available memory resources of the computer device, thereby achieving reasonable configuration of threads and ensuring stable and efficient account data migration.

[0005] A first aspect of an embodiment of the present application provides an account set data migration method, the method being applied to a computer device, the method comprising:

[0006] Determine the account set levels of multiple account set data to be migrated;

[0007] determining currently available memory resources of the computer device and currently available number of threads of the computer device;

[0008] Determine the number of threads allocated to each account set level according to the currently available memory resources and the currently available number of threads;

[0009] For each of the account set levels, threads based on the number of threads allocated to the account set level perform data migration on the account set data at the account set level.

[0010] A second aspect of an embodiment of the present application provides a computer device, including:

[0011] A first determining unit, used to determine the account set levels of multiple account set data to be migrated;

[0012] A second determining unit, configured to determine currently available memory resources of the computer device and the currently available number of threads of the computer device;

[0013] A third determining unit, configured to determine the number of threads allocated to each of the account set levels according to the currently available memory resources and the currently available number of threads;

[0014] The data migration unit is used to migrate the account set data of each account set level based on the number of threads allocated to the account set level.

[0015] A third aspect of an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.

[0016] A fourth aspect of an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method of the first aspect.

[0017] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device executes the method of the first aspect.

[0018] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0019] Determine the account set levels of multiple account set data to be migrated, and determine the current available memory resources of the computer device and the current available number of threads of the computer device. Determine the number of threads allocated to each account set level based on the current available memory resources and the current available number of threads. Therefore, the configuration of the number of threads takes into account the actual situation of the account set data, avoiding the configuration of the number of threads without considering the actual situation of the account set data, resulting in too many or too few threads. After that, the account set data can be migrated for each account set level based on the allocated number of threads. Therefore, the number of threads can be configured in real time and dynamically based on the current number of available threads and the current available memory resources of the computer device, avoiding the problem of excessive load, downtime or low processing efficiency of the computer device processing the account set data migration due to fixed configuration and manual configuration of the number of threads, thereby achieving reasonable configuration of threads to ensure stable and efficient account set data migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of the network framework in the embodiment of the present application;

[0021] Figure 2 A flowchart of the method for migrating account data in an embodiment of the present application;

[0022] Figure 3 This is another flow chart of the method for migrating account data in the embodiment of the present application;

[0023] Figure 4 This is a schematic diagram of the structure of a computer device in an embodiment of the present application;

[0024] Figure 5 This is another structural diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiments of the present application provide an account data migration method, a computer device, and a computer storage medium. The number of threads can be configured in real time and dynamically based on the current number of available threads and the current available memory resources of the computer device, thereby achieving reasonable configuration of threads and ensuring stable and efficient account data migration.

[0026] See also Figure 1 In the embodiment of the present application, the network framework includes:

[0027] The service server 100 and the terminal cluster; the terminal cluster may include: terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n and other terminal devices.

[0028] The business server 100 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud database, cloud service, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform. The terminal device (including terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n) may be a smart phone, tablet computer, laptop computer, desktop computer, PDA, mobile internet device (MID), wearable device (such as smart watch, smart bracelet, etc.), smart computer, smart car and other smart terminals.

[0029] Among them, the business server 100 can establish a communication connection with each terminal device in the terminal cluster, and a communication connection can also be established between each terminal device in the terminal cluster. In other words, the business server 100 can establish a communication connection with each terminal device in the terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n. For example, a communication connection can be established between the terminal device 200a and the business server 100. A communication connection can be established between the terminal device 200a and the terminal device 200b, and a communication connection can also be established between the terminal device 200a and the terminal device 200c. Among them, the above-mentioned communication connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method, etc., which can be determined according to the actual application scenario, and this application is not limited here.

[0030] It should be understood that Figure 1 Each terminal device in the terminal cluster shown can be installed with an application client. When the application client runs in each terminal device, it can interact with the business server 100 respectively, so that the business server 100 can receive business data from each terminal device (such as financial management data uploaded by the user through the terminal device). Among them, the application client can be an application client with the function of displaying text, images, audio and video, such as a financial management application, an enterprise affairs management application, a browser application, a social application, an instant messaging application, a live broadcast application, a game application, a short video application, a video application, a music application, a shopping application, a novel application, a payment application, etc., which can be determined according to the actual application scenario requirements and is not limited here. Among them, the application client can be an independent client or an embedded sub-client integrated in a client (such as a financial management client, an enterprise affairs management client, etc.), which can be determined according to the actual application scenario and is not limited here.

[0031] When customers switch financial systems, they often need to migrate their account data. The migration of account data involves many steps and the program processing link is relatively long, which means that the processing of account data takes a long time and occupies more resources (the memory used before the program ends will not be released, and the occupied database connection will not be released). Especially when there is a lot of account data that needs to be migrated, the concurrent requests for data migration may cause the computer system to be overloaded instantly, resulting in slow system response or even crash.

[0032] Different account sets have different amounts of data. Account sets with more data take longer to process and occupy more memory resources than those with less data. In this regard, the solution is to use a thread pool for concurrent processing. The number of core threads and memory resources that can be allocated to the thread pool are set during initialization, that is, the number of core threads of the thread pool is fixed. If the number of core threads is set too large, it will cause the computer system's CPU load to be high, occupy a lot of memory, and even cause a memory overflow error OOM (OutOfMemoryError) to cause a crash; or if the number of core threads is set too small, the server will have insufficient processing resources, which will lead to low processing efficiency and long processing time.

[0033] In other methods, the number of core threads is determined after manual computer system stress testing. Since multiple businesses are executed together in an online environment, there are more uncertainties. Even with computer system stress testing, there may still be OOM problems caused by unreasonable setting of the number of core threads. Therefore, manual setting of thread pool configuration also has many limitations and requires manpower, which is costly.

[0034] In order to solve the above technical problems, a method for migrating account set data in an embodiment of the present application is proposed. Figure 1 The network framework of the present application is used to describe the method for migrating account data in the embodiment of the present application:

[0035] See also Figure 2 In the embodiment of the present application, an embodiment of the method for migrating account set data includes:

[0036] 201. Determine the account set levels of multiple account set data to be migrated;

[0037] The method of this embodiment can be applied to a computer device, which can be Figure 1 The business server 100 or each terminal device in the network framework shown. The computer device can determine the account set level of multiple account set data to be migrated, and the account set level can be determined based on any level classification standard, such as classification based on the memory occupied by the account set data, or classification based on the importance of the account set data, or classification based on the order in which the account set data is created, or classification based on other standards.

[0038] Therefore, through the level division of account set data, various actual situations of account set data can be determined, so that in the subsequent thread number configuration process, each actual situation of the account set data can be fully considered and reasonably configured separately, thereby improving the rationality of the thread number configuration.

[0039] 202. Determine currently available memory resources of the computer device and the currently available number of threads of the computer device;

[0040] In this embodiment, the computer device also determines the current number of available threads and the current available memory resources, so as to further configure the number of threads for the account set data of each account set level based on these multiple factors.

[0041] The currently available memory resources may be determined based on the total available memory resources and the currently used memory resources, and the currently available number of threads may be determined based on the total available number of threads and the currently used number of threads.

[0042] 203. Determine the number of threads allocated to each account set level according to the currently available memory resources and the currently available number of threads;

[0043] The account set level of the account set data represents the actual situation of the account set data. Therefore, the computer device can allocate the corresponding number of threads to each account set level based on the actual situation of the account set data represented by the account set level, according to the current number of available threads and the current available memory resources, so that the allocated number of threads can meet the migration of the account set data of each account set level, and ensure that the memory resources and thread resources of the computer device can be fully applied to the migration of the account set data, and will not affect other business processing of the computer device, thereby greatly reducing the risk of high load and downtime, and ensuring that the migration of account set data is carried out efficiently and stably.

[0044] Among them, the number of threads can be the number of core threads, that is, the number of core threads. The core threads are the threads of the executable program in the thread pool. The core threads will remain in the memory even if there are no tasks to be executed, and will execute tasks when waiting for tasks to arrive. Core threads are generally not destroyed due to idleness.

[0045] 204. For each of the account set levels, the threads based on the number of threads allocated to the account set level perform data migration on the account set data of the account set level;

[0046] After determining the number of threads allocated to each account set level, for each account set level, the account set data of the account set level can be migrated based on the number of threads allocated to the account set level, for example, the account set data can be migrated from the source system where it originally resides to the target system. Specifically, each thread can handle the migration of one account set data. For example, if 5 threads are allocated to a certain account set level, then the 5 account set data of this level can be migrated.

[0047] In this embodiment, the account set levels of multiple account set data to be migrated are determined, and the current available memory resources of the computer device and the current available number of threads of the computer device are determined. The number of threads allocated to each account set level is determined based on the current available memory resources and the current available number of threads. Therefore, the configuration of the number of threads takes into account the actual situation of the account set data, avoiding the configuration of the number of threads without considering the actual situation of the account set data, resulting in too many or too few threads. After that, the account set data can be migrated for each account set level based on the allocated number of threads. Therefore, the number of threads can be configured in real time and dynamically based on the current number of available threads and the current available memory resources of the computer device, avoiding the problem of excessive load, downtime or low processing efficiency of the computer device processing the account set data migration due to fixed configuration and manual configuration of the number of threads, thereby achieving reasonable configuration of threads and ensuring stable and efficient migration of account set data.

[0048] In addition, since no manual configuration is required, manpower expenditure can be reduced, thereby saving thread configuration costs and reducing the cost of account data migration.

[0049] The following will be Figure 2 Based on the embodiment shown, the embodiment of the present application is further described in detail. Figure 3 Another embodiment of the method for migrating account data in the embodiment of the present application includes:

[0050] 301. Generate an account set data migration task according to the received account set data migration request, and determine the account set data migration task to be executed currently from a plurality of the account set data migration tasks based on scheduled task scheduling;

[0051] In a preferred implementation of this embodiment, in order to ensure the high availability of the data migration service and solve the problem that the high concurrency of data migration requests may cause the system response to slow down, an account data migration task can be generated according to the received account data migration request, the account data migration request submitted by the user is recorded and an account data migration task is generated, and the account data migration is subsequently performed through task dispatching and scheduling. Therefore, this method reduces the account data migration process that needs to execute multiple processing steps to first saving only the account data migration request and task, and the account data to be migrated can be first stored in the database, and the account data in the database can be read for processing when there are processing resources (memory resources and thread resources, etc.), thereby realizing the technical strategy of peak shaving and valley filling.

[0052] The scheduled task scheduling is to execute tasks within a specified time or at a set frequency. For example, you can use the scheduled task scheduling function provided by the Spring Boot framework to handle the scheduled scheduling of account data migration tasks, or use the XXL-Job distributed task scheduling platform to manage and schedule scheduled tasks in a distributed environment, or use other scheduled task scheduling tools to handle the scheduling and management of account data migration tasks.

[0053] 302. Determine from the database that the multiple account set data corresponding to the current account set data migration task to be executed are the multiple account set data to be migrated;

[0054] The computer equipment can collect the account data to be migrated from each source system, and store the collected account data in the database for reading and data migration in the subsequent account data migration task. Therefore, when the account data migration task to be executed is determined by scheduled task scheduling, multiple account data corresponding to the account data migration task to be executed can be determined from the database, and these multiple account data are determined as the multiple account data to be migrated. Therefore, the orderly processing of account data migration can be achieved, avoiding the problem of instantaneous high load and downtime caused by the simultaneous concurrent processing of a large number of account data migrations, thereby ensuring the stability and efficiency of account data migration.

[0055] 303. Determine the account set levels of multiple account set data to be migrated;

[0056] In this embodiment, the account set levels of the multiple account set data to be migrated can be determined according to multiple level classification standards. For example, in a preferred embodiment, the account set levels of the multiple account set data to be migrated can be determined according to the memory occupied by the account set data, wherein the memory occupied by the account set data of the highest account set level is the largest among the memory occupied by the account set data of all account set levels.

[0057] For example, the memory occupied by the account set data can be divided into multiple ranges, each range corresponds to an account set level, and the account set data whose memory occupied falls into one of the ranges will have the account set level corresponding to the range. For example, the range corresponding to the account set level of level A is set to <1MB, the range corresponding to the account set level of level B is set to 1-10MB, the range corresponding to the account set level of level C is set to 10-30MB, and the range corresponding to the account set level of level D is set to >30MB. Therefore, for any account set data, its account set level can be determined according to the memory occupied by the account set data. Furthermore, among the above multiple account set levels, level D can be determined to be the highest account set level.

[0058] Therefore, by dividing the account set levels according to the memory occupied by the account set data, the account set level can reflect the actual memory situation of the account set data. When configuring the number of threads for each account set level later, the actual memory situation of the account set data can be considered to configure the number of threads, making the thread number configuration more reasonable.

[0059] 304. Determine currently available memory resources of the computer device and the currently available number of threads of the computer device;

[0060] In this embodiment, the current available memory resources can be determined based on the total available memory resources and the currently used memory resources, wherein the total available memory resources can be the total memory of the computer device; it can also be a part of the total memory, for example, it can be 75% of the total memory. For example, if the total memory of the computer device is 5G, the total available memory resources are 3.75G. If the currently used memory resources are 0.75G, the current available memory resources are 3.75G-0.75G=3G.

[0061] The current number of available threads can be determined based on the total number of available threads and the currently used number of threads, where the total number of available threads can be the maximum number of threads of the computer container, or a portion of the maximum number of threads, for example, 75% of the maximum number of threads. The computer container is a virtualization technology that provides an independent and isolated operating environment for applications, such as providing an independent and isolated operating environment for financial system software, so that the account set data migration can be stably run and processed based on its configured threads in this environment.

[0062] 305. Determine the number of threads allocated to each account set level according to the currently available memory resources and the currently available number of threads;

[0063] In determining the number of threads allocated to each account set level based on the currently available memory resources and the currently available number of threads, a preferred implementation method may be to determine a first condition for indicating that the sum of memory resources allocated to all account set levels is less than or equal to the currently available memory resources, and to determine a second condition for indicating that the sum of threads allocated to all account set levels is less than or equal to the currently available number of threads, and determine the number of threads allocated to each account set level based on the first condition and the second condition, that is, to determine the number of threads allocated to each account set level when the first condition and the second condition are met.

[0064] The memory resources allocated to each account set level can be determined based on the average memory occupied by the account set data at that account set level and the number of threads at that account set level.

[0065] For example, let the current available memory resource Q (available memory), the current available number of threads T (availableThread), and let the average memory occupied by the account set data of the four account set levels of A, B, C and D be a, b, c and d respectively, and let the number of threads allocated to these four account set levels be n, m, k and l respectively. For example, for the A-level account set level, the memory resource allocated for each thread to process the A-level account set data is a, then the memory resource allocated to the A-level account set level can be expressed as a×n, and so on, the memory resources allocated to other account set levels can be determined, so the first condition can be expressed as a×n+b×m+c×k+d×l≤Q, and then the second condition can be expressed as n+m+k+l≤T.

[0066] Among them, when determining the number of threads allocated to each account set level according to the first condition and the second condition, a preferred approach may be to calculate the number of threads allocated to each account set level so that the total number of threads allocated to all account set levels is the largest when the first condition and the second condition are met.

[0067] Continuing with the above example, the values ​​of n, m, k and l that maximize the sum of n+m+k+l can be calculated based on the first condition and the second condition.

[0068] Therefore, by calculating the number of threads allocated to each account set level so that the total number of threads allocated to all account set levels is the largest under the premise of satisfying the first condition and the second condition, it is possible to fully utilize thread resources for account set data migration when memory resources and thread resources are limited, thereby fully performing data migration to speed up data migration efficiency and improve thread utilization.

[0069] When calculating the number of threads allocated to each account set level so that the total number of threads allocated to all account set levels is the largest, the average memory occupied by each account set level can be obtained, and based on a dynamic programming algorithm, multiple thread number allocation schemes that meet the first condition and the second condition are determined according to the average memory occupied by each account set level, wherein the thread number allocation scheme is used to describe the number of threads allocated to each account set level, and then the number of threads allocated to each account set level can be determined according to the thread number allocation scheme with the largest total number of threads allocated to all account set levels among the multiple thread number allocation schemes.

[0070] The average memory occupied by each account set level can be the average memory occupied by multiple account set data at each account set level, for example, the average disk space occupied can be counted. This parameter can represent the data size of the account set data at the account set level, that is, the larger the average memory occupied, the larger the account set data.

[0071] For example, following the above example, the average memory occupied by the D-level account set is the largest, and it consumes the most resources, so the D-level account set data can be calculated first. If the current available memory resources are all used to execute the D-level account set data but still do not meet the first condition or the second condition, then calculate the number of executable threads m for the C-level account set data. Similarly, search downwards in sequence until the maximum value of sum(n+m+k+l) is determined when the condition n+m+k+l≤T is met. Therefore, based on the dynamic programming algorithm, for example, the number of threads l allocated to the D-level account set data can be calculated first. If l=T, the calculation ends, and the number of threads allocated to the subsequent C-level, B-level, and A-level account set data will not be calculated; if l≤T, the number of threads allocated to the C-level, B-level, and A-level account set data is calculated, that is, the recursion is continued until the optimal solution of sum(n+m+k+l) is met when the first condition and the second condition are met.

[0072] Therefore, by calculating the number of threads allocated to each account set level through a dynamic programming algorithm, the number of threads allocated to each account set level that maximizes the total number of threads allocated to all account set levels can be quickly determined, thereby improving computing efficiency.

[0073] 306. For each of the account set levels, the threads based on the number of threads allocated to the account set level perform data migration on the account set data of the account set level;

[0074] In this embodiment, when performing account set data migration, for each account set level, a thread pool corresponding to the account set level can be created based on the number of threads at the account set level, and data migration is performed on the account set data at the account set level based on each thread in the thread pool at the account set level. In addition, when the data migration is completed, the thread pool at the account set level is recycled to release the threads in the thread pool and release them to the computer container for subsequent account set data migration processing.

[0075] Therefore, in this embodiment, by real-time monitoring of the currently available memory resources and the currently available thread resources, resources are automatically and dynamically allocated according to the currently available memory resources and the currently available thread resources to perform concurrent account set data migration processing, so that the allocation of processing resources can fully consider the actual situation of the account set data and the current resource situation of the system, avoiding blind allocation that may lead to high system load, downtime or inefficient data migration, and can also provide sufficient processing resources for other business processing of the system, so as to protect the server from being affected while concurrently executing data migration.

[0076] The above describes the account set data migration method in the embodiment of the present application. The following describes the computer device in the embodiment of the present application. Figure 4 In the embodiment of the present application, one embodiment of the computer device includes:

[0077] A first determining unit, used to determine the account set levels of multiple account set data to be migrated;

[0078] A second determining unit, configured to determine currently available memory resources of the computer device and the currently available number of threads of the computer device;

[0079] A third determining unit, configured to determine the number of threads allocated to each of the account set levels according to the currently available memory resources and the currently available number of threads;

[0080] The data migration unit is used to migrate the account set data of each account set level based on the number of threads allocated to the account set level.

[0081] In a preferred implementation manner of this embodiment, the third determining unit is specifically configured to:

[0082] Determine a first condition for indicating that the sum of memory resources allocated at all account set levels is less than or equal to the currently available memory resources;

[0083] Determine a second condition for indicating that the sum of the number of threads allocated at all account set levels is less than or equal to the number of currently available threads;

[0084] The number of threads allocated to each account set level is determined according to the first condition and the second condition.

[0085] In a preferred implementation manner of this embodiment, the third determining unit is specifically configured to:

[0086] The number of threads allocated to each of the account set levels is calculated so that the sum of the number of threads allocated to all the account set levels is maximized when the first condition and the second condition are met.

[0087] In a preferred implementation manner of this embodiment, the third determining unit is specifically configured to:

[0088] Get the average memory usage of each account set level;

[0089] Based on a dynamic programming algorithm, multiple thread number allocation schemes satisfying the first condition and the second condition are determined according to the average memory occupied by each of the account set levels, wherein the thread number allocation schemes are used to describe the number of threads allocated to each of the account set levels;

[0090] The number of threads allocated at each account set level is determined according to a thread number allocation scheme having the largest sum of the number of threads allocated at all the account set levels among the multiple thread number allocation schemes.

[0091] In a preferred implementation manner of this embodiment, the first determining unit is specifically configured to:

[0092] The account set levels of the multiple account set data to be migrated are determined according to the memory occupied by the account set data, wherein the memory occupied by the account set data of the highest account set level is the largest among the memory occupied by the account set data of all the account set levels.

[0093] In a preferred implementation manner of this embodiment, the first determining unit is further configured to:

[0094] Collect account data and store the collected account data in the database;

[0095] Generate an account set data migration task based on the received account set data migration request;

[0096] Determine the current account set data migration task to be executed from the multiple account set data migration tasks based on scheduled task scheduling;

[0097] Determine from the database that the multiple account set data corresponding to the current account set data migration task to be executed are the multiple account set data to be migrated.

[0098] In a preferred implementation of this embodiment, the data migration unit is specifically used for:

[0099] Create a thread pool corresponding to the account set level based on the number of threads at the account set level, and migrate the account set data at the account set level based on each thread in the thread pool at the account set level;

[0100] When data migration is completed, the thread pool at the account set level is recycled.

[0101] In this embodiment, the operations performed by each unit in the computer device are the same as those described above. Figures 2 to 3 The description in the illustrated embodiment is similar and will not be repeated here.

[0102] The computer device in the embodiment of the present application is described below. Figure 5 In the embodiment of the present application, one embodiment of the computer device includes:

[0103] The computer device 500 may include one or more central processing units (CPU) 501 and a memory 505 , wherein the memory 505 stores one or more application programs or data.

[0104] The memory 505 may be a volatile storage or a persistent storage. The program stored in the memory 505 may include one or more modules, each of which may include a series of instruction operations in the computer device. Furthermore, the central processing unit 501 may be configured to communicate with the memory 505 and execute a series of instruction operations in the memory 505 on the computer device 500.

[0105] The computer device 500 may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input and output interfaces 504, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0106] The CPU 501 can execute the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment will not be described in detail here.

[0107] The present application also provides a computer storage medium, wherein one embodiment includes: the computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment.

[0108] The present application also provides a computer program product, wherein one embodiment includes: when the computer program product is run on a computer device, the computer device executes the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment.

[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0110] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0111] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0112] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0113] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for migrating account set data, characterized in that: The method is applied to a computer device, and the method comprises: Determine the account set levels of multiple account set data to be migrated; determining currently available memory resources of the computer device and currently available number of threads of the computer device; Determine the number of threads allocated to each account set level according to the currently available memory resources and the currently available number of threads; For each of the account set levels, threads based on the number of threads allocated to the account set level perform data migration on the account set data at the account set level.

2. The method according to claim 1, characterized in that The determining the number of threads allocated to each account set level according to the currently available memory resources and the currently available number of threads includes: Determine a first condition for indicating that the sum of memory resources allocated at all account set levels is less than or equal to the currently available memory resources; Determine a second condition for indicating that the sum of the number of threads allocated at all account set levels is less than or equal to the number of currently available threads; The number of threads allocated to each account set level is determined according to the first condition and the second condition.

3. The method according to claim 2, characterized in that The determining the number of threads allocated to each account set level according to the first condition and the second condition includes: The number of threads allocated to each of the account set levels is calculated so that the sum of the number of threads allocated to all the account set levels is maximized when the first condition and the second condition are met.

4. The method according to claim 3, characterized in that The calculating, when the first condition and the second condition are met, the number of threads allocated to each account set level so that the sum of the number of threads allocated to all account set levels is the largest, includes: Get the average memory usage of each account set level; Based on a dynamic programming algorithm, multiple thread number allocation schemes satisfying the first condition and the second condition are determined according to the average memory occupied by each of the account set levels, wherein the thread number allocation schemes are used to describe the number of threads allocated to each of the account set levels; The number of threads allocated at each account set level is determined according to a thread number allocation scheme having the largest sum of the number of threads allocated at all the account set levels among the multiple thread number allocation schemes.

5. The method according to any one of claims 1 to 4, characterized in that: The step of determining the account set levels of the multiple account set data to be migrated includes: The account set levels of the multiple account set data to be migrated are determined according to the memory occupied by the account set data, wherein the memory occupied by the account set data of the highest account set level is the largest among the memory occupied by the account set data of all the account set levels.

6. The method according to claim 1, characterized in that The method further comprises: Collect account data and store the collected account data in the database; Generate an account set data migration task based on the received account set data migration request; Determine the current account set data migration task to be executed from the multiple account set data migration tasks based on scheduled task scheduling; Determine from the database that the multiple account set data corresponding to the current account set data migration task to be executed are the multiple account set data to be migrated.

7. The method according to any one of claims 1 to 6, characterized in that: The threads based on the number of threads allocated at the account set level perform data migration on the account set data at the account set level, including: Create a thread pool corresponding to the account set level based on the number of threads at the account set level, and migrate the account set data at the account set level based on each thread in the thread pool at the account set level; When data migration is completed, the thread pool at the account set level is recycled.

8. A computer device, characterized in that: include: A first determining unit, used to determine the account set levels of multiple account set data to be migrated; A second determining unit, configured to determine currently available memory resources of the computer device and the currently available number of threads of the computer device; A third determining unit, configured to determine the number of threads allocated to each of the account set levels according to the currently available memory resources and the currently available number of threads; The data migration unit is used to migrate the account set data of each account set level based on the number of threads allocated to the account set level.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that When the computer program product is executed on a computer device, the computer device is caused to perform the method according to any one of claims 1 to 7.