Random event generation method and device, random event verification method and device, storage medium and terminal
By using a pre-arranged confidentiality processing algorithm in software applications to keep the first random number confidentiality processing algorithm confidential and allow users to verify the authenticity of random events, the problem that users and operating platforms cannot easily prove the authenticity of random events is solved, and effective verification of random events is achieved.
Patent Information
- Application Number
- CN202311757336.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
In the existing software application interaction based on random events, users and operating platforms cannot conveniently prove whether random events are operated in secret.
The first random number is confidentialized through the confidentiality processing algorithm agreed with the user, and the confidentiality processing result is provided to the user. The user can obtain the first random number through a public request and verify the authenticity of the random event based on a pre-conventional algorithm.
It realizes the convenience of verifying whether the generated random events are operated by a dark box, and improves users' trust in the authenticity of random events.
Smart Images

Figure CN120168972A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method for generating random events, a verification method, an apparatus, a storage medium, and a terminal. Background Art
[0002] In many software applications, random events related to user interaction are involved, such as lottery draws for players in games, lottery draws for audiences in online live broadcasts, and so on. In specific implementations, operation platforms such as games and online live broadcasts often use random numbers to generate corresponding random events. For example, in an application scenario, after a user in a game defeats a monster, the game manufacturer will randomly give some rewards to the user. With the evolution of the game business model, the phenomenon of using randomness to increase game revenue has become more and more common. A typical example is the so-called "gacha game". In such games, users can use certain resources (such as points or in-game currency, etc.) to draw cards in the game, and each card draw has a certain probability of obtaining rare in-game items.
[0003] Taking the gacha game as an example, since the draw result itself depends on probability, users all hope to have better luck. However, sometimes they will encounter the situation of bad luck, and users will have doubts about whether there is any trickery or under-the-table operation in the draw system. On the other hand, in order to maintain the enthusiasm of users to continue drawing cards, game manufacturers also hope to prove that they have not manipulated the draw results. Therefore, whether for users or game manufacturers, they hope that the draw system can be proven to have no under-the-table operation.
[0004] Currently, for this type of game that generates random numbers on the server side, game manufacturers usually use the following several methods to prove no under-the-table operation. Method 1: Prove no under-the-table operation by publishing the source code of the game server. Method 2: Game manufacturers prove no under-the-table operation by publishing the draw probability in accordance with regulatory requirements. Method 3: Use blockchain technology to prove no under-the-table operation.
[0005] However, for Method 1, since users have no way of knowing whether the code actually executed on the server has been secretly modified, the method of publishing the source code still fails to convince users. For Method 2, if the user group wants to verify whether the extraction probability of the game is consistent with the publicly announced probability, they can only record a large number of extraction records and compare the frequency of obtaining rare items with the publicly announced probability. Obviously, this method of estimating probability by frequency is doomed to be unable to accurately determine whether the "extraction probability" is consistent with the publicly announced probability. On the other hand, it is also very difficult to rule out the possibility that game manufacturers deliberately contaminate the statistical results to manipulate the statistical results. In addition, for individual users, since the sample size is often small, it is very difficult to conduct meaningful verification of the extraction probability. For Method 3, due to the complexity of blockchain technology, it is very difficult to ensure performance and reliability when related algorithms are applied to the game field. In addition, such algorithms are often very complex and difficult to understand, and users often lack blockchain-related knowledge, so it is very difficult to gain the recognition of the user group.
[0006] In summary, in some current software application interactions based on random events, users and operating platforms cannot conveniently prove whether random events have been rigged. Summary of the Invention
[0007] The technical problem solved by the embodiments of the present invention is that in some existing software application interactions based on random events, neither users nor operating platforms can conveniently prove whether random events have been rigged.
[0008] To solve the above technical problem, an embodiment of the present invention provides a method for generating a random event, including: based on a first random number, performing confidentiality processing on the first random number using a confidentiality processing algorithm pre-agreed with the user, and providing the confidentiality processing result to the user. The first random number is configured to be confidential to the user and is made public to the user in response to the user's public request, and the first random number becomes invalid after being made public to the user; obtaining a second random number provided by the user; using an algorithm pre-agreed with the user, generating a third random number according to the first random number and the second random number, generating a random number sequence using the third random number as a random seed, and generating a random event derived from the random number sequence.
[0009] Optionally, the providing the confidentiality processing result to the user includes any one of the following methods: displaying the confidentiality processing result to the user; according to a first mapping relationship pre-agreed with the user, mapping the confidentiality processing result to an element sequence, and displaying the element sequence to the user. Multiple elements in the element sequence come from a preset symbol set.
[0010] Optionally, the element sequence corresponding to the confidentiality processing result is obtained by combining multiple elements from the symbol set.
[0011] Optionally, the second random number is obtained in any of the following ways: according to a second mapping relationship agreed with the user, mapping the element selected by the user from the element sequence to obtain the second random number; or the user arbitrarily inputs the second random number.
[0012] Optionally, according to the second mapping relationship agreed with the user, mapping the element selected by the user from the element sequence to obtain the second random number includes: according to the second mapping relationship agreed with the user, mapping the element sequence arranged by the user from the selected elements in the element sequence to obtain the second random number.
[0013] Optionally, the device indicating the user to use stores the secrecy processing result and the second random number.
[0014] Optionally, the method for generating the random event further includes: in response to the user's storage operation, performing an anti-tampering processing operation on the stored secrecy processing result and the second random number.
[0015] Optionally, before obtaining the second random number provided by the user, it further includes: receiving the confirmation information of the user for the secrecy processing result.
[0016] An embodiment of the present invention further provides a method for verifying a random event, including: in response to the user's verification operation, sending a public request to the operation platform, where the public request is used to request the operation platform to disclose the first random number; receiving the first random number; obtaining a second random number, using an algorithm pre-agreed with the operation platform, generating a third random number according to the first random number and the second random number, generating a random number sequence with the third random number as the random seed, and verifying whether the random event derived from the random number sequence is the same as the random event actually generated by the operation platform.
[0017] An embodiment of the present invention further provides a device for generating a random event, including: a secrecy unit, configured to perform secrecy processing on the first random number based on the first random number by using a secrecy processing algorithm pre-agreed with the user, and provide the secrecy processing result to the user, where the first random number is configured to be kept secret from the user and is disclosed to the user in response to the user's public request, and the first random number becomes invalid after being disclosed to the user; an obtaining unit, configured to obtain the second random number provided by the user; a random event generating unit, configured to use an algorithm pre-agreed with the user, generate a third random number according to the first random number and the second random number, generate a random number sequence with the third random number as the random seed, and generate a random event derived from the random number sequence.
[0018] An embodiment of the present invention further provides a verification device for random events, including: a sending unit, configured to send a public request to an operation platform in response to a user's verification operation, where the public request is used to request the operation platform to disclose a first random number; a receiving unit, configured to receive the first random number; a verification unit, configured to obtain a second random number, generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the operation platform, generate a random number sequence with the third random number as a random seed, and verify whether the random event derived from the random number sequence is the same as the random event actually generated by the operation platform.
[0019] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the above-mentioned random event generation method or the steps of the above-mentioned random event verification method.
[0020] An embodiment of the present invention further provides a terminal, including a memory and a processor. A computer program capable of running on the processor is stored on the memory. When the processor runs the computer program, it executes the steps of the above-mentioned random event generation method or the steps of the above-mentioned random event verification method.
[0021] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:
[0022] Generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the user, generate a random number sequence with the third random number as a random seed, and then generate a random event derived from the random number sequence. The first random number is subjected to a confidentiality processing algorithm pre-agreed with the user for confidentiality processing, and the confidentiality processing result is provided to the user. Since the first random number is configured to be publicly available to the user in response to the user's request and becomes invalid after being made public. In this way, the user can request the disclosure of the first random number through a public request. After the user learns the first random number, perform confidentiality processing on the first random number based on the pre-agreed confidentiality processing algorithm, and compare the consistency between the obtained confidentiality processing result and the disclosed confidentiality processing result to verify whether the first random number has been replaced. Furthermore, verify the authenticity of the third random number used as the random seed based on the first random number and the second random number, and verify whether the random event derived from the random number sequence generated with the third random number as the random seed is the same as the random event actually generated by the operation platform, so as to verify the authenticity of the random event, thereby realizing the verification of whether the generated random event has been manipulated behind the scenes. By generating random events in this way, the convenience for users to verify whether the random events have been manipulated behind the scenes can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1It is a flowchart of a method for generating random events in an embodiment of the present invention;
[0024] Figure 2 It is a schematic diagram of the display of a user interface;
[0025] Figure 3 It is a schematic diagram of the display of another user interface;
[0026] Figure 4 It is a schematic diagram of the display of yet another user interface;
[0027] Figure 5 It is a schematic diagram of the display of still another user interface;
[0028] Figure 6 It is a flowchart of a method for verifying random events in an embodiment of the present invention;
[0029] Figure 7 It is a schematic structural diagram of a device for generating random events in an embodiment of the present invention;
[0030] Figure 8 It is a schematic structural diagram of a device for verifying random events in an embodiment of the present invention. Detailed implementation manners
[0031] As described above, in some current software application interactions based on random events, users and operation platforms cannot conveniently prove whether random events are manipulated behind the scenes.
[0032] To solve the above problems, in an embodiment of the present invention, since the first random number is configured to be publicly available to the user in response to the user's request and becomes invalid after being made public. In this way, the user can request the disclosure of the first random number through a disclosure request. After the user learns the first random number, the user performs a confidentiality process on the first random number based on a pre-agreed confidentiality processing algorithm, and compares the consistency between the obtained confidentiality processing result and the publicly disclosed confidentiality processing result to verify whether the first random number has been replaced. Furthermore, based on the first random number and the second random number, the authenticity of the third random number used as the random seed is verified, and it is verified whether the random events derived from the random number sequence generated with the third random number as the random seed are the same as the random events actually generated by the operation platform, so as to verify the authenticity of the random events, thereby realizing the verification of whether the generated random events are manipulated behind the scenes. By generating random events in this way, the convenience for users to verify whether random events are manipulated behind the scenes can be improved.
[0033] To make the above objects, features, and beneficial effects of the embodiments of the present invention more obvious and understandable, the following will describe the specific embodiments of the present invention in detail with reference to the accompanying drawings.
[0034] An embodiment of the present invention provides a method for generating random events, which can be applied to the operation platform of an interactive software application. Specifically, in an interactive software application, it usually involves an operation platform and multiple devices network-connected to the operation platform. Users connect to the operation platform through their respective devices to realize various functions such as games and webcasts. The operation platform can be various servers configured with server programs, and the devices used by users can be computers, smartphones, tablets, game consoles, etc., on which client programs are running. The client programs and server programs interact and cooperate with each other to realize various interactive services and functions.
[0035] Referring to Figure 1 , the random event generation method of this embodiment may include the following steps 11 to 13.
[0036] Step 11, based on a first random number, perform confidentiality processing on the first random number using a confidentiality processing algorithm pre-agreed with the user, and provide the user with the confidentiality processing result. The first random number is configured to be confidential to the user and is made public to the user in response to the user's public request, and the first random number becomes invalid after being made public to the user.
[0037] Step 12, obtain a second random number provided by the user.
[0038] Step 13, using an algorithm pre-agreed with the user, generate a third random number according to the first random number and the second random number, generate a random number sequence with the third random number as the random seed, and generate a random event derived from the random number sequence.
[0039] As can be seen from the above, since the first random number is configured to be made public to the user in response to the user's request and becomes invalid after being made public. In this way, the user can request to make the first random number public through a public request. After the user learns the first random number, perform confidentiality processing on the first random number based on the pre-agreed confidentiality processing algorithm, and compare the consistency between the obtained confidentiality processing result and the publicly disclosed confidentiality processing result to verify whether the first random number has been replaced. Furthermore, verify the authenticity of the third random number used as the random seed based on the first random number and the second random number, and verify whether the random event derived from the random number sequence generated with the third random number as the random seed is the same as the random event actually generated by the operation platform, so as to verify the authenticity of the random event, thereby realizing the verification of whether the generated random event has been manipulated behind the scenes. By generating random events in this way, the convenience for users to verify whether the random event has been manipulated behind the scenes can be improved.
[0040] In a specific implementation of step 11, the first random number is provided by the operation platform. The operation platform can be the operation platform of a game manufacturer, the operation platform of a live broadcast manufacturer, etc. The user can be a player of a game, an audience of a live broadcast, or a participant in other types of random events, etc.
[0041] The operation platform can agree on relevant algorithms with users by means of publicly disclosing the algorithms used for generating random events to the public (such as confidentiality processing algorithms, random seed generation algorithms, random event derivation algorithms, etc.). The operation platform can also agree on relevant algorithms with users by publicly disclosing the relevant code for generating random events. It can be understood that the operation platform can also use other methods to pre-agree on relevant algorithms with users in advance, and no further examples will be given here.
[0042] In a specific implementation, the confidentiality processing algorithm in step 11 satisfies the following conditions: Condition 1, it is very difficult to find another different first random number such that the confidentiality processing results of the two first random numbers are the same. That is, it has the characteristic of anti-collision attack. Condition 2, it is very difficult to reverse-derive the first random number only based on the confidentiality processing result. That is, it has the characteristic of preimage attack resistance.
[0043] In some embodiments, the confidentiality processing algorithm can include a cryptographic hash function. The cryptographic hash function can be, for example, the SHA256 function, the SM3 function, the SHA3 function, etc. At this time, the confidentiality processing result can be the hash value obtained by performing a hash operation on the first random number using the cryptographic hash function.
[0044] In some other embodiments, the confidentiality processing algorithm can also include a digital signature function.
[0045] During the random event generation process, the operation platform provides the user with the confidentiality processing result of the first random number, that is, publicly discloses the confidentiality processing result to the user, but the first random number is kept confidential from the user. When the user requests to publicly disclose the first random number through a public request, the first random number is publicly disclosed to the user. The first random number becomes invalid after being publicly disclosed to the user. The invalidated first random number is no longer used in subsequent random event generation. When generating a random event again later, a new first random number needs to be regenerated.
[0046] In a specific implementation, any of the following methods can be used to provide the confidentiality processing result to the user.
[0047] In some non-limiting embodiments, the confidentiality processing result is displayed to the user. That is, the original form of the confidentiality processing result is displayed to the user. For example, the confidentiality processing result can be displayed on the user interface.
[0048] In some other non - restrictive embodiments, using a first mapping relationship pre - agreed with the user, the result of the confidentiality processing is mapped to an element sequence, and the element sequence is displayed to the user. Multiple elements in the element sequence are from a preset symbol set. The elements in the preset symbol set can be at least one of the following: characters, words, pictures, emojis, etc. The preset symbol set is pre - agreed with the user.
[0049] In some embodiments, the element sequence corresponding to the result of the confidentiality processing is obtained by combining multiple elements from the symbol set.
[0050] For example, using the encoding method of the Combinatorial Number System (CNS), the result of the confidentiality processing is mapped to an element sequence. Among them, the full English name of the Combinatorial Number System can also be combinatorial representation of integers or combinadic. Also, for example, using other preset mapping methods such as string splicing to map the result of the confidentiality processing to an element sequence.
[0051] In some non - restrictive embodiments, before step 12, confirmation information from the user regarding the result of the confidentiality processing is received. That is to say, the result of the confidentiality processing is confirmed by the user. In other words, the first random number is confirmed by the user. In this way, the user's suspicion that the operation platform uses a first random number favorable to itself can be further eliminated.
[0052] In a specific implementation, the user can send a request to the operation platform to change the result of the confidentiality processing by operating the device used. For example, an operation button "Change" for changing the result of the confidentiality processing can be set on the user interface. When the user triggers the button "Change", a request to change the result of the confidentiality processing is sent to the operation platform. When the operation platform receives the request to change the result of the confidentiality processing, a new first random number is regenerated, and the result of the confidentiality processing corresponding to the new first random number is provided to the user. At this time, the result of the confidentiality processing corresponding to the new first random number is displayed on the user interface.
[0053] In step 12, the second random number provided by the user can be generated in various ways, which are illustrated as follows.
[0054] In some embodiments, according to a second mapping relationship agreed with the user, the elements selected by the user from the element sequence are mapped to obtain a second random number.
[0055] The user selects some or all of the elements from the elements of the element sequence corresponding to the confidentiality processing result. According to the second mapping relationship agreed with the user, the element sequence arranged by the user from the elements selected from the element sequence is mapped to obtain the second random number.
[0056] In some embodiments, the second mapping relationship includes an encoding method using the Factorial Number System (FNS). The English name of the factorial number system can also be factoradic.
[0057] In specific implementation, when the user selects elements from the elements of the element sequence corresponding to the confidentiality processing result, the following at least one operation can be performed on the elements: sorting, inserting, deleting, selecting, transforming, etc. The transformation can include one or more of rotation, mirroring, color change, replacement, etc. In this way, by providing a variety of preset operations on the elements, while ensuring the randomness of the generation of the second random number, it is beneficial for the operation platform to control and save operation costs.
[0058] The user can operate the elements in the element sequence corresponding to the confidentiality processing result through interaction methods such as tapping, dragging, or pressing keys. After completing the operation on the elements in the element sequence, record the element sequence after the operation, and map the element sequence after the operation according to the preset second mapping relationship to obtain the second random number. The length of the element sequence after the operation may be the same as or different from the length of the element sequence corresponding to the confidentiality processing result.
[0059] In some other embodiments, the second random number is arbitrarily input by the user. The content input by the user can be text, pictures, characters, etc. At this time, the second random number may not depend on the element sequence corresponding to the confidentiality processing result. In this way, the randomness of the second random number provided by the user can be further improved, avoiding being predicted in advance by the operation platform, and further reducing the probability of the operation platform's under-the-table operation.
[0060] In some non-limiting embodiments, sensitive information detection is performed on the second random number provided by the user. When the sensitive information detection result indicates that the second random number includes sensitive information, the user is reminded to provide a new second random number. The second random number including sensitive information can be discarded.
[0061] The sensitive information detection of the second random number can be implemented by means of a preset sensitive word library or a sensitive information detection machine learning model, etc. According to the different types of the second random number, the specific detection methods are different, and can be selected according to actual needs.
[0062] In some non-limiting embodiments, the second random number may be displayed. For example, the second random number is displayed on the user interface. Of course, the second random number may also not be displayed according to the display configuration of the second random number by the user.
[0063] Further, it is instructed that the device used by the user stores the result of the confidentiality processing and the second random number. Storing the result of the confidentiality processing and the second random number facilitates subsequent reference by the user. It may be instructed that the device used by the user stores the result of the confidentiality processing and the second random number by means of screenshot. It may also be instructed that the device used by the user stores the result of the confidentiality processing and the second random number by means of screen recording. It may further be instructed that the device used by the user captures the result of the confidentiality processing and the second random number and stores the result of the confidentiality processing and the second random number in text form.
[0064] The device used by the user may store the result of the confidentiality processing and the second random number to the device used by the user in response to an instruction from the operation platform. The device used by the user may also store the result of the confidentiality processing and the second random number to the device used by the user in response to a storage operation by the user.
[0065] Further, in response to a storage operation by the user, the operation platform performs an anti-tampering processing operation on the stored result of the confidentiality processing and the second random number. The anti-tampering processing operation includes at least one of the following: performing digital watermarking technology processing on the stored result of the confidentiality processing and the second random number, or performing digital signature technology processing on the stored result of the confidentiality processing and the second random number. For example, a digital watermark or a digital signature is added to the result of the confidentiality processing and the second random number to effectively prevent the user from maliciously tampering with the result of the confidentiality processing and the second random number.
[0066] To facilitate understanding by those skilled in the art of the generation method of the second random number, several examples are described below.
[0067] Example 1
[0068] The elements in the preset symbol set are emoji. The emoji may include basic emoji, and rotated emoji obtained by rotating the basic emoji by a preset angle, such as rotating 90 degrees, 180 degrees, 270 degrees or other degrees. That is, the preset symbol set is a set composed of various emoji.
[0069] The result of the confidentiality processing of the first random number is mapped to an element sequence of length n by using the CNS encoding method and displayed on the user interface. n is a positive integer. Refer to Figure 2 , taking n equal to 16 as an example, the element sequence x1, x2... x obtained by mapping the result of the confidentiality processing is displayed in a matrix manner 16It should be noted that in practice, it is not limited to displaying the element sequence obtained by mapping the result of confidentiality processing in the form of a matrix, and other appropriate methods can also be adopted, which will not be illustrated one by one here.
[0070] The user can drag the emojis in the element sequence corresponding to the confidentiality processing result displayed on the user interface to reorder them, or rotate the emojis displayed on the user interface according to the set rotation angle. After the user finishes the operation, the sequence on the user interface is y1, y2... y 16 Using the FNS encoding method, map y1, y2... y 16 to a second random number.
[0071] Example 2
[0072] The elements in the preset symbol set are numbers. Here, an example is given with the preset symbol set consisting of a set of hexadecimal numbers.
[0073] Calculate the SHA256 hash value of the confidentiality processing result, map the confidentiality processing result to an element sequence in the way of taking the first n numbers and display it on the user interface. The length of the element sequence corresponding to the confidentiality processing result is n. Refer to Figure 3 Taking n = 9 as an example for illustration. The user interface may include a left display box 31 and a right display box 32. The element sequence x1, x2... x9 corresponding to the confidentiality processing result is displayed in the right display box 32.
[0074] The user can select some or all of the elements from the element sequence x1, x2... x9 in the right display box 32, and the selected elements are displayed in the left display box 31. Among them, the elements x1, x2... x9 in the right display box 32 can be selected repeatedly. Refer to Figure 4 Taking the elements selected by the user as x9, x9, x8, and x1 as an example for illustration.
[0075] After the user finishes the operation, assume that the element sequence in the left display box 31 after the operation is y1, y2... y m Map the element sequence y1, y2... y m to a second random number. m is a positive integer. For example, by calculating the hash value of the element sequence y1, y2... y m map the element sequence y1, y2... y m to a second random number.
[0076] Example 3
[0077] The elements in the preset symbol set are combinations of numbers and English letters. For example, the elements in the preset symbol set are a set composed of decimal digits 0-9 and 26 English letters. A trivial mapping relationship is used to map the result of the confidentiality processing corresponding to the first random number. Among them, the trivial mapping is also called the identity mapping, which refers to a mapping from a set to itself, and for any element, the result after mapping is the same as the original element. That is, the original form of the confidentiality processing result itself is displayed. Refer to Figure 5 , for example, the result of the confidentiality processing is displayed in the first display box 51, and the value of the confidentiality processing result a’ is: xxxxxx. The user can input numbers or letters in the second display box 52. After the user finishes inputting, assuming that the input sequence in the second display box after the operation is y1, y2... y m , y1, y2... y m can be mapped to the second random number. For example, the method of concatenating characters into a string is used to map y1, y2... y m to the second random number.
[0078] Example 4
[0079] The elements in the preset symbol set are characters, words, pictures, emojis, etc. The CNS encoding method is used to map the result of the confidentiality processing to an element sequence, and the elements x1, x2... x n in the sequence come from the preset symbol set. The element sequence x1, x2... x n is displayed on the user interface. The user can reorder the elements in the element sequence x1, x2... x n , as described in Example 1. The user can also select some or all of the elements from the element sequence x1, x2... x n , as described in Example 2. After the user operates on the element sequence x1, x2... x n , the element sequence y1, y2... y m is obtained. The FNS encoding method is used to map y1, y2... y m to the second random number.
[0080] If the number of elements in the symbol set is denoted as p, and p is a positive integer. Taking n elements from the symbol set to form a combination, the total number of ways of taking is kinds, so a mapping can be constructed by using methods such as CNS encoding.
[0081] For a specific combination x1... x n arranged into y1... y m , the number of permutation methods is kinds, so a mapping of the second random number can be constructed by using methods such as FNS encoding.
[0082] If n = m, only y1…y needs to be recorded m to record the secure processing result of the first random number and the second random number simultaneously. Because the combination information it contains can decode the secure processing result, and the permutation information it contains can decode the second random number.
[0083] For example, if the agreed symbol set is {A, B, C, D, E} and n = m = 3, then the total number of ways to take 3 elements from the symbol set to form a combination is ways. Therefore, the mapping relationship from the secure processing result to the element sequence can be constructed in lexicographical order: secure processing result 0 corresponds to the element sequence ABC, secure processing result 1 corresponds to the element sequence ABD, secure processing result 2 corresponds to the element sequence ABE, secure processing result 3 corresponds to the element sequence ACD, secure processing result 4 corresponds to the element sequence ACE, secure processing result 5 corresponds to the element sequence ADE, secure processing result 6 corresponds to the element sequence BCD, secure processing result 7 corresponds to the element sequence BCE, secure processing result 8 corresponds to BDE, secure processing result 9 corresponds to the element sequence CDE.
[0084] For each combination taken out, the number of permutation methods is ways. Therefore, the mapping relationship from the element sequence y1y2y3 to the second random number can be constructed in lexicographical order. For example, for the combination ABC, the mapping relationship can be constructed: the element sequence ABC corresponds to the second random number 0, the element sequence ACB corresponds to the second random number 1, the element sequence BAC corresponds to the second random number 2, the element sequence BCA corresponds to the second random number 3, the element sequence CAB corresponds to the second random number 4, and the element sequence CBA corresponds to the second random number 5. Another example, for the combination ABE, the mapping relationship can be constructed: the element sequence ABE corresponds to the second random number 0, the element sequence AEB corresponds to the second random number 1, the element sequence BAE corresponds to the second random number 2, the element sequence BEA corresponds to the second random number 3, the element sequence EAB corresponds to the second random number 4, and the element sequence EBA corresponds to the second random number 5.
[0085] If y1y2y3 is CAB, the secure processing result can be decoded as 0 and the second random number as 4; if y1y2y3 is AEB, the secure processing result can be decoded as 2 and the second random number as 1.
[0086] In the specific implementation of step 13, the random seed generation algorithm used to generate the third random number can include any one of the following: Key Derivation Function (KDF), XOR function, string concatenation function, etc.
[0087] In the specific implementation of step 13, an algorithm agreed upon with the user can be adopted to generate a random number sequence using the third random number as the random seed. One or more random number sequences are generated. Each random number sequence corresponds to a random event respectively. The generated random event can be determined according to the mapping relationship between the random number sequence and the random event. The specific algorithm for deriving a random event from a random number sequence can be selected according to actual requirements and is not limited here.
[0088] In the process of generating a random number sequence using the third random number as the random seed, external state information such as a timestamp or internal state information of the software application can be referenced to adjust the one or more generated random number sequences, and thus adjust the generated random events. In this way, it can be achieved that different random events are generated when the user triggers the generation of random events at different times. Or different random events are generated according to different internal states of the software application, further improving the randomness of random event generation. Among them, the internal state information of the software application can be internal state information of a game, etc.
[0089] It should be noted that the random numbers in the embodiments of the present invention, such as the first random number, the second random number, and the third random number, are not limited to numbers in the narrow sense, and can also be data in a computer, such as a string, a bit string, etc.
[0090] The embodiments of the present invention also provide a method for verifying a random event. The method for verifying a random event can be applied to the device used by the user. In an interactive software application, it usually involves an operation platform and multiple devices network-connected to the operation platform. The user connects to the operation platform through their respective devices to implement various functions such as games and network live broadcasts. The operation platform can be various servers configured with server programs. The device used by the user can be a computer, a smart phone, a tablet computer, a game console, etc., on which a client program is running. The client program and the server program interact and cooperate with each other to implement various interactive services and functions. The client program can be a third-party program or a program developed by the operation platform. Refer to Figure 6 and the method for verifying a random event can include the following steps 61 to step 63.
[0091] Step 61, in response to the user's verification operation, send a public request to the operation platform, where the public request is used to request the operation platform to publicly disclose the first random number.
[0092] Step 62, receive the first random number.
[0093] Step 63: Obtain a second random number, generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the operation platform, generate a random number sequence with the third random number as the random seed, and verify whether the random event derived from the random number sequence is the same as the random event actually generated by the operation platform.
[0094] In specific implementation, for the specific steps of the operation platform actually generating a random event, reference can be made to the descriptions in steps 11 to 13 provided in the above embodiments, and the specific generation process of the random event will not be elaborated here.
[0095] In specific implementation, in step 61, the user interface may be provided with a random event verification entry, and the user can enter the verification operation of the random event actually generated by the operation platform through the random event verification entry. The random event verification entry can be a button, a link, or an input box for the first random number and the second random number, etc., in various appropriate forms.
[0096] When detecting the user's verification operation, in response to the user's verification operation, send a public request to the operation platform. After receiving the public request, the operation platform provides the first random number to the user. The device used by the user can store the first random number. For example, store the first random number in the form of screen recording, screenshot, or text, etc.
[0097] Furthermore, the stored first random number is subjected to an anti-tampering processing operation. The anti-tampering processing operation can include at least one of the following: performing digital watermarking technology processing on the stored first random number, or performing digital signature technology processing on the stored first random number.
[0098] In step 63, the first random number can be input by the user, obtained from the operation platform, or obtained by acquiring the first random number stored in the device used by the user. The second random number can be input by the user, or obtained by acquiring the confidentiality processing result stored in the device used by the user and the second random number.
[0099] In some embodiments, after receiving the first random number publicly disclosed by the operation platform, the first random number can be subjected to confidentiality processing by using a confidentiality processing algorithm pre-agreed with the operation platform, and it is judged whether the confidentiality processing result obtained by the confidentiality processing is the same as the confidentiality processing result actually provided by the operation platform. Among them, the confidentiality processing result actually provided by the operation platform can be the confidentiality processing result stored in the device used by the user. If the confidentiality processing result obtained by the confidentiality processing is the same as the confidentiality processing result actually provided by the operation platform, it means that the operation platform has not replaced the first random number through under-the-table operations. If the confidentiality processing result obtained by the confidentiality processing is different from the confidentiality processing result actually provided by the operation platform, it means that the operation platform has the behavior of replacing the first random number through under-the-table operations.
[0100] Further, when anti-tampering processing operations are performed on the first random number, the result of the confidentiality processing, and the second random number, verify the integrity of the anti-tampering processing of the first random number, the result of the confidentiality processing, and the second random number to verify whether the anti-tampering processing is damaged. If the anti-tampering processing is damaged, output a reminder that the anti-tampering processing is damaged. In addition, the user can also be reminded to re-enter the first random number and the second random number.
[0101] In some non-limiting embodiments, if the first random number is different from the first random number actually provided by the operation platform, and / or the second random number is different from the second random number actually provided by the operation platform, a reminder of inconsistent random numbers can be output.
[0102] In some non-limiting embodiments, if the third random number calculated based on the first random number and the second random number is different from the third random number actually provided by the operation platform, output a reminder that the third random number has been tampered with secretly.
[0103] In the specific implementation of step 63, when the random event derived from the random number sequence is the same as the random event actually generated by the operation platform, it can be determined that the operation platform has no secret operation. That is, there is no cheating phenomenon in the random event actually generated by the operation platform. On the contrary, if the random event derived from the random number sequence is different from the random event actually generated by the operation platform, it is determined that the operation platform is suspected of having a secret operation. Further, a reminder that the random event has been secretly operated can be output.
[0104] It should be noted that although the above embodiments are described by taking games as examples, the technical solutions of this embodiment are not limited to games, and can be applied to various software applications involving interactive random events, such as network live broadcasts, etc.
[0105] The embodiment of the present invention also provides a device for generating random events. Refer to Figure 7 , the device 70 for generating random events may include:
[0106] A confidentiality unit 71, configured to perform confidentiality processing on the first random number based on the first random number by using a confidentiality processing algorithm pre-agreed with the user, and provide the result of the confidentiality processing to the user. The first random number is configured to be confidential to the user and is publicly disclosed to the user in response to the user's public request. The first random number becomes invalid after being publicly disclosed to the user;
[0107] An acquisition unit 72, configured to acquire the second random number provided by the user;
[0108] A random event generation unit 73, configured to generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the user, generate a random number sequence with the third random number as a random seed, and generate a random event derived from the random number sequence.
[0109] In a specific implementation, the above-mentioned random event generation device 70 can be used to implement the above-mentioned random event generation method. The random event generation device 70 includes units for implementing each step in the above-mentioned random event generation method. For the specific working principle and working method of the random event generation device 70, reference can be made to the description of the random event generation method in the above-mentioned embodiments, which will not be elaborated here.
[0110] An embodiment of the present invention further provides a random event verification device. Refer to Figure 8 , the random event verification device 80 may include:
[0111] A sending unit 81, configured to send a public request to the operation platform in response to a user's verification operation, where the public request is used to request the operation platform to publicly disclose the first random number;
[0112] A receiving unit 82, configured to receive the first random number;
[0113] A verification unit 83, configured to obtain a second random number, generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the operation platform, generate a random number sequence with the third random number as a random seed, and verify whether the random event derived from the random number sequence is the same as the random event actually generated by the operation platform.
[0114] In a specific implementation, the above-mentioned random event verification device 80 can be used to implement the above-mentioned random event verification method. The random event verification device 80 includes units for implementing each step in the above-mentioned random event verification method. For the specific working principle and working method of the random event verification device 80, reference can be made to the description of the random event verification method in the above-mentioned embodiments, which will not be elaborated here.
[0115] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the random event generation method provided in any one of the above embodiments of the present invention, or executes the steps of the random event verification method provided in any one of the above embodiments.
[0116] The computer-readable storage medium may include a non-volatile memory or a non-transitory memory, and may also include an optical disc, a mechanical hard disk, a solid-state drive, etc.
[0117] An embodiment of the present invention further provides a terminal, including a memory and a processor. A computer program capable of running on the processor is stored on the memory. When the processor runs the computer program, it executes the steps of the random event generation method provided in any of the above embodiments, or executes the steps of the random event verification method provided in any of the above embodiments.
[0118] The memory is coupled to the processor. The memory may be located inside or outside the terminal. The memory and the processor may be connected through a communication bus.
[0119] The terminal may include, but is not limited to, terminal devices such as mobile phones, computers, tablet computers, game consoles, etc., and may also be a server, a cloud platform, etc.
[0120] The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer program may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer program may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner.
[0121] In each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can be physically separate, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units. For example, for each device or product applied to or integrated into a chip, each module / unit included therein can be implemented in the form of hardware such as circuits, or at least some modules / units can be implemented in the form of software programs that run on a processor integrated inside the chip, and the remaining (if any) part of the modules / units can be implemented in the form of hardware such as circuits; for each device or product applied to or integrated into a chip module, each module / unit included therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (such as a chip, a circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented in the form of software programs that run on a processor integrated inside the chip module, and the remaining (if any) part of the modules / units can be implemented in the form of hardware such as circuits; for each device or product applied to or integrated into a terminal, each module / unit included therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (such as a chip, a circuit module, etc.) or different components inside the terminal, or at least some modules / units can be implemented in the form of software programs that run on a processor integrated inside the terminal, and the remaining (if any) part of the modules / units can be implemented in the form of hardware such as circuits.
[0122] In the embodiments of the present application, the descriptions such as first, second, and third are only for illustrative and distinguishing purposes of the described objects, without any order, and do not represent any special limitation on the number of devices in the embodiments of the present application, and shall not constitute any limitation to the embodiments of the present application.
[0123] It should be noted that the sequence numbers of the steps in this embodiment do not represent the limitation on the execution order of each step.
[0124] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and this program can be stored in any computer-readable storage medium, and the storage medium can include: ROM, RAM, magnetic disks, optical disks, etc.
[0125] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be subject to the scope defined by the claims.
Claims
1. A method for generating random events, characterized in that, Including: Based on the first random number, perform a confidentiality processing algorithm pre-agreed with the user on the first random number to provide the user with the confidentiality processing result. The first random number is configured to be confidential to the user and is made public to the user in response to the user's public request. The first random number becomes invalid after being made public to the user; Obtain the second random number provided by the user; Adopt an algorithm pre-agreed with the user, generate a third random number according to the first random number and the second random number, generate a random number sequence with the third random number as the random seed, and generate a random event derived from the random number sequence.
2. The method for generating random events according to claim 1, characterized in that, The providing the confidentiality processing result to the user includes any of the following methods: Display the confidentiality processing result to the user; According to a first mapping relationship pre-agreed with the user, map the confidentiality processing result to an element sequence, and display the element sequence to the user. Multiple elements in the element sequence come from a preset symbol set.
3. The method for generating random events according to claim 2, characterized in that, The element sequence corresponding to the confidentiality processing result is obtained by combining multiple elements from the symbol set.
4. The method for generating random events according to claim 2 or 3, characterized in that, The second random number is obtained by any of the following methods: According to a second mapping relationship agreed with the user, map the elements selected by the user from the element sequence to obtain the second random number; The user arbitrarily inputs the second random number.
5. The method for generating random events according to claim 4, characterized in that, The mapping the elements selected by the user from the element sequence to obtain the second random number according to the second mapping relationship agreed with the user includes: According to the second mapping relationship agreed with the user, map the element sequence arranged by the user from the elements selected from the element sequence to obtain the second random number.
6. The method for generating random events according to any one of claims 1, 2, 3 and 5, characterized in that, Also including: Instruct the device used by the user to store the confidentiality processing result and the second random number.
7. The method for generating random events according to claim 6, characterized in that, Also including: In response to the user's storage operation, perform an anti-tampering processing operation on the stored confidentiality processing result and the second random number.
8. The method for generating random events according to claim 1, characterized in that, Before obtaining the second random number provided by the user, it also includes: receiving the confirmation information of the user for the confidentiality processing result.
9. A method for verifying random events, characterized in that, Including: In response to the user's verification operation, send a public request to the operation platform. The public request is used to request the operation platform to make the first random number public; Receive the first random number; Obtain the second random number, adopt an algorithm pre-agreed with the operation platform, generate a third random number according to the first random number and the second random number, generate a random number sequence with the third random number as the random seed, and verify whether the random event derived from the random number sequence is the same as the random event actually generated by the operation platform.
10. A device for generating random events, characterized in that, Including: A confidentiality unit, which is used to perform a confidentiality processing algorithm pre-agreed with the user on the first random number based on the first random number, and provide the user with the confidentiality processing result. The first random number is configured to be confidential to the user and is made public to the user in response to the user's public request. The first random number becomes invalid after being made public to the user; An obtaining unit, which is used to obtain the second random number provided by the user; A random event generation unit, configured to generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the user, generate a random number sequence with the third random number as a random seed, and generate a random event derived from the random number sequence.
11. A device for verifying random events, characterized in that, It includes: A sending unit, configured to send a public request to an operation platform in response to a user's verification operation, where the public request is used to request the operation platform to disclose the first random number; A receiving unit, configured to receive the first random number; A verification unit, configured to obtain a second random number, generate a third random number according to the first random number and the second random number by using an algorithm pre-agreed with the operation platform, generate a random number sequence with the third random number as a random seed, and verify whether the random event derived from the random number sequence is the same as the random event actually generated by the operation platform.
12. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the computer program is run by a processor, it executes the steps of the random event generation method according to any one of claims 1 to 8, or executes the steps of the random event verification method according to claim 9.
13. A terminal, comprising a memory and a processor, wherein a computer program capable of running on the processor is stored on the memory, characterized in that, When the processor runs the computer program, it executes the steps of the random event generation method according to any one of claims 1 to 8, or executes the steps of the random event verification method according to claim 9.