Data processing method and device, electronic equipment and storage medium
1. A data processing method, comprising:
acquiring a data synchronization request sent by a first application, wherein the data synchronization request comprises a first account of a user in the first application and data to be synchronized;
traversing the account association list to determine whether a second application contains a second account associated with the first account;
and under the condition that the account association list contains a second account, synchronizing data of the second account in the second application based on the data to be synchronized.
2. The method of claim 1, wherein the data synchronization request is a data upload request, and the synchronizing data of the second account in the second application based on the data to be synchronized comprises:
determining a data type corresponding to the second application;
and associating the data to be synchronized with the second account under the condition that the type of the data to be synchronized is matched with the data type corresponding to the second application.
3. The method of claim 1, wherein the data synchronization request is a data deletion request, and the synchronizing data of the second account in the second application based on the data to be synchronized comprises:
traversing an associated data set of the second account in a second application based on the data to be synchronized;
and deleting the data to be synchronized from the associated data set under the condition that the associated data set contains the data to be synchronized.
4. The method of claim 1, wherein traversing the account association list to determine whether a second application includes a second account associated with the first account comprises:
and traversing the stored account association list in the cache region to determine whether a second application contains a second account associated with the first account.
5. The method of claim 4, further comprising:
and synchronizing the account association list in the cache region with the account association list in the database at a preset frequency.
6. The method of claim 5, further comprising:
acquiring an account processing request, wherein the account processing request is a binding request or a unbinding request, and the account processing request comprises a first account and a second account;
and according to the account processing request, performing association storage on the first account and the second account in an account association list in the database, or deleting the first account and the second account which are stored in the account association list in the database in an associated manner.
7. A data processing apparatus, comprising:
the system comprises a first acquisition module, a second acquisition module and a synchronization module, wherein the first acquisition module is configured to execute data synchronization request sent by a first application, and the data synchronization request comprises a first account of a user in the first application and data to be synchronized;
the first determination module is configured to execute traversal of the account association list to determine whether a second application contains a second account associated with the first account;
and the synchronization module is configured to synchronize the data of the second account in the second application based on the data to be synchronized when the account association list contains the second account.
8. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to invoke and execute the memory-stored executable instructions to implement the data processing method of any one of claims 1-6.
9. A computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of any of claims 1-6.
10. A computer program product, comprising a computer program which, when executed by a processor of an electronic device, enables the electronic device to perform the data processing method of any one of claims 1-6.
Background
At present, along with the rapid development of the internet, when a user uses internet products, the user needs to log in the account of the user in the internet products to realize data processing, so that when the user uses a plurality of internet products, the user needs to log in the account number of the user in each internet product one by one, and therefore the method is not only tedious and complex, but also wastes time, and the user experience is poor.
Therefore, how to facilitate users to use internet products is the key of the current research.
Disclosure of Invention
The present disclosure is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present disclosure is to provide a data processing method, which not only facilitates users to use products and saves users' time, but also improves the reliability of data processing, thereby improving the user experience.
A second object of the present disclosure is to propose a data processing apparatus.
A third object of the present disclosure is to provide an electronic device.
A fourth object of the present disclosure is to provide a computer-readable storage medium.
A fifth object of the present disclosure is to propose a computer program product.
To achieve the above object, an embodiment of a first aspect of the present disclosure provides a data processing method, including: acquiring a data synchronization request sent by a first application, wherein the data synchronization request comprises a first account of a user in the first application and data to be synchronized; traversing the account association list to determine whether a second application contains a second account associated with the first account; and under the condition that the account association list contains a second account, synchronizing data of the second account in the second application based on the data to be synchronized.
In addition, the data processing method according to the above embodiment of the present disclosure may further have the following additional technical features:
according to an embodiment of the present disclosure, the data synchronization request is a data upload request, and the synchronizing 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; and associating the data to be synchronized with the second account under the condition that the type of the data to be synchronized is matched with the data type corresponding to the second application.
According to an embodiment of the present disclosure, the data synchronization request is a data deletion request, and the synchronizing data of the second account in the second application based on the data to be synchronized includes: traversing an associated data set of the second account in a second application based on the data to be synchronized; and deleting the data to be synchronized from the associated data set under the condition that the associated data set contains the data to be synchronized.
According to an embodiment of the present disclosure, the traversing the account association list to determine whether a second application includes a second account associated with the first account includes: and traversing the stored account association list in the cache region to determine whether a second application comprises a second account associated with the first account.
According to an embodiment of the present disclosure, the data processing method further includes: and synchronizing the account association list in the cache region with the account association list in the database at a preset frequency.
According to an embodiment of the present disclosure, the data processing method further includes: acquiring an account processing request, wherein the account processing request is a binding request or a unbinding request, and the account processing request comprises a first account and a second account; and according to the account processing request, performing association storage on the first account and the second account in an account association list in the database, or deleting the first account and the second account which are stored in the account association list in the database in an associated manner.
According to an embodiment of the present disclosure, the data processing method further includes: monitoring a log file of the database; and under the condition that the log file is monitored to contain the update information, synchronizing the update state of the associated account in the update information to the cache region.
According to an embodiment of the present disclosure, after the traversing the account association list to determine whether a second application includes a second account associated with the first account, the method further includes: sending a user information acquisition request to a first application under the condition that the account association list does not contain the second account; acquiring user information corresponding to a first account returned by the first application; querying a user information base corresponding to the second application to acquire a second account corresponding to the user information in the second application; and associating the first account with the second account in the account association list.
To achieve the above object, a second embodiment of the present disclosure provides a data processing apparatus, including: the system comprises a first acquisition module, a second acquisition module and a synchronization module, wherein the first acquisition module is configured to execute data synchronization request sent by a first application, and the data synchronization request comprises a first account of a user in the first application and data to be synchronized; the first determination module is configured to execute traversal of the account association list to determine whether a second application contains a second account associated with the first account; and the synchronization module is configured to synchronize the data of the second account in the second application based on the data to be synchronized when the account association list contains the second account.
In addition, the data processing apparatus according to the above-described embodiment of the present disclosure may further have the following additional technical features:
according to an embodiment of the present disclosure, the data synchronization request is a data upload request, and the synchronization module is specifically configured to perform: determining a data type corresponding to the second application; and associating the data to be synchronized with the second account under the condition that the type of the data to be synchronized is matched with the data type corresponding to the second application.
According to an embodiment of the present disclosure, the data synchronization request is a data deletion request, and the synchronization module is specifically configured to perform: traversing an associated data set of the second account in a second application based on the data to be synchronized; and deleting the data to be synchronized from the associated data set under the condition that the associated data set contains the data to be synchronized.
According to an embodiment of the present disclosure, the first determining module is specifically configured to: and traversing the user account pairs stored in the cache region to determine whether a second application comprises a second account related to the first account.
According to an embodiment of the present disclosure, the synchronization module is further specifically configured to perform: and synchronizing the account association list in the cache region with the account association list in the database at a preset frequency.
According to an embodiment of the present disclosure, further comprising:
the second acquisition module is configured to execute an account acquisition processing request, wherein the processing request is a binding request or a unbinding request, and the processing request comprises a first account and a second account;
and the first updating module is configured to perform association storage of the first account and the second account in an account association list in the database according to the account processing request, or delete the first account and the second account which are stored in the account association list in the database in an associated manner.
According to an embodiment of the present disclosure, further comprising:
a first monitoring module configured to perform monitoring of a log file of the database;
and the second updating module is configured to synchronize the updating state of the associated account in the updating information to the cache region under the condition that the monitoring that the log file contains the updating information.
According to an embodiment of the present disclosure, further comprising:
the first sending module is configured to send a user information acquisition request to the first application under the condition that the account association list does not contain the second account;
the third acquisition module is configured to execute acquisition of user information corresponding to the first account returned by the first application;
the second determining module is configured to query a user information base corresponding to the second application to acquire a second account corresponding to the user information in the second application;
the first association module is configured to perform association between the first account and the second account in the account association list.
To achieve the above object, an embodiment of a third aspect of the present disclosure provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; the processor is configured to call and execute the executable instructions stored in the memory to implement the data processing method provided by the embodiment of the first aspect of the disclosure.
To achieve the above object, a fourth aspect of the present disclosure provides a computer-readable storage medium, where instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method provided in the first aspect of the present disclosure.
To achieve the above object, a fifth aspect of the present disclosure provides a computer program product, which when executed by a processor of an electronic device, enables the electronic device to execute the data processing method provided in the first aspect of the present disclosure.
According to the technical scheme of the embodiment of the disclosure, a data synchronization request sent by a first application is acquired, wherein the data synchronization request comprises a first account of a user in the first application and data to be synchronized; traversing the account association list to determine whether a second application contains a second account associated with the first account; and under the condition that the account association list contains a second account, synchronizing data of the second account in the second application based on the data to be synchronized. Therefore, on the basis of 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, so that the product is convenient for a user to use, the time of the user is saved, the reliability of data processing is improved, and the use experience of the user is improved.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
FIG. 1 is a flow chart of a data processing method according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram of updating an account association list in a database, according to one embodiment of the present disclosure;
FIG. 3 is a flow diagram of updating an account association list in a cache according to one embodiment of the present disclosure;
FIG. 4 is a flow chart of a data processing method according to one example of the present disclosure;
FIG. 5 is a schematic diagram of user account binding according to one example of the present disclosure;
FIG. 6 is a block diagram of a data processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present disclosure, and should not be construed as limiting the present disclosure.
The disclosure provides a data processing method, a device, an electronic device and a storage medium, mainly considering that when a user uses an internet product at present, the user needs to log in an account of the user in the internet product to perform corresponding operation no matter under any condition, and the problems that the complexity of using the product by the user is increased and the user experience is poor are increased.
According to the data processing method, on the basis of the association of the two account numbers, the data of the second account number in the second application is synchronized according to the data to be synchronized in the data synchronization request, so that the data processing method is convenient for a user to use a product, saves the time of the user, improves the reliability of data processing, and improves the use experience of the user.
A data processing method, an apparatus, an electronic device, and a storage medium according to embodiments of the present disclosure are described below with reference to the drawings.
Fig. 1 is a flowchart of a data processing method according to an embodiment of the present disclosure, and an execution subject may be an electronic device, specifically, the electronic device may be, but is not limited to, a computer, a mobile terminal, and the mobile terminal may be, but is not limited to, a personal computer, a smart phone, an IPAD, and the like.
It should be noted that, in the embodiment of the present disclosure, data under an account associated with an account in another application (hereinafter, referred to as a second application) is processed through an account of a user in the application (hereinafter, referred to as a first application), where the account of the user in the first application is referred to as a first account and the account is unique, and an account of the user in the second application associated with the first account is referred to as a second account and the account is also unique.
As shown in fig. 1, the data processing method includes the following steps S101 to S103.
S101, a data synchronization request sent by a first application is obtained, wherein the data synchronization request comprises a first account of a user in the first application and data to be synchronized.
The user can trigger the first application action through the first client corresponding to the first application, namely sending a data synchronization request. The data to be synchronized in the data synchronization request may be data generated by the first application according to the user's requirement, and is used to indicate what processing is performed on data (also referred to as associated data) to which the second account of the user belongs in the second application.
Specifically, the first application may send the data synchronization request to the second application, and then the second application may obtain the data synchronization request sent by the first application, that is, may obtain the first account and the data to be synchronized of the user in the first application.
S102, traversing the account association list to determine whether a second application contains a second account associated with the first account.
It should be noted that the account association list may be established in advance, that is, a unique index of a first account of a user in a first application and a second account of the user in a second application may be established in a database level, so as to ensure that the first account and the second account are bound in a one-to-one correspondence.
Specifically, after the second application acquires the first account and the data to be synchronized of the user in the first application, the second application may traverse the query account association list to determine whether a second account associated with the first account exists in the second application.
And S103, under the condition that the account association list contains the second account, synchronizing data of the second account in the second application based on the data to be synchronized.
Specifically, when it is determined that the account association list includes the second account, the data to be synchronized may be synchronized to the data of the second application of the second account. According to the above steps S101 to S103, when a user needs to perform data processing on a second application through a first application, corresponding operation may be performed on a first client corresponding to the first application through a first account in the first application, and then the first application generates a data synchronization request according to an instruction of the user, where the data synchronization request carries the first account and data to be synchronized, and sends the data synchronization request to the second application, and after receiving the data synchronization request, the second application may traverse an inquiry account association list to determine whether the second application includes a second account associated (bound) with the first account, and if the account association list includes the second account associated with the first account, the data of the second account in the second application may be synchronized based on the data to be synchronized.
That is to say, under the condition that the second account is associated with the first account, the user performs corresponding operation on the first client corresponding to the first application through the first account in the first application, that is, data of the second account in the second application can be correspondingly processed, so as to meet the use requirement of the user. Specifically, under the condition that an account in a first application is associated (bound) with an account in a second application, when a user needs to perform data synchronization processing on data associated with the second account, the user may trigger the first application to send a data synchronization request to the second application, and after the second application acquires the first account and data to be synchronized in the data synchronization request, the second application determines whether the second application includes the second account associated with the first account by traversing an inquiry account association list. Then, under the condition that the account association list includes the second account, the data of the second account in the second application can be synchronized based on the data to be synchronized, so that corresponding operation can be realized in the second application without a second client corresponding to the second application, that is, without a user logging in the account in the second application.
For example, when a user needs to publish a work (video, photo or text) in a second application through a first application, the user may trigger the first application to send a data synchronization request to the second application, where the data synchronization request includes a first account and data to be synchronized, the data synchronization request is the published work, the data to be synchronized is the work, and the second application acquires the first account and the data to be synchronized (the work). The query can be performed in the account association list, and when a second account is found in the account association list, the second application can receive the data synchronization request for releasing the works, and the works in the data synchronization request are released under the second account.
In addition, based on the binding relationship between the first account in the first application and the second account in the second application, the user can also obtain the relevant information in the first application in the second application under the condition that the second account is associated with the first account, so as to facilitate the operation of the user in the first application.
For example, when the user catches a coupon in the second application and the coupon belongs to the first application, in order to avoid misuse when the user uses the coupon in the first application, it is necessary to determine whether the coupon belongs to the first account of the user in the first application. Therefore, a user can trigger the second application to send a data synchronization request to the first application, where the data synchronization request includes the second account and data to be synchronized, where the data synchronization request may indicate the first application to determine whether the coupon belongs to the first account, the data to be synchronized may be the coupon, after the first application acquires the second account and the data to be synchronized, the first application queries in an account association list, and when the account association list includes the first account associated with the second account, it may determine whether the coupon belongs to the first account.
According to the data processing method, under the condition that 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, so that the data processing method is convenient for a user to use a product, saves the time of the user, improves the reliability of data processing, and improves the use experience of the user.
In step S103, when the data of the second account in the second application is synchronized based on the data to be synchronized, the data may be determined according to the data type corresponding to the data of the second account and the data type corresponding to the data of the second application, or may be determined according to the type of the data processing request
That is, in an embodiment of the present disclosure, if the data synchronization request is a data upload request, the synchronizing the data of the second account in the second application based on the data to be synchronized in step S103 includes: and determining a data type corresponding to the second application, and associating the data to be synchronized with the second account under the condition that the type of the data to be synchronized is matched with the data type corresponding to the second application.
Specifically, when the type of the data synchronization request is a data upload request, the data type corresponding to the second application may be determined first, and then it is determined whether the type of the data to be synchronized matches the data type corresponding to the second application in which the second account is located, and if the type of the data to be synchronized matches the data type in the second application in which the second account is located, the data to be synchronized may be associated with the second account. It is to be appreciated that after receiving the data synchronization request, the second application can upload the data to be synchronized to a second account in the second application.
That is, in an embodiment of the present disclosure, if the data synchronization request is a data deletion request, the synchronizing the data of the second account in the second application based on the data to be synchronized in step S103 includes: traversing an associated data set 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 set under the condition that the associated data set contains the data to be synchronized.
Specifically, when the type of the data synchronization request is a data deletion request, the second application may determine whether the data to be synchronized belongs to the second account in the second application, that is, may traverse an associated data set of the second account in the second application based on the data to be synchronized, and if the associated data set contains the data to be synchronized, that is, the data to be synchronized belongs to the second account in the second application, the data to be synchronized may be deleted from the associated data set. It is to be understood that, after receiving the data synchronization request, the second application may delete the data to be synchronized under the second account in the second application.
For example, the data synchronization request is "upload picture a", that is, the data upload request, the type of the data to be synchronized is "picture", and if the second application determines that the type of the data to be synchronized is matched with 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 of "picture", the picture a may be uploaded to the second application.
For another example, the data synchronization request is "delete picture B", which is a data deletion request, and then, based on the data to be synchronized, the associated data set of the second account in the second application may be traversed, and if the second application determines that the associated data set includes "picture B" to be synchronized, that is, the "picture B" belongs to the second account in the second application, the picture B may be deleted from the associated data set, that is, the picture B may be deleted from the second account in the second application.
Therefore, the relationship between the data to be synchronized and the second account is determined according to the type of the data synchronization request, the type of the data to be synchronized and the data type of the second account, and the effectiveness and reliability of the relationship determination are further improved, so that the reliability of data processing is further improved.
It can be understood that there are usually a plurality of user accounts in the first application, and the user accounts respectively correspond to the user accounts in the second application one to one, so as to form a plurality of associated accounts corresponding one to one, and further form an account association list. It should be noted that all user accounts, including all associated user accounts and unassociated user accounts, are stored in the database, and it can be understood that all associated user accounts, that is, account association lists, are stored in the database, and in this case, when a second account associated with a first account is acquired, the second account associated with the first account needs to be queried in the database.
However, in actual use, it is required to first query whether the first account of the user in the first application is associated with the second account of the user in the second application, or whether the second account of the user in the second application is associated with the first account of the user in the first application, and the database is not sufficient to bear the call volume during query.
That is, in an embodiment of the present disclosure, traversing the account association list in step S102 to determine whether the second application includes the second account associated with the first account may include: and querying the account association list stored in the cache area to determine whether a second application comprises a second account associated with the first account.
Specifically, since the account association list is stored in the cache region, the account association list stored in the cache region can be queried after the second application acquires the first account, and 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 acquired, so that the second account associated with the first account can be acquired.
Under the condition that the account association list part is stored in the cache region, if the association account corresponding to the first account is not inquired in the cache region, the account association list stored in the database needs to be inquired, and if the association account corresponding to the first account is inquired in the database, the association account can be stored in the cache region for calling when needed; if the associated account corresponding to the first account is not queried in the database, the empty association relationship may be written into the cache region to prevent cache breakthrough.
Under the condition that the account association list is completely stored in the cache region, if the associated account corresponding to the first account is not inquired in the cache region, the second application can acquire user information corresponding to the first account from the first application, and inquire the database according to the user information to determine the second account of the user in the second application, and then form the associated account by the first account and the second account, and store the associated account in the cache region for calling when needed.
As described above, the account association list may be partially stored in the cache region, or may be entirely cached in the cache region. When the account number association list is stored in the cache region, a large amount of useless data is avoided. Therefore, in the embodiment of the present disclosure, all the account association lists are stored in the cache region, in order to store all the account association lists in the cache region, the account association lists in the cache region and the account association lists in the database may be synchronized in real time, the account association lists in the cache region and the account association lists in the database may also be periodically synchronized with a certain time interval as a period, and the account association list marks in the cache region and the account association lists in the database may also be synchronized with a preset frequency.
That is, in one example of the present disclosure, the data processing method may further include: and synchronizing the account association list in the cache region with the account association list in the database at a preset frequency.
The preset frequency may be determined according to a general update frequency of the database, and may be, for example, 10Hz (hertz).
For example, when the preset frequency is 10Hz, the synchronization action is performed 10 times every 1 second, that is, the account association list in the cache region is synchronized with the account association list in the database, so that all the user associated accounts and the account association list in the database are ensured to be stored in the cache region.
Therefore, the account association lists in the database are all stored in the cache region, and the account association lists in the cache region and the account association lists in the database are kept synchronous, so that the accuracy and the integrity of the account association lists in the cache region can be ensured, a large amount of useless data cannot exist, cache penetration caused by multiple times of returning to the source database cannot be generated, and the query efficiency is improved.
That is, the account association list in the database and the account association list in the cache area are updated synchronously, for example, when a user account is added to the database, the added user account and its associated account are stored in the cache area. The triggering action of the user at the client can start an updating program of the account association list in the database.
That is, as shown in fig. 2, the data processing method provided by an example of the present disclosure may further include the following steps S201 and S202 to update the account association list in the database.
S201, an account processing request is obtained, wherein the processing request is a binding request or an unbinding request, and the account processing request comprises a first account and a second account.
The account processing request may be generated according to a request action of a user at a client. For example, when the user clicks a "bind" or "unbind" button next to the user account at the client, the first application generates a processing request for the account and may send the processing request for the account to the second application.
And S202, performing association storage on the first account and the second account in an account association list in the database according to the account processing request, or deleting the first account and the second account which are stored in the account association list in the database in an associated manner.
Specifically, after the second application acquires the account binding request, binding a first account of the user in the first application with a second account of the second application according to the account binding request, so that the first account is associated with the second account, namely, the first account and the second account are stored in an account association list in the database in an associated manner; or after the second application acquires the account unbinding request, according to the account unbinding request, the first account of the user in the first application and the second account of the user in the second application are unbound, so that the first account and the second account are not associated, that is, the first account and the second account stored in association are deleted from an account association list in the database, thereby updating the account association list in the database.
Therefore, the binding and unbinding of the two accounts are carried out according to the account processing request, the updating of the account association list is realized, the accuracy of each associated account in the account association list in the database is further ensured, and the influence on the operation of a user due to inaccurate updating is avoided.
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 are synchronized, the account association list in the cache area needs to be updated, that is, as shown in fig. 3, after the account association list in the database is updated, the following steps S301 and S302 may further be included:
s301, monitoring the log file of the database.
The log file of the database may record the update condition, namely binding or unbinding, of the first account and the second account stored in association with each other in the account association list in the database. During actual use, the log file of the database can be monitored through the monitoring program so as to monitor the update of each associated account in the account association list in the database in real time.
S302, under the condition that the log file is monitored to contain the update information, the update state of the associated account in the update information is synchronized to a cache region.
And according to the monitored update log information, if a new account is bound or unbound, updating the cache area account association list in time so as to keep the account association list in the database and the account association list in the cache area synchronous. Therefore, when the account association list in the database is updated, the account association list in the cache region is updated correspondingly, so that the accuracy and reliability of association of each associated account in the cache region are ensured, and the phenomenon that the operation of a user is influenced due to the fact that the associated accounts in the database and the cache region are asynchronous is avoided.
In the above step S103, what kind of action the second application performs when the second account associated with the first account is acquired in the embodiment of the present disclosure is described, in another embodiment of the present disclosure, the second application may not acquire the second account associated with the first account in the second application in the cache region, and at this time, in order to facilitate the user to continue the operation, the operation shown in fig. 4 is performed without exiting the current program.
As shown in fig. 4, in another embodiment of the present disclosure, the data processing method may further include the following steps S401 to S406:
s401, a data synchronization request sent by a first application is obtained, wherein the data synchronization request comprises a first account of a user in the first application and data to be synchronized.
The step S401 corresponds to the step S101, and therefore, the description thereof is omitted here.
S402, traversing the account association list to determine whether the second application contains a second account associated with the first account.
S403, sending a user information obtaining request to the first application when the account association list does not include the second account associated with the first account.
The user information may include an account number of the user, a gender, a height, a weight, a constellation, and the like of the user.
Specifically, when the second application does not acquire the second account associated with the first account in the cache region, 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.
S404, user information corresponding to the first account returned by the first application is obtained.
S405, querying a user information base corresponding to the second application to obtain a second account corresponding to the user information in the second application.
S406, the first account and the second account are stored in the account association list in an associated manner.
Specifically, after the user information corresponding to the first account is acquired, the database can be queried according to the user information, so as to query a second account of the user in the second application in the database, where the second account and the first account are accounts to be bound, and then the first account and the second account are stored in an associated manner, that is, bound, so as to form an account association list. The account association list may then be stored in a cache for subsequent recall.
S407, in the case of acquiring a second account associated with the first account, in response to the data synchronization request, processing data associated with the second account based on the data to be synchronized, where the second account is a user account of the user in a second application.
Specifically, after the first account and the second account are bound and stored in the cache region, the second account can be obtained when the second account is obtained in the cache region again, so that a data synchronization request is responded, and data associated with the second account is synchronized based on the data to be synchronized.
Therefore, when the account associated with the first account is not acquired 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 that the second account is acquired to perform corresponding data processing, the reliability of user operation is ensured, and the condition that the user cannot perform corresponding operation due to the fact that the associated account cannot be inquired is avoided.
In order to describe the data processing method of the embodiment of the present disclosure more clearly, a user account binding process in the data processing method is described below with reference to fig. 5.
As shown in fig. 5, a binding interface is provided for the second application, and a unique index of the id of the user in the first application and the id of the user in the second application is established from a database layer, so that the id of the user in the first application and the id of the user in the second application are in unique one-to-one correspondence, and if a plurality of user accounts are bound, an error is reported, and repeated binding is treated as successful processing. The method comprises the steps of storing full data in a cache region, updating a binding database when a new account is bound or unbound, monitoring a binlog (binary log) of a database table through a program implementation to update each associated account in an account association list of the cache region in real time, starting a timed task to poll the account association list in the database to update a binding relation in the cache region, so that the accuracy of data in the cache can be guaranteed, a large amount of useless data cannot exist, cache penetration cannot occur (because the method does not return to a source database), and data which cannot be read in the cache is considered to be in a non-binding state.
When each associated account in the cache region is updated, the id in the first application may be used as a key (key word) and the id in the second application as a value (value), or the id in the second application may be used as a key and the id in the first application as a value, and binding or unbinding of the associated account is performed, so that when the associated account in the cache region is queried, forward query and reverse query are supported, and query efficiency is improved.
The embodiment of the present disclosure also provides a data processing apparatus, and fig. 6 is a block diagram of a data processing apparatus according to the embodiment of the present disclosure.
As shown in fig. 6, the data processing apparatus 100 includes: a first acquisition module 110, a first determination module 120, and a synchronization module 130.
The first obtaining module 110 is configured to execute obtaining a data synchronization request sent by a first application, where the data synchronization request includes a first account of a user in the first application and data to be synchronized; a first determining module 120 configured to perform traversal of the account association list to determine whether a second application includes a second account associated with the first account; a synchronization module 130, configured to perform, when the account association list includes a second account, synchronizing data of the second account in the second application based on the data to be synchronized.
In an embodiment, the data synchronization request is a data upload request, and the synchronization module 130 is specifically configured to determine a data type corresponding to the second application, and associate the data to be synchronized with the second account when the type of the data to be synchronized is matched with the data type corresponding to the second application.
In an embodiment, the data synchronization request is a data deletion request, and the synchronization module 130 may be specifically configured to perform: traversing an associated data set of the second account in a second application based on the data to be synchronized; and deleting the data to be synchronized from the associated data set under the condition that the associated data set contains the data to be synchronized.
In one embodiment, the first determining module 120 is specifically configured to perform: and traversing the stored account association list in the cache region to determine whether a second application comprises a second account associated with the first account.
In an 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.
In one example, the data processing apparatus 100 may further include: the second acquisition module is configured to execute an account acquisition processing request, wherein the processing request is a binding request or a unbinding request, and the processing request comprises a first account and a second account; and the first updating module is configured to perform association storage of the first account and the second account in an account association list in the database according to the account processing request, or delete the first account and the second account which are stored in the account association list in the database in an associated manner.
In one example, the data processing apparatus 100 may further include: the first monitoring module is configured to monitor a log file of the database; and the second updating module is configured to synchronize the updating state of the associated account in the updating information to the cache region under the condition that the monitoring that the log file contains the updating information.
In one example, the data processing apparatus 100 may further include: the first sending module is configured to send a user information acquisition request to the first application under the condition that the account association list does not contain the second account; the third acquisition module is configured to execute acquisition of user information corresponding to the first account returned by the first application; the second determining module is configured to query a user information base corresponding to the second application to acquire a second account corresponding to the user information in the second application; the first association module is configured to perform association between the first account and the second account in the account association list.
It should be noted that, for the specific implementation of the data processing apparatus, reference may be made to the specific implementation of the data processing method, and details are not described here for avoiding redundancy.
According to the data processing device in the embodiment of the disclosure, under the condition that 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, so that not only is the product use by a user facilitated, the time of the user is saved, but also the reliability of data processing is improved, and the use experience of the user is improved.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 7, the electronic apparatus 200 includes: a memory 210 and a processor 220, and a bus 230 connecting the various components, including the memory 210 and the processor 220.
Wherein, the memory 210 is used for storing the executable instructions of the processor 220; the processor 201 is configured to call and execute the executable instructions stored in the memory 202 to implement the data processing method proposed by the above-mentioned embodiment of the present disclosure.
Bus 230 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such 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.
Electronic device 200 typically includes a variety of electronic device readable media. Such media may be any available media that is accessible by electronic device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
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/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 230 by one or more data media interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 280 having a set (at least one) of 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 thereof may comprise an implementation of a network environment, may be stored in, for example, the memory 210. The program modules 270 generally perform the functions and/or methodologies of the embodiments described in this disclosure.
Electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), with one or more devices that enable a user to interact with electronic device 200, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 200 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 292. Also, the electronic device 200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 293. As shown, the network adapter 293 communicates with the other modules of the electronic device 200 via the bus 230. It should be appreciated that although not shown in the figures, 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, among others.
The processor 220 executes various functional applications and data processing by executing programs stored in the memory 210.
It should be noted that, for the implementation process of the electronic device according to the embodiment of the present disclosure, reference is made to the foregoing explanation of data processing according to the embodiment of the present disclosure, and details are not described here again.
According to the electronic device, when the processor calls and executes the executable instruction stored in the memory, under the condition that 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, so that the electronic device is convenient for a user to use a product, saves the time of the user, improves the reliability of data processing, and improves the use experience of the user.
In order to implement the above embodiments, the present disclosure also provides a computer-readable storage medium, where instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to execute the data processing method as described above.
In order to implement the above embodiments, the present disclosure also provides a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to execute the data processing method as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:进程间数据搬移的方法及装置