A method, apparatus, device and medium for mail synchronization

By acquiring user synchronization information and email information, the system proactively detects unsynchronized emails and requests synchronization, resolving the issue of unsynchronized emails in the new mailbox. This achieves timely email synchronization and efficient processing, improving the user experience.

CN116805935BActive Publication Date: 2026-08-25BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310896861.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2026-08-25
Estimated Expiration
2043-07-20

AI Technical Summary

Technical Problem

When users migrate from an old email address to a new one, newly received emails cannot be synchronized to the new email address in a timely manner, resulting in a poor user experience.

Method used

By acquiring users' synchronization information and email information, the system proactively detects unsynchronized emails and requests their synchronization to a new email address. It also optimizes the synchronization process using fragmentation and locking mechanisms, thereby improving synchronization efficiency and accuracy.

Benefits of technology

It enables timely email synchronization, improves user experience, ensures that newly received emails are displayed in the new mailbox in a timely manner, and enhances the efficiency and accuracy of email synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116805935B_ABST
    Figure CN116805935B_ABST
Patent Text Reader

Abstract

The method comprises: obtaining a first user identifier of a first user who needs to synchronize mails; obtaining first synchronization information corresponding to the first user based on the first user identifier, the first synchronization information comprising information representing the latest mails synchronized when the latest synchronization of the mails of the first user from a first mailbox end to a second mailbox end is performed; obtaining second synchronization information corresponding to the first user from the first mailbox end, the second synchronization information comprising information representing the latest mails stored in the first mailbox end for the first user; determining whether the first mailbox end contains first mails for the first user which are not synchronized to the second mailbox end based on the first synchronization information and the second synchronization information; and if it is determined that the first mailbox end contains the first mails, requesting the first mailbox end to synchronize the first mails to the second mailbox end, so as to better synchronize the mails and avoid the problem of unsynchronized mails.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data synchronization technology, and in particular to a method, apparatus, device, and medium for email synchronization. Background Technology

[0002] Email is an indispensable communication tool in the workplace. When users need to migrate their email accounts from one provider (old email) to another (new email), it's necessary to synchronize emails from the old account to the new account. However, during this migration process, newly received emails in the old account may not be synchronized to the new account in a timely manner, resulting in users being unable to view these new emails in the new account and leading to a poor user experience. Summary of the Invention

[0003] This disclosure provides one or more embodiments of a method, apparatus, device, and medium for email synchronization, thereby achieving better email synchronization and avoiding, to some extent, the problem of untimely email synchronization.

[0004] According to the first aspect, a method for email synchronization is provided, including:

[0005] Get the first user identifier of the first user whose emails need to be synchronized;

[0006] Based on the first user identifier, obtain the first synchronization information corresponding to the first user, wherein the first synchronization information includes information representing the latest email synchronized by the first user when the first email was last synchronized from the first email client to the second email client;

[0007] Obtain second synchronization information corresponding to the first user from the first email client. The second synchronization information includes information representing the latest emails stored by the first email client for the first user.

[0008] Based on the first synchronization information and the second synchronization information, determine whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox.

[0009] If it is determined that the first email account contains the first email, a request is sent to the first email account to synchronize the first email account to the second email account.

[0010] In one optional implementation, obtaining the first user identifier of the first user who needs to synchronize emails includes: obtaining the first user identifier from the currently selected first segment, wherein the first segment is determined from a plurality of segments, and any one of the plurality of segments contains user identifiers of a plurality of users who need to synchronize emails.

[0011] In the above optional implementation, the user identifiers of each user who needs to synchronize emails are stored in several shards. By processing the user identifiers obtained from the first shard selected from the several shards, the email synchronization process of users in each shard of the several shards can be processed in parallel, thereby improving the efficiency of user email synchronization.

[0012] In one optional implementation, the first shard further includes the synchronization time corresponding to the first user, wherein the synchronization time is the time of the latest synchronization of the first user's emails from the first mailbox to the second mailbox, and the synchronization time corresponding to the first user satisfies a preset email synchronization condition.

[0013] In the above optional implementation, users who need to synchronize emails are selected based on their corresponding synchronization time and preset email synchronization conditions. This can, to a certain extent, prioritize email synchronization for users with the greatest need for email synchronization, thereby improving the user experience.

[0014] In one optional implementation, before obtaining the first user identifier from the currently selected first fragment, the method further includes: obtaining the current value of the configuration parameter; determining a target value based on the current value; determining the first fragment identifier of the currently selected first fragment using the target value and the current fragment number; and determining the first fragment based on the first fragment identifier.

[0015] In the above optional implementation, by using the target value of the configuration parameters and the current number of shards to determine the first shard to be selected, the shards to be processed can be selected in an orderly manner, ensuring that each shard has an equal probability of being selected, and thus ensuring that the probability of the user corresponding to the user identifier stored in the shard is equal.

[0016] In one optional implementation, before obtaining the first user identifier from the currently selected first segment, the method further includes: locking the first segment and setting a corresponding locking duration; obtaining the first user identifier from the currently selected first segment includes: obtaining the first user identifier from the first segment when it is determined that the current time is within the time range corresponding to the locking duration.

[0017] In the above optional implementation, locking can prevent the first segment from being selected multiple times at the same time. Setting an appropriate locking time can prevent the processing time of the first segment from being too long, which would prevent the users corresponding to other segments from being processed in a timely manner.

[0018] In one optional implementation, the method further includes: updating the current value of the configuration parameter based on the target value to obtain a new current value of the configuration parameter.

[0019] In the above optional implementation, updating the current value of the configuration parameters based on the target value can ensure that each of the several shards can be selected, guaranteeing that the users corresponding to each shard can be processed.

[0020] In one optional implementation, the method further includes: obtaining the user identifier of the user whose email needs to be synchronized from the specified data storage space; using a preset hash algorithm, determining the shard to which each user belongs based on the user identifier of each user and the current number of shards; and storing the user identifier of each user in its respective shard.

[0021] In the above optional implementation, the shard to which each user belongs can be determined in an orderly manner, which can, to a certain extent, ensure that users are distributed as evenly as possible to each shard, and ensure that each user can be processed better and faster.

[0022] In one optional implementation, determining whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox includes: comparing the first synchronization information and the second synchronization information to obtain a comparison result; and determining whether the first mailbox contains the first email based on the comparison result.

[0023] In the above optional implementation, it is possible to determine relatively accurately whether the first mailbox contains the first email for the first user that has not been synchronized to the second mailbox, thus ensuring the efficiency and accuracy of email synchronization.

[0024] In one optional implementation, the first synchronization information includes a first cursor identifier value, and the second synchronization information includes a second cursor identifier value; if the comparison result indicates that the first cursor identifier value is less than the second cursor identifier value, then it is determined that the first mailbox contains the first email.

[0025] The above optional embodiments provide a specific method for determining whether the first mailbox contains the first email, so as to accurately determine whether the first mailbox contains the first email for the first user that has not been synchronized to the second mailbox, thereby ensuring the efficiency and accuracy of email synchronization.

[0026] In one optional implementation, if the comparison result indicates that the first cursor identifier value is greater than the second cursor identifier value, an abnormality alert message is output.

[0027] In the above optional implementation, if it is determined that the first cursor identifier value is greater than the second cursor identifier value, it can be determined that an abnormality has occurred in the email synchronization process, and an abnormality reminder message is output so that staff can maintain the email synchronization process in a timely manner, thereby ensuring the smooth execution of the email synchronization process.

[0028] In one optional implementation, requesting the first email to be synchronized to the second email account includes: sending a subscription request for an email synchronization service to the first email account, so that the first email account synchronizes the first email to the second email account.

[0029] In the above optional implementation, the first email client can promptly synchronize the first email to the second email client, and further ensures that after the first email client obtains a new email for the first user, it can promptly synchronize it to the second email client.

[0030] In one optional implementation, the method further includes: if it is detected that the subscription request is not authorized, retrieving the first email from the first email address and synchronizing the retrieved first email to the second email address.

[0031] In the above optional implementation, after detecting that the subscription request is not authorized, if the first user has authorized the receipt of emails from the first email address, the first email is retrieved from the first email address and synchronized to the second email address, so as to ensure that the new email address for the first user can be synchronized to the second email address, thereby improving the user experience.

[0032] According to the second aspect, an email synchronization device is provided, comprising:

[0033] The first acquisition module is configured to acquire the first user identifier of the first user whose emails need to be synchronized.

[0034] The second acquisition module is configured to acquire first synchronization information corresponding to the first user based on the first user identifier, wherein the first synchronization information includes information representing the latest email synchronized by the first user when the email was last synchronized from the first email client to the second email client.

[0035] The third acquisition module is configured to acquire second synchronization information corresponding to the first user from the first email client. The second synchronization information includes information representing the latest emails stored by the first email client for the first user.

[0036] The first determining module is configured to determine, based on the first synchronization information and the second synchronization information, whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox.

[0037] The request module is configured to, if it is determined that the first email contains the first email, request the first email to be synchronized to the second email.

[0038] According to a third aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in the first aspect.

[0039] According to a fourth aspect, an electronic device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method described in the first aspect.

[0040] According to the email synchronization method, apparatus, device, and medium provided in this disclosure, based on the first synchronization information corresponding to the first user and the second synchronization information corresponding to the first user obtained in real time from the first mailbox, it can be determined whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox. If it is determined that the first mailbox contains the first email, a request is made to the first mailbox to synchronize the first email to the second mailbox. The above process can achieve active detection of the first mailbox, that is, actively detect whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox, and then, if it is determined that it contains the first email, request the first mailbox to synchronize the first email to the second mailbox, so as to achieve better email synchronization. Attached Figure Description

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

[0042] Figure 1A This is a schematic diagram illustrating the implementation framework of one embodiment disclosed in this disclosure;

[0043] Figure 1B This is a flowchart illustrating one embodiment disclosed in this disclosure;

[0044] Figure 2 A flowchart illustrating an email synchronization method provided in this embodiment;

[0045] Figure 3 A schematic block diagram of an email synchronization device provided in an embodiment;

[0046] Figure 4 This is a schematic block diagram of an electronic device provided for an embodiment. Detailed Implementation

[0047] The technical solutions of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0048] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0049] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0050] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0051] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0052] This disclosure presents a method, apparatus, and medium for email synchronization. The application scenarios and technical concepts of the email synchronization method are described below:

[0053] As mentioned earlier, email is an indispensable communication tool in the workplace. When a user needs to migrate their email account from one provider (old email client) to another, the emails received on the old client need to be synchronized to the new client. Migrating from one provider to another can be considered as keeping the user's email address the same as the old one, but the new client can synchronize emails received on the old client.

[0054] In one exemplary scenario, the email synchronization process may include, for example, that user A has successfully subscribed to the email change notification service on the old email client, i.e., authorized the synchronization of emails received on the old email client for user A (whose email address is A) to the new email client; for example, when user B sends a new email 1 to user A's email address A through their email address B, the old email client receives the new email 1 and, upon detecting that user A has successfully subscribed to the email change notification service, synchronizes the new email 1 to the new email client, so that user A can view the new email 1 on the new email client, i.e., user A can view the new email 1 after logging into the new email client through their email address A.

[0055] In one implementation, the emails received by the old email client for user A (whose email address is A) may include at least: emails received by the old email client for user A (whose email address is A) after user A has successfully subscribed to the email change notification service; and may also include: emails received by the old email client for user A before user A has successfully subscribed to the email change notification service.

[0056] During the email synchronization process described above, even if user A successfully subscribes to the email change notification service, which authorizes the synchronization of emails received in the old email client (for user A's email address) to the new email client, the email change notification service provided by the old email client is often unstable and prone to interruptions. As a result, newly received emails in the old email client cannot be synchronized to the new email client in a timely manner, making it impossible for the user to view newly received emails in the new email client, leading to a poor user experience.

[0057] To address the aforementioned issues, this disclosure provides a method for email synchronization, which can better achieve email synchronization and improve user experience. Figure 1A and Figure 1B A schematic diagram illustrating an implementation scenario according to an embodiment disclosed herein is shown. In this implementation scenario, an exemplary email synchronization system is illustrated, such as... Figure 1A As shown in Figure 1, the email synchronization system may include one or more data processing terminals, data storage space, and a shard set. In the case of multiple data processing terminals, the email synchronization system may include data processing terminal 1, data processing terminal 2, ..., data processing terminal N. The shard set may include shard 1, shard 2, ..., shard M.

[0058] This data storage space can store user-related information for several users who require email synchronization. This user-related information includes at least the user's identifier, such as a userID. In one implementation, the user-related information may also include the synchronization time corresponding to the user, which is the time when the corresponding user's emails were last synchronized from the first mailbox (i.e., the aforementioned old mailbox) to the second mailbox (i.e., the aforementioned new mailbox). The user-related information may also include synchronization information corresponding to the user, wherein this synchronization information includes information representing the latest email synchronized when the user's emails were last synchronized from the first mailbox to the second mailbox. In one implementation, the synchronization information may include a cursor identifier value, wherein a larger cursor identifier value indicates that the latest synchronized email is newer.

[0059] exist Figure 1B In the exemplary implementation scenario shown, where the email synchronization system includes multiple data processing terminals, the email synchronization process can include two stages: a user grouping stage and a data processing (i.e., email synchronization) stage.

[0060] Among them, such as Figure 1B As shown, in the user grouping stage, any one of the several data processing terminals (e.g., data processing terminal i) can obtain the user identifiers of each user who needs to synchronize emails from the data storage space; then, for each user, based on the user identifier and the current number of shards, determine the shard to which each user belongs; then, at least the user identifiers of each user are stored in the shard to which each user belongs; in one implementation, the synchronization time corresponding to each user can also be obtained from the data storage space, and the synchronization time corresponding to each user is associated with the user identifier and stored in the shard to which each user belongs, thus realizing the grouping of users.

[0061] In one scenario, if this email synchronization process is the first email synchronization process, the user identifiers of the users whose emails need to be synchronized, obtained from the data storage space, may include: the user identifiers of all users stored in the data storage space.

[0062] In another scenario, if this email synchronization process is not the first email synchronization process, the user identifier of the user whose emails need to be synchronized, obtained from the data storage space, may include: the user identifier of the user whose shard to be determined is stored in the data storage space.

[0063] In another scenario, it can be assumed that all users stored in the data storage space are users with email synchronization needs. This can be understood as including users currently needing email synchronization, as well as users who have historical (or future) email synchronization needs. To better distinguish whether a user currently has an email synchronization need, the user-related information can also include the corresponding user's synchronization status. If the synchronization status is active, it indicates that the corresponding user currently has an email synchronization need; if the synchronization status is inactive, it indicates that the corresponding user does not currently have an email synchronization need, but has historical (or future) email synchronization needs. In this case, to ensure the timeliness of email synchronization for users currently needing synchronization, the user identifier of the user requiring email synchronization obtained from the data storage space can include: the user identifier of a user stored in the data storage space whose assigned fragment is not yet determined, and whose corresponding synchronization status is active.

[0064] In one implementation, any one of the several data processing terminals may trigger the action of retrieving the user identifier of the user who needs to synchronize emails from the data storage space after detecting a change in the user-related information stored in the data storage space (e.g., adding user-related information of a new user, or modifying user-related information). Alternatively, it may trigger the action of retrieving the user identifier of the user who needs to synchronize emails from the data storage space after detecting the arrival of the data retrieval period, or trigger the action of retrieving the user identifier of the user who needs to synchronize emails from the data storage space after receiving a data retrieval instruction.

[0065] After the user grouping phase is completed, the data processing (i.e., email synchronization) phase begins. In this phase, each of the several data processing endpoints selects the shards it needs to process from the aforementioned number of shards, and then processes the users within those selected shards. Understandably, the processing procedures for users in each data processing endpoint's selected shards are similar. The following description uses the processing procedure of any one data processing endpoint (e.g., data processing endpoint i) to illustrate the user processing. For the processing procedures of other data processing endpoints, please refer to the process of data processing endpoint i.

[0066] Specifically, any data processing terminal i among several data processing terminals obtains the user identifier j of the user j whose emails need to be synchronized from the selected segment to be processed, and then... Figure 1BAs shown, based on user identifier j, the first synchronization information corresponding to user j is obtained from the data storage space. The first synchronization information includes information representing the latest email synchronized when the email of user j was synchronized from the first mailbox to the second mailbox, such as synchronizing to the XXth email (the latest email in the latest synchronization).

[0067] Next, data processing terminal i obtains the second synchronization information corresponding to user j from the first email client. This second synchronization information includes information representing the latest email stored by the first email client for user j. In one implementation, to better ensure data security, data processing terminal i can obtain the second synchronization information corresponding to user j from the first email client based on the first synchronization information. Specifically, data processing terminal i sends the first synchronization information to the first email client. The first email client compares the first synchronization information with the synchronization information of the latest synchronized email stored locally for user j (referred to as the third synchronization information), obtains the comparison result, and verifies user j based on the comparison result. If the comparison result indicates that the first synchronization information and the third synchronization information are the same, the verification is confirmed to be successful, and the first email client sends the second synchronization information stored for user j to data processing terminal i, and data processing terminal i obtains the second synchronization information corresponding to user j.

[0068] Then, based on the first and second synchronization information of user j, the data processing terminal i determines whether the first mailbox contains emails for user j that have not been synchronized to the second mailbox (referred to as first emails). If it is determined that the first mailbox contains first emails, the data processing terminal i requests the first mailbox to synchronize all first emails to the second mailbox so that the second mailbox can synchronize and obtain all first emails.

[0069] Subsequently, in one implementation, data processing terminal i updates the data storage space with the second synchronization information, using it as the new first synchronization information corresponding to user j, and synchronizes this new first synchronization information to the shard where user j resides (i.e., updates the first synchronization information stored in the shard where user j resides with this second synchronization information, using it as the new first synchronization information corresponding to user j). Furthermore, data processing terminal i can also update the synchronization time of user j stored in the data storage space and in the shard to which user j belongs, based on the synchronization time of the first email in this synchronization.

[0070] In another implementation, if it is determined that the first mailbox does not contain the first email for user j that has not been synchronized to the second mailbox, the data processing terminal i updates the synchronization time of user j stored in the data storage space according to the time corresponding to the current email synchronization process for user j, and updates the synchronization time of user j stored in the shard to which user j belongs.

[0071] In the above process, the data processing end can actively probe the first mailbox, that is, actively detect whether the first mailbox contains emails for users who need to synchronize emails that have not been synchronized to the second mailbox. If it is confirmed that the first mailbox contains such emails, the processing end will request the first mailbox to synchronize the corresponding emails to the second mailbox, so as to achieve better email synchronization, improve the timeliness of email synchronization to a certain extent, and improve the user experience.

[0072] Furthermore, in the above process, when there are multiple data processing terminals, these terminals can process users in each segment in parallel, which can improve the efficiency of email synchronization to a certain extent and better improve the timeliness of email synchronization for users who need to synchronize their emails.

[0073] The methods, apparatus, devices, and media for email synchronization provided in this disclosure will be described in detail below with reference to specific embodiments.

[0074] Figure 2 A flowchart illustrating an email synchronization method according to one embodiment of this disclosure is shown. This method can be implemented using a target program, which can be deployed in the aforementioned email synchronization system. The email synchronization system may include one or more data processing terminals. If the email synchronization system includes one data processing terminal, the target program can be that data processing terminal; if the email synchronization system includes multiple data processing terminals, the target program can be any one of those multiple data processing terminals. It is understood that the email synchronization process performed on a user by any data processing terminal in the email synchronization system is similar. The following description uses the target program's email synchronization process as an example; the email synchronization processes performed on users by other data processing terminals can be found in the target program's user email synchronization process.

[0075] The target program can be installed in an electronic device, which can be implemented through any device, equipment, platform, or cluster of devices with computing and processing capabilities. For example... Figure 2 As shown, the method includes the following steps S210-S250:

[0076] In step S210, obtain the first user identifier of the first user whose emails need to be synchronized.

[0077] The users who need to synchronize emails can include those who require synchronizing their emails from a first email account to a second email account. For example, users who have subscribed to an email synchronization service (also known as an email change notification service) on their first email account. After successfully subscribing to the email synchronization service on their first email account, these users can synchronize their emails from their first email account to their second email account. In one scenario, the first and second email accounts may belong to different email providers.

[0078] In one implementation, the user-related information of each user whose emails need to be synchronized can be stored in a designated data storage space, such as the aforementioned data storage space. This user-related information may include at least the user's user identifier, such as a userID. In another implementation, the user-related information may also include the information of the latest email synchronized when the corresponding user last synchronized their emails from the first mailbox to the second mailbox; that is, the synchronization information for the corresponding user. This user-related information may also include the synchronization time when the corresponding user last synchronized their emails from the first mailbox to the second mailbox.

[0079] In one scenario, the designated data storage space can be provided by a relational database that offers persistent storage services, in order to manage user-related information for users who need to synchronize emails.

[0080] Understandably, this designated data storage space can store user-related information of users who currently or historically (or subsequently) have a need for email synchronization (i.e., a need to synchronize their emails from a first mailbox to a second mailbox). To ensure better email synchronization services are provided to users who currently have a need for email synchronization, and to guarantee the timeliness of email synchronization for such users, the user-related information can also include the corresponding user's synchronization status. When the user's synchronization status is active, it indicates that the user currently has a need for email synchronization. When the user's synchronization status is inactive, it indicates that the user does not currently have a need for email synchronization, but may have had a need for email synchronization in the past and / or may have a need for email synchronization in the future.

[0081] In one implementation, the target program can directly obtain the user identifiers of each user (e.g., users whose synchronization status is active or all users stored in the specified data storage space) that need to synchronize emails from the designated data storage space. Then, based on each user's user identifier, it can execute the subsequent email synchronization process (i.e., email synchronization handling) for each user. It is understandable that the process of the target program executing the subsequent email synchronization process based on each user's user identifier is similar. The following example illustrates the process of executing the subsequent email synchronization process for any first user among the users who need to synchronize emails.

[0082] In one embodiment, when the email synchronization system includes multiple data processing terminals, if there are many users who need to synchronize emails (i.e., users who need to synchronize their emails from a first mailbox to a second mailbox), in order to ensure the timeliness of email synchronization for each user and to guarantee the user experience, the email synchronization method may further include a process of grouping users who need email synchronization before step S210. This allows each group of users to be processed in parallel by multiple data processing terminals, thereby improving the efficiency of email synchronization. This process may include the following steps 11-13: In step 11, the target program obtains the user identifiers of each user who needs to synchronize emails from a specified data storage space. In this step, the target program can read the user identifiers of each user who needs to synchronize emails from the specified data storage space.

[0083] In one scenario, if this email synchronization process is the first email synchronization for a user in the specified data storage space who needs to synchronize emails, the user identifier of the user needing to synchronize emails obtained from the specified data storage space may include: the user identifiers of all users stored in the specified data storage space. In another scenario, if this email synchronization process is not the first email synchronization process, the user identifier of the user needing to synchronize emails obtained from the specified data storage space may include: the user identifiers of users whose shard membership has not been determined in the specified data storage space. In yet another scenario, if the specified data storage space also stores the synchronization status of each user, the user identifier of the user needing to synchronize emails obtained from the specified data storage space may include: the user identifiers of users whose shard membership has not been determined in the specified data storage space, and whose corresponding synchronization status is active.

[0084] After the target program reads the user IDs of each user who needs to synchronize emails, in step 12, it uses a preset hash algorithm to determine the shard to which each user belongs based on their user ID and the current number of shards. Specifically, the target program can take the remainder of each user's user ID using the current number of shards, and then determine the shard to which each user belongs based on the remainder result, thus grouping users who need to synchronize emails. For example, if user A's userID is 72343231 and the current number of shards is 100, then the remainder of user A's user ID using the current number of shards is 72343231 % 100 = 31. Based on this remainder result of 31, user A's shard is determined. Specifically, user A's shard is determined to be the shard with the corresponding shard ID 31.

[0085] In one implementation, the current number of shards refers to the number of shards in the shard set included in the email synchronization system, and can be set according to actual needs. In another case, the current number of shards can also be determined based on the number of data processing terminals included in the aforementioned email synchronization system; for example, the current number of shards (i.e., the number of shards in the shard set) can be equal to the number of data processing terminals included in the aforementioned email synchronization system. In yet another case, the current number of shards can also be greater than or less than the number of data processing terminals included in the email synchronization system.

[0086] In one implementation, the target program can also group users using other grouping methods. For example, if the number of shards in the aforementioned email synchronization system (the current number of shards) is 100, the target program can directly group users based on the values ​​of two specified positions (e.g., the last two digits) in each user's user identifier, grouping users whose values ​​in the two specified positions are equal into one group, thus assigning each user to different groups. It should be noted that this disclosure does not limit the user grouping method; any method that can group users can be applied to this disclosure.

[0087] After determining the shard to which each user belongs, in step 13, the user identifier of each user is stored in its respective shard.

[0088] In one implementation, to ensure timely email synchronization, each shard can be provided by a non-relational database to improve email synchronization efficiency.

[0089] In another implementation, steps 11-13 above can also be executed by any of the other data processing endpoints in the email synchronization system besides the target program.

[0090] In one embodiment, when users who need to synchronize emails are divided into different shards, step S210 may include: obtaining a first user identifier from the currently selected first shard, wherein the first shard is determined from a plurality of shards, and any one of the plurality of shards contains user identifiers of a plurality of users who need to synchronize emails.

[0091] In cases where users who need to synchronize emails are divided into different shards, the target program first needs to select the shard it needs to process from multiple shards, i.e., the first shard currently selected. Then, it needs to obtain the first user identifier of the first user who needs to synchronize emails from the first shard currently selected.

[0092] In one embodiment, the first shard may further include the synchronization time corresponding to the first user, wherein the synchronization time is the time of the latest synchronization of the first user's emails from the first mailbox to the second mailbox, and the synchronization time corresponding to the first user meets the preset email synchronization conditions.

[0093] In this implementation, considering that users who have just completed email synchronization (i.e., those whose latest email synchronization was within a certain timeframe from the current time) have a relatively weaker need for email synchronization compared to users whose synchronization time has been more than a certain amount of time away, the target program can prioritize executing the email synchronization process for users whose synchronization time has been more than a certain amount of time away from the current time. Accordingly, the synchronization time for the first user must meet preset email synchronization conditions. These conditions can include the synchronization time being more than a certain amount of time away from the current time. This certain amount of time can be set according to actual conditions, for example, 1 minute.

[0094] In this implementation, the target program can obtain the first user identifier of any first user among users who need to synchronize emails and whose corresponding synchronization time meets the preset email synchronization conditions (i.e., the corresponding synchronization time is more than a certain amount of time away from the current time) from the first segment. This allows the program to prioritize email synchronization for users with higher synchronization needs. For example, the target program can obtain the first user identifier of any first user among users who need to synchronize emails and whose corresponding synchronization time is 1 minute or more away from the current time from the first segment.

[0095] In one implementation, the user identifiers of each user who needs to synchronize emails in the first segment can be sorted according to the order of their corresponding synchronization times. The smaller the synchronization time of a user, i.e. the earlier the synchronization time, the earlier the user identifier will be in the sorting order. Accordingly, the target program can take each user as the first user from front to back according to the sorting order of the users in the first segment and obtain the first user identifier of the first user.

[0096] In another implementation, considering that user-related information stored in the designated data storage space may be modified (e.g., deleted), it can be assumed that the user no longer needs email synchronization. Considering that user identifiers stored in the first segment may not be updated in a timely manner, after obtaining the first user identifier, the target program can search for the first user identifier in the designated data storage space. If the first user identifier is not found in the designated data storage space, it is determined that the first user's information has been deleted from the designated data storage space, indicating that the user no longer needs email synchronization. Accordingly, the target program deletes the first user identifier and the corresponding synchronization time from the first segment. Then, it continues to obtain user identifiers from other users in the first segment, using them as the first user's first user identifier, and continues the subsequent process. If the first user identifier is found in the designated data storage space, it is determined that the first user is the user who needs email synchronization, and the target program performs the subsequent email synchronization process for the first user.

[0097] In one implementation, if it is determined that the specified data storage space contains the first user identifier, the synchronization status corresponding to the first user identifier can be checked to see if it is active. If the synchronization status corresponding to the first user identifier is inactive, the synchronization time corresponding to the first user stored in the specified data storage space (and the first segment) is updated based on the time when the first user identifier was obtained. Then, the user identifiers of other users are obtained from the first segment and used as the first user identifier of the first user, and the subsequent process continues. If it is determined that the specified data storage space contains the first user identifier and the synchronization status corresponding to the first user identifier is active, the synchronization time corresponding to the first user stored in the specified data storage space (and the first segment) is updated, and the subsequent email synchronization process is performed for the first user.

[0098] In the aforementioned email synchronization system, which includes multiple data processing terminals, users requiring email synchronization are divided into different shards. The target program needs to select the shard it needs to process from multiple shards. The process of the target program selecting the shard it needs to process from multiple shards is described below. Accordingly, in one embodiment, before step S210, the method may further include the following steps 21-24:

[0099] In step 21, the current value of the configuration parameter is obtained. To ensure that each data processing end can better select the shard it needs to process, the email synchronization system can pre-store a configuration parameter to help each data processing end select the shard it needs to process. Accordingly, the target program reads the current value of the configuration parameter from the storage location where the configuration parameter is stored.

[0100] Next, in step 22, the target value is determined based on the current value. In one implementation, after the target program obtains the current value, it can increment the current value by one to obtain the target value, and then execute the subsequent step 23. In another implementation, after the target program obtains the current value, it can determine the current value as the target value, and then execute the subsequent step 23.

[0101] In step 23, the first fragment identifier of the currently selected first fragment is determined using the target value and the current number of fragments. Specifically, in this step, the target program can take the remainder of the target value with the current number of fragments, and determine the first fragment identifier based on the remainder result. For example: if the target value equals the current value plus one, and the current value of the configuration parameter is 135230, then the corresponding target value is 135231, and the current number of fragments is 100. Taking the remainder of the target value with the current number of fragments, i.e., the remainder result is 135231 % 100 = 31, and then determining the first fragment identifier of the target program's currently selected first fragment based on the remainder result 31; that is, the first fragment identifier is 31.

[0102] Then, in step 24, the first fragment is determined based on the first fragment identifier. Continuing with the previous example, the target program determines the fragment with the corresponding fragment identifier 31 as the first fragment currently selected by the target program itself.

[0103] In one implementation, to prevent the target program from simultaneously reading the current parameters of the configuration parameters with at least one of the other data processing terminals in the aforementioned email synchronization system, which could lead to the target program and at least one of the other data processing terminals in the email synchronization system determining the same fragment that needs to be processed, the target program can use locking or atomic operations when operating on the configuration parameters. This ensures that when the target program is operating on the configuration parameters, other data processing terminals in the email synchronization system cannot operate on the configuration parameters.

[0104] To prevent simultaneous processing of the same data shard (i.e., simultaneous processing of users within the same shard) by different data processing endpoints in the email synchronization system, after obtaining the target value in step 22, the target program can also execute the following step 25: update the current value of the configuration parameter based on the target value to obtain a new current value for the configuration parameter. In one implementation, if the target value equals the current value plus one, the target program can update the current value of the configuration parameter to the target value to obtain a new current value for the configuration parameter. In another implementation, if the target value equals the current value, the target program can first increment the target value by one, and then update the current value of the configuration parameter to the incremented target value to obtain a new current value for the configuration parameter.

[0105] If the target program uses a locking mechanism to operate on the configuration parameters, preventing other data processing terminals in the email synchronization system from operating on the configuration parameters while it is operating on them, the target program will unlock the configuration parameters after obtaining the new current value, allowing other data processing terminals in the email synchronization system to operate on the unlocked configuration parameters.

[0106] In one scenario, the target program can execute step 25 before executing step 23; or it can execute step 25 after executing step 23 or step 24; or it can execute steps 23 and 25 in parallel.

[0107] In one embodiment, after the target program determines its currently selected first shard, in order to avoid other data processing terminals in the email synchronization system also selecting the first shard and thus processing users in the first shard, thereby wasting computing resources, the target program locks the first shard after determining its currently selected first shard. Then, it performs email synchronization (i.e., email synchronization processing) on ​​users in the first shard whose corresponding synchronization time meets the preset email synchronization conditions, until there are no users in the first shard whose corresponding synchronization time meets the preset email synchronization conditions. Then, it releases the first shard and reselects the shard to be processed from multiple shards, that is, it re-executes step 21 to obtain the current value of the configuration parameters and executes the subsequent steps.

[0108] In another implementation, in order to ensure that all users in each segment can be processed, that is, to perform email synchronization processing, after the target program determines the first segment it currently selects, it can then proceed to step 31: lock the first segment and set the corresponding lock duration; accordingly, step S210 may include: if it is determined that the current time is within the time range corresponding to the lock duration, obtain the first user identifier from the first segment.

[0109] In this implementation, after locking the first segment, a corresponding lock duration is set. If the current time is within the time range corresponding to the lock duration, the first user identifier is obtained from the first segment, and subsequent processes are executed. If the current time is not within the time range corresponding to the lock duration, i.e., the locking time of the first segment exceeds the corresponding lock duration, the target program releases the first segment and reselects the segment to be processed from multiple segments, i.e., re-executes step 21 to obtain the current value of the configuration parameters and subsequent steps. This is to avoid the situation where the processing time of the first segment is too long, causing other segments (users in them) to not be processed in time.

[0110] The lock duration can be set according to the actual scenario; for example, the lock duration can be set to 30 seconds.

[0111] After the target program obtains the first user identifier, in step S220, it obtains the first synchronization information corresponding to the first user based on the first user identifier. The first synchronization information includes information representing the latest email synchronized when the first user's emails were last synchronized from the first mailbox to the second mailbox.

[0112] In one implementation, the first synchronization information corresponding to the first user is stored in a designated data storage space. In this step, after the target program obtains the first user identifier, it can read the first synchronization information corresponding to the first user from the designated data storage space based on the first user identifier.

[0113] Then in step S230, the second synchronization information corresponding to the first user is obtained from the first email client. The second synchronization information includes information representing the latest emails stored by the first email client for the first user.

[0114] In one embodiment, to better ensure the security of user emails, in step S230, the target program can obtain the second synchronization information corresponding to the first user from the first mailbox based on the first synchronization information corresponding to the first user. Specifically, the target program can send the first synchronization information corresponding to the first user to the first email address. The first email address receives the first synchronization information corresponding to the first user. To ensure the security of the first user's emails, the first email address needs to verify the first user by comparing the received first synchronization information corresponding to the first user with the locally stored synchronization information corresponding to the first user (i.e., the information stored in the first email address that represents the latest email synchronized when the first user's emails were last synchronized from the first email address to the second email address, referred to as the third synchronization information). If the comparison result shows that the received first synchronization information corresponding to the first user is the same as the locally stored third synchronization information corresponding to the first user, then the verification is considered successful, and the second synchronization information corresponding to the first user is sent to the target program. Accordingly, the target program retrieves the second synchronization information corresponding to the first user from the first email address. If the comparison result shows that the received first synchronization information corresponding to the first user is different from the locally stored third synchronization information corresponding to the first user, the first email address can send a message indicating an error to the target program, but will not send the second synchronization information corresponding to the first user to the target program.

[0115] In one implementation, after the target program receives an error message from the first email client indicating that an error has occurred, to prevent the first user from being unable to synchronize their emails from the first email client to the second email client, the first user can be notified so that the first user can actively subscribe to the email synchronization service (also known as the email change push service) from the first email client again. This allows the first email client to synchronize the first user's emails to the second email client, and the first user can then view their latest emails from the second email client.

[0116] After the target program obtains the first synchronization information and the second synchronization information of the first user, in step S240, it determines whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox based on the first synchronization information and the second synchronization information.

[0117] In one embodiment, step S240 may include the following steps 41-42: In step 41, the target program compares the first synchronization information and the second synchronization information to obtain a comparison result; then in step 42, based on the comparison result, it is determined whether the first mailbox contains the first email.

[0118] Understandably, the first user's first synchronization information includes information representing the latest email synchronized when the first user's emails were last synchronized from the first mailbox to the second mailbox, such as including the first cursor identifier value (also called cursor historyID). The first user's second synchronization information includes information representing the latest emails stored by the first mailbox for the first user, such as including the second cursor identifier value. If the first mailbox receives a new email for the first user after the first user's last email synchronization, then the second cursor identifier value included in the second synchronization information is greater than the first cursor identifier value included in the first synchronization information. Conversely, if the first mailbox does not receive a new email for the first user after the first user's last email synchronization, then the first user's second cursor identifier value is equal to the first cursor identifier value.

[0119] Therefore, the target program compares the first synchronization information and the second synchronization information to obtain the comparison result; and based on the comparison result, it determines whether the first mailbox contains the first email, so as to relatively accurately determine whether the first mailbox contains the first email for the first user that has not been synchronized to the second mailbox, thus ensuring the efficiency and accuracy of email synchronization.

[0120] In one implementation, if the comparison result indicates that the first cursor identifier value is less than the second cursor identifier value, meaning that the first mailbox received a new email for the first user after the first user's latest email synchronization, it can be determined that the first mailbox contains a first email for the first user that was not synchronized to the second mailbox, and step S250 is then executed. This implementation can accurately determine whether the first mailbox contains a first email for the first user that was not synchronized to the second mailbox, ensuring the efficiency and accuracy of email synchronization.

[0121] In another implementation, if the comparison result indicates that the first cursor identifier value equals the second cursor identifier value, meaning that the first mailbox has not received any new emails for the first user since the first user's latest email synchronization, then it is determined that the first mailbox does not contain any emails for the first user that have not been synchronized to the second mailbox. To save computational resources, the target program can continue to obtain the user identifiers of other users who need to synchronize emails (whose synchronization time meets the preset email synchronization conditions) from the first segment, and perform subsequent email synchronization processes for these other users.

[0122] In another implementation, if the comparison result indicates that the first cursor identifier value is greater than the second cursor identifier value, it is determined that the first synchronization information corresponding to the first user may contain errors, and an error alert is output accordingly. Outputting this error alert reminds staff that if the first cursor identifier value is greater than the second cursor identifier value, the email synchronization system may be experiencing an anomaly, allowing staff to maintain the email synchronization system promptly and ensure the smooth execution of the email synchronization process.

[0123] If the target program determines that the first mailbox contains the first email, then in step S250, it requests the first mailbox to synchronize the first email to the second mailbox.

[0124] In one embodiment, step S250 may specifically include the following steps: the target program sends a subscription request for the email synchronization service to the first mailbox, so that the first mailbox synchronizes the first email to the second mailbox. In this implementation, the target program sends a subscription request for the email synchronization service to the first mailbox, so that the first mailbox can promptly synchronize the first email to the second mailbox, and further, after detecting newly acquired emails for the first user, it can promptly synchronize them to the second mailbox, thereby improving the user experience and achieving timely email synchronization for the user.

[0125] In another embodiment, step S250 may further include the following steps: if an unauthorized subscription request is detected, retrieve the first email from the first mailbox and synchronize the retrieved first email to the second mailbox. In this implementation, if an unauthorized subscription request is detected, meaning the first user's email synchronization service has not been successfully subscribed to, in order to ensure that the first user's emails are synchronized from the first mailbox to the second mailbox so that the first user can view their new emails in the second mailbox, the target program, after determining that the first user has authorized the email synchronization system (i.e., the email synchronization system can retrieve the first user's emails from the first mailbox), retrieves the first email from the first mailbox and synchronizes the retrieved first email to the second mailbox.

[0126] In this embodiment, the target program can actively probe the first mailbox, that is, actively detect whether the first mailbox contains emails for users who need to synchronize emails that have not been synchronized to the second mailbox. Then, if it is determined that the first mailbox contains such emails, it requests the first mailbox to synchronize the corresponding emails to the second mailbox, so as to achieve better email synchronization and improve the timeliness of email synchronization to a certain extent.

[0127] Furthermore, in the above process, when there are multiple data processing terminals in the email synchronization system, these terminals can perform email synchronization processing on users in each segment in parallel, which can improve email synchronization efficiency to a certain extent and better improve the timeliness of email synchronization for each user who needs to synchronize their emails.

[0128] The foregoing description describes specific embodiments of this disclosure; other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than those shown in the embodiments, and the desired result may still be achieved. Furthermore, the processes depicted in the drawings do not necessarily need to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0129] Corresponding to the above method embodiments, this disclosure provides an email synchronization device 300, the schematic block diagram of which is shown below. Figure 3 As shown, used to execute Figure 2 The method shown, wherein the apparatus 300 includes:

[0130] The first acquisition module 310 is configured to acquire the first user identifier of the first user whose email needs to be synchronized.

[0131] The second acquisition module 320 is configured to acquire first synchronization information corresponding to the first user based on the first user identifier, wherein the first synchronization information includes information representing the latest email synchronized by the first user when the email was last synchronized from the first mailbox to the second mailbox.

[0132] The third acquisition module 330 is configured to acquire second synchronization information corresponding to the first user from the first email client. The second synchronization information includes information representing the latest emails stored by the first email client for the first user.

[0133] The first determining module 340 is configured to determine, based on the first synchronization information and the second synchronization information, whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox.

[0134] The request module 350 is configured to request the synchronization of the first email to the second email if it is determined that the first email contains the first email.

[0135] In one optional implementation, the first acquisition module 310 is specifically configured to acquire the first user identifier from the currently selected first segment, wherein the first segment is determined from a plurality of segments, and any one of the plurality of segments contains user identifiers of a plurality of users who need to synchronize emails.

[0136] In one optional implementation, the first shard further includes the synchronization time corresponding to the first user, wherein the synchronization time is the time of the latest synchronization of the first user's emails from the first mailbox to the second mailbox, and the synchronization time corresponding to the first user satisfies a preset email synchronization condition.

[0137] In one alternative implementation, it further includes:

[0138] The fourth acquisition module (not shown in the figure) is configured to acquire the current value of the configuration parameters before acquiring the first user identifier from the currently selected first segment;

[0139] Add a module (not shown in the figure) configured to determine the target value based on the current value;

[0140] The second determining module (not shown in the figure) is configured to determine the first fragment identifier of the currently selected first fragment using the target value and the current number of fragments;

[0141] The third determining module (not shown in the figure) is configured to determine the first fragment based on the first fragment identifier.

[0142] In one alternative implementation, it further includes:

[0143] The locking setting module (not shown in the figure) is configured to lock the first segment before obtaining the first user identifier from the currently selected first segment, and set the corresponding locking duration.

[0144] The first acquisition module 310 is specifically configured to acquire the first user identifier from the first segment when it is determined that the current time is within the time range corresponding to the lock duration.

[0145] In one optional implementation, it further includes: an update module (not shown in the figure), configured to update the current value update of the configuration parameter based on the target value, so as to obtain a new current value of the configuration parameter.

[0146] In one alternative implementation, it further includes:

[0147] The fifth acquisition module (not shown in the figure) is configured to obtain the user identifiers of each user whose emails need to be synchronized from the specified data storage space.

[0148] The fourth determination module (not shown in the figure) is configured to use a preset hash algorithm to determine the shard to which each user belongs based on the user's identifier and the current number of shards.

[0149] The storage module (not shown in the figure) is configured to store each user's user identifier in its respective shard.

[0150] In one optional implementation, the first determining module 340 is specifically configured to compare the first synchronization information and the second synchronization information to obtain a comparison result;

[0151] Based on the comparison results, it is determined whether the first email address contains the first email.

[0152] In one optional implementation, the first synchronization information includes a first cursor identifier value, and the second synchronization information includes a second cursor identifier value;

[0153] The first determining module 340 is specifically configured to determine that the first email contains the first email if the comparison result indicates that the first cursor identifier value is less than the second cursor identifier value.

[0154] In one optional implementation, the first determining module 340 is further configured to output an abnormality alert if the comparison result indicates that the first cursor identifier value is greater than the second cursor identifier value.

[0155] In one optional implementation, the request module 350 is specifically configured to send a subscription request for the email synchronization service to the first email client, so that the first email client synchronizes the first email to the second email client.

[0156] In one optional implementation, the request module 350 is further configured to, if it detects that the subscription request is not authorized, retrieve the first email from the first email address and synchronize the retrieved first email to the second email address.

[0157] The above-described apparatus embodiments correspond to the method embodiments, and detailed descriptions can be found in the description of the method embodiments section, which will not be repeated here. The apparatus embodiments are derived based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments; detailed descriptions can be found in the corresponding method embodiments.

[0158] This disclosure provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements... Figure 2 The method shown below. See below for reference. Figure 4It shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0159] like Figure 4 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the electronic device. The processing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0160] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively. Figure 4 Each box shown can represent a device or multiple devices as needed.

[0161] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 409, or installed from a storage device 408, or installed from a ROM 402. When the computer program is executed by a processing device 401, it performs the functions defined in the methods of embodiments of this disclosure.

[0162] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the functions provided in this disclosure, such as those described in this disclosure. Figure 2 The method shown.

[0163] It should be noted that the computer-readable medium described in the embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the embodiments of this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the embodiments of this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (Radio Frequency), etc., or any suitable combination thereof.

[0164] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: obtain a first user identifier of a first user whose emails need to be synchronized; based on the first user identifier, obtain first synchronization information corresponding to the first user, wherein the first synchronization information includes information representing the latest email synchronized during the most recent synchronization of the first user's emails from the first mailbox to the second mailbox; obtain second synchronization information corresponding to the first user from the first mailbox, wherein the second synchronization information includes information representing the latest emails stored by the first mailbox for the first user; based on the first synchronization information and the second synchronization information, determine whether the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox; if it is determined that the first mailbox contains the first email, request the first mailbox to synchronize the first email to the second mailbox.

[0165] Computer program code for performing the operations of embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0166] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for storage media and computing devices are basically similar to the method embodiments, so they are described more simply; relevant parts can be referred to the descriptions of the method embodiments.

[0167] Those skilled in the art will recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0168] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, or improvements made based on the technical solutions of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for email synchronization, comprising: Get the first user identifier of the first user whose emails need to be synchronized; Based on the first user identifier, obtain the first synchronization information corresponding to the first user, wherein the first synchronization information includes a first cursor identifier value, and the first cursor identifier value represents the information of the latest email synchronized when the first user's email is synchronized from the first mailbox to the second mailbox. The first synchronization information is sent to the first email client so that the first email client can verify the first synchronization information against the third synchronization information corresponding to the first user stored locally on the first email client. The third synchronization information is the synchronization information of the latest synchronized email stored locally for the first user. If the verification is successful, the second synchronization information corresponding to the first user is obtained from the first email client. The second synchronization information includes a second cursor identifier value, which represents the information of the latest email stored by the first email client for the first user. The first synchronization information and the second synchronization information are compared to obtain the comparison result; If the comparison result indicates that the first cursor identifier value is less than the second cursor identifier value, then it is determined that the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox; if it is determined that the first mailbox contains the first email, a subscription request for the email synchronization service is sent to the first mailbox so that the first mailbox synchronizes the first email to the second mailbox. If the subscription request of the first user is detected to be unauthorized, the email synchronization system retrieves the first email from the first mailbox and synchronizes the retrieved first email to the second mailbox. The email synchronization system includes one or more data processing terminals, data storage space, and shard set.

2. The method as described in claim 1, wherein, The step of obtaining the first user identifier of the first user whose emails need to be synchronized includes: Obtain the first user identifier from the currently selected first shard, wherein the first shard is determined from a plurality of shards, and any one of the plurality of shards contains user identifiers of a plurality of users who need to synchronize emails.

3. The method as described in claim 2, wherein the first shard further includes the synchronization time corresponding to the first user, wherein, The synchronization time is the time of the latest synchronization of the first user's emails from the first mailbox to the second mailbox, and the synchronization time corresponding to the first user meets the preset email synchronization conditions.

4. The method of claim 2, further comprising, before obtaining the first user identifier from the currently selected first segment: Get the current value of the configuration parameter; Based on the current value, determine the target value; Using the target value and the current number of fragments, the first fragment identifier of the currently selected first fragment is determined; The first fragment is determined based on the first fragment identifier.

5. The method of claim 4, further comprising, before obtaining the first user identifier from the currently selected first segment: The first segment is locked, and a corresponding locking duration is set. Obtaining the first user identifier from the currently selected first segment includes: If it is determined that the current time is within the time range corresponding to the lock duration, the first user identifier is obtained from the first segment.

6. The method of claim 4, further comprising: Based on the target value, update the current value of the configuration parameter to obtain a new current value for the configuration parameter.

7. The method of claim 2, further comprising: Retrieve the user identifiers of each user whose emails need to be synchronized from the specified data storage space; Using a preset hash algorithm, the shard to which each user belongs is determined based on the user's identifier and the current number of shards. Each user's identifier is stored in its respective shard.

8. The method of claim 7, further comprising: If the comparison result indicates that the first cursor identifier value is greater than the second cursor identifier value, an anomaly alert message will be output.

9. An email synchronization device, comprising: The first acquisition module is configured to acquire the first user identifier of the first user whose emails need to be synchronized. The second acquisition module is configured to acquire first synchronization information corresponding to the first user based on the first user identifier, wherein the first synchronization information includes a first cursor identifier value, and the first cursor identifier value represents the information of the latest email synchronized by the first user when the email was last synchronized from the first mailbox to the second mailbox. The third acquisition module is configured to send the first synchronization information to the first mailbox, so that the first mailbox verifies the first synchronization information against the third synchronization information corresponding to the first user stored locally on the first mailbox. The third synchronization information is the synchronization information of the latest synchronized email stored locally for the first user. If the verification is successful, the module acquires the second synchronization information corresponding to the first user from the first mailbox. The second synchronization information includes a second cursor identifier value, which represents the information of the latest email stored by the first mailbox for the first user. The first determining module is configured to compare the first synchronization information and the second synchronization information to obtain a comparison result; if the comparison result indicates that the first cursor identifier value is less than the second cursor identifier value, then it is determined that the first mailbox contains a first email for the first user that has not been synchronized to the second mailbox; the request module is configured to, if it is determined that the first mailbox contains the first email, send a subscription request for the email synchronization service to the first mailbox so that the first mailbox synchronizes the first email to the second mailbox; if it is detected that the subscription request for the first user is not authorized, the email synchronization system obtains the first email from the first mailbox and synchronizes the obtained first email to the second mailbox, wherein the email synchronization system includes one or more data processing terminals, a data storage space, and a shard set.

10. An electronic device comprising a memory and a processor, wherein, The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Data synchronization method, servers and distributed system

    CN103379129A

  • Supply chain visualization and control

    CN119585752A