CN117097694A - Mail migration method, mail migration device, electronic equipment, storage medium and program product - Google Patents

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

Info

Publication number
CN117097694A
CN117097694A CN202210523153.9A CN202210523153A CN117097694A CN 117097694 A CN117097694 A CN 117097694A CN 202210523153 A CN202210523153 A CN 202210523153A CN 117097694 A CN117097694 A CN 117097694A
Authority
CN
China
Prior art keywords
migration
mail
target
task
mail migration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210523153.9A
Other languages
Chinese (zh)
Inventor
王政博
黄亮
文琛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210523153.9A priority Critical patent/CN117097694A/en
Publication of CN117097694A publication Critical patent/CN117097694A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/18Commands or executable codes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a mail migration method, a mail migration device, electronic equipment, a storage medium and a program product; the mail migration method comprises the steps that a mail migration request can be obtained 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 task execution queues 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 server in distributed deployment is determined, the mail migration task needing to be processed currently is read from the target queue through the target server, target mail data needing to be migrated are obtained based on the mail migration task through the target server, and mail migration is carried out on the target mail data based on the target server; splitting the mail migration service is realized, the coupling of the mail migration flow is reduced, the mail migration processing capacity is enhanced, and the mail migration efficiency is improved.

Description

Mail migration method, mail migration device, electronic equipment, storage medium and program product
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a mail migration method, an apparatus, an electronic device, a storage medium, and a program product.
Background
With the current rapid development of economy and technology, electronic mailboxes have become increasingly popular for use in people's lives. In the practical application process, in order to facilitate management of mails in an email box, etc., it is often required to migrate mails of a certain user or users.
At present, the main method adopted in the mail migration is to run a mail migration program in a stand-alone server, and obtain mailbox account information required to be migrated from a database for migration. However, with this scheme, the execution of the single machine is limited by the processing capability of the single machine, so that when more mails need to be migrated, the migration is time-consuming and the mail migration efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a mail migration method, a device, electronic equipment, a storage medium and a program product, which can split mail migration service, reduce the coupling of mail migration flow, expand a distributed mail migration system at any time, enhance mail migration processing capacity and improve mail migration efficiency.
The embodiment of the invention provides a mail migration method, which comprises the following steps:
acquiring a mail migration request through an access layer of the mail migration system, and generating a mail migration task based on the mail migration request;
Selecting a target queue for writing the mail migration task from a task execution queue controlled by the logic layer through the logic layer of the mail migration system, and writing the mail migration task into the target queue;
determining a target server corresponding to the target queue in the distributed deployed servers, and reading a mail migration task which needs to be processed currently from the target queue through the target server;
acquiring target mail data to be migrated based on the mail migration task;
and E, through the target server, performing mail migration on the target mail data based on the target server.
Correspondingly, the embodiment of the invention also provides a mail migration device, which comprises:
the task generating unit is used for acquiring a mail migration request through an access layer of the mail migration system and generating a mail migration task based on the mail migration request;
a task writing unit, configured to select, through a logic layer of the mail migration system, a target queue for writing the mail migration task from task execution queues controlled by the logic layer, and write the mail migration task into the target queue;
The task reading unit is used for determining a target server corresponding to the target queue in the distributed deployment servers, and reading the mail migration task which needs to be processed currently from the target queue through the target server;
the data acquisition unit is used for acquiring target mail data to be migrated based on the mail migration task through the target server;
and the mail migration unit is used for carrying out mail migration on the target mail data based on the target server.
Optionally, the mail migration request includes a target migration duration, and the mail migration device provided in the embodiment of the present invention further includes a queue extension unit, configured to predict an actual migration duration of a mail migration process according to the target mail data and the target queue;
if the actual migration time length is longer than the target migration time length, determining a new target queue and a new server corresponding to the new target queue, so that the new actual migration time length predicted based on the new target queue is not longer than the target migration time length;
the mail migration unit is used for carrying out mail migration on the target mail data based on the target server and the newly added server.
Optionally, the mail migration device provided by the embodiment of the present invention further includes a task rewriting unit, configured to detect a migration result of the target server for performing mail migration on the target mail data;
when the migration result is migration failure, determining the mail migration task corresponding to the target mail data with migration failure;
and executing the step of writing the mail migration task into the target queue.
Optionally, the mail migration device provided by the embodiment of the present invention further includes a task reissuing unit, configured to select, when writing the mail migration task into the target queue fails, a task execution queue other than the target queue from task execution queues controlled by the logic layer, as a new target queue into which the mail migration task is written;
and executing the step of writing the mail migration task into the target queue.
Optionally, the mail migration request includes migration indication information, where the migration indication information is used to indicate migration associated information corresponding to the target mail data;
the task generating unit is used for acquiring migration associated information indicated by the migration indication information from an information storage layer of the mail migration system based on the mail migration request through an access layer of the mail migration system;
And generating mail migration tasks according to the migration associated information.
Optionally, the task generating unit is configured to send, through an access layer of the mail migration system, a permission acquisition request to an information storage layer of the mail migration system based on the mail migration request, and trigger the information storage layer to generate a permission issuing instruction based on the permission acquisition request;
and acquiring the authority issuing instruction, and acquiring migration associated information indicated by the migration indicating information from the information storage layer according to the authority issuing instruction.
Optionally, the mail migration task includes a target mail migration type of a mail migration process;
the mail migration unit is used for analyzing the mail migration task based on the target server to obtain a target mail migration type corresponding to the mail migration task;
determining a target migration program corresponding to the target mail migration type;
and migrating the target mail data based on the target migration program.
Optionally, the mail migration unit is configured to determine, according to the target mail migration type, a target migration function corresponding to the target mail migration type from migration functions corresponding to at least one preset mail migration type;
And generating a target migration program corresponding to the target mail migration type based on the target migration function.
Optionally, the mail migration device provided by the embodiment of the present invention further includes an extended code obtaining unit, configured to obtain an extended function code, where the extended function code is used to implement an extended function in a mail migration process;
the mail migration unit is used for generating a target migration program of the mail migration process according to the target migration function and the extension function code;
executing the extended function code in the target migration program;
and migrating the target mail data based on the target migration function in the target migration program.
Optionally, the mail migration unit is configured to determine, according to the target mail migration type corresponding to the mail migration task, a target migration program corresponding to the target mail migration type from migration programs corresponding to at least one preset mail migration type.
Optionally, the mail migration device provided by the embodiment of the present invention further includes a migration information storage unit, configured to obtain migration record information generated when performing mail migration on the target mail data;
And storing the migration record information to an information storage layer of the mail migration system.
Optionally, the task generating unit is configured to obtain a mail migration request through an access layer of the mail migration system, and generate at least two mail migration tasks based on the mail migration request, where the mail migration tasks include task issuing time, and mail data corresponding to different mail migration tasks and needing to be migrated are different;
the mail migration device provided by the embodiment of the invention further comprises a task timing issuing unit, a task issuing unit and a task processing unit, wherein the task timing issuing unit is used for judging whether each mail migration task meets the task issuing condition or not based on the task issuing time of each mail migration task;
and issuing mail migration tasks meeting the task issuing conditions to a logic layer of the mail migration system through the access layer.
Correspondingly, the embodiment of the invention also provides electronic equipment, which comprises a memory and a processor; the memory stores an application program, and the processor is configured to run the application program in the memory, so as to execute steps in any mail migration method provided by the embodiment of the present invention.
Correspondingly, the embodiment of the invention also provides a computer readable storage medium, which stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor to execute the steps in any mail migration method provided by the embodiment of the invention.
In addition, the embodiment of the invention also provides a computer program product, which comprises a computer program or instructions, wherein the computer program or instructions realize the steps in any mail migration method provided by the embodiment of the invention when being executed by a processor.
By adopting the scheme of the embodiment of the invention, the mail migration request can be acquired through the access layer of the mail migration system, the mail migration task is generated based on the mail migration request, the target queue for writing the mail migration task is selected from the task execution queue controlled by the logic layer through the logic layer of the mail migration system, the mail migration task is written into the target queue, the target server corresponding to the target queue in the distributed deployment server is determined, the mail migration task which needs to be processed currently is read from the target queue through the target server, the target mail data which needs to be migrated is acquired based on the mail migration task through the target server, and the mail migration is performed on the target mail data based on the target server; in the embodiment of the invention, the mail migration system comprising the access layer and the logic layer is designed, and the servers corresponding to the task execution queues in the logic layer are distributed, so that the splitting of mail migration service is realized, the coupling of mail migration flow is reduced, the queues for mail migration can be expanded at any time, the mail migration processing capacity is enhanced, and the mail migration efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of a scenario of a mail migration method provided by an embodiment of the present invention;
FIG. 2 is a flowchart of a mail migration method provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a downtime fault of a logical layer server according to an embodiment of the present invention;
FIG. 4 is a schematic capacity expansion diagram of a logical layer server according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a mail migration system according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a target migration program generation process according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an extended functionality provided by an embodiment of the present invention;
FIG. 8 is another schematic flow chart of a mail migration method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a mail migration process according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a logic layer scheduling process provided by an embodiment of the present invention;
Fig. 11 is a schematic structural diagram of a mail migration apparatus according to an embodiment of the present invention;
fig. 12 is another schematic structural diagram of a mail migration apparatus according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
FIG. 14 is a call volume change diagram for a server in the service evolution process provided by an embodiment of the present invention;
FIG. 15 is a call volume change diagram of a server before and after a server in a server cluster fails and is down, according to an embodiment of the present invention;
fig. 16 is a call volume change diagram of a server cluster before and after a server in the server cluster fails and is down according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
The embodiment of the invention provides a mail migration method, a mail migration device, electronic equipment and a computer readable storage medium. Specifically, the embodiment of the invention provides a mail migration method suitable for a mail migration device, and the mail migration device can be integrated in electronic equipment.
The electronic device may be a terminal or the like, including but not limited to a mobile terminal and a fixed terminal, for example, a mobile terminal including but not limited to a smart phone, a smart watch, a tablet computer, a notebook computer, a smart car, etc., wherein the fixed terminal includes but not limited to a desktop computer, a smart television, etc.
The electronic device may be a server, which may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server that provides 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 basic cloud computing services such as big data and artificial intelligence platform, but is not limited thereto.
The mail migration method of the embodiment of the invention can be realized by a server or a terminal and the server together.
The mail migration method is implemented by the terminal and the server together, and the method will be described below.
As shown in fig. 1, the mail migration system provided by the embodiment of the present invention may include a user side device 10, a service side device 20, and the like; the user-side device 10 and the service-side device 20 are connected to each other through a network, for example, a wired or wireless network connection.
The user side device 10 may include a plurality of terminals, and provide functions of mail display, mail sending and receiving for the user, so that the user can perform mail management operations such as sending and receiving, deleting, and the like of the mail.
The service-side device 20 may include several servers, and provides various business services for the user. For example, a storage server that stores mail contents, pictures corresponding to the mail contents, storage addresses of the pictures, authentication tokens, and the like may be used, for example, a mail server that transmits, manages, and the like mail.
In some examples, the user side device 10 may be a terminal for performing mail migration operations for a user, for sending a mail migration request to the service side device 20.
The service side device 20 may be configured to obtain a mail migration request through an access layer of the mail migration system, and generate a mail migration task based on the mail migration request; through a logic layer of the mail migration system, selecting a target queue for writing mail migration tasks from task execution queues controlled by the logic layer, and writing the mail migration tasks into the target queue, wherein the tasks in one task execution queue are executed by one server; determining a target server corresponding to a target queue in the distributed deployed servers, and reading a mail migration task which needs to be processed currently from the target queue through the target server; acquiring target mail data to be migrated based on a mail migration task through a target server; and E, based on the target server, performing mail migration on the target mail data.
It will be appreciated that in some embodiments, the steps of mail migration performed by the service-side device 20 may also be performed by the user-side device 10, which is not limited by the embodiment of the present invention.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The embodiments of the present invention will be described in terms of a mail migration apparatus, which may be integrated in a server and/or a terminal in particular.
As shown in fig. 2, the specific flow of the mail migration method in this embodiment may be as follows:
201. and acquiring a mail migration request through an access layer of the mail migration system, and generating a mail migration task based on the mail migration request.
The mail migration system may be an organic whole having a migration function for user mails. In some examples, the mail migration system may include at least an access layer and a logic layer that are in communication with each other and interact to collectively implement mail migration functionality.
It can be understood that the mail migration system in the embodiment of the invention can provide mail migration service for external enterprises for enterprise-level mailbox users and can also provide mail migration service for common individual users.
For example, the mail migration system may migrate mails of one or more employee accounts corresponding to a certain enterprise, or may migrate mails of a certain personal account belonging to a person. When the mail migration system performs mail migration, all mails in a certain account or some accounts can be migrated, or only part of the mails can be migrated, which is not limited by the embodiment of the invention.
The access layer is a module in the mail migration system, which has functions of supporting cluster deployment, remote procedure call (Remote Procedure Call, RPC) and the like. The access layer provides a functional interface which can be called by other modules, so that communication with the other modules can be realized.
In some embodiments, the access layer may include one or more servers to obtain mail migration requests, respond to mail migration requests, schedule mail migration tasks, and so forth.
Specifically, the mail migration request may be generated based on an operation of the user at the user-side device. For example, the user side device may generate a mail migration request in response to a triggering operation of the user on the mail migration control, and send the mail migration request to the mail migration system.
Alternatively, the mail migration request may be generated by the service-side device. For example, due to the limitation of the storage space, mail data of employees in the same enterprise may be stored in different storage areas, and in order to facilitate management of the mail data, the service side device may generate a mail migration request to migrate the mail data stored in the different storage areas into the same storage area.
In some examples, the mail migration request may be just an instruction that can trigger the mail migration system to perform mail migration, and no other information is included. The mail migration system may send an information acquisition request to the user side device or the service side device that generates the mail migration request in response to the mail migration request, so as to acquire information that may be used in the mail migration process.
In other examples, in order to improve mail migration efficiency, the mail migration request may include migration indication information, where the migration indication information may be used to indicate migration associated information corresponding to the target mail data, and the step of "generating, by an access layer of the mail migration system, a mail migration task based on the mail migration request" may specifically include:
Acquiring migration associated information indicated by migration indication information from an information storage layer of the mail migration system based on a mail migration request through an access layer of the mail migration system;
and generating mail migration tasks according to the migration associated information.
The information storage layer of the mail migration system can be a data storage module which supports cluster deployment and is high in availability in the mail migration system and can be used for storing information such as mailbox information of users, mail migration states of all users, migration logs and the like.
Specifically, the migration instruction information can indicate information that is required to be used when migrating the target mail data. For example, the migration indication information may be a user identification (such as a user ID, a mailbox account number and a mailbox account number of the user, etc.) of the user initiating the mail migration; alternatively, the migration indicating information may be a storage location of migration related information in the information storage layer, and so on.
Wherein the migration related information is all or part of information required in the process of acquiring the target mail data and/or migrating the target mail data. Specifically, the migration association information may include, but is not limited to, a mailbox account number and a mailbox account number password of the user, an IP port of a server storing the target mail data, a migration protocol type adopted in the process of migrating the target mail data, and the like.
In the embodiment of the invention, the mail migration task is an instruction set which can be issued to a logic layer of the mail migration system for execution. The mail migration task may include migration related information, or may include a specific mail migration instruction, a mail migration parameter, and the like.
It can be understood that in the embodiment of the present invention, mail migration may be implemented in a cluster deployment manner, and in a mail migration system, there may be a case where several servers are running simultaneously. If a plurality of servers request migration related information from the information storage layer at the same time, information transmission errors may occur between the servers and the information storage layer, so that the information storage layer can give permission to acquire information to the servers of the access layer. That is, the step of "obtaining, by the access layer of the mail migration system, migration association information indicated by the migration indication information from the information storage layer of the mail migration system based on the mail migration request" may specifically include:
sending a permission acquisition request to an information storage layer of the mail migration system through an access layer of the mail migration system based on the mail migration request, and triggering the information storage layer to generate a permission issuing instruction based on the permission acquisition request;
And acquiring a permission issuing instruction, and acquiring migration associated information indicated by the migration indicating information from the information storage layer according to the permission issuing instruction.
The permission acquisition request is a request sent by the access layer to the information storage layer, so that the information storage layer is requested to allow a certain server to acquire migration related information. The authority issuing instruction is a code for allowing a certain server to acquire migration related information from the information storage layer.
Specifically, when the access layer sends the permission acquisition requests, the servers deployed in the cluster in the access layer can actually send the respective permission acquisition requests to the information storage layer synchronously. And the information storage layer can generate a right issuing instruction corresponding to any server according to the right acquiring request of each server.
In this embodiment, the rights acquisition request of each server may include identification information of each server, and the information storage layer may generate the rights issuing instruction for a certain server according to the identification information of the server in the rights acquisition request.
Alternatively, in other embodiments, the access layer may send the rights acquisition request of the access layer to the information storage layer when sending the rights acquisition request, and the information storage layer may generate the rights issuing instruction for the access layer. After the access layer acquires the authority issuing instruction, a server can be determined from the servers to acquire migration instruction information from the information storage layer according to the authority issuing instruction.
Alternatively, in other embodiments, the access layer may schedule servers deployed in the cluster, and when sending the rights acquisition request, may send the rights acquisition request of a certain server to the information storage layer. The information storage layer may generate a rights issuing instruction corresponding to the server according to the rights acquisition request of the server.
Optionally, in order to ensure the security of the information in the information storage layer and avoid the malicious program from acquiring the migration related information, the authority issuing instruction generated by the information storage layer may include verification information for acquiring the migration related information from the information storage layer.
202. And selecting a target queue for writing the mail migration task from task execution queues controlled by the logic layer through the logic layer of the mail migration system, and writing the mail migration task into the target queue.
In an embodiment of the present invention, the logical layer of the mail migration system may be a message queue module (MQ module) that supports cluster deployment and high availability.
The task execution queue may be a message queue controlled by a logic layer. The task execution queue may transfer mail migration tasks to be executed to a server corresponding to the task execution queue for execution.
The target queue is a queue written with the current mail migration task in one or more task execution queues.
In the practical application process, when the target mail data is migrated, the migration failure may be caused by the reasons of single machine failure, network connection failure and the like of the server. In order to avoid that the migration failure of some target mail data affects the overall service of the mail migration system, the migration result can be detected, and when the migration failure result exists, the task is timely redistributed. That is, the mail migration method provided by the embodiment of the present invention may further include:
detecting a migration result of the target server for mail migration of the target mail data;
when the migration result is migration failure, determining a mail migration task corresponding to target mail data of the migration failure;
the step of writing the mail migration task into the target queue is performed.
For example, as shown in fig. 3, the server MQ4 in the logical layer is down due to a fault, and all the mail migration tasks in operation are broken, so that the migration result of the target server for performing mail migration on the target mail data can be detected, for example, whether the sending of the mail migration tasks in operation is overtime is identified through the task scheduling of the access layer. If the migration result is that the migration fails, for example, the mail migration task is sent out overtime, the access layer can reinitiate the mail migration task, i.e. re-write the mail migration task into the target queue.
It can be understood that, for the situation that the server of the logic layer is down due to a fault, if the access layer finds that the server where the target queue written originally by the mail migration task is located cannot communicate when performing task scheduling, a new target queue can be determined, and the mail migration task is written into the new target queue. That is, the mail migration method provided by the embodiment of the present invention may further include:
when the mail migration task fails to be written into the target queue, selecting a task execution queue except the target queue from task execution queues controlled by the logic layer as a new target queue for writing the mail migration task;
the step of writing the mail migration task into the target queue is performed.
For example, after the access layer reinitiates the mail migration task with failed migration, it finds that the server MQ4 cannot be Ping-enabled, and then the mail migration task can be sent to other servers for processing, that is, a new target queue is determined, and the mail migration task is written into the new target queue, so as to ensure the stable overall migration.
The target server corresponding to the new target queue is different from the target server corresponding to the task execution queue whose migration failed.
It can be seen that in the embodiment of the invention, the modules such as the access layer, the logic layer and the like are split and deployed, and after each module is deployed with a cluster, even if a single machine fails, the response of cluster service is not affected.
In some alternative embodiments, because the amount of data to be migrated is large, if all mail data is migrated at one time, the required migration time will be relatively long, which affects the normal use of the user. Therefore, the same batch of data can be migrated at regular or irregular time and for multiple times according to the actual requirement of the user for mail migration. That is, the step of "obtaining a mail migration request through an access layer of a mail migration system, generating a mail migration task based on the mail migration request", includes:
the mail migration method comprises the steps of obtaining a mail migration request through an access layer of a mail migration system, and generating at least two mail migration tasks based on the mail migration request, wherein the mail migration tasks comprise task issuing time, and mail data which are corresponding to different mail migration tasks and need to be migrated are different.
The task issuing time may be a time or a time period. The access layer can determine the task issuing time of the generated mail migration task according to the number of mail migration tasks currently being executed or waiting to be executed, the importance degree of mail data corresponding to the generated mail migration task and other factors.
For example, the access layer may determine to generate three different mail migration tasks according to the mail migration request, so as to implement migration of mail data corresponding to the mail migration request. Mail data corresponding to the mail migration task 1 may be mails sent and received by a user within 7 days recently, mail data corresponding to the mail migration task 2 may be mails sent and received by the user within 7-30 days, and mail data corresponding to the mail migration task 3 may be mails sent and received by the user 30 days ago.
Correspondingly, before the step of "selecting, by the logic layer of the mail migration system, the target queue for writing the mail migration task from the task execution queue controlled by the logic layer", the mail migration method provided by the embodiment of the present invention may further include:
judging whether each mail migration task meets the task issuing conditions or not based on the task issuing time of each mail migration task;
and issuing the mail migration task meeting the task issuing condition to a logic layer of the mail migration system through the access layer.
The task issuance condition may be that a time interval between the current time and the task issuance time (a certain time) is not greater than a preset issuance time threshold, or may be that a time interval between the current time and a start time or a final time of the task issuance time (a certain time) is not greater than a preset issuance time threshold, or the task issuance condition may be that the current time is within the task issuance time and the mail migration system may execute the mail migration task, or the like.
By the aid of the method, the mail data can be migrated at regular or irregular time and multiple times, so that the number of users supported by the mail migration system is increased, and the service capacity of the mail migration system is improved.
203. And determining a target server corresponding to the target queue in the distributed deployed servers, and reading the mail migration task which needs to be processed currently from the target queue through the target server.
In the actual application process, the execution of the mail migration task in the target queue actually requires the server to provide hardware or software resources. For example, the mail migration task in the target queue may be specifically performed in the server by running a thread or process.
In the embodiment of the invention, the servers of the logic layer can adopt a distributed deployment mode, so that an expandable cluster structure is realized, and the execution pressure of mail migration tasks is reduced.
It is understood that there may be one or more target servers corresponding to the target queue. For example, if the logical layer determines that the task amount of the mail migration task in the target queue is smaller, only one target server may be allocated to process the mail migration task. If the logic layer determines that the task amount of the mail migration task in the target queue is large, a plurality of target servers can be allocated to process the mail migration task.
In general, if mail migration is too long, the user's experience of use is greatly affected. Therefore, when the processing capacity is insufficient, service expansion needs to be performed in time to avoid the too long time for mail migration.
For example, in some examples, the mail migration request may include a target migration duration, and before the step of "performing mail migration on target mail data based on the target server", the mail migration method provided by the embodiment of the present invention may further include:
predicting the actual migration time length of the mail migration process according to the target mail data and the target queue;
if the actual migration time length is longer than the target migration time length, determining a new target queue and a new server corresponding to the new target queue, so that the new actual migration time length predicted based on the new target queue is not longer than the target migration time length.
The target migration duration may be a time set by the user through the user side device, or may also be a time set by the service side device according to a requirement. For example, the service side device needs to migrate mail data of different storage areas to a designated area before a certain time, and at this time, the target migration duration may be set according to the time.
Specifically, the actual migration duration may be determined according to the data amount of the target mail data and the number of target queues scheduled by the logic layer. For example, when the number of target queues is the same, the larger the data amount of the target mail data, the longer the actual migration period is.
Correspondingly, in the mail migration process, the mail migration can be performed by a newly-added server through the target server. That is, the step of "performing mail migration on target mail data based on the target server" may specifically include:
and E, performing mail migration on the target mail data based on the target server and the newly added server.
For example, if the number of members of the enterprise a is huge and the migration task cannot be completed as expected according to the current processing capacity of the MQ of the logical layer, as shown in fig. 4, at this time, the transverse capacity expansion can be performed on the MQ of the logical layer alone, and the cluster migration capacity can be improved by increasing the number of MQ, i.e. increasing the number of servers, without modifying codes, which is very convenient.
In the embodiment of the invention, the modules such as the access layer, the logic layer and the like are split and deployed, so that the capacity can be independently expanded according to the bottleneck in the mail migration process, and the resources are saved. For example, when the single scheduling speed of the access layer is too slow, the access layer can be expanded, so that the scheduling capability of the access layer is enhanced.
204. And acquiring target mail data to be migrated based on the mail migration task through the target server.
In particular, the mail data may include, but is not limited to, the mail body, sender, attachment, signed content, etc. of the individual mail of the user. The target mail data is data corresponding to a currently executed mail migration task in the mail data.
Wherein mail data may be stored in a data source. The data source includes mail data that can be migrated. It will be appreciated that the data source and information storage layers may be two distinct modules, as shown in fig. 5. For example, the data source may actually be a database that provides data support for conventional usage procedures for mailboxes, such as mail deletion, mailing, etc., while the information storage layer may be a database that provides data support for mail migration procedures.
In some alternative embodiments, in order to facilitate rapid determination of the cause and location of the problem when the mail migration is problematic, migration record information generated during the mail migration may be included. That is, the mail migration method provided by the embodiment of the present invention may further include:
obtaining migration record information generated when mail migration is carried out on target mail data;
And storing the migration record information to an information storage layer of the mail migration system.
In the practical application process, the information storage layer can set effective time for the stored migration record information. When the existing migration record information is invalid, the invalid migration record information can be deleted to save storage resources. Alternatively, when the storage resources are sufficient, the invalid migration record information may not be deleted, which is not limited by the embodiment of the present invention.
205. And E, based on the target server, performing mail migration on the target mail data.
In the embodiment of the invention, the logic layer can manage a plurality of worker nodes for executing mail migration tasks, and the server resource is scheduled to provide resources for the worker to process the mail migration tasks. The worker may migrate data according to mail migration tasks.
In the actual mail migration process, different mail migration types exist, and migration programs required in migration are different. Thus, the mail migration task may include a target mail migration type of the mail migration process, and the step of "performing mail migration on target mail data based on the target server" may specifically include:
Analyzing the mail migration task based on the target server to obtain a target mail migration type corresponding to the mail migration task;
determining a target migration program corresponding to the target mail migration type;
and migrating the target mail data based on the target migration program.
For example, the scheduling task in the logic layer message queue is processed by a Worker, and the Worker judges the migration type used by the user according to the target mail migration type corresponding to the mail migration task, determines the corresponding migration program as the target migration program, and starts to migrate data.
Specifically, the mail migration type may be a mail transmission type corresponding to a different mail transmission protocol. For example, mail migration types may include, but are not limited to, simple mail transfer protocol (SMTP protocol), post office protocol (POP protocol), internet information access protocol (IMAP protocol), and so forth.
The target mail migration type is a mail transmission type adopted when target mail data are migrated.
It can be understood that some functions in the mail migration process can be implemented by general codes, such as logging in, acquiring a folder list, downloading a designated id mail, etc., when determining a target migration program, the general codes can be directly called to implement the functions, and codes related to the mail migration type, which are not general, are determined according to the mail migration type, that is, the step of determining the target migration program corresponding to the target mail migration type specifically includes:
According to the target mail migration type, determining a target migration function corresponding to the target mail migration type from migration functions corresponding to at least one preset mail migration type;
and generating a target migration program corresponding to the target mail migration type based on the target migration function.
The target migration function may be a function code which cannot be applied to data of each mail migration type, and corresponds to the target mail migration type.
It will be appreciated that the target migration function may include both generic code and non-generic code, in which case the target migration function may be referred to as a target migration program. Alternatively, the target migration function may include only code that is not generic, and the target migration function and the generic code may be combined when the target migration program is generated.
As shown in FIG. 6, general functions of mail Migration, such as logging in, obtaining a folder list, downloading a designated id mail, etc., are defined in the Migration module base class Migration, and the specific implementation is that the sub-class inheriting it implements the corresponding function according to the requirements of different protocols.
The class migrationfactor realizes the creation mode of all types of migration modules, and when in use, the corresponding migration modules can be created only by inputting the corresponding protocol types. When the expansion is required to adapt to a new protocol, the expansion can be completed only by realizing a new subclass and adding a corresponding creation mode into the subclass.
In the practical application process, besides mail migration, the user may have other functional requirements, for example, sending a prompt message before mail migration or after mail migration is completed. In order to reduce the code modification cost and the code invasiveness, the functions other than mail migration and the migration program for executing the mail migration functions are separated in the embodiment of the invention, so that the customization demands of different users are realized. Before the step of generating the target migration program corresponding to the target mail migration type based on the target migration function, the mail migration method provided by the embodiment of the invention may further include:
and acquiring an extended function code, wherein the extended function code is used for realizing an extended function in the mail migration process.
Specifically, the extension function may be to push a reminder message to a client of a user performing mail migration when the mail migration starts, or send a reminder mail to the user performing mail migration after the mail migration ends, and so on. The extended function codes corresponding to the different extended functions may be different codes according to the function design.
Correspondingly, the step of generating a target migration program corresponding to the target mail migration type based on the target migration function includes:
Generating a target migration program of the mail migration process according to the target migration function and the extended function code;
at this time, the step of "migrating the target mail data based on the target migration program" includes:
executing the extended function code in the target migration program;
and migrating the target mail data based on the target migration function in the target migration program.
The procedure for executing the extended function code in the target migration program and the procedure for migrating the target mail data based on the target migration function in the target migration program are not limited in order.
As shown in fig. 7, the extended function code may be executed (Before auth) Before the target migration function (Do imap.auth ()) is executed, or may be executed (After the target migration function is executed (After auth). The setting can be specifically performed according to the actual demands of the user.
For example, the enterprise CorpA requests to send an email notification when the user starts using the IMAP migration task, and then the function of the target migration function corresponding to the IMAP type is not changed, and only needs to insert new email notification logic after the Auth identity is verified.
For example, to avoid modification of the code of the target Migration function corresponding to the generic IMAP type, the system uses a decorator mode, as shown in fig. 6, where the CorpA inherits the base class Migration and is used as the target Migration function corresponding to the IMAP type, and in the CorpA detector class, the target Migration function corresponding to the IMAP type is initialized as a member variable in the class. In implementing the base class migration interface as in fig. 7, an implementation in IMAP is actually used, but code may be inserted before and/or after its execution.
In some alternative embodiments, the target migration program may also be preset, that is, the step of determining the target migration program corresponding to the target mail migration type includes:
and determining a target migration program corresponding to the target mail migration type from migration programs corresponding to at least one preset mail migration type according to the target mail migration type corresponding to the mail migration task.
According to the mail migration method provided by the embodiment of the invention, as shown in fig. 14, in the service evolution process, as the call volume is higher and higher, the logic layer service expansion supports the mail migration requirement.
As shown in FIG. 15, when the mq36 goes down on a certain day 17:24-17:35, the migration request cannot be processed normally, but the whole cluster service is not affected in FIG. 16, and the tasks of the mq36 are uniformly distributed to other machines, so that high availability is realized.
It can be seen from the above that, in the embodiment of the present invention, a mail migration request may be obtained through an access layer of a mail migration system, a mail migration task is generated based on the mail migration request, a target queue for writing the mail migration task is selected from task execution queues controlled by a logic layer through the logic layer of the mail migration system, the mail migration task is written into the target queue, wherein, a task in one task execution queue is executed by one server, a target server corresponding to the target queue in a distributed deployment server is determined, the mail migration task currently required to be processed is read from the target queue through the target server, target mail data required to be migrated is obtained 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; in the embodiment of the invention, the mail migration system comprising the access layer and the logic layer is designed, and the servers corresponding to the task execution queues in the logic layer are distributed, so that the splitting of mail migration service is realized, the coupling of mail migration flow is reduced, the queues for mail migration can be expanded at any time, the mail migration processing capacity is enhanced, and the mail migration efficiency is improved.
The method described in the previous examples is described in further detail below by way of example.
In this embodiment, a description will be given with reference to the system of fig. 1.
As shown in fig. 8, the specific flow of the mail migration method in this embodiment may be as follows:
801. the service side equipment acquires a mail migration request through an access layer of the mail migration system, and generates at least two mail migration tasks based on the mail migration request, wherein the mail migration tasks comprise task issuing time and target mail migration types of mail migration processes.
Mail data which are corresponding to different mail migration tasks and need to be migrated are different.
As shown in fig. 9, the access layer module a performs the scheduling task at regular time according to the configuration parameters, and because of the cluster deployment, there are multiple servers running at the same time, but only one server is expected to perform scheduling, so that the distributed lock needs to be acquired first, and here, the optimistic lock can be simply implemented by using the storage layer database.
By means of the distributed lock, it can be ensured that when a plurality of threads are concurrent, only one thread operates the service, the method and the variable at the same time.
The access layer server which acquires the distributed lock starts to run the scheduling program, acquires user information which needs to be migrated from the storage layer database, including account passwords, request server IP ports, migration types and the like, and generates mail migration tasks. And sending the migration task to the logic layer message queue.
802. The service side device judges whether each mail migration task meets the task issuing conditions or not based on the task issuing time of each mail migration task, and issues the mail migration task meeting the task issuing conditions to a logic layer of the mail migration system through the access layer.
In some alternative examples, the task issuing condition may be null, that is, after the server of the access layer generates the mail migration task, the mail migration task may be directly sent to the logic layer, and the logic layer determines the execution time of the specific mail migration task, and so on.
803. The service side equipment selects a target queue for writing the mail migration task from task execution queues controlled by a logic layer through the logic layer of the mail migration system, and writes the mail migration task into the target queue.
804. The service side equipment determines a target server corresponding to a target queue in the distributed deployed servers through a logic layer, and reads the mail migration task which needs to be processed currently from the target queue through the target server.
As shown in fig. 10, when a task is scheduled to be executed in the logical layer message queue, an executor, i.e., a worker, may be created. And the mail migration task is processed by a workbench. The corresponding key node log and failure log in the migration process can be written into the storage layer immediately. And storing the migrated folders and mails into a target mail system.
The mail system generally refers to a mail service providing system supporting mail storage and inquiry.
805. The service side equipment analyzes the mail migration task based on the target server to obtain a target mail migration type corresponding to the mail migration task.
The Worker can judge the target mail migration type used by the user according to the task information in the mail migration task, and creates a corresponding migration module through a protocol factory to start migrating data.
806. The service side equipment determines a target migration function corresponding to the target mail migration type from migration functions corresponding to at least one preset mail migration type based on the target server according to the target mail migration type.
The general function of mail Migration, such as logging in, obtaining a folder list, downloading a designated id mail, etc., is defined in the Migration module base class Migration, and the specific implementation is that the sub-class inherits the general function according to the requirements of different protocols.
The factory class migationfactor realizes the creation mode of all types of migration modules, and when the factory class migartion factor is used, the corresponding migration modules can be created only by inputting the corresponding protocol types. When the expansion is required to adapt to a new protocol, the expansion can be completed only by realizing a new subclass and adding a corresponding creation mode into the factory class.
The use of modular code design can reduce the need for customization, development costs for protocol extensions.
807. The service side equipment acquires the extended function code through the target server of the logic layer, and generates a target migration program of the mail migration process according to the target migration function and the extended function code.
The extended function code is used for realizing the extended function in the mail migration process.
The use of modular code designs can reduce development costs for customization needs. The adaptation of all protocols is uniformly managed through a factory mode, and the custom requirement of an inserting enterprise is realized by using a decorator mode, so that the modification cost and the code invasiveness can be greatly reduced.
808. The service side device executes the extended function code in the target migration program based on the target server of the logic layer, and migrates the target mail data based on the target migration function in the target migration program.
In the embodiment of the invention, the split service is used for independent deployment, so that the coupling between modules is reduced, and the capacity can be transversely expanded at any time when stronger processing capacity is required; the single service cluster is decentralised, and a small number of machine faults can not influence the normal running of migration.
In typical application scenarios such as enterprise-oriented mail migration service, the method and the system can be used for constructing a set of mail migration system with high flexibility, so that stable migration service is realized. The use of modular code design reduces the need for customization, development costs for protocol extensions. The service is decoupled by using the micro-service design concept, and the service is deployed according to the functional clusters, so that the service capacity is conveniently expanded, the processing capacity is improved, and the service availability problem of the single-machine service is solved.
It can be seen from the above that, in the embodiment of the present invention, a mail migration request may be obtained through an access layer of a mail migration system, a mail migration task is generated based on the mail migration request, a target queue for writing the mail migration task is selected from task execution queues controlled by a logic layer through the logic layer of the mail migration system, the mail migration task is written into the target queue, wherein, a task in one task execution queue is executed by one server, a target server corresponding to the target queue in a distributed deployment server is determined, the mail migration task currently required to be processed is read from the target queue through the target server, target mail data required to be migrated is obtained 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; in the embodiment of the invention, the mail migration system comprising the access layer and the logic layer is designed, and the servers corresponding to the task execution queues in the logic layer are distributed, so that the splitting of mail migration service is realized, the coupling of mail migration flow is reduced, the queues for mail migration can be expanded at any time, the mail migration processing capacity is enhanced, and the mail migration efficiency is improved.
In order to better implement the method, correspondingly, the embodiment of the invention also provides a mail migration device.
Referring to fig. 11, the apparatus may include:
the task generating unit 1101 may be configured to obtain a mail migration request through an access layer of the mail migration system, and generate a mail migration task based on the mail migration request;
the task writing unit 1102 may be configured to select, through a logical layer of the mail migration system, a target queue for writing a mail migration task from task execution queues controlled by the logical layer, and write the mail migration task into the target queue, where a task in one task execution queue is executed by one server;
the task reading unit 1103 may be configured to determine a target server corresponding to a target queue in the distributed deployed servers, and read, through the target server, a mail migration task that needs to be processed currently from the target queue;
the data obtaining unit 1104 may be configured to obtain, by using the target server, target mail data that needs to be migrated based on a mail migration task;
mail migration unit 1105 may be configured to perform mail migration on target mail data based on the target server.
In some alternative embodiments, as shown in fig. 12, the mail migration request may include a target migration duration, and the mail migration apparatus provided in the embodiments of the present invention may further include a queue expansion unit 1106, configured to predict an actual migration duration of the mail migration process according to the target mail data and the target queue;
If the actual migration time length is longer than the target migration time length, determining a new target queue and a new server corresponding to the new target queue, so that the new actual migration time length predicted based on the new target queue is not longer than the target migration time length;
mail migration unit 1105 may be configured to perform mail migration on the target mail data based on the target server and the newly added server.
In some optional embodiments, the mail migration apparatus provided in the embodiments of the present invention may further include a task rewriting unit 1107, which may be configured to detect a migration result of the target server for performing mail migration on the target mail data;
when the migration result is migration failure, determining a mail migration task corresponding to target mail data of the migration failure;
the step of writing the mail migration task into the target queue is performed.
In some optional embodiments, the mail migration apparatus provided in the embodiments of the present invention may further include a task reissuing unit 1108, configured to select, when writing of the mail migration task into the target queue fails, a task execution queue other than the target queue from task execution queues controlled by the logic layer as a new target queue into which the mail migration task is written;
The step of writing the mail migration task into the target queue is performed.
In some optional embodiments, the mail migration request may include migration indication information, where the migration indication information may be used to indicate migration associated information corresponding to the target mail data;
the task generating unit can be used for acquiring migration associated information indicated by the migration indication information from an information storage layer of the mail migration system based on the mail migration request through an access layer of the mail migration system;
and generating mail migration tasks according to the migration associated information.
In some alternative embodiments, the task generating unit 1101 may be configured to send, by an access layer of the mail migration system, a rights acquisition request to an information storage layer of the mail migration system based on the mail migration request, and trigger the information storage layer to generate a rights issuing instruction based on the rights acquisition request;
and acquiring a permission issuing instruction, and acquiring migration associated information indicated by the migration indicating information from the information storage layer according to the permission issuing instruction.
In some alternative embodiments, the mail migration task may include a target mail migration type of the mail migration process;
mail migration unit 1105 may be configured to parse the mail migration task based on the target server to obtain a target mail migration type corresponding to the mail migration task;
Determining a target migration program corresponding to the target mail migration type;
and migrating the target mail data based on the target migration program.
In some optional embodiments, the mail migration unit 1105 may be configured to determine, according to a target mail migration type, a target migration function corresponding to the target mail migration type from migration functions corresponding to at least one preset mail migration type;
and generating a target migration program corresponding to the target mail migration type based on the target migration function.
In some optional embodiments, the mail migration apparatus provided in the embodiments of the present invention may further include an extended code obtaining unit 1109, which may be configured to obtain an extended function code, where the extended function code may be used to implement an extended function in a mail migration process;
mail migration unit 1105, which may be used to generate a target migration program of mail migration process according to the target migration function and the extended function code;
executing the extended function code in the target migration program;
and migrating the target mail data based on the target migration function in the target migration program.
In some optional embodiments, the mail migration unit 1105 may be configured to determine, according to a target mail migration type corresponding to a mail migration task, a target migration program corresponding to the target mail migration type from migration programs corresponding to at least one preset mail migration type.
In some optional embodiments, the mail migration apparatus provided in the embodiments of the present invention may further include a migration information storage unit 1110, which may be configured to obtain migration record information generated when performing mail migration on target mail data;
and storing the migration record information to an information storage layer of the mail migration system.
In some optional embodiments, the task generating unit 1101 may be configured to obtain, by using an access layer of the mail migration system, a mail migration request, and generate at least two mail migration tasks based on the mail migration request, where the mail migration tasks may include task issuing time, and mail data to be migrated corresponding to different mail migration tasks are different;
the mail migration device provided by the embodiment of the invention can further comprise a task timing issuing unit 1111 which can be used for judging whether each mail migration task meets the task issuing condition based on the task issuing time of each mail migration task;
and issuing the mail migration task meeting the task issuing condition to a logic layer of the mail migration system through the access layer.
From the above, through the mail migration device, a mail migration request can be obtained through an access layer of a mail migration system, a mail migration task is generated based on the mail migration request, a target queue for writing the mail migration task is selected from task execution queues controlled by a logic layer through the logic layer of the mail migration system, the mail migration task is written into the target queue, wherein the task in one task execution queue is executed by one server, a target server corresponding to the target queue in the distributed deployed server is determined, the mail migration task which needs to be processed currently is read from the target queue through the target server, target mail data which needs to be migrated is obtained 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; in the embodiment of the invention, the mail migration system comprising the access layer and the logic layer is designed, and the servers corresponding to the task execution queues in the logic layer are distributed, so that the splitting of mail migration service is realized, the coupling of mail migration flow is reduced, the queues for mail migration can be expanded at any time, the mail migration processing capacity is enhanced, and the mail migration efficiency is improved.
In addition, the embodiment of the present invention further provides an electronic device, which may be a terminal or a server, as shown in fig. 13, and shows a schematic structural diagram of the electronic device according to the embodiment of the present invention, specifically:
the electronic device may include Radio Frequency (RF) circuitry 1301, memory 1302 including one or more computer-readable storage media, input unit 1303, display unit 1304, sensor 1305, audio circuitry 1306, wireless fidelity (WiFi, wireless Fidelity) module 1307, processor 1308 including one or more processing cores, and power supply 1309. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 13 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the RF circuit 1301 may be used for receiving and transmitting signals during a message or a call, specifically, after receiving downlink information of a base station, the downlink information is processed by one or more processors 1308; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 1301 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 1301 may also communicate with networks and other devices through wireless communication. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications (GSM, global System of Mobile communication), general packet radio service (GPRS, general Packet Radio Service), code division multiple access (CDMA, code Division Multiple Access), wideband code division multiple access (WCDMA, wideband Code Division Multiple Access), long term evolution (LTE, long Term Evolution), email, short message service (SMS, short Messaging Service), and the like.
The memory 1302 may be used to store software programs and modules, and the processor 1308 executes the software programs and modules stored in the memory 1302 to perform various functional applications and data processing. The memory 1302 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the electronic device (such as audio data, phonebooks, etc.), and the like. In addition, memory 1302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic 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 by the processor 1308 and the input unit 1303.
The input unit 1303 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, the input unit 1303 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device and converts it to touch point coordinates, which are then sent to the processor 1308, and can receive commands from the processor 1308 and execute them. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. The input unit 1303 may comprise other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 1304 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 1304 may include a display panel, which may alternatively be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, upon detection of a touch operation thereon or thereabout by the touch-sensitive surface, being communicated to the processor 1308 to determine the type of touch event, and the processor 1308 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 13 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The electronic device may also include at least one sensor 1305, such as a light sensor, a motion sensor, and other sensors. In particular, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or backlight when the electronic device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device are not described in detail herein.
Audio circuitry 1306, speakers, and a microphone may provide an audio interface between the user and the electronic device. The audio circuit 1306 can transmit the received electrical signal after audio data conversion to a speaker, and the electrical signal is converted into a sound signal by the speaker to be output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 1306 and converted into audio data, which are processed by the audio data output processor 1308, and transmitted via the RF circuit 1301 to, for example, another electronic device, or output the audio data to the memory 1302 for further processing. The audio circuit 1306 may also include an ear bud jack to provide communication of the peripheral ear bud with the electronic device.
WiFi belongs to a short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive emails, browse webpages, access streaming media and the like through the WiFi module 1307, so that wireless broadband Internet access is provided for the user. Although fig. 13 shows a WiFi module 1307, it is understood that it does not belong to the necessary constitution of the electronic device, and can be omitted entirely as necessary within a range that does not change the essence of the invention.
The processor 1308 is the control center of the electronic device, connects the various parts of the overall handset using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 1302, and invoking data stored in the memory 1302. Optionally, the processor 1308 may include one or more processing cores; preferably, the processor 1308 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1308.
The electronic device also includes a power supply 1309 (e.g., a battery) for powering the various components, which may be logically connected to the processor 1308 by a power management system, such as to perform functions such as managing charging, discharging, and power consumption by the power management system. The power supply 1309 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the electronic device may further include a camera, a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the processor 1308 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 1302 according to the following instructions, and the processor 1308 executes the application programs stored in the memory 1302, so as to implement various functions as follows:
acquiring a mail migration request through an access layer of a mail migration system, and generating a mail migration task based on the mail migration request;
through a logic layer of the mail migration system, selecting a target queue for writing mail migration tasks from task execution queues controlled by the logic layer, and writing the mail migration tasks into the target queue, wherein the tasks in one task execution queue are executed by one server;
Determining a target server corresponding to a target queue in the distributed deployed servers, and reading a mail migration task which needs to be processed currently from the target queue through the target server;
acquiring target mail data to be migrated based on a mail migration task through a target server;
and E, based on the target server, performing mail migration on the target mail data.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present invention provides a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the mail migration methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
acquiring a mail migration request through an access layer of a mail migration system, and generating a mail migration task based on the mail migration request;
through a logic layer of the mail migration system, selecting a target queue for writing mail migration tasks from task execution queues controlled by the logic layer, and writing the mail migration tasks into the target queue, wherein the tasks in one task execution queue are executed by one server;
Determining a target server corresponding to a target queue in the distributed deployed servers, and reading a mail migration task which needs to be processed currently from the target queue through the target server;
acquiring target mail data to be migrated based on a mail migration task through a target server;
and E, based on the target server, performing mail migration on the target mail data.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Because the instructions stored in the computer readable storage medium can execute the steps in any mail migration method provided by the embodiments of the present application, the beneficial effects that any mail migration method provided by the embodiments of the present application can be achieved, and detailed descriptions of the foregoing embodiments are omitted herein.
According to one aspect of the present application, there is also provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the methods provided in the various alternative implementations of the embodiments described above.
The mail migration method, device, electronic equipment, storage medium and program product provided by the embodiments of the present invention are described in detail, and specific examples are applied to illustrate the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understand the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present invention, the present description should not be construed as limiting the present invention.

Claims (16)

1. A mail migration method, which is applied to a mail migration system, comprising:
acquiring a mail migration request through an access layer of the mail migration system, and generating a mail migration task based on the mail migration request;
selecting a target queue for writing the mail migration task from a task execution queue controlled by the logic layer through the logic layer of the mail migration system, and writing the mail migration task into the target queue;
determining a target server corresponding to the target queue in the distributed deployed servers, and reading a mail migration task which needs to be processed currently from the target queue through the target server;
Acquiring target mail data to be migrated based on the mail migration task through the target server;
and E, based on the target server, carrying out mail migration on the target mail data.
2. The mail migration method of claim 1, wherein the mail migration request includes a target migration duration;
before the mail migration is performed on the target mail data based on the target server, the method further comprises:
predicting the actual migration duration of the mail migration process according to the target mail data and the target queue;
if the actual migration time length is longer than the target migration time length, determining a new target queue and a new server corresponding to the new target queue, so that the new actual migration time length predicted based on the new target queue is not longer than the target migration time length;
the mail migration for the target mail data based on the target server includes:
and E, based on the target server and the newly added server, carrying out mail migration on the target mail data.
3. The mail migration method of claim 1, further comprising:
Detecting a migration result of the target server for carrying out mail migration on the target mail data;
when the migration result is migration failure, determining the mail migration task corresponding to the target mail data with migration failure;
and executing the step of writing the mail migration task into the target queue.
4. A mail migration method as in claim 3, further comprising:
when the mail migration task fails to be written into the target queue, selecting a task execution queue except the target queue from task execution queues controlled by the logic layer as a new target queue for writing the mail migration task;
and executing the step of writing the mail migration task into the target queue.
5. The mail migration method according to claim 1, wherein the mail migration request includes migration instruction information for instructing migration associated information corresponding to the target mail data;
the mail migration task is generated by the access layer of the mail migration system based on the mail migration request, and the method comprises the following steps:
Acquiring migration associated information indicated by the migration indication information from an information storage layer of the mail migration system based on the mail migration request through an access layer of the mail migration system;
and generating mail migration tasks according to the migration associated information.
6. The mail migration method according to claim 5, wherein the obtaining, by the access layer of the mail migration system, migration-related information indicated by the migration indication information from the information storage layer of the mail migration system based on the mail migration request, includes:
sending a permission acquisition request to an information storage layer of the mail migration system based on the mail migration request through an access layer of the mail migration system, and triggering the information storage layer to generate a permission issuing instruction based on the permission acquisition request;
and acquiring the authority issuing instruction, and acquiring migration associated information indicated by the migration indicating information from the information storage layer according to the authority issuing instruction.
7. The mail migration method of claim 1, wherein the mail migration task includes a target mail migration type of a mail migration process;
The mail migration for the target mail data based on the target server includes:
analyzing the mail migration task based on the target server to obtain a target mail migration type corresponding to the mail migration task;
determining a target migration program corresponding to the target mail migration type;
and migrating the target mail data based on the target migration program.
8. The mail migration method of claim 7, wherein the determining the target migration program corresponding to the target mail migration type includes:
determining a target migration function corresponding to the target mail migration type from migration functions corresponding to at least one preset mail migration type according to the target mail migration type;
and generating a target migration program corresponding to the target mail migration type based on the target migration function.
9. The mail migration method of claim 8, wherein before generating the target migration program corresponding to the target mail migration type based on the target migration function, the method further comprises:
acquiring an extension function code, wherein the extension function code is used for realizing an extension function in a mail migration process;
The generating the target migration program corresponding to the target mail migration type based on the target migration function includes:
generating a target migration program of the mail migration process according to the target migration function and the extended function code;
the migration of the target mail data based on the target migration program comprises the following steps:
executing the extended function code in the target migration program;
and migrating the target mail data based on the target migration function in the target migration program.
10. The mail migration method of claim 7, wherein the determining the target migration program corresponding to the target mail migration type includes:
and determining a target migration program corresponding to the target mail migration type from migration programs corresponding to at least one preset mail migration type according to the target mail migration type corresponding to the mail migration task.
11. The mail migration method of claim 1, further comprising:
obtaining migration record information generated when the target mail data is subjected to mail migration;
And storing the migration record information to an information storage layer of the mail migration system.
12. The mail migration method according to claim 1, wherein the obtaining, by the access layer of the mail migration system, a mail migration request, and generating, based on the mail migration request, a mail migration task includes:
acquiring mail migration requests through an access layer of the mail migration system, and generating at least two mail migration tasks based on the mail migration requests, wherein the mail migration tasks comprise task issuing time, and mail data which are corresponding to different mail migration tasks and need to be migrated are different;
before the target queue for writing the mail migration task is selected from the task execution queues controlled by the logic layer through the logic layer of the mail migration system, the method further comprises:
judging whether each mail migration task meets a task issuing condition or not based on the task issuing time of each mail migration task;
and issuing mail migration tasks meeting the task issuing conditions to a logic layer of the mail migration system through the access layer.
13. A mail migration apparatus, comprising:
The task generating unit is used for acquiring a mail migration request through an access layer of the mail migration system and generating a mail migration task based on the mail migration request;
a task writing unit, configured to select, through a logic layer of the mail migration system, a target queue for writing the mail migration task from task execution queues controlled by the logic layer, and write the mail migration task into the target queue;
the task reading unit is used for determining a target server corresponding to the target queue in the distributed deployment servers, and reading the mail migration task which needs to be processed currently from the target queue through the target server;
the data acquisition unit is used for acquiring target mail data to be migrated based on the mail migration task through the target server;
and the mail migration unit is used for carrying out mail migration on the target mail data based on the target server.
14. An electronic device comprising a memory and a processor; the memory stores an application program, and the processor is configured to execute the application program in the memory to perform the steps in the mail migration method according to any one of claims 1 to 12.
15. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the mail migration method of any one of claims 1 to 12.
16. A computer program product comprising computer programs or instructions which, when executed by a processor, implement the steps of the mail migration method of any one of claims 1 to 12.
CN202210523153.9A 2022-05-13 2022-05-13 Mail migration method, mail migration device, electronic equipment, storage medium and program product Pending CN117097694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210523153.9A CN117097694A (en) 2022-05-13 2022-05-13 Mail migration method, mail migration device, electronic equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210523153.9A CN117097694A (en) 2022-05-13 2022-05-13 Mail migration method, mail migration device, electronic equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN117097694A true CN117097694A (en) 2023-11-21

Family

ID=88775783

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210523153.9A Pending CN117097694A (en) 2022-05-13 2022-05-13 Mail migration method, mail migration device, electronic equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN117097694A (en)

Similar Documents

Publication Publication Date Title
KR102481065B1 (en) Application function implementation method and electronic device
EP3010262B1 (en) Method for realizing cellphone without card and cellphone
US20190199795A1 (en) Method and device for synchronizing backup data, storage medium, electronic device, and server
CN107391768B (en) Webpage data processing method, device and equipment and computer readable storage medium
CN111478849B (en) Service access method, device and storage medium
US20160316312A1 (en) Interface display method, device, terminal, server and system
CN112130866A (en) Application deployment method and related device
WO2019128571A1 (en) Resource management method and device, mobile terminal, as well as computer readable storage medium
CN109992380B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN107463395B (en) Component calling method and device
CN111359210B (en) Data processing method and device, electronic equipment and storage medium
CN109511139B (en) WIFI control method and device, mobile device and computer-readable storage medium
CN110196662B (en) Method, device, terminal and storage medium for displaying synchronization state
CN115225966B (en) Application starting method, device, terminal equipment and storage medium
JP7319431B2 (en) Application function implementation method and electronic device
CN109992362B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN117097694A (en) Mail migration method, mail migration device, electronic equipment, storage medium and program product
CN115065609A (en) B-end SaaS system hybrid deployment method and system
CN112732548B (en) Interface testing method and device
CN113852450A (en) Message push feedback method and device, electronic equipment and storage medium
CN110753909B (en) Service scheduling method and device, computer equipment and computer readable storage medium
CN109993525B (en) Application program processing method and device, electronic equipment and computer readable storage medium
CN107301089A (en) A kind of APP deployment and call method and terminal
CN114564700A (en) Method and related device for managing communication of untrusted application programs
CN111144845A (en) Mobile terminal conference reminding method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination