Webpage lottery drawing information processing method and device, server and storage medium

By storing the unique codes of virtual items in the Redis database and combining it with the double confirmation mechanism of the relational database, the reliability and security issues of the lottery system were solved, ensuring the smooth progress of the lottery and improving the user experience.

CN120672387APending Publication Date: 2025-09-19GUANGZHOU SANQI DREAM NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510547065.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The lottery system in the existing technology is prone to lottery errors, resulting in a poor user experience. In the existing technology, the lottery system in the existing technology is prone to over-issuance of winning items (the above-mentioned virtual items), users repeatedly drawing lots, and users repeatedly winning. Moreover, the security of the lottery system is insufficient, and it is easy for a third party to forge winning information, resulting in a poor user experience.

Method used

By storing the unique code of each virtual item in the Redis database and the item status of each virtual item in the relational database, and utilizing the atomic operations of the Redis database and the double confirmation mechanism of the relational database, we ensure the data consistency and integrity of the lottery process, prevent over-issuance of winning items and duplicate winnings, and prevent the forgery of winning information through verification codes.

Benefits of technology

The reliability and security of the lottery system have been improved, errors such as over-issuance of winning items and repeated winnings have been avoided, the user experience has been improved, and the smooth progress of the lottery activities has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672387A_ABST
    Figure CN120672387A_ABST
Patent Text Reader

Abstract

The invention provides a webpage lottery drawing information processing method, which comprises the following steps of: storing an article unique code of each virtual article in a Redis database, and storing the article unique code and the article state of each virtual article in a relational database, and under the condition that the current login account of the client initiating the lottery drawing request is a user account with lottery drawing qualification, obtaining the unique article code corresponding to the target virtual article randomly determined in the Redis database, deleting the unique article code of the target virtual article in the Redis database, and based on the unique article code of the target virtual article, drawing the lottery drawing request based on the unique article code of the target virtual article. And updating the article state recorded in the relational database to determine whether the target virtual article is permitted to be received, and issuing the target virtual article to the current login account if the target virtual article is permitted to be received, so that the client reads the information of the target virtual article. According to the scheme, the consistency and integrity of the data can be guaranteed, and the reliability and safety of the lottery drawing system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a web page lottery information processing method, device, server, and storage medium. Background Art

[0002] With the development of Internet technology, in order to attract users and strengthen interaction with users, companies have added online real-time lottery links to various online activities. In this regard, web-based virtual item (i.e. lottery prizes) lottery activities have gradually become one of the basic means for games, shopping websites and other applications to conduct online reward activities and promotion activities.

[0003] In the related art, the event organizer adjusts the types and quantities of lottery prizes and the probability of winning each type of prize in the lottery system, so that the lottery system responds to the lottery request of the user when drawing the lottery at the front end, performs lottery logic processing, and announces the lottery results. However, the inventors found in actual applications that the lottery system in the related art is prone to lottery errors. For example, in the case of high concurrency, the reliability of the lottery system is low, and it is easy for the winning items (the above-mentioned virtual items) to be over-issued, users to draw the lottery repeatedly, and users to win the prize repeatedly; and the security of the lottery system is insufficient, and it is easy for the winning information to be forged by a third party, causing disputes between users and event organizers. Summary of the Invention

[0004] The present application provides a web page lottery information processing method, server and storage medium, which solves the problem that lottery systems in related technologies are prone to lottery errors, resulting in a poor user experience. This solution can improve the reliability and security of the lottery system to meet the requirements of high-concurrency scenarios for the lottery system, ensure the smooth progress of lottery activities, and help improve the user experience.

[0005] In a first aspect, the present application provides a web page lottery information processing method, which includes:

[0006] The unique item code of each virtual item is stored in the Redis database, and the unique item code and item status of each virtual item are stored in the relational database. The item status is used to identify whether the virtual item has been claimed;

[0007] In response to the received lottery request, if the current login account of the client initiating the lottery request is a user account that is eligible for the lottery, obtain the item unique code corresponding to the randomly determined target virtual item in the Redis database, and delete the item unique code of the target virtual item from the Redis database;

[0008] Based on the unique code of the target virtual item, the item status recorded in the relational database is updated to determine whether the target virtual item is allowed to be collected;

[0009] When it is determined that the target virtual item is allowed to be collected, the target virtual item is sent to the current login account so that the client can read the information of the target virtual item.

[0010] In a second aspect, the present application further provides a web page lottery information processing device, which includes:

[0011] a data recording module configured to store the unique item code of each virtual item in a Redis database, and store the unique item code and item status of each virtual item in a relational database, wherein the item status is used to identify whether the virtual item has been claimed;

[0012] a data extraction module configured to, in response to a received lottery request, obtain a unique item code corresponding to a randomly determined target virtual item in a Redis database if the current login account of the client initiating the lottery request is a user account eligible for the lottery, and delete the unique item code of the target virtual item from the Redis database;

[0013] a data update module configured to update the item status recorded in the relational database based on the unique item code of the target virtual item to determine whether to allow the target virtual item to be collected;

[0014] The data sending module is configured to send the target virtual item to the current login account when it is determined that the target virtual item is allowed to be collected, so that the client can read the information of the target virtual item.

[0015] In a third aspect, the present application further provides a server, comprising:

[0016] one or more processors;

[0017] The storage device is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the web page lottery information processing method of the present application.

[0018] In a fourth aspect, the present application also provides a storage medium storing computer-executable instructions, which, when executed by a processor, are used to execute the web page lottery information processing method of the present application.

[0019] This application solution can record the information of virtual items through the Redis database and the relational database, and then ensure the consistency and integrity of the data when processing according to the lottery logic, thereby improving the reliability and security of the lottery system to meet the requirements of the lottery system in high-concurrency scenarios, ensuring the smooth progress of the lottery activities, and effectively avoiding lottery errors such as over-issuance of winning items and repeated winnings, which helps to improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of the steps of a web page lottery information processing method provided in one embodiment of the present application;

[0021] Figure 2 A schematic diagram of the steps for obtaining a unique item code according to an embodiment of the present application;

[0022] Figure 3 A schematic diagram of the steps for obtaining a unique item code according to another embodiment of the present application;

[0023] Figure 4 A schematic diagram of the steps for updating a database provided in one embodiment of the present application;

[0024] Figure 5 A schematic diagram of the structure of a web page lottery information processing device provided in one embodiment of the present application;

[0025] Figure 6 A schematic diagram of the structure of a server provided in one embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and examples. It will be understood that the specific embodiments described herein are merely used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only portions related to the embodiments of the present application, rather than all structures, are shown in the accompanying drawings. After reading this specification, those skilled in the art should be able to understand that, as long as the technical features do not contradict each other, any combination of the technical features may constitute an optional embodiment.

[0027] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the description of this application, "multiple" means two or more, and "several" means one or more.

[0028] With the development of Internet technology, web-based virtual item raffles have become one of the means for companies to attract users and strengthen interaction with them in various online activities. For example, when users use game applications or shopping software applications on their terminal devices, they can click on a link to enter the corresponding webpage and participate in the raffle. The event organizer (such as a company or individual) adjusts the types and quantities of raffle prizes and the winning probability of each prize in the raffle system, so that the raffle system responds to the user's raffle request when making a raffle, performs raffle logic processing, and announces the raffle results.

[0029] However, in actual applications, the inventors discovered that lottery systems in related art are prone to lottery errors. For example, in high-concurrency situations, the lottery system's reliability is low, making it easy for prizes (the aforementioned virtual items) to be over-issued, for users to draw multiple prizes, and for users to win multiple prizes. Furthermore, the lottery system's security is insufficient, making it easy for third parties to forge winning information, leading to disputes between users and event organizers.

[0030] In this regard, this application provides a web page lottery information processing method, which can display a corresponding lottery interface for users on the web page for them to participate in the lottery. The web page lottery information processing method of this solution can be applied to the server to process the lottery information, thereby ensuring the smooth progress of the lottery. Figure 1 As shown, Figure 1 This is a schematic diagram of the steps of a web page lottery information processing method provided in one embodiment of the present application. This solution is described in detail using a server as an example. In one embodiment, the relevant information of the prizes (i.e., virtual items) for each lottery round is updated in real time in a database. This allows the database to update the recorded information while processing user request information during the lottery, thereby avoiding lottery errors. The specific steps are as follows:

[0031] Step S110: Store the unique item code of each virtual item in a Redis database, and store the unique item code and item status of each virtual item in a relational database. The item status is used to identify whether the virtual item has been claimed.

[0032] The Redis (Remote Dictionary Server) database is an open-source, in-memory database that complies with the BSD (Berkeley Software Distribution) license. It provides a high-performance key-value storage system. The Redis database not only supports basic key-value storage but also offers a rich set of data types, including strings, lists, sets, hashes, and sorted sets. Furthermore, all operations performed on the Redis database are atomic, meaning that the operation is either fully executed or not executed at all. This feature is crucial for ensuring data consistency and integrity and facilitates transaction processing in highly concurrent environments.

[0033] Furthermore, the unique item code of each virtual item is stored in a Redis database. The unique item code serves as a unique identifier for the virtual item. Different virtual items have different corresponding unique item codes and are unique within the Redis database. Furthermore, during each lottery draw, one of the unique item codes is extracted from the Redis database. Furthermore, whether each virtual item has been claimed is indicated by its corresponding item status. This item status is used to indicate whether the virtual item has been claimed. For example, a corresponding numerical value can be used to indicate claimed or unclaimed, such as 1 for claimed and 0 for unclaimed. Furthermore, a relational database is used to store the unique item code and item status of each virtual item. It should be noted that the relational database can be any of Oracle, MySQL, and SQL Server databases to store the unique item codes and item status. It is understood that by utilizing both a Redis database and a relational database, this solution, through dual confirmation of operations performed across both databases when confirming a lottery draw, can avoid lottery errors such as over-issuance of winning items.

[0034] Step S120: In response to the received lottery request, if the current login account of the client that initiates the lottery request is a user account that is eligible for the lottery, obtain the item unique code corresponding to the randomly determined target virtual item in the Redis database, and delete the item unique code of the target virtual item in the Redis database.

[0035] In one embodiment, a user accesses a web page for a lottery through a terminal device (i.e., a client), such as by clicking a link or entering a URL to jump to the web page. In response to the user's operation of starting the lottery on the terminal device (e.g., clicking a corresponding virtual button to start the lottery), the terminal device sends a lottery request to the server. In response to this, after receiving the lottery request, the server also verifies whether the current login account of the client that initiated the lottery request is a user account that is eligible for the lottery, that is, verifies the user's identity to determine whether the user can participate in the lottery.

[0036] Optionally, the server also records the target user account's account ID, the corresponding remaining number of draws, and the number of draws limited within the draw cycle in the user list. Upon receiving a draw request, the server determines whether the currently logged-in account is the target user account based on the user list, for example, by comparing the target user account's account ID recorded in the user list with the account ID of the currently logged-in account.

[0037] If the currently logged-in account is the target user account, the user list is further used to determine whether the number of draws for the account meets the requirements. For example, if the current number of draws for the currently logged-in account is less than or equal to the draw limit and the remaining number of draws is not zero, the currently logged-in account is determined to be a user account eligible for the draw. For example, if the draw limit for a target user account in a draw cycle is 2 (e.g., only two draws can be made in a day), and the remaining number of draws is 5, if the currently logged-in account is determined to be the target user account and the user has only drawn the draw once while logged in to the account, i.e., the draw limit has not been reached and the remaining number of draws is also 0, then the user account is determined to be the target user account.

[0038] The server then retrieves the unique item code corresponding to the randomly determined target virtual item from the Redis database and deletes the unique item code from the Redis database. It is understood that the selected target virtual item is randomly determined, not a specific virtual item, to ensure the randomness of the lottery. Furthermore, the operation of extracting a unique item code from the Redis database is an atomic operation within the Redis database and will not be interrupted, thus ensuring data consistency and integrity in a high-concurrency environment. Furthermore, after an item code is selected, it is deleted from the Redis database to avoid over-issuance of winning items.

[0039] Step S130: Based on the unique code of the target virtual item, the item status recorded in the relational database is updated to determine whether the target virtual item is allowed to be collected.

[0040] The relational database records the item unique code and the corresponding item status. After determining the item unique code of the target virtual item, the item status recorded in the relational database is updated according to the item unique code. It is understandable that based on the item unique code, the server can search the relational database for the item status corresponding to the item unique code, and then update the item status, such as updating it to a received status. In one embodiment, there are two situations corresponding to updating the item status to a received status. One is to update the item status from an unreceived status to a received status, in which case the update is successful; the other is to update the item status from a received status to a received status, in which case the update fails. In this regard, whether to allow the target virtual item to be collected can be determined based on the update result, so that it is determined that the target virtual item is allowed to be collected when the update is successful.

[0041] Step S140: If it is determined that the target virtual item is allowed to be collected, the target virtual item is sent to the current login account so that the client can read the information of the target virtual item.

[0042] If the server determines that the target virtual item is permitted, it will be delivered to the currently logged-in account. In one embodiment, the relevant information and data of the user account will be stored on a server leased or purchased by the enterprise. When the user logs in to their account through a client, the client can retrieve the relevant data and information to display it to the user on the client. For example, in a game application, the game data of the user account will be stored on the corresponding game server. After the user logs in to the client, the corresponding game data of the user account, such as virtual assets and game records, will be displayed on the client through data exchange between the client and the game server. To this end, in this solution, by delivering the target virtual item to the currently logged-in account, the target virtual item can be sent to the corresponding server storing the relevant information of the user account and associated with the currently logged-in account, so that the user can also see the information of the drawn target virtual item when logging in to the account on other terminal devices. After the delivery operation is completed, the client logged in by the currently logged-in account can read the information of the target virtual item, such as reading the information of the target virtual item from the server storing the relevant information of the user account, and then display it to the user.

[0043] As can be seen from the above solution, this solution can record the information of virtual items through the Redis database and the relational database, and then ensure the consistency and integrity of the data when processing according to the lottery logic, thereby improving the reliability and security of the lottery system, meeting the requirements of the lottery system in high-concurrency scenarios, ensuring the smooth progress of the lottery activities, and effectively avoiding lottery errors such as over-issuance of winning items and repeated winnings, which helps to improve the user experience.

[0044] The Redis database provides a rich set of data types, including strings, lists, sets, hash tables, sorted sets, etc. Therefore, different data types can be used to store unique item codes in the Redis database.

[0045] Alternatively, in one embodiment, if each virtual item has the same probability of winning, the server can create a Redis set (such as the set described above) in the Redis database. This Redis set is unordered, and its elements are unique. To this end, the server stores the unique item code for each virtual item in the Redis set, with each item code serving as a set element. This solution, by storing item codes in a Redis set, ensures their uniqueness while facilitating their extraction, thereby ensuring randomness in the lottery draw.

[0046] Optionally, in one embodiment, there are different probability values ​​for the winning probabilities of corresponding virtual items. For example, the winning probability of a virtual item of type I is 50%, and the winning probability of a virtual item of type II is 30%, where there are multiple virtual items of the same type. Based on this, the server creates multiple Redis lists (such as the list described above) based on the different probability values, and writes the item unique codes of virtual items with the same winning probability into the corresponding Redis lists in a random order. This allows the server to determine the final item unique code in combination with the winning probability of the virtual item when extracting the corresponding item unique code, thereby improving the randomness of the lottery.

[0047] Figure 2 This is a schematic diagram of the steps for obtaining a unique item code according to an embodiment of the present application. In one embodiment, when storing unique item codes in a Redis set, the server can randomly obtain the unique item code by calling the corresponding set operation command. The specific steps are as follows:

[0048] Step S210: When the unique code of the item is stored in a Redis set, call the SPOP command to perform a random removal operation on the Redis set.

[0049] Step S220: Determine the value of the set element removed after executing the SPOP command, and use it as the unique item code corresponding to the target virtual item.

[0050] It can be understood that the SPOP command is a set operation command in the Redis database. The SPOP command is used to randomly remove and return one or more elements from the Redis set. To this end, when configuring the SPOP command, the number of set elements to be removed is configured, and then the SPOP command is called to perform a random removal operation on the Redis set, that is, to extract a set element from it and remove it from the Redis set. Moreover, the set elements stored in the Redis set are the item unique codes corresponding to different virtual items. Based on this, the value of the removed set element can be used as the item unique code corresponding to the target virtual item. Therefore, by calling the corresponding set operation command, this solution can still ensure the extraction of the corresponding item unique code in a high-concurrency scenario, ensuring the smooth progress of the lottery activity.

[0051] Figure 3 This is a schematic diagram of the steps for obtaining a unique item code according to another embodiment of the present application. In one embodiment, when the unique item codes are stored in a Redis list, the server can randomly obtain the unique item code by calling the corresponding list operation command. The specific steps are as follows:

[0052] Step S310: When the unique code of the item is stored in a Redis list, the target Redis list assigned to the current login account is determined based on the generated random number and the probability distribution table generated according to the winning probability.

[0053] Step S320: Use either the LPOP command or the RPOP command as the target command to call the target command to perform a dequeue operation on the target Redis list.

[0054] Step S330: Determine the value of the list element output after executing the LPOP command or the RPOP command as the item unique code corresponding to the target virtual item.

[0055] It is understood that a corresponding probability distribution table is generated based on the probability of winning. For example, the probability distribution table is configured according to the item type, such as a 50% probability of winning for Type I, a 30% probability of winning for Type II, and a 20% probability of winning for Type III. It should be noted that the types of virtual items can be virtual item types, such as voucher types (such as consumer vouchers, coupons, etc.), electronic product types (such as watches, bracelets, mobile phones, etc.); of course, they can also be divided into types based on the value of the items, such as high-value types and low-value types. The specific division strategy can be set according to actual application requirements.

[0056] Furthermore, when a lottery is conducted, a random number generator can be used to generate a random number to determine the type of item to be matched based on the correspondence between the random number and the items in the probability distribution table. For example, based on the range corresponding to the random number and the probabilities of each item in the probability distribution table, the configured range is, for example, Type III corresponding to values ​​less than or equal to 20, Type II corresponding to values ​​greater than 20 and less than or equal to 30, and Type I corresponding to values ​​greater than 30 and less than or equal to 50. If the currently generated random number is 25, Type II is selected accordingly. Furthermore, the Redis list corresponding to Type II is selected from all Redis lists as the target Redis list and is assigned to the current login account.

[0057] The LPOP command and the RPOP command are list operation commands, both of which are used to perform dequeue operations on list elements in a list, that is, to remove them from the list. Among them, the LPOP command is used to remove a list element from the head of the list, and the RPOP command is used to remove a list element from the tail of the list. To this end, after determining the target Redis list, any one of the LPOP command and the RPOP command is randomly selected as the target command, and then the command is called to perform a dequeue operation on the target Redis list, thereby removing a list element from the head or tail of the list. The list elements stored in the Redis list are item unique codes corresponding to different virtual items. Based on this, the value of the removed set element can be used as the item unique code corresponding to the target virtual item. Therefore, by calling the corresponding list operation command, this solution can still ensure the extraction of the corresponding item unique code in a high-concurrency scenario, ensuring the smooth progress of the lottery activity.

[0058] In some embodiments, the relational database used is a MySQL database. In a MySQL database, a transaction is a set of operations that either succeed or fail simultaneously, thereby ensuring the atomicity, consistency, isolation, and durability of database operations. To this end, a MySQL transaction is set up in the MySQL database to update the status of items recorded in the library. The target item can then be updated by editing the SQL statement in the MySQL transaction.

[0059] Specifically, based on the unique item code of the target virtual item, the SQL statements in the MySQL transaction are updated, and then all SQL statements in the MySQL transaction are executed, so that the item status corresponding to the unique item code can be updated when the database is updated. Based on this, whether the target virtual item is allowed to be collected can be determined based on the update result. Among them, there are two situations corresponding to updating the item status to the collected status: one is to update the item status from the uncollected status to the collected status, in which case the update is successful; the other is to update the item status from the collected status to the collected status, in which case the update fails. Therefore, if the update fails, it is determined that the target virtual item is not allowed to be collected; if the update is successful, it is determined that the target virtual item is allowed to be collected.

[0060] Optionally, in one embodiment, as Figure 4 As shown, Figure 4 This is a schematic diagram of the steps for updating a database provided in an embodiment of the present application. By configuring the SQL statement in the MySQL transaction, the database can be updated. The specific steps include:

[0061] Step S410: Determine the target SQL statement in the MySQL transaction, where the target SQL statement is used to update the status of the item corresponding to the target unique code from an unclaimed state to a claimed state.

[0062] Step S420: Use the item unique code as the target unique code in the target SQL statement, and call the target SQL statement to update the MySQL database.

[0063] It can be understood that this solution selects a target SQL statement in a MySQL transaction and updates it according to the item's unique code. The target SQL statement is used to update the item's status corresponding to the target unique code from unclaimed to claimed. For example, in a MySQL database, the item's status is represented by the STATUS field, and the item's unique code is represented by the CODE field. The target SQL statement can be as follows:

[0064] "UPDATE table SET STATUS = 1 WHERE CODE = 'item unique code' AND STATUS = 0)"

[0065] The update conditions include CODE = 'item unique code' and STATUS = 0. This means that the target unique code and the item status being unclaimed are the update conditions. Therefore, when these two update conditions are met, the corresponding item status is updated to claimed (i.e., set to 1). The target virtual item's unique code is used as the target unique code. When executing the target SQL statement in the MySQL transaction, the target SQL statement is called and executed, thereby updating the MySQL database.

[0066] Therefore, this solution can update the database by updating the database, and can also find out whether the corresponding virtual items have been claimed, which helps to quickly complete the judgment of the lottery logic and improve the reliability and security of the lottery system.

[0067] In some embodiments, before sending the target virtual item to the current login account, the server may also verify with the client to ensure the security of the lottery system and prevent a third party from forging the winning information. When it is determined that the target virtual item is allowed to be sent to the current login account, the server sends the target virtual item's unique code, item image, and verification code to the client for verification by the client, that is, the client can verify the item's unique code based on the verification code. The specific verification method can refer to the relevant algorithms in the relevant technology, such as parity check, CRC (Cyclic Redundancy Check, cyclic redundancy check) check, etc. And after the verification is successful, the client can also generate a composite image including the item image and the item's unique code to show to the user. In this regard, by providing a verification code, this solution can avoid the occurrence of third-party forgery and help improve the security of the lottery system.

[0068] Figure 5 This is a schematic diagram of the structure of a web lottery information processing device provided in one embodiment of the present application. This device is used to execute the web lottery information processing method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. As shown in the figure, the device includes a data recording module 501, a data extraction module 502, a data update module 503, and a data transmission module 504.

[0069] The data recording module 501 is configured to store the unique item code of each virtual item in a Redis database, and store the unique item code and item status of each virtual item in a relational database, where the item status is used to identify whether the virtual item has been claimed.

[0070] The data extraction module 502 is configured to, in response to a received lottery request, obtain a unique item code corresponding to a randomly determined target virtual item in the Redis database if the current login account of the client initiating the lottery request is a user account eligible for the lottery, and delete the unique item code of the target virtual item from the Redis database;

[0071] The data update module 503 is configured to update the item status recorded in the relational database based on the item unique code of the target virtual item to determine whether to allow the target virtual item to be collected;

[0072] The data sending module 504 is configured to send the target virtual item to the current login account when it is determined that the target virtual item is allowed to be collected, so that the client can read the information of the target virtual item.

[0073] It can be seen that this solution can configure the Redis database and the relational database through the data recording module 501 to record the information of virtual items, and then ensure the consistency and integrity of the data when processing according to the lottery logic, and use the data extraction module 502 and the data update module 503 to control the data selection and update during the lottery process, thereby improving the reliability and security of the lottery system to meet the requirements of the lottery system in high-concurrency scenarios, ensure the smooth progress of the lottery activities, and effectively avoid lottery errors such as over-issuance of winning items and repeated winnings, which helps to improve the user experience.

[0074] Based on the above embodiment, the data recording module 501 is specifically configured as follows:

[0075] When the probability of winning each virtual item is the same, a Redis set is created in the Redis database, and the unique code of each virtual item is stored in the Redis set;

[0076] Alternatively, when there are different probability values ​​for the winning probabilities of corresponding virtual items, several Redis lists are created based on the different probability values, and the unique item codes of virtual items with the same winning probability are written into the corresponding Redis lists in a random order.

[0077] Based on the above embodiment, the data extraction module 502 is specifically configured as follows:

[0078] When the unique code of an item is stored in a Redis collection, call the SPOP command to perform a random removal operation on the Redis collection;

[0079] The value of the collection element removed after running the SPOP command is determined as the item unique code corresponding to the target virtual item.

[0080] Based on the above embodiment, the data extraction module 502 is specifically configured as follows:

[0081] When the unique item code is stored in a Redis list, the target Redis list assigned to the current login account is determined based on the generated random number and the probability distribution table generated according to the winning probability;

[0082] Use either the LPOP command or the RPOP command as the target command to call the target command to perform a dequeue operation on the target Redis list;

[0083] The value of the list element output after running the LPOP command or the RPOP command is determined as the item unique code corresponding to the target virtual item.

[0084] Based on the above embodiment, the relational database is a MySQL database, and the data update module 503 is specifically configured as follows:

[0085] Based on the unique code of the target virtual item, the SQL statement of the MySQL transaction is updated. The MySQL transaction is used to update the item status recorded in the library.

[0086] Execute all SQL statements of the MySQL transaction to update the MySQL database;

[0087] If the update fails, it is determined that the target virtual item will not be allowed to be collected;

[0088] If the update is successful, the target virtual item is allowed to be collected.

[0089] Based on the above embodiment, the data updating module 503 is further configured to:

[0090] Determine the target SQL statement in the MySQL transaction. The target SQL statement is used to update the status of the item corresponding to the target unique code from unclaimed to claimed.

[0091] The item unique code is used as the target unique code in the target SQL statement, and the target SQL statement is called to update the MySQL database.

[0092] On the basis of the above embodiment, the device further includes a data verification module, which is specifically configured as follows:

[0093] The target virtual item's unique code, item image, and verification code are sent to the client, so that the client can verify the item's unique code based on the verification code, and generate a composite image including the item image and the item's unique code after successful verification.

[0094] It is worth noting that in the embodiment of the above-mentioned device, the modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of this application.

[0095] Figure 6 This is a schematic diagram of the structure of a server provided in one embodiment of the present application. The device is used to execute the web page lottery information processing method provided in the above embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in the figure, the server includes a processor 601, a memory 602, an input device 603 and an output device 604. The number of processors 601 can be one or more, and the figure takes one processor 601 as an example; the processor 601, the memory 602, the input device 603 and the output device 604 can be connected by a bus or other means, and the figure takes the connection via a bus as an example. The memory 602, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the web page lottery information processing method in the embodiment of the present application. The processor 601 executes the corresponding various functional applications and data processing by running the software programs, instructions and modules stored in the memory 602, that is, realizes the above-mentioned web page lottery information processing method.

[0096] The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data recorded or created during use, etc. In addition, the memory 602 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 602 may further include a memory remotely located relative to the processor 601, and these remotely located memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0097] The input device 603 can be used to input corresponding digital or character information to the processor 601, and generate key signal input related to the user settings and function control of the device; the output device 604 can be used to send or display key signal output related to the user settings and function control of the device.

[0098] An embodiment of the present application further provides a storage medium storing computer-executable instructions, which, when executed by a processor, are used to perform relevant operations in the web page lottery information processing method provided in any embodiment of the present application.

[0099] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The 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 disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0100] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0101] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.

Claims

1. A web page lottery information processing method, characterized in that: include: Storing the unique item code of each virtual item in a Redis database, and storing the unique item code and item status of each virtual item in a relational database, wherein the item status is used to identify whether the virtual item has been claimed; In response to the received lottery request, if the current login account of the client initiating the lottery request is a user account that is eligible for the lottery, obtaining the item unique code corresponding to the randomly determined target virtual item in the Redis database, and deleting the item unique code of the target virtual item from the Redis database; Based on the unique item code of the target virtual item, updating the item status recorded in the relational database to determine whether to allow the target virtual item to be collected; If it is determined that the target virtual item is allowed to be collected, the target virtual item is sent to the current login account so that the client can read the information of the target virtual item.

2. The web page lottery information processing method according to claim 1, characterized in that: The storing of the unique item code of each virtual item in a Redis database, and the storing of the unique item code and item status of each virtual item in a relational database, includes: When the probability of winning each virtual item is the same, creating a Redis set in the Redis database, and storing the unique item code of each virtual item in the Redis set; Alternatively, when there are different probability values ​​for the winning probabilities of corresponding virtual items, several Redis lists are created based on the different probability values, and the unique item codes of virtual items with the same winning probability are written into the corresponding Redis lists in a random order.

3. The web page lottery information processing method according to claim 2, characterized in that: In response to the received lottery request, if the current login account of the client that initiated the lottery request is a user account that is eligible for the lottery, obtaining the item unique code corresponding to the randomly determined target virtual item in the Redis database, and deleting the item unique code of the target virtual item from the Redis database, including: In the case where the unique code of the item is stored in the Redis set, calling the SPOP command to perform a random removal operation on the Redis set; The value of the set element removed after running the SPOP command is determined as the item unique code corresponding to the target virtual item.

4. The web page lottery information processing method according to claim 2, characterized in that: In response to the received lottery request, if the current login account of the client that initiated the lottery request is a user account that is eligible for the lottery, obtaining the item unique code corresponding to the randomly determined target virtual item in the Redis database, and deleting the item unique code of the target virtual item from the Redis database, including: In the case where the unique item code is stored in the Redis list, determining a target Redis list to be allocated to the current login account based on a generated random number and a probability distribution table generated according to the winning probability; Using any one of the LPOP command and the RPOP command as a target command, and calling the target command to perform a dequeue operation on the target Redis list; The value of the list element output after running the LPOP command or the RPOP command is determined as the item unique code corresponding to the target virtual item.

5. The web page lottery information processing method according to claim 1, characterized in that: The relational database is a MySQL database; The updating operation of the item status recorded in the relational database based on the item unique code of the target virtual item to determine whether to allow the target virtual item to be collected includes: According to the unique code of the target virtual item, an SQL statement of a MySQL transaction is updated, wherein the MySQL transaction is used to update the item status recorded in the library; Execute all SQL statements of the MySQL transaction to update the MySQL database; If the update fails, determining that the target virtual item is not allowed to be collected; If the update is successful, it is determined that the target virtual item is allowed to be collected.

6. The web page lottery information processing method according to claim 5, characterized in that: The updating of the SQL statement of the MySQL transaction according to the unique code of the target virtual item includes: Determine a target SQL statement in the MySQL transaction, where the target SQL statement is used to update the status of an item corresponding to a target unique code from an unclaimed status to a claimed status; The item unique code is used as the target unique code in a target SQL statement, and the target SQL statement is called to update the MySQL database.

7. The web page lottery information processing method according to claim 1, characterized in that: Before sending the target virtual item to the current login account so that the client can read the target virtual item information when it is determined that the target virtual item is allowed to be collected, the method further includes: The unique item code, item image and verification code of the target virtual item are sent to the client, so that the client can verify the unique item code based on the verification code, and generate a composite image including the item image and the unique item code after successful verification.

8. A web page lottery information processing device, characterized in that: include: a data recording module configured to store the unique item code of each virtual item in a Redis database, and store the unique item code and item status of each virtual item in a relational database, wherein the item status is used to identify whether the virtual item has been claimed; a data extraction module configured to, in response to a received lottery request, obtain a unique item code corresponding to a randomly determined target virtual item in the Redis database if the current login account of the client initiating the lottery request is a user account eligible for the lottery, and delete the unique item code of the target virtual item from the Redis database; a data updating module configured to update the item status recorded in the relational database based on the item unique code of the target virtual item to determine whether to allow the target virtual item to be collected; The data sending module is configured to send the target virtual item to the current login account when it is determined that the target virtual item is allowed to be collected, so that the client can read the information of the target virtual item.

9. A server, characterized in that: The server includes: one or more processors; A storage device for storing one or more programs, when one or more of the programs are executed by one or more of the processors, enables the one or more processors to implement the web page lottery information processing method according to any one of claims 1 to 7.

10. A storage medium storing computer executable instructions, characterized in that: When executed by a processor, the computer executable instructions are used to execute the web page lottery information processing method according to any one of claims 1 to 7.