CN-121581981-B - Method for updating interest rate information in hardware wallet
Abstract
The application relates to the technical field of information, in particular to a method for updating interest rate information in a hardware wallet, which comprises the steps that a terminal device obtains the interest rate information in the hardware wallet and sends the interest rate information to a background service, when the background service judges that the interest rate information of the hardware wallet is out of date, an update interest rate initialization command and an update interest rate command are issued to the hardware wallet through the terminal device, after the integrity of the update interest rate command is checked, the hardware wallet rolls back and updates interest rate records in an interest rate detail information file according to interest rate update data in the update interest rate command, and meanwhile, the interest rate information recorded in the interest rate information file is updated. The application realizes the update of the interest rate information in the hardware wallet, and the provided technical scheme for updating the interest rate information in the hardware wallet can improve the accuracy and flexibility of calculating interest of the hardware wallet and the applicability of the hardware wallet.
Inventors
- LU ZHOU
Assignees
- 飞天诚信科技股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260123
Claims (12)
- 1. A method of updating interest rate information in a hardware wallet, comprising: step S11, the terminal equipment acquires wallet information and interest rate information of a hardware wallet and uploads the wallet information and the interest rate information to a background service; Step S12, the background service judges whether the interest rate information of the hardware wallet is out of date, if yes, a terminal random number is generated, an update interest rate initialization command containing the terminal random number is organized and sent to the hardware wallet through the terminal equipment, and step S13 is executed, otherwise, the terminal equipment is prompted that update is not needed, and step S16 is executed; Step S13, the hardware wallet encrypts a terminal random number in the update interest rate initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates a wallet random number, and sends the terminal random number ciphertext and the wallet random number to the background service through the terminal equipment; Step S14, the background service acquires a verification key according to the wallet information, uses the acquired verification key and the terminal random number to verify the terminal random number ciphertext, if the verification is passed, organizes an update interest rate command, acquires a protection key according to the wallet information, calculates a message authentication code of the update interest rate command by using the wallet random number and the acquired protection key, sends the update interest rate command and the message authentication code to the hardware wallet through the terminal equipment, executes step S15, otherwise, prompts the terminal equipment for update failure, and executes step S16; step S15, the hardware wallet uses a preset protection key, the wallet random number and the message authentication code to check the integrity of the interest rate updating command, if the verification is passed, the hardware wallet rolls back and updates the interest records in the interest list information file according to the interest rate updating data in the interest rate updating command, and updates the interest rate information recorded in the interest rate information file by using the latest interest rate information in the interest rate updating data, and prompts success of the update to the terminal equipment, and step S16 is executed, otherwise, prompts failure of the update to the terminal equipment, and step S16 is executed; and S16, the terminal equipment prompts corresponding information, and the interest rate updating flow is ended.
- 2. The method of updating interest rate information in a hardware wallet of claim 1, wherein: when the terminal equipment receives an interest rate updating instruction triggered by a user, the method is executed; and/or, when the user uses the hardware wallet to perform online consumption through the terminal device, executing the method; And/or executing the method when the user uses the hardware wallet to recharge through the terminal equipment.
- 3. The method for updating interest rate information in a hardware wallet of claim 1, wherein prior to performing said step S11, further comprises the terminal device activating a non-connection module to establish a connection with the hardware wallet.
- 4. The method for updating interest rate information in a hardware wallet of claim 1, wherein step S13 further comprises, before step S13, determining whether the update interest rate initialization command includes a terminal random number by the hardware wallet, if yes, executing step S13, otherwise, prompting the terminal device that the update has failed, and executing step S16.
- 5. The method for updating interest rate information in a hardware wallet of claim 1, wherein the rolling-back updating of interest records in an interest details information file according to the interest rate updating data in the interest rate updating command comprises determining interest records requiring rolling-back updating according to the interest rate information in the interest rate updating command, recalculating recorded interest and accumulated interest in the interest records, and updating the interest records according to calculation results.
- 6. The method for updating interest rate information in a hardware wallet of claim 1, wherein the rolling-back updating of interest records in the interest list information file is performed according to the interest rate updating data in the interest rate updating command, specifically comprising the steps of determining the interest records needing rolling-back updating according to the interest rate information in the interest rate updating command, recalculating the interest counting days, recording interest and accumulated interest according to wallet balance, counting days, annual interest rate and starting date in the interest rate information in the interest records, and generating new interest records according to calculation results to replace the interest records needing rolling-back updating.
- 7. The method for updating interest rate information in a hardware wallet of claim 1, wherein after rolling back the interest records in the interest profile information file according to the interest rate update data in the update interest rate command, further comprising: Step x1, the hardware wallet reads wallet balance, and reads accumulated interest in the latest interest record in the interest list information file; And step x2, the hardware wallet displays the read wallet balance and accumulated interest through a display screen, starts timing, and refreshes the display screen to be in an initial state after the timing is finished.
- 8. The method for updating interest rate information in a hardware wallet of claim 7, wherein said step x1 is preceded by the further step of: Step y1, the hardware wallet obtains the latest information date of the latest interest record in the interest detail information file to obtain the latest information date, judges whether the latest information date is the last information date corresponding to the current time, if yes, the step x1 is executed, otherwise, the step y2 is executed; And step y2, calculating interest generated by the hardware wallet after the latest interest date according to the transaction record in the transaction detail information file by the hardware wallet, generating a corresponding interest record, writing the interest record into the interest detail information file, and executing the step x1.
- 9. The method for updating interest rate information in a hardware wallet of claim 7, wherein said step x1 is preceded by the further step of: step z1, the hardware wallet obtains the latest information date of the latest interest record in the interest detail information file to obtain the latest information date, judges whether the latest information date is the last information date corresponding to the current time, if yes, the step x1 is executed, otherwise, the step z2 is executed; and step z2, calculating interest generated by the hardware wallet after the latest interest date according to the transaction record in the transaction detail information file, updating the interest record in the interest detail information file and/or generating a corresponding interest record, writing the interest record into the interest detail information file, and executing the step x1.
- 10. A computer system comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method according to any one of claims 1-9.
- 11. A method of updating interest rate information in a hardware wallet, comprising: step S21, the hardware wallet establishes connection with the terminal equipment; step S22, the hardware wallet receives a wallet application selection command sent by the terminal equipment, and returns wallet information of the hardware wallet to the terminal equipment; Step S23, the hardware wallet receives a wallet interest rate information reading command sent by the terminal equipment, reads interest rate information recorded in an interest rate information file and returns the interest rate information of the hardware wallet to the terminal equipment; Step S24, the hardware wallet receives an update interest rate initialization command sent by the terminal equipment, encrypts a terminal random number in the update interest rate initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates a wallet random number, returns the terminal random number ciphertext and the wallet random number to the terminal equipment, waits for receiving the update interest rate command and the message authentication code, and executes step S25 if the update interest rate command is received, otherwise, the flow is ended; Step S25, the hardware wallet uses a preset protection key, the wallet random number and the message authentication code to check the integrity of the update interest rate command, if the verification is passed, step S26 is executed, otherwise, the update failure is prompted to the terminal equipment, and the process is ended; and S26, the hardware wallet rolls back and updates interest records in the interest list information file according to the interest rate update data in the interest rate update command, updates the interest rate information recorded in the interest rate information file by using the latest interest rate information in the interest rate update data, prompts success in updating to the terminal equipment, and ends the flow.
- 12. A computer device comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the method of claim 11.
Description
Method for updating interest rate information in hardware wallet Technical Field The application relates to the technical field of information, in particular to a method for updating interest rate information in a hardware wallet. Background The hardware wallet is used as a physical carrier of the digital RMB, hardware level protection is realized through a security chip technology, but the hardware wallet in the prior art does not support the digital RMB to count information, the applicant discovers in the realization process that if the interest rate of the digital RMB is dynamically updated like the deposit interest rate, in order to improve the accuracy and the flexibility of calculating the interest of the hardware wallet, the update of the interest rate information in the hardware wallet needs to be further realized. Disclosure of Invention The invention aims to overcome the defects of the prior art and provides a method for updating interest rate information in a hardware wallet. In a first aspect, the present application provides a method of updating interest rate information in a hardware wallet, the method comprising: step S11, the terminal equipment acquires wallet information and interest rate information of a hardware wallet and uploads the wallet information and the interest rate information to a background service; Step S12, the background service judges whether the interest rate information of the hardware wallet is out of date, if yes, a terminal random number is generated, an update interest rate initialization command containing the terminal random number is organized and sent to the hardware wallet through the terminal equipment, and step S13 is executed, otherwise, the terminal equipment is prompted that update is not needed, and step S16 is executed; Step S13, the hardware wallet encrypts and updates the terminal random number in the interest rate initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates a wallet random number, and sends the terminal random number ciphertext and the wallet random number to a background service through terminal equipment; Step S14, the background service acquires a verification key according to wallet information, uses the acquired verification key and a terminal random number to verify a terminal random number ciphertext, if verification passes, organizes an update interest rate command, acquires a protection key according to wallet information, calculates a message authentication code of the update interest rate command by using the wallet random number and the acquired protection key, sends the update interest rate command and the message authentication code to a hardware wallet through a terminal device, and executes step S15, otherwise, prompts the terminal device that update fails, and executes step S16; Step S15, the hardware wallet uses a preset protection key, a wallet random number and a message authentication code to check the integrity of the interest rate updating command, if the verification is passed, the interest rate updating data in the interest rate updating command is used for carrying out rollback updating on the interest records in the interest information file, the latest interest rate information in the interest rate updating data is used for updating the interest rate information recorded in the interest rate information file, the success of updating is indicated to the terminal equipment, the step S16 is executed, otherwise, the failure of updating is indicated to the terminal equipment, and the step S16 is executed; and S16, the terminal equipment prompts corresponding information, and the interest rate updating flow is ended. In a second aspect, the present application provides a computer system comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to carry out the steps of the above method. In a third aspect, the present application provides a method of updating interest rate information in a hardware wallet, the method comprising: step S21, the hardware wallet establishes connection with the terminal equipment; step S22, the hardware wallet receives a wallet application selection command sent by the terminal equipment, and returns wallet information of the hardware wallet to the terminal equipment; Step S23, the hardware wallet receives a wallet interest rate information reading command sent by the terminal equipment, reads the interest rate information recorded in the interest rate information file, and returns the interest rate information of the hardware wallet to the terminal equipment; step S24, the hardware wallet receives an update interest rate initialization command sent by the terminal equipment, encrypts a terminal random number in the update interest rate initialization command by using a preset verification key to obtain a terminal random number ciphertext, generates