Mail migration method and device, electronic equipment, storage medium and program product

CN117097694BActive Publication Date: 2026-10-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210523153.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2026-10-23
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

但是采用这种方案,由于采用单机执行,受限于单机的处理能力,当需要迁移的邮件较多时,其迁移耗时较长,邮件迁移效率低

Benefits of technology

[0048]此外,本发明实施例还提供一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时实现本发明实施例所提供的任一种邮件迁移方法中的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117097694B_ABST
    Figure CN117097694B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a mail migration method and device, electronic equipment, storage medium and program product; a mail migration request can be acquired through an access layer of a mail migration system, a mail migration task is generated based on the mail migration request, a target queue is selected from a task execution queue controlled by a logic layer of the mail migration system, the mail migration task is written into the target queue, a target server corresponding to the target queue in a distributed server is determined, the mail migration task currently needing to be processed is read from the target queue through the target server, target mail data needing to be migrated is acquired based on the mail migration task through the target server, and mail migration is performed on the target mail data based on the target server; the mail migration service is split, the coupling of the mail migration process is reduced, the mail migration processing capacity is enhanced, and the mail migration efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and more specifically to email migration methods, apparatus, electronic devices, storage media, and program products. Background Technology

[0002] With the rapid development of the economy and technology, email has become increasingly common in people's lives. In practical applications, to facilitate the management of emails in mailboxes, it is often necessary to migrate the emails of one or more users.

[0003] Currently, the main method for migrating emails is to run an email migration program on a single server, retrieving the email account information to be migrated from the database. However, this approach, due to its single-machine execution, is limited by the processing power of that single machine. When there are many emails to be migrated, the migration process is time-consuming and inefficient. Summary of the Invention

[0004] The embodiments of the present invention provide email migration methods, apparatus, electronic devices, storage media, and program products, which can decompose email migration services, reduce the coupling of email migration processes, expand the distributed email migration system at any time, enhance email migration processing capabilities, and improve email migration efficiency.

[0005] This invention provides an email migration method, including:

[0006] The email migration system obtains email migration requests through its access layer and generates email migration tasks based on these requests.

[0007] Through the logic layer of the email migration system, a target queue for writing the email migration task is selected from the task execution queue controlled by the logic layer, and the email migration task is written into the target queue.

[0008] Determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server;

[0009] Based on the email migration task, obtain the target email data that needs to be migrated;

[0010] Email migration is performed on the target email data using the target server.

[0011] Accordingly, embodiments of the present invention also provide an email migration device, comprising:

[0012] The task generation unit is used to obtain email migration requests through the access layer of the email migration system and generate email migration tasks based on the email migration requests.

[0013] The task writing unit is used to select a target queue for writing the email migration task from the task execution queue controlled by the logic layer of the email migration system, and write the email migration task into the target queue.

[0014] The task reading unit is used to determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server;

[0015] The data acquisition unit is used to acquire the target email data to be migrated based on the email migration task through the target server.

[0016] The email migration unit is used to migrate the target email data based on the target server.

[0017] Optionally, the email migration request includes a target migration duration. The email migration device provided in this embodiment of the invention further includes a queue expansion unit, used to predict the actual migration duration of the email migration process based on the target email data and the target queue.

[0018] If the actual migration time is greater than the target migration time, a new target queue and a new server corresponding to the new target queue are determined so that the new actual migration time predicted based on the new target queue is not greater than the target migration time.

[0019] The email migration unit is used to migrate the target email data based on the target server and the new server.

[0020] Optionally, the email migration apparatus provided in this embodiment of the invention further includes a task rewriting unit, used to detect the migration result of the target server performing email migration on the target email data;

[0021] When the migration result is a migration failure, the email migration task corresponding to the target email data that failed to migrate is determined;

[0022] Perform the step of writing the email migration task into the target queue.

[0023] Optionally, the email migration apparatus provided in this embodiment of the invention further includes a task redistribution unit, which is used to select a task execution queue other than the target queue from the task execution queue controlled by the logic layer as a new target queue for writing the email migration task when writing the email migration task into the target queue fails.

[0024] Perform the step of writing the email migration task into the target queue.

[0025] Optionally, the email migration request includes migration indication information, which is used to indicate the migration association information corresponding to the target email data;

[0026] The task generation unit is used to obtain migration association information indicated by the migration instruction information from the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system;

[0027] Based on the migration association information, an email migration task is generated.

[0028] Optionally, the task generation unit is used to send a permission acquisition request to the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system, and trigger the information storage layer to generate a permission granting instruction based on the permission acquisition request.

[0029] Obtain the permission granting instruction, and according to the permission granting instruction, obtain the migration association information indicated by the migration instruction information from the information storage layer.

[0030] Optionally, the email migration task includes the target email migration type in the email migration process;

[0031] The email migration unit is used to parse the email migration task based on the target server to obtain the target email migration type corresponding to the email migration task.

[0032] Determine the target migration procedure corresponding to the target email migration type;

[0033] Based on the target migration procedure, the target email data is migrated.

[0034] Optionally, the email migration unit is configured to determine the target migration function corresponding to the target email migration type from at least one preset migration function corresponding to the target email migration type.

[0035] Based on the target migration function, a target migration program corresponding to the target email migration type is generated.

[0036] Optionally, the email migration device provided in this embodiment of the invention further includes an extension code acquisition unit, used to acquire extension function code, the extension function code being used to implement extension functions during the email migration process;

[0037] The email migration unit is used to generate a target migration program for the email migration process based on the target migration function and the extended function code.

[0038] Execute the extended functionality code in the target migration procedure;

[0039] The target email data is migrated based on the target migration function in the target migration procedure.

[0040] Optionally, the email migration unit is configured to determine the target migration program corresponding to the target email migration type from a preset set of migration programs corresponding to at least one email migration type, based on the target email migration type corresponding to the email migration task.

[0041] Optionally, the email migration device provided in this embodiment of the invention further includes a migration information storage unit, used to acquire migration record information generated when migrating the target email data;

[0042] The migration record information is stored in the information storage layer of the email migration system.

[0043] Optionally, the task generation unit is used to obtain email migration requests through the access layer of the email migration system, and generate at least two email migration tasks based on the email migration requests. The email migration tasks include a task issuance time, and the email data to be migrated is different for different email migration tasks.

[0044] The email migration device provided in this embodiment of the invention further includes a task timed issuance unit, which is used to determine whether each email migration task meets the task issuance conditions based on the task issuance time of each email migration task.

[0045] The access layer distributes email migration tasks that meet the task distribution conditions to the logic layer of the email migration system.

[0046] Accordingly, embodiments of the present invention also provide an electronic device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to perform the steps in any of the email migration methods provided in the embodiments of the present invention.

[0047] Accordingly, embodiments of the present invention also provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the mail migration methods provided in embodiments of the present invention.

[0048] Furthermore, embodiments of the present invention also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in any of the email migration methods provided in embodiments of the present invention.

[0049] The solution adopted in this embodiment of the invention can obtain email migration requests through the access layer of the email migration system, generate email migration tasks based on the email migration requests, select the target queue for writing the email migration task from the task execution queue controlled by the logic layer through the logic layer, write the email migration task into the target queue, determine the target server corresponding to the target queue in the distributed deployment server, read the email migration task to be processed from the target queue through the target server, obtain the target email data to be migrated based on the email migration task through the target server, and perform email migration on the target email data based on the target server. Since this embodiment of the invention designs an email migration system including an access layer and a logic layer, and the servers corresponding to each task execution queue in the logic layer are distributed, the email migration service is decomposed, the coupling of the email migration process is reduced, the queue for email migration can be expanded at any time, the email migration processing capacity is enhanced, and the email migration efficiency is improved. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a schematic diagram of a scenario for the email migration method provided in an embodiment of the present invention;

[0052] Figure 2 This is a flowchart of the email migration method provided in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of a logic layer server downtime fault provided in an embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of the expansion of the logic layer server provided in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of the email migration system provided in an embodiment of the present invention;

[0056] Figure 6 This is a schematic diagram of the target migration procedure generation process provided in an embodiment of the present invention;

[0057] Figure 7 This is a schematic diagram illustrating the extended functions provided in the embodiments of the present invention;

[0058] Figure 8 This is another flowchart illustrating the email migration method provided in this embodiment of the invention;

[0059] Figure 9 This is a schematic diagram of the email migration process provided in an embodiment of the present invention;

[0060] Figure 10 This is a schematic diagram of the logic layer scheduling process provided in an embodiment of the present invention;

[0061] Figure 11 This is a schematic diagram of the email migration device provided in an embodiment of the present invention;

[0062] Figure 12 This is another structural schematic diagram of the email migration device provided in an embodiment of the present invention;

[0063] Figure 13 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention;

[0064] Figure 14 This is a graph showing the change in server call volume during the business evolution process provided in this embodiment of the invention;

[0065] Figure 15 This is a graph showing the change in the call volume of a server in a server cluster before and after the server fails and goes down, as provided in an embodiment of the present invention.

[0066] Figure 16 This is a graph showing the change in the call volume of a server cluster before and after a server in the server cluster fails and goes down, as provided in an embodiment of the present invention. Detailed Implementation

[0067] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0068] This invention provides an email migration method, apparatus, electronic device, and computer-readable storage medium. Specifically, this invention provides an email migration method suitable for an email migration apparatus that can be integrated into an electronic device.

[0069] The electronic device can be a terminal or other device, including but not limited to mobile terminals and fixed terminals. For example, mobile terminals include but are not limited to smartphones, smartwatches, tablets, laptops, smart vehicles, etc., while fixed terminals include but are not limited to desktop computers, smart TVs, etc.

[0070] The electronic device can also be a server or other similar device. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, but it is not limited to these.

[0071] The email migration method of this invention can be implemented by a server or by both a terminal and a server.

[0072] The following example illustrates this email migration method using both a terminal and a server.

[0073] like Figure 1 As shown, the email migration system provided in this embodiment of the invention may include a user-side device 10 and a service-side device 20, etc.; the user-side device 10 and the service-side device 20 are connected via a network, such as a wired or wireless network.

[0074] The user-side device 10 may include several terminals to provide users with functions such as email display and email sending and receiving, so that users can perform email management operations such as sending, receiving, deleting, etc.

[0075] The server-side device 20 may include several servers to provide various business services to users. For example, it may include a storage server for storing email content, images corresponding to the email content, image storage addresses, verification tokens, etc., and an email server for sending and managing emails, etc.

[0076] In some examples, user-side device 10 can be a terminal for a user to perform email migration operations, used to send email migration requests to service-side device 20.

[0077] Server-side device 20 can be used to obtain email migration requests through the access layer of the email migration system, generate email migration tasks based on the email migration requests, select the target queue for writing email migration tasks from the task execution queue controlled by the logic layer of the email migration system, and write the email migration tasks into the target queue. Each task in a task execution queue is executed by one server. The system can also determine the target server corresponding to the target queue in the distributed deployment of servers, read the email migration tasks to be processed from the target queue through the target server, obtain the target email data to be migrated based on the email migration tasks through the target server, and perform email migration on the target email data based on the target server.

[0078] It is understood that in some embodiments, the email migration steps performed by the server-side device 20 may also be performed by the user-side device 10, and this embodiment of the present invention does not limit this.

[0079] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0080] The embodiments of the present invention will be described from the perspective of an email migration device, which can be integrated into a server and / or a terminal.

[0081] like Figure 2 As shown, the specific process of the email migration method in this embodiment can be as follows:

[0082] 201. Obtain email migration requests through the access layer of the email migration system, and generate email migration tasks based on the email migration requests.

[0083] In this context, an email migration system can be an organic whole with the function of migrating user emails. In some examples, an email migration system may include at least an access layer and a logic layer, which are interconnected and interact with each other to jointly realize the email migration function.

[0084] It is understood that the email migration system in this embodiment of the invention can provide email migration services to external enterprises for enterprise-level email users, or it can provide email migration services to ordinary individual users.

[0085] For example, an email migration system can migrate emails from one or more employee accounts belonging to a company, or it can migrate emails from an individual's personal account. When migrating emails, the system can migrate all emails from one or more accounts, or it can migrate only a portion of the emails; this embodiment of the invention does not limit this.

[0086] The access layer is a module in the email migration system that supports cluster deployment and Remote Procedure Call (RPC). The access layer provides functional interfaces that can be called by other modules, enabling communication between them.

[0087] In some embodiments, the access layer may include one or more servers to receive email migration requests, respond to email migration requests, schedule email migration tasks, and so on.

[0088] Specifically, email migration requests can be generated based on user actions on the user's device. For example, the user's device can generate an email migration request in response to a user's trigger action on an email migration control, and then send the email migration request to the email migration system.

[0089] Alternatively, email migration requests can also be generated by the server-side device. For example, due to storage space limitations, the email data of employees in the same enterprise may be stored in different storage areas. In order to facilitate the management of email data, the server-side device can generate email migration requests to migrate email data stored in different storage areas to the same storage area.

[0090] In some examples, an email migration request may simply be an instruction that triggers the email migration system to perform an email migration, without including any other information. In response to the email migration request, the email migration system may send an information retrieval request to the user-side device or server-side device that generated the email migration request to obtain information that may be needed during the email migration process.

[0091] In other examples, to improve email migration efficiency, the email migration request may include migration instruction information. This migration instruction information can be used to indicate migration association information corresponding to the target email data. The step "generating an email migration task based on the email migration request through the access layer of the email migration system" may specifically include:

[0092] Based on the email migration request, the access layer of the email migration system retrieves the migration instruction information and migration association information indicated by the information storage layer of the email migration system.

[0093] Generate an email migration task based on the migration association information.

[0094] The information storage layer of the email migration system can be a highly available data storage module that supports cluster deployment in the email migration system. It can be used to store user email information, email migration status of each user, migration logs and other information.

[0095] Specifically, migration instructions can indicate the information needed when migrating target email data. For example, migration instructions can be the user identifier of the user initiating the email migration (such as user ID, user's email account and password); or, migration instructions can be the storage location of migration-related information in the information storage layer, and so on.

[0096] Migration-related information refers to all or part of the information required during the process of acquiring and / or migrating the target email data. Specifically, migration-related information may include, but is not limited to, the user's email account and password, the IP address and port of the server storing the target email data, and the type of migration protocol used during the migration of the target email data.

[0097] In this embodiment of the invention, an email migration task is a set of instructions that can be issued to the logical layer of the email migration system for execution. The email migration task may include migration association information, as well as specific email migration instructions and parameters.

[0098] It is understood that email migration can be implemented using a cluster deployment in this embodiment of the invention, and several servers may be running simultaneously in the email migration system. If multiple servers simultaneously request migration-related information from the information storage layer, information transmission errors may occur between the servers and the information storage layer. Therefore, the access layer servers can be granted access permissions to obtain information based on the information storage layer. That is, the step "obtaining migration-related information indicated by migration instruction information from the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system" can specifically include:

[0099] The access layer of the email migration system sends an access request to the information storage layer of the email migration system based on the email migration request, which triggers the information storage layer to generate an access grant instruction based on the access request.

[0100] Obtain the permission granting instruction, and based on the permission granting instruction, retrieve the migration instruction information and migration association information indicated by the migration instruction from the information storage layer.

[0101] The permission acquisition request is a request sent from the access layer to the information storage layer, requesting permission from the information storage layer for a specific server to obtain migration-related information. The permission granting instruction is the code from the information storage layer that allows a specific server to obtain migration-related information from the information storage layer.

[0102] Specifically, when the access layer sends a permission acquisition request, each server deployed in the cluster within the access layer can simultaneously send its own permission acquisition request to the information storage layer. The information storage layer can then generate a permission granting instruction corresponding to any given server based on these requests.

[0103] In this embodiment, the permission acquisition request of each server may include the identification information of each server. The information storage layer can generate a permission granting instruction for a specific server based on the server identification information in the permission acquisition request.

[0104] Alternatively, in other embodiments, when the access layer sends a permission acquisition request, it may send the access layer's permission acquisition request to the information storage layer, and the information storage layer may generate a permission granting instruction for the access layer. After obtaining the permission granting instruction, the access layer can determine a server from the server pool to retrieve migration instruction information from the information storage layer according to the permission granting instruction.

[0105] Alternatively, in other embodiments, the access layer can schedule the servers deployed in the cluster. When sending a permission acquisition request, it can send a permission acquisition request for a specific server to the information storage layer. The information storage layer can then generate a permission granting instruction corresponding to that server based on the permission acquisition request.

[0106] Optionally, in order to ensure the security of information in the information storage layer and prevent malicious programs from obtaining migration-related information, the permission granting instruction generated by the information storage layer may include verification information for obtaining migration-related information from the information storage layer.

[0107] 202. Through the logic layer of the email migration system, select the target queue for writing email migration tasks from the task execution queue controlled by the logic layer, and write the email migration tasks into the target queue.

[0108] In this embodiment of the invention, the logical layer of the email migration system can be a message queue module (MQ module) that supports cluster deployment and high availability.

[0109] The task execution queue can be a message queue controlled by the logic layer. The task execution queue can pass email migration tasks to be executed to the server corresponding to the task execution queue for execution.

[0110] The target queue is one or more task execution queues that are being written into the current mail migration task.

[0111] In practical applications, migration of target email data may fail due to server malfunctions, network connection failures, or other reasons. To prevent the failure of migrating a portion of the target email data from affecting the overall service of the email migration system, the migration results can be monitored, and if migration failures are found, the task can be promptly reassigned. In other words, the email migration method provided in this embodiment of the invention may further include:

[0112] Detect the migration results of the target server in migrating the target email data;

[0113] When the migration result is migration failure, determine the email migration task corresponding to the target email data that failed to migrate;

[0114] Perform the step of writing the email migration task to the target queue.

[0115] For example, such as Figure 3 As shown, the MQ4 server in the logic layer experienced a failure and crashed, interrupting all its running email migration tasks. The system can detect the migration results of the target server's email data migration, for example, by using the task scheduling in the access layer to identify whether the running email migration task timed out. If the migration result is a failure, such as an email migration task timeout, the access layer can re-initiate the email migration task, that is, rewrite the email migration task into the target queue.

[0116] It is understandable that, in the event of a server failure or downtime at the logic layer, if the access layer discovers during task scheduling that the server hosting the original target queue for the email migration task is unreachable, it can determine a new target queue and write the email migration task into the new target queue. That is, the email migration method provided in this embodiment of the invention may further include:

[0117] When writing the email migration task to the target queue fails, a new target queue for writing the email migration task is selected from the task execution queues controlled by the logic layer, excluding the target queue.

[0118] Perform the step of writing the email migration task to the target queue.

[0119] For example, if the access layer finds that the MQ4 server cannot be pinged after re-initiating a failed email migration task, it can dispatch the email migration task to other servers for processing. That is, a new target queue is determined, and the email migration task is written into the new target queue to ensure the stable progress of the overall migration.

[0120] It should be noted that the target server for the new target queue is different from the target server for the task execution queue that failed to migrate.

[0121] As can be seen, in this embodiment of the invention, modules such as the access layer and the logic layer are deployed separately. After each module is deployed in a cluster, even if a single machine fails, the response of the cluster service will not be affected.

[0122] In some optional embodiments, due to the large amount of data to be migrated, migrating all email data at once would take a long time, affecting normal user operation. Therefore, the same batch of data can be migrated periodically or irregularly, multiple times, according to the user's actual email migration needs. That is, the step "obtaining email migration requests through the access layer of the email migration system and generating email migration tasks based on the email migration requests" includes:

[0123] The email migration system obtains email migration requests through its access layer. Based on these requests, it generates at least two email migration tasks. Each email migration task includes a task issuance time, and the email data to be migrated varies depending on the task.

[0124] The task distribution time can be a specific moment or a time period. The access layer can determine the task distribution time for the generated email migration task based on factors such as the number of email migration tasks currently being executed or waiting to be executed, and the importance of the email data corresponding to the generated email migration task.

[0125] For example, the access layer can generate three different email migration tasks based on the email migration request to migrate the email data corresponding to the request. Email migration task 1 can correspond to emails sent and received by a user within the last 7 days, email migration task 2 can correspond to emails sent and received by the same user within the last 7-30 days, and email migration task 3 can correspond to emails sent and received by the same user more than 30 days ago.

[0126] Accordingly, the access layer can issue the previous task of the email to the access layer based on the task issuance time. That is, before the step "selecting the target queue for writing the email migration task from the task execution queue controlled by the logic layer of the email migration system", the email migration method provided in this embodiment of the invention may further include:

[0127] Based on the task release time of each email migration task, determine whether each email migration task meets the task release conditions;

[0128] Through the access layer, email migration tasks that meet the task distribution conditions are distributed to the logic layer of the email migration system.

[0129] The task assignment condition can be that the time interval between the current time and the task assignment time (a certain time) is not greater than a preset assignment time threshold, or that the time interval between the current time and the start or end time of the task assignment time (a certain time) is not greater than a preset assignment time threshold, or that the task assignment condition can also be that the current time is within the task assignment time and the email migration system can execute the email migration task, etc.

[0130] By migrating email data regularly or irregularly, and multiple times, the number of users that the email migration system can support at the same time can be increased, thereby improving the service capabilities of the email migration system.

[0131] 203. Determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server.

[0132] In practical applications, the execution of email migration tasks in the target queue actually requires the server to provide hardware or software resources. For example, the server can run threads or processes to specifically execute email migration tasks in the target queue.

[0133] In this embodiment of the invention, the server of the logic layer can be deployed in a distributed manner, realizing a scalable cluster structure and reducing the execution pressure of email migration tasks.

[0134] Understandably, a target queue can have one or more target servers. For example, if the logic layer determines that the workload of email migration tasks in the target queue is small, it can allocate only one target server to handle the email migration tasks. If the logic layer determines that the workload of email migration tasks in the target queue is large, it can allocate several target servers to handle the email migration tasks.

[0135] Generally, excessively long email migration times can significantly impact user experience. Therefore, when processing capacity is insufficient, timely service expansion is necessary to prevent email migration from becoming too time-consuming.

[0136] For example, in some examples, the email migration request may include a target migration duration. Before the step "migrate email data based on the target server", the email migration method provided in this embodiment of the invention may further include:

[0137] Based on the target email data and the target queue, predict the actual migration time of the email migration process;

[0138] If the actual migration time is longer than the target migration time, a new target queue and the corresponding new server are determined so that the new actual migration time predicted based on the new target queue is not greater than the target migration time.

[0139] The target migration duration can be a time set by the user through their device, or it can be a time set by the server based on requirements. For example, if the server needs to migrate email data from different storage areas to a designated area before a certain time, the target migration duration can be set according to that time.

[0140] Specifically, the actual migration time can be determined based on the amount of target email data and the number of target queues scheduled by the logic layer. For example, if the number of target queues is the same, the larger the amount of target email data, the longer the actual migration time will generally be.

[0141] Accordingly, during the email migration process, email migration can be performed by adding a new server based on the target server. That is, the step "Migrate email data based on the target server" can specifically include:

[0142] Based on the target server and the newly added server, perform email migration on the target email data.

[0143] For example, Company A needs to initiate an email migration with a large number of members. If the current message queue (MQ) processing capacity at the logic layer is insufficient to complete the migration on schedule, then... Figure 4 As shown, horizontal scaling can be performed on the logic layer MQ separately. Increasing the number of MQ servers can improve the cluster migration capability without modifying the code, which is very convenient.

[0144] In this embodiment of the invention, the access layer and logic layer are deployed separately, allowing for independent scaling based on bottlenecks encountered during email migration, thus saving resources. For example, when the access layer's single-time scheduling speed is too slow, the access layer can be expanded to enhance its scheduling capabilities.

[0145] 204. Obtain the target email data to be migrated through the target server based on the email migration task.

[0146] Specifically, email data can include, but is not limited to, the email body, sender, attachments, and signature content of each user's emails. Target email data refers to the data within the email data that corresponds to the currently executed email migration task.

[0147] Email data can be stored in a data source. The data source includes email data that can be migrated. It is understandable that, as... Figure 5 As shown, the data source and the information storage layer can be two different modules. For example, the data source can actually be a database that provides data support for the regular use of the email service, such as email deletion and sending / receiving, while the information storage layer can be a database that provides data support for the email migration process.

[0148] In some optional embodiments, to facilitate quick identification of the cause and location of problems when email migration encounters issues, migration record information generated during the email migration process can be included. That is, the email migration method provided in this embodiment of the invention may further include:

[0149] Retrieve migration record information generated during email migration of target email data;

[0150] The migration record information is stored in the information storage layer of the email migration system.

[0151] In practical applications, the information storage layer can set an expiration time for the stored migration record information. When some migration record information becomes invalid, it can be deleted to save storage resources. Alternatively, if storage resources are sufficient, invalid migration record information may not be deleted; this embodiment of the invention does not limit this approach.

[0152] 205. Based on the target server, perform email migration on the target email data.

[0153] In this embodiment of the invention, the logic layer can manage several worker nodes that execute email migration tasks, and schedule server resources to provide resources for the workers to process email migration tasks. The workers can migrate data according to the email migration tasks.

[0154] In actual email migration processes, different email migration types exist, and different email migration types require different migration procedures. Therefore, an email migration task can include the target email migration type in the email migration process, and the step "migrate the target email data based on the target server" can specifically include:

[0155] Based on parsing the email migration task on the target server, the target email migration type corresponding to the email migration task is obtained;

[0156] Determine the target migration procedure corresponding to the target email migration type;

[0157] Based on the target migration procedure, the target email data is migrated.

[0158] For example, in the logical layer message queue, the scheduling task is handed over to the Worker for processing. The Worker determines the migration type used by the user based on the target email migration type corresponding to the email migration task, identifies the corresponding migration program as the target migration program, and starts migrating data.

[0159] Specifically, email migration types can be email transmission types corresponding to different email transmission protocols. For example, email migration types can include, but are not limited to, Simple Mail Transfer Protocol (SMTP), Post Office Protocol (POP), and Internet Message Access Protocol (IMAP).

[0160] The target email migration type refers to the email transmission type used when migrating target email data.

[0161] It is understandable that some functions in the email migration process can be implemented using common code, such as login, retrieving folder lists, and downloading emails with specific IDs. When determining the target migration program, these functions can be implemented by directly calling the code for these common functions. Additionally, non-common code related to the email migration type should be determined based on the email migration type. In other words, the step "Determine the target migration program corresponding to the target email migration type" specifically includes:

[0162] Based on the target email migration type, determine the target migration function corresponding to the target email migration type from at least one preset migration function corresponding to the target email migration type;

[0163] Based on the target migration function, generate the target migration program corresponding to the target email migration type.

[0164] The target migration function can be function code that is not applicable to data of each email migration type, and corresponds to the target email migration type.

[0165] Understandably, a target transfer function can include both generic and non-generic code; in this case, the target transfer function can be used as the target transfer procedure. Alternatively, the target transfer function can only include non-generic code, and when generating the target transfer procedure, the target transfer function and generic code can be combined.

[0166] like Figure 6 As shown, the base class Migration of the migration module defines general functions for email migration, such as login, getting a folder list, and downloading emails with a specified ID. The specific implementation is carried out by the subclasses that inherit from it, which implement the corresponding functions according to the requirements of different protocols.

[0167] The `MigrationFactory` class implements methods for creating migration modules of all types. To use it, simply pass in the corresponding protocol type to create the appropriate migration module. When you need to extend the class to adapt to new protocols, simply implement a new subclass and add the corresponding creation method to the class to complete the extension.

[0168] In practical applications, users may have other functional requirements besides email migration, such as sending notification messages before or after email migration. To reduce code modification costs and code invasiveness, this embodiment of the invention separates the functions other than email migration from the migration program that performs the email migration function, thus meeting the customized needs of different users. Before the step "Generating the target migration program corresponding to the target email migration type based on the target migration function", the email migration method provided in this embodiment of the invention may further include:

[0169] Obtain the extended functionality code, which is used to implement extended functions during the email migration process.

[0170] Specifically, extended functionality could include pushing notification messages to the clients of users performing email migrations at the start of the migration, or sending reminder emails to users after the migration is complete, and so on. The code for different extended functionality can be different based on the functional design.

[0171] Correspondingly, the step "Generate the target migration program corresponding to the target email migration type based on the target migration function" includes:

[0172] Based on the target migration function and extended function code, generate the target migration program for the email migration process;

[0173] At this point, the step "Migrate the target email data based on the target migration procedure" includes:

[0174] Execute extended functionality code in the target migration procedure;

[0175] The target email data is migrated based on the target migration function in the target migration procedure.

[0176] It should be noted that there is no specific order between executing the extended function code in the target migration procedure and migrating the target email data based on the target migration function in the target migration procedure.

[0177] like Figure 7 As shown, the extended functionality code can be executed either before (Before auth) or after (After auth) the target migration function (Do imap.Auth()). The specific execution time can be configured according to the user's actual needs.

[0178] For example, if an enterprise CorpA requires sending an email notification when a user starts an IMAP migration task, the functionality of the target migration function corresponding to the IMAP type itself is not changed; only the new email notification logic needs to be inserted after the authentication verification.

[0179] For example, to avoid modifying the target migration function code corresponding to the generic IMAP type, the system uses the decorator pattern, such as... Figure 6 As shown, CorpA inherits from the base class Migration and serves as the target migration function for the IMAP type. In the CorpADecorator class, the target migration function for the IMAP type is initialized as a member variable. Figure 7When implementing the base class migration interface, the actual implementation in IMAP is used, but code can be inserted before and / or after its execution.

[0180] In some optional embodiments, the target migration procedure may also be pre-configured; that is, the step "determine the target migration procedure corresponding to the target email migration type" includes:

[0181] Based on the target email migration type corresponding to the email migration task, determine the target migration program corresponding to the target email migration type from at least one preset migration program corresponding to the target email migration type.

[0182] The email migration method according to embodiments of the present invention, such as Figure 14 As shown, during the business evolution, with the increasing call volume, the logic layer service was expanded to support the email migration needs.

[0183] like Figure 15 As shown, MQ36 experienced a failure and crashed between 17:24 and 17:35 on a certain day, failing to process migration requests normally. Figure 16 As shown, the overall cluster service was not affected, and the tasks of mq36 were distributed to other machines to achieve high availability.

[0184] As can be seen from the above, the embodiments of the present invention can obtain email migration requests through the access layer of the email migration system, generate email migration tasks based on the email migration requests, select the target queue for writing email migration tasks from the task execution queue controlled by the logic layer through the logic layer, and write the email migration tasks into the target queue. Each task in a task execution queue is executed by a server. The target server corresponding to the target queue in the distributed deployment is determined. The email migration tasks to be processed are read from the target queue through the target server. Based on the email migration tasks, the target email data to be migrated is obtained through the target server. The target email data is then migrated based on the target server. Since the embodiments of the present invention design an email migration system including an access layer and a logic layer, and the servers corresponding to each task execution queue in the logic layer are distributed, the email migration service is decomposed, reducing the coupling of the email migration process. The queues for email migration can be expanded at any time, enhancing email migration processing capabilities and improving email migration efficiency.

[0185] Based on the methods described in the preceding embodiments, the following examples will provide further detailed explanations.

[0186] In this embodiment, the combination Figure 1 The system will be explained.

[0187] like Figure 8As shown, the email migration method in this embodiment can be described in the following specific steps:

[0188] 801. The server-side device obtains the email migration request through the access layer of the email migration system. Based on the email migration request, it generates at least two email migration tasks. The email migration tasks include the task issuance time and the target email migration type of the email migration process.

[0189] Different email migration tasks require different email data to be migrated.

[0190] like Figure 9 As shown, access layer module A executes scheduled tasks periodically according to configuration parameters. Due to cluster deployment, multiple servers are running simultaneously, but it is expected that only one server can be scheduled. Therefore, it is necessary to acquire a distributed lock first. Here, optimistic locking can be easily implemented using a storage layer database.

[0191] Distributed locks ensure that when multiple threads are running concurrently, only one thread operates on the business logic, method, or variable at any given moment.

[0192] Once the access layer server acquires the distributed lock, it starts running the scheduler, retrieves the user information to be migrated from the storage layer database, including usernames and passwords, request server IP addresses and ports, migration types, etc., and generates an email migration task. The migration task is then sent to the logic layer message queue.

[0193] 802. Based on the task issuance time of each email migration task, the server-side device determines whether each email migration task meets the task issuance conditions. Through the access layer, the email migration tasks that meet the task issuance conditions are issued to the logical layer of the email migration system.

[0194] In some optional examples, the task dispatch conditions can be empty, meaning that after the access layer server generates the email migration task, it can directly send the email migration task to the logic layer, and the logic layer can determine the specific execution time of the email migration task, etc.

[0195] 803. The server-side device selects the target queue for writing email migration tasks from the task execution queue controlled by the logic layer of the email migration system, and writes the email migration tasks into the target queue.

[0196] 804. The server-side device determines the target server corresponding to the target queue in the distributed deployment server through the logic layer, and reads the email migration task that needs to be processed from the target queue through the target server.

[0197] like Figure 10As shown, when a task needs to be executed in the logical layer message queue, an executor, i.e., a worker, can be created. The email migration task is then handed over to a worker for processing. Key node logs and failure logs during the migration process can be written to the storage layer in real time. The migrated folders and emails are stored in the target email system.

[0198] In this context, "email system" generally refers to an email service provider system that supports email storage and retrieval.

[0199] 805. The server-side device parses the email migration task based on the target server to obtain the target email migration type corresponding to the email migration task.

[0200] The Worker can determine the target email migration type used by the user based on the task information in the email migration task, create the corresponding migration module through the protocol factory, and start migrating data.

[0201] 806. The server-side device, based on the target server, determines the target migration function corresponding to the target email migration type from at least one preset migration function corresponding to the target email migration type.

[0202] The base class `Migration` in the migration module defines general functions for email migration, such as logging in, retrieving a folder list, and downloading emails with a specified ID. The specific implementations are provided by the subclasses that inherit from it, based on the requirements of different protocols.

[0203] The MigrationFactory class implements methods for creating migration modules of all types. To use it, simply pass in the corresponding protocol type to create the appropriate migration module. When you need to extend the class to adapt to new protocols, simply implement a new subclass and add the corresponding creation method to the factory class to complete the extension.

[0204] Using modular code design can reduce the development costs of customization requirements and protocol extensions.

[0205] 807. The server-side device obtains the extended function code from the target server in the logic layer, and generates the target migration program for the email migration process based on the target migration function and the extended function code.

[0206] The extended functionality code is used to implement extended functions during the email migration process.

[0207] Using modular code design can reduce the development cost of customized requirements. By using the factory pattern to uniformly manage the adaptation of all protocols and using the decorator pattern to insert customized requirements for enterprises, modification costs and code invasiveness can be greatly reduced.

[0208] 808. The server-side device executes the extended function code in the target migration procedure based on the target server in the logical layer, and migrates the target email data based on the target migration function in the target migration procedure.

[0209] In this embodiment of the invention, by splitting services and deploying them independently, the coupling between modules is reduced, and horizontal scaling can be carried out at any time when stronger processing power is needed; the single service cluster is decentralized, and the failure of a small number of machines will not affect the normal migration process.

[0210] In typical application scenarios such as enterprise-oriented email migration services, this invention can be used to build a highly flexible email migration system, ensuring stable migration services. Modular code design reduces the development costs for customized requirements and protocol extensions. Using microservice design principles decouples services, deploying them in functional clusters, facilitating service expansion, improving processing capacity, and resolving service availability issues associated with single-machine services.

[0211] As can be seen from the above, the embodiments of the present invention can obtain email migration requests through the access layer of the email migration system, generate email migration tasks based on the email migration requests, select the target queue for writing email migration tasks from the task execution queue controlled by the logic layer through the logic layer, and write the email migration tasks into the target queue. Each task in a task execution queue is executed by a server. The target server corresponding to the target queue in the distributed deployment is determined. The email migration tasks to be processed are read from the target queue through the target server. Based on the email migration tasks, the target email data to be migrated is obtained through the target server. The target email data is then migrated based on the target server. Since the embodiments of the present invention design an email migration system including an access layer and a logic layer, and the servers corresponding to each task execution queue in the logic layer are distributed, the email migration service is decomposed, reducing the coupling of the email migration process. The queues for email migration can be expanded at any time, enhancing email migration processing capabilities and improving email migration efficiency.

[0212] To better implement the above methods, this embodiment of the invention also provides an email migration device.

[0213] refer to Figure 11 The device may include:

[0214] The task generation unit 1101 can be used to obtain email migration requests through the access layer of the email migration system and generate email migration tasks based on the email migration requests.

[0215] The task writing unit 1102 can be used to select the target queue for writing email migration tasks from the task execution queue controlled by the logical layer of the email migration system, and write the email migration tasks into the target queue. In this case, a task in a task execution queue is executed by a server.

[0216] The task reading unit 1103 can be used to determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server;

[0217] The data acquisition unit 1104 can be used to acquire the target email data to be migrated based on the email migration task through the target server;

[0218] The email migration unit 1105 can be used to migrate email data to a target server.

[0219] In some alternative embodiments, such as Figure 12 As shown, the email migration request may include the target migration time. The email migration device provided in this embodiment of the invention may also include a queue expansion unit 1106, which can be used to predict the actual migration time of the email migration process based on the target email data and the target queue.

[0220] If the actual migration time is longer than the target migration time, a new target queue and the new server corresponding to the new target queue are determined so that the new actual migration time predicted based on the new target queue is not greater than the target migration time.

[0221] Email migration unit 1105 can be used to migrate target email data based on the target server and the newly added server.

[0222] In some optional embodiments, the email migration apparatus provided in this embodiment of the invention may further include a task rewriting unit 1107, which can be used to detect the migration result of the target server performing email migration on the target email data.

[0223] When the migration result is migration failure, determine the email migration task corresponding to the target email data that failed to migrate;

[0224] Perform the step of writing the email migration task to the target queue.

[0225] In some optional embodiments, the email migration apparatus provided in this embodiment of the invention may further include a task redistribution unit 1108, which can be used to select a task execution queue other than the target queue from the task execution queue controlled by the logic layer as a new target queue for writing the email migration task when writing the email migration task into the target queue fails.

[0226] Perform the step of writing the email migration task to the target queue.

[0227] In some optional embodiments, the email migration request may include migration instruction information, which can be used to indicate migration association information corresponding to the target email data;

[0228] The task generation unit can be used to obtain migration association information indicated by migration instruction information from the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system.

[0229] Generate an email migration task based on the migration association information.

[0230] In some optional embodiments, the task generation unit 1101 can be used to send a permission acquisition request to the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system, and trigger the information storage layer to generate a permission granting instruction based on the permission acquisition request.

[0231] Obtain the permission granting instruction, and based on the permission granting instruction, retrieve the migration instruction information and migration association information indicated by the migration instruction from the information storage layer.

[0232] In some optional embodiments, the email migration task may include the target email migration type of the email migration process;

[0233] The email migration unit 1105 can be used to parse the email migration task based on the target server and obtain the target email migration type corresponding to the email migration task.

[0234] Determine the target migration procedure corresponding to the target email migration type;

[0235] Based on the target migration procedure, the target email data is migrated.

[0236] In some optional embodiments, the email migration unit 1105 can be used to determine the target migration function corresponding to the target email migration type from at least one preset migration function corresponding to the target email migration type.

[0237] Based on the target migration function, generate the target migration program corresponding to the target email migration type.

[0238] In some optional embodiments, the email migration apparatus provided in this embodiment of the invention may further include an extension code acquisition unit 1109, which can be used to acquire extension function code, and the extension function code can be used to implement extension functions in the email migration process.

[0239] The email migration unit 1105 can be used to generate the target migration program for the email migration process based on the target migration function and extended function code.

[0240] Execute extended functionality code in the target migration procedure;

[0241] The target email data is migrated based on the target migration function in the target migration procedure.

[0242] In some optional embodiments, the email migration unit 1105 can be used to determine the target migration program corresponding to the target email migration type from a preset migration program corresponding to at least one email migration type, based on the target email migration type corresponding to the email migration task.

[0243] In some optional embodiments, the email migration apparatus provided in this embodiment of the invention may further include a migration information storage unit 1110, which can be used to obtain migration record information generated when migrating target email data.

[0244] The migration record information is stored in the information storage layer of the email migration system.

[0245] In some optional embodiments, the task generation unit 1101 can be used to obtain email migration requests through the access layer of the email migration system, and generate at least two email migration tasks based on the email migration requests. The email migration tasks may include task issuance time, and the email data to be migrated corresponding to different email migration tasks are different.

[0246] The email migration device provided in this embodiment of the invention may further include a task timed distribution unit 1111, which can be used to determine whether each email migration task meets the task distribution conditions based on the task distribution time of each email migration task.

[0247] Through the access layer, email migration tasks that meet the task distribution conditions are distributed to the logic layer of the email migration system.

[0248] As can be seen from the above, through the email migration device, email migration requests can be obtained through the access layer of the email migration system. Based on the email migration requests, email migration tasks are generated. Through the logic layer of the email migration system, the target queue for writing email migration tasks is selected from the task execution queue controlled by the logic layer, and the email migration tasks are written into the target queue. Here, tasks in one task execution queue are executed by one server. The target server corresponding to the target queue in the distributed deployment server is determined. Through the target server, the email migration tasks that need to be processed are read from the target queue. Through the target server, the target email data to be migrated is obtained based on the email migration tasks. Based on the target server, the target email data is migrated. Since the email migration system including the access layer and the logic layer is designed in this embodiment of the invention, and the servers corresponding to each task execution queue in the logic layer are distributed, the email migration service is decomposed, the coupling of the email migration process is reduced, the queue for email migration can be expanded at any time, the email migration processing capacity is enhanced, and the email migration efficiency is improved.

[0249] Furthermore, embodiments of the present invention also provide an electronic device, which may be a terminal or a server, etc. Figure 13 As shown, it illustrates a structural schematic diagram of the electronic device involved in an embodiment of the present invention, specifically:

[0250] The electronic device may include a radio frequency (RF) circuit 1301, a memory 1302 including one or more computer-readable storage media, an input unit 1303, a display unit 1304, a sensor 1305, an audio circuit 1306, a wireless fidelity (WiFi) module 1307, a processor 1308 including one or more processing cores, and a power supply 1309, etc. Those skilled in the art will understand that... Figure 13 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0251] RF circuit 1301 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 1308 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 1301 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 1301 can also communicate wirelessly with networks and other devices. Wireless communication can use any communication standard or protocol, including but not limited to GSM, GPRS, CDMA, WCDMA, LTE, email, and SMS.

[0252] The memory 1302 can be used to store software programs and modules. The processor 1308 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302. The memory 1302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device (such as audio data, telephone directory, etc.). In addition, the memory 1302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1302 may also include a memory controller to provide access to the memory 1302 for the processor 1308 and the input unit 1303.

[0253] The input unit 1303 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, in one embodiment, the input unit 1303 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display or touchpad, can collect user touch operations on or near it (e.g., user operations using fingers, styluses, or any suitable object or accessory on or near the touch-sensitive surface), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, transmitting the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 1308, and can receive and execute commands from the processor 1308. Furthermore, various types of touch-sensitive surfaces, such as resistive, capacitive, infrared, and surface acoustic wave, can be used. In addition to the touch-sensitive surface, the input unit 1303 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0254] Display unit 1304 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of electronic devices. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Display unit 1304 may include a display panel, optionally configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar form. Furthermore, a touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to processor 1308 to determine the type of touch event. Subsequently, processor 1308 provides corresponding visual output on the display panel according to the type of touch event. Although in Figure 13 In this context, the touch-sensitive surface and the display panel are two separate components for implementing input and output functions. However, in some embodiments, the touch-sensitive surface and the display panel can be integrated to achieve both input and output functions.

[0255] The electronic device may also include at least one sensor 1305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel according to the ambient light level, and the proximity sensor can turn off the display panel and / or backlight when the electronic device is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the electronic device, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0256] Audio circuitry 1306, a speaker, and a microphone provide an audio interface between the user and the electronic device. Audio circuitry 1306 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 1306, converted back into audio data, and processed by processor 1308. The audio data is then transmitted via RF circuitry 1301 to, for example, another electronic device, or output to memory 1302 for further processing. Audio circuitry 1306 may also include an earphone jack to facilitate communication between external headphones and the electronic device.

[0257] WiFi is a short-range wireless transmission technology. Electronic devices using the WiFi module 1307 can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 13 WiFi module 1307 is shown, but it is understood that it is not a necessary component of an electronic device and can be omitted as needed without changing the nature of the invention.

[0258] The processor 1308 is the control center of the electronic device, connecting various parts of the phone via various interfaces and lines. It executes software programs and / or modules stored in the memory 1302, and calls data stored in the memory 1302 to perform various functions and process data. Optionally, the processor 1308 may include one or more processing cores; preferably, the processor 1308 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1308.

[0259] The electronic device also includes a power supply 1309 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1308 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1309 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0260] Although not shown, the electronic device may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1308 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 1302 according to the following instructions, and the processor 1308 runs the applications stored in the memory 1302 to realize various functions, as follows:

[0261] The email migration system obtains email migration requests through its access layer and generates email migration tasks based on these requests.

[0262] Through the logic layer of the email migration system, the target queue for writing email migration tasks is selected from the task execution queue controlled by the logic layer, and the email migration tasks are written into the target queue. Among them, the tasks in one task execution queue are executed by one server.

[0263] Determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server;

[0264] Based on the email migration task, obtain the target email data that needs to be migrated from the target server.

[0265] Based on the target server, perform email migration on the target email data.

[0266] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0267] To this end, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the email migration methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:

[0268] The email migration system obtains email migration requests through its access layer and generates email migration tasks based on these requests.

[0269] Through the logic layer of the email migration system, the target queue for writing email migration tasks is selected from the task execution queue controlled by the logic layer, and the email migration tasks are written into the target queue. Among them, the tasks in one task execution queue are executed by one server.

[0270] Determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server;

[0271] Based on the email migration task, obtain the target email data that needs to be migrated from the target server.

[0272] Based on the target server, perform email migration on the target email data.

[0273] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0274] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0275] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the email migration methods provided in the embodiments of the present invention, the beneficial effects that any of the email migration methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0276] According to one aspect of this application, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.

[0277] The email migration method, apparatus, electronic device, storage medium, and program product provided in the embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An email migration method, characterized in that, Applied to email migration systems, including: The email migration system obtains email migration requests through its access layer and generates email migration tasks based on these requests; the email migration requests include the target migration duration. Through the logic layer of the email migration system, a target queue for writing the email migration task is selected from the task execution queue controlled by the logic layer, and the email migration task is written into the target queue. Determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server; Based on the email migration task, the target email data to be migrated is obtained through the target server. Based on the target email data and the target queue, predict the actual migration time of the email migration process; If the actual migration time is greater than the target migration time, a new target queue and a new server corresponding to the new target queue are determined so that the new actual migration time predicted based on the new target queue is not greater than the target migration time. Based on the target server, the email migration of the target email data includes: based on the target server and the newly added server, the email migration of the target email data.

2. The email migration method according to claim 1, characterized in that, The method further includes: Detect the migration results of the target server in migrating the target email data; When the migration result is a migration failure, the email migration task corresponding to the target email data that failed to migrate is determined; Perform the step of writing the email migration task into the target queue.

3. The email migration method according to claim 2, characterized in that, The method further includes: When writing the email migration task to the target queue fails, a task execution queue other than the target queue is selected from the task execution queue controlled by the logic layer as a new target queue for writing the email migration task. Perform the step of writing the email migration task into the target queue.

4. The email migration method according to claim 1, characterized in that, The email migration request includes migration instruction information, which is used to indicate the migration association information corresponding to the target email data; The process of generating an email migration task based on the email migration request through the access layer of the email migration system includes: Based on the email migration request, the access layer of the email migration system obtains the migration association information indicated by the migration instruction information from the information storage layer of the email migration system. Based on the migration association information, an email migration task is generated.

5. The email migration method according to claim 4, characterized in that, The process of obtaining migration association information indicated by the migration instruction information from the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system includes: The access layer of the email migration system sends a permission acquisition request to the information storage layer of the email migration system based on the email migration request, triggering the information storage layer to generate a permission granting instruction based on the permission acquisition request. Obtain the permission granting instruction, and according to the permission granting instruction, obtain the migration association information indicated by the migration instruction information from the information storage layer.

6. The email migration method according to claim 1, characterized in that, The email migration task includes the target email migration type in the email migration process; The process of migrating the target email data based on the target server includes: Based on the parsing of the email migration task by the target server, the target email migration type corresponding to the email migration task is obtained; Determine the target migration procedure corresponding to the target email migration type; Based on the target migration procedure, the target email data is migrated.

7. The email migration method according to claim 6, characterized in that, The step of determining the target migration procedure corresponding to the target email migration type includes: Based on the target email migration type, determine the target migration function corresponding to the target email migration type from at least one preset migration function corresponding to the target email migration type; Based on the target migration function, a target migration program corresponding to the target email migration type is generated.

8. The email migration method according to claim 7, characterized in that, Before generating the target migration program corresponding to the target email migration type based on the target migration function, the method further includes: Obtain the extended functionality code, which is used to implement extended functions during the email migration process; The step of generating the target migration program corresponding to the target email migration type based on the target migration function includes: Based on the target migration function and the extended function code, generate the target migration program for the email migration process; The migration of the target email data based on the target migration procedure includes: Execute the extended functionality code in the target migration procedure; The target email data is migrated based on the target migration function in the target migration procedure.

9. The email migration method according to claim 6, characterized in that, The step of determining the target migration procedure corresponding to the target email migration type includes: Based on the target email migration type corresponding to the email migration task, a target migration program corresponding to the target email migration type is determined from at least one preset migration program corresponding to the target email migration type.

10. The email migration method according to claim 1, characterized in that, The method further includes: Obtain migration record information generated during email migration of the target email data; The migration record information is stored in the information storage layer of the email migration system.

11. The email migration method according to claim 1, characterized in that, The step of obtaining email migration requests through the access layer of the email migration system and generating email migration tasks based on the email migration requests includes: The email migration system obtains email migration requests through its access layer and generates at least two email migration tasks based on these requests. Each email migration task includes a task issuance time, and the email data to be migrated varies for each task. Before selecting the target queue for writing the email migration task from the task execution queue controlled by the logic layer of the email migration system, the method further includes: Based on the task release time of each email migration task, determine whether each email migration task meets the task release conditions; The access layer distributes email migration tasks that meet the task distribution conditions to the logic layer of the email migration system.

12. A mail migration device, characterized in that, include: The task generation unit is used to obtain email migration requests through the access layer of the email migration system and generate email migration tasks based on the email migration requests. The email migration request includes the target migration duration; The task writing unit is used to select a target queue for writing the email migration task from the task execution queue controlled by the logic layer of the email migration system, and write the email migration task into the target queue. The task reading unit is used to determine the target server corresponding to the target queue in the distributed deployment server, and read the email migration task that needs to be processed from the target queue through the target server; The data acquisition unit is used to acquire the target email data to be migrated based on the email migration task through the target server. A queue expansion unit is used to predict the actual migration time of the email migration process based on the target email data and the target queue. If the actual migration time is greater than the target migration time, a new target queue and a new server corresponding to the new target queue are determined so that the new actual migration time predicted based on the new target queue is not greater than the target migration time. The email migration unit is used to migrate the target email data based on the target server, including: migrating the target email data based on the target server and the newly added server.

13. The email migration device according to claim 12, characterized in that, The email migration device further includes a task rewriting unit, used to detect the migration result of the target server in migrating the target email data; When the migration result is a migration failure, the email migration task corresponding to the target email data that failed to migrate is determined; Perform the step of writing the email migration task into the target queue.

14. The email migration device according to claim 13, characterized in that, The email migration device also includes a task redistribution unit, which, when writing the email migration task to the target queue fails, selects a task execution queue other than the target queue from the task execution queue controlled by the logic layer as a new target queue for writing the email migration task. Perform the step of writing the email migration task into the target queue.

15. The email migration device according to claim 12, characterized in that, The email migration request includes migration instruction information, which is used to indicate the migration association information corresponding to the target email data; The task generation unit is used to obtain migration association information indicated by the migration instruction information from the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system; Based on the migration association information, an email migration task is generated.

16. The email migration device according to claim 15, characterized in that, The task generation unit is used to send a permission acquisition request to the information storage layer of the email migration system based on the email migration request through the access layer of the email migration system, and trigger the information storage layer to generate a permission granting instruction based on the permission acquisition request. Obtain the permission granting instruction, and according to the permission granting instruction, obtain the migration association information indicated by the migration instruction information from the information storage layer.

17. The email migration device according to claim 12, characterized in that, The email migration task includes the target email migration type in the email migration process; The email migration unit is used to parse the email migration task based on the target server to obtain the target email migration type corresponding to the email migration task. Determine the target migration procedure corresponding to the target email migration type; Based on the target migration procedure, the target email data is migrated.

18. The email migration device according to claim 17, characterized in that, The email migration unit is configured to determine the target migration function corresponding to the target email migration type from a set of at least one preset email migration type migration functions, based on the target email migration type. Based on the target migration function, a target migration program corresponding to the target email migration type is generated.

19. The email migration device according to claim 18, characterized in that, The email migration device also includes an extension code acquisition unit for acquiring extension function codes, which are used to implement extension functions during the email migration process. The email migration unit is used to generate a target migration program for the email migration process based on the target migration function and the extended function code. Execute the extended functionality code in the target migration procedure; The target email data is migrated based on the target migration function in the target migration procedure.

20. The email migration device according to claim 17, characterized in that, The email migration unit is configured to determine the target migration program corresponding to the target email migration type from a preset set of migration programs corresponding to at least one email migration type, based on the target email migration type corresponding to the email migration task.

21. The email migration device according to claim 12, characterized in that, The email migration device also includes a migration information storage unit, used to acquire migration record information generated when migrating the target email data; The migration record information is stored in the information storage layer of the email migration system.

22. The email migration device according to claim 12, characterized in that, The task generation unit is used to obtain email migration requests through the access layer of the email migration system, and generate at least two email migration tasks based on the email migration requests. The email migration tasks include the task issuance time, and the email data to be migrated is different for different email migration tasks. The email migration device also includes a task timed distribution unit, which is used to determine whether each email migration task meets the task distribution conditions based on the task distribution time of each email migration task. The access layer distributes email migration tasks that meet the task distribution conditions to the logic layer of the email migration system.

23. An electronic device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor is used to run the application program within the memory to perform the steps of the email migration method according to any one of claims 1 to 11.

24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the mail migration method according to any one of claims 1 to 11.

25. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the mail migration method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Migrating objects from a source service to a target service

    US20170046199A1