A method and apparatus for synchronizing a real-time clock, and a storage medium
By generating request codes and dynamic codes through encryption and decryption processes, the real-time clock synchronization problem of the device system is solved when the CPU battery is replaced or the system date is abnormal, ensuring that the device time is consistent with the cloud time and protecting the rights and interests of the device manufacturer.
Patent Information
- Application Number
- CN202111666347.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In existing technologies, when the CPU battery is replaced or the system date is abnormal, the device system cannot achieve real-time clock synchronization with the server background time, resulting in the device being locked and unable to be unlocked.
The device generates a request code and sends it to the manufacturer's terminal device. The manufacturer's terminal device encrypts the code using a dynamic code and sends it back to the device. The device verifies the time information based on the dynamic code to ensure time synchronization.
It enables real-time clock synchronization when the CPU battery is replaced or the system date is abnormal, ensuring that the device's locked date is consistent with the cloud server time, thus protecting the rights of device manufacturers.
Smart Images

Figure CN114564074B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to a method, apparatus, and storage medium for synchronizing a real-time clock. Background Technology
[0002] Currently, installment payment plans are gradually being adopted in the industrial automation equipment market. This is mainly due to two factors: Firstly, rising raw material prices, increased labor costs, and intensified market competition have led to a surge in demand for automation equipment from manufacturing companies, while some companies are experiencing cash flow shortages. Secondly, the automation equipment market itself is highly competitive, and the "buyer's market" for manufacturers has been fully confirmed. Consequently, equipment manufacturers are forced to adopt more flexible promotional methods, thus creating a growing market demand for installment payment plans.
[0003] The specific implementation method of installment payment is as follows: a specific date is set as the device lock date according to the payment amount. When the device lock date is reached, if the customer has not made the next payment, the device will be locked and unusable. In this process, after the device goes offline, the system date and time of the device must be synchronized with the system time of the cloud backend server. The system date and time cannot be modified arbitrarily. Therefore, the synchronization mechanism of the device's RTC clock is involved to ensure the rights and interests of the device manufacturer.
[0004] There is currently no effective solution to the technical problem that existing equipment systems cannot achieve real-time clock synchronization when the CPU battery is replaced or the system date is abnormal and out of sync with the current server background time. Summary of the Invention
[0005] The embodiments of this disclosure provide a real-time clock synchronization method, apparatus, and storage medium to at least solve the technical problem in the prior art that existing device systems cannot complete real-time clock synchronization when the CPU battery is replaced or the system date is abnormal and out of sync with the current server background time.
[0006] According to one aspect of the present disclosure, a real-time clock synchronization method is provided for synchronizing the real-time clock of a device supporting a credit installment payment software system. The method includes: a first terminal device operated by an operator sending a request code to a second terminal device of the device manufacturer, wherein the request code is obtained by encrypting time information set by the operator; the second terminal device determining a dynamic code based on the request code and sending the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; and the operating device determining the current time of the device based on the dynamic code received by the first terminal device.
[0007] According to another aspect of the present disclosure, a storage medium is also provided, the storage medium including a stored program, wherein, when the program is executed, a processor performs any of the methods described above.
[0008] According to another aspect of the present disclosure, a real-time clock synchronization device is also provided, comprising: a sending module for synchronizing the real-time clock of a device supporting a credit installment payment software system, comprising: a sending module for a first terminal device of an operator operating the device to send a request code to a second terminal device of the device manufacturer, wherein the request code is obtained by encrypting time information set by the operator; a first determining module for the second terminal device to determine a dynamic code based on the request code and send the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; and a second determining module for the operating device to determine the current time of the device based on the dynamic code received by the first terminal device.
[0009] According to another aspect of the present disclosure, a real-time clock synchronization device is also provided, comprising: a processor for synchronizing the real-time clock of a device supporting a credit installment payment software system; and a memory connected to the processor for providing instructions to the processor to process the following steps: a first terminal device of an operator of the device sends a request code to a second terminal device of the device manufacturer, wherein the request code is obtained by encrypting time information set by the operator; the second terminal device determines a dynamic code based on the request code and sends the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; and the operating device determines the current time of the device based on the dynamic code received by the first terminal device.
[0010] In this embodiment, the backend server authenticates the device's permissions using a request code. The backend server then generates a dynamic code and sends it to the device. After the dynamic code is authenticated by the device, the date and time decrypted from the dynamic code are used to verify the device's set date and time. Only after successful verification is RTC clock synchronization allowed. This solves the technical problem in existing technologies where real-time clock synchronization is impossible when the CPU battery is replaced or the system date is abnormal and out of sync with the current server's backend time. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this invention, illustrate exemplary embodiments of the present disclosure and are used to explain the disclosure, but do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a hardware structure block diagram of a computing device for implementing the method described in Embodiment 1 of this disclosure; Figure 2 This is a schematic diagram of a real-time clock synchronization system according to Embodiment 1 of this disclosure; Figure 3 This is a flowchart illustrating a real-time clock synchronization method according to the first aspect of Embodiment 1 of this disclosure; Figure 4a , Figure 4b This is a schematic diagram of the encryption and decryption process of the request code according to the first aspect of Embodiment 1 of this disclosure; Figure 4c , Figure 4d This is a schematic diagram of the encryption and decryption process of the dynamic code according to the first aspect of Embodiment 1 of this disclosure; Figure 5a This is a schematic diagram of the interface of the operating device according to the first aspect of Embodiment 1 of this disclosure; Figure 5b This is a schematic diagram of the interface illustrating the manufacturer's decryption process according to the first aspect of the embodiments of this disclosure; Figure 6 This is a schematic diagram of a real-time clock synchronization device according to Embodiment 2 of this disclosure; and Figure 7 This is a schematic diagram of a real-time clock synchronization device according to Embodiment 3 of this disclosure. Detailed Implementation
[0012] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this disclosure.
[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. Example
[0014] According to this embodiment, a method embodiment for synchronizing a real-time clock is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0015] The method embodiments provided in this example can be executed on mobile terminals, computer terminals, servers, or similar computing devices. Figure 1 A hardware block diagram of a computing device for implementing a real-time clock synchronization method is shown. Figure 1 As shown, a computing device may include one or more processors (processors may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), memory for storing data, and transmission devices for communication functions. In addition, it may also include: a display, input / output interfaces (I / O interfaces), a universal serial bus (USB) port (which may be included as one of the ports in the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, a computing device may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0016] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element in a computing device. As involved in the embodiments of this disclosure, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).
[0017] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the real-time clock synchronization method in the embodiments of this disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the real-time clock synchronization method of the aforementioned application. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the computing device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0018] The transmission device is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the computing device's communication provider. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a radio frequency (RF) module used for wireless communication with the Internet.
[0019] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows users to interact with the user interface of the computing device.
[0020] It should be noted here that, in some optional embodiments, the above... Figure 1 The computing device shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance, and is intended to illustrate the types of components that may exist in the aforementioned computing devices.
[0021] Figure 2 This is a schematic diagram of a real-time clock synchronization system according to this embodiment. (Refer to...) Figure 2 As shown, the system includes: a first terminal device 100 for the operator, a second terminal device 200 for the equipment manufacturer, and a backend server 300. The first terminal device 100 and the second terminal device 200 are connected via network communication, and the second terminal device 200 is also connected to the backend server 300 via network communication. It should be noted that the hardware structure described above can be used for the first terminal device 100, the second terminal device 200, and the backend server 300 in the system.
[0022] Under the aforementioned operating environment, according to the first aspect of this embodiment, a real-time clock synchronization method is provided, the method comprising: Figure 2 The first terminal device 100, the second terminal device 200, and the backend server 300 shown are implemented. Figure 3 A flowchart illustrating the method is shown below. (Refer to...) Figure 3 As shown, the method includes: S302: The operator's first terminal device sends a request code to the equipment manufacturer's second terminal device, wherein the request code is obtained by encrypting the time information set by the operator. S304: The second terminal device determines the dynamic code based on the request code and sends the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; and S306: The operating device determines the current time of the device based on the dynamic code received by the first terminal device.
[0023] As described in the background section, the specific implementation of installment payments involves setting a specific date as the device lock date based on the payment amount. If the customer has not made the next payment by the lock date, the device becomes unusable. This process involves ensuring that the device's system date and time are synchronized with the cloud backend server's system time after the device goes offline. The system date and time cannot be arbitrarily modified. Therefore, the device's RTC clock synchronization mechanism is required to protect the rights of the device manufacturer.
[0024] In view of this, the device real-time clock synchronization method for supporting credit installment payment software systems provided in this embodiment of the invention is a mechanism that requires modification of the device's date and time with authorization when there is a discrepancy between the device's date and time and the date and time of the cloud server. When RTC synchronization failure occurs on the device, the actual date and time are set on the device, and a request code is generated on the device. The operator sends the request code to the decryptor, who enters the request code on the WeChat official account. The cloud server backend encrypts the current server date and time to generate a dynamic code, and then sends the dynamic code to the operator. The operator enters the code into the device, and the device automatically checks whether the set date and time are normal. If the set date and time are normal, RTC clock synchronization is performed; otherwise, RTC clock synchronization is not performed to ensure the validity of the RTC clock setting.
[0025] First, when the CPU battery of the operating device is replaced or the system date is out of sync with the current server's backend time, the operator's first terminal device sends a request code to the device manufacturer's second terminal device. This request code is encrypted based on the time information set by the operator. Specifically, the operator inputs the device's time and date on the operating device, and the device generates a request code based on this information. The request code can be in numeric or identification code form. The operator then sends the request code from the first terminal device 100 to the device manufacturer's second terminal device 200.
[0026] Furthermore, the second terminal device 200 determines the dynamic code based on the request code and sends the dynamic code to the first terminal device 100, wherein the dynamic code is used to synchronize the real-time clock of the operating device.
[0027] Specifically, the second terminal device 200 can identify the device information of the operation device that needs to be decrypted based on the received request code, and then encrypt the device information through a preset dynamic code generation algorithm to obtain a dynamic code which is sent to the first terminal device 100.
[0028] Then, the operating device determines the current time of the device based on the dynamic code received by the first terminal device. This enables the installment credit device to be unlocked even when it is locked.
[0029] Therefore, based on the above method, the backend server authenticates the device's permissions through the device's request code. The backend server then generates a dynamic code and sends it to the device. After the dynamic code is authenticated by the device, the date and time decrypted from the dynamic code are used to verify the device's set date and time. Only after successful verification is RTC clock synchronization allowed. This solves the technical problem in existing technologies where existing device systems cannot achieve real-time clock synchronization when the CPU battery is replaced or the system date is abnormal and out of sync with the current server's backend time.
[0030] Optionally, the operation of the second terminal device to determine the dynamic code based on the request code includes: the second terminal device sending the request code to the backend server; the backend server decoding the request code using the system time to determine the device serial number and the first verification code corresponding to the request code; the backend server verifying the device serial number based on the first verification code to determine the validity of the device serial number; and if the device serial number is valid, retrieving the data information corresponding to the device serial number from the database, encrypting the data information, generating a dynamic code, and sending it to the second terminal device.
[0031] Specifically, refer to Figures 4a-4b As shown, the request code can consist of a 1-digit checksum and a 6-digit device code. This is obtained by encrypting the device serial number and the currently set system date.
[0032] The first terminal device 200 sends a decryption request to the backend server 300 via a request code. The backend server 300 decrypts the request code to obtain the device information requesting clock synchronization and verifies the accuracy of the decrypted device serial number based on the first verification code obtained after decryption. If the device number is accurate, the backend server 300 reads the data information corresponding to the device serial number from the memory (which may be a database with storage capabilities, etc.).
[0033] When the decrypted device serial number is valid, the backend server 300 searches for it in the backend database. If the serial number exists, it is considered valid; otherwise, if the serial number does not exist in the database, the RTC clock synchronization operation is not allowed. Thus, the encryption and decryption processes of the request code and dynamic code are completed through the above methods, ensuring the security of clock synchronization.
[0034] Optionally, the operation of retrieving data information corresponding to the device serial number from the database, encrypting the data information, and generating a dynamic code includes: obtaining timestamp information from the backend server, determining the dynamic code based on the timestamp information and the data information, wherein the data information includes the device serial number and the dynamic random code corresponding to the device serial number.
[0035] Specifically, refer to Figures 4c-4d The diagram illustrates the encryption and decryption process of the dynamic code. The backend server obtains the 16-bit device random code corresponding to the device serial number, the current system date and time, and then encrypts the current time information (hours:minutes) together with the device serial number, outputting a 4-bit dynamic code, where 3 bits are the time information and 1 bit is the checksum. The dynamic code is obtained by encrypting the 16-bit random code, the current system date, the 6-bit device serial number, and the current time, including a 1-bit checksum and 3-bit time information. This process completes the encryption of the dynamic code, thereby ensuring the accuracy of clock synchronization.
[0036] also, Figure 5a The interface information for operating the device is shown in the figure. It can be seen from the figure that the request code can be in the form of numbers or identification codes. Figure 5b The diagram illustrates the process of manufacturer personnel receiving a request code and responding with a dynamic code. It shows that only authorized manufacturer personnel have permission to access the backend server (300) via the terminal device. The operator sends the request code from the operating device to the decryptor (manufacturer personnel). After receiving the request code, the decryptor can log in to the WeChat official account client, such as... Figure 5b As shown, after entering the request code, click the "Generate Dynamic Code" button. The backend server receives the request code via a 300 status code and decrypts it using the system date, as shown below. Figure 4bAs shown, the device serial number and checksum are decrypted, and the validity of the serial number is determined by the checksum.
[0037] Optionally, the operation of the operating device to determine the current time of the device based on the dynamic code received by the first terminal device includes: the operating device decrypting the dynamic code to determine the time information and the second verification code corresponding to the dynamic code; the operating device verifying the time information through the second verification code to determine the validity of the time information; and, if the time information is valid and the time information and the set time information are within a preset error range, determining the current time of the device.
[0038] Specifically, such as Figures 4c-4d As shown, after receiving the dynamic code, the operating device obtains its local random code, the currently set date, and the device serial number to decrypt the dynamic code, extracting the time information and a verification code. The validity of the time information is then determined using the verification code. The operating device obtains the decrypted time information and compares it with the currently set time information. If the error meets the requirements, the set date and time information are synchronized to the system.
[0039] Optionally, the method further includes: keeping the operating device in an "on" state before the current time of the operating device is determined; and not setting time information before the current time of the operating device is determined. The operating device cannot operate without being unlocked by the manufacturer, thereby ensuring the manufacturer's management of the operating device during the credit period.
[0040] Optionally, the equipment manufacturer can be a person with decoding privileges. Specifically, the equipment manufacturer is a registered and authorized decryption specialist with decryption permissions, thus ensuring the security of the manufacturer's information.
[0041] In addition, refer to Figure 1 As shown, according to a second aspect of this embodiment, a storage medium is provided. The storage medium includes a stored program, wherein, when the program is executed, a processor performs any of the methods described above.
[0042] Therefore, according to this embodiment, the backend server authenticates the operating device's permissions through the device's request code. The backend server then generates a dynamic code and sends it to the operating device. After the dynamic code is authenticated by the operating device, the date and time decrypted from the dynamic code are used to verify the device's set date and time. Only after successful verification is RTC clock synchronization allowed. This solves the technical problem in the prior art where existing device systems cannot achieve real-time clock synchronization when the CPU battery is replaced or the system date is abnormal and out of sync with the current server's backend time.
[0043] In addition, when the system's CPU battery is replaced or the system date is abnormal and out of sync with the current server's backend time, time synchronization is required. In this case, the RTC date and time synchronization decryption process must be executed. Step 1: The process on the device side is as follows (1) In the system options on the device, there will be a time synchronization function button. Clicking it will bring up the time synchronization dialog box. (2) The user enters the date and time, and clicks the "Confirm" button after confirming that the information is correct. A 7-digit request code and a QR code are generated. After that, the date and time cannot be modified. (3) The device request code uses the date set by the current system to encrypt the device serial number information; (4) After the user clicks the "Confirm" button to generate a request code, the device backend starts the timer and automatically updates the currently set time; (5) Display a prompt message: The device is not allowed to be restarted before the time synchronization is completed; otherwise, the request code will be invalid. (6) The user sends the request code to the manufacturer's customer service personnel. The request code is valid for the day. Step 2: The server-side backend process is as follows (1) The server receives the request code and decrypts it to obtain the date and device serial number. (2) If the date on the server side is inconsistent with the decrypted date, the message "Device date setting error, time synchronization is disabled" will be displayed. (3) If the decrypted device serial number does not exist in the background database, the system will prompt that there is no current device serial number registered and the request code is invalid. (4) If the date and device serial number verification passes, the current server backend time (hours:minutes) is added to the allowable time error, and a 4-digit dynamic code is generated by encryption. (5) Customer service personnel will send the dynamic code to the customer. Step 3: Device End (1) The user receives the dynamic code and enters it on the device. (2) After receiving the request code, the device backend immediately checks whether the device has been restarted. If it has been restarted, it prompts that the current dynamic code is invalid and the device has been restarted. (3) If the device has not restarted, decrypt the current dynamic code; if the device serial number verification fails, refuse time synchronization. (4) If the device serial number verification is OK, then decrypt the server background time. (5) If the current timer update time (hours:minutes) on the device is less than the decrypted time (hours:minutes), then the current date and time set on the device plus the timer running time will be updated to the date and time settings on the device; otherwise, synchronization will fail.
[0044] In addition, when the device's RTC clock is out of sync with the server time, the device operator should first set the actual date and time, such as... Figure 5a As shown, after setting the date and time, click "Confirm" to generate a request code and a QR code for the request code. The date and time set thereafter cannot be modified.
[0045] Figure 1 As shown, the device uses the currently temporarily set date information to encrypt the device serial number and generate a 7-bit request code, of which 6 bits are the device serial number information and 1 bit is the verification code information.
[0046] The operator sends the device's request code to the decryptor. Upon receiving the request code, the decryptor logs into the WeChat official account client, such as... Figure 6 As shown, after entering the request code, click the "Generate Dynamic Code" button. After receiving the request code, the cloud backend server decrypts the current request code using the system date, as shown below. Figure 2 As shown, the device serial number and checksum are decrypted, and the validity of the serial number is determined by the checksum.
[0047] Once the decrypted device serial number is valid, the system searches for the device serial number in the background database. If the device serial number exists, it is considered valid; otherwise, if the device serial number does not exist in the database, the RTC clock synchronization operation is not allowed. like Figure 3 As shown, the backend server obtains the 16-bit random device code of the corresponding device serial number, the current system date and time, and then encrypts the current time information (hour:minute) together with the device serial number, and outputs a 4-bit dynamic code, of which 3 bits are time information and 1 bit is a check code; The decryptor sends the dynamic code to the equipment operator, who then inputs it into the device, such as... Figure 4d As shown, after receiving the dynamic code, the device obtains the local random code, the currently set date, and the device serial number together to decrypt the dynamic code, thereby decrypting the time information and the verification code. The validity of the time information is then determined by the verification code.
[0048] The device obtains the decrypted time information and compares it with the currently set time information. If the error meets the requirements, the set date and time information will be synchronized to the system.
[0049] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0050] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention. Example
[0051] Figure 6 A real-time clock synchronization device 600 according to this embodiment is shown, which corresponds to the method described according to the first aspect of Embodiment 1. (See reference...) Figure 6 As shown, the device 600 includes: a sending module 610, used for a first terminal device of an operator to send a request code to a second terminal device of the equipment manufacturer, wherein the request code is obtained by encrypting time information set by the operator; a first determining module 620, used for the second terminal device to determine a dynamic code based on the request code and send the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; and a second determining module 630, used for the operating device to determine the current time of the device based on the dynamic code received by the first terminal device.
[0052] Optionally, the first determining module 620 includes: a sending submodule, used by the second terminal device to send the request code to a backend server; a first determining submodule, used by the backend server to decode the request code using system time, and determine the device serial number and a first verification code corresponding to the request code; a second determining submodule, used by the backend server to verify the device serial number according to the first verification code, and determine the validity of the device serial number; and a generating submodule, used to, if the device serial number is valid, retrieve data information corresponding to the device serial number from the database, encrypt the data information, generate the dynamic code, and send it to the second terminal device.
[0053] Optionally, the generation submodule includes: a determining unit, configured to obtain the timestamp information of the backend server, and determine the dynamic code based on the timestamp information and the data information, wherein the data information includes the device serial number and a dynamic random code corresponding to the device serial number.
[0054] Optionally, the second determining module 630 includes: a third determining submodule, used by the operating device to decrypt the dynamic code and determine the time information and second verification code corresponding to the dynamic code; a fourth determining submodule, used by the operating device to verify the time information through the second verification code and determine the validity of the time information; and a fifth determining submodule, used to determine the current time of the device if the time information is valid and the time information and the set time information are within a preset error.
[0055] Optionally, the device 600 further includes: the operating device being in an on state before the current time of the operating device is determined; and the set time information not being executed before the current time of the operating device is determined.
[0056] Optionally, the device manufacturer is a person with decoding authority.
[0057] Therefore, according to this embodiment, the backend server authenticates the operating device's permissions through the device's request code. The backend server then generates a dynamic code and sends it to the operating device. After the dynamic code is authenticated by the operating device, the date and time decrypted from the dynamic code are used to verify the device's set date and time. Only after successful verification is RTC clock synchronization allowed. This solves the technical problem in the prior art where existing device systems cannot achieve real-time clock synchronization when the CPU battery is replaced or the system date is abnormal and out of sync with the current server's backend time. Example
[0058] Figure 7A real-time clock synchronization device 700 according to this embodiment is shown, which corresponds to the method described according to the first aspect of Embodiment 1. Reference Figure 7 As shown, the device 700 includes: a processor 710; and a memory 720 connected to the processor 710, used to provide the processor 710 with instructions to process the following steps: a first terminal device of an operator of the operating device sends a request code to a second terminal device of the device manufacturer, wherein the request code is obtained by encrypting time information set by the operator; the second terminal device determines a dynamic code based on the request code and sends the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; and the operating device determines the current time of the device based on the dynamic code received by the first terminal device.
[0059] Optionally, the operation of the second terminal device to determine the dynamic code based on the request code includes: the second terminal device sending the request code to the backend server; the backend server decoding the request code using the system time to determine the device serial number and the first verification code corresponding to the request code; the backend server verifying the device serial number based on the first verification code to determine the validity of the device serial number; and if the device serial number is valid, retrieving the data information corresponding to the device serial number from the database, encrypting the data information, generating a dynamic code, and sending it to the second terminal device.
[0060] Optionally, the operation of retrieving data information corresponding to the device serial number from the database, encrypting the data information, and generating a dynamic code includes: obtaining timestamp information from the backend server, determining the dynamic code based on the timestamp information and the data information, wherein the data information includes the device serial number and the dynamic random code corresponding to the device serial number.
[0061] Optionally, the operation of the operating device to determine the current time of the device based on the dynamic code received by the first terminal device includes: the operating device decrypting the dynamic code to determine the time information and the second verification code corresponding to the dynamic code; the operating device verifying the time information through the second verification code to determine the validity of the time information; and, if the time information is valid and the time information and the set time information are within a preset error range, determining the current time of the device.
[0062] Optionally, it also includes: the operating device being in an on state before the current time of the operating device is determined; and the time setting information not being executed before the current time of the operating device is determined.
[0063] Optionally, the equipment manufacturer is a person with decoding authority.
[0064] Therefore, according to this embodiment, the backend server authenticates the operating device's permissions through the device's request code. The backend server then generates a dynamic code and sends it to the operating device. After the dynamic code is authenticated by the operating device, the date and time decrypted from the dynamic code are used to verify the device's set date and time. Only after successful verification is RTC clock synchronization allowed. This solves the technical problem in the prior art where existing device systems cannot achieve real-time clock synchronization when the CPU battery is replaced or the system date is abnormal and out of sync with the current server's backend time.
[0065] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0066] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0067] In the several embodiments provided by this invention, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0068] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0069] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0070] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0071] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A real-time clock synchronization method for realizing real-time clock synchronization of devices supporting credit installment payment software systems, characterized in that, include: The operating device encrypts the device serial number based on the time information set by the operator and generates a request code; The operator's first terminal device sends the request code to the equipment manufacturer's second terminal device; The second terminal device sends the request code to the backend server; The backend server decodes the request code using the system time to determine the device serial number and first check code corresponding to the request code; The backend server verifies the device serial number based on the first verification code to determine the validity of the device serial number; If the device serial number is valid, retrieve the data information corresponding to the device serial number from the database, encrypt the data information, generate a dynamic code, and send it to the second terminal device. The second terminal device sends the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; The operating device determines the current time of the device based on the dynamic code received by the first terminal device, including: The operating device decrypts the dynamic code to determine the time information and second check code corresponding to the dynamic code; The operating device verifies the time information using the second verification code to determine the validity of the time information; If the time information is valid, and the time information and the set time information are within a preset error range, the current time of the device is determined; The dynamic code consists of time information and a check code; The dynamic code is obtained by encrypting a random code, the current system date, the device serial number, and the current time.
2. The method according to claim 1, characterized in that, The operation of retrieving data information corresponding to the device serial number from the database, encrypting the data information, and generating the dynamic code includes: Obtain the timestamp information of the backend server, and determine the dynamic code based on the timestamp information and the data information, wherein the data information includes the device serial number and the dynamic random code corresponding to the device serial number.
3. The method according to claim 1, characterized in that, Also includes: The operating device is in the on state until the current time of the operating device is determined; as well as The set time information will not be executed until the current time of the operating device is determined.
4. The method according to claim 1, characterized in that, The equipment manufacturer is a person with decoding authority.
5. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program is executed, the method described in any one of claims 1 to 4 is performed by a processor.
6. A real-time clock synchronization device for synchronizing the real-time clock of a device supporting a credit installment payment software system, characterized in that, include: The sending module is used to encrypt the device serial number of the operating device according to the time information set by the operator, generate a request code, and send the request code from the first terminal device of the operator of the operating device to the second terminal device of the equipment manufacturer. The first determining module is used to send the request code from the second terminal device to the backend server. The backend server decodes the request code using the system time, determines the device serial number and the first verification code corresponding to the request code, verifies the validity of the device serial number based on the first verification code, and if the device serial number is valid, retrieves the data information corresponding to the device serial number from the database, encrypts the data information, generates a dynamic code, and sends it to the second terminal device. The second terminal device sends the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device. as well as The second determining module is used by the operating device to determine the current time of the device based on the dynamic code received by the first terminal device, including: the operating device decrypting the dynamic code to determine time information and a second verification code corresponding to the dynamic code; the operating device verifying the time information using the second verification code to determine the validity of the time information; and determining the current time of the device if the time information is valid and the time information and the set time information are within a preset error; the dynamic code consists of time information and a verification code; wherein the dynamic code is obtained by encrypting a random code, the current system date, the device serial number, and the current time.
7. A real-time clock synchronization device for synchronizing the real-time clock of a device supporting a credit installment payment software system, characterized in that, include: processor; as well as A memory, connected to the processor, for providing the processor with instructions to perform the following processing steps: The operating device encrypts the device serial number based on the time information set by the operator and generates a request code; The operator's first terminal device sends the request code to the equipment manufacturer's second terminal device; The second terminal device sends the request code to the backend server; The backend server decodes the request code using the system time to determine the device serial number and first check code corresponding to the request code; The backend server verifies the device serial number based on the first verification code to determine the validity of the device serial number; If the device serial number is valid, retrieve the data information corresponding to the device serial number from the database, encrypt the data information, generate a dynamic code, and send it to the second terminal device. The second terminal device sends the dynamic code to the first terminal device, wherein the dynamic code is used to synchronize the real-time clock of the operating device; The operating device determines the current time of the device based on the dynamic code received by the first terminal device, including: The operating device decrypts the dynamic code to determine the time information and second check code corresponding to the dynamic code; The operating device verifies the time information using the second verification code to determine the validity of the time information; If the time information is valid, and the time information and the set time information are within a preset error range, the current time of the device is determined; The dynamic code consists of time information and a check code; The dynamic code is obtained by encrypting a random code, the current system date, the device serial number, and the current time.
8. The apparatus according to claim 7, characterized in that, The operation of retrieving data information corresponding to the device serial number from the database, encrypting the data information, and generating the dynamic code includes: Obtain the timestamp information of the backend server, and determine the dynamic code based on the timestamp information and the data information, wherein the data information includes the device serial number and the dynamic random code corresponding to the device serial number.
Citation Information
Patent Citations
Clock synchronization method, system and device, intelligent terminal, vehicle terminal and medium
CN109495263A
Time synchronization method and device
CN112346512A
