Recovery Method, Device, Storage Medium and Electronic Device for Electronic Vouchers

Through the combination of hash table and linked list structure, the storage space is accurately allocated, and the problem of low electronic voucher recycling efficiency is solved, efficient storage and reuse of invalid vouchers is achieved, and the utilization rate of system resources is improved.

CN115048555BActive Publication Date: 2025-07-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210647348.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2025-07-18
Estimated Expiration
2042-06-09

AI Technical Summary

Technical Problem

The recycling efficiency of electronic certificates in the prior art is low, resulting in wasted system resources and invalid certificates cannot be used again.

Method used

Using a combination structure of hash table and linked list, the power index value is determined by calculating the number of invalid vouchers and the preset base value, the storage space is accurately allocated, and the invalid vouchers are stored in the free storage unit, and the storage information is cleared for reuse.

Benefits of technology

It improves the utilization rate of invalid vouchers and the utilization efficiency of storage units, and realizes efficient voucher recycling and reuse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048555B_ABST
    Figure CN115048555B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, storage medium and electronic device for recycling electronic vouchers, which relates to the field of fintech or other related fields. The method includes: obtaining the number of vouchers of invalid vouchers, and calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset bottom value and the number of vouchers; determining, according to the mapping relationship between the first power exponent value and the keywords in the hash table, the keywords corresponding to each first power exponent value in the hash table, and obtaining the free storage units in the linked list corresponding to the keywords, so as to obtain at least one free storage unit; storing the invalid vouchers into at least one free storage unit, and clearing the storage information in the invalid vouchers. Through the present application, the problems in the related art that the efficiency of recycling invalid vouchers is low and the invalid vouchers cannot be used again are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fintech, and in particular, to a method, device, storage medium, and electronic device for recycling electronic vouchers. Background Art

[0002] In the era of the rapid development of Internet finance, with the high-speed development of Internet electronic payment, the use of electronic vouchers has become more and more popular. As the scenarios of using electronic vouchers gradually increase, the growth rate of the demand for electronic vouchers is also getting faster and faster. At the same time, at the end of the transaction using the electronic voucher, due to the large number of issued electronic vouchers, a large number of expired electronic vouchers are generated, resulting in a waste of system resources.

[0003] The current method for recycling expired electronic vouchers is to sort them according to the end date of the electronic vouchers, and the electronic vouchers that expire first are destroyed first, so as to clean up the expired electronic vouchers. When a new transaction is carried out, a new batch of electronic vouchers is recreated to avoid the expired electronic vouchers occupying storage resources. However, due to the large base number of electronic vouchers, the process of cleaning up expired electronic vouchers and creating new electronic vouchers is complex and inefficient, and at the same time, resources are wasted many times in the destruction and creation processes, so that the system resources are not reasonably utilized.

[0004] In view of the problem that the efficiency of recycling invalid vouchers in the related art is low and the invalid vouchers cannot be used again, no effective solution has been proposed yet. Summary of the Invention

[0005] The present application provides a method, device, storage medium, and electronic device for recycling electronic vouchers to solve the problem that the efficiency of recycling invalid vouchers in the related art is low and the invalid vouchers cannot be used again.

[0006] According to one aspect of the present application, a method for recycling electronic vouchers is provided. The method includes: obtaining the number of vouchers of invalid vouchers, and calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers; determining, according to the mapping relationship between the first power exponent value and the keywords in the hash table, the keywords corresponding to each first power exponent value in the hash table, and obtaining the free storage units in the linked list corresponding to the keywords, so as to obtain at least one free storage unit, wherein each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data; storing the invalid vouchers into at least one free storage unit, and clearing the storage information in the invalid vouchers, wherein the invalid vouchers include storage information and attribute information.

[0007] Optionally, calculating at least one first power exponent value corresponding to invalid vouchers according to a preset base value and the number of vouchers includes: randomly setting at least one initial power exponent value; determining a first initial power corresponding to each initial power exponent value according to the base value, obtaining at least one first initial power, and adding at least one first initial power to obtain a first initial result; determining whether the first initial result is equal to the number of invalid vouchers; in the case where the first initial result is not equal to the number of invalid vouchers, resetting the initial power exponent value and re-executing the steps of determining a first initial power corresponding to each initial power exponent value according to the base value, obtaining at least one first initial power, and adding at least one first initial power to obtain a first initial result until the first initial result is equal to the number of invalid vouchers; in the case where the first initial result is equal to the number of invalid vouchers, determining the initial power exponent value as the first power exponent value to obtain at least one first power exponent value.

[0008] Optionally, storing the invalid vouchers into at least one idle storage unit includes: respectively determining a first target power according to each first power exponent value and the base value, obtaining at least one first target power; grouping the invalid vouchers according to the first target power to obtain at least one group of invalid vouchers, where the number of invalid vouchers in each group of invalid vouchers is the same as a first target power; storing each group of invalid vouchers into a target idle storage unit, where the target idle storage unit is the idle storage unit corresponding to the first power exponent value of a group of invalid vouchers.

[0009] Optionally, after storing the invalid vouchers into at least one idle storage unit and clearing the storage information in the invalid vouchers, the method further includes: determining whether there are non-idle storage units in the initial linked list, where the initial linked list is any one of multiple linked lists in the hash table; in the case where there are non-idle storage units, determining whether the number of non-idle storage units is greater than or equal to the base value; in the case where the number of non-idle storage units is greater than or equal to the base value, obtaining a second power exponent value corresponding to the initial linked list; incrementing a preset value on the basis of the second power exponent value to obtain an updated power exponent value, and obtaining a linked list corresponding to the updated power exponent value to obtain a target linked list; obtaining non-idle storage units with the number of the second power exponent value in the initial linked list to obtain a plurality of target storage units, and storing the invalid vouchers in the plurality of target storage units into the idle storage units in the target linked list.

[0010] Optionally, after storing the invalid vouchers in at least one free storage unit and clearing the storage information in the invalid vouchers, the method further includes: determining whether there is an incompletely stored storage unit in the initial linked list, where the incompletely stored storage unit is a storage unit whose storage space is not fully occupied, and the initial linked list is any one of the multiple linked lists in the hash table; when there is an incompletely stored storage unit in the initial linked list, determining the number of invalid vouchers in the incompletely stored storage unit to obtain a target number; randomly setting at least one initial power exponent value; determining a second initial power corresponding to each initial power exponent value according to the base value to obtain at least one second initial power, and adding the at least one second initial power to obtain a second initial result; determining whether the second initial result is equal to the target number; when the second initial result is not equal to the target number, resetting the initial power exponent value and re-executing the step of determining a second initial power corresponding to each initial power exponent value according to the base value to obtain at least one second initial power, and adding the at least one second initial power to obtain a second initial result until the second initial result is equal to the target number; when the second initial result is equal to the number of vouchers, determining the initial power exponent value as the second power exponent value to obtain at least one second power exponent value; determining a free storage unit corresponding to each second power exponent value to obtain at least one free storage unit, and storing the invalid vouchers in the incompletely stored storage unit in the at least one free storage unit.

[0011] Optionally, before obtaining the number of vouchers of the invalid vouchers, the method further includes: obtaining the number of invalid vouchers to be issued, and determining a third power exponent value according to the number of invalid vouchers to be issued and the base value; obtaining the invalid vouchers from the linked list corresponding to the third power exponent value, adding storage information to the invalid vouchers to obtain target vouchers, and issuing the target vouchers according to the target service; obtaining the remaining target vouchers after the target service is completed, and determining the remaining target vouchers as invalid vouchers.

[0012] Optionally, determining a third power exponent value according to the number of invalid vouchers to be issued and the base value includes: randomly setting a fourth power exponent value according to the base value, and determining a second target power according to the fourth power exponent value and the base value; determining whether the second target power is greater than or equal to the number of invalid vouchers to be issued; when the second target power is less than the number of invalid vouchers to be issued, increasing the fourth power exponent value by a preset value to obtain an updated fourth power exponent value, and re-executing the step of determining the second target power according to the fourth power exponent value and the base value until the second target power is greater than or equal to the number of invalid vouchers to be issued; when the second target power is greater than or equal to the number of invalid vouchers to be issued, determining the fourth power exponent value as the third power exponent value.

[0013] According to another aspect of the present application, a recycling device for electronic vouchers is provided. The device includes: a first acquisition unit, configured to acquire the quantity of invalid vouchers, and calculate at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the quantity of vouchers; a second acquisition unit, configured to determine, according to the mapping relationship between the first power exponent value and the keywords in the hash table, the keywords corresponding to each first power exponent value in the hash table, and acquire the free storage units in the linked list corresponding to the keywords, so as to obtain at least one free storage unit, wherein each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data; a first storage unit, configured to store the invalid vouchers into at least one free storage unit, and clear the storage information in the invalid vouchers, wherein the invalid vouchers include storage information and attribute information.

[0014] According to another aspect of the embodiments of the present invention, a computer storage medium is further provided. The computer storage medium is used to store a program, wherein when the program runs, it controls the device where the computer storage medium is located to execute a method for recycling electronic vouchers.

[0015] According to another aspect of the embodiments of the present invention, an electronic device is further provided, which includes one or more processors and a memory; computer-readable instructions are stored in the memory, and the processor is configured to run the computer-readable instructions, wherein when the computer-readable instructions run, they execute a method for recycling electronic vouchers.

[0016] Through the present application, the following steps are adopted: acquiring the quantity of invalid vouchers, and calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the quantity of vouchers; determining, according to the mapping relationship between the first power exponent value and the keywords in the hash table, the keywords corresponding to each first power exponent value in the hash table, and acquiring the free storage units in the linked list corresponding to the keywords, so as to obtain at least one free storage unit, wherein each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data; storing the invalid vouchers into at least one free storage unit, and clearing the storage information in the invalid vouchers, wherein the invalid vouchers include storage information and attribute information. The problem that the efficiency of recycling invalid vouchers is low and the invalid vouchers cannot be used again in the related art is solved. By storing the invalid vouchers in the storage spaces in the linked list in the hash table and clearing the information in the invalid vouchers after storage, blank vouchers can be directly obtained from the hash table during the next transaction, thereby completing the storage and reuse of the invalid vouchers, and further achieving the effects of efficiently processing the invalid vouchers, improving the utilization rate of the invalid vouchers, and efficiently using the storage units. Brief Description of the Drawings

[0017] The drawings forming a part of this application are used to provide a further understanding of this application. The schematic embodiments and descriptions thereof of this application are used to explain this application and do not constitute an improper limitation to this application. In the drawings:

[0018] Figure 1 is a flowchart of a method for recycling electronic vouchers provided according to an embodiment of this application;

[0019] Figure 2 is a schematic diagram of an optional hash table provided according to an embodiment of this application;

[0020] Figure 3 is a schematic diagram of a device for recycling electronic vouchers provided according to an embodiment of this application;

[0021] Figure 4 is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Description of the Embodiments

[0022] It should be noted that, without conflict, the embodiments in this application and the features in the embodiments may be combined with each other. The following will describe this application in detail with reference to the drawings and in combination with the embodiments.

[0023] In order to enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of this application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so as to describe the embodiments of this application here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these process, method, product or device.

[0025] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between this system and relevant users or institutions. Before obtaining relevant information, a request for acquisition needs to be sent to the aforementioned users or institutions through the interface, and after receiving the consent information feedback from the aforementioned users or institutions, the relevant information can be obtained.

[0026] It should be noted that the method, device, storage medium, and electronic device for recycling electronic vouchers determined in this disclosure can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application fields of the method, device, storage medium, and electronic device for recycling electronic vouchers determined in this disclosure are not limited.

[0027] According to an embodiment of the present application, a method for recycling electronic vouchers is provided.

[0028] Figure 1 is a flowchart of the method for recycling electronic vouchers according to an embodiment of the present application. As Figure 1 shown, the method includes the following steps:

[0029] Step S102, obtain the number of vouchers of invalid vouchers, and calculate at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers.

[0030] Specifically, the vouchers can be electronic vouchers used in transactions, and can exist in the form of two-dimensional codes, digital codes, or electronic bills. Before the transaction starts, the vouchers can include information such as voucher styles and voucher numbers. When the vouchers are used in a certain transaction, transaction information can be added to, for example, the two-dimensional code existing in the vouchers. At this time, the vouchers can be used. After the transaction ends, some unused vouchers are invalid vouchers.

[0031] It should be noted that when recycling and storing invalid vouchers in this application, a buddy algorithm is used to establish an idle electronic voucher hash table. That is, the Key value in the hash table is the exponent of the power, and the Value value is the value obtained by performing a power operation on the preset base and the exponent. Figure 2 is a schematic diagram of an optional hash table provided according to an embodiment of the present application. As Figure 2 shown, the base can be 2, Key1 can be 0, then Value1 is 2 0 , that is, each storage space in the storage chain with Key = 1 can store 1 voucher, Key2 is 1, and Value2 is 2 1 , and so on, KeyN can be N, then ValueN is 2 N, that is, each storage space in the storage chain with Key = N can store 2 N vouchers. Through this method, the number of vouchers in each storage space can be accurately determined by the Key value. Since each storage space can only have two storage states: empty or full, the storage capacity of each storage space can be accurately determined, so that the storage space of invalid vouchers can be quickly allocated, recycled, and quickly obtained when reused.

[0032] After obtaining the invalid vouchers, it is necessary to first determine the number of invalid vouchers and determine the power exponent value according to this number and the preset base number. Since the number of invalid vouchers to be recycled is large, it is necessary to reasonably allocate the storage space of the invalid vouchers. Therefore, it is necessary to determine the Key value corresponding to the storage location according to the base number and the number of invalid vouchers in order to accurately store the invalid vouchers. For example, there are 32 invalid vouchers. When the base number is 2, since 2 5 = 32, 32 invalid vouchers can be directly stored in the storage space in the linked list corresponding to Key = 5.

[0033] Since the number of invalid vouchers is random and may be too large, it is necessary to reasonably allocate the storage space corresponding to the invalid vouchers. Optionally, in the method for recycling electronic vouchers provided in the embodiments of the present application, calculating at least one first power exponent value corresponding to the invalid vouchers according to the preset base number value and the number of vouchers includes: randomly setting at least one initial power exponent value; determining the first initial power corresponding to each initial power exponent value according to the base number value to obtain at least one first initial power, and adding at least one first initial power to obtain a first initial result; determining whether the first initial result is equal to the number of invalid vouchers; in the case where the first initial result is not equal to the number of invalid vouchers, resetting the initial power exponent value and re-executing the steps of determining the first initial power corresponding to each initial power exponent value according to the base number value to obtain at least one first initial power, and adding at least one first initial power to obtain a first initial result until the first initial result is equal to the number of invalid vouchers; in the case where the first initial result is equal to the number of invalid vouchers, determining the initial power exponent value as the first power exponent value to obtain at least one first power exponent value.

[0034] Specifically, after determining the base number and the quantity of invalid vouchers, at least one power exponent value can be randomly determined first. Then, according to the power exponent value and the base number, powers corresponding to each power exponent are generated, and the at least one power is summed to obtain a summation result. This result is compared with the quantity of invalid vouchers. If they are equal, the invalid vouchers can be stored according to the Key value corresponding to the power exponent. If they are not equal, at least one power exponent value needs to be re-determined and recalculated until the summation result is equal to the quantity of invalid vouchers. Thus, the storage space for the invalid vouchers to be stored can be reasonably allocated.

[0035] For example, when the base number is 2 and the quantity of invalid vouchers is 111, the power exponent value can be set to 7. Then calculate 2 7 =128, which is greater than 111. The power exponent value needs to be reset. When the power exponent values are 0, 1, 2, 3, 5, 6, 2 6+ 2 5+ 2 3+ 2 2+ 2 1+ 2 0 =111. Therefore, 0, 1, 2, 3, 5, 6 can be determined as the power exponent values corresponding to this batch of invalid vouchers. Further, according to the Key values corresponding to the power exponent values, that is, Key = 0, 1, 2, 3, 5, 6, the storage space in the linked list with Key = 0, 1, 2, 3, 5, 6 can be obtained for storing the invalid vouchers.

[0036] Step S104: According to the mapping relationship between the first power exponent value and the keywords in the hash table, determine the keywords corresponding to each first power exponent value in the hash table, and obtain the free storage units in the linked list corresponding to the keywords, getting at least one free storage unit. Each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units. No data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data.

[0037] Specifically, there can be a mapping relationship between the first power exponent value and the keyword Key in the hash table. For example, the power exponent value = Key value. Through the mapping relationship between the first power exponent value and the keyword Key in the hash table, the storage space for the invalid vouchers can be allocated according to the power exponent value.

[0038] Step S106: Store the invalid vouchers into at least one free storage unit and clear the storage information in the invalid vouchers. The invalid vouchers include storage information and attribute information.

[0039] Specifically, after the space allocation, the invalid vouchers can be stored, and the storage information related to the transaction in the invalid vouchers can be deleted in the storage space, and only the attribute information is retained, so that the vouchers can be used at the boundary when reused next time.

[0040] The method for recycling electronic vouchers provided by the embodiments of the present application calculates at least one first power exponent value corresponding to the invalid vouchers according to the preset base value and the number of vouchers by obtaining the number of vouchers of the invalid vouchers; determines the keyword corresponding to each first power exponent value in the hash table according to the mapping relationship between the first power exponent value and the keyword in the hash table, and obtains the free storage units in the linked list corresponding to the keyword, so as to obtain at least one free storage unit, wherein each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data; stores the invalid vouchers into at least one free storage unit, and clears the storage information in the invalid vouchers, wherein the invalid vouchers include storage information and attribute information. This solves the problems in the related art that the efficiency of recycling invalid vouchers is low and the invalid vouchers cannot be used again. By storing the invalid vouchers in the storage space of the linked list in the hash table and clearing the information in the invalid vouchers after storage, blank vouchers can be directly obtained from the hash table during the next transaction, thus completing the storage and reuse of the invalid vouchers, and further achieving the effects of efficiently processing the invalid vouchers, increasing the utilization rate of the invalid vouchers, and efficiently using the storage units.

[0041] Optionally, in order to accurately store the invalid vouchers, in the method for recycling electronic vouchers provided by the embodiments of the present application, storing the invalid vouchers into at least one free storage unit includes: respectively determining a first target power according to each first power exponent value and the base value to obtain at least one first target power; grouping the invalid vouchers according to the first target power to obtain at least one group of invalid vouchers, wherein the number of invalid vouchers in each group of invalid vouchers is the same as a first target power; storing each group of invalid vouchers into a target free storage unit, where the target free storage unit is the free storage unit corresponding to the first power exponent value of a group of invalid vouchers.

[0042] Specifically, after calculating at least one power exponent value, it is necessary to calculate the power corresponding to each power exponent value according to the base and each power exponent value, group the invalid vouchers according to the size of the power, and store each group of invalid vouchers in the storage space corresponding to the corresponding power exponent value, so as to complete the storage.

[0043] For example, when the base is 2 and the number of invalid vouchers is 111, and when the power exponent values are: 0, 1, 2, 3, 5, 6, 2 6+ 2 5+2 3+ 2 2+ 2 1+ 2 0 = 111, so the power exponent values corresponding to this batch of invalid vouchers can be determined as 0, 1, 2, 3, 5, 6, and the corresponding power calculations are performed, that is: 64, 32, 8, 4, 2, 1. Then, 111 invalid vouchers need to be divided into 6 groups, and the number of vouchers in each group is: 64, 32, 8, 4, 2, 1. And each group of vouchers is stored in the corresponding storage space. For example, 64 invalid vouchers are stored in the free storage space in the linked list corresponding to Key = 6. Since each storage space in the linked list with Key = 6 can only store 64 invalid vouchers, the requirement of complete storage can be met, thus preventing the situation where the storage space is not fully filled. In this embodiment, by determining the storage space corresponding to the invalid vouchers, the effect of reasonably storing the invalid vouchers is achieved.

[0044] Optionally, in the method for recycling electronic vouchers provided in the embodiments of the present application, after storing the invalid vouchers in at least one free storage unit and clearing the storage information in the invalid vouchers, the method further includes: determining whether there are non-free storage units in the initial linked list, where the initial linked list is any one of the multiple linked lists in the hash table; in the case where there are non-free storage units, determining whether the number of non-free storage units is greater than or equal to the base value; in the case where the number of non-free storage units is greater than or equal to the base value, obtaining the second power exponent value corresponding to the initial linked list; incrementing a preset value based on the second power exponent value to obtain an updated power exponent value, and obtaining the linked list corresponding to the updated power exponent value to obtain the target linked list; obtaining non-free storage units with the number of the second power exponent value in the initial linked list to obtain multiple target storage units, and storing the invalid vouchers in the multiple target storage units in the free storage space in the target linked list.

[0045] Specifically, after the storage is completed, it is necessary to check whether there are multiple non-free storage units in the hash table. In the case where there are multiple non-free storage units in a certain linked list in the hash table, it is necessary to determine the number of non-free storage units, and in the case where the number meets the merging requirement, the vouchers in the multiple non-free storage units are merged and stored. Thereby saving the storage space in each linked list and improving the acquisition efficiency when obtaining vouchers at the same time.

[0046] For example, when the base number is 2, there are non-idle storage units in the linked list with Key = 5. At this time, it is necessary to determine whether the number of non-idle storage units is greater than or equal to the base number, that is, whether it is greater than or equal to 2. If it is greater than or equal to 2, it can be determined that two non-idle storage units can be merged. Thus, the vouchers stored in the storage spaces of the two linked lists with Key = 5 can be stored in the storage space of a linked list with Key = 6, so that the occupation of two storage spaces becomes the occupation of one storage space. And when querying, the vouchers can be directly obtained from the storage space with Key = 6 through the value of 64, avoiding the phenomenon that the vouchers cannot be obtained from the storage space with Key = 6 after determining Key = 6.

[0047] Optionally, in the method for recycling electronic vouchers provided in the embodiments of the present application, after storing the invalid vouchers in at least one idle storage unit and clearing the storage information in the invalid vouchers, the method further includes: determining whether there are incompletely stored storage units in the initial linked list, where the incompletely stored storage unit is a storage unit whose storage space is not completely occupied, and the initial linked list is any one of multiple linked lists in the hash table; when there are incompletely stored storage units in the initial linked list, determining the number of invalid vouchers in the incompletely stored storage units to obtain a target number; randomly setting at least one initial power exponent value; determining the second initial power corresponding to each initial power exponent value according to the base number to obtain at least one second initial power, and adding the at least one second initial power to obtain a second initial result; determining whether the second initial result is equal to the target number; when the second initial result is not equal to the target number, resetting the initial power exponent value and re-executing the steps of determining the second initial power corresponding to each initial power exponent value according to the base number to obtain at least one second initial power and adding the at least one second initial power to obtain a second initial result until the second initial result is equal to the target number; when the second initial result is equal to the number of vouchers, determining the initial power exponent value as the second power exponent value to obtain at least one second power exponent value; determining the idle storage unit corresponding to each second power exponent value to obtain at least one idle storage unit, and storing the invalid vouchers in the incompletely stored storage units in the at least one idle storage unit.

[0048] Specifically, after the storage is completed, it is necessary to check whether there are incompletely stored storage units in the hash table. When there are partially stored storage units in a certain linked list in the hash table, the partially stored storage units need to be split, and the split vouchers are stored in the corresponding storage units, so that each storage unit in the hash table is in a completely stored state, and thus the storage amount in each storage unit can be accurately determined.

[0049] For example, in the linked list with Key = 8, there is a storage unit that stores only 145 vouchers. At this time, the 145 vouchers need to be split according to the base number to determine the power exponent value corresponding to the 145 vouchers. When the base number is 2, it can be determined that 2 7+ 2 4+ 2 0 = 145. Therefore, the power exponent values corresponding to the 145 vouchers are 0, 4, and 7. Then, 145 needs to be divided into three parts: 1, 16, and 128, and the three parts of vouchers are synchronously stored in the free storage spaces of the three linked lists with Key = 0, Key = 4, and Key = 7, so that each storage space is in a fully stored state.

[0050] Not only can invalid vouchers be recycled, but vouchers can also be obtained from the hash table for reuse. Optionally, in the method for recycling electronic vouchers provided in the embodiments of the present application, before obtaining the number of invalid vouchers, the method further includes: obtaining the number of invalid vouchers to be issued, and determining a third power exponent value according to the number of invalid vouchers to be issued and the base value; obtaining invalid vouchers from the linked list corresponding to the third power exponent value, adding storage information to the invalid vouchers to obtain target vouchers, and issuing the target vouchers according to the target service; obtaining the remaining target vouchers after the target service is completed, and determining the remaining target vouchers as invalid vouchers.

[0051] Specifically, when obtaining vouchers, they can be obtained from the corresponding storage space according to the voucher requirements. For example, if the number of vouchers to be obtained is 64, they can be obtained from the storage space in the linked list with Key = 6. After obtaining the vouchers, it is also necessary to add the content corresponding to the transaction as storage information to the vouchers according to the transaction requirements, so as to obtain vouchers that can be used for the transaction. After the transaction ends, the remaining vouchers are the invalid vouchers to be recycled.

[0052] Optionally, in the method for recycling electronic vouchers provided in the embodiments of the present application, determining the third power exponent value according to the number of invalid vouchers to be issued and the base value includes: randomly setting a fourth power exponent value according to the base value, and determining a second target power according to the fourth power exponent value and the base value; determining whether the second target power is greater than or equal to the number of invalid vouchers to be issued; in the case where the second target power is less than the number of invalid vouchers to be issued, increasing the fourth power exponent value by a preset value to obtain an updated fourth power exponent value, and re-executing the step of determining the second target power according to the fourth power exponent value and the base value until the second target power is greater than or equal to the number of invalid vouchers to be issued; in the case where the second target power is greater than or equal to the number of invalid vouchers to be issued, determining the fourth power exponent value as the third power exponent value.

[0053] Specifically, when obtaining vouchers, it is also necessary to first determine the power exponent value, determine the power according to the power exponent value and the base number, and obtain the vouchers from the corresponding storage unit according to the determined power.

[0054] For example, when the base number is 2 and the voucher to be obtained is 100, it is necessary to first determine the power exponent value, which can be 7, and then calculate 2 7 = 128 which is greater than 100. So, 100 vouchers can be obtained from the storage unit with Key = 7.

[0055] It should be noted that when there is no non-idle storage unit in the linked list with Key = 7, it is necessary to obtain from a storage unit with a larger storage capacity than the storage unit corresponding to Key = 7, that is, the storage unit in the linked list with Key = 8. After obtaining 100 vouchers from the storage unit in the linked list with Key = 8, the remaining vouchers also need to be allocated to the corresponding storage units, so that each storage unit is either idle or in a fully stored state. In this embodiment, by determining the position of the storage unit larger than the number of vouchers to be obtained and obtaining the vouchers from this storage unit, the effect of efficiently obtaining vouchers is achieved.

[0056] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0057] The embodiment of the present application also provides a recycling device for electronic vouchers. It should be noted that the recycling device for electronic vouchers in the embodiment of the present application can be used to execute the recycling method for electronic vouchers provided by the embodiment of the present application. The following introduces the recycling device for electronic vouchers provided by the embodiment of the present application.

[0058] Figure 3 is a schematic diagram of the recycling device for electronic vouchers provided by the embodiment of the present application. As Figure 3 shown, the device includes: a first acquisition unit 31, a second acquisition unit 32, and a first storage unit 33.

[0059] The first acquisition unit 31 is used to acquire the number of invalid vouchers and calculate at least one first power exponent value corresponding to the invalid vouchers according to the preset base value and the number of vouchers.

[0060] A second obtaining unit 32, configured to determine, according to a mapping relationship between a first power exponent value and a keyword in a hash table, a keyword corresponding to each first power exponent value in the hash table, and obtain free storage units in a linked list corresponding to the keyword, so as to obtain at least one free storage unit, where each keyword in the hash table corresponds to a linked list, storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data.

[0061] A first storage unit 33, configured to store an invalid voucher into at least one free storage unit, and clear storage information in the invalid voucher, where the invalid voucher includes storage information and attribute information.

[0062] The electronic voucher recycling device provided by the embodiments of the present application obtains the number of invalid vouchers through a first obtaining unit 31, and calculates at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers. A second obtaining unit 32 determines, according to a mapping relationship between a first power exponent value and a keyword in a hash table, a keyword corresponding to each first power exponent value in the hash table, and obtains free storage units in a linked list corresponding to the keyword, so as to obtain at least one free storage unit, where each keyword in the hash table corresponds to a linked list, storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data. A first storage unit 33 stores an invalid voucher into at least one free storage unit, and clears storage information in the invalid voucher, where the invalid voucher includes storage information and attribute information. The problem that the efficiency of recycling invalid vouchers is low and the invalid vouchers cannot be used again in the related art is solved. By storing the invalid vouchers in the storage spaces in the linked list in the hash table and clearing the information in the invalid vouchers after storage, blank vouchers can be directly obtained from the hash table during the next transaction, so as to complete the storage and reuse of the invalid vouchers, and further achieve the effects of efficiently processing the invalid vouchers, improving the utilization rate of the invalid vouchers, and efficiently using the storage units.

[0063] Optionally, in the electronic voucher recycling device provided in the embodiments of the present application, the first acquisition unit 31 includes: a first setting module, configured to randomly set at least one initial power exponent value; a first determination module, configured to determine a first initial power corresponding to each initial power exponent value according to the base value, obtain at least one first initial power, and add the at least one first initial power to obtain a first initial result; a first judgment module, configured to judge whether the first initial result is equal to the number of invalid vouchers; a second setting module, configured to, when the first initial result is not equal to the number of invalid vouchers, reset the initial power exponent value, and re-execute the steps of determining a first initial power corresponding to each initial power exponent value according to the base value, obtaining at least one first initial power, and adding the at least one first initial power to obtain a first initial result, until the first initial result is equal to the number of invalid vouchers; a second determination module, configured to, when the first initial result is equal to the number of invalid vouchers, determine the initial power exponent value as the first power exponent value, and obtain at least one first power exponent value.

[0064] Optionally, in the electronic voucher recycling device provided in the embodiments of the present application, the first storage unit 33 includes: a third determination module, configured to determine a first target power according to each first power exponent value and the base value respectively, and obtain at least one first target power; a grouping module, configured to group the invalid vouchers according to the first target power, and obtain at least one group of invalid vouchers, where the number of invalid vouchers in each group of invalid vouchers is the same as a first target power; a storage module, configured to store each group of invalid vouchers into a target free storage unit, where the target free storage unit is the free storage unit corresponding to the first power exponent value of a group of invalid vouchers.

[0065] Optionally, in the electronic voucher recycling device provided in the embodiments of the present application, the device further includes: a first determination unit, configured to determine whether there is a non-free storage unit in the initial linked list, where the initial linked list is any one of multiple linked lists in the hash table; a first judgment unit, configured to, when there is a non-free storage unit, judge whether the number of non-free storage units is greater than or equal to the base value; a third acquisition unit, configured to, when the number of non-free storage units is greater than or equal to the base value, acquire a second power exponent value corresponding to the initial linked list; a fourth acquisition unit, configured to increment a preset value on the basis of the second power exponent value to obtain an updated power exponent value, and acquire the linked list corresponding to the updated power exponent value to obtain a target linked list; a second storage unit, configured to acquire non-free storage units with the number of the second power exponent value in the initial linked list to obtain a plurality of target storage units, and store the invalid vouchers in the plurality of target storage units into the free storage units in the target linked list.

[0066] Optionally, in the electronic voucher recycling device provided in the embodiments of the present application, the device further includes: a second determination unit, configured to determine whether there is an incompletely stored storage unit in the initial linked list, where the incompletely stored storage unit is a storage unit whose storage space is not fully occupied, and the initial linked list is any one of multiple linked lists in the hash table; a third determination unit, configured to determine the number of invalid vouchers in the incompletely stored storage unit to obtain a target number when there is an incompletely stored storage unit in the initial linked list; a first setting unit, configured to randomly set at least one initial power exponent value; a fourth determination unit, configured to determine a second initial power corresponding to each initial power exponent value according to the base value to obtain at least one second initial power, and add at least one second initial power to obtain a second initial result; a second judgment unit, configured to judge whether the second initial result is equal to the target number; a second setting unit, configured to reset the initial power exponent value and re-execute the steps of determining a second initial power corresponding to each initial power exponent value according to the base value to obtain at least one second initial power, and adding at least one second initial power to obtain a second initial result until the second initial result is equal to the target number; a fifth determination unit, configured to determine the initial power exponent value as the second power exponent value to obtain at least one second power exponent value when the second initial result is equal to the voucher number; a sixth determination unit, configured to determine free storage units corresponding to each second power exponent value to obtain at least one free storage unit, and store the invalid vouchers in the incompletely stored storage unit into at least one free storage unit.

[0067] Optionally, in the electronic voucher recycling device provided in the embodiments of the present application, the device further includes: a fourth acquisition unit, configured to acquire the number of invalid vouchers to be issued, and determine a third power exponent value according to the number of invalid vouchers to be issued and the base value; a fifth acquisition unit, configured to acquire invalid vouchers from the linked list corresponding to the third power exponent value, add storage information to the invalid vouchers to obtain target vouchers, and issue the target vouchers according to the target service; a sixth acquisition unit, configured to acquire the remaining target vouchers after the target service is completed, and determine the remaining target vouchers as invalid vouchers.

[0068] Optionally, in the electronic voucher recycling device provided in the embodiments of the present application, the fourth acquisition unit includes: a third setting module, configured to randomly set a fourth power exponent value according to a base value, and determine a second target power according to the fourth power exponent value and the base value; a second judgment module, configured to judge whether the second target power is greater than or equal to the number of invalid vouchers to be issued; an execution module, configured to, when the second target power is less than the number of invalid vouchers to be issued, increase the fourth power exponent value by a preset value to obtain an updated fourth power exponent value, and determine the second target power according to the updated fourth power exponent value and the base value by re - executing the steps until the second target power is greater than or equal to the number of invalid vouchers to be issued; a fourth determination module, configured to, when the second target power is greater than or equal to the number of invalid vouchers to be issued, determine the fourth power exponent value as the third power exponent value.

[0069] The above - mentioned electronic voucher recycling device includes a processor and a memory. The above - mentioned first acquisition unit 31, second acquisition unit 32, first storage unit 33, etc. are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the above - mentioned program units stored in the memory.

[0070] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and by adjusting the kernel parameters, the problems of low efficiency in recycling invalid vouchers and the inability to reuse invalid vouchers in the related art can be solved.

[0071] The memory may include non - permanent memory in a computer - readable medium, random access memory (RAM) and / or non - volatile memory in the form of, for example, read - only memory (ROM) or flash memory (flash RAM). The memory includes at least one storage chip.

[0072] The embodiments of the present invention provide a computer - readable storage medium, on which a program is stored, and when the program is executed by a processor, the electronic voucher recycling method is realized.

[0073] The embodiments of the present invention provide a processor, and the processor is used to run a program, wherein when the program runs, the electronic voucher recycling method is executed.

[0074] As Figure 4As shown in the figure, an embodiment of the present invention provides an electronic device. The electronic device 40 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: obtaining the number of vouchers of invalid vouchers, and calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers; determining, according to the mapping relationship between the first power exponent value and the keywords in the hash table, the keywords corresponding to each first power exponent value in the hash table, and obtaining the free storage units in the linked list corresponding to the keywords, so as to obtain at least one free storage unit, wherein each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data; storing the invalid vouchers into at least one free storage unit, and clearing the storage information in the invalid vouchers, wherein the invalid vouchers include storage information and attribute information. The device herein may be a server, a PC, a PAD, a mobile phone, etc.

[0075] The present application also provides a computer program product which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: obtaining the number of vouchers of invalid vouchers, and calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers; determining, according to the mapping relationship between the first power exponent value and the keywords in the hash table, the keywords corresponding to each first power exponent value in the hash table, and obtaining the free storage units in the linked list corresponding to the keywords, so as to obtain at least one free storage unit, wherein each keyword in the hash table corresponds to a linked list, and the storage units in the linked list include free storage units and non-free storage units, no data is stored in the free storage units, and all storage spaces in the non-free storage units are stored with data; storing the invalid vouchers into at least one free storage unit, and clearing the storage information in the invalid vouchers, wherein the invalid vouchers include storage information and attribute information.

[0076] Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to produce a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0078] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0080] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0081] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0082] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0083] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0084] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for recycling electronic vouchers, characterized in that, Including: Obtaining the number of vouchers for the invalid vouchers, and calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers; According to the mapping relationship between the first power exponent value and the keywords in the hash table, determining the keywords corresponding to each of the first power exponent values in the hash table, and obtaining the free storage units in the linked list corresponding to the keywords, to obtain at least one of the free storage units, wherein each keyword in the hash table corresponds to a linked list, the storage units in the linked list include free storage units and non-free storage units, the free storage units do not store data, and all storage spaces in the non-free storage units store data; Storing the invalid vouchers into at least one of the free storage units, and clearing the storage information in the invalid vouchers, wherein the invalid vouchers include the storage information and attribute information; Calculating at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the number of vouchers includes: randomly setting at least one initial power exponent value; determining a first initial power corresponding to each of the initial power exponent values according to the base value, to obtain at least one of the first initial powers, and adding at least one of the first initial powers to obtain a first initial result; determining whether the first initial result is equal to the number of the invalid vouchers; in the case where the first initial result is not equal to the number of the invalid vouchers, resetting the initial power exponent value, and re-executing the steps of determining a first initial power corresponding to each of the initial power exponent values according to the base value, to obtain at least one of the first initial powers, and adding at least one of the first initial powers to obtain a first initial result, until the first initial result is equal to the number of the invalid vouchers; in the case where the first initial result is equal to the number of the invalid vouchers, determining the initial power exponent value as the first power exponent value, to obtain at least one of the first power exponent values.

2. The method according to claim 1, wherein Storing the invalid vouchers into at least one of the free storage units includes: Respectively determining a first target power according to each of the first power exponent values and the base value, to obtain at least one of the first target powers; Grouping the invalid vouchers according to the first target power, to obtain at least one group of the invalid vouchers, wherein the number of the invalid vouchers in each group of the invalid vouchers is the same as one of the first target powers; Storing each group of the invalid vouchers into a target free storage unit, wherein the target free storage unit is the free storage unit corresponding to the first power exponent value of a group of the invalid vouchers.

3. The method according to claim 1, characterized in that, After storing the invalid vouchers into at least one of the free storage units and clearing the storage information in the invalid vouchers, the method further includes: Determining whether there is a non-free storage unit in the initial linked list, wherein the initial linked list is any one of the multiple linked lists in the hash table; In the case where there is a non-free storage unit, determining whether the number of the non-free storage units is greater than or equal to the base value; When the number of the non-idle storage units is greater than or equal to the base value, obtain a second power exponent value corresponding to the initial linked list; Increment a preset value based on the second power exponent value to obtain an updated power exponent value, and obtain a linked list corresponding to the updated power exponent value to obtain a target linked list; Obtain the non-idle storage units with the number being the second power exponent value in the initial linked list to obtain a plurality of target storage units, and store the invalid vouchers in the plurality of target storage units into the idle storage units in the target linked list.

4. The method according to claim 1, wherein After storing the invalid vouchers into at least one of the idle storage units and clearing the storage information in the invalid vouchers, the method further includes: Determine whether there are storage units that are not fully stored in the initial linked list, where the storage units that are not fully stored are the storage units whose storage spaces are not fully occupied, and the initial linked list is any one of the plurality of linked lists in the hash table; When there are storage units that are not fully stored in the initial linked list, determine the number of invalid vouchers in the storage units that are not fully stored to obtain a target number; Randomly set at least one initial power exponent value; Determine a second initial power corresponding to each initial power exponent value according to the base value to obtain at least one second initial power, and add at least one second initial power to obtain a second initial result; Judge whether the second initial result is equal to the target number; When the second initial result is not equal to the target number, reset the initial power exponent value, and re-execute the step of determining a second initial power corresponding to each initial power exponent value according to the base value to obtain at least one second initial power, and adding at least one second initial power to obtain a second initial result until the second initial result is equal to the target number; When the second initial result is equal to the number of vouchers, determine the initial power exponent value as the second power exponent value to obtain at least one second power exponent value; Determine the idle storage units corresponding to each second power exponent value to obtain at least one idle storage unit, and store the invalid vouchers in the storage units that are not fully stored into at least one idle storage unit.

5. The method according to claim 1, characterized in that, Before obtaining the number of vouchers of the invalid vouchers, the method further includes: Obtain the number of the invalid vouchers to be issued, and determine a third power exponent value according to the number of the invalid vouchers to be issued and the base value; Obtain the invalid vouchers from the linked list corresponding to the third power exponent value, add the storage information to the invalid vouchers to obtain a target voucher, and issue the target voucher according to the target service; Obtain the remaining target vouchers after the target service is completed, and determine the remaining target vouchers as the invalid vouchers.

6. The method according to claim 5, characterized in that Determining a third power exponent value according to the number of the invalid vouchers to be issued and the base value includes: Randomly set a fourth power exponent value according to the base value, and determine a second target power according to the fourth power exponent value and the base value; Determine whether the second target power is greater than or equal to the quantity of the invalid vouchers to be issued; In the case where the second target power is less than the quantity of the invalid vouchers to be issued, increase the fourth power exponent value by a preset value to obtain an updated fourth power exponent value, and re-execute the step of determining the second target power according to the fourth power exponent value and the base value until the second target power is greater than or equal to the quantity of the invalid vouchers to be issued; In the case where the second target power is greater than or equal to the quantity of the invalid vouchers to be issued, determine the fourth power exponent value as the third power exponent value.

7. A recycling device for electronic vouchers, characterized in that, Comprising: A first obtaining unit, configured to obtain the quantity of vouchers of invalid vouchers, and calculate at least one first power exponent value corresponding to the invalid vouchers according to a preset base value and the quantity of vouchers; A second obtaining unit, configured to determine, according to a mapping relationship between the first power exponent value and a keyword in a hash table, a keyword corresponding to each of the first power exponent values in the hash table, and obtain an idle storage unit in a linked list corresponding to the keyword, to obtain at least one of the idle storage units, where each keyword in the hash table corresponds to a linked list, and storage units in the linked list include idle storage units and non-idle storage units, no data is stored in the idle storage units, and all storage spaces in the non-idle storage units are stored with data; A first storage unit, configured to store the invalid vouchers into at least one of the idle storage units, and clear storage information in the invalid vouchers, where the invalid vouchers include the storage information and attribute information; The first obtaining unit includes: a first setting module, configured to randomly set at least one initial power exponent value; a first determining module, configured to determine a first initial power corresponding to each of the initial power exponent values according to the base value, to obtain at least one of the first initial powers, and add at least one of the first initial powers to obtain a first initial result; a first judging module, configured to judge whether the first initial result is equal to the quantity of the invalid vouchers; a second setting module, configured to, in the case where the first initial result is not equal to the quantity of the invalid vouchers, re-set the initial power exponent value, and re-execute the step of determining a first initial power corresponding to each of the initial power exponent values according to the base value, to obtain at least one of the first initial powers, and add at least one of the first initial powers to obtain a first initial result, until the first initial result is equal to the quantity of the invalid vouchers; a second determining module, configured to, in the case where the first initial result is equal to the quantity of the invalid vouchers, determine the initial power exponent value as the first power exponent value, to obtain at least one of the first power exponent values.

8. A computer storage medium, characterized in that, The computer storage medium is used for storing a program, where the program, when running, controls a device where the computer storage medium is located to execute the method for recycling electronic vouchers according to any one of claims 1 to 6.

9. An electronic device, characterized in that, Comprising one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for recycling electronic vouchers according to any one of claims 1 to 6.

10. A computer program product, characterized in that, When executed on a data processing device, is adapted to execute a program initialized with the steps of the method for recycling electronic vouchers according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Electronic voucher processing method, system, e-commerce system, and storage medium

    CN109214865A

  • Cache data processing method, electronic device and readable storage medium

    CN111400308A