Dynamic offline password generation method based on system time two-dimensional code and intelligent terminal
By displaying a QR code in the advertising device to transmit system time and identification information, and using a mobile terminal to calculate the offline password, the problem of password errors caused by system time drift in the advertising device is solved, and the reliability and security of the device in offline mode are improved.
Patent Information
- Application Number
- CN202610364630.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-24
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, offline password generation errors caused by system time drift when advertising devices are offline affect the normal operation of device configuration.
By displaying a QR code in the advertising device to transmit system time and device identification information, and using a mobile terminal to parse and calculate the offline password, the password generation is ensured to be based on the accurate device time.
It resolves the offline password error issue caused by system time drift, improves the reliability and security of the device in offline mode, simplifies device design, and reduces deployment and maintenance costs.
Smart Images

Figure CN122339673A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to a dynamic offline password generation method, system, smart terminal, and storage medium based on system time QR codes. Background Technology
[0002] Currently, the industry typically enhances the security of advertising screens by requiring a password before device configuration. To ensure that devices can still obtain valid passwords in offline scenarios, an offline password generation scheme based on TOTP (One-Time Dynamic Password) is usually adopted.
[0003] However, this solution has a significant drawback: the password generation process relies on the accuracy of the device's system time. After production, advertising devices are often stored in warehouses for extended periods. During this time, because the devices are not connected to the network for time synchronization, and the hardware clock experiences daily drift, this cumulative effect can lead to a substantial discrepancy between the device's system time and the actual time.
[0004] When the device is finally installed on-site but is still offline, this time deviation will directly affect the calculation result of TOTP (One-Time Dynamic Password), causing the generated offline password to be inconsistent with the expectation, thus failing verification and affecting the normal use and configuration of the device.
[0005] Therefore, existing technologies still need improvement and development. Summary of the Invention
[0006] The technical problem to be solved by this invention is to provide a dynamic offline password generation method, system, smart terminal and storage medium based on system time QR code, which addresses the problems and defects of the prior art. This invention transmits the system time of the device to the device maintenance personnel through a QR code, so that the offline password is generated directly based on the system time of the device, thus solving the problem that the offline password cannot be calculated correctly due to the error of the device system time.
[0007] The technical solution adopted by this invention to solve the problem is as follows: A dynamic offline password generation method based on system time QR codes, comprising: When a pre-defined operation is detected, the system controls the display of a QR code generated according to pre-defined rules to transmit the device's system time and device identification information. The QR code is scanned by a designated application pre-installed on the mobile terminal, and the QR code is automatically parsed to extract the system time and device identification information of the advertising device. Based on the extracted system time and device identification information of the advertising device, and combined with a preset one-time dynamic password algorithm, the offline password of the advertising device is calculated locally on the mobile terminal. The advertising device receives the input offline password and, upon successful verification, allows subsequent configuration operations.
[0008] The dynamic offline password generation method based on system time QR codes, wherein the step of controlling and triggering the advertising device to display a QR code generated according to preset rules to transmit device system time and device identification information when a preset specified operation is detected includes the following: The advertising device is pre-configured to display a QR code that transmits the device system time and device identification information, triggered by a specified operation, wherein the specified operation is triggered by a physical button, a touch button, or a sensor.
[0009] The dynamic offline password generation method based on system time QR code, wherein the preset rule is: to collect device identification information in advance and to obtain the current system time of the device in real time; The device identification information collected in advance, as well as the current system time of the device obtained in real time, are encrypted in a symmetric or asymmetric manner, and then a QR code is dynamically generated to transmit the device system time and device identification information.
[0010] The dynamic offline password generation method based on system time QR code, wherein the device identification information includes the device's unique identifier, model, and serial number.
[0011] The dynamic offline password generation method based on system time QR code is characterized in that the step of controlling the advertising device to display a QR code generated according to preset rules to transmit device system time and device identification information when a preset specified operation is detected includes: Integrate the pre-collected device identification information with the real-time acquired device current system time; Calculate the integrated hash value of the integrated information, and encrypt the integrated hash value using the private key of the advertising device to generate a digital signature; The system time and device identification information of the advertising device, along with the newly generated digital signature, are encrypted according to preset rules to generate a digital QR code for transmitting the device's system time and device identification information.
[0012] The aforementioned dynamic offline password generation method based on system time QR code, wherein the step of scanning the QR code using a pre-installed application on a mobile terminal, automatically parsing the QR code, and extracting the system time and device identification information of the advertising device includes: The digital QR code is scanned by a designated application pre-installed on the mobile terminal, and the digital QR code is automatically decrypted to obtain the system time, device identification information, and digital signature of the advertising device.
[0013] The method for generating a dynamic offline password based on a system time QR code, wherein the step of calculating the offline password of the advertising device locally on the mobile terminal based on the extracted system time and device identification information of the advertising device, combined with a preset one-time dynamic password algorithm, includes: Perform the same hash calculation on the decrypted system time and device identification information of the advertising device to obtain a locally calculated local hash value; Using a preset public key corresponding to the private key of the advertising device, the digital signature extracted from the digital QR code is decrypted to obtain the original hash value calculated by the advertising device. Compare the locally calculated local hash value with the original hash value decrypted from the digital signature; If the local hash value is consistent with the original hash value, it is determined that the digital QR code content has not been tampered with during transmission and the information is complete and reliable. Then, the offline password of the advertising device is calculated based on the obtained device system time. If the local hash value is inconsistent with the original hash value, it is determined that the content of the digital QR code has been tampered with; the control issues a warning, refuses to use the digital QR code information with tampered content for password calculation, and prompts the user to obtain the QR code again or check the device security.
[0014] A dynamic offline password generation system based on system time QR codes, wherein the system comprises: A pre-configuration module is used to pre-configure the advertising device to display a QR code that transmits the device system time and device identification information, triggered by a specified operation, wherein the specified operation is triggered by a physical button, a touch button, or a sensor. The QR code generation and display module is used to control and trigger the advertising device to display a QR code generated according to preset rules to transmit the device system time and device identification information when a preset specified operation is detected. The QR code parsing module is used to scan the QR code through a designated application pre-installed on the mobile terminal, automatically parse the QR code, and extract the system time and device identification information of the advertising device. The offline password generation module is used to calculate the offline password of the advertising device locally on the mobile terminal based on the extracted system time and device identification information of the advertising device and a preset one-time dynamic password algorithm. The offline password verification module is used to control the advertising device to receive the input offline password and, if the verification is successful, allow subsequent configuration operations.
[0015] A smart terminal includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs comprising the method for performing any one of the methods.
[0016] A computer-readable storage medium wherein, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the methods described herein.
[0017] The beneficial effects of this invention are as follows: This invention provides a dynamic offline password generation method, system, smart terminal, and storage medium based on a system time QR code. By displaying a QR code in the advertising device, the invention transmits information such as the device's system time through the QR code. Device maintenance personnel can obtain the device's system time by scanning the QR code with a mobile app. Then, according to a preset TOTP (One-Time Dynamic Password) algorithm, combined with the obtained device system time, the current device's password can be calculated, thereby avoiding the problem that the calculated password cannot be used due to the inconsistency between the device information time and the actual physical time. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the dynamic offline password generation method based on system time QR codes provided in Embodiment 1 of the present invention.
[0020] Figure 2 The present invention provides a principle block diagram of an embodiment of a dynamic offline password generation system based on system time QR codes.
[0021] Figure 3 This is a block diagram illustrating the internal structure of a smart terminal provided in an embodiment of the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0023] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0024] In traditional offline password generation mechanisms, the TOTP (One-Time Dynamic Password) algorithm's high dependence on the device's system time accuracy leads to a critical technical flaw. Specifically, due to hardware clock drift, advertising devices cannot synchronize their time during the storage phase in an offline state, and the system time accumulates deviations as storage time increases. This deviation directly affects the TOTP calculation process, causing the generated offline password to be inconsistent with the verification end's expected result, thus triggering password verification failure. This, in turn, hinders the normal execution of device configuration operations, compromising system security and operational reliability.
[0025] For example, in the actual deployment of advertising equipment, after production, the equipment typically needs to be stored in a warehouse for a considerable period, during which time it is completely offline and not connected to the network for time calibration. The inherent drift of the hardware clock causes the system time to continuously deviate from the standard time reference. When the equipment is transported to the installation site and configuration operations are attempted, the offline password generated by the operator based on TOTP cannot be verified by the device due to the system time deviation. The configuration process is forcibly interrupted, the equipment cannot enter working mode, and on-site debugging work is forced to a standstill.
[0026] If the aforementioned system time skew issue is not resolved, the TOTP offline password verification mechanism will remain unreliable, causing repeated verification failures during critical configuration phases. This will continuously threaten device security, increase the complexity of on-site maintenance due to configuration interruptions, and potentially force operators to use non-standard methods to bypass security verification, further introducing potential risks and impacting the stable operation of the entire system.
[0027] In response, this application proposes a dynamic offline password generation method based on system time QR codes.
[0028] like Figure 1 As shown in Embodiment 1 of the present invention, a dynamic offline password generation method based on a system time QR code includes the following steps: Step S100: When a preset specified operation is detected, the advertising device is controlled to display a QR code generated according to preset rules to transmit the device system time and device identification information. Step S200: Scan the QR code using the designated application pre-installed on the mobile terminal, automatically parse the QR code, and extract the system time and device identification information of the advertising device; Step S300: Based on the extracted system time and device identification information of the advertising device, and combined with a preset one-time dynamic password algorithm, calculate the offline password of the advertising device locally on the mobile terminal. Step S400: The advertising device receives the input offline password and verifies it to allow subsequent configuration operations.
[0029] For ease of understanding, the following explains some key terms in this embodiment: The advertising device in this embodiment refers to an electronic device used to display advertising content, such as digital signage or advertising machines. This device typically includes a display screen, a processor, and a storage unit, and may operate offline.
[0030] The specified operation refers to a pre-defined trigger mechanism used to activate the advertising device to perform a specific function. This operation can be performed by the user through physical interaction, touch sensing, or remote commands.
[0031] The preset rules refer to a series of conventions and algorithms followed when generating QR codes. These rules define how to encode, encrypt, or integrate data such as device system time and device identification information to ensure the validity and security of the QR code content.
[0032] The QR code is a two-dimensional barcode capable of storing a large amount of information. In this embodiment, the QR code is used to carry the system time of the advertising device, device identification information, and possible security verification information.
[0033] The mobile terminal refers to a portable electronic device with scanning and calculation capabilities, such as a smartphone or tablet. In this embodiment, the mobile terminal is pre-installed with a specific application for parsing QR codes and performing offline password calculations.
[0034] The designated application refers to a dedicated software application installed on a mobile terminal. The application in this embodiment has functions such as scanning codes, parsing QR codes, extracting information, executing one-time dynamic password algorithms, and displaying calculation results.
[0035] The system time refers to the current time information maintained internally by the device. For advertising devices, the system time in this embodiment may deviate from the standard time due to prolonged offline operation.
[0036] The device identification information refers to various data used to uniquely identify the advertising device, such as the device's unique serial number, model number, and MAC address. This information helps identify the target device during password generation and verification.
[0037] The One-Time Dynamic Password (TOTP) algorithm is a time-synchronized password generation algorithm. This algorithm generates a one-time password that is valid for a short period by inputting parameters such as the key and timestamp into a hash function.
[0038] The offline password refers to a one-time password generated using a specific algorithm when the device is not connected to the internet. In this embodiment, the offline password is used for device authentication and configuration in an offline environment.
[0039] This embodiment provides a dynamic offline password generation method based on a system time QR code. Specifically, when a preset specified operation is detected, the advertising device is controlled to display a QR code generated according to preset rules, used to convey the device's system time and device identification information. The implementation of this specified operation can be varied. For example, the advertising device can be configured to initiate the QR code generation and display process upon receiving a simple external electrical signal. Alternatively, the advertising device can be designed to automatically enter a waiting state after startup, triggering the QR code display when the user confirms via a simple button press. In another implementation, the advertising device can periodically display the QR code, for example, automatically refreshing the QR code content at regular intervals. Through these methods, the advertising device can present a QR code containing its system time and device identification information to the user as needed.
[0040] Secondly, advertising maintenance personnel can scan the QR code using a designated application pre-installed on the mobile terminal. The QR code will then be automatically parsed to extract the system time and device identification information of the advertising device. In one implementation, the designated application on the mobile terminal directly reads the device system time and device identification information stored in plaintext form within the QR code after scanning. For example, the QR code can simply encode the device system timestamp and device serial number as a text string. In another implementation, the information in the QR code can undergo basic encoding processing, such as using Base64 encoding. After reading the information, the mobile terminal application performs the corresponding decoding operation to obtain the original device system time and device identification information.
[0041] Next, based on the extracted system time and device identification information of the advertising device, and combined with a preset one-time dynamic password algorithm, the offline password for the advertising device is calculated locally on the mobile terminal. Specifically, after successfully extracting the system time and device identification information of the advertising device, the designated application on the mobile terminal directly uses this information as input parameters and substitutes it into the preset one-time dynamic password algorithm for calculation. For example, the application can use the extracted device system time as a time step parameter, combine the device identification information with a preset shared key as a seed, and then perform a hash operation to generate a one-time password. In this process, the mobile terminal only relies on the information obtained from the QR code for local calculation and does not rely on its own system time.
[0042] Finally, the advertising device receives the input offline password and verifies it to allow subsequent configuration operations. When the user inputs the offline password calculated by the mobile terminal into the advertising device, the device receives the password. The advertising device internally uses the same offline password verification logic and algorithm as the mobile terminal. For example, the advertising device can store the same shared key as the mobile terminal and use its own system time (or the system time obtained from the QR code) and device identification information, combined with a one-time dynamic password algorithm, to recalculate a desired password. Then, the advertising device compares the received password with its own calculated desired password. If they match, the verification is successful, and the advertising device allows the user to perform subsequent configuration, maintenance, or management operations.
[0043] The following example will provide a more detailed explanation of the above technical solution: For example, consider an advertising device installed and put into use in a remote area. After a long period of storage and transportation since leaving the factory, the device's internal clock has experienced significant time drift due to lack of network synchronization, resulting in a large discrepancy between its system time and the actual standard time. Now, a technician needs to perform offline configuration on the advertising device, such as adjusting the displayed content or updating the firmware.
[0044] First, a technician approaches the advertising device and triggers a pre-defined operation by touching a virtual button on the device's screen. Upon receiving this instruction, the advertising device immediately generates and displays a QR code on its screen. This QR code is generated according to a preset rule based on the advertising device's current system time (e.g., the device's internal clock displays 10:00 AM on January 1, 2023, while the actual standard time may be 10:00 AM on January 5, 2023) and its unique device identification information (e.g., serial number "AD-001"). It should be noted that the system time included in the QR code in this embodiment is the actual time of the advertising device at the moment the QR code is generated.
[0045] Next, the technician used their mobile device to open the pre-installed designated application and scan the QR code displayed on the advertising device's screen. The designated application on the mobile device automatically recognized and parsed the QR code. During the parsing process, the application successfully extracted the advertising device's system time (January 1, 2023, 10:00 AM) and device identification information ("AD-001") from the QR code.
[0046] Subsequently, the designated application on the mobile terminal calculates an offline password locally based on the extracted system time of the advertising device (10:00 AM on January 1, 2023) and device identification information (“AD-001”), combined with a preset one-time dynamic password algorithm (e.g., the TOTP algorithm). It is important to emphasize that the mobile terminal uses the system time of the advertising device obtained from the QR code for calculation, not the mobile terminal's own system time.
[0047] Finally, the technician inputs the offline password calculated on the mobile terminal into the advertising device. Upon receiving the offline password, the advertising device uses the same algorithm and key stored internally as the mobile terminal, combined with the system time obtained from the QR code (or its own system time, but since the password is calculated based on the QR code's time, verification must also be based on this time) and device identification information to perform password verification. Because the mobile terminal uses the advertising device's own system time when calculating the password, even if the advertising device's internal clock drifts, as long as the time information in the QR code accurately reflects the system time when the device generated the QR code, and the mobile terminal calculates based on this time, the generated password will match the password the advertising device intends to verify. After successful verification, the advertising device allows the technician to perform subsequent configuration operations.
[0048] As can be seen from the above example, this method effectively solves the problem of system time drift caused by long-term offline operation of advertising devices, which affects offline password verification, by encapsulating the system time of the advertising device in a QR code and having the mobile terminal perform offline password calculation based on this time.
[0049] Based on the above examples, the technical solution proposed in this embodiment demonstrates significant technical contributions.
[0050] In existing technologies, when advertising devices are offline for extended periods and their internal clocks drift, the TOTP offline password calculated based on the device's own system time often fails verification, hindering normal device configuration and maintenance. For example, in the above scenario, if a technician's mobile terminal directly uses its own standard time, or if the advertising device itself uses its drifted system time to calculate the password, both will result in password mismatches and configuration failure.
[0051] This embodiment cleverly circumvents this core problem by introducing a QR code as a carrier of system time and device identification information, with the mobile terminal performing local calculations. Specifically, when configuration is required, the advertising device encapsulates its current system time (even if it has drifted) and device identification information into a QR code. After the mobile terminal scans and parses the QR code, it uses the advertising device's own system time (rather than the mobile terminal's standard time) as the input parameter for the one-time dynamic password algorithm. This method ensures that the base time for password calculation remains consistent with the actual state of the advertising device when the QR code is generated.
[0052] Compared to existing technologies, the advantages of this embodiment are: First, it solves the problem of offline password failure caused by clock drift when the advertising device is offline, ensuring that the device can be effectively configured in any offline scenario.
[0053] Secondly, performing password calculations via mobile terminals shifts the complex calculation process from advertising devices to more powerful mobile terminals, simplifying the design of advertising devices and improving the flexibility of calculations.
[0054] Furthermore, this solution eliminates the need for advertising devices to connect to the internet for time synchronization, reducing deployment and maintenance costs, and is particularly suitable for scenarios with poor network coverage or no network access.
[0055] Therefore, this embodiment provides a reliable, efficient and easy-to-implement offline password generation and verification mechanism, which significantly improves the usability and security of advertising devices.
[0056] In some embodiments described above in this application, a dynamic offline password generation method based on a system time QR code is proposed. Furthermore, before the step of controlling and triggering the display of a QR code generated according to preset rules to transmit the device system time and device identification information when a preset specified operation is detected, the advertising device is pre-configured to trigger the display of the QR code to transmit the device system time and device identification information through a specified operation. The specified operation is triggered by a physical button, a touch button, or a sensor.
[0057] The technical feature of pre-configuring the advertising device to display a QR code containing the device's system time and identification information via a specified operation refers to setting the advertising device before it is put into use, enabling it to display a QR code containing the device's system time and identification information when receiving a specific instruction or detecting a specific event. This configuration ensures that the device can respond to user requests when needed and provide necessary information in a controlled manner. One implementation method is to complete this configuration during the device manufacturing stage through firmware flashing or software pre-installation, integrating the triggering logic and QR code generation and display module into the device's operating system. Another implementation method is for device administrators or maintenance personnel to perform post-configuration through the device's management interface (e.g., debugging tools connected via USB port, remote configuration interface of network interface, or device's built-in settings menu), enabling or disabling this function and specifying the triggering method. The specified operation, triggered by a physical button, touch button, or sensor, defines the specific user interaction method for triggering the display of the QR code on the advertising device. These operations are signals actively issued by the user to explicitly instruct the device to perform the QR code display function, thus providing an intuitive and controllable means of interaction. Physical button triggering can refer to a dedicated button on the device, such as a "Service Mode" button or an "Information Display" button, which the user presses or holds to activate the QR code display. Touch button triggering can refer to a virtual button on the device's display screen or a capacitive or resistive touch area on the device's casing, where the user triggers the QR code display with a light touch or swipe. Sensor-triggered triggering can refer to using the device's sensors to detect specific external events, such as a proximity sensor detecting the user's hand approaching or waving, a light sensor detecting specific changes in ambient light, or an NFC / RFID reader detecting the approach of a specific tag, thereby triggering the QR code display.
[0058] The solution proposed in this application pre-configures the advertising device, enabling it to recognize and respond to specific user actions, thereby triggering the display of a QR code. This pre-configuration mechanism ensures that the advertising device already possesses the ability to recognize specified operations and the corresponding processing logic during operation. When a user performs a preset specified operation, such as pressing a physical button, touching a specific area, or triggering a sensor, the control system inside the advertising device detects this operation. Based on the pre-configuration, the device then initiates the QR code generation and display process, generating a QR code containing the device's system time and device identification information according to preset rules, and then displaying it. This mechanism associates the display of the QR code with the user's explicit intent, forming a controlled and secure triggering process, effectively avoiding unintended QR code display, and providing users with a clear and convenient interactive method to obtain the information needed for offline passwords.
[0059] The following example illustrates this: Before the advertising device leaves the factory, its embedded system is programmed to display a QR code for generating an offline password when a physical button labeled "Maintenance Mode" is pressed continuously for three seconds. This configuration information is stored in the device's non-volatile memory. When on-site maintenance personnel need to obtain the offline password, they simply locate the "Maintenance Mode" physical button on the advertising device and press and hold it for three seconds. Upon detecting this continuous press, the advertising device's microcontroller initiates the preset QR code generation program and displays a QR code containing the current system time and device identification information on the device's screen.
[0060] By pre-configuring a specific triggering mechanism in the advertising device and limiting the triggering method to physical buttons, touch buttons, or sensor triggering, this application ensures that the display of the QR code is based on the user's explicit intent and controlled operation. This effectively avoids accidental or unauthorized display of the QR code, thereby enhancing the security of device information transmission. Simultaneously, it provides users with an intuitive, convenient, and reliable way to proactively obtain the information needed for offline passwords, improving operational convenience and user experience.
[0061] In some embodiments described above in this application, a dynamic offline password generation method based on a system time QR code is proposed. This method involves using a mobile terminal to scan a QR code displayed on an advertising device to obtain device information and calculate the offline password. However, during its implementation, if the preset rules used to generate the QR code are not clear enough or lack security considerations, the information contained in the QR code may be easily tampered with or forged, thereby affecting the accuracy and security of the offline password.
[0062] In response, this application further proposes the following preset rules: pre-collect device identification information and obtain the device's current system time in real time; encrypt the pre-collected device identification information and the obtained current system time in real time using a symmetric or asymmetric method, and then dynamically generate a QR code for transmitting the device's system time and device identification information.
[0063] The preset rules refer to the specific steps and algorithms used to guide advertising devices in preparing and encoding data to generate QR codes. These rules ensure the standardization, security, and validity of the QR code content. They can manifest as embedded program logic within the advertising device, for example, by pre-setting a set of data structure definitions and encryption algorithm flows in the device's firmware; or they can be a configurable strategy that can be updated through the device management interface, allowing for flexible adjustments to data collection, formatting, and encryption parameters.
[0064] The pre-collection of device identification information refers to acquiring and storing the unique identification data of the advertising device before the QR code is generated. This information is typically a fixed or semi-fixed attribute assigned to the device during the manufacturing or initialization phase, such as the device's unique serial number, model code, or MAC address. The purpose is to bind the generated offline password to a specific physical device, thereby enhancing security and preventing the password from being misused on unauthorized devices. This information can be burned into the device's secure storage area (such as EEPROM or one-time programmable memory) during device production and read and cached when the device starts up.
[0065] The real-time acquisition of the device's current system time refers to obtaining a precise current timestamp from the advertising device's internal clock source when generating the QR code. The term "real-time" emphasizes the immediacy and dynamism of time, which is crucial for generating time-sensitive dynamic offline passwords. This ensures the password remains valid for a short period, thereby reducing the risk of replay attacks. This time information can be provided by the device's internal Real-Time Clock (RTC) module, or, if the device has network connectivity, synchronized with an external time server via the Network Time Protocol (NTP).
[0066] Encryption using symmetric or asymmetric methods refers to data protection processing of pre-collected device identification information and real-time system time. The purpose of encryption is to prevent unauthorized third parties from stealing or tampering with sensitive information during QR code transmission, ensuring data confidentiality and integrity. Symmetric encryption methods, such as the Advanced Encryption Standard (AES), use the same key for both encryption and decryption, requiring the advertising device and mobile terminal to securely share this key. Asymmetric encryption methods, such as the RSA algorithm, use a public-private key pair. The advertising device can use its private key to sign or encrypt data, while the mobile terminal uses the corresponding public key for verification or decryption.
[0067] The dynamically generated QR code for transmitting device system time and device identification information refers to encoding encrypted device identification information and system time into a visually scannable QR code pattern. The "dynamic" characteristic here mainly refers to the real-time nature of the system time, ensuring that the content of the QR code changes with time each time it is generated. This can be achieved through a built-in QR code generation library or module in the advertising device, converting the encrypted data string into QR code image data and displaying it on the device's screen.
[0068] This application's solution addresses potential security vulnerabilities in basic solutions by explicitly defining the rules for generating QR code content. Specifically, by pre-collecting device identification information, it ensures the unique association between QR code content and a specific device; by obtaining the device's current system time in real time, it guarantees the dynamism and timeliness of the QR code content, providing a foundation for generating one-time passwords; more importantly, by encrypting this information using symmetric or asymmetric methods, it significantly enhances the confidentiality and integrity of the QR code content, effectively preventing information from being stolen or tampered with during transmission. Finally, based on this securely processed information, a QR code is dynamically generated, ensuring that each generated QR code is unique and protected, thus providing reliable and secure input for subsequent offline password calculation by the mobile terminal. This mechanism ensures that the offline password generation process is based on trustworthy device and time information, significantly enhancing the security of the entire system.
[0069] The following is a concrete example. In one implementation, when the advertising device detects that a user has triggered a physical button, its internal microcontroller immediately executes a pre-programmed QR code generation procedure. This procedure first reads the pre-written device serial number and product model from the device's non-volatile memory as device identification information. Simultaneously, the microcontroller retrieves the current UTC timestamp from its integrated Real-Time Clock (RTC) module. Subsequently, this device identification information and the system time are combined into a data string. To ensure data security, this data string is encrypted using a pre-programmed AES-256 symmetric encryption algorithm, with the encryption key securely stored in a designated application on both the advertising device and the mobile terminal. The encrypted data string is then sent to the device's QR code encoding module, which converts it into a standard QR code data matrix. Finally, the device's display driver renders and displays the QR code data matrix on the advertising device's screen. Because the system time is updated in real time, a new QR code containing the latest encrypted time information is generated each time the user triggers an operation.
[0070] Through the above technical solution, when generating a QR code, the advertising device can ensure that the device identification information and system time contained in the QR code are authentic, complete, and encrypted. This effectively avoids the risk of malicious tampering or forgery of the QR code content, thereby guaranteeing the accuracy and security of the offline password calculated by the mobile terminal based on the QR code. This method significantly improves the reliability of the offline password generation process, providing a solid security foundation for subsequent device configuration operations.
[0071] In some embodiments described above in this application, a scheme is proposed to generate offline passwords by transmitting device system time and device identification information via QR codes. However, if the specific content of the device identification information is not clear enough or lacks sufficient uniqueness, it may lead to confusion when identifying a specific device, thereby affecting the accuracy and security of offline password generation, especially in application scenarios that require fine-grained management or differentiation of multiple devices of the same type.
[0072] In response, this application further proposes the above-mentioned dynamic offline password generation method based on system time QR code, wherein the device identification information includes the device's unique identifier, model, and serial number information.
[0073] A device's unique identifier is a specific code that can uniquely identify a device, such as its MAC address, IMEI code, or UUID. Its purpose is to ensure the uniqueness of each device within a network or system, preventing identity confusion. In practice, a device's unique identifier can be embedded in the hardware by the device manufacturer during production, or it can be generated and stored by the system when the device is first started.
[0074] The model number refers to the product model or series name of the device, used to distinguish different types or batches of equipment. For example, it could be a specific product model code defined by the manufacturer, or a series name describing the device's functions and specifications. Model information is typically stored in the device's firmware or configuration parameters and can be retrieved through system call interfaces.
[0075] The serial number information refers to a unique number assigned to each device by the manufacturer, typically used for product traceability, warranty, and asset management. For example, it could be a combination of a production batch number and a serial number, or the device's factory serial number. Serial number information is usually also embedded in the device hardware or stored in the firmware and can be read via specific commands or interfaces.
[0076] This application's solution explicitly includes the device's unique identifier, model number, and serial number as part of the device identification information, ensuring that the device identity information included in the generated QR code for transmitting the device's system time and device identification information is comprehensive and highly specific. When the advertising device detects a pre-defined operation, it collects its current system time and device identification information consisting of the unique identifier, model number, and serial number. This information is then encrypted according to preset rules and dynamically generates a QR code. After scanning and parsing the QR code using a pre-installed designated application, the mobile terminal can accurately extract the advertising device's precise identity information. This precise device identity information, combined with the device's system time, serves as input to a one-time dynamic password algorithm, calculating the advertising device's offline password locally on the mobile terminal. In this way, it ensures that the generated offline password is specific to a particular device instance, rather than a generic device type, thereby significantly improving the accuracy and security of the offline password and effectively avoiding security risks that may arise due to ambiguous device identity.
[0077] In one specific implementation, when the advertising device needs to generate an offline password, its internal processor first obtains the device's MAC address as a unique identifier, such as "00:1A:2B:3C:4D:5E". Simultaneously, it obtains the device's model information, such as "SmartDisplay-X100", and the device's serial number information, such as "SN20231027001". This information, along with the device's current system time obtained in real time (e.g., "2023-10-27 14:35:00"), is integrated into a data string, such as "MAC:00:1A:2B:3C:4D:5E|MODEL:SmartDisplay-X100|SN:SN20231027001|TIME:2023-10-27 14:35:00". This data string is then encrypted using a preset encryption algorithm (e.g., using AES-256 symmetric encryption) and encoded into a QR code. After the designated application on the mobile terminal scans and decrypts the QR code, it can accurately extract the MAC address, model, serial number, and system time. Then, based on this precise device identity and time information, combined with a preset one-time dynamic password algorithm, it can calculate the offline password for the specific advertising device.
[0078] The above technical solution clarifies that device identification information should include the device's unique identifier, model, and serial number. This allows for the embedding of detailed and unique identity information of the advertising device when generating the QR code. After parsing the QR code, the mobile terminal can obtain the precise identity of the advertising device, enabling offline password calculation based on a clear and unique device context. This precise device identification capability effectively avoids password confusion or security vulnerabilities caused by ambiguous information in multi-device environments, significantly improving the accuracy, reliability, and security of the offline password generation process, and is particularly suitable for scenarios requiring granular management and authorization of individual devices.
[0079] The present invention will be further illustrated by another specific application embodiment: In this specific application example, it is assumed that an outdoor advertising screen device, after being manufactured in the factory, was stored in a warehouse for six months without being connected to the network for time synchronization. Due to hardware clock drift, the system time of the advertising screen is 30 minutes behind the actual physical time. When the device is finally installed on-site and needs to be configured, since it is in an offline state, an offline password is required. The operation steps are as follows: S1. Triggering the QR code display step, for example, when equipment maintenance personnel walk in front of the advertising screen (advertising equipment), they trigger the advertising screen to display the equipment information QR code by pressing a "Get Equipment Information" button on the touch screen.
[0080] S2. Generating and Displaying the QR Code: The advertising screen's software immediately generates a QR code containing the device's current system time (e.g., if the actual physical time is 10:00 AM on October 26, 2023, but the device's system time is 9:30 AM on October 26, 2023), and other necessary device identification information. For security, this information is encrypted when the QR code is generated. The QR code is then displayed on the advertising screen.
[0081] S3. Scan the QR code: Equipment maintenance personnel open the "Maintenance App" pre-installed on their mobile phone (mobile terminal) and use the App's scanning function to scan the QR code displayed on the advertising screen.
[0082] S4. Decryption and Time Acquisition Steps: After the maintenance app successfully scans the QR code, it will automatically decrypt the encrypted content and extract the current system time of the advertising screen device (i.e., 09:30 on October 26, 2023).
[0083] S5. Calculate the offline password step: The maintenance App calculates the correct offline password for the current advertising screen locally on the phone based on the obtained device system time (09:30 on October 26, 2023) and the preset TOTP algorithm.
[0084] S6. Password Step: The maintenance personnel input the offline password calculated by the App into the configuration interface of the advertising screen. Since the password is calculated based on the device's own system time, it can be successfully verified, thus enabling subsequent configuration operations.
[0085] As can be seen from the above, this invention avoids the problem of password verification failure due to time inconsistency, even if there is a discrepancy between the system time of the advertising screen and the actual physical time, because the offline password calculation is based on the system time provided by the device itself.
[0086] In some of the embodiments described above in this application, a QR code is generated by encrypting the device system time and device identification information. However, during its implementation, if the QR code content is maliciously tampered with during the generation or display process, the mobile terminal will be unable to effectively identify the integrity and authenticity of the information during parsing, which may lead to the calculation of an incorrect offline password based on inaccurate or forged information, affecting the security of subsequent configuration operations.
[0087] In response, this application further proposes a step for controlling and triggering an advertising device to display a QR code generated according to preset rules to transmit device system time and device identification information when a preset specified operation is detected. This step includes: integrating pre-collected device identification information and real-time acquired device current system time; calculating the integrated hash value of the integrated information and encrypting the integrated hash value using the advertising device's private key to generate a digital signature; and encrypting the advertising device's system time and device identification information, along with the newly generated digital signature, according to preset rules to generate a digital QR code for transmitting device system time and device identification information.
[0088] Integrating pre-collected device identification information and real-time acquired device system time involves logically or physically combining the device's unique identification information and current time information to provide a unified input data source for subsequent hash calculations, ensuring that all critical information is included in the integrity verification scope. For example, device identification information and system time can be concatenated into a string or byte sequence in a preset order, such as concatenating the device serial number, model, and current timestamp; or, device identification information and system time can be encapsulated in a data structure (such as a JSON object or XML document) and then serialized into a string or byte sequence.
[0089] Calculating the integrated hash value of the integrated information involves performing a hash operation on the integrated device identification information and system time to generate a fixed-length hash digest. The hash value acts as a "fingerprint" of the data, enabling rapid detection of data tampering; any minor alteration to the original data will result in a significant change in the hash value. For example, the SHA-256 (256-bit Secure Hash Algorithm) algorithm can be used to hash the integrated information; alternatively, the SM3 (Chinese Commercial Cryptographic Algorithm) algorithm can be used.
[0090] Encrypting the integrated hash value using the advertising device's private key to generate a digital signature refers to using asymmetric encryption technology to encrypt the integrated hash value using the private key held by the advertising device, thereby generating a digital signature. A digital signature provides data integrity, authentication, and non-repudiation. By encrypting the hash value with the private key, it can be proven that the hash value was indeed generated by the advertising device holding the corresponding private key, and that the data has not been tampered with after signing. For example, the RSA algorithm can be used, encrypting the hash value using the advertising device's RSA private key; or, the ECC (Elliptic Curve Cryptography) algorithm can be used, signing the hash value using the advertising device's ECC private key.
[0091] Encrypting the system time and device identification information of the advertising device, along with the newly generated digital signature, according to preset rules to generate a digital QR code for transmitting the device's system time and device identification information means combining the original system time, device identification information, and newly generated digital signature, encrypting them according to preset encryption rules, and finally encoding them into a digital QR code. This ensures the confidentiality of the QR code content, preventing unauthorized third parties from directly reading sensitive information; at the same time, the digital signature is included, providing a basis for subsequent integrity verification. For example, the system time, device identification information, and digital signature can be packaged into a data packet, then encrypted using the AES (Advanced Encryption Standard) symmetric encryption algorithm combined with a preset key, and then the encrypted data can be encoded into a QR code; or, the system time, device identification information, and digital signature can be Base64 encoded, then encrypted using a preset encryption algorithm (such as SM4), and then a QR code can be generated.
[0092] The proposed solution involves the advertising device first integrating its current system time with its device identification information to form a unified dataset upon detecting a pre-defined operation. Then, a hash operation is performed on this dataset to generate a unique hash value, which serves as a "fingerprint" reflecting the data's integrity. To further ensure the hash value's authenticity and lack of tampering, the advertising device encrypts the hash value using its pre-set private key, generating a digital signature. This digital signature, acting as a tamper-proof credential, is encrypted along with the original system time and device identification information according to pre-defined encryption rules, ultimately generating a digital QR code containing all necessary information and security credentials. This approach allows mobile terminals to not only obtain the encrypted system time and device identification information when scanning and parsing the QR code, but also verify the integrity and authenticity of this information through the digital signature. This effectively avoids security risks caused by malicious tampering of the QR code content during generation or transmission, ensuring the accuracy and reliability of subsequent offline password calculations.
[0093] The following is a concrete example. Assume the device identification information of the advertising device is "AD_DEV_SN001", and the current system time is the Unix timestamp "1698373800". First, combine the device identification information "AD_DEV_SN001" and the system time "1698373800" into a single string, for example: "AD_DEV_SN001|1698373800". Next, calculate the hash value of the combined string using the SHA-256 algorithm, obtaining a hash digest, for example: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855". Then, the advertising device uses its pre-installed RSA private key to encrypt the above SHA-256 hash value, generating a digital signature. Finally, the original device identification information "AD_DEV_SN001", system time "1698373800", and the generated digital signature are combined into a JSON object, for example: `{"deviceId":"AD_DEV_SN001","timestamp":1698373800,"signature":"..."}`. Then, the JSON string is encrypted using the AES-256 algorithm and a preset shared key. Finally, the encrypted data is encoded into a QR code image and displayed on the advertising device.
[0094] By embedding digital signatures into QR codes using the above technical solution, mobile terminals can effectively verify the integrity and authenticity of device system time and device identification information when parsing the QR code. This significantly enhances the anti-tampering capability of the QR code content. Even if the QR code encounters malicious attacks during generation or transmission, the tampered information can be detected and rejected in a timely manner. This ensures the accuracy and security of subsequent offline password calculations, effectively prevents unauthorized configuration operations caused by information forgery or tampering, and improves the overall security level of the system in offline environments.
[0095] In some embodiments described above, the advertising device integrates device identification information and the real-time system time of the device to calculate an integrated hash value. This integrated hash value is then encrypted using the advertising device's private key to generate a digital signature. Subsequently, the system time, device identification information, and the newly generated digital signature are encrypted according to preset rules to generate a digital QR code for transmitting the device system time and device identification information. However, in its implementation, if the mobile terminal simply parses and extracts the QR code content without performing dedicated decryption processing on this encrypted and signed digital QR code, the original, protected information cannot be effectively obtained, and subsequent integrity verification cannot be performed using the digital signature, potentially leading to information security risks.
[0096] In response, this application further proposes to automatically decrypt the digital QR code by scanning it with a designated application pre-installed on a mobile terminal, thereby obtaining the system time, device identification information, and digital signature of the advertising device.
[0097] The phrase "scanning the digital QR code via a pre-installed application on the mobile terminal" refers to using a specific software application pre-installed on the mobile terminal to scan and capture data from the digital QR code displayed on the advertising device screen through its built-in image recognition function. This designated application can be an application specifically designed for device management or configuration, with a built-in efficient QR code recognition module capable of accurately capturing and parsing digital QR code images. Alternatively, this designated application can be a functional module integrated into a broader IoT management platform, achieving QR code recognition by calling a system-level QR code scanning interface or integrating a third-party scanning library.
[0098] "Automatic decryption of the digital QR code" means that after successful scanning, the designated application automatically performs a data restoration process without user intervention, converting the encrypted digital QR code data back into the original, readable system time, device identification information, and digital signature. The decryption process can use either a symmetric or asymmetric key corresponding to the encryption used by the advertising device. For example, if the advertising device uses a symmetric key for encryption, the mobile terminal needs to have the same symmetric key pre-installed for decryption; if the advertising device uses a public key for encryption, the mobile terminal needs to use the corresponding private key for decryption. The decryption algorithm can be integrated within the designated application; after successful scanning, the application automatically calls the built-in decryption function to process the obtained encrypted data block.
[0099] "Obtaining the system time, device identification information, and digital signature of the advertising device" refers to the direct result of the decryption operation, namely, obtaining the original, tamper-proof key information contained in the digital QR code. The system time is used for subsequent offline password calculation, the device identification information is used to identify the device, and the digital signature is used to verify the integrity and authenticity of the information. The decrypted data can be stored in the mobile terminal's memory in a structured form (e.g., JSON, XML, or other custom data structures) for use by subsequent password calculation and signature verification modules. This information can also be directly passed as parameters to subsequent processing functions, such as offline password calculation functions and digital signature verification functions, to ensure smooth and efficient data flow.
[0100] The proposed solution involves scanning a digital QR code displayed on an advertising device using a pre-installed application on a mobile terminal. The application then automatically decrypts the QR code. This decryption process is based on the encryption method and key used by the advertising device when generating the QR code, ensuring that the information obtained from the QR code is encrypted and protected. Through decryption, the mobile terminal can accurately obtain the original system time, device identification information, and a digital signature generated from the advertising device's private key. This process ensures that the information obtained from the QR code is not only readable but also encrypted, effectively preventing unauthorized access and information leakage. Simultaneously, obtaining the digital signature lays the foundation for subsequent verification of the integrity and authenticity of the information, making the entire offline password generation process more secure and reliable.
[0101] The following example illustrates this concept. A mobile terminal can pre-install a designated application called "Smart Device Assistant." When a user needs to configure an advertising device, they initiate the QR code scanning function through this application. After detecting the designated operation, the advertising device displays a digital QR code containing encrypted information on its screen. The "Smart Device Assistant" application captures and recognizes the digital QR code image on the screen by calling the mobile terminal's camera interface. Upon successful recognition, the application's internal QR code parsing module converts the image data into a binary stream and passes it to the built-in decryption module. Assuming the advertising device uses the AES symmetric encryption algorithm and a preset shared key when generating the digital QR code, the decryption module in the "Smart Device Assistant" application will use the same shared key and AES decryption algorithm to decrypt the binary stream. After decryption, the application will extract the advertising device's system time, device identification information, and a digital signature signed by the advertising device's private key from the decrypted data. This information is then stored in a temporary variable within the application for subsequent offline password calculation and signature verification.
[0102] Through the above technical solution, when obtaining advertising device information, mobile terminals no longer simply read the QR code content, but decrypt the digital QR code to obtain encrypted system time, device identification information, and digital signature. This significantly enhances the security of information transmission and effectively prevents the risk of information being stolen or tampered with by third parties during QR code generation and display. Since the mobile terminal can directly obtain the digital signature, this provides the necessary prerequisite for subsequent verification of the integrity and authenticity of the information, ensuring that the key data used to generate offline passwords is trustworthy. This improves the security and reliability of the entire offline password generation method and avoids potential security vulnerabilities caused by information leakage or tampering.
[0103] In some embodiments described above, a mobile terminal can obtain the system time, device identification information, and digital signature of an advertising device by scanning and decrypting a digital QR code, and plans to calculate an offline password based on this information. However, in practical applications, the system time or device identification information carried by the digital QR code may be at risk of malicious tampering during generation, display, or transmission. Using unverified information directly to calculate the offline password could lead to the generation of an incorrect password or even security vulnerabilities, threatening the system with unauthorized access.
[0104] To address this, this application further proposes to perform the same hash calculation on the decrypted system time and device identification information of the advertising device to obtain a locally calculated local hash value; using a preset public key corresponding to the private key of the advertising device, the digital signature extracted from the digital QR code is decrypted to obtain the original hash value calculated by the advertising device; the locally calculated local hash value is compared with the original hash value decrypted from the digital signature; if the locally calculated local hash value matches the original hash value, it is determined that the content of the digital QR code has not been tampered with during transmission and the information is complete and reliable, and the offline password of the advertising device is calculated based on the obtained device system time; if the locally calculated local hash value does not match the original hash value, it is determined that the content of the digital QR code has been tampered with; a warning is issued, refusing to use the digital QR code information with tampered content for password calculation, and prompting the user to obtain the QR code again or check the device security.
[0105] The process involves performing the same hash calculation on the decrypted system time and device identification information of the advertising device to obtain a locally calculated local hash value. This means using the system time and device identification information of the advertising device parsed from the digital QR code as input, and generating a fixed-length hash value through a hash function. Hash calculation is a one-way hash function that maps input data of arbitrary length to a fixed-length output. Its core function is to generate a "digital fingerprint" for the data, ensuring that even minor changes to the data will result in a significant change in the hash value. In implementation, industry-standard secure hash algorithms such as SHA-256 and SHA-3 can be used to guarantee the uniqueness and collision resistance of the calculation result. Using a preset public key corresponding to the private key of the advertising device, the digital signature extracted from the digital QR code is decrypted to obtain the original hash value calculated by the advertising device. This refers to using public-key cryptography principles, through the public key pre-distributed to the mobile terminal by the advertising device, to decrypt the digital signature contained in the digital QR code. The digital signature is the result of the advertising device encrypting the hash value of the system time and device identification information using its private key, used to verify the source and integrity of the information. Public-key decryption of digital signatures is a crucial step in public-key cryptography. By using a public key paired with the advertising device's private key, the original hash value calculated by the advertising device when generating the digital signature can be recovered. This can be achieved using asymmetric encryption algorithms such as RSA and ECC, ensuring that only mobile terminals with the correct public key can successfully decrypt and verify the signature.
[0106] Comparing the locally calculated local hash value with the original hash value decrypted from the digital signature involves a precise bit-by-bit comparison of the two hash values. If the two hash values match exactly, it indicates that the data has not been tampered with during transmission and the digital signature is valid. Conversely, any inconsistency indicates that the data may have been tampered with or the digital signature is invalid. This comparison process is typically implemented through software logic, such as using comparison functions for strings or byte arrays. When the locally calculated local hash value matches the original hash value, it is determined that the digital QR code content has not been tampered with during transmission and the information is complete and reliable. The offline password of the advertising device is then calculated based on the obtained device system time. This means that when the comparison results match, the system confirms that the system time and device identification information extracted from the digital QR code are complete and reliable, and have not been maliciously modified during transmission. At this point, the mobile terminal can securely use this verified information, combined with a preset one-time dynamic password algorithm, to calculate the offline password of the advertising device locally.
[0107] If the locally calculated local hash value is inconsistent with the original hash value, it is determined that the content of the digital QR code has been tampered with. The system issues a warning, refuses to use the tampered digital QR code information for password calculation, and prompts the user to obtain the QR code again or check the device security. This means that when the comparison result is inconsistent, the system immediately determines that the content of the digital QR code has been tampered with or the signature is invalid. To prevent security risks, the mobile terminal will immediately stop the subsequent offline password calculation process and issue a warning to the user, indicating that there may be a problem and suggesting that the user obtain the QR code again or perform a security check on the advertising device, thereby effectively preventing the generation of passwords using insecure information.
[0108] In the above method, the mobile terminal obtains the system time, device identification information, and digital signature generated by the advertising device's private key after scanning and decrypting the digital QR code. To ensure the integrity and authenticity of this critical information during transmission, this application introduces a rigorous verification mechanism. Specifically, the mobile terminal first independently performs a hash calculation on the system time and device identification information of the advertising device decrypted from the digital QR code, thereby obtaining a locally calculated hash value. Simultaneously, the mobile terminal uses a pre-stored public key corresponding to the advertising device's private key to decrypt the digital signature extracted from the digital QR code, recovering the original hash value calculated by the advertising device when generating the digital QR code. Subsequently, the mobile terminal precisely compares the locally calculated hash value with the original hash value decrypted from the digital signature. If these two hash values are completely identical, it indicates that the system time and device identification information carried by the digital QR code have not been tampered with during transmission and indeed originate from a legitimate advertising device; the information is complete and reliable. Under this premise, the mobile terminal will then securely calculate the offline password for the advertising device locally based on the obtained device system time and a preset one-time dynamic password algorithm. Conversely, if the two hash values do not match, the system will immediately determine that the digital QR code content has been tampered with or the digital signature is invalid, thus refusing to use this untrusted information for password calculation and promptly issuing a warning to the user, prompting them to obtain the QR code again or check device security. Through this mechanism of double hash verification and digital signature verification, this application ensures that the generation of the offline password is based on rigorously verified, complete, and authentic data, greatly improving the security and reliability of the entire password generation process.
[0109] As a specific implementation method, assume that when the advertising device generates the digital QR code, its system time is "2023-10-27 10:30:00" and its device identification information is "AD_DEV_SN001". The advertising device integrates these two pieces of information, calculates a hash value, such as "Hash_Original_XYZ", and encrypts "Hash_Original_XYZ" using its private key to generate a digital signature "Signature_ABC". Then, it encrypts the system time, device identification information, and "Signature_ABC" to generate the digital QR code. After the mobile terminal scans and decrypts the digital QR code, it obtains the system time "2023-10-27 10:30:00", the device identification information "AD_DEV_SN001", and the digital signature "Signature_ABC". At this point, the mobile terminal will perform the following steps: First, it will independently perform the same hash calculation on the obtained system time "2023-10-27 10:30:00" and device identification information "AD_DEV_SN001", for example, using the SHA-256 algorithm, to obtain a locally calculated hash value "Hash_Local_XYZ". Simultaneously, the mobile terminal will use a preset public key corresponding to the advertising device's private key to decrypt the obtained digital signature "Signature_ABC", thereby recovering the original hash value "Hash_Original_XYZ" calculated by the advertising device. Next, the mobile terminal will compare "Hash_Local_XYZ" with "Hash_Original_XYZ". If the two are completely identical, for example, both being "Hash_XYZ", the system confirms that the obtained information is complete and trustworthy, and then calculates the offline password based on "2023-10-27 10:30:00". If "Hash_Local_XYZ" is inconsistent with "Hash_Original_XYZ", for example, if "Hash_Local_XYZ" is "Hash_XYZ_Tampered", the system will determine that the content of the digital QR code has been tampered with, immediately issue a warning, and refuse to perform offline password calculation.
[0110] Through the above technical solution, this application effectively solves the problem of ensuring the integrity and authenticity of the system time and device identification information extracted from the digital QR code during the generation of dynamic offline passwords based on system time QR codes. By performing hash calculations on the decrypted information locally on the mobile terminal and comparing it with the original hash value obtained by decrypting the digital signature using the public key, this application can accurately determine whether the digital QR code content has been tampered with during transmission. This mechanism ensures that only rigorously verified, complete, and reliable system time and device identification information is used for offline password calculation, thereby avoiding the risk of password errors or system security vulnerabilities due to the use of tampered data. This significantly improves the security, reliability, and tamper-proof capability of the dynamic offline password generation process, providing a more robust security guarantee for the configuration and operation of advertising devices.
[0111] Exemplary device like Figure 2 As shown, this embodiment of the invention provides a dynamic offline password generation system based on system time QR codes. The system includes: The pre-configuration module 310 is used to pre-configure a QR code in the advertising device that is triggered by a specified operation to display information about the device system time and device identification. The specified operation is triggered by a physical button, a touch button, or a sensor. The QR code generation and display module 320 is used to control and trigger the advertising device to display a QR code generated according to preset rules to transmit the device system time and device identification information when a preset specified operation is detected. The QR code parsing module 330 is used to scan the QR code through a designated application pre-installed on the mobile terminal, automatically parse the QR code, and extract the system time and device identification information of the advertising device. The offline password generation module 340 is used to calculate the offline password of the advertising device locally on the mobile terminal based on the extracted system time and device identification information of the advertising device and a preset one-time dynamic password algorithm. The offline password verification module 350 is used to control the advertising device to receive the input offline password, and to allow subsequent configuration operations if the verification is successful, as described above.
[0112] This embodiment avoids password verification failures caused by device system time drift by directly encapsulating the system time of the advertising device in a QR code and having the mobile terminal calculate the offline password based on this time. Specifically, in existing technologies, the TOTP algorithm relies on a precise time synchronization mechanism. However, after long-term storage and transportation following factory production, the hardware clock of the advertising device experiences cumulative drift due to lack of network synchronization, resulting in a significant deviation between the system time and the standard time. When the device is installed offline, this deviation causes the offline password generated based on the device's system time to be inconsistent with the expected result of the verification end, thus hindering the configuration operation. This application ensures that the advertising device transmits its current system time in real time when generating the QR code, and the mobile terminal strictly uses this time as the input parameter for the one-time dynamic password algorithm when calculating the offline password, ensuring that the reference time for password generation and verification is completely consistent. Therefore, even if the system time of the advertising device deviates from the standard time due to drift, as long as the time information in the QR code accurately reflects the system state at the time of device generation, the offline password calculated by the mobile terminal can match the expected password recalculated by the advertising device based on the same time parameter, thus successfully passing the verification.
[0113] Through the above technical solution, this application effectively solves the problem of offline password failure caused by clock drift in offline advertising devices, ensuring that the device can be reliably configured and maintained in any offline scenario. Compared with existing technologies, this solution does not rely on the synchronization of the device's system time with the standard time, eliminating the impact of time deviation on password verification. At the same time, it transfers the password calculation process to a more powerful mobile terminal, simplifying the design complexity of the advertising device and reducing the deployment and maintenance costs in areas without network coverage.
[0114] Based on the above embodiments, the present invention also provides a smart terminal, the principle block diagram of which can be as follows: Figure 3 As shown. The smart terminal includes a processor, memory, network interface, display screen, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a dynamic offline password generation method based on a system time QR code. The database of the smart terminal stores the dynamic offline password generation program based on the system time QR code.
[0115] Those skilled in the art will understand that Figure 3The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the smart terminal to which the present invention is applied. A specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0116] In one embodiment, a smart terminal is provided, including a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, the one or more programs including the method described above.
[0117] The smart terminal is configured to scan the QR code displayed on the advertising device via a pre-installed application on the mobile terminal. It automatically parses the QR code, extracts the system time and device identification information of the advertising device, and calculates the offline password for the advertising device locally based on the extracted system time and device identification information, combined with a preset one-time dynamic password algorithm. Specifically, when the advertising device detects a preset specified operation, it displays a QR code containing its system time and device identification information. The smart terminal's processor executes a program stored in memory, controlling the specified application to scan the QR code and parse its content to obtain the advertising device's system time. Subsequently, it calculates the offline password based on this system time, ensuring that the password calculation benchmark remains consistent with the actual state of the advertising device when the QR code was generated.
[0118] This embodiment combines a smart terminal with a dynamic offline password generation method based on a system time QR code, thus avoiding the problem of directly relying on the device's system time for password calculation. Since the smart terminal calculates based on the advertising device's system time obtained from the QR code, rather than relying on its own system time or standard time, even if the advertising device's system time drifts due to prolonged offline operation, the calculated offline password will still remain consistent with the password the advertising device intends to verify. For example, suppose the advertising device's system time is 4 days behind the actual time due to hardware clock drift. After a technician scans the QR code to obtain this system time, the smart terminal uses this time to calculate the offline password, and the advertising device also uses the same system time for verification, thus ensuring password matching.
[0119] The above technical solution effectively solves the problem of offline password verification failure caused by system time drift when advertising devices are offline. Compared with existing technologies, this embodiment does not require advertising devices to be connected to the internet for time synchronization, reducing deployment and maintenance costs. It is especially suitable for scenarios with poor network coverage or no network, significantly improving the availability and security of advertising devices.
[0120] In other embodiments, this application proposes a computer-readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the method described above. This embodiment combines a computer-readable storage medium with a dynamic offline password generation method based on a system time QR code, enabling the electronic device to calculate the offline password based on the advertising device's own system time rather than a standard time. This effectively avoids password verification failures caused by device clock drift, achieving the technical effect of stably implementing device configuration operations in an offline environment.
[0121] Specifically, the instructions stored in the storage medium guide the electronic device to trigger the display of a QR code generated according to preset rules when a preset specified operation is detected. This QR code transmits the device's system time and device identification information. The QR code is then scanned by a designated application pre-installed on the mobile terminal, automatically parsing it to extract the advertising device's system time and device identification information. Based on this extracted information, and combined with a preset one-time dynamic password algorithm, the mobile terminal calculates the advertising device's offline password locally. Finally, the advertising device receives the input offline password and verifies it, allowing subsequent configuration operations. Because the mobile terminal directly uses the advertising device's system time obtained from the QR code as the algorithm input parameter when calculating the offline password, rather than relying on the mobile terminal's own time or standard time, even if the advertising device experiences significant time deviation due to hardware clock drift caused by prolonged offline storage, the generated offline password will still remain consistent with the advertising device's expected verification result.
[0122] Using the above technical solution, when advertising equipment is installed on-site after being stored in a warehouse, offline password verification can be completed without network time synchronization. For example, when the system time of the advertising equipment deviates significantly due to daily drift, the system time obtained by the mobile terminal through parsing the QR code is directly used for password calculation, ensuring that the calculation benchmark is synchronized with the status of the advertising equipment. This fundamentally solves the technical problem in the background technology where time deviation leads to abnormal TOTP calculation results and offline password verification failures, significantly improving the configuration reliability and maintenance efficiency of advertising equipment in scenarios without network coverage.
[0123] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A dynamic offline password generation method based on system time QR codes, characterized in that, include: When a pre-defined operation is detected, the system controls the display of a QR code generated according to pre-defined rules to transmit the device's system time and device identification information. The QR code is scanned by a designated application pre-installed on the mobile terminal, and the QR code is automatically parsed to extract the system time and device identification information of the advertising device. Based on the extracted system time and device identification information of the advertising device, and combined with a preset one-time dynamic password algorithm, the offline password of the advertising device is calculated locally on the mobile terminal. The advertising device receives the input offline password and, upon successful verification, allows subsequent configuration operations.
2. The dynamic offline password generation method based on system time QR code according to claim 1, characterized in that, Before the step of controlling the advertising device to display a QR code generated according to preset rules to transmit device system time and device identification information when a preset specified operation is detected, the following steps are included: The advertising device is pre-configured to display a QR code that transmits the device system time and device identification information, triggered by a specified operation, wherein the specified operation is triggered by a physical button, a touch button, or a sensor.
3. The dynamic offline password generation method based on system time QR code according to claim 2, characterized in that, The preset rules are: to collect device identification information in advance, and to obtain the current system time of the device in real time; The device identification information collected in advance, as well as the current system time of the device obtained in real time, are encrypted in a symmetric or asymmetric manner, and then a QR code is dynamically generated to transmit the device system time and device identification information.
4. The dynamic offline password generation method based on system time QR code according to claim 1, characterized in that, The device identification information includes the device's unique identifier, model, and serial number.
5. The dynamic offline password generation method based on system time QR code according to claim 3, characterized in that, The step of controlling the advertising device to display a QR code generated according to preset rules to transmit device system time and device identification information when a preset specified operation is detected includes: Integrate the pre-collected device identification information with the real-time acquired device current system time; Calculate the integrated hash value of the integrated information, and encrypt the integrated hash value using the private key of the advertising device to generate a digital signature; The system time and device identification information of the advertising device, along with the newly generated digital signature, are encrypted according to preset rules to generate a digital QR code for transmitting the device's system time and device identification information.
6. The dynamic offline password generation method based on system time QR code according to claim 5, characterized in that, The step of scanning the QR code using a pre-installed application on a mobile terminal, automatically parsing the QR code, and extracting the system time and device identification information of the advertising device includes: The digital QR code is scanned by a designated application pre-installed on the mobile terminal, and the digital QR code is automatically decrypted to obtain the system time, device identification information, and digital signature of the advertising device.
7. The dynamic offline password generation method based on system time QR code according to claim 6, characterized in that, The step of calculating the offline password of the advertising device locally on the mobile terminal based on the extracted system time and device identification information of the advertising device, combined with a preset one-time dynamic password algorithm, includes: Perform the same hash calculation on the decrypted system time and device identification information of the advertising device to obtain a locally calculated local hash value; Using a preset public key corresponding to the private key of the advertising device, the digital signature extracted from the digital QR code is decrypted to obtain the original hash value calculated by the advertising device. Compare the locally calculated local hash value with the original hash value decrypted from the digital signature; If the local hash value is consistent with the original hash value, it is determined that the digital QR code content has not been tampered with during transmission and the information is complete and reliable. Then, the offline password of the advertising device is calculated based on the obtained device system time. If the local hash value is inconsistent with the original hash value, it is determined that the content of the digital QR code has been tampered with; the control issues a warning, refuses to use the digital QR code information with tampered content for password calculation, and prompts the user to obtain the QR code again or check the device security.
8. A dynamic offline password generation system based on system time QR codes, characterized in that, The system includes: A pre-configuration module is used to pre-configure the advertising device to display a QR code that transmits the device system time and device identification information, triggered by a specified operation, wherein the specified operation is triggered by a physical button, a touch button, or a sensor. The QR code generation and display module is used to control and trigger the advertising device to display a QR code generated according to preset rules to transmit the device system time and device identification information when a preset specified operation is detected. The QR code parsing module is used to scan the QR code through a designated application pre-installed on the mobile terminal, automatically parse the QR code, and extract the system time and device identification information of the advertising device. The offline password generation module is used to calculate the offline password of the advertising device locally on the mobile terminal based on the extracted system time and device identification information of the advertising device and a preset one-time dynamic password algorithm. The offline password verification module is used to control the advertising device to receive the input offline password and, if the verification is successful, allow subsequent configuration operations.
9. A smart terminal, characterized in that, It includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, wherein the one or more programs include methods for performing any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-7.