Information Synchronization Method, Device, Electronic Device and Medium

By comparing the personnel database verification information of the attendance client and the access control equipment, the problem of data inconsistency in the attendance management system is solved, and two-way synchronization and data consistency are achieved.

CN114648820BActive Publication Date: 2025-05-27ZHEJIANG UNIVIEW TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011501074.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2025-05-27
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

The existing attendance management system cannot realize two-way data synchronization between the attendance client and the access control device, resulting in inconsistency of data.

Method used

By obtaining the personnel database verification information on both ends, comparing the personnel identification and personnel information hash values, determining the information consistency, and synchronizing operations based on the comparison results.

Benefits of technology

It realizes two-way synchronization between the attendance client and the access control equipment to ensure data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114648820B_ABST
    Figure CN114648820B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses an information synchronization method, device, electronic device and medium. The method includes: obtaining first personnel library verification information of a first terminal and second personnel library verification information of a second terminal; comparing verification fields of the first personnel library verification information and the second personnel library verification information; wherein, the verification fields include: personnel identification and personnel information hash value; synchronizing a first personnel library of the first terminal and a second personnel library in the second terminal according to the comparison result. The above solution compares the verification fields according to the first personnel library verification information and the second personnel library verification information, so as to realize the two-way synchronization between the first terminal and the second terminal, and ensure the data consistency between the first terminal and the second terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of information synchronization, and in particular, to an information synchronization method, device, electronic device, and medium. Background Art

[0002] At present, most enterprises manage the attendance of employees through an attendance management system. The attendance management system may include fingerprint access control devices, face access control devices, attendance management software, etc.

[0003] However, the current attendance management system only supports data transmission from the attendance client to the access control device or data synchronization from the access control device to the attendance client, and cannot achieve two-way synchronization of data between the attendance client and the access control device, so it cannot guarantee the consistency of data between the attendance client and the access control device in real time. Summary of the Invention

[0004] The embodiments of the present invention provide an information synchronization method, device, electronic device, and medium to achieve two-way synchronization of the personnel databases in the first terminal and the second terminal and ensure data consistency.

[0005] In one embodiment, the embodiments of the present application provide an information synchronization method, which includes:

[0006] Obtain the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal;

[0007] Compare the verification fields of the first personnel database verification information and the second personnel database verification information; wherein, the verification fields include: personnel identifier and personnel information hash value;

[0008] Synchronize the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result.

[0009] In another embodiment, the embodiments of the present application further provide an information synchronization device, which includes:

[0010] A verification information acquisition module, configured to obtain the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal;

[0011] A comparison module, configured to compare the verification fields of the first personnel database verification information and the second personnel database verification information; wherein, the verification fields include: personnel identifier and personnel information hash value;

[0012] A synchronization module, configured to synchronize the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result.

[0013] In yet another embodiment, the embodiment of the present application further provides an electronic device, including: one or more processors;

[0014] a memory for storing one or more programs;

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the information synchronization method according to any one of the embodiments of the present application.

[0016] In still another embodiment, the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the information synchronization method according to any one of the embodiments of the present application.

[0017] In the embodiment of the present application, the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal are obtained; the verification field comparison is performed on the first personnel database verification information and the second personnel database verification information, so as to efficiently and accurately determine whether the information in the first personnel database and the second personnel database is consistent according to the verification field comparison of the first personnel database verification information and the second personnel database verification information. According to the comparison result, the first personnel database of the first terminal and the second personnel database in the second terminal are synchronized, so as to realize the two-way synchronization of the personnel databases in the first terminal and the second terminal, and ensure the consistency of the data in the first terminal and the second terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flowchart of an information synchronization method provided by an embodiment of the present invention;

[0019] Figure 2 is a schematic diagram of the personnel database structure provided by an embodiment of the present invention;

[0020] Figure 3 is a schematic diagram of the personnel database information provided by an embodiment of the present invention;

[0021] Figure 4 is a schematic diagram of the first process of the verification field comparison provided by an embodiment of the present invention;

[0022] Figure 5 is a schematic diagram of the second process of the verification field comparison provided by an embodiment of the present invention;

[0023] Figure 6 is a flowchart of an information synchronization method provided by another embodiment of the present invention;

[0024] Figure 7 is a flowchart of an information synchronization method provided by still another embodiment of the present invention;

[0025] Figure 8Schematic diagram of an information synchronization device provided by an embodiment of the present invention;

[0026] Figure 9 Schematic diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0027] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present invention, rather than limiting the present invention. Additionally, it should be noted that for the convenience of description, only the parts related to the present invention are shown in the drawings, rather than all the structures.

[0028] Figure 1 Flowchart of an information synchronization method provided by an embodiment of the present invention. The information synchronization method provided by the embodiments of the present application is applicable to the situation of synchronizing the information in the personnel database between the first terminal and the second terminal. Typically, the embodiments of the present application are applicable to the situation of two-way information synchronization between the attendance management client and the access control device. This method can be specifically executed by an information synchronization device, which can be implemented in a software and / or hardware manner, and this device can be integrated in an electronic device capable of implementing the information synchronization method. Refer to Figure 1 , the method of the embodiments of the present application specifically includes:

[0029] S110. Obtain the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal.

[0030] The embodiments of the present application can be executed by an Agent scheduling system. The Agent scheduling system can be configured in the attendance management client. The Agent performs data caching, schedules the synchronization direction and synchronization content, and efficiently synchronizes information. Through the Agent, the business of the attendance management client and the access control device is separated, enhancing the business processing ability of the attendance management client. Among them, the first terminal can be the attendance management client, and the second terminal can be the access control device. It can also be configured that the first terminal is the access control device and the second terminal is the attendance management client. The first personnel database verification information in the first terminal and the second personnel database verification information in the second terminal can be represented in the form of a graph or in the form of a table. In the embodiments of the present application, the specific implementation solution is described by taking the form of a table as an example.

[0031] In the embodiments of the present application, as Figure 2 shown, a personnel database is established in the attendance management client and the access control device, and the personnel database information is as Figure 3As shown in the figure, the personnel database includes a personnel database identifier, a personnel identifier, personnel text information, a hash value of the personnel text information, a personnel image, and a hash value of the personnel image. The personnel database identifier and the personnel identifier are unique personnel identifier fields created by the access control device. When adding a new person or library permission to the access control device on the attendance management client, after the access control device successfully adds the permission, it will return the personnel database identifier + personnel identifier or the personnel database identifier of the newly added person to the attendance management client. The attendance management client then updates its own personnel database based on the returned personnel database identifier, personnel identifier, and other information, which can ensure the consistency of the personnel database identifier and the personnel identifier of the same person in both the left and right databases. The personnel text information includes information such as the person's name, gender, affiliated department, ID number, work card number, and address. The hash value of the personnel text information is generated by performing a hash calculation on the personnel text information based on a hash algorithm, and the hash value of the personnel image is generated by performing a hash calculation on the personnel image based on a hash algorithm. The hash algorithm is an algorithm that uses a shorter piece of information to ensure the uniqueness of a file. This identifier is related to every byte of the file. When the original file changes, its identifier value also changes. Therefore, if the personnel text information is different, the hash value of the personnel text information is also different, and if the personnel image is different, the hash value of the personnel image is also different.

[0032] In the embodiment of the present application, the personnel database verification information is not all the information in the personnel database of the terminal, but a part of the information extracted from the personnel database as verification information, including the personnel database identifier, the personnel identifier, the personnel text information, the hash value of the personnel text information, and the hash value of the personnel image, without extracting the personnel image. The beneficial effect of the above solution is that the file size of the personnel image is often large, which will consume transmission resources and storage resources, and when performing personnel image comparison, it will occupy computing resources and affect the computing speed. Therefore, information with a large file size such as the personnel image is not used as verification information, and information with a small data size is used as verification information, thereby improving the transmission efficiency and computing speed, increasing the speed of verification information comparison, and further improving the efficiency of information synchronization. Table 1 and Table 2 exemplarily show the first personnel database verification information table of the attendance management client and the second personnel database verification information table of the access control device. Among them, NULL indicates that the corresponding verification information does not exist. The existence and non-existence of the verification information in Table 1 and Table 2 are only for examples and do not limit the table.

[0033] Table 1

[0034]

[0035] Table 2

[0036]

[0037] In an embodiment of the present application, the execution trigger timing of S110 may be when the access control device goes online on the attendance management client. Going online may refer to the first registration and going online, or may refer to the re - online of the access control device that has been registered on the attendance management client after going offline. It can also be manually triggered to meet more software application scenarios.

[0038] S120. Compare the verification fields of the first personnel database verification information and the second personnel database verification information; wherein, the verification fields include: personnel identification and personnel information hash value.

[0039] Exemplarily, the first personnel database verification information and the second personnel database verification information may include one or several of personnel database identification, personnel identification, personnel text information, personnel text information hash value, and personnel image hash value, and do not necessarily include all of the above verification information. For example, as shown in Table 1 and Table 2, the first personnel database verification information includes the verification information corresponding to personnel ID4, but the second personnel database verification information does not include the verification information corresponding to personnel ID4. In an embodiment of the present application, the verification fields of the first personnel database verification information and the second personnel database verification information are compared to determine which verification fields do not exist, and which verification fields exist but are inconsistent, between the first personnel database verification information and the second personnel database verification information.

[0040] S130. Synchronize the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result.

[0041] Specifically, the comparison method may be: check whether there is a personnel identification in the personnel identification of the second personnel database verification information that matches the personnel identification in the first personnel database verification information. If not, synchronize the personnel information corresponding to the personnel identification. If it exists, then determine whether the personnel information hash value in the first personnel database verification information corresponding to the same personnel identification is consistent with the personnel information hash value in the second personnel database verification information. In the case where the personnel information hash values are inconsistent, synchronize the personnel information corresponding to the personnel identification.

[0042] In an embodiment of the present application, obtain the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal; compare the verification fields of the first personnel database verification information and the second personnel database verification information, so as to efficiently and accurately determine whether the information in the first personnel database and the second personnel database is consistent according to the comparison of the verification fields of the first personnel database verification information and the second personnel database verification information. Synchronize the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result, so as to realize the two - way synchronization of the personnel databases in the first terminal and the second terminal, and ensure the consistency of the data in the first terminal and the second terminal.

[0043] In an embodiment of the present application, synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result includes: if any personnel identifier appears in the verification information of the first personnel database and does not appear in the verification information of the second personnel database, then synchronize the personnel database corresponding to this personnel identifier from the first terminal to the second terminal; if any personnel identifier appears in the verification information of the second personnel database and does not appear in the verification information of the first personnel database, then synchronize the personnel database corresponding to this personnel identifier from the second terminal to the first terminal.

[0044] The above solution is a solution adopted when a personnel identifier exists in one terminal but not in the other during the personnel identifier comparison process. It is also applicable to the personnel database identifier comparison process.

[0045] In an embodiment of the present application, the verification field further includes personnel text information, and the personnel information hash value includes a personnel text information hash value; accordingly, synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result includes: if there is a match in the personnel identifier comparison between the verification information of the first personnel database and the verification information of the second personnel database, then compare the personnel text information hash values corresponding to this personnel identifier; if the personnel text information hash value in the verification information of the first personnel database corresponding to this personnel identifier is inconsistent with the personnel text information hash value in the verification information of the second personnel database, then compare the personnel text information corresponding to this personnel identifier; if the personnel text information in the verification information of the first personnel database corresponding to this personnel identifier is inconsistent with the personnel text information in the verification information of the second personnel database, then synchronize the personnel text information in the first terminal and the personnel text information in the second terminal.

[0046] And / or, the personnel information hash value includes a personnel image hash value; accordingly, synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result includes: if there is a match in the personnel identifier comparison between the verification information of the first personnel database and the verification information of the second personnel database, then compare the personnel image hash values corresponding to this personnel identifier; if the personnel image hash value in the verification information of the first personnel database corresponding to this personnel identifier is inconsistent with the personnel image hash value in the verification information of the second personnel database, then synchronize the personnel images in the first terminal and the personnel images in the second terminal.

[0047] Exemplarily, such as Figure 4As shown, first compare the personnel library identifier in the first personnel library verification information with the personnel library identifier in the second personnel library verification information. If the comparison is inconsistent, perform a synchronization operation to synchronize the personnel library corresponding to the existing personnel library identifier to another terminal, or use the personnel library information in the attendance client as the standard to synchronize the personnel library of the attendance management client to the access control device. If the comparison is consistent, then compare the personnel identifier in the first personnel library verification information with the personnel identifier in the second personnel library verification information. If the comparison is inconsistent, perform a synchronization operation. If the personnel identifier exists in the personnel library verification information of one terminal but does not exist in the personnel library verification information of the other terminal, then synchronize the personnel library corresponding to the existing personnel identifier to the other terminal. If the comparison is consistent, enter Process A, as Figure 5 shown, compare the hash value of the personnel text information in the first personnel library verification information corresponding to the personnel identifier with the hash value of the personnel text information in the second personnel library verification information. If they are consistent, no synchronization operation is performed. If they are inconsistent, then compare the personnel text information in the first personnel library verification information corresponding to the personnel identifier with the personnel text information in the second personnel library verification information. If they are consistent, no synchronization operation is performed. If they are inconsistent, perform a personnel text information synchronization operation.

[0048] Specifically, if the hash value of the personnel text information in the first personnel library verification information is inconsistent with the hash value of the personnel text information in the second personnel library verification information, then further compare the personnel text information. If a certain verification field in the personnel text information exists in the first personnel library verification information but does not exist in the second personnel library verification information, then copy the personnel library information corresponding to this field from the first terminal to the second terminal. If a certain verification field in the personnel text information exists in the second personnel library verification information but does not exist in the first personnel library verification information, then copy the personnel library information corresponding to this field from the second terminal to the first terminal. If a certain verification field in the personnel text information exists in both the first personnel library verification information and the second personnel library verification information but is inconsistent, then synchronize it to be consistent according to the actual situation.

[0049] In the embodiment of the present application, for the situation where a certain verification field in the personnel text information exists in both the first personnel library verification information and the second personnel library verification information but is inconsistent, the following refinement solution is proposed: If the first terminal is the attendance management client and the second terminal is the access control device, then if the personnel text information in the first personnel library verification information corresponding to the personnel identifier is inconsistent with the personnel text information in the second personnel library verification information, synchronize the personnel text information in the first terminal and the personnel text information in the second terminal, including: synchronizing the personnel text information corresponding to the personnel identifier in the attendance management client to the access control device.

[0050] If a certain verification field exists in both the first personnel database verification information and the second personnel database verification information but is inconsistent, the personnel database information in the attendance management client is synchronized to the access control device, that is, synchronization is performed based on the personnel database information in the attendance management client. The unit's personnel management staff manually manages the information of all personnel through the attendance management client, and only the unit's personnel management staff has the operation authority. Therefore, the information in the attendance management client has a high credibility. When synchronization is required due to inconsistent verification fields, the information in the attendance management client is used as the standard, which improves the accuracy and reliability of the personnel database information.

[0051] If the personnel database identifiers in the first personnel database verification information and the second personnel database verification information are compared and found to be consistent, the comparison of the personnel image hash value can be performed simultaneously with the comparison of the personnel text information hash value, or the comparison of the personnel image hash value can be performed after the comparison of the personnel text information hash value. It is also possible to first perform the comparison of the personnel image hash value and then perform the comparison of the personnel text information hash value when the personnel database identifiers in the first personnel database verification information and the second personnel database verification information are compared and found to be consistent. If the personnel database identifiers in the first personnel database verification information and the second personnel database verification information are compared and found to be consistent, the personnel image hash values in the first personnel database verification information and the second personnel database verification information corresponding to the personnel identifier are compared. If the comparison is consistent, no synchronization operation is performed. If the comparison is inconsistent, a personnel image synchronization operation is performed. Figure 4 and Figure 5 Both parties in [reference] refer to the first terminal and the second terminal. The other party refers to the terminal that needs to be synchronized and updated.

[0052] In the embodiment of the present application, when comparing subsequent verification fields in the case where the personnel database identifiers are compared and found to be consistent, the verification field comparison between the first personnel database verification information and the second personnel database verification information includes: determining the addressing addresses in the first personnel database verification information and the second personnel database verification information according to the personnel identifier of the target personnel; according to the addressing addresses, searching for the first verification information of the target personnel from the first personnel database verification information and searching for the second verification information of the target personnel from the second personnel database verification information; and performing a verification field comparison on the first verification information and the second verification information.

[0053] Exemplarily, as shown in Table 1 and Table 2, for the target personnel to be compared, the corresponding addressing addresses are determined according to the personnel identifier of the target personnel, and the addressing addresses can be set to be the same as the personnel identifier. Through the addressing addresses, the position of the verification information of the target personnel in the verification information table can be quickly locked, so as to quickly and efficiently find the verification information for comparison and improve the comparison efficiency.

[0054] Figure 6 The flowchart of the information synchronization method provided by another embodiment of the present invention. The embodiments of the present application are further optimizations of the above embodiments. For details not described in detail in the embodiments of the present application, please refer to the above embodiments. Refer to Figure 6 , the information synchronization method provided by the embodiments of the present application may include:

[0055] S210. Obtain the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal.

[0056] S220. Compare the verification fields included in the first verification information and the verification fields included in the second verification information according to the priority order of the verification fields; wherein, the priority order of the verification fields is: personnel identifier, hash value of personnel text information.

[0057] In the embodiments of the present application, progressive comparison of the verification fields is performed, that is, comparison is performed according to the priority order of the verification fields, so as to perform hierarchical comparison to improve the comparison speed and efficiency. For example, if the personnel identifier and the hash value of the personnel information are both compared and consistent, it means that the first personnel database in the first terminal is consistent with the second personnel database in the second terminal, so other operations may not be performed. If the personnel identifiers are not compared consistently, the personnel databases are synchronized. If the personnel identifiers are compared consistently, the hash value of the personnel information corresponding to the personnel identifier is further compared.

[0058] S230. During the comparison according to the priority order, if the verification fields corresponding to the current priority are not compared consistently, synchronize the first personnel database of the first terminal and the second personnel database in the second terminal.

[0059] Exemplarily, check whether there is a personnel identifier in the personnel identifier of the second personnel database verification information that matches the personnel identifier in the first personnel database verification information. If not, synchronize the personnel database corresponding to the existing personnel identifier to the terminal where the personnel identifier does not exist. If it exists, then determine whether they are consistent. If not, synchronize the personnel information corresponding to the personnel identifier. If they are consistent, determine whether the hash value of the personnel information in the first personnel database verification information corresponding to the same personnel identifier is consistent with the hash value of the personnel information in the second personnel database verification information. If not, synchronize the personnel information corresponding to the personnel identifier.

[0060] In the embodiments of the present application, if the comparison of the personnel identifier or the hash value of the personnel information is inconsistent, personnel database synchronization is required. The solution adopted according to the specific information of the personnel database to be synchronized is as follows: If it is necessary to synchronize the personnel text information corresponding to the personnel identifier in the personnel database information, directly use the personnel text information in the personnel database verification information obtained by the Agent to update the personnel database information of another terminal. If it is necessary to synchronize the personnel image corresponding to the personnel identifier in the personnel database information, send a personnel image acquisition request to the terminal containing the accurate personnel image, and receive the personnel image carried with the synchronization direction flag bit returned by the terminal. Then, determine the receiving terminal among the first terminal and the second terminal according to the synchronization direction flag bit, and send it to update the personnel image of the receiving terminal.

[0061] S240. Receive the personnel database change request carried with the synchronization direction flag bit sent by the first terminal or the second terminal.

[0062] Exemplarily, after the two-way synchronization of the personnel database is completed, if there is an update in the personnel database of either the first terminal or the second terminal, send a personnel database change request carried with the synchronization direction flag bit to the Agent. The Agent determines which terminal's data needs to be synchronized to which terminal according to the synchronization direction flag bit. The change request may include the synchronization direction flag bit, the personnel database identifier, the personnel identifier, and the change content, etc.

[0063] S250. According to the synchronization direction flag bit, determine the active change terminal and the passive change terminal among the first terminal and the second terminal.

[0064] For example, it can be set that when the synchronization direction flag bit is 0, it means that the first terminal is the active change terminal and the second terminal is the passive change terminal, and the data in the first terminal needs to be updated to the second terminal. When the synchronization direction flag bit is 1, it means that the first terminal is the passive change terminal and the second terminal is the active change terminal, and the data in the second terminal needs to be updated to the first terminal. It can also be set vice versa according to the actual situation.

[0065] S260. Synchronize the personnel database in the passive change terminal according to the personnel database in the active change terminal.

[0066] Exemplarily, synchronize and copy the updated personnel database information in the active change terminal to the personnel database information in the passive update terminal, so as to realize the information synchronization between the first terminal and the second terminal.

[0067] The technical solution in the embodiments of the present application performs progressive comparison according to the priority order of the check fields and performs search comparison according to the addressing address, thereby effectively improving the efficiency of the check information comparison and improving the real-time performance of the terminal information synchronization.

[0068] Figure 7 The flowchart of the information synchronization method provided by another embodiment of the present invention. The embodiments of the present application optimize the above embodiments, and for the details not described in detail in the embodiments of the present application, please refer to the above embodiments. Refer to Figure 7 , the information synchronization method provided by the embodiments of the present application may include:

[0069] S310. Obtain the first personnel library verification information of the first terminal and the second personnel library verification information of the second terminal.

[0070] S320. Compare the verification fields of the first personnel library verification information and the second personnel library verification information; wherein, the verification fields include: personnel identifier and personnel information hash value.

[0071] S330. Synchronize the first personnel library of the first terminal and the second personnel library in the second terminal according to the comparison result.

[0072] S340. Receive the updated personnel library verification information returned by the terminal with a personnel library update among the first terminal and the second terminal.

[0073] Exemplarily, when the personnel text information or personnel image of the first terminal or the second terminal is updated, the corresponding personnel text information hash value or personnel image hash value will be updated. To ensure the consistency of the personnel library information on both sides, after the synchronization of the personnel text information or personnel image corresponding to the same personnel identifier is completed, a synchronization success signal and the updated local personnel text information hash value and / or personnel image hash value are returned to the Agent.

[0074] S350. Compare the updated personnel library verification information with the personnel library verification information corresponding to the other terminal; wherein, the other terminal is the terminal other than the terminal corresponding to the updated personnel library verification information among the first terminal and the second terminal.

[0075] S360. If the comparison is consistent, it is determined that the personnel library synchronization is successful.

[0076] Exemplarily, the Agent compares the received personnel text information hash value and / or personnel image hash value with the personnel text information hash value and / or personnel image hash value corresponding to the same personnel identifier in the personnel library of the other terminal. If they are consistent, it is determined that the synchronization is successful; otherwise, it is determined that the synchronization fails. If the synchronization is successful, the Agent triggers the update of the verification information in the corresponding personnel library information verification table to ensure the consistency of the bilateral personnel library information verification tables.

[0077] S370. If the updated personnel library verification information returned by the terminal with a personnel library update among the first terminal and the second terminal is not received within the preset time, or the comparison is inconsistent, perform a retry synchronization.

[0078] If the updated personnel database verification information is not received within the preset time, or the comparison of the updated personnel database verification information is inconsistent, it may be a synchronization failure. The Agent triggers the resynchronization of the corresponding information. If the preset number of retries, such as 3 times, still fails to synchronize successfully, an information indicating the failure of synchronizing the personnel image or personnel text information is generated.

[0079] In the solution of the embodiment of the present application, the verification information returned by the terminal with data changes is compared to further verify whether the synchronization is successful, effectively ensuring the consistency of the terminal data. And if the updated personnel database verification information returned by the terminal with a personnel database update in the first terminal and the second terminal is not received within the preset time, or the comparison is inconsistent, then the resynchronization is performed, thereby improving the ability to handle program exceptions.

[0080] Figure 8 It is a schematic structural diagram of an information synchronization device provided by an embodiment of the present invention. This device is applicable to the situation where the personnel databases in the first terminal and the second terminal are synchronized. Typically, the embodiment of the present application is applicable to the situation where two-way data synchronization is performed between an attendance management client and an access control device. This device can be implemented in a software and / or hardware manner, and this device can be integrated in an electronic device. Refer to Figure 8 and this device specifically includes:

[0081] A verification information acquisition module 410, configured to acquire the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal;

[0082] A comparison module 420, configured to perform a comparison of verification fields on the first personnel database verification information and the second personnel database verification information; wherein, the verification fields include: personnel identifier and personnel information hash value;

[0083] A synchronization module 430, configured to synchronize the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result.

[0084] In the embodiment of the present application, the comparison module 420 includes:

[0085] An addressing address determination unit, configured to determine the addressing addresses in the first personnel database verification information and the second personnel database verification information according to the personnel identifier of the target personnel;

[0086] A search unit, configured to search for the first verification information of the target personnel from the first personnel database verification information and search for the second verification information of the target personnel from the second personnel database verification information according to the addressing addresses;

[0087] A verification field comparison unit for comparing the verification fields of the first verification information and the second verification information.

[0088] In an embodiment of the present application, the comparison module 420 includes:

[0089] An order comparison unit for comparing the verification fields included in the first personnel library verification information and the verification fields included in the second personnel library verification information according to the priority order of the verification fields; wherein, the priority order of the verification fields is: personnel identifier, personnel information hash value;

[0090] Correspondingly, the synchronization module 430 includes:

[0091] A personnel library synchronization unit for synchronizing the first personnel library of the first terminal and the second personnel library in the second terminal if the verification fields corresponding to the current priority are inconsistent during the comparison according to the priority order.

[0092] In an embodiment of the present application, the synchronization module 430 is specifically configured to:

[0093] If there is any personnel identifier that appears in the first personnel library verification information and does not appear in the second personnel library verification information, synchronize the personnel library corresponding to the personnel identifier from the first terminal to the second terminal;

[0094] If there is any personnel identifier that appears in the second personnel library verification information and does not appear in the first personnel library verification information, synchronize the personnel library corresponding to the personnel identifier from the second terminal to the first terminal.

[0095] In an embodiment of the present application, the verification field further includes personnel text information, and the personnel information hash value includes a personnel text information hash value; the synchronization module 430 is specifically configured to:

[0096] If the personnel identifiers in the first personnel library verification information and the second personnel library verification information are compared and are consistent, compare the personnel text information hash values corresponding to the personnel identifier;

[0097] If the personnel text information hash value in the first personnel library verification information corresponding to the personnel identifier is inconsistent with the personnel text information hash value in the second personnel library verification information, compare the personnel text information corresponding to the personnel identifier;

[0098] If the personnel text information in the first personnel library verification information corresponding to the personnel identifier is inconsistent with the personnel text information in the second personnel library verification information, synchronize the personnel text information in the first terminal and the personnel text information in the second terminal.

[0099] In an embodiment of the present application, if the first terminal is an attendance management client and the second terminal is an access control device, the synchronization module 430 is further specifically configured to:

[0100] Synchronize the personnel text information corresponding to the personnel identifier in the attendance management client to the access control device.

[0101] In an embodiment of the present application, the personnel information hash value includes a personnel image hash value;

[0102] The synchronization module 430 is specifically configured to:

[0103] If there is a consistent comparison of personnel identifiers in the first personnel database verification information and the second personnel database verification information, compare the personnel image hash values corresponding to the personnel identifier;

[0104] If the personnel image hash value in the first personnel database verification information corresponding to the personnel identifier is inconsistent with the personnel image hash value in the second personnel database verification information, synchronize the personnel images in the first terminal and the personnel images in the second terminal.

[0105] In an embodiment of the present application, the device further includes:

[0106] A change request receiving module, configured to receive a personnel database change request carrying a synchronization direction flag bit sent by the first terminal or the second terminal;

[0107] A change terminal determination module, configured to determine an active change terminal and a passive change terminal among the first terminal and the second terminal according to the synchronization direction flag bit;

[0108] A change synchronization module, configured to synchronize the personnel database in the passive change terminal according to the personnel database in the active change terminal.

[0109] In an embodiment of the present application, the device further includes:

[0110] A verification information receiving module, configured to receive updated personnel database verification information returned by a terminal with a personnel database update among the first terminal and the second terminal;

[0111] A verification information comparison module, configured to compare the updated personnel database verification information with the personnel database verification information corresponding to another terminal; where the another terminal is a terminal other than the terminal corresponding to the updated personnel database verification information among the first terminal and the second terminal;

[0112] A comparison success determination module, configured to determine that the personnel database synchronization is successful if the comparison is consistent.

[0113] In an embodiment of the present application, the device further includes:

[0114] A retry synchronization module, configured to perform retry synchronization if the updated personnel library verification information returned by the terminal with a personnel library update in the first terminal and the second terminal is not received within a preset time, or if the comparison is inconsistent.

[0115] In an embodiment of the present application, the method is executed by an Agent scheduling system.

[0116] The information synchronization device provided in the embodiments of the present application can execute the information synchronization method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.

[0117] Figure 9 It is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. Figure 9 The block diagram of an exemplary electronic device 512 suitable for implementing the embodiments of the present application is shown. Figure 9 The displayed electronic device 512 is only an example, and should not bring any limitation to the functions and usage scope of the embodiments of the present application.

[0118] As Figure 9 shown, the electronic device 512 may include: one or more processors 516; a memory 528 for storing one or more programs, and when the one or more programs are executed by the one or more processors 516, the one or more processors 516 implement the information synchronization method provided in the embodiments of the present application, including:

[0119] Obtain the first personnel library verification information of the first terminal and the second personnel library verification information of the second terminal;

[0120] Perform a comparison of verification fields on the first personnel library verification information and the second personnel library verification information; wherein, the verification fields include: personnel identification and personnel information hash value;

[0121] Synchronize the first personnel library of the first terminal and the second personnel library in the second terminal according to the comparison result.

[0122] The components of the electronic device 512 may include but are not limited to: one or more processors or processors 516, a memory 528, and a bus 518 connecting different device components (including the memory 528 and the processor 516).

[0123] Bus 518 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, an Accelerated Graphics Port, a processor bus, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include the 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.

[0124] Electronic device 512 typically includes a variety of computer-readable storage media. These storage media may be any available storage media accessible by electronic device 512, including both volatile and nonvolatile storage media, removable and non-removable storage media.

[0125] Memory 528 may include computer-readable storage media in the form of volatile memory, such as random access memory (RAM) 530 and / or cache memory 532. Electronic device 512 may further include other removable / non-removable, volatile / nonvolatile computer storage media. By way of example only, storage system 534 may be used for reading from and writing to non-removable, nonvolatile magnetic storage media ( Figure 9 not shown and typically called a “hard disk drive”). Although Figure 9 not shown in the figures, a 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 and writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical storage media) may be provided. In such cases, each drive may be connected to bus 518 by one or more data storage media interfaces. Memory 528 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 present invention.

[0126] A program / utility 540 having a set (at least one) of program modules 542 may be stored, for example, in memory 528, and such program modules 542 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may include an implementation of a networking environment. Program modules 542 generally carry out the functions and / or methods of the embodiments described herein.

[0127] The electronic device 512 can also communicate with one or more external devices 514 (such as a keyboard, a pointing device, a display 524, etc.), and can also communicate with one or more devices that enable a user to interact with the electronic device 512, and / or communicate with any device that enables the electronic device 512 to communicate with one or more other computing devices (such as a network card, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 522. Moreover, the electronic device 512 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 520. As Figure 9 shown, the network adapter 520 communicates with other modules of the electronic device 512 through the bus 518. It should be understood that although Figure 9 not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID devices, tape drives, and data backup storage devices, etc.

[0128] The processor 516 executes various functional applications and data processing by running at least one of other programs among multiple programs stored in the memory 528, for example, implementing an information synchronization method provided by an embodiment of the present application.

[0129] An embodiment of the present invention provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute an information synchronization method when executed by a computer processor, including:

[0130] Obtaining the first personnel library verification information of the first terminal and the second personnel library verification information of the second terminal;

[0131] Performing a verification field comparison on the first personnel library verification information and the second personnel library verification information; wherein, the verification fields include: personnel identification and personnel information hash value;

[0132] Synchronizing the first personnel library of the first terminal and the second personnel library in the second terminal according to the comparison result.

[0133] The computer storage medium of the embodiments of the present application may adopt any combination of one or more computer-readable storage media. The computer-readable storage medium may be a computer-readable signal storage medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or component, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the embodiments of the present application, the computer-readable storage medium may be any tangible storage medium that contains or stores a program, and the program can be used by or in combination with an instruction execution device, apparatus, or component.

[0134] The computer-readable signal storage medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal storage medium may also be any computer-readable storage medium other than the computer-readable storage medium, and the computer-readable storage medium can send, propagate, or transmit a program for use by or in combination with an instruction execution device, apparatus, or component.

[0135] The program code contained on the computer-readable storage medium can be transmitted by any suitable storage medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0136] The computer program code for performing the operations of the present invention can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0137] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An information synchronization method, characterized in that, it is executed by an Agent scheduling system, the Agent scheduling system is configured in an attendance management client, and the Agent scheduling system performs data caching, scheduling synchronization direction and synchronization content. The method includes: Obtaining first personnel library verification information of a first terminal and second personnel library verification information of a second terminal; the first personnel library verification information and the second personnel library verification information include one or more of a personnel library identifier, a personnel identifier, personnel text information, a personnel text information hash value, and a personnel image hash value; in the first terminal and the second terminal, one terminal is an attendance management client, and the other terminal is an access control device; Performing a comparison of verification fields between the first personnel library verification information and the second personnel library verification information; wherein, the verification fields include: a personnel identifier and a personnel information hash value; Synchronizing the first personnel library of the first terminal and the second personnel library of the second terminal according to the comparison result; the personnel library includes a personnel library identifier, a personnel identifier, personnel text information, a personnel text information hash value, a personnel image, and a personnel image hash value; Synchronizing the first personnel library of the first terminal and the second personnel library of the second terminal according to the comparison result includes: if it is necessary to synchronize the personnel text information corresponding to the personnel identifier in the personnel library information, then use the personnel text information in the personnel library verification information obtained by the Agent scheduling system to update the personnel library information of the other terminal; if it is necessary to synchronize the personnel image corresponding to the personnel identifier in the personnel library information, the Agent scheduling system sends a personnel image acquisition request to the terminal containing the accurate personnel image, and receives the personnel image carrying the synchronization direction flag bit returned by the terminal, so as to determine the receiving terminal in the first terminal and the second terminal according to the synchronization direction flag bit, and perform sending to update the personnel image of the receiving terminal.

2. The method according to claim 1, characterized in that, Performing a comparison of verification fields between the first personnel library verification information and the second personnel library verification information includes: Determining an addressing address in the first personnel library verification information and the second personnel library verification information according to the personnel identifier of the target personnel; According to the addressing address, searching for the first verification information of the target personnel from the first personnel library verification information, and searching for the second verification information of the target personnel from the second personnel library verification information; Performing a comparison of verification fields between the first verification information and the second verification information.

3. The method according to claim 1, characterized in that, Performing a comparison of verification fields between the first personnel library verification information and the second personnel library verification information includes: Comparing the verification fields included in the first personnel library verification information and the verification fields included in the second personnel library verification information according to the priority order of the verification fields; wherein, the priority order of the verification fields is: personnel identifier, personnel information hash value; Correspondingly, synchronizing the first personnel library of the first terminal and the second personnel library of the second terminal according to the comparison result includes: In the process of comparison according to the priority order, if the verification fields corresponding to the current priority are inconsistent, synchronize the first personnel database of the first terminal and the second personnel database in the second terminal.

4. The method according to claim 1, wherein, synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result includes: If any personnel identifier appears in the verification information of the first personnel database and does not appear in the verification information of the second personnel database, synchronize the personnel database corresponding to this personnel identifier from the first terminal to the second terminal; If any personnel identifier appears in the verification information of the second personnel database and does not appear in the verification information of the first personnel database, synchronize the personnel database corresponding to this personnel identifier from the second terminal to the first terminal.

5. The method according to claim 1, wherein, the verification field further includes personnel text information, and the personnel information hash value includes the personnel text information hash value; Accordingly, synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result includes: If there is a consistent comparison of personnel identifiers in the verification information of the first personnel database and the verification information of the second personnel database, compare the personnel text information hash values corresponding to this personnel identifier; If the personnel text information hash value in the verification information of the first personnel database corresponding to this personnel identifier is inconsistent with the personnel text information hash value in the verification information of the second personnel database, compare the personnel text information corresponding to this personnel identifier; If the personnel text information in the verification information of the first personnel database corresponding to this personnel identifier is inconsistent with the personnel text information in the verification information of the second personnel database, synchronize the personnel text information in the first terminal and the personnel text information in the second terminal.

6. The method according to claim 1, wherein, the personnel information hash value includes the personnel image hash value; Accordingly, synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result includes: If there is a consistent comparison of personnel identifiers in the verification information of the first personnel database and the verification information of the second personnel database, compare the personnel image hash values corresponding to this personnel identifier; If the personnel image hash value in the verification information of the first personnel database corresponding to this personnel identifier is inconsistent with the personnel image hash value in the verification information of the second personnel database, synchronize the personnel image in the first terminal and the personnel image in the second terminal.

7. The method according to any one of claims 1-6, wherein, after synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result, the method further includes: Receiving a personnel database change request carrying a synchronization direction flag bit sent by the first terminal or the second terminal; Determining the active change terminal and the passive change terminal in the first terminal and the second terminal according to the synchronization direction flag bit; Synchronize the personnel database in the passive change terminal according to the personnel database in the active change terminal.

8. The method according to any one of claims 1-6, wherein, after synchronizing the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result, the method further includes: receiving the updated personnel database verification information returned by the terminal with a personnel database update in the first terminal and the second terminal; comparing the updated personnel database verification information with the personnel database verification information corresponding to the other terminal; wherein, the other terminal is the terminal other than the terminal corresponding to the updated personnel database verification information among the first terminal and the second terminal; if the comparison is consistent, it is determined that the personnel database synchronization is successful.

9. An information synchronization device, wherein, configured in the Agent scheduling system, the Agent scheduling system is configured in the attendance management client, and the Agent scheduling system performs data caching, scheduling synchronization direction and synchronization content. The device includes: a verification information acquisition module, configured to acquire the first personnel database verification information of the first terminal and the second personnel database verification information of the second terminal; the first personnel database verification information and the second personnel database verification information include one or more of a personnel database identifier, a personnel identifier, personnel text information, a personnel text information hash value, and a personnel image hash value; in the first terminal and the second terminal, one terminal is the attendance management client, and the other terminal is an access control device; a comparison module, configured to perform a verification field comparison on the first personnel database verification information and the second personnel database verification information; wherein, the verification fields include: a personnel identifier and a personnel information hash value; a synchronization module, configured to synchronize the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result; the personnel database includes a personnel database identifier, a personnel identifier, personnel text information, a personnel text information hash value, a personnel image, and a personnel image hash value; The synchronization module synchronizes the first personnel database of the first terminal and the second personnel database in the second terminal according to the comparison result, including: if it is necessary to synchronize the personnel text information corresponding to the personnel identifier in the personnel database information, the personnel text information in the personnel database verification information obtained by the Agent scheduling system is used to update the personnel database information of the other terminal; if it is necessary to synchronize the personnel image corresponding to the personnel identifier in the personnel database information, the Agent scheduling system sends a personnel image acquisition request to the terminal containing the accurate personnel image, and receives the personnel image carried with the synchronization direction flag bit returned by the terminal, so as to determine the receiving terminal in the first terminal and the second terminal according to the synchronization direction flag bit, and perform sending to update the personnel image of the receiving terminal.

10. An electronic device, wherein, the electronic device includes: one or more processors; a memory, configured 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 information synchronization method according to any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the information synchronization method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Data synchronization processing method and device, equipment and storage medium

    CN111723153A

  • Method for managing personal information data andschedule data

    KR1020010058739A