CN105653654B - Lottery qualification indexing system and method - Google Patents
Lottery qualification indexing system and method Download PDFInfo
- Publication number
- CN105653654B CN105653654B CN201511004815.8A CN201511004815A CN105653654B CN 105653654 B CN105653654 B CN 105653654B CN 201511004815 A CN201511004815 A CN 201511004815A CN 105653654 B CN105653654 B CN 105653654B
- Authority
- CN
- China
- Prior art keywords
- qualification
- information
- lottery
- unit
- index
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012797 qualification Methods 0.000 title claims abstract description 450
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000004140 cleaning Methods 0.000 claims description 5
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a lottery qualification indexing system and a method, belonging to the technical field of database indexing; the system comprises: the device comprises a first storage unit, a first index unit, a second index unit and a first query unit; the method comprises the following steps: step S1, obtaining the corresponding qualification weight information included in the second index unit according to the user information query; step S2, obtaining the qualification identification information according to the qualification weight information index; and step S3, finally indexing the lottery qualification information according to the qualification identification information and outputting the lottery qualification information. The beneficial effects of the above technical scheme are: the method can improve the query efficiency of repeated lottery qualification query and can keep the uniformity of the lottery qualification state in the whole lottery system.
Description
Technical Field
The invention relates to the technical field of database indexing, in particular to a lottery qualification indexing system and a lottery qualification indexing method.
Background
The conventional lottery system is usually a conventional database, wherein a user lottery qualification table is established in the database, each time a lottery qualification is queried, a query statement needs to be executed in the database, and if the user repeatedly queries the lottery qualification, the number of times of repeated execution of the query statement is very large, thereby slowing down the whole query speed. If there are a large number of concurrent repeat query operations, the quality of service of the database may be degraded or even the service may not be provided normally.
Disclosure of Invention
According to the above problems in the prior art, a technical solution of a lottery qualification indexing system and method is provided, which aims to improve the query efficiency of repeated lottery qualification queries and maintain the uniformity of the lottery qualification status in the whole lottery system.
The technical scheme specifically comprises the following steps:
a lottery eligibility indexing system, comprising:
a first storage unit for storing lottery qualification information associated with different users;
the first indexing unit is connected with the first storage unit and used for setting qualification identification information for indexing aiming at each piece of lottery qualification information, and each qualification identification information corresponds to one piece of user information;
a second indexing unit connected to the first indexing unit for setting qualification weight information for indexing according to each qualification identification information, wherein the qualification weight information comprises the user information and qualification expiration time associated with the qualification identification information;
and the first query unit is connected with the second index unit and used for obtaining the corresponding qualification weight information included in the second index unit according to the user information query, thereby obtaining the qualification identification information according to the qualification weight information index, and finally obtaining and outputting the lottery qualification information according to the qualification identification information index.
Preferably, the lottery qualification indexing system, wherein the qualification expiration time is from a preset start operation time for the lottery qualification information to a preset end operation time for the lottery qualification information;
the first inquiring unit takes the current inquiring time as the termination operation time, finds whether the operation time of the matched user information is within the qualification expiration time, obtains the qualification identification information according to the user information found, and obtains and outputs the lottery qualification information according to the qualification identification information index.
Preferably, the lottery qualification indexing system, wherein the first querying unit queries at least one qualification weight information according to the user information;
the lottery qualification indexing system further comprises:
and the display unit is connected with the first query unit and is used for displaying the number of the qualification weight information obtained by the query of the first query unit to a user for viewing.
Preferably, the lottery qualification indexing system is suitable for a redis storage system;
the first index unit forms index information including the qualification identification information by adopting an index establishing mode of a key value pair form, forms key value information by adopting the qualification identification information, and forms form information by adopting the lottery qualification information after serialization.
Preferably, the lottery qualification indexing system further comprises:
the newly added unit is respectively connected with the first index unit and the second index unit and is used for respectively forming the qualification identification information and the qualification weight information for indexing according to the newly added lottery qualification information;
the second storage unit is respectively connected with the newly added unit and the first index unit, the newly added lottery qualification information is simultaneously stored in the second storage unit, and the first index unit generates corresponding qualification identification information for indexing according to the lottery qualification information stored in the second storage unit;
a marking unit, connected to the second storage unit, for marking the lottery qualification information whose storage time in the second storage unit exceeds a preset expiration time as expired;
the second query unit is connected with the second indexing unit, and is used for searching and obtaining the lottery qualification information marked as overdue and stored in the second storage unit until the current time according to a preset first time interval, and outputting the lottery qualification information included in a list to be cleaned;
and the cleaning unit is respectively connected with the second query unit, the first index unit, the second index unit and the second storage unit and is used for deleting the corresponding lottery qualification information according to the list to be cleaned.
Preferably, the lottery qualification indexing system further comprises:
and the state changing unit is connected with the second index unit and used for updating the operation time in the second index unit corresponding to the lottery qualification information to a preset value which is larger than the ending operation time after the lottery qualification associated with the lottery qualification information is used.
Preferably, the lottery qualification indexing system further comprises:
the operation recording unit is connected with the adding unit and is used for recording an adding record of the lottery qualification information and a use record of the lottery qualification related to the lottery qualification information;
a synchronization unit, respectively connected to the operation recording unit and the first storage unit, configured to, according to the newly added record and/or the usage record in the operation recording unit:
adding the lottery qualification information to the first storage unit; and/or
Changing the use state of the lottery qualification information stored in the first storage unit.
Preferably, in the lottery qualification indexing system, when only the new record exists for the same lottery qualification information in the operation recording unit, the synchronizing unit adds the lottery qualification information to the first storage unit; or
When only the use record exists for the same lottery qualification information in the operation recording unit, the synchronization unit changes the use state of the corresponding lottery qualification information stored in the first storage unit into used state; or
When the new addition record and the use record exist in the operation recording unit for the same lottery qualification information at the same time, the synchronization unit adds the lottery qualification information to the first storage unit, and changes the use state of the added lottery qualification information to be used.
Preferably, the lottery qualification indexing system further comprises:
the operation clearing unit is respectively connected with the operation recording unit and the synchronization unit;
the operation clearing unit is used for:
after the synchronization unit performs an operation of adding the lottery qualification information to the first storage unit once or an operation of changing the use state of the lottery qualification information once, all the new addition records and the use records stored in the operation recording unit and associated with the corresponding lottery qualification information are cleared.
A lottery qualification indexing method, wherein:
storing lottery qualification information related to different users in a first storage unit;
setting qualification identification information for indexing aiming at each lottery qualification information, wherein each qualification identification information corresponds to user information;
setting qualification weighting information for indexing according to each qualification identification information, wherein the qualification weighting information comprises the user information and qualification expiration time associated with the qualification identification information, and the method further comprises the following steps:
step S1, obtaining the corresponding qualification weight information included in the second index unit according to the user information query;
step S2, obtaining the qualification identification information according to the qualification weight information index;
and step S3, finally indexing the lottery qualification information according to the qualification identification information and outputting the lottery qualification information.
Preferably, the lottery qualification indexing method, wherein the qualification expiration time is from a preset start operation time for the lottery qualification information to a preset end operation time for the lottery qualification information;
the step S3 specifically includes:
step S31, taking the current query time as the operation termination time, and finding whether the operation time of the user information matching with the current query time is within the qualification expiration time:
if the matched user information does not exist, quitting;
step S32, obtaining the qualification identification information according to the user information obtained by searching;
and step S33, obtaining and outputting the lottery qualification information according to the qualification identification information index.
Preferably, in the lottery qualification indexing method, in step S1, at least one piece of qualification weight information is obtained according to the user information query, and the number of the qualification weight information obtained by the first query unit is displayed to the user for viewing through a display screen.
Preferably, the lottery qualification indexing method is suitable for a redis storage system, and forms index information including the qualification identification information by using an index establishing manner in a key value pair form, forms key value information by using the qualification identification information, and forms form information by using the lottery qualification information after serialization.
Preferably, the lottery qualification indexing method, wherein the step of clearing the expired lottery qualification information in the first storage unit comprises:
step A1, respectively forming the qualification identification information and the qualification weight information for indexing according to the newly added lottery qualification information, and storing the newly added lottery qualification information in a second storage unit;
a step a2 of marking the lottery qualification information whose holding time in the second storage unit exceeds a preset expiration time as expired;
step A3, searching and obtaining the lottery qualification information marked as overdue and stored in the second storage unit until the current time according to a preset first time interval, and including the lottery qualification information in a list to be cleaned for output;
step A4, deleting the corresponding lottery qualification information according to the list to be cleaned.
Preferably, the lottery qualification indexing method, wherein after the lottery qualification associated with the lottery qualification information is used, the operation time in the second index unit corresponding to the lottery qualification information is updated to a preset value greater than the termination operation time.
Preferably, the lottery qualification indexing method, wherein a newly added record of the lottery qualification information and a use record of the lottery qualification associated with the lottery qualification information are recorded;
then a synchronization unit is used, according to the newly added record and/or the usage record:
adding the lottery qualification information to the first storage unit; and/or
Changing the use state of the lottery qualification information stored in the first storage unit.
Preferably, the lottery qualification indexing method, wherein the synchronization unit is adapted to:
when only the newly added record exists for the same lottery qualification information in the operation recording unit, adding the lottery qualification information into the first storage unit; or
When only the use record exists for the same lottery qualification information in the operation recording unit, changing the use state of the corresponding lottery qualification information stored in the first storage unit into used state; or
When the new addition record and the use record exist in the operation recording unit for the same lottery qualification information at the same time, adding the lottery qualification information to the first storage unit, and changing the use state of the added lottery qualification information to be used.
Preferably, in the lottery qualification indexing method, after the synchronizing unit performs an operation of adding the lottery qualification information to the first storage unit or an operation of changing the use state of the lottery qualification information, an operation clearing unit is used to clear all the new-added records and the use records stored in the operation recording unit and associated with the corresponding lottery qualification information.
The beneficial effects of the above technical scheme are:
1) a lottery qualification indexing system is provided, which can improve the query efficiency of repeated lottery qualification query and can maintain the uniformity of the lottery qualification state in the whole lottery system.
2) The lottery qualification indexing method can support the normal operation of the lottery qualification indexing system.
Drawings
Fig. 1 is a schematic diagram of the general structure of a lottery qualification indexing system according to a preferred embodiment of the present invention;
fig. 2-4 are schematic diagrams illustrating a lottery qualification indexing method according to a preferred embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
In the prior art, after a user inquires the lottery qualification, the user often uses the lottery qualification for lottery immediately because of unstable network or self reason, and may repeatedly enter a webpage and inquire the lottery qualification, the burden of the repeated operation on the background database may generate a plurality of repeatedly executed inquiry sentences, and when the concurrent repeated operation with a large number occurs, the database may not normally provide services, and even the whole lottery system may be dragged down.
In accordance with the above-mentioned problems of the prior art, there is provided a lottery qualification indexing system, as shown in fig. 1, comprising:
a first storage unit 1 for storing lottery qualification information associated with different users;
the first indexing unit 2 is connected with the first storage unit 1 and used for setting qualification identification information for indexing aiming at each lottery qualification information, and each qualification identification information corresponds to one user information;
a second indexing unit 3, connected to the first indexing unit 2, for setting qualification weight information for indexing according to each qualification identification information, the qualification weight information including user information and qualification expiration time associated with the qualification identification information;
and the first query unit 4 is connected with the second index unit 3 and is used for obtaining the corresponding qualification weight information included in the second index unit 3 according to the query of the user information, thereby obtaining qualification identification information according to the qualification weight information index, and finally obtaining and outputting lottery qualification information according to the qualification identification information index.
In an embodiment, the first storage unit 1 may be a conventional database, such as an SQL (Structured Query Language) database or other similar relational database. Lottery qualification information associated with different users is stored in the first storage unit 1, and each lottery qualification information may include: user information (e.g., user ID) of the user, time information at which lottery qualification information associated with the user is saved in the first storage unit 1, and use state information of the lottery qualification information, and the like. The above information is described in detail below.
In this embodiment, with the above-described first indexing unit 2, one corresponding qualification identification information for indexing is formed for each of the lottery qualification information saved in the first storage unit 1. The qualification identification information may use the user information, such as the user ID, in the lottery qualification information described above.
In this embodiment, with the above-described second index unit 3, one corresponding qualification weight information is formed for each qualification identification information for indexing the lottery qualification information formed by the above-described first index unit 2. The qualification weight information may include the user information (e.g., user ID) and a qualification expiration time. The qualification expiration time may be from a preset start operation time for the lottery qualification information to a preset end operation time for the lottery qualification information. In other words, the qualification time is a predetermined time period, the time period is a fixed time period, the starting time is a predetermined starting operation time, and the ending time is a predetermined ending operation time. A preferred embodiment of the initial value of the above-mentioned qualification weight information may be: 12345678022403, wherein the first 8 bits (12345678) are used for representing user information and the last 6 bits (022403) are used for representing the operation time of the corresponding lottery qualification information, i.e., the corresponding lottery qualification information is newly added to the first storage unit 1 at 2 months, 24 days and 3. The qualification expiration time is a predetermined time period, for example, from 010101(01 month, 01 day, 01) to 123124(12 month, 31 day, 24).
In this embodiment, the user queries the corresponding qualification weight information included in the second indexing unit 3 according to the user information, thereby obtaining qualification identification information by indexing according to the qualification weight information, and finally obtaining and outputting lottery qualification information by indexing according to the qualification identification information.
In a preferred embodiment of the present invention, the first query unit 4 searches whether the operation time of the matched user information is within the qualification expiration time according to the current query time, obtains qualification identification information according to the searched user information, and obtains and outputs lottery qualification information according to the qualification identification information index.
Specifically, in a preferred embodiment of the present invention, the maximum operation time range corresponding to each user information may be unified from the starting operation time (01/01) to the ending operation time (12/31/24), for example, the user information is 12345678, the corresponding operation time range is 010101 to 123124, the maximum available value range (i.e., the qualification expiration time) of the qualification weight information is 12345678010101 to 12345678123124, the first querying unit 4 may use the current operation time (e.g., 122117) associated with the current time as the starting operation time to determine the operation time range of the query, and find whether the corresponding qualification information exists in the determined operation time range, for example, find whether the corresponding qualification exists in the range of 12345678122117 and 12345678124, thereby find the corresponding weight information and further index the qualification identification information, and finally obtains the lottery qualification information stored in the first storage unit 1.
In a preferred embodiment of the present invention, the first query unit 4 queries at least one qualification weight information according to the user information.
As also shown in fig. 1, the lottery qualification indexing system further includes:
and the display unit 5 is connected with the first query unit 4 and is used for displaying the number of the qualification weight information obtained by querying the first query unit 4 to a user for viewing.
Specifically, in a preferred embodiment of the present invention, if a plurality of qualification weight information associated with the user information are obtained by querying according to the operation time range, each qualification weight information is necessarily corresponding to one qualification identification information, and thus corresponds to one lottery qualification information, so that the number of the qualification weight information obtained by querying actually represents the number of lottery qualifications currently available for the user, and thus is displayed to the user for viewing.
In a preferred embodiment of the present invention, the lottery qualification indexing system is applied to a redis storage system. The redis storage system is an open-source database written in ANSIC language, supporting network, and based on memory or persistent log type, Key Value pair (Value).
Therefore, the first indexing unit 2 may form index information including qualification identification information by using a Key-Value index establishing manner, where the qualification identification information is used to form Key information, and the Value information is formed by using the drawing qualification information serialized in json format.
In a preferred embodiment of the present invention, as still shown in fig. 1, the lottery qualification indexing system further includes:
the newly-added unit 6 is respectively connected with the first index unit 2 and the second index unit 3 and is used for respectively forming qualification identification information and qualification weight information for indexing according to newly-added lottery qualification information;
the second storage unit 7 is respectively connected with the newly added unit 1 and the first index unit 2, the newly added lottery qualification information is simultaneously stored in the second storage unit 7, and the first index unit 2 generates corresponding qualification identification information for indexing according to the lottery qualification information stored in the second storage unit 7;
a marking unit 8 connected to the second storage unit 7 for marking the lottery qualification information whose storage time in the second storage unit 7 exceeds a preset expiration time as expired;
the second query unit 9 is connected to the second indexing unit 3, and is configured to search for, according to a preset first time interval, the lottery qualification information marked as expired, which is stored in the second storage unit 7 until the current time, and include the lottery qualification information in a list to be cleaned and output the lottery qualification information;
and the cleaning unit 10 is respectively connected with the second query unit 9, the first index unit 2, the second index unit 3 and the second storage unit 7, and is used for deleting the corresponding lottery qualification information according to the list to be cleaned.
Specifically, in a preferred embodiment of the present invention, the newly adding unit 6 is configured to form corresponding qualification identification information according to the lottery qualification information to be added and put into the first indexing unit 2, and form corresponding qualification weighting information and put into the second indexing unit 3. The complete information of the lottery qualification information is included in the qualification identification information. And the adding unit 6 puts the lottery qualification information to be added into the second storage unit 7.
In a preferred embodiment of the present invention, an expiration time of one lottery qualification information is preset in the lottery qualification indexing system. The lottery qualification information whose holding time in the second storage unit 7 exceeds the preset expiration time is then marked as expired using the marking unit 8 described above. Specifically, the time saved in the second storage unit 7 may be regarded as equivalent to the time saved in the first storage unit 1, and if the saving time exceeds the qualification expiration time, the lottery qualification information is considered to have expired and needs to be cleared, and is thus marked using the marking unit 8.
In a preferred embodiment of the present invention, the second search unit 9 is adopted, and the lottery qualification information marked as expired stored in the second storage unit 7 up to the current time is obtained by periodically (according to a preset time interval) searching through the two-stage index system of the second index unit 3 and the first index unit 2, and is included in a list to be cleaned and output. For example, the operation time information corresponding to the current time is 162115(16 o' clock 21 min 15 sec), the qualification weight information corresponding to the lottery qualification information marked as expired is searched for in the determined operation time range of 000000-.
Subsequently, in a preferred embodiment of the present invention, the cleaning unit 10 is adopted to delete the corresponding lottery qualification information according to the lottery qualification information marked as expired included in the list to be cleaned, thereby completing the expiration cleaning operation of the lottery qualification information.
In a preferred embodiment of the present invention, as still shown in fig. 1, the lottery qualification indexing system further includes:
and a state changing unit 11 connected to the second indexing unit 3 for updating the operation time corresponding to the lottery qualification information in the second indexing unit 3 to a preset value greater than the termination operation time after the lottery qualification associated with the lottery qualification information is used.
Specifically, in the preferred embodiment of the present invention, as described above, the maximum operation time range corresponding to the qualification weight information can be defined as 010101-123124, and accordingly, the maximum termination operation time is 123124. In other words, if the operation time corresponding to a certain entitlement weight message is greater than 123124, the entitlement weight message is expired, and is never queried. Therefore, in a preferred embodiment of the present invention, the state changing unit 11 is adopted to update the operation time in the qualification weight information corresponding to the used lottery qualification information to a preset value greater than the maximum termination operation time, where the preset value may be 171253, or any value greater than the maximum termination operation time.
In a preferred embodiment of the present invention, as still shown in fig. 1, the lottery qualification indexing system further includes:
the operation recording unit 12 is connected with the newly adding unit 6 and is used for recording a newly added record of the lottery qualification information and a use record of the lottery qualification related to the lottery qualification information;
a synchronization unit 13, connected to the operation recording unit 12 and the first storage unit 1, respectively, for, according to the newly added record and/or usage record in the operation recording unit:
adding lottery qualification information to the first storage unit 1; and/or
The use state of the lottery qualification information stored in the first storage unit 1 is changed.
Specifically, in the preferred embodiment of the present invention, when only a new record exists for the same lottery qualification information in the operation recording unit 12, the synchronization unit 13 adds the lottery qualification information to the first storage unit 1; or
When only the use record exists for the same lottery qualification information in the operation recording unit 12, the synchronization unit 13 changes the use state of the corresponding lottery qualification information stored in the first storage unit 1 to be used; or
When there are both a new-added record and a usage record for the same lottery qualification information in the operation recording unit 12, the synchronization unit 13 adds the lottery qualification information to the first storage unit 1, and changes the usage state of the added lottery qualification information to be used.
In other words, within the operating time range defined by the start operating time and the current operating time associated with the current time, the synchronization unit 13 finds an operating record in which certain lottery qualification information exists in the operating recording unit 12:
if only a new record exists, it indicates that the lottery qualification information needs to be added to the first storage unit 1, and the synchronization unit 13 synchronizes the lottery qualification information to the first storage unit 1;
if there is only a usage record, it indicates that the lottery qualification information has already been added to the first storage unit 1 and has already been used, and the synchronization unit 13 synchronizes the usage state to the corresponding lottery qualification information in the above-described first storage unit 1, that is, changes the usage state of the lottery qualification information to used (defaults to unused).
If there is a new record and a usage record simultaneously before the current operation time, it indicates that the lottery qualification information needs to be added to the first storage unit 1 and has been used up, and at this time, the synchronization unit 13 needs to add the lottery qualification information to the first storage unit 1 and change its usage state to used at the same time.
In a preferred embodiment of the present invention, as still shown in fig. 1, the lottery qualification indexing system further includes:
an operation clearing unit 14 connected to the operation recording unit 12 and the synchronization unit 13, respectively;
the operation clearing unit 14 is configured to:
after the synchronization unit 13 performs an operation of adding lottery qualification information to the first storage unit 1 once or an operation of changing the use state of the lottery qualification information once, all the newly added records and use records stored in the operation recording unit 12 in association with the corresponding lottery qualification information are cleared.
In other words, in the preferred embodiment of the present invention, after the synchronization unit 13 periodically performs one synchronization (to add new lottery qualification information or change the usage status of the lottery qualification information), the operation clearing unit 14 is used to clear all the new records and usage records included in the operation recording unit 12, so as to avoid repeated synchronization operations for the same lottery qualification information during the next synchronization.
In summary, in the technical scheme of the present invention, two-level indexes are established through the redis storage system, so that the problems of low service performance and low query efficiency of the conventional database under the condition of large concurrent query quantity are solved, and the resource utilization rate of the whole lottery system is reduced.
In a preferred embodiment of the present invention, based on the lottery qualification indexing system described above, there is provided a lottery qualification indexing method, which specifically includes:
storing lottery qualification information related to different users in a first storage unit;
setting qualification identification information for indexing aiming at each lottery qualification information, wherein each qualification identification information corresponds to one user information;
setting qualification weight information for indexing according to each qualification identification information, the qualification weight information including user information associated with the qualification identification information and operation time information associated with the qualification identification information, the initial operation time information being the time when the lottery qualification information is added to the first storage unit, further comprising the steps as shown in fig. 2:
step S1, obtaining corresponding qualification weight information included in the second index unit according to the user information query;
step S2, obtaining qualification identification information according to the qualification weight information index;
and step S3, finally indexing to obtain and output the lottery qualification information according to the qualification identification information.
In a preferred embodiment of the present invention, the qualification expiration time is from a preset start operation time for the lottery qualification information to a preset end operation time for the lottery qualification information;
the step S3 is specifically shown in fig. 3, and includes:
step S31, taking the current query time as the operation termination time, and finding whether the operation time with the matched user information is within the qualification expiration time:
if the matched user information does not exist, quitting;
step S32, acquiring qualification identification information according to the searched user information;
and step S33, obtaining and outputting the lottery qualification information according to the qualification identification information index.
In a preferred embodiment of the present invention, in the step S1, at least one qualification weight information can be obtained according to the user information query, and the number of the qualification weight information obtained by the first query unit is displayed to the user for viewing through a display screen.
In a preferred embodiment of the present invention, the lottery qualification indexing method is also applicable to a redis storage system, and therefore index information including qualification identification information may be formed in a Key-Value pair type index establishing manner (Key-Value manner), Key information may be formed in the qualification identification information, and Value information may be formed in the serialized lottery qualification information.
In a preferred embodiment of the present invention, the step of clearing the expired lottery qualification information in the first storage unit is specifically shown in fig. 4, and includes:
step A1, respectively forming qualification identification information and qualification weight information for indexing according to the newly added lottery qualification information, and storing the newly added lottery qualification information in a second storage unit;
step A2, marking the lottery qualification information whose storage time in the second storage unit exceeds a preset expiration time as expired;
step A3, finding out the lottery qualification information marked as overdue and stored in the second storage unit until the current time according to the preset first time interval, and outputting the lottery qualification information included in a list to be cleaned;
and step A4, deleting the corresponding lottery qualification information according to the list to be cleaned.
In a preferred embodiment of the present invention, after the lottery qualification associated with the lottery qualification information is used, the operation time information in the corresponding qualification weight information in the second index unit is updated to a preset value greater than the termination operation time.
In the preferred embodiment of the invention, newly added records of lottery qualification information and use records of lottery qualification related to the lottery qualification information are recorded;
a synchronization unit is used, based on the newly added record and/or usage record:
adding the lottery qualification information into the first storage unit; and/or
The use state of the lottery qualification information stored in the first storage unit is changed.
In a preferred embodiment of the present invention, a synchronization unit is employed:
when only new records exist in the operation recording unit for the same lottery qualification information, adding the lottery qualification information into the first storage unit; or
When only the use record exists in the operation recording unit for the same lottery qualification information, the use state of the corresponding lottery qualification information stored in the first storage unit is changed into the used state; or
When a newly added record and a usage record exist simultaneously in the operation recording unit for the same lottery qualification information, the lottery qualification information is added to the first storage unit, and the usage state of the added lottery qualification information is changed to be used.
In a preferred embodiment of the present invention, after the synchronization unit performs an operation of adding the lottery qualification information to the first storage unit once or an operation of changing the use state of the lottery qualification information once, an operation clearing unit is used to clear all the newly added records and use records stored in the operation recording unit in association with the corresponding lottery qualification information.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.
Claims (18)
1. A lottery eligibility indexing system, comprising:
a first storage unit for storing lottery qualification information associated with different users;
the first indexing unit is connected with the first storage unit and used for setting qualification identification information for indexing aiming at each piece of lottery qualification information, and each qualification identification information corresponds to one piece of user information;
a second indexing unit connected to the first indexing unit for setting qualification weight information for indexing according to each qualification identification information, wherein the qualification weight information comprises the user information and qualification expiration time associated with the qualification identification information;
and the first query unit is connected with the second index unit and used for obtaining the corresponding qualification weight information included in the second index unit according to the user information query, thereby obtaining the qualification identification information according to the qualification weight information index, and finally obtaining and outputting the lottery qualification information according to the qualification identification information index.
2. The lottery eligibility index system of claim 1, wherein the eligibility expiration time is from a preset start operation time for the lottery eligibility information to a preset end operation time for the lottery eligibility information;
the first inquiring unit takes the current inquiring time as the termination operation time, finds whether the operation time of the matched user information is within the qualification expiration time, obtains the qualification identification information according to the user information found, and obtains and outputs the lottery qualification information according to the qualification identification information index.
3. The lottery eligibility index system of claim 1, wherein the first search unit obtains at least one of the eligibility weight information based on the user information search;
the lottery qualification indexing system further comprises:
and the display unit is connected with the first query unit and is used for displaying the number of the qualification weight information obtained by the query of the first query unit to a user for viewing.
4. A lottery eligibility index system as in claim 1, adapted for a redis storage system;
the first index unit forms index information including the qualification identification information by adopting an index establishing mode of a key value pair form, forms key value information by adopting the qualification identification information, and forms form information by adopting the lottery qualification information after serialization.
5. The lottery eligibility index system of claim 1, further comprising:
the newly added unit is respectively connected with the first index unit and the second index unit and is used for respectively forming the qualification identification information and the qualification weight information for indexing according to the newly added lottery qualification information;
the second storage unit is respectively connected with the newly added unit and the first index unit, the newly added lottery qualification information is simultaneously stored in the second storage unit, and the first index unit generates corresponding qualification identification information for indexing according to the lottery qualification information stored in the second storage unit;
a marking unit, connected to the second storage unit, for marking the lottery qualification information whose storage time in the second storage unit exceeds a preset expiration time as expired;
the second query unit is connected with the second indexing unit, and is used for searching and obtaining the lottery qualification information marked as overdue and stored in the second storage unit until the current time according to a preset first time interval, and outputting the lottery qualification information included in a list to be cleaned;
and the cleaning unit is respectively connected with the second query unit, the first index unit, the second index unit and the second storage unit and is used for deleting the corresponding lottery qualification information according to the list to be cleaned.
6. The lottery eligibility index system of claim 2, further comprising:
and the state changing unit is connected with the second index unit and used for updating the operation time in the second index unit corresponding to the lottery qualification information to a preset value which is larger than the ending operation time after the lottery qualification associated with the lottery qualification information is used.
7. The lottery eligibility index system of claim 5, further comprising:
the operation recording unit is connected with the adding unit and is used for recording an adding record of the lottery qualification information and a use record of the lottery qualification related to the lottery qualification information;
a synchronization unit, respectively connected to the operation recording unit and the first storage unit, configured to, according to the newly added record and/or the usage record in the operation recording unit:
adding the lottery qualification information to the first storage unit; and/or
Changing the use state of the lottery qualification information stored in the first storage unit.
8. The lottery qualification indexing system of claim 7, wherein the synchronizing unit adds the lottery qualification information to the first storage unit when only the new addition record exists for the same lottery qualification information in the operation recording unit; or
When only the use record exists for the same lottery qualification information in the operation recording unit, the synchronization unit changes the use state of the corresponding lottery qualification information stored in the first storage unit into used state; or
When the new addition record and the use record exist in the operation recording unit for the same lottery qualification information at the same time, the synchronization unit adds the lottery qualification information to the first storage unit, and changes the use state of the added lottery qualification information to be used.
9. The lottery eligibility index system of claim 7, further comprising:
the operation clearing unit is respectively connected with the operation recording unit and the synchronization unit;
the operation clearing unit is used for:
after the synchronization unit performs an operation of adding the lottery qualification information to the first storage unit once or an operation of changing the use state of the lottery qualification information once, all the new addition records and the use records stored in the operation recording unit and associated with the corresponding lottery qualification information are cleared.
10. A lottery qualification indexing method, characterized by:
storing lottery qualification information related to different users in a first storage unit;
setting qualification identification information for indexing aiming at each lottery qualification information, wherein each qualification identification information corresponds to user information;
setting qualification weighting information for indexing according to each qualification identification information, wherein the qualification weighting information comprises the user information and qualification expiration time associated with the qualification identification information, and the method further comprises the following steps:
step S1, obtaining the corresponding qualification weight information included in the second index unit according to the user information query;
step S2, obtaining the qualification identification information according to the qualification weight information index;
and step S3, finally indexing the lottery qualification information according to the qualification identification information and outputting the lottery qualification information.
11. A lottery qualification indexing method as in claim 10, wherein the qualification expiration time is from a preset start operation time for the lottery qualification information to a preset end operation time for the lottery qualification information;
the step S3 specifically includes:
step S31, taking the current query time as the operation termination time, and finding whether the operation time of the user information matching with the current query time is within the qualification expiration time:
if the matched user information does not exist, quitting;
step S32, obtaining the qualification identification information according to the user information obtained by searching;
and step S33, obtaining and outputting the lottery qualification information according to the qualification identification information index.
12. The lottery qualification indexing method of claim 10, wherein in step S1, at least one qualification weight information is obtained according to the user information query, and the number of the qualification weight information obtained by the first query unit is displayed to the user for viewing through a display screen.
13. A lottery qualification indexing method as in claim 10, adapted to a redis storage system, and forming index information including the qualification identification information in an index establishment manner of a key-value pair form, forming key-value information using the qualification identification information, and forming form information using the lottery qualification information after serialization.
14. The lottery qualification indexing method of claim 10, wherein the step of clearing the lottery qualification information expired in the first storage unit comprises:
step A1, respectively forming the qualification identification information and the qualification weight information for indexing according to the newly added lottery qualification information, and storing the newly added lottery qualification information in a second storage unit;
a step a2 of marking the lottery qualification information whose holding time in the second storage unit exceeds a preset expiration time as expired;
step A3, searching and obtaining the lottery qualification information marked as overdue and stored in the second storage unit until the current time according to a preset first time interval, and including the lottery qualification information in a list to be cleaned for output;
step A4, deleting the corresponding lottery qualification information according to the list to be cleaned.
15. The lottery qualification indexing method of claim 11, wherein after the lottery qualification associated with the lottery qualification information is used, the operation time in the second index unit corresponding to the lottery qualification information is updated to a preset value greater than the termination operation time.
16. The lottery eligibility indexing method of claim 14, wherein a newly added record of the lottery eligibility information and a usage record of lottery eligibility associated with the lottery eligibility information are recorded;
then a synchronization unit is used, according to the newly added record and/or the usage record:
adding the lottery qualification information to the first storage unit; and/or
Changing the use state of the lottery qualification information stored in the first storage unit.
17. A lottery eligibility indexing method as in claim 16, wherein, with the synchronizing unit:
when only the newly added record exists for the same lottery qualification information in an operation recording unit, adding the lottery qualification information into the first storage unit; or
When only the use record exists for the same lottery qualification information in an operation recording unit, changing the use state of the corresponding lottery qualification information stored in the first storage unit into used state; or
When the new addition record and the use record exist simultaneously in an operation recording unit for the same lottery qualification information, the lottery qualification information is added to the first storage unit, and the use state of the added lottery qualification information is changed to be used.
18. The lottery qualification indexing method of claim 16, wherein after the synchronizing unit performs an operation of adding the lottery qualification information to the first storage unit once or an operation of changing the use state of the lottery qualification information once, an operation clearing unit clears all the newly added records and the use records stored in an operation recording unit in association with the corresponding lottery qualification information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511004815.8A CN105653654B (en) | 2015-12-28 | 2015-12-28 | Lottery qualification indexing system and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511004815.8A CN105653654B (en) | 2015-12-28 | 2015-12-28 | Lottery qualification indexing system and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105653654A CN105653654A (en) | 2016-06-08 |
CN105653654B true CN105653654B (en) | 2021-11-30 |
Family
ID=56477085
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511004815.8A Active CN105653654B (en) | 2015-12-28 | 2015-12-28 | Lottery qualification indexing system and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105653654B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106028165A (en) * | 2016-06-17 | 2016-10-12 | 武汉斗鱼网络科技有限公司 | Method and system for realizing lucky draw in mobile terminal of live broadcasting website |
CN108399266B (en) * | 2018-03-23 | 2022-01-07 | 阿里巴巴(中国)有限公司 | Data extraction method and device, electronic equipment and computer readable storage medium |
CN111787366A (en) * | 2018-03-28 | 2020-10-16 | 广州华多网络科技有限公司 | Method, device, system, storage medium and computer equipment for distributing resources |
CN109598551B (en) * | 2018-11-30 | 2021-03-02 | 网易(杭州)网络有限公司 | Game lottery method and device with distributed server structure |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1858737A (en) * | 2006-01-25 | 2006-11-08 | 华为技术有限公司 | Method and system for data searching |
CN1894689A (en) * | 2003-08-29 | 2007-01-10 | 伏泰劳普蒂克斯有限公司 | Method, device and software for querying and presenting search results |
CN1975729A (en) * | 2005-12-02 | 2007-06-06 | 国际商业机器公司 | System of effectively searching text for keyword, and method thereof |
CN102193917A (en) * | 2010-03-01 | 2011-09-21 | 中国移动通信集团公司 | Method and device for processing and querying data |
CN103489120A (en) * | 2013-10-12 | 2014-01-01 | 从兴技术有限公司 | Credit sale network lottery drawing system and implementation method thereof |
-
2015
- 2015-12-28 CN CN201511004815.8A patent/CN105653654B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1894689A (en) * | 2003-08-29 | 2007-01-10 | 伏泰劳普蒂克斯有限公司 | Method, device and software for querying and presenting search results |
CN1975729A (en) * | 2005-12-02 | 2007-06-06 | 国际商业机器公司 | System of effectively searching text for keyword, and method thereof |
CN1858737A (en) * | 2006-01-25 | 2006-11-08 | 华为技术有限公司 | Method and system for data searching |
CN102193917A (en) * | 2010-03-01 | 2011-09-21 | 中国移动通信集团公司 | Method and device for processing and querying data |
CN103489120A (en) * | 2013-10-12 | 2014-01-01 | 从兴技术有限公司 | Credit sale network lottery drawing system and implementation method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN105653654A (en) | 2016-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108228817B (en) | Data processing method, device and system | |
CN105653654B (en) | Lottery qualification indexing system and method | |
JP5613951B2 (en) | Method for aggressive information push notification and server therefor | |
WO2020034757A1 (en) | Data processing method and device, storage medium, and electronic device | |
US9128974B2 (en) | Methods for tracking database changes and devices thereof | |
CN109299157B (en) | Data export method and device for distributed big single table | |
US8386423B2 (en) | Scalable policy-based database synchronization of scopes | |
US10769132B1 (en) | Efficient storage and retrieval of time series data | |
CN106933836B (en) | Data storage method and system based on sub-tables | |
CN106407360B (en) | Data processing method and device | |
CN103561133A (en) | IP address ownership information indexing and fast querying method | |
CN106570027B (en) | Transactional task processing method and device | |
CN105989076A (en) | Data statistical method and device | |
CN109308296A (en) | A kind of generation method, device and the computer readable storage medium of business datum table | |
CN105159845A (en) | Memory reading method | |
US10474185B2 (en) | Timestamp alignment across a plurality of computing devices | |
CN111488340B (en) | Data processing method and device and electronic equipment | |
CN111460240B (en) | Cross-region multi-activity micro-service architecture page turning data query method and device | |
CN105246054A (en) | Message push method suitable for android smart phone | |
CN103378978A (en) | Message push method and server | |
CN115033575A (en) | Data query method, device, equipment and storage medium | |
CN110134689A (en) | Target group's screening technique, system and computer equipment based on main object label variations | |
CN109086382A (en) | A kind of method of data synchronization, device, equipment and storage medium | |
CN112328842A (en) | Data processing method and device, electronic equipment and storage medium | |
CN107169003B (en) | Data association method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20231018 Address after: Room A320, 3rd Floor, No. 1359 Zhonghua Road, Huangpu District, Shanghai, 200010 Patentee after: Shanghai Jiaran Information Technology Co.,Ltd. Address before: 200003 Fengsheng Building, No. 763 Mengzi Road, Huangpu District, Shanghai Patentee before: SHANGHAI HANDPAL INFORMATION TECHNOLOGY SERVICE Co.,Ltd. |
|
TR01 | Transfer of patent right |