A data synchronization method and device, a server, and a storage medium
By dividing data synchronization tasks into pages and implementing waiting operations, the response bottleneck problem in multi-channel and multi-enterprise data synchronization was solved, achieving accurate and timely data synchronization results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2026-03-20
AI Technical Summary
Existing data synchronization solutions suffer from low accuracy and timeliness when addressing data synchronization needs across multiple channels and enterprises.
By dividing the data synchronization task into pages and waiting for a preset pagination time after the task on the same data synchronization page is completed, the service performance of the channel to be synchronized is restored before the task on the next page is executed, thus reducing the possibility of response bottlenecks.
It improves the accuracy and timeliness of data synchronization under the data synchronization needs of multiple channels and enterprises, and ensures the effective execution of each data synchronization task.
Smart Images

Figure CN114077499B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of data processing, and in particular, to a data synchronization method and device, a server and a storage medium. BACKGROUND
[0002] In real life, various application software is needed by enterprises. Since the enterprises do not have much time and money to directly develop and / or interface with application suppliers to purchase these application software, an enterprise management tool box system (hereinafter referred to as an enterprise tool box) with various application software is emerging.
[0003] In actual application, various enterprises can be associated on the same or different channels (or platforms) that provide services for the enterprises. In order to enable the enterprises associated on the channels to effectively apply the application software accessed on the enterprise tool box, the enterprise data of the enterprises can be synchronized to the enterprise tool box.
[0004] In the process of implementing the present application, the inventors have found that the prior art has the following technical problems: in the case of multi-channel and multi-enterprise data synchronization requirements, the existing data synchronization scheme has the problem of low accuracy and timeliness of data synchronization. SUMMARY
[0005] Embodiments of the present application provide a data synchronization method, device, server and storage medium to achieve the effect of accurate and timely data synchronization.
[0006] In a first aspect, embodiments of the present application provide a data synchronization method, which can be applied to a data synchronization server and can include:
[0007] Upon receiving a data synchronization instruction, a to-be-synchronized enterprise associated on a to-be-synchronized channel corresponding to the data synchronization instruction is determined, and a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise is obtained, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages;
[0008] A data synchronization task is called from the data synchronization list, and it is determined whether the first data synchronization task currently called is located in a current synchronization page of a second data synchronization task last called, wherein the current synchronization page is one of the data synchronization pages;
[0009] If not, after it is determined that each data synchronization task in the current synchronization page is executed, a waiting operation with a preset page duration is performed, and after the waiting operation is executed, the first data synchronization task currently called is executed for data synchronization.
[0010] In a second aspect, the embodiments of the present application further provide a data synchronization device, which is configured to be arranged in a data synchronization server and can include:
[0011] a data synchronization list obtaining module, configured to, when receiving the data synchronization instruction, determine the to-be-synchronized enterprises associated with the data synchronization instruction on the to-be-synchronized channel, and obtain a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages;
[0012] a data synchronization task determining module, configured to call the data synchronization task from the data synchronization list, and determine whether a first data synchronization task currently called is located in a current synchronization page of a second data synchronization task last called, wherein the current synchronization page is one of the data synchronization pages;
[0013] a data synchronization module, configured to, if no, after determining that each data synchronization task in the current synchronization page is executed completely, perform a waiting operation with a preset page duration, and after the waiting operation is performed completely, execute the first data synchronization task currently called to perform data synchronization.
[0014] In a third aspect, the embodiments of the present application further provide a data synchronization server, which can include:
[0015] one or more processors;
[0016] a memory, configured to store one or more programs;
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the data synchronization method provided by any of the embodiments of the present application.
[0018] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the data synchronization method provided by any of the embodiments of the present application.
[0019] The technical solution of this invention involves identifying the enterprises to be synchronized on the synchronization channel corresponding to the received data synchronization instruction, obtaining a data synchronization list containing data synchronization tasks corresponding to each enterprise, where each data synchronization task is used to synchronize the enterprise data of the corresponding enterprise, and each data synchronization task is divided into at least two data synchronization pages; calling a data synchronization task from the data synchronization list, and determining whether the currently called first data synchronization task is located on the current synchronization page where the previously called second data synchronization task is located, where the current synchronization page is one of the data synchronization pages, thereby determining whether the number of data synchronization tasks responded to by the synchronization channel in a short period of time may cause a response bottleneck in the synchronization channel; if not, this indicates that the synchronization channel may be experiencing a response bottleneck at this time, and after determining that all data synchronization tasks belonging to the current synchronization page have been completed, a waiting operation with a preset page duration can be performed to allow the synchronization channel to restore service performance, and then after the waiting operation is completed, the currently called first data synchronization task is executed to perform data synchronization, thereby ensuring the effective execution of each data synchronization task. The above technical solution reduces the possibility of response bottlenecks in the data synchronization channels by dividing each data synchronization task into pages and waiting for a preset pagination time after completing each data synchronization task on the same data synchronization page before executing each data synchronization task on the next data synchronization page. This achieves accurate and timely data synchronization when facing data synchronization needs of multiple channels and multiple enterprises. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the architecture of an enterprise toolbox in a data synchronization method according to an embodiment of the present invention;
[0021] Figure 2 This is a flowchart of a data synchronization method according to Embodiment 1 of the present invention;
[0022] Figure 3 This is a flowchart of a data synchronization method according to Embodiment 2 of the present invention;
[0023] Figure 4 This is a flowchart of an optional example of a data synchronization method in Embodiment 2 of the present invention;
[0024] Figure 5a This is a first schematic diagram of user login in a data synchronization method according to Embodiment 2 of the present invention;
[0025] Figure 5b This is a second schematic diagram of user login in a data synchronization method according to Embodiment 2 of the present invention;
[0026] Figure 6is a flowchart of the application of on-shelf and off-shelf in a data synchronization method in Embodiment Two of the present application;
[0027] Figure 7 is a flowchart of a data synchronization method in Embodiment Three of the present application;
[0028] Figure 8 is a structural block diagram of a data synchronization device in Embodiment Four of the present application;
[0029] Figure 9 is a structural schematic diagram of a data synchronization server in Embodiment Five of the present application. DETAILED DESCRIPTION
[0030] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.
[0031] Before introducing the embodiments of the present application, the application scenarios of the embodiments of the present application are exemplarily described: the application software involved by each enterprise can include office software, financial software, enterprise resource planning (ERP) software, asset management software and / or human resource software, etc., and the channels involved can include ERP channels, wisdom industrial and commercial association channels and / or matchmaking channels, etc. The above-mentioned enterprise toolbox can be understood as a unified channel application management platform, supporting the access of multiple channels and multiple applications. In actual application, optionally, referring to Figure 1 application software, such as releasing, on-shelf, off-shelf, synchronizing enterprise data in the enterprise toolbox, etc., thereby providing a unified application-oriented docking specification, and the two cooperate with each other to provide application software that can be quickly deployed for the channel, thereby reducing the product delivery pressure of the channel (i.e. the pressure caused by directly developing and / or docking with each application supplier to purchase these application software); at the same time, it also provides various functions such as user management, channel management, application management, statistical analysis, user feedback, etc., thereby providing technical support for the operation of the enterprise toolbox.
[0032] A plurality of servers can be involved in the enterprise toolbox, and the data synchronization server can be a server deployed on a data synchronization server capable of realizing data synchronization function in each server. Each channel has a channel server, and when the data synchronization server interfaces with a plurality of channel servers, or in other words, interfaces with a channel server deployed on the channel server, for each channel server, since the channel server needs to meet the data synchronization needs of a plurality of enterprises, it is assumed that a data synchronization interface is deployed on the channel server, and the data synchronization server synchronizes enterprise data by calling the data synchronization interface, which means that the channel server needs to call the data synchronization interface in batches to synchronize the enterprise data of each enterprise under the channel (such as synchronizing the enterprise data of one enterprise each time the data synchronization interface is called). Since the service performance of each channel server is limited, such batch interface calling in a short time is likely to cause the channel server to be unable to respond quickly to each interface call due to response bottlenecks, at which time the channel server will fail to respond due to delayed processing. When the frequency of response failures is too high, it is difficult to effectively guarantee the accuracy and timeliness of data synchronization.
[0033] It should be noted that the significance of data synchronization is that an employee of an enterprise wants to apply a certain application software connected to the enterprise toolbox, provided that the enterprise data of the enterprise has been synchronized to the enterprise toolbox. The above enterprise data can include enterprise name, organizational structure, user information (i.e. employee information), relationship between users and roles, and / or relationship between roles and permissions, etc., which is equivalent to the initialization process of the application software. Thus, when the employee applies the application software, the application server of the application software can directly obtain the enterprise data of the enterprise to which the employee belongs from the enterprise toolbox, and then determine the operation permission of the employee.
[0034] Embodiment one
[0035] Figure 2 is a flowchart of a data synchronization method provided in the embodiment one of the present application. The present embodiment can be applied to the case of data synchronization for multiple channels and multiple enterprises. The method can be executed by a data synchronization device provided by the embodiment of the present application, and the device can be realized by software and / or hardware. The device can be integrated on a data synchronization server.
[0036] Referring to Figure 2 , the method of the embodiment of the present application specifically includes the following steps:
[0037] S110, when receiving the data synchronization instruction, determining the to-be-synchronized enterprises associated with the to-be-synchronized channel corresponding to the data synchronization instruction, and obtaining a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages.
[0038] The data synchronization instruction can be used to synchronize enterprise data of each to-be-synchronized enterprise associated with a to-be-synchronized channel. Therefore, when the data synchronization instruction is received, it can be determined which channel in the multiple channels the to-be-synchronized channel corresponding to the data synchronization instruction is associated with, and then it can be determined which to-be-synchronized enterprises are associated with the to-be-synchronized channel. In order to synchronize the enterprise data of the to-be-synchronized enterprises, a data synchronization task can be configured for each to-be-synchronized enterprise in advance, and these data synchronization tasks can be stored in a preset data synchronization list. In actual application, these data synchronization tasks or the data synchronization list can be stored in a preset database, so they can be obtained from the preset database. Alternatively, in order to speed up the data synchronization, the data synchronization tasks can be called based on multi-threading.
[0039] As described above, the number of to-be-synchronized enterprises associated with the to-be-synchronized channel can be multiple. When the enterprise data is synchronized from the to-be-synchronized channel by calling the data synchronization task multiple times in a short time, a response bottleneck can occur. Therefore, the data synchronization tasks in the data synchronization list are divided into at least two data synchronization pages, and the data synchronization tasks are divided into at least two data synchronization pages, so that the data synchronization tasks are called in batches to reduce the frequency of occurrence of the response bottleneck. In actual application, the data synchronization task can be divided into which data synchronization page, and the data synchronization task can be divided into which position in the data synchronization page, which can affect the synchronization order of the data synchronization task. Accordingly, in order to synchronize the enterprise data of more important to-be-synchronized enterprises first, the data synchronization tasks corresponding to each to-be-synchronized enterprise can be divided into pages according to the importance of each to-be-synchronized enterprise, and the importance of each to-be-synchronized enterprise can be determined according to the activity of each to-be-synchronized enterprise, i.e. according to the application frequency of each application software in the enterprise toolbox. In addition, similarly, the synchronization priority of each channel can also be determined according to the application frequency of each application software in the enterprise toolbox, so that the data synchronization instruction corresponding to the channel with higher activity can be sent first.
[0040] S120, calling the data synchronization task from the data synchronization list, and determining whether the first data synchronization task currently called is located in the current synchronization page of the second data synchronization task last called, wherein the current synchronization page is one of the data synchronization pages.
[0041] Since the data synchronization list stores multiple data synchronization tasks, which are invoked sequentially, after a data synchronization task is invoked from the list, it can be determined whether this task (the currently invoked first task) and the previously invoked second task are located on the same data synchronization page. The same data synchronization page could be the current synchronization page where the previously invoked task is located. In practical applications, optionally, when dividing the data synchronization tasks into pages, they can be represented by the enterprise identifier of the enterprise to be synchronized. For example, the enterprise identifiers corresponding to the data synchronization tasks to be divided into different data synchronization pages can be used to distinguish them, and the distinction results can be stored in a storage area accessible to the data synchronization server, such as Redis memory. Furthermore, the page division process for each data synchronization task can be implemented by a data synchronization server deployed in the enterprise toolkit, or by other servers; no specific limitation is made here.
[0042] The significance of this step is that if the first data synchronization task currently invoked is located on the current synchronization page, it means that the data synchronization tasks on the current synchronization page have not yet been completed, indicating that the data synchronization tasks responded to by the channel to be synchronized in a short period of time are relatively limited, and the possibility of a response bottleneck is low. Otherwise, it means that the channel to be synchronized has responded to a large number of data synchronization tasks in a short period of time, indicating that the channel to be synchronized has already responded to a large number of data synchronization tasks in a short period of time, and the possibility of a response bottleneck is high, requiring certain measures to avoid the occurrence of a response bottleneck.
[0043] S130. If not, after determining that all data synchronization tasks in the current synchronization page have been completed, a wait operation with a waiting time of the preset page duration is executed, and after the wait operation is completed, the first data synchronization task currently called is executed to perform data synchronization.
[0044] Wherein, for a data synchronization task, it can be called and then executed, and when it is executed, the data synchronization task can be considered to be completed. Therefore, when the first data synchronization task currently called is not located on the current synchronization page, it can be determined whether each data synchronization task in the current synchronization page is executed. This can involve a variety of situations: for example, when multiple threads in the data synchronization server are calling data synchronization tasks at the same time, it can occur that a thread has called a data synchronization task on the next data synchronization page of the current synchronization page, while some threads are still calling and / or executing data synchronization tasks on the current synchronization page; for example, when multiple data synchronization servers in the enterprise toolbox are calling data synchronization tasks at the same time, it can occur that a data synchronization server has called a data synchronization task on the next data synchronization page of the current synchronization page, while some data synchronization servers are still calling and / or executing data synchronization tasks on the current synchronization page; and so on, which is not specifically limited here.
[0045] After determining that each data synchronization task in the current synchronization page is executed, a waiting operation with a preset paging duration can be performed, which allows the service performance of the channel to be synchronized to be restored and reduces the possibility of response bottlenecks; and then, after the waiting operation is executed, the first data synchronization task currently called is executed to synchronize data, i.e., the execution of the data synchronization task in the next data synchronization page of the current synchronization page is started. In practical applications, the above-mentioned preset paging duration can be determined according to the service performance of the channel to be synchronized, so that the waiting operation with the preset paging duration can ensure that the channel to be synchronized responds normally to subsequent data synchronization tasks.
[0046] On this basis, the above-mentioned data synchronization method can also include: S140, if yes, i.e., the first data synchronization task currently called is located on the current synchronization page, the first data synchronization task currently called is executed to synchronize data, thereby continuing to complete the data synchronization task in the current synchronization page.
[0047] The technical scheme of the embodiment of the present application determines the to-be-synchronized enterprises associated with the received data synchronization instruction on the to-be-synchronized channel, acquires a data synchronization list containing data synchronization tasks corresponding to each to-be-synchronized enterprise, the data synchronization task is a task for synchronizing enterprise data of the corresponding to-be-synchronized enterprise, and each data synchronization task is divided into at least two data synchronization pages; a certain data synchronization task is called from the data synchronization list, and it is determined whether the first data synchronization task currently called is located in the current synchronization page of the second data synchronization task last called, the current synchronization page is one of the data synchronization pages, thereby determining whether the number of data synchronization tasks responded by the to-be-synchronized channel in a short time can cause the to-be-synchronized channel to appear a response bottleneck; if not, it means that the to-be-synchronized channel can appear a response bottleneck at this time, then a waiting operation with a preset paging time length can be performed to restore the service performance of the to-be-synchronized channel after it is determined that each data synchronization task belonging to the current synchronization page is executed, and then the first data synchronization task currently called is executed to perform data synchronization after the waiting operation is executed, thereby ensuring the effective execution of each data synchronization task. The above technical scheme divides each data synchronization task into pages, waits for a preset paging time length after each data synchronization task on the same data synchronization page is executed, and then executes each data synchronization task on the next data synchronization page, thereby reducing the possibility of the to-be-synchronized channel appearing a response bottleneck, and thereby achieving accurate and timely data synchronization when facing the data synchronization demand of multiple channels and multiple enterprises.
[0048] An optional technical solution, after if no, the data synchronization method can further include: adjusting the first preset end identifier corresponding to the data synchronization server, and reading the second preset end identifier, wherein the second preset end identifier is set according to the adjustment result of the first preset end identifier; determine whether each data synchronization task belonging to the current synchronization page is executed according to the read second preset end identifier. Wherein, the first preset end identifier can represent whether the data synchronization server has executed all the data synchronization tasks that can be called in the current synchronization page, so when the data synchronization server determines that the first data synchronization task currently called is not located in the current synchronization page, it means that the second data synchronization task called last time has been executed (because after executing a data synchronization task, the next data synchronization task will be called), the first preset end identifier corresponding to itself can be adjusted. The second preset end identifier can represent whether each data synchronization task on the current synchronization page is executed. The significance of setting the first preset end identifier and the second preset end identifier at the same time is that in actual application, there can be at least two data synchronization servers on the enterprise toolbox to synchronize enterprise data at the same time, so each data synchronization server can be configured with its own first preset end identifier, and then the second preset end identifier is determined according to each first preset end identifier, so that the reading result of the second preset end identifier can accurately determine whether each data synchronization task belonging to the current synchronization page has been executed. For example, assuming that there are three data synchronization servers A, B and C, taking A as an example, when it calls the data synchronization task of the next synchronization page of the current synchronization page, it adjusts the first preset end identifier corresponding to itself from 0 to 1, and then continuously reads the second preset end identifier to determine whether it is 1; B and C are similar. When the first preset end identifier of A, B and C is 1, anyone of A, B and C adjusts the second preset end identifier from 0 to 1, so that A, B and C start to call the data synchronization task on the next synchronization page when reading the second preset end identifier is 1.
[0049] In another alternative technical solution, the division of each data synchronization task can be achieved by the following steps: obtaining an upper limit of the number of tasks of each data synchronization task divided into the same data synchronization page, wherein the upper limit is determined according to the number of data synchronization server used to execute the data synchronization task; and dividing each data synchronization task according to the upper limit. Wherein, the service performance of each channel to be synchronized is limited, and similarly, the service performance of each data synchronization server is also limited, in order to avoid service bottleneck of the data synchronization server, the upper limit of the number of tasks of each data synchronization task divided into the same data synchronization page can be determined according to the number of data synchronization server, that is, the more the number of data synchronization server, the greater the upper limit, and the two are positively correlated. Of course, in addition, the upper limit can also be determined according to the service performance and high concurrency processing capacity of the channel server where the channel to be synchronized is located, the better the service performance and the stronger the high concurrency processing capacity, the greater the upper limit. After obtaining the upper limit, the data synchronization list can be paginated according to the upper limit, that is, each data synchronization task is divided into the corresponding data synchronization page. The above technical solution can determine the upper limit according to the actual service performance of the overall data synchronization server, and then divide each data synchronization task according to the upper limit, thereby ensuring the effective call of the data synchronization server to each data synchronization task.
[0050] For example, when the data synchronization list is paginated, the following two parameters can be set: the delay parameter of each page (i.e. the preset paging duration) T delay and the page size (i.e. the upper limit) P size . On this basis, assuming that the number of tasks of the data synchronization task in the data synchronization list is J total , the data synchronization list is paginated based on P size , and the number of pages of the data synchronization page obtained is: It can be seen that the greater P size , the smaller N p , the smaller the number of cycles (i.e. the number of times to reach the next data synchronization page) that need to be executed, and thus the shorter the total data synchronization time. On this basis, since the enterprise toolbox can be a distributed service, assuming that there are N server data synchronization servers, and one data synchronization thread is deployed on each data synchronization server, then the number of tasks of the data synchronization task that needs to be executed in each data synchronization page of each data synchronization server is: Since the service performance of a single data synchronization server is certain, when the number of data synchronization servers is large, P size can be reasonably increased, and the increase of P size can reduce N pFurther, assuming that the time for a single data synchronization server to perform a single data synchronization task is T1, then the total data synchronization time is: T total single *T1*N p +(N p -1)*T delay , that is: Therefore, T tbtal is positively correlated with J total , T1 and T delay , and is negatively correlated with N server and P size .
[0051] Embodiment Two
[0052] Figure 3 is a flowchart of a data synchronization method provided in Embodiment Two of the present application. The present embodiment is optimized on the basis of the technical solutions in the above embodiments. In the present embodiment, optionally, determining whether the currently invoked first data synchronization task is located in the current synchronization page where the last invoked second data synchronization task is located can include: querying a task state identifier corresponding to the currently invoked first data synchronization task, and determining whether the currently invoked first data synchronization task has been executed according to the query result; if not, determining whether the currently invoked first data synchronization task is located in the current synchronization page where the last invoked second data synchronization task is located; the data synchronization method can further include: modifying the task state identifier to lock the currently invoked first data synchronization task. The explanations of the same or corresponding terms in the above embodiments are not repeated here.
[0053] Referring to Figure 3 , the method of the present embodiment can specifically include the following steps:
[0054] S210, upon receiving a data synchronization instruction, determining a to-be-synchronized enterprise associated with the data synchronization instruction on a to-be-synchronized channel, and obtaining a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise, wherein each data synchronization task located in the data synchronization list is divided into at least two data synchronization pages.
[0055] S220, invoking a data synchronization task from the data synchronization list, and querying a task state identifier corresponding to the currently invoked first data synchronization task, and determining whether the currently invoked first data synchronization task has been executed according to the query result.
[0056] The task state identifier can represent whether the corresponding data synchronization task has been executed by the remaining data synchronization servers or the remaining threads deployed on the data synchronization server. Therefore, by querying the task state identifier corresponding to the first data synchronization task called currently, it can be determined whether the first data synchronization task has been executed.
[0057] In S230, if no, it is determined whether the first data synchronization task called currently is located in the current synchronization page where the second data synchronization task called last time is located, and the task state identifier is modified to lock the first data synchronization task called currently. The current synchronization page is one of the data synchronization pages.
[0058] If the first data synchronization task called currently has not been executed, it can be determined whether the first data synchronization task is located in the current synchronization page and is locked to avoid being executed by the remaining data synchronization servers and / or threads. In actual application, the determination of the current synchronization page and the locking operation can be performed simultaneously, sequentially or reversely, which is not limited herein. For example, the first data synchronization task called currently can be locked first, and then it is determined whether the first data synchronization task is located in the current synchronization page, so as to avoid the situation that the first data synchronization task is executed by the remaining data synchronization servers and / or threads during the determination of whether the first data synchronization task is located in the current synchronization page, i.e. to avoid the situation that the same data synchronization task is executed repeatedly.
[0059] On this basis, the data synchronization method can further include: if yes, i.e. according to the query result, it is determined that the first data synchronization task called currently has been executed, the step of calling the data synchronization task from the data synchronization list is repeated, i.e. the next data synchronization task is called again, so as to ensure the effective execution of the data synchronization tasks in sequence.
[0060] In S240, if no, after it is determined that all the data synchronization tasks in the current synchronization page have been executed, a waiting operation with a preset page duration is performed, and after the waiting operation is performed, the first data synchronization task called currently is executed to perform data synchronization.
[0061] On this basis, the data synchronization method can further include: in S250, if yes, i.e. the first data synchronization task called currently is located in the current synchronization page, the first data synchronization task called currently is executed to perform data synchronization. Alternatively, after the first data synchronization task called currently is executed to perform data synchronization, the data synchronization method can further include: the task state identifier is modified to release the lock on the first data synchronization task called currently, so as to ensure that the first data synchronization task called currently can be executed again when the data synchronization of the channel to be synchronized is performed next time.
[0062] The technical solution of the embodiment of the present application queries the task state identifier corresponding to the first data synchronization task currently invoked, and if it is determined according to the query result that the first data synchronization task currently invoked has not been executed, the task state identifier is modified to lock the first data synchronization task currently invoked, thereby ensuring that the same data synchronization task will not be invoked repeatedly, and further ensuring data consistency and data deduplication.
[0063] In order to better understand the specific implementation process of each step, the following will be described in an exemplary manner with specific examples. Exemplarily, referring to Figure 4 , continue to take A, B and C in the above example as an example, the enterprise toolbox executes the timing task in a timer mode, such as controlling A, B and C to acquire the data synchronization list from the preset database and execute the data synchronization task channel_job in a paging manner every day. Take A as an example, after invoking a certain channel_job, it first queries whether the task state identifier isRunning of the channel_job is 1. If yes, it indicates that the channel_job has been executed by B or C and is locked, then A skips the channel_job and continues to query the isRunning of the next channel_job; otherwise (i.e. isRunning is 1), it indicates that the channel_job has not been executed by B or C, then the channel_job is executed and the isRunning is set to 1, and after the execution of the channel_job, the isRunning is set to 0 (i.e. the lock is released). In practical application, optionally, when a to-be-synchronized channel is added, a data synchronization list can be added in the preset database, and the number of channel_jobs in the added data synchronization list is consistent with the number of to-be-synchronized enterprises under the added to-be-synchronized channel.
[0064] For a user in a to-be-synchronized enterprise, if the user wants to apply to access a certain application software on the enterprise toolbox, the user needs to log in to the application software first. In order to improve the user perception, a single sign-on mode is set in the enterprise toolbox, that is, the user only needs to log in once on the channel server where the to-be-synchronized channel is located, and then when the user applies to access the application software in the enterprise toolbox, the channel server only needs to call the user identity authentication interface channelAuthLogin, and does not need to input the username and password again for login operation. On this basis, an optional user login scheme is that the to-be-logged-in user (that is, the user to be logged in to the to-be-logged-in application, the to-be-logged-in application is the to-be-logged-in application software) first enters the homepage of the enterprise toolbox, and then logs in to the to-be-logged-in application by triggering the application identifier set on the homepage. The above-mentioned mode is suitable for the case that the enterprise administrator of the to-be-synchronized enterprise enters the enterprise toolbox and first opens the to-be-logged-in application, at this time, whether it is an enterprise administrator can be specified through a certain field in channelAuthLogin such as isConfig, wherein the enterprise administrator can have the permission to set various enterprise data. The specific process of the above-mentioned mode is described in detail in the following Figure 5a When the to-be-logged-in user logs in to the channel server, the data synchronization server can obtain the username and password (that is, Token) input by the to-be-logged-in user on the channel server, and then returns the application link corresponding to the application identifier triggered by the to-be-logged-in user on the homepage to the channel server, so that the channel server logs in to the application server through the Token and the application link; further, the application server obtains the user data of the to-be-logged-in user from the data synchronization server, so that the to-be-logged-in user can normally apply the to-be-logged-in application. Another optional user login scheme is described as follows:
[0065] Based on any of the above technical solutions, the data synchronization method may optionally include: upon detecting a user login event, obtaining the application identifier of the application to be logged in and the user token of the user to be logged in, wherein the user login event is triggered when the channel server where the synchronization channel is located calls the application login interface deployed on the data synchronization server based on the received user token and application identifier; determining the application link corresponding to the application identifier, and sending the application link to the channel server so that the channel server can jump to the application server where the application to be logged in is located based on the application link, user token, and application identifier. The user login event can be an event where the user wants to log in to the application to be logged in. It can be an event triggered when the data synchronization server detects that the data synchronization interface has been called after the channel server receives the user token and application identifier entered by the user to be logged in, and then calls the application login interface deployed on the data synchronization server based on the user token and application identifier. In practical applications, optionally, the user token can be the username and password entered by the user to be logged in on the channel server, and the application identifier can be the identifier of the application to be logged in triggered by the user on the display page of the synchronization channel, which can be represented in various forms such as icons and text. Alternatively, the aforementioned application login interface, `appLogin`, can be a standardized interface provided by the enterprise toolkit. It can be deployed on the data synchronization server or simultaneously on the application server; no specific limitations are specified here. Furthermore, the data synchronization server determines the application link URL corresponding to the application identifier `appId` and returns the URL to the channel server. This allows the channel server to redirect to the application server containing the application to be logged in based on the URL, user token, and `appId`. For example, this redirection can be performed by calling `appLogin` deployed on the application server. See [example...] Figure 5b 1.1 in the middle.
[0066] Optionally, the above data synchronization method may further include: upon receiving a user authentication instruction, sending the user token corresponding to the user authentication instruction to the application server, so that the application server can authenticate the user identity of the user to be logged in based on the user token sent by the channel server and the user token sent by the data synchronization server. The user authentication instruction can be an instruction used to authenticate the user identity of the user to be logged in. In practical applications, optionally, it can be an instruction sent by the application server by calling `channelAuthLogin` deployed on the data synchronization server. For example, see [link to example]. Figure 5b1.2. The data synchronization server sends the user token corresponding to the user identity authentication instruction to the application server, so that the application server compares the user token sent by the channel server and the user token sent by the data synchronization server, and authenticates the user identity of the user to be logged in according to the comparison result. When the user identity authentication of the user to be logged in is successful, the user to be logged in can directly jump to the application server through the channel server. For example, see Figure 5b 1.3 in FIG. 1. Thus, the user to be logged in does not need to enter the homepage of the enterprise toolbox, and the user perception is improved. In actual application, the above-mentioned user identity authentication process can be performed during the process of jumping from the channel server to the application server.
[0067] Alternatively, the above-mentioned data synchronization method can further include: when the data acquisition instruction is received, obtaining the user data of the user to be logged in corresponding to the data acquisition instruction from the synchronized enterprise data, and sending the user data to the application server. Wherein, the data acquisition instruction can be an instruction used by the application server to obtain the user data of the user to be logged in from the data synchronization server. After receiving the data acquisition instruction, the data synchronization server can obtain the user data of the user to be logged in from the synchronized enterprise data, and then return it to the application server, so that the user to be logged in can normally apply the application to be logged in. For example, see Figure 5b 2 and 3 in FIG. 1.
[0068] In actual application, the login process of the data synchronization server can use the static password plus graphic verification code double verification mode, which can effectively prevent brute force cracking; and the registration function can use the SMS verification code plus graphic verification code mode, which can effectively prevent the SMS bomb risk, and can also set the number of times per day and the SMS sending interval limit for SMS verification code acquisition.
[0069] On the basis of any of the above technical solutions, optionally, the data synchronization method further comprises: when detecting an application listing event, obtaining application information of a to-be-listed application corresponding to the application listing event and channel information of a to-be-synchronized channel associated with the to-be-listed application, wherein the to-be-synchronized enterprises on the to-be-synchronized channel associated with the to-be-listed application include enterprises allowed to use the to-be-listed application; recording the application information and the channel information, and sending an application listing audit notification to an audit client where an audit object responsible for auditing whether the to-be-listed application is listed or not is located. The application listing event can be an event that a certain to-be-listed application on an application server is ready to be listed on a data synchronization server. The to-be-listed application can be a to-be-listed application software. The application information can be attribute information of the to-be-listed application. The channel information can be attribute information of a to-be-synchronized channel that can use the to-be-listed application, i.e., each to-be-synchronized enterprise under the to-be-synchronized channel can be an enterprise allowed to use the to-be-listed application. After recording the application information and the channel information and sending the application listing audit notification to the audit client where the audit object responsible for auditing whether the to-be-listed application is listed or not is located, the audit object can determine whether the to-be-listed application is allowed to access the enterprise toolbox based on the application information and the channel information. The above technical solution can effectively manage the listing process of the to-be-listed application, and can provide personalized application resource packages for to-be-synchronized enterprises under a to-be-synchronized channel according to channel information of the to-be-synchronized channel (i.e., characteristics of the to-be-synchronized channel), so that the to-be-synchronized enterprises can open and use according to actual business needs.
[0070] To better understand the specific implementation process of each step, the following exemplary description is given in conjunction with specific examples. Exemplarily, see Figure 6 When listing a certain to-be-listed application to the enterprise toolbox, the application publisher of the to-be-listed application can first register as an application developer on the enterprise toolbox, and then create an application to trigger an application listing event and initiate an application listing process. Specifically, the application developer designs a database table to fill in application information, wherein app_status can mark the state of the to-be-listed application app, such as to-be-listed, listing audit, listing audit failure, listed, deleted, etc. The application developer designs a database table to associate the association relationship between the to-be-listed application and the to-be-synchronized channel (i.e., select channel information), thereby specifying which to-be-synchronized enterprises under the to-be-synchronized channel can open and use the to-be-listed application. When the application developer performs related operations such as application listing and delisting, the corresponding records can be made in the table, and then the enterprise toolbox administrator and the application developer can update, view and / or audit the table during the app listing and delisting process. In actual application, optionally, a charging mode such as free, monthly charge, annual charge, etc. can be set when listing the to-be-listed application software, which is not limited herein.
[0071] Embodiment Three
[0072] Figure 7 is a flowchart of a data synchronization method provided in Embodiment Three of the present application. The present embodiment is optimized on the basis of the technical solutions of the above-mentioned embodiments. In the present embodiment, optionally, performing the first data synchronization task currently invoked to synchronize data can include: obtaining task parameters in the first data synchronization task currently invoked, wherein the task parameters include enterprise identifiers of the enterprises to be synchronized; invoking a data synchronization interface deployed on a channel server based on the task parameters, wherein a data synchronization function associated with the data synchronization interface is a function for standardizing and / or normalizing enterprise data of the enterprises to be synchronized corresponding to the enterprise identifiers, and the channel server is a server where the channel to be synchronized is located; obtaining the enterprise data of the enterprises to be synchronized corresponding to the enterprise identifiers, and synchronizing the obtained enterprise data to a target database. Wherein, the same or corresponding explanations of the terms in the above-mentioned embodiments are not repeated here.
[0073] Referring to Figure 7 , the method of the present embodiment can specifically include the following steps:
[0074] S310, upon receiving a data synchronization instruction, determining a to-be-synchronized enterprise associated with the data synchronization instruction on a to-be-synchronized channel, and obtaining a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages.
[0075] S320, invoking a data synchronization task from the data synchronization list, and determining whether a first data synchronization task currently invoked is located in a current synchronization page where a first data synchronization task last invoked is located, wherein the current synchronization page is one of the data synchronization pages.
[0076] S330, if not, after determining that each data synchronization task in the current synchronization page is executed, performing a waiting operation with a preset paging time length, and after the waiting operation is performed, obtaining task parameters in the first data synchronization task currently invoked, wherein the task parameters include enterprise identifiers of the to-be-synchronized enterprises.
[0077] Wherein, the enterprise identifier can be used to uniquely identify a to-be-synchronized enterprise, so according to the enterprise identifier, it can be determined which enterprise data of the to-be-synchronized enterprise is synchronized by the first data synchronization task currently invoked.
[0078] S340, calling the data synchronization interface deployed on the channel server based on the task parameter, wherein the data synchronization function associated with the data synchronization interface is a function for standardizing and / or normalizing the enterprise data of the to-be-synchronized enterprise corresponding to the enterprise identifier, and the channel server is a server where the to-be-synchronized channel is located.
[0079] The data synchronization interface can be a unified data connection interface provided by the enterprise toolbox. The data synchronization interface is deployed on the channel server, so that the data synchronization server can call the data synchronization interface based on the task parameter to synchronize the enterprise data corresponding to the task parameter. It should be emphasized that, since the data formats of the enterprise data can be different, in order to better integrate the enterprise data by the enterprise toolbox, the data synchronization function associated with the data synchronization interface can be a function for standardizing and / or normalizing the enterprise data, that is, the enterprise data obtained from the data synchronization interface is already standardized and / or normalized. In actual application, optionally, the data synchronization interface can be as shown in Table 1:
[0080] Table 1 data synchronization interface
[0081] Serial Number API Name Function 1 queryUserList Get user list 2 countUserList Get total number of users 3 countUserCompany Get total number of enterprise user relationships 4 queryUserCompany Get enterprise user 5 countUserOrg Get total number of organization user relationships 6 queryUserOrg Get department user 7 countRoleList Get total number of roles 8 queryRoleList Get role list 9 queryUserRole Get user role relationship 10 countCompanyList Get total number of enterprises 11 queryCompanyList Get enterprise list 12 countOrgList Get total number of organizations 13 queryOrgList Get department list
[0082] S350, obtaining the enterprise data of the to-be-synchronized enterprise corresponding to the enterprise identifier, and synchronizing the obtained enterprise data to the target database.
[0083] The obtained enterprise data is synchronized to the target database, such as updating the existing enterprise data in the target database, inserting the non-existing enterprise data, etc., which is not limited here. The target database can be a MySQL database, an ES database, etc., which is not limited here.
[0084] The technical scheme of the embodiment of the application, by calling the data synchronization interface deployed on the channel server based on the task parameter obtained in the first data synchronization task currently called, since the data synchronization interface is provided by the enterprise toolbox and is associated with the data synchronization function capable of standardizing and / or normalizing the enterprise data of the to-be-synchronized enterprise corresponding to the task parameter, the obtained enterprise data can be directly applied by the enterprise toolbox, and they are synchronized to the target database. The above technical scheme, the enterprise toolbox provides a standardized data synchronization interface, realizes the effect of multi-channel and multi-enterprise access without increasing the connection cost due to the increase of the to-be-synchronized channel, and further realizes the effect of effective acquisition of standardized enterprise data.
[0085] In an optional technical solution, the task parameter further comprises a channel identifier of the channel to be synchronized, and the data synchronization function is further configured to compare the channel identifier with a preset identifier of the channel to be synchronized on which the data synchronization interface is deployed; and / or, the enterprise identifier comprises an encrypted identifier of the enterprise to be synchronized, and the task parameter further comprises a check code obtained by encrypting the unencrypted enterprise identifier based on a preset encryption algorithm, and the data synchronization function is further configured to decrypt the enterprise identifier based on the check code and a preset decryption algorithm corresponding to the preset encryption algorithm. The channel identifier can be used to uniquely identify a channel to be synchronized. After the channel identifier is passed to the data synchronization interface, the data synchronization function associated with the data synchronization interface can compare the received channel identifier with the preset identifier of the channel to be synchronized stored in advance, so as to determine whether the data synchronization task is used to synchronize enterprise data of the enterprise to be synchronized on the channel to be synchronized on which the data synchronization interface is deployed, that is, whether the data synchronization task matches the channel to be synchronized on which the data synchronization interface is deployed, thereby ensuring the accuracy of data synchronization. In order to ensure the privacy of the task parameter during transmission, the task parameter can be an encrypted parameter, such as an encrypted enterprise identifier, an encrypted channel identifier, and a check code obtained by encrypting the unencrypted enterprise identifier and / or channel identifier based on a preset encryption algorithm. For example, when the preset encryption algorithm is an md5 encryption algorithm, uniqueCode=MD5DigestAsHex(chCode+comId), wherein uniqueCode is the check code, chCode is the unencrypted channel identifier, and comId is the unencrypted enterprise identifier. Thus, the data synchronization function can further be configured to decrypt the enterprise identifier and / or channel identifier based on the check code and a preset decryption algorithm corresponding to the preset encryption algorithm. In actual application, the enterprise data obtained after the data synchronization interface is called can also carry the enterprise identifier and / or channel identifier, or a composite weight of the two, thereby uniquely identifying the ownership of the enterprise data.
[0086] Embodiment Four
[0087] Figure 8 A structural block diagram of the data synchronization device provided in Embodiment Four of the present application is shown in FIG. 4. The device is configured in a data synchronization server and is used to execute the data synchronization method provided in any of the above embodiments. The device and the data synchronization method of each of the above embodiments belong to the same inventive concept. Details not described in the embodiment of the data synchronization device can be referred to the above embodiments of the data synchronization method. Referring to FIG. 4, the device can specifically comprise a data synchronization list obtaining module 410, a data synchronization task determining module 420, and a data synchronization module 430. Figure 8
[0088] The data synchronization list obtaining module 410 is configured to, when receiving the data synchronization instruction, determine the to-be-synchronized enterprises associated with the data synchronization instruction on the to-be-synchronized channel, and obtain a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages.
[0089] The data synchronization task determining module 420 is configured to call the data synchronization task from the data synchronization list, and determine whether a first data synchronization task currently called is located in a current synchronization page of a second data synchronization task last called, wherein the current synchronization page is one of the data synchronization pages.
[0090] The data synchronization module 430 is configured to, if no, perform a waiting operation with a preset page duration after determining that each data synchronization task in the current synchronization page is executed, and perform the first data synchronization task currently called to perform data synchronization after the waiting operation is performed.
[0091] Optionally, the data synchronization task determining module 420 can include:
[0092] The data synchronization task judging unit is configured to query a task state identifier corresponding to the first data synchronization task currently called, and determine whether the first data synchronization task currently called is executed according to a query result.
[0093] The data synchronization task determining unit is configured to, if no, determine whether the first data synchronization task currently called is located in the current synchronization page of the second data synchronization task last called.
[0094] Correspondingly, the data synchronization device can further include:
[0095] The data synchronization task locking module is configured to modify the task state identifier to lock the first data synchronization task currently called.
[0096] On this basis, optionally, the data synchronization device can further include:
[0097] The data synchronization task calling module is configured to, if it is determined according to the query result that the first data synchronization task currently called is executed, perform again the step of calling the data synchronization task from the data synchronization list.
[0098] Further optionally, the data synchronization device can further include:
[0099] The data synchronization task release module is configured to modify the task state identifier to release the lock on the first data synchronization task after executing the first data synchronization task to perform data synchronization.
[0100] Optionally, the data synchronization device can further include:
[0101] The second preset end identifier reading module is configured to adjust the first preset end identifier corresponding to the data synchronization server and read a second preset end identifier if the result is no, wherein the second preset end identifier is set according to the adjustment result of the first preset end identifier.
[0102] The data synchronization task judgment module is configured to determine whether all data synchronization tasks in the current synchronization page are executed according to the read second preset end identifier.
[0103] Optionally, the data synchronization device can further include:
[0104] The data resynchronization module is configured to repeatedly execute the first data synchronization task to perform data synchronization if the result is yes.
[0105] Optionally, the division of the data synchronization tasks is implemented by the following modules:
[0106] The upper limit obtaining module is configured to obtain an upper limit of the number of data synchronization tasks divided into the same data synchronization page, wherein the upper limit is determined according to the number of data synchronization servers used to execute the data synchronization tasks.
[0107] The data synchronization task division module is configured to divide the data synchronization tasks according to the upper limit.
[0108] Optionally, the data synchronization module 430 can include:
[0109] The task parameter obtaining unit is configured to obtain a task parameter in the first data synchronization task, wherein the task parameter includes an enterprise identifier of a to-be-synchronized enterprise.
[0110] The data synchronization interface calling unit is configured to call a data synchronization interface deployed on a channel server based on the task parameter, wherein a data synchronization function associated with the data synchronization interface is a function used to standardize and / or normalize enterprise data of the to-be-synchronized enterprise corresponding to the enterprise identifier, and the channel server is a server where the to-be-synchronized channel is located.
[0111] The data synchronization unit is configured to obtain enterprise data of the to-be-synchronized enterprise corresponding to the enterprise identifier and synchronize the obtained enterprise data to a target database.
[0112] On this basis, optionally, the task parameter further comprises a channel identifier of the channel to be synchronized, and the data synchronization function is further configured to compare the channel identifier with a preset identifier of the channel to be synchronized on which the data synchronization interface is deployed; and / or,
[0113] The enterprise identifier comprises an encrypted identifier of the enterprise to be synchronized, and the task parameter further comprises a check code obtained by encrypting an unencrypted enterprise identifier based on a preset encryption algorithm, and the data synchronization function is further configured to decrypt the enterprise identifier based on the check code and a preset decryption algorithm corresponding to the preset encryption algorithm.
[0114] Optionally, the data synchronization apparatus further comprises:
[0115] The user token obtaining module is configured to obtain an application identifier of the application to be logged in and a user token of the user to be logged in corresponding to the user login event when detecting the user login event, wherein the user login event is an event triggered by a channel service server on which the channel to be synchronized is located when calling an application login interface deployed on the data synchronization service server based on the received user token and the application identifier.
[0116] The application link determining module is configured to determine an application link corresponding to the application identifier and send the application link to the channel service server, so that the channel service server jumps to the application service server on which the application to be logged in is located according to the application link, the user token and the application identifier.
[0117] On this basis, optionally, the data synchronization apparatus further comprises:
[0118] The user token sending module is configured to send a user token corresponding to the user identity authentication instruction to the application service server when receiving the user identity authentication instruction, so that the application service server authenticates the user identity of the user to be logged in according to the user token sent by the channel service server and the user token sent by the data synchronization service server; and / or,
[0119] The user data sending module is configured to obtain user data of the user to be logged in corresponding to the data acquisition instruction from the synchronized enterprise data when receiving the data acquisition instruction, and send the user data to the application service server.
[0120] Optionally, the data synchronization apparatus further comprises:
[0121] The channel information obtaining module is configured to obtain application information of the application to be uploaded and channel information of the channel to be synchronized associated with the application to be uploaded when detecting the application uploading event, wherein the enterprise to be synchronized associated with the application to be uploaded comprises an enterprise allowed to use the application to be uploaded.
[0122] The application on-shelf auditing notification sending module is configured to record application information and channel information, and send the application on-shelf auditing notification to an auditing client where an auditing object responsible for auditing whether the application to be on-shelved is on-shelved is located.
[0123] The data synchronization device provided in the fourth embodiment of the present application determines the to-be-synchronized enterprises associated with the received data synchronization instruction on the to-be-synchronized channel through the data synchronization list acquisition module, acquires a data synchronization list containing data synchronization tasks corresponding to each to-be-synchronized enterprise, wherein the data synchronization task is a task for synchronizing the enterprise data of the corresponding to-be-synchronized enterprise, and each data synchronization task is divided into at least two data synchronization pages; the data synchronization task determination module determines whether the first data synchronization task currently called is located in the current synchronization page of the second data synchronization task last called, the current synchronization page being one of the data synchronization pages, thereby determining whether the number of data synchronization tasks responded by the to-be-synchronized channel in a short time can cause the to-be-synchronized channel to appear a response bottleneck; if not, it indicates that the to-be-synchronized channel can appear a response bottleneck at this time, so that a waiting operation with a preset paging time length can be performed to restore the service performance of the to-be-synchronized channel after determining that each data synchronization task belonging to the current synchronization page is executed, and then the first data synchronization task currently called is executed to perform data synchronization, thereby ensuring the effective execution of each data synchronization task. The above device divides each data synchronization task into pages, waits for a preset paging time length after each data synchronization task on the same data synchronization page is executed, and then executes each data synchronization task on the next data synchronization page, thereby reducing the possibility of the to-be-synchronized channel appearing a response bottleneck, and further achieving accurate and timely data synchronization when facing the data synchronization demand of multiple channels and multiple enterprises.
[0124] The data synchronization device provided in the embodiments of the present application can execute the data synchronization method provided in any embodiment of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0125] It should be noted that in the embodiments of the above data synchronization device, each unit and module included is only divided according to the function logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, the specific name of each functional unit is only for convenient mutual distinction, and does not limit the protection scope of the present application.
[0126] Embodiment five
[0127] Figure 9 The structural schematic diagram of the data synchronization server provided in the fifth embodiment of the present application is as follows, Figure 9As shown, the server includes a memory 510, a processor 520, an input device 530, and an output device 540. The number of processors 520 in the server can be one or more, Figure 9 The memory 510, the processor 520, the input device 530, and the output device 540 in the server can be connected through a bus or other means, Figure 9 The memory 510, the processor 520, the input device 530, and the output device 540 in the server can be connected through a bus or other means,
[0128] The memory 510 is a computer readable storage medium, which can be used to store software programs, computer executable programs, and modules, such as program instructions / modules corresponding to the data synchronization method in the embodiments of the present application (for example, the data synchronization list obtaining module 410, the data synchronization task determining module 420, and the data synchronization module 430 in the data synchronization device). The processor 520 performs various functional applications and data processing of the server by running the software programs, instructions, and modules stored in the memory 510, that is, implements the above-mentioned data synchronization method.
[0129] The memory 510 can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the server, etc. In addition, the memory 510 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state memory device. In some examples, the memory 510 can further include a memory remotely arranged with respect to the processor 520, which can be connected to the device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0130] The input device 530 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 540 can include a display device such as a display screen.
[0131] Embodiment six
[0132] Embodiment six of the present application provides a storage medium containing computer executable instructions, which when executed by a computer processor, are used to execute a data synchronization method. The method is configured in a data synchronization server, which can include:
[0133] When the data synchronization instruction is received, a to-be-synchronized enterprise corresponding to the data synchronization instruction on a to-be-synchronized channel is determined, a data synchronization list containing data synchronization tasks respectively used for synchronizing enterprise data of each to-be-synchronized enterprise is acquired, and each data synchronization task in the data synchronization list is divided into at least two data synchronization pages;
[0134] The data synchronization task is called from the data synchronization list, and it is determined whether a first data synchronization task currently called is located in a current synchronization page of a second data synchronization task last called, wherein the current synchronization page is one of the data synchronization pages;
[0135] If no, after it is determined that each data synchronization task in the current synchronization page is executed, a waiting operation with a preset paging duration is performed, and after the waiting operation is performed, the first data synchronization task currently called is executed to perform data synchronization.
[0136] Of course, the storage medium containing computer executable instructions provided by the embodiment of the present application is not limited to the method operations described above, and can also perform related operations in the data synchronization method provided by any embodiment of the present application.
[0137] Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary general hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment. According to such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a FLASH, a hard disk or an optical disk, etc., including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0138] Note that the above is only the preferred embodiment of the present application and the technical principle applied. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and those skilled in the art can make various obvious changes, readjustments and substitutions without departing from the scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A data synchronization method, characterized in that, The method, applied to a data synchronization server, includes: Upon receiving a data synchronization instruction, the enterprise to be synchronized on the channel to be synchronized corresponding to the data synchronization instruction is determined, and a data synchronization list containing data synchronization tasks for synchronizing enterprise data of each of the enterprises to be synchronized is obtained, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages. The data synchronization task is invoked from the data synchronization list, and it is determined whether the currently invoked first data synchronization task is located on the current synchronization page where the previously invoked second data synchronization task is located, wherein the current synchronization page is one of the data synchronization pages; If not, after determining that all data synchronization tasks belonging to the current synchronization page have been completed, a waiting operation with a waiting time of a preset page duration is performed, and after the waiting operation is completed, the currently invoked first data synchronization task is executed to perform data synchronization.
2. The method according to claim 1, characterized in that, Determining whether the currently invoked first data synchronization task is located on the current synchronization page where the previously invoked second data synchronization task was located includes: Query the task status identifier corresponding to the currently invoked first data synchronization task, and determine whether the currently invoked first data synchronization task has been executed based on the query result; If not, determine whether the currently invoked first data synchronization task is located on the current synchronization page where the previously invoked second data synchronization task was located; The method further includes: Modify the task status identifier to lock the currently invoked first data synchronization task.
3. The method according to claim 2, characterized in that, Also includes: If the query result determines that the currently invoked first data synchronization task has been executed, then the step of invoking the data synchronization task from the data synchronization list is executed again.
4. The method according to claim 2, characterized in that, After executing the currently invoked first data synchronization task to perform data synchronization, the method further includes: Modify the task status flag to release the lock on the currently invoked first data synchronization task.
5. The method according to claim 1, characterized in that, Following the "if not" statement, it also includes: The first preset end identifier corresponding to the data synchronization server is adjusted, and the second preset end identifier is read, wherein the second preset end identifier is set according to the adjustment result of the first preset end identifier; Based on the read second preset end identifier, determine whether all the data synchronization tasks belonging to the current synchronization page have been completed.
6. The method according to claim 1, characterized in that, Also includes: If so, the currently invoked first data synchronization task is executed repeatedly to perform data synchronization.
7. The method according to claim 1, characterized in that, The division of the data synchronization tasks is achieved through the following steps: The upper limit of the number of tasks for each of the data synchronization tasks assigned to the same data synchronization page is obtained, wherein the upper limit is determined based on the number of servers of the data synchronization server used to execute the data synchronization tasks. The data synchronization tasks are divided according to the aforementioned maximum number.
8. The method according to claim 1, characterized in that, The execution of the currently invoked first data synchronization task for data synchronization includes: Obtain the task parameters from the currently invoked first data synchronization task, wherein the task parameters include the enterprise identifier of the enterprise to be synchronized; The data synchronization interface deployed on the channel server is called based on the task parameters. The data synchronization function associated with the data synchronization interface is a function used to standardize and / or normalize the enterprise data of the enterprise to be synchronized corresponding to the enterprise identifier. The channel server is the server where the channel to be synchronized is located. Obtain the enterprise data of the enterprise to be synchronized corresponding to the enterprise identifier, and synchronize the obtained enterprise data to the target database.
9. The method according to claim 8, characterized in that, The task parameters also include the channel identifier of the channel to be synchronized, and the data synchronization function is further used to compare the channel identifier with a preset identifier of the channel to be synchronized that has the data synchronization interface deployed; and / or, The enterprise identifier includes the encrypted identifier of the enterprise to be synchronized. The task parameters also include a verification code that encrypts the unencrypted enterprise identifier based on a preset encryption algorithm. The data synchronization function is further used to decrypt the enterprise identifier based on the verification code and a preset decryption algorithm corresponding to the preset encryption algorithm.
10. The method according to claim 1, characterized in that, Also includes: When a user login event is detected, the application identifier of the application to be logged in and the user token of the user to be logged in are obtained, wherein the user login event is an event triggered when the channel server where the channel to be synchronized is located calls the application login interface deployed on the data synchronization server based on the received user token and the application identifier. The application link corresponding to the application identifier is determined and sent to the channel server so that the channel server can redirect to the application server where the application to be logged in is located based on the application link, the user token and the application identifier.
11. The method according to claim 10, characterized in that, Also includes: When a user authentication instruction is received, the user token corresponding to the user authentication instruction is sent to the application server so that the application server can authenticate the user identity of the user to be logged in based on the user token sent by the channel server and the user token sent by the data synchronization server. And / or, Upon receiving a data retrieval instruction, the system retrieves the user data of the user to be logged in corresponding to the data retrieval instruction from the synchronized enterprise data and sends the user data to the application server.
12. The method according to claim 1, characterized in that, Also includes: When an application listing event is detected, the application information of the application to be listed corresponding to the application listing event and the channel information of the channel to be synchronized associated with the application to be listed are obtained, wherein the enterprises to be synchronized associated with the channel to be synchronized associated with the application to be listed include enterprises that allow the application to be listed to be listed. Record the application information and the channel information, and send the application listing review notification to the review client of the review object responsible for reviewing whether the application to be listed should be listed.
13. A data synchronization device, characterized in that, Configured on the data synchronization server, the device includes: The data synchronization list acquisition module is used to determine the enterprise to be synchronized on the synchronization channel corresponding to the data synchronization instruction when a data synchronization instruction is received, and to acquire a data synchronization list containing data synchronization tasks for synchronizing enterprise data of each enterprise to be synchronized, wherein each data synchronization task in the data synchronization list is divided into at least two data synchronization pages. The data synchronization task determination module is used to call a data synchronization task from the data synchronization list and determine whether the currently called first data synchronization task is located on the current synchronization page where the previously called second data synchronization task is located, wherein the current synchronization page is one of the data synchronization pages; The data synchronization module is used to, if not, perform a waiting operation with a preset page duration after determining that all data synchronization tasks belonging to the current synchronization page have been completed, and after the waiting operation is completed, execute the currently invoked first data synchronization task to perform data synchronization.
14. A data synchronization server, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data synchronization method as described in any one of claims 1-12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data synchronization method as described in any one of claims 1-12.
Citation Information
Patent Citations
Resource allocation method, resource manager, resource server and system
CN103810045A
Parallel task processing method and device
CN106990943A