Data processing method, device, electronic device and storage medium
Through account association and data synchronization, the problem of complex user experience caused by users frequently logging in to their accounts is solved, simplifying login and improving the reliability of data processing.
Patent Information
- Application Number
- CN202110566319.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-05-24
AI Technical Summary
Users need to frequently log in to various accounts when using multiple Internet products, resulting in a complicated and time-consuming user experience, which affects the user experience.
By obtaining the data synchronization request, the account association list is traversed to determine whether the second application contains a second account associated with the first account, and if the account association list contains the second account, the second account is synchronized based on the data to be synchronized. The data in the second application is synchronized to achieve account association and data synchronization.
It simplifies the user login process, saves user time, and improves the reliability of data processing and user experience.
Smart Images

Figure CN113407356B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] At present, with the rapid development of the Internet, when users use Internet products, they need to log in to their accounts in the Internet products to process data. This results in users having to log in to their accounts in each Internet product one by one when using multiple Internet products. This is not only cumbersome and complicated, but also a waste of time and the user experience is poor.
[0003] Therefore, how to make it convenient for users to use Internet products is the key to current research. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the first purpose of the present disclosure is to propose a data processing method, which not only facilitates users to use the product and saves users' time, but also improves the reliability of data processing, thereby improving the user's experience.
[0006] A second objective of the present disclosure is to provide a data processing device.
[0007] A third objective of the present disclosure is to provide an electronic device.
[0008] A fourth objective of the present disclosure is to provide a computer-readable storage medium.
[0009] A fifth object of the present disclosure is to provide a computer program product.
[0010] To achieve the above-mentioned purpose, an embodiment of the first aspect of the present disclosure proposes a data processing method, including: obtaining a data synchronization request sent by a first application, wherein the data synchronization request includes a first account of a user in the first application and data to be synchronized; traversing an account association list to determine whether a second application includes a second account associated with the first account; and when the second account is included in the account association list, synchronizing the data of the second account in the second application based on the data to be synchronized.
[0011] In addition, the data processing method according to the above embodiment of the present disclosure may also have the following additional technical features:
[0012] According to one embodiment of the present disclosure, the data synchronization request is a data upload request, and synchronizing the data of the second account in the second application based on the data to be synchronized includes: determining the data type corresponding to the second application; and when the type of the data to be synchronized matches the data type corresponding to the second application, associating the data to be synchronized with the second account.
[0013] According to an embodiment of the present disclosure, the data synchronization request is a data deletion request, and synchronizing the data of the second account in the second application based on the data to be synchronized includes: traversing the associated data sets of the second account in the second application based on the data to be synchronized; and deleting the data to be synchronized from the associated data sets when the data to be synchronized is included in the associated data sets.
[0014] According to an embodiment of the present disclosure, traversing the account association list to determine whether the second application includes the second account associated with the first account includes: traversing the account association list stored in the cache area to determine whether the second application includes the second account associated with the first account.
[0015] According to an embodiment of the present disclosure, the data processing method further includes: synchronizing the account association list in the cache area with the account association list in the database at a preset frequency.
[0016] According to an embodiment of the present disclosure, the data processing method further includes: obtaining an account processing request, wherein the account processing request is a binding request or an unbinding request, and the account processing request includes a first account and a second account; according to the account processing request, associating and storing the first account and the second account in an account association list in the database, or deleting the first account and the second account associated and stored in the account association list in the database.
[0017] According to an embodiment of the present disclosure, the data processing method further includes: monitoring the log file of the database; when it is monitored that the log file contains update information, synchronizing the update status of the associated account in the update information to the cache area.
[0018] According to an embodiment of the present disclosure, after traversing the account association list to determine whether the second application includes the second account associated with the first account, it also includes: if the second account is not included in the account association list, sending a user information acquisition request to the first application; acquiring user information corresponding to the first account returned by the first application; querying the user information library corresponding to the second application to acquire the second account corresponding to the user information in the second application; and associating the first account and the second account in the account association list.
[0019] To achieve the above-mentioned purpose, the second aspect embodiment of the present disclosure proposes a data processing device, including: a first acquisition module, configured to execute acquisition of a data synchronization request sent by a first application, wherein the data synchronization request includes a first account of a user in the first application and data to be synchronized; a first determination module, configured to execute traversal of an account association list to determine whether the second application contains a second account associated with the first account; and a synchronization module, configured to execute synchronization of the data of the second account in the second application based on the data to be synchronized when the second account is included in the account association list.
[0020] In addition, the data processing device according to the above embodiment of the present disclosure may also have the following additional technical features:
[0021] According to one embodiment of the present disclosure, the data synchronization request is a data upload request, and the synchronization module is specifically configured to execute: determining the data type corresponding to the second application; and associating the data to be synchronized with the second account when the type of the data to be synchronized matches the data type corresponding to the second application.
[0022] According to one embodiment of the present disclosure, the data synchronization request is a data deletion request, and the synchronization module is specifically configured to execute: based on the data to be synchronized, traversing the associated data set of the second account in the second application; and if the data to be synchronized is included in the associated data set, deleting the data to be synchronized from the associated data set.
[0023] According to an embodiment of the present disclosure, the first determination module is specifically configured to: traverse the user account pairs stored in the cache area to determine whether the second application includes a second account associated with the first account.
[0024] According to an embodiment of the present disclosure, the synchronization module is further specifically configured to execute: synchronizing the account association list in the cache area with the account association list in the database at a preset frequency.
[0025] According to one embodiment of the present disclosure, it further includes:
[0026] A second acquisition module is configured to execute an acquisition account processing request, wherein the processing request is a binding request or an unbinding request, and the processing request includes a first account and a second account;
[0027] The first updating module is configured to execute, according to the account processing request, storing the first account and the second account in association with each other in the account association list in the database, or deleting the first account and the second account stored in association with each other in the account association list in the database.
[0028] According to one embodiment of the present disclosure, it further includes:
[0029] A first monitoring module is configured to monitor the log files of the database;
[0030] The second updating module is configured to execute, when it is monitored that the log file contains update information, synchronizing the update status of the associated account in the update information to the cache area.
[0031] According to one embodiment of the present disclosure, it further includes:
[0032] A first sending module is configured to send a user information acquisition request to the first application when the second account is not included in the account association list;
[0033] A third acquisition module is configured to execute acquisition of user information corresponding to the first account returned by the first application;
[0034] A second determining module is configured to query a user information database corresponding to the second application to obtain a second account corresponding to the user information in the second application;
[0035] The first association module is configured to execute in the account association list to associate the first account with the second account.
[0036] To achieve the above-mentioned purpose, the third aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to call and execute the executable instructions stored in the memory to implement the data processing method proposed in the first aspect embodiment of the present disclosure.
[0037] To achieve the above-mentioned objectives, the fourth aspect embodiment of the present disclosure proposes a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the data processing method proposed in the first aspect embodiment of the present disclosure.
[0038] To achieve the above-mentioned purpose, the fifth aspect of the present disclosure proposes a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to execute the data processing method proposed in the first aspect of the present disclosure.
[0039] The technical solution of the disclosed embodiment is to obtain a data synchronization request sent by a first application, wherein the data synchronization request includes a first account of a user in the first application and data to be synchronized; traverse the account association list to determine whether a second application includes a second account associated with the first account; if the second account is included in the account association list, synchronize the data of the second account in the second application based on the data to be synchronized. Thus, based on the association of the two accounts, the data of the second account in the second application can be synchronized according to the data to be synchronized in the data synchronization request, which not only facilitates the user to use the product and saves the user's time, but also improves the reliability of data processing, thereby improving the user's experience.
[0040] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a flow chart of a data processing method according to an embodiment of the present disclosure;
[0042] Figure 2 is a flow chart of updating an account association list in a database according to an embodiment of the present disclosure;
[0043] Figure 3 is a flow chart of updating an account association list in a cache area according to an embodiment of the present disclosure;
[0044] Figure 4 is a flow chart of a data processing method according to an example of the present disclosure;
[0045] Figure 5 is a schematic diagram of user account binding according to an example of the present disclosure;
[0046] Figure 6 is a structural block diagram of a data processing device according to an embodiment of the present disclosure;
[0047] Figure 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0048] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0049] The present disclosure mainly considers that when users currently use Internet products, they need to log in to their accounts in the Internet products to perform corresponding operations under any circumstances, which increases the complexity of users' use of the products and the problem of poor user experience, and proposes a data processing method, device, electronic device and storage medium.
[0050] The data processing method proposed in the present disclosure synchronizes the data of the second account in the second application according to the data to be synchronized in the data synchronization request on the basis of the association between the two accounts. This not only facilitates the user to use the product and saves the user's time, but also improves the reliability of data processing, thereby improving the user's experience.
[0051] The data processing method, device, electronic device, and storage medium of the embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0052] Figure 1 It is a flowchart of a data processing method according to an embodiment of the present disclosure. The execution subject may be an electronic device. Specifically, the electronic device may be but not limited to a computer or a mobile terminal. The mobile terminal may be but not limited to a personal computer, a smart phone, an IPAD, etc.
[0053] It should be noted that the embodiments of the present disclosure process data under an account associated with an application (hereinafter referred to as the first application) through the user's account in one application (hereinafter referred to as the first application), wherein the user's account in the first application is called the first account, and the account is unique, and the user's account in the second application that is associated with the first account is called the second account, and the account is also unique.
[0054] like Figure 1 As shown, the data processing method includes the following steps S101 to S103.
[0055] S101, obtaining a data synchronization request sent by a first application, wherein the data synchronization request includes a first account of a user in the first application and data to be synchronized.
[0056] The user can trigger the first application action through the first client corresponding to the first application, that is, send a data synchronization request. The data to be synchronized in the data synchronization request can be data generated by the first application according to the needs of the user, which is used to indicate how to process the data (also called associated data) belonging to the second account of the user in the second application.
[0057] Specifically, the first application may send a data synchronization request to the second application, and then the second application obtains the data synchronization request sent by the first application, and can obtain the user's first account in the first application and the data to be synchronized.
[0058] S102: traverse the account association list to determine whether the second application includes a second account associated with the first account.
[0059] It should be noted that the embodiment of the present disclosure can establish an account association list in advance, that is, a unique index of the user's first account in the first application and the user's second account in the second application can be established at the database level to ensure that the first account and the second account are bound one-to-one.
[0060] Specifically, after obtaining the first account of the user in the first application and the data to be synchronized, the second application can traverse and query the account association list to determine whether there is a second account associated with the first account in the second application.
[0061] S103: When the account association list includes the second account, synchronize the data of the second account in the second application based on the data to be synchronized.
[0062] Specifically, when it is determined that the account association list includes the second account, the data to be synchronized can be synchronized to the data of the second account in the second application. According to the above steps S101 to S103, when the user needs to process the data of the second application through the first application, the first account in the first application can be used to perform corresponding operations in the first client corresponding to the first application, and then the first application generates a data synchronization request according to the user's instructions, wherein the data synchronization request carries the first account and the data to be synchronized, and sends the data synchronization request to the second application. After the second application receives the data synchronization request, it can traverse and query the account association list to determine whether the second application contains the second account associated (bound) with the first account. If the account association list contains the second account associated with the first account, the data of the second account in the second application can be synchronized based on the data to be synchronized.
[0063] That is to say, when the second account is associated with the first account, the user can perform corresponding operations on the first client corresponding to the first application through the first account in the first application, and the data of the second account in the second application can be processed accordingly to meet the user's usage needs. Specifically, when the account in the first application is associated (bound) with the account in the second application, when the user needs to synchronize the data associated with the second account, the user can trigger the first application to send a data synchronization request to the second application. After the second application obtains the first account and the data to be synchronized in the data synchronization request, it traverses and queries the account association list to determine whether the second application contains the second account associated with the first account. Afterwards, if the second account is included in the account association list, the data of the second account in the second application can be synchronized based on the data to be synchronized, so that the corresponding operation can be implemented in the second application without going through the second client corresponding to the second application, that is, the user does not need to log in to the account in the second application.
[0064] For example, when a user needs to publish a work (video, photo or text) in a second application through a first application, the user can trigger the first application to send a data synchronization request to the second application, and the data synchronization request includes the first account and the data to be synchronized, wherein the data synchronization request is to publish the work, and the data to be synchronized is the work. After the second application obtains the first account and the data (work) to be synchronized, it can query in the account association list. When the second account is found in the account association list, the second application can receive the data synchronization request to publish the work, and publish the work in the data synchronization request under the second account.
[0065] In addition, based on the binding relationship between the first account in the first application and the second account in the second application, when the second account is associated with the first account, the user can also obtain relevant information in the first application in the second application to facilitate the user's operations in the first application.
[0066] For example, if a user grabs a coupon in the second application and the coupon belongs to the first application, when the user uses the coupon in the first application, in order to avoid misuse, it is necessary to determine whether the coupon belongs to the user's first account in the first application. Therefore, the user can trigger the second application to send a data synchronization request to the first application, and the data synchronization request includes the second account and the data to be synchronized, wherein the data synchronization request can be an instruction for the first application to determine whether the coupon belongs to the first account, and the data to be synchronized can be the coupon. After the first application obtains the second account and the data to be synchronized, it queries the account association list. When the account association list contains the first account associated with the second account, it can determine whether the coupon belongs to the first account.
[0067] The data processing method of the disclosed embodiment, when a first account is associated with a second account, can synchronize the data of the second account in the second application according to the data to be synchronized in the data synchronization request, which not only facilitates the user to use the product and saves the user's time, but also improves the reliability of data processing, thereby improving the user's experience.
[0068] In the above step S103, when synchronizing the data of the second account in the second application based on the data to be synchronized, it can be determined according to the corresponding data types of the two, or it can be determined according to the type of data processing request.
[0069] That is, in one embodiment of the present disclosure, if the data synchronization request is a data upload request, the data of the second account in the second application is synchronized based on the data to be synchronized in the above step S103, including: determining the data type corresponding to the second application, and when the type of the data to be synchronized matches the data type corresponding to the second application, associating the data to be synchronized with the second account.
[0070] Specifically, when the type of the data synchronization request is a data upload request, the data type corresponding to the second application can be determined first, and then it can be determined whether the type of the data to be synchronized matches the data type corresponding to the second application where the second account is located. If the type of the data to be synchronized matches the data type in the second application where the second account is located, the data to be synchronized can be associated with the second account. It can be understood that after receiving the data synchronization request, the second application can upload the data to be synchronized to the second account in the second application.
[0071] That is, in one embodiment of the present disclosure, if the data synchronization request is a data deletion request, the above step S103 synchronizes the data of the second account in the second application based on the data to be synchronized, including: traversing the associated data sets of the second account in the second application based on the data to be synchronized; and deleting the data to be synchronized from the associated data sets when the associated data sets contain the data to be synchronized.
[0072] Specifically, when the type of the data synchronization request is a data deletion request, the second application can determine whether the data to be synchronized in the second application belongs to the second account, that is, based on the data to be synchronized, it can traverse the associated data sets of the second account in the second application, and if the associated data sets contain the data to be synchronized, that is, the data to be synchronized belongs to the second account in the second application, then the data to be synchronized can be deleted from the associated data sets. It can be understood that after receiving the data synchronization request, the second application can delete the data to be synchronized under the second account in the second application.
[0073] For example, the data synchronization request is "Upload Picture A", that is, it is a data upload request, and the type of data to be synchronized is "Picture". If the second application determines that the type of data to be synchronized matches the data type in the second application where the second account is located, that is, the data type in the second application includes the data type "Picture", then Picture A can be uploaded to the second application.
[0074] For another example, the data synchronization request is "Delete Picture B", which is a data deletion request. Afterwards, based on the data to be synchronized, the associated data set of the second account in the second application can be traversed. If the second application determines that the associated data set contains "Picture B" to be synchronized, that is, "Picture B" belongs to the second account in the second application, then Picture B can be deleted from the associated data set, that is, Picture B can be deleted from the second account in the second application.
[0075] Therefore, the relationship between the data to be synchronized and the second account is determined according to the type of data synchronization request, the type of data to be synchronized and the data type to which the second account belongs, thereby further improving the effectiveness and reliability of relationship determination and further improving the reliability of data processing.
[0076] It is understandable that there are usually multiple user accounts in the first application, and the multiple user accounts correspond one-to-one to the user accounts in the second application, thereby forming multiple one-to-one associated accounts, and then forming an account association list. It should be noted that all user accounts are stored in the database, including all associated user accounts and unassociated user accounts. It is understandable that the associated user accounts, that is, the account association list, are all stored in the database. In this case, when obtaining the second account associated with the first account, it is necessary to query the database for the second account associated with the first account.
[0077] However, in actual use, it is necessary to first query whether the user's first account in the first application is associated with the user's second account in the second application, or whether the user's second account in the second application is associated with the user's first account in the first application, and the database is not sufficient to withstand the call volume during the query. Therefore, in the embodiment of the present disclosure, the already associated user accounts, that is, the account association list, can be cached in the cache area, and then the cache area can be queried whether there is a second account associated with the first account.
[0078] That is, in one embodiment of the present disclosure, traversing the account association list in the above step S102 to determine whether the second application includes the second account associated with the first account may include: querying the account association list stored in the cache area to determine whether the second application includes the second account associated with the first account.
[0079] Specifically, since the account association list is stored in the cache area, the second application can query the account association list stored in the cache area after obtaining the first account. If the user account corresponding to the first account is queried in the account association list, the second account in the account association list is obtained, and the second account associated with the first account can be obtained.
[0080] In the case where part of the account association list is stored in the cache area, if the associated account corresponding to the first account is not found in the cache area, it is necessary to query the account association list stored in the database. If the associated account corresponding to the first account is found in the database, the associated account can be stored in the cache area for call when needed; if the associated account corresponding to the first account is not found in the database, an empty association relationship can be written into the cache area to prevent cache penetration.
[0081] When the entire account association list is stored in the cache area, if the associated account corresponding to the first account is not found in the cache area, the second application can obtain the user information corresponding to the first account from the first application, and query the database based on the user information to determine the user's second account in the second application. Thereafter, the first account and the second account are associated with each other, and the associated account can be stored in the cache area for call when needed.
[0082] As described above, the account association list can be partially stored in the cache area, or it can be cached in its entirety in the cache area. When partially stored, a large number of empty association relationships (binding relationships) will exist in the cache area, resulting in a large amount of useless data in the cache area. When the account association list is stored in its entirety in the cache area, a large amount of useless data can be avoided. Therefore, the embodiment of the present disclosure stores all the account association lists in the cache area. In order to store all the account association lists in the cache area, the account association lists in the cache area can be synchronized with the account association lists in the database in real time, or the account association lists in the cache area can be periodically synchronized with the account association lists in the database at a certain time interval, or the account association list labels in the cache area can be synchronized with the account association lists in the database at a preset frequency.
[0083] That is, in an example of the present disclosure, the data processing method may further include: synchronizing the account association list in the cache area with the account association list in the database at a preset frequency.
[0084] The preset frequency may be determined according to a general update frequency of the database, for example, may be 10 Hz (Hertz).
[0085] For example, when the preset frequency is 10 Hz, 10 synchronization actions are performed every 1 second, that is, the account association list in the cache area is synchronized with the account association list in the database, thereby ensuring that all user-associated accounts and account association lists in the database are stored in the cache area.
[0086] Therefore, all account association lists in the database are stored in the cache area, and the account association lists in the cache area are kept synchronized with the account association lists in the database, which can ensure the accuracy and completeness of the account association lists in the cache area, and there will be no large amount of useless data, and no cache penetration caused by multiple returns to the source database, thereby improving query efficiency.
[0087] That is, the account association list in the database is updated synchronously with the account association list in the cache area. For example, when a user account is added to the database, the added user account and its associated accounts are stored in the cache area. The user's trigger action on the client can start the update program of the account association list in the database.
[0088] That is Figure 2 As shown, the data processing method provided by an example of the present disclosure may also include the following steps S201 and S202 to update the account association list in the database.
[0089] S201, obtaining an account processing request, wherein the processing request is a binding request or an unbinding request, and the account processing request includes a first account and a second account.
[0090] The account processing request may be generated based on a user's request action on the client. For example, when the user clicks the "bind" or "unbind" button next to the user account on the client, the first application generates a processing request for the account and may send the account processing request to the second application.
[0091] S202: According to the account processing request, the first account and the second account are stored in association in the account association list in the database, or the first account and the second account stored in association in the account association list in the database are deleted.
[0092] Specifically, after the second application obtains the account binding request, it binds the user's first account in the first application with the second account in the second application according to the account binding request, so that the first account and the second account are associated, that is, the first account and the second account are associated and stored in the account association list in the database; or, after the second application obtains the account unbinding request, it unbinds the user's first account in the first application from the second account in the second application according to the account unbinding request, so that the first account and the second account are not associated, that is, the associated stored first account and the second account are deleted in the account association list in the database, thereby updating the account association list in the database.
[0093] Therefore, the two accounts are bound and unbound according to the account processing request, and the account association list is updated, which further ensures the accuracy of the associated accounts in the account association list in the database and avoids inaccurate updates that affect user operations.
[0094] It should be noted that after the account association list in the database is updated, in order to ensure that the account association list in the database and the account association list in the cache area remain synchronized, the account association list in the cache area needs to be updated, that is, Figure 3 As shown, after updating the account association list in the database, the following steps S301 and S302 may also be included:
[0095] S301, monitor the log files of the database.
[0096] The log file of the database can record the update of the first account and the second account in each associated storage in the account association list in the database, that is, binding or unbinding. In actual use, the log file of the database can be monitored by a monitoring program to monitor the update of each associated account in the account association list in the database in real time.
[0097] S302: When the log file contains update information, the update status of the associated account in the update information is synchronized to the cache area.
[0098] According to the monitored update log information, if there is a new account binding or unbinding, the cache account association list is updated in time to keep the account association list in the database and the account association list in the cache synchronized. Therefore, when the account association list in the database is updated, the account association list in the cache is updated accordingly, ensuring the accuracy and reliability of the association of each associated account in the cache, and avoiding the phenomenon that the associated accounts in the database and the cache are out of sync and affect user operations.
[0099] The above step S103 describes what action the second application performs when the second account associated with the first account is obtained in the embodiment of the present disclosure. In another embodiment of the present disclosure, the second application may not obtain the second account associated with the first account in the second application in the cache area. In this case, in order to facilitate the user to continue the operation, there is no need to exit the current program, but to perform the following steps: Figure 4 Action shown.
[0100] like Figure 4 As shown, in another embodiment of the present disclosure, the data processing method may further include the following steps S401 to S406:
[0101] S401, obtaining a data synchronization request sent by a first application, wherein the data synchronization request includes a first account of a user in the first application and data to be synchronized.
[0102] The step S401 corresponds to the above step S101, so it will not be described again here.
[0103] S402: traverse the account association list to determine whether the second application includes a second account associated with the first account.
[0104] S403: If the account association list does not include the second account associated with the first account, send a user information acquisition request to the first application.
[0105] Among them, user information may include the user's account number, the user's gender, height, weight, and zodiac sign, etc.
[0106] Specifically, when the second application fails to obtain the second account associated with the first account in the cache area, the second application sends a user information acquisition request to the first application, so that the first application sends the user information corresponding to the first account to the second application.
[0107] S404: Obtain user information corresponding to the first account returned by the first application.
[0108] S405: Query a user information database corresponding to the second application to obtain a second account corresponding to the user information in the second application.
[0109] S406: In the account association list, the first account and the second account are associated and stored.
[0110] Specifically, after obtaining the user information corresponding to the first account, the database can be queried according to the user information to query the second account of the user in the second application in the database. The second account and the first account are the accounts that need to be bound, so the first account and the second account are associated and stored, that is, bound, to form an account association list. Afterwards, the account association list can be stored in the cache area for subsequent calls.
[0111] S407, in a case where a second account associated with the first account is obtained, responding to the data synchronization request, processing the data associated with the second account based on the data to be synchronized, wherein the second account is a user account of the user in the second application.
[0112] Specifically, after the first account is bound to the second account and stored in the cache area, the second account can be obtained when the second account is obtained in the cache area again, so as to respond to the data synchronization request and synchronize the data associated with the second account based on the data to be synchronized.
[0113] Therefore, when the account associated with the first account is not obtained in the account association list, the second account associated with the first account in the second application can be determined according to the user information, so as to obtain the second account for corresponding data processing, thereby ensuring the reliability of user operations and avoiding the inability to perform corresponding operations due to the inability to query the associated account.
[0114] In order to more clearly describe the data processing method of the embodiment of the present disclosure, Figure 5 Describe the user account binding process in the data processing method.
[0115] like Figure 5 As shown, a binding interface is provided to the second application, and a unique index of the user's id in the first application and the user's id in the second application is established from the database level to ensure that the user's id in the first application and the user's id in the second application are uniquely corresponding. If multiple user accounts are bound, an error will be reported, and repeated binding will be treated as successful. The cache stores all data, and the binding database will be updated when a new account is bound or unbound. The binlog (binary log) of the database table is monitored through the program to update the associated accounts in the account association list of the cache in real time. At the same time, a scheduled task is started to poll the account association list in the database to update the binding relationship in the cache. This can ensure the accuracy of the data in the cache, and there will be no large amount of useless data, and no cache penetration (because this method does not return to the source database). Data that cannot be read in the cache is considered to be in a non-binding state.
[0116] Among them, when updating each associated account in the cache area, the id in the first application can be used as the key (keyword) and the id in the second application as the value (value), or the id in the second application can be used as the key and the id in the first application as the value to bind or unbind the associated account, so that when querying the associated accounts in the cache area, positive query and reverse query are supported, thereby improving query efficiency.
[0117] The present disclosure also provides a data processing device. Figure 6 It is a structural block diagram of a data processing device according to an embodiment of the present disclosure.
[0118] like Figure 6 As shown, the data processing device 100 includes: a first acquisition module 110 , a first determination module 120 and a synchronization module 130 .
[0119] Among them, the first acquisition module 110 is configured to execute and obtain a data synchronization request sent by the first application, wherein the data synchronization request includes the user's first account in the first application and the data to be synchronized; the first determination module 120 is configured to execute traversal of the account association list to determine whether the second application contains a second account associated with the first account; the synchronization module 130 is configured to execute, when the second account is included in the account association list, synchronization of the data of the second account in the second application based on the data to be synchronized.
[0120] In one embodiment, the data synchronization request is a data upload request, and the synchronization module 130 is specifically configured to determine the data type corresponding to the second application, and when the type of the data to be synchronized matches the data type corresponding to the second application, associate the data to be synchronized with the second account.
[0121] In one embodiment, the data synchronization request is a data deletion request, and the synchronization module 130 may be specifically configured to execute: based on the data to be synchronized, traversing the associated data set of the second account in the second application; and if the data to be synchronized is included in the associated data set, deleting the data to be synchronized from the associated data set.
[0122] In one embodiment, the first determination module 120 is specifically configured to execute: traverse the account association list stored in the cache area to determine whether the second application includes a second account associated with the first account.
[0123] In one embodiment, the synchronization module is further specifically configured to synchronize the account association list in the cache area with the account association list in the database at a preset frequency.
[0124] In one example, the data processing device 100 may further include: a second acquisition module, configured to execute an acquisition account processing request, wherein the processing request is a binding request or an unbinding request, and the processing request includes a first account and a second account; a first update module, configured to execute, according to the account processing request, associating and storing the first account and the second account in an account association list in the database, or deleting the first account and the second account associated and stored in the account association list in the database.
[0125] In one example, the data processing device 100 may also include: a first monitoring module, configured to monitor the log file of the database; a second update module, configured to synchronize the update status of the associated account in the update information to the cache area when it is monitored that the log file contains update information.
[0126] In one example, the data processing device 100 may also include: a first sending module, configured to execute a user information acquisition request to the first application when the second account is not included in the account association list; a third acquisition module, configured to execute acquisition of user information corresponding to the first account returned by the first application; a second determination module, configured to execute a query to the user information library corresponding to the second application to obtain the second account corresponding to the user information in the second application; and a first association module, configured to execute in the account association list to associate the first account and the second account.
[0127] It should be noted that the specific implementation of the data processing device can refer to the specific implementation of the above-mentioned data processing method. To avoid redundancy, it will not be described in detail here.
[0128] The data processing device of the disclosed embodiment, when the first account is associated with the second account, can synchronize the data of the second account in the second application according to the data to be synchronized in the data synchronization request, which not only facilitates the user to use the product and saves the user's time, but also improves the reliability of data processing, thereby improving the user's experience.
[0129] Figure 7 is a structural block diagram of an electronic device according to an embodiment of the present disclosure.
[0130] like Figure 7 As shown, the electronic device 200 includes: a memory 210 and a processor 220, and a bus 230 connecting different components (including the memory 210 and the processor 220).
[0131] The memory 210 is used to store executable instructions of the processor 220 ; the processor 201 is configured to call and execute executable instructions stored in the memory 202 to implement the data processing method proposed in the above embodiment of the present disclosure.
[0132] Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0133] The electronic device 200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 200, including volatile and non-volatile media, removable and non-removable media.
[0134] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The electronic device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 230 via one or more data medium interfaces. The memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0135] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in the memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 270 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0136] The electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 292. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via a network adapter 293. As shown, the network adapter 293 communicates with other modules of the electronic device 200 via a bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0137] The processor 220 executes various functional applications and data processing by running the programs stored in the memory 210 .
[0138] It should be noted that the implementation process of the electronic device of the embodiment of the present disclosure refers to the aforementioned explanation of the data processing of the embodiment of the present disclosure, which will not be repeated here.
[0139] In the electronic device of the embodiment of the present disclosure, when the processor calls and executes the executable instructions stored in the memory, when the first account is associated with the second account, the data of the second account in the second application can be synchronized according to the data to be synchronized in the data synchronization request, which not only makes it convenient for users to use the product and saves users' time, but also improves the reliability of data processing, thereby improving the user's usage experience.
[0140] In order to implement the above embodiments, the embodiments of the present disclosure further propose a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the data processing method as described above.
[0141] In order to implement the above embodiments, the embodiments of the present disclosure further provide a computer program product. When the computer program is executed by a processor of an electronic device, the electronic device can execute the data processing method as described above.
[0142] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: include: Obtaining a data synchronization request sent by the first application, wherein the data synchronization request includes a first account of the user in the first application and data to be synchronized; Traversing the account association list to determine whether the second application includes a second account associated with the first account; In a case where the account association list includes a second account, synchronizing the data of the second account in the second application based on the data to be synchronized; The traversing the account association list to determine whether the second application includes a second account associated with the first account includes: storing all account association lists in a cache area, and traversing the account association lists stored in the cache area to determine whether the second application includes a second account associated with the first account; The method further comprises: The account association list in the cache area is synchronously updated with the account association list in the database at a preset frequency, and the preset frequency is determined according to the update frequency of the database.
2. The method according to claim 1, characterized in that The data synchronization request is a data upload request, and synchronizing the data of the second account in the second application based on the data to be synchronized includes: Determining a data type corresponding to the second application; When the type of the data to be synchronized matches the data type corresponding to the second application, the data to be synchronized is associated with the second account.
3. The method according to claim 1, characterized in that The data synchronization request is a data deletion request, and synchronizing the data of the second account in the second application based on the data to be synchronized includes: Based on the data to be synchronized, traverse the associated data sets of the second account in the second application; In a case where the associated data set includes the data to be synchronized, the data to be synchronized is deleted from the associated data set.
4. The method according to claim 1, characterized in that Also includes: Obtaining an account processing request, wherein the account processing request is a binding request or an unbinding request, and the account processing request includes a first account and a second account; According to the account processing request, the first account and the second account are stored in association in the account association list in the database, or the first account and the second account stored in association in the account association list in the database are deleted.
5. The method according to claim 4, characterized in that Also includes: Monitoring the log files of the database; When it is detected that the log file contains update information, the update status of the associated account in the update information is synchronized to the cache area.
6. The method according to any one of claims 1 to 5, characterized in that: After traversing the account association list to determine whether the second application includes a second account associated with the first account, the method further includes: If the second account is not included in the account association list, sending a user information acquisition request to the first application; Obtaining user information corresponding to the first account returned by the first application; Querying a user information database corresponding to the second application to obtain a second account corresponding to the user information in the second application; In the account association list, the first account and the second account are associated and stored.
7. A data processing device, characterized in that: include: A first acquisition module is configured to execute and acquire a data synchronization request sent by a first application, wherein the data synchronization request includes a first account of a user in the first application and data to be synchronized; A first determination module is configured to perform traversal of the account association list to determine whether the second application includes a second account associated with the first account; A synchronization module, configured to execute, when the account association list includes a second account, synchronizing the data of the second account in the second application based on the data to be synchronized; The first determining module is specifically configured to execute: storing all account association lists in a cache area, and traversing the account association lists stored in the cache area to determine whether the second application includes a second account associated with the first account; The synchronization module is further specifically configured to execute: The account association list in the cache area is synchronously updated with the account association list in the database at a preset frequency, and the preset frequency is determined according to the update frequency of the database.
8. The device according to claim 7, characterized in that The data synchronization request is a data upload request, and the synchronization module is specifically configured to execute: Determining a data type corresponding to the second application; When the type of the data to be synchronized matches the data type corresponding to the second application, the data to be synchronized is associated with the second account.
9. The device according to claim 7, characterized in that The data synchronization request is a data deletion request, and the synchronization module is specifically configured to execute: Based on the data to be synchronized, traverse the associated data sets of the second account in the second application; In a case where the associated data set includes the data to be synchronized, the data to be synchronized is deleted from the associated data set.
10. The device according to claim 7, characterized in that Also includes: A second acquisition module is configured to execute an acquisition account processing request, wherein the processing request is a binding request or an unbinding request, and the processing request includes a first account and a second account; The first updating module is configured to execute, according to the account processing request, to associate and store the first account with the second account in the account association list in the database, or to delete the first account with the second account associated and stored in the account association list in the database.
11. The device according to claim 10, characterized in that Also includes: A first monitoring module is configured to monitor the log files of the database; The second updating module is configured to execute, when monitoring that the log file contains update information, synchronizing the update status of the associated account in the update information to the cache area.
12. The device according to any one of claims 7 to 11, characterized in that: Also includes: A first sending module is configured to send a user information acquisition request to the first application when the second account is not included in the account association list; A third acquisition module is configured to execute acquisition of user information corresponding to the first account returned by the first application; A second determining module is configured to query a user information database corresponding to the second application to obtain a second account corresponding to the user information in the second application; The first association module is configured to execute in the account association list to associate the first account with the second account.
13. An electronic device, characterized in that: include: processor; a memory for storing executable instructions for the processor; The processor is configured to call and execute executable instructions stored in the memory to implement the data processing method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data processing method as described in any one of claims 1 to 6.
15. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor of an electronic device, enables the electronic device to execute the data processing method according to any one of claims 1 to 6.
