Two-dimensional code inspection system based on offline mechanism and its implementation method

By using offline mechanisms to generate encrypted QR codes in the inspection system, the problems of high equipment costs and easy forgery of QR codes in traditional inspection methods are solved, and a high security and effective punch-in process is achieved.

CN118430090BActive Publication Date: 2025-01-17SHENZHEN ZHONGYAN ANCHUANG TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410816651.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2025-01-17
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

The traditional inspection and check-in method has high equipment costs and high installation and maintenance costs, and static QR codes are easily copied and forged, resulting in a reduction in the effectiveness of check-in.

Method used

Adopt a QR code inspection system based on offline mechanism, by obtaining the equipment ID and dealer ID of the inspection equipment, generating encrypted information in combination with the local clock, and dynamically generating QR codes to ensure the timeliness and uniqueness of the QR codes. Prevent forgery.

Benefits of technology

It improves the security and timeliness of QR codes, prevents manual forgery, ensures the effectiveness and accuracy of clocking in, and is suitable for network-free environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118430090B_ABST
    Figure CN118430090B_ABST
Patent Text Reader

Abstract

The present application discloses a two-dimensional code inspection system based on an offline mechanism and an implementation method thereof, the method comprising: obtaining a device ID of an inspection device, and obtaining a current timestamp through a local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state; obtaining a key of the inspection device, the key being generated according to a dealer ID of the inspection device; encrypting the dealer ID, the device ID and the current timestamp to obtain primary encryption information; performing secondary encryption on the primary encryption information using the key to obtain secondary encryption information; generating a target two-dimensional code corresponding to the current timestamp according to the secondary encryption information; and displaying the target two-dimensional code for inspection personnel to scan the target two-dimensional code for clocking in.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a two-dimensional code inspection system based on an offline mechanism and an implementation method thereof. Background Art

[0002] In recent years, with the rapid development of mobile Internet, QR code technology has been widely used in various scenarios, such as payment, identity authentication, information acquisition, etc. In the inspection and clocking-in scenario, traditional inspection and clocking-in methods such as swiping cards, fingerprints, facial recognition, NFC, etc. have problems such as high equipment cost, high installation and maintenance cost, and static QR codes are easy to copy and lack security. Especially in the inspection scenario, QR codes are easy to be forged, which reduces the effectiveness of clocking-in. Therefore, how to improve the security of QR codes to ensure the effectiveness of clocking-in needs to be solved urgently. Summary of the invention

[0003] The embodiment of the present application provides a QR code inspection system based on an offline mechanism and an implementation method thereof, which can improve the security of the QR code to ensure the effectiveness of clocking in.

[0004] In a first aspect, an embodiment of the present application provides a two-dimensional code inspection method based on an offline mechanism, the method comprising:

[0005] Obtaining the device ID of the inspection device, and obtaining the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state;

[0006] Obtaining a key of the inspection device, where the key is generated according to a dealer ID of the inspection device;

[0007] Encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information;

[0008] Using the key to perform secondary encryption on the primary encrypted information to obtain secondary encrypted information;

[0009] A target QR code corresponding to the current timestamp is generated according to the secondary encrypted information; and the target QR code is displayed so that inspection personnel can scan the target QR code to clock in.

[0010] In a second aspect, an embodiment of the present application provides a two-dimensional code inspection system, the two-dimensional code inspection system includes an inspection device at a designated inspection point, the system includes: an acquisition unit, an encryption unit and a display unit, wherein:

[0011] The acquisition unit acquires the device ID of the inspection device and acquires the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state; acquires the key of the inspection device, and the key is generated according to the dealer ID of the inspection device;

[0012] The encryption unit is used to encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information; and to perform secondary encryption on the primary encrypted information using the key to obtain secondary encrypted information;

[0013] The display unit is used to generate a target QR code corresponding to the current timestamp according to the secondary encryption information; and display the target QR code so that the inspection personnel can scan the target QR code to clock in.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect of the embodiment of the present application.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0017] The embodiments of the present application have the following beneficial effects:

[0018] It can be seen that the two-dimensional code inspection system based on the offline mechanism and its implementation method described in the embodiment of the present application are applied to the two-dimensional code inspection system, the two-dimensional code inspection system includes an inspection device at a designated inspection point, the device ID of the inspection device is obtained, and the current timestamp is obtained through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state, the key of the inspection device is obtained, the key is generated according to the dealer ID of the inspection device, the dealer ID, the device ID and the current timestamp are encrypted to obtain a primary encryption information, the primary encryption information is encrypted twice with the key to obtain the secondary encryption information, and the secondary encryption information is generated according to the secondary encryption information The target QR code corresponding to the current timestamp; displays the target QR code for inspection personnel to scan the target QR code to clock in. First, the QR code in offline state is prevented from expiring after being photographed, and the timeliness and credibility are improved. The QR code in offline state is anti-counterfeiting, which can prevent artificial forgery of QR code without on-site inspection. Second, complex encryption algorithms and dynamic generation algorithms are used to improve the security and uniqueness of QR codes. Third, the QR code is generated in combination with the current timestamp and card number information to ensure the timeliness and accuracy of the QR code. The inspection point is used offline, that is, there is no need for a network, and it can adapt to various complex environments, thereby improving the security of the QR code to ensure the effectiveness of clocking in. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 It is a structural schematic diagram of a two-dimensional code inspection system provided in an embodiment of the present application;

[0021] Figure 2 It is a flowchart of an image processing method provided in an embodiment of the present application;

[0022] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0023] Figure 4 It is a block diagram of the functional units of a two-dimensional code inspection system based on an offline mechanism provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0026] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0027] The electronic devices involved in the embodiments of the present application may be electronic devices with communication capabilities or electronic devices without communication capabilities. The electronic devices may include various handheld devices with wireless communication functions, vehicle-mounted devices (driving recorders, in-vehicle cameras, vehicle-mounted speakers, etc.), inspection devices in a QR code inspection system, a control platform in a QR code inspection system, a back end in a QR code inspection system, wearable devices (smart glasses, smart bracelets, smart watches, etc.), computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, etc.

[0028] Among them, ID (identification) means identity identification.

[0029] In the related technology, there are some punch-in systems based on dynamic QR codes, which improve the security of punching in by generating dynamically changing QR codes based on Beijing time. However, these systems need to be connected to the Internet in real time, and the correct time needs to be guaranteed. The dynamic QR codes are generated based on the time. Once the network is disconnected, the system will not work properly, and the project engineering requires huge wiring, installation, and construction costs.

[0030] In addition, the dynamic QR code punching system in the related art relies on the correct network time and cannot work properly when disconnected from the network, while the static QR code can be scanned and punched in by taking a photo and keeping a record, and it is easy to be copied, which poses a certain risk of cheating in inspection punching. The generation and management of QR codes are relatively simple and less secure.

[0031] In order to solve the defects in the related art, the embodiment of the present application provides a two-dimensional code inspection method based on an offline mechanism, which may include the following steps:

[0032] Obtaining the device ID of the inspection device, and obtaining the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state;

[0033] Obtaining a key of the inspection device, where the key is generated according to a dealer ID of the inspection device;

[0034] Encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information;

[0035] Using the key to perform secondary encryption on the primary encrypted information to obtain secondary encrypted information;

[0036] A target QR code corresponding to the current timestamp is generated according to the secondary encrypted information; and the target QR code is displayed so that inspection personnel can scan the target QR code to clock in.

[0037] By adopting the embodiments of the present application, firstly, the QR code in an offline state can be prevented from expiring after being photographed, and the timeliness and credibility are improved. The QR code in an offline state can be prevented from being counterfeited manually without on-site inspections. Secondly, complex encryption algorithms and dynamic generation algorithms are adopted to improve the security and uniqueness of the QR code. Thirdly, the QR code is generated in combination with the current timestamp and card number information to ensure the timeliness and accuracy of the QR code. The inspection point is used offline, that is, there is no need for a network, and it can adapt to various complex environments. Therefore, the security of the QR code can be improved to ensure the effectiveness of clocking in.

[0038] In specific implementation, the embodiments of the present application can be widely used in enterprises, schools, military units, hospitals, firefighting, forests, public places and other scenarios where inspection and clocking in are required, especially in scenarios where power supply and network are unavailable. Environments where offline use is possible.

[0039] The following is a detailed description of the embodiments of the present application.

[0040] See also Figure 1 , Figure 1 This is a structural diagram of a QR code inspection system provided by an embodiment of the present application. As shown in the figure, the QR code inspection system includes: a backend, an inspection device, and a user device, wherein the backend is equivalent to a local server, and the backend and the inspection device can be connected by wired communication, and the inspection device is in an offline state, which includes that the inspection device is not in an online networking state, that is, the inspection device is not connected to the Internet. The inspection personnel hold the user device, and the inspection device can be used to generate a QR code for the inspection personnel to scan the QR code for clocking in. After scanning the code, the user device can send the scanned QR code and its identity information to the backend to generate a corresponding clocking-in record.

[0041] With the above Figure 1 For details on the embodiments shown in the drawings, please refer to Figure 2 , Figure 2 It is a flow chart of a two-dimensional code inspection method based on an offline mechanism provided in an embodiment of the present application, which is applied to a two-dimensional code inspection system. The two-dimensional code inspection system includes inspection equipment at designated inspection points. As shown in the figure, the two-dimensional code inspection method based on an offline mechanism includes the following steps:

[0042] 201. Obtain the device ID of the inspection device, and obtain the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state.

[0043] In the embodiment of the present application, the designated inspection point can be preset or set by system default. The inspection device is in an offline state, and the offline state includes that the inspection device is not in an online networking state.

[0044] The device ID is used to uniquely identify the inspection device, and the device ID may include at least one of the following: card number information, device number, IP address, MAC address, etc., which are not limited here.

[0045] In a specific implementation, the device ID of the inspection device can be obtained, and the current timestamp can be obtained through the local clock of the inspection device. Specifically, the current timestamp can be obtained through the local clock of the inspection device at every preset time interval, wherein the preset time interval can be pre-set or system default.

[0046] The local clock is a local clock set in the inspection device at the designated inspection point. Since it is not the network time, it can only be generated locally.

[0047] In the specific implementation, the inspection equipment in this QR code inspection system is used offline, that is, the dynamic QR code inspection point. From the first battery installation, the system can be restored to a default time. When the executor punches in for the first time, the background algorithm will recognize the battery switching and the first battery installation operation, and prompt the punching personnel to punch in for time calibration. After punching in twice, the device and the background time (backend time) are calibrated. For example, the background time can be used to calibrate the time of the inspection device. Specifically, the background time can be set to the time of the inspection device.

[0048] Furthermore, there will be inconsistencies between the time of the QR code inspection point and the time of the background (APP or patrol machine) after calibration, and the time of the two is synchronized. That is to say, there will be a difference between the time of the inspection point and the time of the background. The system will make dynamic corrections every time you punch in, so that it can be maintained at a fixed time value.

[0049] 202. Obtain a key of the inspection device, where the key is generated according to a dealer ID of the inspection device.

[0050] The dealer is a dealer who sells the inspection equipment. In a specific implementation, different dealers may correspond to different dealer IDs.

[0051] In the embodiment of the present application, the key can be generated according to the dealer ID of the inspection device. Specifically, the key of the inspection device can be obtained.

[0052] 203. Encrypt the dealer ID, the device ID and the current timestamp to obtain primary encryption information.

[0053] In the embodiment of the present application, an encryption algorithm can be used to encrypt the dealer ID, device ID and current timestamp to obtain encrypted information. In this way, a complex encryption algorithm and a dynamic generation algorithm can be used to improve the security and uniqueness of the QR code. Among them, the encryption algorithm can be preset or the system defaults, and the encryption algorithm can include at least one of the following: symmetric encryption algorithm, asymmetric encryption algorithm, national secret algorithm, secure hash algorithm, etc., which are not limited here.

[0054] 204. Use the key to perform secondary encryption on the primary encrypted information to obtain secondary encrypted information.

[0055] In the embodiment of the present application, the key can be used to encrypt the once encrypted information twice to obtain the secondary encrypted information. In this way, complex encryption algorithms and dynamic generation algorithms can be used to improve the security and uniqueness of the QR code.

[0056] 205. Generate a target QR code corresponding to the current timestamp according to the secondary encrypted information; display the target QR code so that the inspection personnel can scan the target QR code to clock in. One QR code can only record one clock in.

[0057] Among them, the inspection equipment can adopt ultra-low power consumption design, for example, it can be used for more than 2 years with 3 No. 5 batteries. The clock-in function can be turned on at a scheduled time, that is, the QR code will be displayed only during the specified time period, and the inspection equipment can be in a dormant state during other time periods. The specified time period can be pre-set or the system defaults.

[0058] Among them, the target QR code is displayed for a preset time period, and the preset time period can be pre-set or system default. After the preset time period, a new QR code can be generated, and the new QR code can also be displayed only for the preset time period.

[0059] In the embodiment of the present application, a target QR code corresponding to the current timestamp can be generated according to the secondary encryption information, and the target QR code can be displayed for inspection personnel to scan the target QR code to clock in. In this way, firstly, the QR code in an offline state can be prevented from expiring after being photographed, and the timeliness and credibility can be improved. The QR code in an offline state can be prevented from being counterfeited manually without on-site inspection. Secondly, a complex encryption algorithm and a dynamic generation algorithm are used to improve the security and uniqueness of the QR code. Thirdly, the QR code is generated in combination with the current timestamp and the card number information to ensure the timeliness and accuracy of the QR code. The inspection point can be used offline, that is, no network is required, and it can adapt to various complex environments.

[0060] In the specific implementation, the QR code corresponding to the inspection equipment is different in each time period. The inspection point generates a dynamic QR code with timeliness and uniqueness. The time difference obtained by normal scanning must be equal to the time difference after the system. If there is a certain difference, the system can determine the code generated on-site at the non-QR code inspection point, thereby determining the validity of the code.

[0061] Among them, normal use means that the system sets personnel to punch in at fixed times, and the inspection personnel punch in on time to ensure the validity of their time and the uniqueness of the inspection point. Inspection punches in within the normal specified time is considered qualified, and failure to pass the verification within the specified time is considered missed inspection. This method can solve the problem of historical QR codes that cannot be verified by taking photos.

[0062] In the embodiment of the present application, since the dynamic QR code has a globally unique identity and can be generated by an encryption algorithm, it avoids the manual production of QR codes through third-party tools or software. In this way, only the dynamic QR code points that actually generate valid QR codes according to the time are valid, which effectively prevents cheating inspections. If a timeout occurs, a background alarm or an abnormal reminder will appear, which means that the person who punched the card did not punch the card at the specified time or missed the punch.

[0063] In the specific implementation, when the battery of the inspection point is low or exhausted, the QR code inspection point will keep a record of the battery replacement, which can be synchronized to the backend so that the next inspection can be used normally after calibration with the correct time due to battery replacement. The inspection personnel scan the dynamic QR code generated by the QR code inspection point to punch in, and the punch in will be saved in the local database after verification to ensure the integrity and security of the data.

[0064] To illustrate, in the embodiment of the present application, the dynamic QR code inspection point does not need to be connected online, and is powered by three 1.5V batteries, which is very convenient to install. When the network cannot be connected, the QR code generated by the dynamic QR code inspection point can be judged and verified by the background to verify the time validity and identity uniqueness of the current QR code. After the verification is passed, the accurate inspection time is obtained. When the time of the QR code inspection point deviates from the correct network time, the time is synchronized by scanning the inspection code, and the background time synchronization calculation can be accurately synchronized and calibrated. The time difference caused by battery replacement and offline operation is calibrated, thereby making up for the problem of being unable to calibrate the time due to offline operation.

[0065] Optionally, the two-dimensional code inspection system further includes a backend; the backend is connected to the user device for communication; and may further include the following steps:

[0066] A1. When it is detected that the target QR code is scanned by the user device, the identity information of the target QR code and the user device is obtained through the backend;

[0067] A2. Verify the identity information. When the identity information is successfully verified, parse the target QR code to obtain the current timestamp; obtain the actual time point of the background;

[0068] A3. When the difference between the current timestamp and the actual time point is within a preset range, determine that the inspection is qualified, generate a first clock-in record, and save the first clock-in record in a local database;

[0069] A4. When the difference between the current timestamp and the actual time point is not within the preset range, determine that the detection is missed, generate a second punch-in record, and save the second punch-in record in the local database.

[0070] The identity information of the user device may include at least one of the following: IP address, MAC address, mobile phone number, user name, device number, etc., which are not limited here. The identity information of the user device may be used to identify the identity of the inspection personnel.

[0071] The preset range may be preset or a system default. The actual time point of the background may be a network time.

[0072] Among them, when parsing the target QR code to obtain the current timestamp, you can first parse the target QR code to obtain the secondary encrypted information, then use the key to decrypt the secondary encrypted information to obtain the primary encrypted information, and then use the dealer ID and device ID to decrypt the primary encrypted information to obtain the current timestamp.

[0073] In the embodiment of the present application, when it is detected that the target QR code is scanned by the user device, the identity information of the target QR code and the user device is obtained through the backend, and then the identity information is verified. When the identity information is successfully verified, the target QR code can be parsed to obtain the current timestamp, and then the actual time point of the background is obtained. When the difference between the current timestamp and the actual time point is within a preset range, it is determined that the inspection is qualified, and a first punch-in record is generated, and the first punch-in record is saved in a local database. On the contrary, when the difference between the current timestamp and the actual time point is not within the preset range, it is determined that the inspection is missed, and a second punch-in record is generated, and the second punch-in record is saved in a local database, wherein the first punch-in record is a punch-in record of qualified inspection generated based on the identity information of the user device, and the second punch-in record is a punch-in record of missed inspection (unqualified inspection) generated based on the identity information of the user device. Not only can the QR code in an offline state be prevented from being expired after being photographed, but the timeliness and credibility are improved. The QR code in an offline state can prevent artificial forgery of the QR code without on-site inspection, and can also authenticate the identity and verify the validity of the punch-in.

[0074] Optionally, the following steps may also be included:

[0075] B1. Obtain the scanning time of the user device; the scanning time is the network synchronization time when the user device scans;

[0076] B2. Determine a first time difference between the current timestamp and the actual time point;

[0077] B3. Determine a second time difference between the code scanning time and the actual time point;

[0078] B4. Determine a target calibration parameter of the local clock according to the first time difference and the second time difference, wherein the target calibration parameter is used to calibrate the local clock.

[0079] Among them, the scanning time is within the display time of the target QR code, and the actual time point is the reception time of the target QR code after the background receives the scanned code. The time difference between the scanning time and the actual time point can be determined and used as the target calibration parameter.

[0080] In the specific implementation, due to the lag in clocking in, a QR code is often generated first, and then the user device scans the QR code to complete the clocking in. The scanning time of the user device can be obtained. The scanning time is the network synchronization time when the user device scans, and the first time difference between the current timestamp and the actual time point is determined. The second time difference between the scanning time and the actual time point is determined, and the target calibration parameter of the local clock is determined according to the first time difference and the second time difference. The target calibration parameter is used to calibrate the local clock, target calibration parameter = first time difference - second time difference, that is, local clock + target calibration parameter = current timestamp. Taking into account that the user scanning action lags behind the time of the QR code, the target calibration parameter can be used to correct the actual timestamp of the local clock to make it more in line with the user's actual clocking in time, which helps to ensure the synchronization of clocking in, that is, to keep the actual clocking in time synchronized with the network time.

[0081] In the specific implementation, this system is used offline. For this dynamic QR code inspection point, the system will restore to a default time from the first battery installation. When the executor punches in for the first time, the background algorithm will identify the battery switching and the first battery installation operation, and prompt the punching personnel to punch in for time calibration. After punching in twice, the device and the background time are calibrated. The time of the QR code inspection point is not the real calibrated Beijing time. There will be inconsistencies between the time of the QR code inspection point and the time of the background (APP or patrol machine) after calibration, and the time of the two is synchronous, that is, there will be a difference between the time of the inspection point and the time of the background. The system will make dynamic corrections every time you punch in, so that it can be maintained at a fixed time value.

[0082] Optionally, the inspection device further includes a battery. The above step 201, obtaining the current timestamp through the local clock of the inspection device, may include the following steps:

[0083] 21. Obtain a reference timestamp through the local clock of the inspection device;

[0084] 22. Calibrate the reference timestamp according to the target calibration parameter to obtain a first timestamp;

[0085] 23. Obtaining a target remaining power of the battery and a target usage time of the battery;

[0086] 24. Determine a target stability factor corresponding to the target remaining power;

[0087] 25. Obtain target attribute parameters of the battery;

[0088] 26. Determine a target attenuation curve corresponding to the target attribute parameter, wherein the horizontal axis of the target attenuation curve is time and the vertical axis is an attenuation factor;

[0089] 27. A target attenuation factor corresponding to the target attenuation curve according to the target usage duration;

[0090] 28. Determine a first adjustment parameter corresponding to the target stability factor;

[0091] 29. Determine a second adjustment parameter corresponding to the target attenuation factor;

[0092] 30. Adjust the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp.

[0093] In an embodiment of the present application, a reference timestamp can be obtained through the local clock of the inspection device. The reference timestamp is the actual timestamp of the local clock. The reference timestamp can be calibrated according to the target calibration parameter to obtain a first timestamp, that is, reference timestamp + target calibration parameter = first timestamp. The target remaining power of the battery and the target usage time of the battery can also be obtained. As for the battery, its stability will change with the change of the remaining power. That is, the mapping relationship between the preset remaining power and the stability factor can be pre-stored, and the target stability factor corresponding to the target remaining power can be determined based on the mapping relationship. Under normal circumstances, the value of the stability factor can be 1. As the remaining power changes, the value of the stability factor will be lower than 1.

[0094] Furthermore, the target attribute parameters of the battery can also be obtained, and the target attribute parameters can include at least one of the following: brand, scale, model, etc., which are not limited here. Different attribute parameters can correspond to different attenuation curves, that is, the mapping relationship between the preset attribute parameters and the attenuation curve can be pre-stored, and then, the target attenuation curve corresponding to the target attribute parameters can be determined based on the mapping relationship. The horizontal axis of the target attenuation curve is time and the vertical axis is the attenuation factor. Then, the target attenuation factor corresponding to the target attenuation curve can be obtained according to the target usage time. The mapping relationship between the preset stability factor and the adjustment parameter can be pre-stored, and the first adjustment parameter corresponding to the target stability factor can be determined based on the mapping relationship. The mapping relationship between the preset attenuation factor and the adjustment parameter can be pre-stored, and the second adjustment parameter corresponding to the target attenuation factor can be determined based on the mapping relationship. Stability and attenuation can both affect the accuracy of the clock itself, so the adjustment The parameter value range is between -1 and 1s. In this way, the first timestamp can be adjusted according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp. For example, the current timestamp = the first timestamp + (the first adjustment parameter + the second adjustment parameter). Alternatively, the maximum value between the first adjustment parameter and the second adjustment parameter can be selected, and the current timestamp = the first timestamp + the maximum value. Alternatively, the average of the first adjustment parameter and the second adjustment parameter can be taken, and the current timestamp = the first timestamp + the average. In this way, the local clock can be calibrated using the battery's own state (remaining power and attenuation) to make the clock more consistent with the network time and more in line with the user's actual punch-in time, which helps to ensure punch-in synchronization, that is, to keep the actual punch-in time synchronized with the network time.

[0095] Optionally, the above step 30, adjusting the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp, may include the following steps:

[0096] 301. Adjust the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain a second timestamp;

[0097] 302. Obtain target environment parameters;

[0098] 303. Determine a target fine-tuning parameter corresponding to the target environmental parameter;

[0099] 304. Fine-tune the second timestamp according to the target fine-tuning parameter to obtain the current timestamp.

[0100] In the embodiment of the present application, the environmental parameters may include external environmental parameters and internal environmental parameters, wherein the external environmental parameters may include at least one of the following: weather, temperature, humidity, atmospheric pressure, geographical location, magnetic field interference intensity, etc., which are not limited here, and the internal environmental parameters may include software environmental parameters, and / or hardware environmental parameters. The software environmental parameters may include at least one of the following: system type, system version, operating speed, software resources, etc., which are not limited here. The hardware environmental parameters may include at least one of the following: hardware type, hardware model, hardware resources, etc., which are not limited here.

[0101] In a specific implementation, since the local clock may run slower or faster, the fine-tuning parameter may be positive or negative.

[0102] In a specific implementation, the first timestamp can be adjusted according to the first adjustment parameter and the second adjustment parameter to obtain the second timestamp. The mapping relationship between the preset environmental parameters and the fine-tuning parameters can also be pre-stored. The value range of the fine-tuning parameters is -0.5~0.5s. Then, the target fine-tuning parameters corresponding to the target environmental parameters can be determined based on the mapping relationship. In this way, the second timestamp can be fine-tuned according to the target fine-tuning parameters to obtain the current timestamp. The current timestamp = the second timestamp + the target fine-tuning parameters. On the one hand, the local clock can be calibrated using the battery's own state (remaining power and attenuation). On the other hand, the local clock can be further fine-tuned based on the actual environmental parameters, so that the clock is more consistent with the network time and more in line with the user's actual punch-in time, which helps to ensure the synchronization of punch-in, that is, the actual punch-in time is synchronized with the network time.

[0103] Optionally, the target environment parameters include target external environment parameters and target internal environment parameters; the above step 303, determining the target fine-tuning parameters corresponding to the target environment parameters, may include the following steps:

[0104] 331. Determine a first fine-tuning parameter corresponding to the target external environment parameter;

[0105] 332. Determine a second fine-tuning parameter corresponding to the target internal and external parameters;

[0106] 333. Obtain a target weight pair corresponding to the target attenuation factor, the target weight pair comprising a target first weight and a target second weight; the target first weight is a weight corresponding to an external environmental parameter, and the target second weight is a weight corresponding to an internal environmental parameter;

[0107] 334. Perform a weighted operation according to the target weight, the first fine-tuning parameter, and the second fine-tuning parameter to obtain the target fine-tuning parameter.

[0108] In the embodiment of the present application, a mapping relationship between a preset external environment parameter and a fine-tuning parameter can be pre-stored, and then, a first fine-tuning parameter corresponding to the target external environment parameter can be determined based on the mapping relationship. A mapping relationship between a preset internal environment parameter and a fine-tuning parameter can also be pre-stored, and then, a second fine-tuning parameter corresponding to the internal and external parameters can be determined based on the mapping relationship. A mapping relationship between a preset attenuation factor and a weight pair can also be pre-stored, and then, a target weight pair corresponding to the target attenuation factor can be obtained based on the mapping relationship, wherein the target weight pair includes a target first weight and a target second weight; the target first weight pair includes a target first weight and a target second weight; the target first weight pair includes a target second weight and a target second weight. The target value is the weight corresponding to the external environmental parameter, and the target second weight is the weight corresponding to the internal environmental parameter. In this way, a weighted operation can be performed according to the target weight, the first fine-tuning parameter and the second fine-tuning parameter to obtain the target fine-tuning parameter. The target fine-tuning parameter = target first weight * first fine-tuning parameter + target second weight + second fine-tuning parameter. That is, not only can the fine-tuning parameters suitable for the internal and external environments be obtained, but the environmental impact can also be accurately evaluated based on the attenuation situation, so that the depth of the fine-tuning effect conforms to the actual situation, which makes it more in line with the actual punch-in time of the user, and helps to ensure the synchronization of the punch-in, that is, the actual punch-in time is synchronized with the network time.

[0109] Optionally, the following steps may also be included:

[0110] S1. Obtain a first subkey and a second subkey, where the first subkey and the second subkey are input by different administrators respectively;

[0111] S2. Encrypt the first subkey and the second subkey using an asymmetric encryption algorithm to obtain a first root key;

[0112] S3, obtain random factors;

[0113] S4. Encrypt the random factor according to the first root key to obtain a system master key;

[0114] S5. Obtain the target customer code corresponding to the inspection device;

[0115] S6. Determine a key extraction code corresponding to the target customer code;

[0116] S7, separating the system master key according to the key extraction code to obtain a second root key;

[0117] S8. Encrypt the dealer ID according to the second root key to obtain the key.

[0118] In an embodiment of the present application, the first subkey and the second subkey are respectively input by different administrators to obtain the first subkey and the second subkey. An asymmetric encryption algorithm can also be used to encrypt the first subkey and the second subkey to obtain a first root key, and then a random factor is generated based on a random algorithm.

[0119] Furthermore, the random factor can be encrypted according to the first root key to obtain the system master key, and then the target customer code corresponding to the inspection equipment can be obtained. Different customer entities can correspond to different customer codes, and then the key extraction code corresponding to the target customer code is determined. The key extraction code is used to select characters at corresponding positions from the system master key. For example, the key extraction code is 1234, then "1" means extracting the first character from the system master key, "2" means extracting the second character from the system master key, "3" means extracting the third character from the system master key, and "4" means extracting the fourth character from the system master key. Based on this principle, the system master key can be separated according to the key extraction code to obtain the second root key, and then the dealer ID can be encrypted according to the second root key to obtain the key.

[0120] To illustrate, in the embodiment of the present application, for generating the system master key, after the system is initialized, two sub-keys A and B are input by different administrators respectively, and after asymmetric encryption, the random factor taken out as the root key is encrypted twice to obtain the system master key, ensuring the uniqueness of the key after generation. For the dealer key, the dealer gets the dealer code, and will get the dealer's root key according to the customer code after secondary dispersion of the mother key, and generate a unique key according to the dealer. The QR code generator encrypts the injected dealer ID and key. When the QR code is generated, it will generate data encryption based on the injected dealer ID and device ID and time, and then use the injected key to encrypt the output, and finally, the back-end decrypts.

[0121] In the embodiment of the present application, the QR code inspection point is offline and cannot obtain the standard Beijing time or other standard time. Let the code scanning program know the time when the QR code is generated and whether it is a QR code that is captured and saved. Moreover, the QR code is battery-powered. After a power outage, the device time cannot follow the time before the last power outage. In response to these problems, a large number of algorithm improvements have been made in combination with the QR code inspection point used for on-site inspections to make up for these deficiencies. Battery replacement detection has been added to the QR code generator, and a time travel accuracy correction algorithm has been performed on the QR code generator to ensure that the travel error is small. After replacing the battery, the QR code inspection point needs to be dynamically calibrated after the battery is replaced. The time calibration requires scanning the code again, dynamically checking the QR code time, and dynamically checking the time of the scanned code and the generated code. For example, it can ensure that the time accuracy of each scan is controlled within one minute, and the scan code is successfully clocked in and the clock-in record is saved.

[0122] It can be seen that the two-dimensional code inspection method based on the offline mechanism described in the embodiment of the present application is applied to the two-dimensional code inspection system, which includes an inspection device at a designated inspection point, obtaining the device ID of the inspection device, and obtaining the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state, obtaining the key of the inspection device, the key is generated according to the dealer ID of the inspection device, the dealer ID, the device ID and the current timestamp are encrypted to obtain primary encryption information, the primary encryption information is secondary encrypted using the key to obtain secondary encryption information, and the current time is generated according to the secondary encryption information The target QR code corresponding to the time stamp; the target QR code is displayed for the inspection personnel to scan the target QR code to punch in. First, the QR code in the offline state is prevented from expiring after being photographed, and the timeliness and credibility are improved. The QR code in the offline state is anti-counterfeiting, which can prevent the artificial forgery of the QR code without on-site inspection. Second, complex encryption algorithms and dynamic generation algorithms are used to improve the security and uniqueness of the QR code. Third, the QR code is generated in combination with the current timestamp and card number information to ensure the timeliness and accuracy of the QR code. The inspection point is used offline, that is, there is no need for a network, and it can adapt to various complex environments, thereby improving the security of the QR code to ensure the effectiveness of punching in.

[0123] With the above Figure 2 For details on the embodiments shown in the drawings, please refer to Figure 3 , Figure 3 3 is a structural diagram of an electronic device 300 provided in an embodiment of the present application. As shown in the figure, the electronic device 300 includes a processor 310, a memory 320, a communication interface 330, and one or more programs 321, wherein the one or more programs 321 are stored in the above-mentioned memory 320 and are configured to be executed by the above-mentioned processor 310, and are applied to a two-dimensional code inspection system. The two-dimensional code inspection system includes an inspection device for a designated inspection point, and the one or more programs 321 include instructions for executing the following steps:

[0124] Obtaining the device ID of the inspection device, and obtaining the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state;

[0125] Obtaining a key of the inspection device, where the key is generated according to a dealer ID of the inspection device;

[0126] Encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information;

[0127] Using the key to perform secondary encryption on the primary encrypted information to obtain secondary encrypted information;

[0128] A target QR code corresponding to the current timestamp is generated according to the secondary encrypted information; and the target QR code is displayed so that inspection personnel can scan the target QR code to clock in.

[0129] Optionally, the two-dimensional code inspection system further includes a backend; the backend is in communication connection with the user device; the one or more programs 321 further include instructions for executing the following steps:

[0130] When it is detected that the target QR code is scanned by the user device, the identity information of the target QR code and the user device is obtained through the backend;

[0131] Verify the identity information, and when the identity information is successfully verified, parse the target QR code to obtain the current timestamp; obtain the actual time point of the background;

[0132] When the difference between the current timestamp and the actual time point is within a preset range, the inspection is determined to be qualified, and a first punch-in record is generated, and the first punch-in record is saved in a local database;

[0133] When the difference between the current timestamp and the actual time point is not within the preset range, missed detection is determined, and a second punch-in record is generated, and the second punch-in record is stored in the local database.

[0134] Optionally, the one or more programs 321 further include instructions for performing the following steps:

[0135] Obtaining the scanning time of the user device; the scanning time is the network synchronization time when the user device scans;

[0136] Determine the time difference between the code scanning time and the actual time point;

[0137] A target calibration parameter of the local clock is determined according to the time difference, and the target calibration parameter is used to calibrate the local clock.

[0138] Optionally, the inspection device further includes a battery; in the aspect of obtaining the current timestamp through the local clock of the inspection device, the one or more programs 321 include instructions for performing the following steps:

[0139] Acquire a reference timestamp through the local clock of the inspection device;

[0140] Calibrate the reference timestamp according to the target calibration parameter to obtain a first timestamp;

[0141] Obtaining a target remaining power of the battery and a target usage time of the battery;

[0142] Determining a target stability factor corresponding to the target remaining power;

[0143] Obtaining target attribute parameters of the battery;

[0144] Determine a target attenuation curve corresponding to the target attribute parameter, wherein the horizontal axis of the target attenuation curve is time and the vertical axis is an attenuation factor;

[0145] A target attenuation factor corresponding to the target attenuation curve according to the target usage duration;

[0146] Determining a first adjustment parameter corresponding to the target stability factor;

[0147] determining a second adjustment parameter corresponding to the target attenuation factor;

[0148] The first timestamp is adjusted according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp.

[0149] Optionally, in the aspect of adjusting the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp, the one or more programs 321 include instructions for performing the following steps:

[0150] Adjust the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain a second timestamp;

[0151] Get target environment parameters;

[0152] Determining a target fine-tuning parameter corresponding to the target environmental parameter;

[0153] The second timestamp is fine-tuned according to the target fine-tuning parameter to obtain the current timestamp.

[0154] Optionally, the target environment parameters include target external environment parameters and target internal environment parameters; in determining the target fine-tuning parameters corresponding to the target environment parameters, the one or more programs 321 include instructions for executing the following steps:

[0155] Determining a first fine-tuning parameter corresponding to the target external environment parameter;

[0156] determining a second fine-tuning parameter corresponding to the target internal and external parameters;

[0157] Acquire a target weight pair corresponding to the target attenuation factor, the target weight pair comprising a target first weight and a target second weight; the target first weight is a weight corresponding to an external environmental parameter, and the target second weight is a weight corresponding to an internal environmental parameter;

[0158] A weighted operation is performed according to the target weight, the first fine-tuning parameter, and the second fine-tuning parameter to obtain the target fine-tuning parameter.

[0159] Optionally, the one or more programs 321 further include instructions for performing the following steps:

[0160] Obtaining a first subkey and a second subkey, where the first subkey and the second subkey are respectively input by different administrators;

[0161] Encrypting the first subkey and the second subkey using an asymmetric encryption algorithm to obtain a first root key;

[0162] Get random factors;

[0163] Encrypt the random factor according to the first root key to obtain a system master key;

[0164] Obtaining the target customer code corresponding to the inspection device;

[0165] Determining a key extraction code corresponding to the target customer code;

[0166] Separate the system master key according to the key extraction code to obtain a second root key;

[0167] The dealer ID is encrypted according to the second root key to obtain the key.

[0168] It can be seen that the electronic device described in the embodiment of the present application is applied to a two-dimensional code inspection system. The two-dimensional code inspection system includes an inspection device at a designated inspection point, obtaining the device ID of the inspection device, obtaining the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state, obtaining the key of the inspection device, the key is generated according to the dealer ID of the inspection device, the dealer ID, the device ID and the current timestamp are encrypted to obtain a primary encryption information, the primary encryption information is secondary encrypted using the key to obtain secondary encryption information, and the current timestamp corresponding to the secondary encryption information is generated Target QR code: Display the target QR code for inspection personnel to scan the target QR code to clock in. First, the QR code in offline state can be prevented from expiring after being photographed, and the timeliness and credibility are improved. The QR code in offline state can be prevented from being counterfeited manually without on-site inspection. Second, complex encryption algorithms and dynamic generation algorithms are used to improve the security and uniqueness of the QR code. Third, the QR code is generated in combination with the current timestamp and card number information to ensure the timeliness and accuracy of the QR code. The inspection point is used offline, that is, there is no need for a network, and it can adapt to various complex environments, thereby improving the security of the QR code to ensure the effectiveness of clocking in.

[0169] Figure 4 This is a functional unit block diagram of a two-dimensional code inspection system 400 based on an offline mechanism involved in an embodiment of the present application. The two-dimensional code inspection system 400 based on an offline mechanism includes inspection equipment at a designated inspection point, and the system 400 includes: an acquisition unit 401, an encryption unit 402 and a display unit 403, wherein:

[0170] The acquisition unit 401 acquires the device ID of the inspection device and acquires the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state; acquires the key of the inspection device, and the key is generated according to the dealer ID of the inspection device;

[0171] The encryption unit 402 is used to encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information; and to perform secondary encryption on the primary encrypted information using the key to obtain secondary encrypted information;

[0172] The display unit 403 is used to generate a target QR code corresponding to the current timestamp according to the secondary encryption information; and display the target QR code so that the inspection personnel can scan the target QR code to clock in.

[0173] Optionally, the two-dimensional code inspection system further includes a backend; the backend is in communication connection with the user device; the system 400 is further specifically used for:

[0174] When it is detected that the target QR code is scanned by the user device, the identity information of the target QR code and the user device is obtained through the backend;

[0175] Verify the identity information, and when the identity information is successfully verified, parse the target QR code to obtain the current timestamp; obtain the actual time point of the background;

[0176] When the difference between the current timestamp and the actual time point is within a preset range, the inspection is determined to be qualified, and a first punch-in record is generated, and the first punch-in record is saved in a local database;

[0177] When the difference between the current timestamp and the actual time point is not within the preset range, missed detection is determined, and a second punch-in record is generated, and the second punch-in record is stored in the local database.

[0178] Optionally, the system 400 is further specifically used for:

[0179] Obtaining the scanning time of the user device; the scanning time is the network synchronization time when the user device scans;

[0180] Determine the time difference between the code scanning time and the actual time point;

[0181] A target calibration parameter of the local clock is determined according to the time difference, and the target calibration parameter is used to calibrate the local clock.

[0182] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0183] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0184] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0185] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0186] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0187] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0188] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0189] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the above-mentioned methods in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0190] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0191] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A two-dimensional code inspection method based on an offline mechanism, characterized in that: Applied to a two-dimensional code inspection system, the two-dimensional code inspection system includes inspection equipment at designated inspection points, and the method includes: Obtaining the device ID of the inspection device, and obtaining the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state; Obtaining a key of the inspection device, where the key is generated according to a dealer ID of the inspection device; Encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information; Using the key to perform secondary encryption on the primary encrypted information to obtain secondary encrypted information; Generate a target QR code corresponding to the current timestamp according to the secondary encrypted information; display the target QR code so that the inspection personnel can scan the target QR code to clock in; Wherein, the two-dimensional code inspection system further includes a back end; the back end is connected to the user device for communication; the method further includes: When it is detected that the target QR code is scanned by the user device, the identity information of the target QR code and the user device is obtained through the backend; Verify the identity information, and when the identity information is successfully verified, parse the target QR code to obtain the current timestamp; obtain the actual time point of the backend; When the difference between the current timestamp and the actual time point is within a preset range, the inspection is determined to be qualified, and a first punch-in record is generated, and the first punch-in record is saved in a local database; When the difference between the current timestamp and the actual time point is not within the preset range, missed detection is determined, and a second punch-in record is generated, and the second punch-in record is stored in the local database.

2. The method according to claim 1, characterized in that: The method further comprises: Obtaining the scanning time of the user device; the scanning time is the network synchronization time when the user device scans; Determining a first time difference between the current timestamp and the actual time point; Determine a second time difference between the code scanning time and the actual time point; A target calibration parameter of the local clock is determined according to the first time difference and the second time difference, and the target calibration parameter is used to calibrate the local clock.

3. The method according to claim 2, characterized in that The inspection device further includes a battery; and obtaining the current timestamp through the local clock of the inspection device includes: Acquire a reference timestamp through the local clock of the inspection device; Calibrate the reference timestamp according to the target calibration parameter to obtain a first timestamp; Obtaining a target remaining power of the battery and a target usage time of the battery; Determining a target stability factor corresponding to the target remaining power; Obtaining target attribute parameters of the battery; Determine a target attenuation curve corresponding to the target attribute parameter, wherein the horizontal axis of the target attenuation curve is time and the vertical axis is an attenuation factor; A target attenuation factor corresponding to the target attenuation curve according to the target usage duration; Determining a first adjustment parameter corresponding to the target stability factor; determining a second adjustment parameter corresponding to the target attenuation factor; The first timestamp is adjusted according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp.

4. The method according to claim 3, characterized in that: The adjusting the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain the current timestamp includes: Adjust the first timestamp according to the first adjustment parameter and the second adjustment parameter to obtain a second timestamp; Get target environment parameters; Determining a target fine-tuning parameter corresponding to the target environmental parameter; The second timestamp is fine-tuned according to the target fine-tuning parameter to obtain the current timestamp.

5. The method according to claim 4, characterized in that The target environment parameters include target external environment parameters and target internal environment parameters; The determining of the target fine-tuning parameter corresponding to the target environment parameter includes: Determining a first fine-tuning parameter corresponding to the target external environment parameter; determining a second fine-tuning parameter corresponding to the target internal and external parameters; Acquire a target weight pair corresponding to the target attenuation factor, the target weight pair comprising a target first weight and a target second weight; the target first weight is a weight corresponding to an external environmental parameter, and the target second weight is a weight corresponding to an internal environmental parameter; A weighted operation is performed according to the target weight, the first fine-tuning parameter, and the second fine-tuning parameter to obtain the target fine-tuning parameter.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining a first subkey and a second subkey, where the first subkey and the second subkey are respectively input by different administrators; Encrypting the first subkey and the second subkey using an asymmetric encryption algorithm to obtain a first root key; Get random factors; Encrypt the random factor according to the first root key to obtain a system master key; Obtaining the target customer code corresponding to the inspection device; Determining a key extraction code corresponding to the target customer code; Separate the system master key according to the key extraction code to obtain a second root key; The dealer ID is encrypted according to the second root key to obtain the key.

7. A two-dimensional code inspection system, characterized in that: The two-dimensional code inspection system includes inspection equipment at designated inspection points, and the system includes: an acquisition unit, an encryption unit and a display unit, wherein: The acquisition unit acquires the device ID of the inspection device and acquires the current timestamp through the local clock of the inspection device; the inspection device is in an offline state; the offline state includes that the inspection device is not in an online networking state; acquires the key of the inspection device, and the key is generated according to the dealer ID of the inspection device; The encryption unit is used to encrypt the dealer ID, the device ID and the current timestamp to obtain primary encrypted information; and to perform secondary encryption on the primary encrypted information using the key to obtain secondary encrypted information; The display unit is used to generate a target QR code corresponding to the current timestamp according to the secondary encryption information; and display the target QR code so that the inspection personnel can scan the target QR code to clock in; The two-dimensional code inspection system further includes a backend; the backend is connected to the user device for communication; the system is also specifically used for: When it is detected that the target QR code is scanned by the user device, the identity information of the target QR code and the user device is obtained through the backend; Verify the identity information, and when the identity information is successfully verified, parse the target QR code to obtain the current timestamp; obtain the actual time point of the backend; When the difference between the current timestamp and the actual time point is within a preset range, the inspection is determined to be qualified, and a first punch-in record is generated, and the first punch-in record is saved in a local database; When the difference between the current timestamp and the actual time point is not within the preset range, missed detection is determined, and a second punch-in record is generated, and the second punch-in record is stored in the local database.

8. The system according to claim 7, characterized in that The system is also specifically used for: Obtaining the scanning time of the user device; the scanning time is the network synchronization time when the user device scans; Determine the time difference between the code scanning time and the actual time point; A target calibration parameter of the local clock is determined according to the time difference, and the target calibration parameter is used to calibrate the local clock.

Citation Information

Patent Citations

  • Equipment time synchronization method in offline mode

    CN112616183A

  • Safety production AI inspection method based on trusted data

    CN113852674A