Game object numbering method, device, computer equipment and storage medium
By performing hash mapping processing of multi-level numbering intervals on the number generation method of game objects, the out-of-order identification is generated, which solves the problem that encoding identification is easily cracked in the prior art, and improves the security and attack resistance of the game system.
Patent Information
- Application Number
- CN202211124778.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-09-15
AI Technical Summary
In the existing game technology, the encoding identification generation logic is easily cracked, resulting in the outside world being able to learn the specific information of the game through the encoding identification of the players or the game team, causing security and performance problems.
By using the hash mapping process of multi-level numbering intervals to generate out-of-order identifications according to the number of identification bits and sequential numbers of out-of-order identifications, the security of out-of-order identifications and the anti-attack ability of the game system are improved.
It enhances the security of out-of-order logos, improves the anti-attack ability of the game system, prevents the coded logo from being cracked, and protects the security of game information.
Smart Images

Figure CN115445198B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, in particular to the field of game technology, and specifically to a method, device, computer equipment and storage medium for generating numbers for game objects. Background Art
[0002] With the continuous development of computer communication technology, the widespread application of computer devices such as smart phones, tablets and laptops, computer devices are developing in a diversified and personalized direction, and are becoming an indispensable terminal in people's life and work. In order to meet people's pursuit of spiritual life, entertainment games that can be operated on computer devices have emerged, and more and more terminal games have emerged. For example, games such as Multiplayer Online Battle Arena (MOBA) and Massive Multiplayer Online (MMO) developed based on client or server architecture are deeply loved by users due to their high fluency, good operation feel, and real-time combat.
[0003] At present, games generally have the function of generating coding identifiers for game objects. For example, a player who registers in a game can be assigned a unique user coding identifier, and a new game team created by a player in the game can also be assigned a corresponding team coding identifier. Although, in order to avoid exposing game information, the existing technology can generate random coding identifiers, but the logic of generating coding identifiers in the existing technology is easy to be cracked, making it easier for the outside world to obtain specific information about the game through the coding identifiers of players or game teams, which can easily cause security or performance problems. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, computer device and storage medium for generating numbers for game objects. The number of identification digits and sequential numbers of the random identification of the game objects generated by random identification as needed are used to determine the multi-level numbering intervals for hash mapping processing, so that random identification can be obtained, which can improve the security of the random identification and enhance the anti-attack capability of the game system.
[0005] The present application provides a method for generating game object numbers, the method comprising:
[0006] When it is detected that a game object in a target game needs to be processed for random identification generation, the number of identification digits of the random identification that needs to be generated for the game object and the sequence number generated by the game object in the target game according to a preset numbering sequence rule are obtained;
[0007] Determine the maximum interval range of the identifier value under the number of identifier digits;
[0008] Determine the multi-level number intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level number intervals is the number of identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range;
[0009] Based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, the sequential number is converted into the level number corresponding to each level;
[0010] Based on the numbering interval of each level, a reference value and a designated offset value corresponding to each level are obtained, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value obtained from each level;
[0011] For each level number, the level number is converted into a provisional conversion value for each level based on the reference value corresponding to each level, the specified offset value, and the maximum value of the number interval;
[0012] Based on the maximum value of the interval range of other levels below each level, the tentative conversion value of each level is converted into the mapped tentative conversion value of each level;
[0013] The tentative conversion values after mapping at each level are summed to obtain the target disorder mark.
[0014] Accordingly, the embodiment of the present application further provides a device for generating a number of a game object, the device for generating a number of a game object comprising:
[0015] A first acquisition unit is used to, when detecting that a game object in a target game needs to be processed for random sequence identification generation, acquire the number of identification digits of the random sequence identification that needs to be generated for the game object, and the sequence number generated by the game object in the target game according to a preset numbering sequence rule;
[0016] A first determining unit, used to determine a maximum interval range of the identifier value under the number of identifier digits;
[0017] A second determining unit is used to determine the multi-level numbering intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level numbering intervals is the number of the identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range;
[0018] A first conversion unit, configured to convert the sequence number into a level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level;
[0019] A second acquisition unit is used to acquire a reference value and a designated offset value corresponding to each level based on the number interval of each level, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value acquired from each level;
[0020] A second conversion unit, configured to convert the level number of each level into a tentative conversion value of each level based on the reference value corresponding to each level, the specified offset value and the maximum value of the numbering interval;
[0021] A third conversion unit, configured to convert the tentative conversion value of each level into a mapped tentative conversion value of each level based on the maximum value of the interval range of other levels below each level;
[0022] The processing unit is used to sum the mapped tentative conversion values of each level to obtain a target disorder mark.
[0023] In some embodiments, the number generating device of the game object includes:
[0024] The first processing subunit is used to convert the maximum interval range based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range and a preset reference value to obtain a converted maximum interval range.
[0025] In some embodiments, the number generating device of the game object includes:
[0026] A first acquisition subunit is used to acquire a difference between a value corresponding to a right endpoint of the maximum interval range and a left endpoint of the maximum interval range;
[0027] A generating subunit is used to generate a converted maximum interval range based on the difference value and the preset reference value, wherein the value corresponding to the right endpoint of the converted maximum interval range is the difference value, and the value corresponding to the left endpoint of the converted maximum interval range is the preset reference value.
[0028] In some embodiments, the number generating device of the game object includes:
[0029] A second processing subunit is used to perform multiplication decomposition processing on the difference based on a specified number of levels to obtain a maximum value of each level;
[0030] The first determining subunit is used to determine the numbering interval corresponding to each level based on a preset minimum value and a maximum value of each level.
[0031] In some embodiments, the number generating device of the game object includes:
[0032] A second acquisition subunit is used to acquire a first product of the maximum values of all the numbering intervals of the lower layers of the numbering interval of the current layer;
[0033] A third processing subunit is used to perform a remainder processing based on the product and the maximum value of the numbering interval of the current level to obtain a target remainder;
[0034] The third processing sub-unit is further used to round the sequence number based on the target remainder to obtain the level number corresponding to the current level.
[0035] In some embodiments, the number generating device of the game object includes:
[0036] A third acquisition subunit, configured to acquire a second product of a level number of a current level and a reference value of the current level;
[0037] A third acquisition subunit is further used to acquire a first sum value of the second product and a specified offset value of the current level;
[0038] The fourth processing sub-unit is used to perform modulo processing based on the first sum value and the maximum value of the numbering interval of the current level to obtain a provisional conversion value of the current level.
[0039] In some embodiments, the number generating device of the game object includes:
[0040] A fourth acquisition subunit, used to acquire a third product of the maximum values of the interval ranges of all other levels below the current level;
[0041] The fourth acquisition subunit is further used to acquire a fourth product between the third product and the provisional conversion value of the current level as the mapped provisional conversion value of the current level.
[0042] In some embodiments, the number generating device of the game object includes:
[0043] A second determining subunit is used to determine whether the value of the right endpoint of the maximum interval range after the conversion is a prime number;
[0044] The second determination subunit is also used for, if yes, selecting an intermediate value in the maximum interval range after the conversion, and determining a first numerical interval range and a second numerical interval range based on the difference, the preset reference value and the intermediate value, and determining the selected target interval range for generating a disordered identifier according to the size relationship between the sequence number and the intermediate value, wherein the leftmost value of the first numerical interval range is the preset reference value, the rightmost value of the first numerical interval range is the intermediate value, the leftmost value of the second numerical interval range is the intermediate value, and the rightmost value of the second numerical interval range is the difference.
[0045] Correspondingly, an embodiment of the present application also provides a computer device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements any step of a method for generating game object numbers when executed by the processor.
[0046] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any step of the method for generating game object numbers is implemented.
[0047] The embodiment of the present application provides a method, apparatus, computer device and storage medium for generating numbers of game objects. When it is detected that a game object in a target game needs to be processed for generating a random identifier, the method obtains the number of identification bits of the random identifier that needs to be generated for the game object, and the sequential number generated by the game object in the target game according to a preset numbering sequence rule; determines the maximum interval range of the identifier value under the number of identification bits; determines the multi-level numbering interval corresponding to the maximum interval range; based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, converts the sequential number into a level number corresponding to each level; based on the numbering interval of each level, obtains a reference value and a specified offset value corresponding to each level; for the level number of each level, converts it into a provisional conversion value of each level based on the reference value, the specified offset value and the maximum value of the numbering interval corresponding to each level; based on the maximum value of the interval range of other levels below each level, converts the provisional conversion value of each level into a mapped provisional conversion value of each level; sums the mapped provisional conversion values of each level to obtain a target random identifier. The embodiment of the present application obtains the number of identification bits and sequence numbers of the random identification of the game objects that need to generate random identification, and can improve the security of the random identification and enhance the anti-attack capability of the game system by performing hash mapping processing on the sequence numbers of the game objects that need to generate random identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 A schematic diagram of a scenario of a system for generating game object numbers provided in an embodiment of the present application.
[0050] Figure 2 A flowchart of a method for generating game object numbers provided in an embodiment of the present application.
[0051] Figure 3 A schematic diagram of the structure of a device for generating numbers for game objects provided in an embodiment of the present application.
[0052] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0054] The embodiment of the present application provides a method, device, computer equipment and storage medium for generating the number of game objects. Specifically, the method for generating the number of game objects in the embodiment of the present application can be performed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms.
[0055] For example, when the numbering method of the game object is run on a terminal, the terminal device stores a game application and is used to present a virtual scene in the game screen. The terminal device is used to interact with the user through a graphical user interface, for example, the game application is downloaded and installed by the terminal device and run. The terminal device may provide the graphical user interface to the user in a variety of ways, for example, it may be rendered and displayed on the display screen of the terminal device, or the graphical user interface may be presented by holographic projection. For example, the terminal device may include a touch display screen and a processor, the touch display screen is used to present a graphical user interface and receive an operation instruction generated by a user acting on the graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, respond to an operation instruction, and control the display of the graphical user interface on the touch display screen.
[0056] For example, when the numbering method of the game object is run on the server, it can be a cloud game. Cloud gaming refers to a gaming method based on cloud computing. In the operation mode of cloud gaming, the operating body of the game application and the game screen presentation body are separated, and the storage and operation of the numbering method of the game object are completed on the cloud gaming server. The game screen presentation is completed on the client of the cloud gaming. The cloud gaming client is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud gaming client can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, a personal digital assistant, etc., but the terminal device for processing game data is a cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send an operation instruction to the cloud gaming server. The cloud gaming server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the cloud gaming client through the network. Finally, the cloud gaming client decodes and outputs the game screen.
[0057] See also Figure 1 , Figure 1A scene diagram of a numbering system for a game object provided in an embodiment of the present application. The system may include at least one terminal, at least one server, at least one database, and a network. The terminal held by the user can be connected to the server of different games through the network. The terminal is any device with computing hardware that can support and execute software products corresponding to the game. In addition, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can be connected to each other through different networks and different servers. The network can be a wireless network or a wired network, such as a wireless network for a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different terminals can also use their own Bluetooth network or hotspot network to connect to other terminals or to servers, etc. For example, multiple users can be online through different terminals and connected and synchronized with each other through appropriate networks to support multi-player games. In addition, the system may include multiple databases, multiple databases are coupled to different servers, and information related to the game environment can be continuously stored in the database when different users are online for multi-player games.
[0058] The embodiment of the present application provides a method for generating the number of a game object, which can be executed by a terminal or a server. The embodiment of the present application is described by taking the method for generating the number of a game object executed by a terminal as an example. Wherein, the terminal may include a touch display screen and a processor (of course, the terminal may also use peripherals such as a mouse and a keyboard as input devices, and only the touch display screen is used as an example for description here), and the touch display screen is used to present a graphical user interface and receive the operation instructions generated by the user acting on the graphical user interface. When the user operates the graphical user interface through the touch display screen, the graphical user interface can control the content of the terminal local by responding to the received operation instructions, and can also control the content of the opposite server by responding to the received operation instructions. For example, the operation instructions generated by the user acting on the graphical user interface include instructions for starting a game application, and the processor is configured to start the game application after receiving the instruction for starting the game application provided by the user. In addition, the processor is configured to render and draw a graphical user interface associated with the game on the touch display screen. The touch display screen is a multi-touch sensitive screen that can sense the touch or sliding operations performed by multiple points on the screen at the same time. The user uses a finger to perform a touch operation on the graphical user interface, and when the graphical user interface detects the touch operation, the different virtual objects in the graphical user interface of the game are controlled to perform actions corresponding to the touch operation. For example, the game can be any of casual games, action games, role-playing games, strategy games, sports games, puzzle games, etc. Among them, the game may include a virtual scene of the game drawn on the graphical user interface. In addition, the virtual scene of the game may include one or more virtual objects controlled by the user (or player), such as virtual characters. In addition, the virtual scene of the game may also include one or more obstacles, such as railings, gullies, walls, etc., to limit the movement of virtual objects, for example, limiting the movement of one or more objects to a specific area within the virtual scene. Optionally, the virtual scene of the game also includes one or more elements, such as skills, scores, character health status, energy, etc., to provide help to the player, provide virtual services, increase the scores related to the player's performance, etc. In addition, the graphical user interface may also present one or more indicators to provide indication information to the player. For example, the game may include a virtual object controlled by the player and one or more other virtual objects (such as an enemy character). In one embodiment, one or more other virtual objects are controlled by other players of the game. For example, one or more other virtual objects may be controlled by a computer, such as a robot using an artificial intelligence (AI) algorithm, to achieve a human-machine battle mode. For example, a virtual object may have various skills or abilities that a game player may use to achieve a goal. For example, a virtual object may have one or more weapons, props, tools, etc. that may be used to eliminate other objects from the game. Such skills or abilities may be activated by a game player using one of a plurality of preset touch operations with a touch display screen of a terminal.The processor may be configured to present a corresponding game screen in response to an operation instruction generated by a user's touch operation.
[0059] It should be noted that Figure 1 The scenario diagram of the game object numbering system shown is merely an example. The game object numbering system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art will appreciate that, with the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0060] Based on the above problems, the embodiments of the present application provide a method, device, computer equipment and storage medium for generating numbers of game objects, which can improve the game interaction efficiency of players in the game. The following are detailed descriptions. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0061] See also Figure 2 , Figure 2 The following is a flow chart of a method for generating numbers of game objects provided in an embodiment of the present application. The specific flow of the method for generating numbers of game objects may be shown in steps 101 to 108 as follows:
[0062] 101. When it is detected that a game object in a target game needs to be processed for random identification generation, the number of identification digits of the random identification that needs to be generated for the game object and the sequential number generated by the game object in the target game according to a preset numbering sequence rule are obtained.
[0063] For example, when it is detected that a player in the target game is registering a game account, it is necessary to perform random identification generation processing on the player number, obtain the number of identification digits of the random identification that the player needs to generate, which is eight digits, and the sequence number generated by the player in the target game according to the preset numbering sequence rules, which can be X, that is, the sequence number of the player is determined according to the number of registered players when the player registers the game account. For example, when the number of registered players is 84562137, the sequence number of the player can be 84562138.
[0064] 102. Determine a maximum interval range of the identifier value under the number of identifier digits.
[0065] In order to simplify the processing data of out-of-order identifiers, after the step of "determining the maximum interval range of the identifier value under the number of identifier bits", the method may include:
[0066] The maximum interval range is converted based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain a converted maximum interval range.
[0067] Further, in order to determine the simplified interval range, the step of "converting the maximum interval range based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and the preset reference value to obtain the converted maximum interval range" may include:
[0068] Obtain the difference between the value corresponding to the right endpoint of the maximum interval range and the left endpoint of the maximum interval range;
[0069] A converted maximum interval range is generated based on the difference value and the preset reference value, wherein the value corresponding to the right endpoint of the converted maximum interval range is the difference value, and the value corresponding to the left endpoint of the converted maximum interval range is the preset reference value.
[0070] For example, when it is detected that a player in the target game is registering a game account, it is necessary to perform random identification generation processing on the player number to obtain the number of identification bits of the random identification that the player needs to generate. The number of identification bits is eight digits. According to the number of identification bits, the maximum interval range can be determined to be [10000000, 100000000), the maximum value within the maximum interval range is 100000000, and the minimum value within the maximum interval range is 100000000. At this time, the preset reference value is 0, and the difference between 100000000 and 10000000 can be obtained as 90000000, and the value corresponding to the left endpoint of the maximum interval range after the preset reference value is converted is used, and the difference is used as the value corresponding to the right endpoint of the converted maximum interval range, that is, the converted maximum interval range [0, 90000000) is obtained.
[0071] In a specific embodiment, after generating the maximum range of the converted interval based on the difference value and the preset reference value, the method further includes:
[0072] Determine whether the value of the right endpoint of the maximum interval range after the conversion is a prime number;
[0073] If so, select the middle value in the converted maximum interval range, and determine the first numerical interval range and the second numerical interval range based on the difference value, the preset reference value, and the middle value. Determine the target interval range to be selected according to the magnitude relationship between the sequence number and the middle value, and perform the generation process of disordered identification. Wherein, the leftmost value of the first numerical interval range is the preset reference value, the rightmost value of the first numerical interval range is the middle value, the leftmost value of the second numerical interval range is the middle value, and the rightmost value of the second numerical interval range is the difference value.
[0074] Optionally, in the embodiment of the present application, the difference between the value corresponding to the right endpoint of the maximum interval range and the left endpoint of the maximum interval range can be obtained. If the difference is a prime number or a number that is not easily decomposed into the product of multiple numbers, for example, the difference is 89999999, and 89999999 is a prime number, which naturally cannot be decomposed by multiplication. In this case, several numbers close to 89999999 can be found. For example, select three numbers 322, 144, and 568. The product of the above three numbers is 26337024. Therefore, when the sequence number x is less than 26337024, the above-mentioned multi-level bucket hashing mapping is used. When the sequence number x is in the range of [26337024, 89999999), it can be further decomposed into generating a disordered id in the range of [0, 63662975) + 26337024. A single pair (reference value (relatively prime to the difference), specified offset) can be simply selected to continue generating the disordered id, or multi-level bucketing can be used to further subdivide it. Further, the number 89999999 cannot be decomposed. 80000000 can be selected from it and 80000000 can be decomposed into three interval segments, which are 2000, 200, and 200 respectively. When the sequence number x <8000000>0, the above-mentioned bucket formula is used for calculation. The remaining part is [80000000, 89999999], corresponding to 8000000 + [0, 9999999]. Next, generate [0, 9999999] and add 8000000 to the result. A pair of (reference value (relatively prime to the difference), specified offset) can be selected again. For example, the reference value is selected as 4562797 here (satisfying that 4562797 and 9999999 are relatively prime to each other), and the specified offset is selected as 532325. When x >= 80000000, the corresponding id is ((x - 80000000) * 4562797 + 532325) % 9999999 + 80000000.
[0075] 103. Determine a plurality of level number intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level number intervals is the number of identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range.
[0076] In order to obtain multiple level number intervals, the step of "determining the multiple level number intervals corresponding to the maximum interval range" may include:
[0077] Performing multiplication decomposition processing on the difference based on a specified number of levels to obtain a maximum value at each level;
[0078] The numbering interval corresponding to each level is determined based on the preset minimum value and the maximum value of each level.
[0079] 104 , based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, convert the sequence number into a level number corresponding to each level.
[0080] In one embodiment, the step of “converting the sequence number into a level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level” may include:
[0081] Get the first product of the maximum values of all the number intervals of the lower layers of the number interval of the current layer;
[0082] Performing a remainder processing based on the product and the maximum value of the numbering interval of the current level to obtain a target remainder;
[0083] The sequence number is rounded based on the target remainder to obtain a level number corresponding to the current level.
[0084] 105. Obtain a reference value and a designated offset value corresponding to each level based on the numbering interval of each level, wherein the reference value of each level is a value that is coprime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value obtained from each level.
[0085] 106 , for each level number, convert it into a provisional conversion value of each level based on the reference value corresponding to each level, the specified offset value and the maximum value of the number interval.
[0086] Specifically, the step of “the level number of each level is converted into a provisional conversion value of each level based on the reference value corresponding to each level, the specified offset value and the maximum value of the numbering interval” may include:
[0087] Obtaining a second product of the level number of the current level and the reference value of the current level;
[0088] Obtaining a first sum of the second product and a specified offset value of the current level;
[0089] A modulo process is performed based on the first sum value and the maximum value of the numbering interval of the current level to obtain a provisional conversion value of the current level.
[0090] 107 , based on the maximum values of the interval ranges of other levels below each level, convert the provisional conversion value of each level into the mapped provisional conversion value of each level.
[0091] In the embodiment of the present application, the step of “converting the provisional conversion value of each level into the mapped provisional conversion value of each level based on the maximum value of the interval range of other levels below each level” may include:
[0092] Obtain the third product of the maximum values of the interval ranges of all other levels below the current level;
[0093] A fourth product between the third product and the provisional conversion value of the current level is obtained as the mapped provisional conversion value of the current level.
[0094] 108 , summing up the mapped provisional conversion values of each level to obtain a target disorder mark.
[0095] In order to further illustrate the method for generating game object numbers provided in the embodiment of the present application, the application of the method for generating game object numbers in a specific implementation scenario will be used as an example for illustration, and the specific application scenario is described as follows.
[0096] (1) When it is detected that a player in the target game is registering a game account, it is necessary to perform random identification generation processing on the player number to obtain the number of identification bits of the random identification that the player needs to generate. The number of identification bits is eight digits. According to the number of identification bits, the maximum interval range can be determined to be [10000000, 100000000), the maximum value in the maximum interval range is 100000000, and the minimum value in the maximum interval range is 100000000. At this time, the preset reference value is 0, and the difference between 100000000 and 10000000 can be obtained as 90000000, and the value corresponding to the left endpoint of the maximum interval range after the preset reference value is converted is used as the value corresponding to the right endpoint of the converted maximum interval range, that is, the converted maximum interval range is [0, 90000000). The sequential number generated by the player in the target game according to the preset numbering sequence rules is determined according to the number of players registered when the player registers the game account. For example, when the number of registered players is 12345452, the sequential number of the player can be 12345453.
[0097] (2) The embodiment of the present application can map the converted maximum interval range into a multi-level hash, each level corresponds to a hash range, that is, 90000000 is divided into three segments, and the maximum value of the first level number interval is 1000, the maximum value of the second level number interval is 900, and the maximum value of the third level number interval is 100. The number interval of the first level is [0, 1000], the number interval of the third level is [0, 900], and the number interval of the third level is [0, 100]. The reference value and the specified offset value corresponding to each level can be obtained. The reference value of the first level is 619, and the specified offset value of the first level is 535; the reference value of the second level is 557, and the specified offset value of the second level is 559. The reference value of the third level is 59, and the specified offset value of the third level is 13.
[0098] (3) Based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, the sequential number is converted into the level number corresponding to each level. Based on 12345453, the level number of the first level is 137, the level number of the second level is 154, and the level number of the third level is 53. For the level number of each level, the reference value corresponding to each level, the specified offset value and the maximum value of the numbering interval are converted into the provisional conversion value of each level. Specifically, the provisional conversion value of the first level is 338, the provisional conversion value of the second level is 337, and the provisional conversion value of the third level is 40. Based on the maximum value of the interval range of other levels below each level, the provisional conversion value of each level is converted into the mapped provisional conversion value of each level, and the mapped provisional conversion values of each level are summed to obtain the final value 30453740 as the target disorder mark.
[0099] The embodiment of the present application adopts a multi-level bucketing method, which can obtain the bucket subscript of the corresponding level by dividing the original value by the product of the range of the next few levels of buckets, and then perform a mapping under the bucket. After the mapping is completed, it is multiplied by the scores of the range of the next few levels of buckets and added up to obtain the final random id. The whole is divided into multiple levels to increase the difficulty of cracking. The embodiment of the present application adopts a multi-level bucketing method, which allows the high-level bucket to be responsible for calculating the high-order part of the number, while the low-level bucket calculates the low-order part of the number, with clear division of labor and high calculation efficiency.
[0100] Optionally, in order to make the numerical values of the game account more disordered, a traditional hash mapping may be applied to the result of the multi-level bucket hash mapping to increase the difficulty of cracking the game account.
[0101] Specifically, through multi-level digit splitting, the number is split into high and low bits, and traditional hash mapping is performed separately and assembled. The disordered number obtained by assembly is more difficult to be cracked and discovered due to more parameters. In addition, it also has local order, which can meet the requirements of similar IDs of players who enter the game at similar times in some games. For numbers that cannot be split by multiplication, branches are used for processing. Multi-level bucket hashing is performed for numbers less than the threshold, and further hashing is performed for numbers greater than the threshold. This branch can be branched, which further increases the difficulty of being cracked. For games that do not require local order, by connecting the traditional hash map with the multi-level bucket hash map in series, the multi-level bucket hash map is once again disordered, which further increases the difficulty of being cracked. This operation can be cascaded with multiple mappings, so additional metadata can be added through deeper series connection to increase the difficulty of being cracked.
[0102] In summary, the embodiment of the present application provides a method for generating numbers for game objects, which includes obtaining the number of identification digits of the random identification that needs to be generated for the game object and the sequential number generated by the game object according to a preset numbering sequence rule in the target game when it is detected that the game object in the target game needs to be processed for random identification generation; determining the maximum interval range of the identification value under the number of identification digits; determining the multi-level numbering interval corresponding to the maximum interval range; based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, converting the sequential number into the level number corresponding to each level; based on the numbering interval of each level, obtaining the reference value and the specified offset value corresponding to each level; for the level number of each level, converting it into a provisional conversion value of each level based on the reference value, the specified offset value and the maximum value of the numbering interval corresponding to each level; based on the maximum value of the interval range of other levels below each level, converting the provisional conversion value of each level into the mapped provisional conversion value of each level; summing the mapped provisional conversion values of each level to obtain the target random identification. The embodiment of the present application generates a random identification of a game object according to the number of identification digits and the sequential numbering as needed, thereby determining the multi-level numbering intervals for hash mapping processing, thereby obtaining a random identification, which can improve the security of the random identification and enhance the anti-attack capability of the game system.
[0103] In order to better implement the method for generating game object numbers provided in the embodiment of the present application, the embodiment of the present application also provides a device for generating game object numbers based on the above-mentioned game object numbers. The meanings of the terms are the same as those in the method for generating game object numbers, and the specific implementation details can refer to the description in the method embodiment.
[0104] See also Figure 3 , Figure 3A schematic diagram of a device for generating game object numbers according to an embodiment of the present application, the device comprising:
[0105] The first acquisition unit 201 is used to acquire the number of identification digits of the random identification that needs to be generated for the game object and the sequence number generated by the game object in the target game according to a preset numbering sequence rule when it is detected that the game object in the target game needs to be processed for random identification generation;
[0106] The first determining unit 202 is used to determine the maximum interval range of the identifier value under the number of identifier bits;
[0107] The second determining unit 203 is used to determine the multi-level numbering intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level numbering intervals is the number of the identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range;
[0108] A first conversion unit 204, configured to convert the sequence number into a level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level;
[0109] A second acquisition unit 205 is used to acquire a reference value and a designated offset value corresponding to each level based on the number interval of each level, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value obtained from each level;
[0110] A second conversion unit 206, configured to convert the level number of each level into a tentative conversion value of each level based on the reference value corresponding to each level, the specified offset value and the maximum value of the numbering interval;
[0111] A third conversion unit 207, configured to convert the tentative conversion value of each level into a mapped tentative conversion value of each level based on the maximum value of the interval range of other levels below each level;
[0112] The processing unit 208 is used to sum the mapped tentative conversion values of each level to obtain a target disorder mark.
[0113] In some embodiments, the number generating device of the game object includes:
[0114] The first processing subunit is used to convert the maximum interval range based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range and a preset reference value to obtain a converted maximum interval range.
[0115] In some embodiments, the number generating device of the game object includes:
[0116] A first acquisition subunit is used to acquire a difference between a value corresponding to a right endpoint of the maximum interval range and a left endpoint of the maximum interval range;
[0117] A generating subunit is used to generate a converted maximum interval range based on the difference value and the preset reference value, wherein the value corresponding to the right endpoint of the converted maximum interval range is the difference value, and the value corresponding to the left endpoint of the converted maximum interval range is the preset reference value.
[0118] In some embodiments, the number generating device of the game object includes:
[0119] A second processing subunit is used to perform multiplication decomposition processing on the difference based on a specified number of levels to obtain a maximum value of each level;
[0120] The first determining subunit is used to determine the numbering interval corresponding to each level based on a preset minimum value and a maximum value of each level.
[0121] In some embodiments, the number generating device of the game object includes:
[0122] A second acquisition subunit is used to acquire a first product of the maximum values of all the numbering intervals of the lower layers of the numbering interval of the current layer;
[0123] A third processing subunit is used to perform a remainder processing based on the product and the maximum value of the numbering interval of the current level to obtain a target remainder;
[0124] The third processing sub-unit is further used to round the sequence number based on the target remainder to obtain the level number corresponding to the current level.
[0125] In some embodiments, the number generating device of the game object includes:
[0126] A third acquisition subunit, configured to acquire a second product of a level number of a current level and a reference value of the current level;
[0127] A third acquisition subunit is further used to acquire a first sum value of the second product and a specified offset value of the current level;
[0128] The fourth processing sub-unit is used to perform modulo processing based on the first sum value and the maximum value of the numbering interval of the current level to obtain a provisional conversion value of the current level.
[0129] In some embodiments, the number generating device of the game object includes:
[0130] A fourth acquisition subunit, used to acquire a third product of the maximum values of the interval ranges of all other levels below the current level;
[0131] The fourth acquisition subunit is further used to acquire a fourth product between the third product and the provisional conversion value of the current level as the mapped provisional conversion value of the current level.
[0132] In some embodiments, the number generating device of the game object includes:
[0133] A second determining subunit is used to determine whether the value of the right endpoint of the maximum interval range after the conversion is a prime number;
[0134] The second determination subunit is also used for, if yes, selecting an intermediate value in the maximum interval range after the conversion, and determining a first numerical interval range and a second numerical interval range based on the difference, the preset reference value and the intermediate value, and determining the selected target interval range for generating a disordered identifier according to the size relationship between the sequence number and the intermediate value, wherein the leftmost value of the first numerical interval range is the preset reference value, the rightmost value of the first numerical interval range is the intermediate value, the leftmost value of the second numerical interval range is the intermediate value, and the rightmost value of the second numerical interval range is the difference.
[0135] The embodiment of the present application provides a device for generating numbers for game objects. When a first acquisition unit 201 detects that a game object in a target game needs to be processed for random identification generation, the device acquires the number of identification digits of the random identification that needs to be generated for the game object and the sequential number generated by the game object in the target game according to a preset numbering sequence rule. A first determination unit 202 determines the maximum interval range of the identification value under the number of identification digits. A second determination unit 203 determines the multi-level numbering interval corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the numbering intervals of each level is the number of identification digits and is not less than the value corresponding to the right end point of the maximum interval range. A first conversion unit 204 converts the sequential number into a number based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level. The level number corresponding to each level; the second acquisition unit 205 acquires the reference value and the specified offset value corresponding to each level based on the number interval of each level, wherein the reference value of each level is a value corresponding to the value of the right endpoint of each level in a mutually prime relationship, and the specified offset value of each level is a value obtained from each level; the second conversion unit 206 converts the level number of each level into a provisional conversion value of each level based on the reference value, the specified offset value and the maximum value of the number interval corresponding to each level; the third conversion unit 207 converts the provisional conversion value of each level into a mapped provisional conversion value of each level based on the maximum value of the interval range of other levels under each level; the processing unit 208 sums the mapped provisional conversion values of each level to obtain the target random identification. The embodiment of the present application determines the number of identification bits and the sequence number of the random identification of the game object generated by the random identification as needed, thereby determining the multi-level number interval for hash mapping processing, so that the random identification can be obtained, which can improve the security of the random identification and enhance the anti-attack ability of the game system.
[0136] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal or a server, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), or other terminal devices. Figure 4 As shown, Figure 4A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.
[0137] The processor 301 is the control center of the computer device 300. It uses various interfaces and lines to connect the various parts of the entire computer device 300, executes various functions of the computer device 300 and processes data by running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, thereby monitoring the computer device 300 as a whole.
[0138] In the embodiment of the present application, the processor 301 in the computer device 300 will load instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions:
[0139] When it is detected that a game object in a target game needs to be processed for random identification generation, the number of identification digits of the random identification that needs to be generated for the game object and the sequence number generated by the game object in the target game according to a preset numbering sequence rule are obtained;
[0140] Determine the maximum interval range of the identifier value under the number of identifier digits;
[0141] Determine the multi-level number intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level number intervals is the number of identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range;
[0142] Based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, the sequential number is converted into the level number corresponding to each level;
[0143] Based on the numbering interval of each level, a reference value and a designated offset value corresponding to each level are obtained, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value obtained from each level;
[0144] For each level number, the level number is converted into a provisional conversion value for each level based on the reference value corresponding to each level, the specified offset value, and the maximum value of the number interval;
[0145] Based on the maximum value of the interval range of other levels below each level, the tentative conversion value of each level is converted into the mapped tentative conversion value of each level;
[0146] The tentative conversion values after mapping at each level are summed to obtain the target disorder mark.
[0147] In one embodiment, after determining the maximum interval range of the identifier value under the number of identifier bits, the method further includes:
[0148] The maximum interval range is converted based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain a converted maximum interval range.
[0149] In one embodiment, the converting process of the maximum interval range based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain the converted maximum interval range includes:
[0150] Obtain the difference between the value corresponding to the right endpoint of the maximum interval range and the left endpoint of the maximum interval range;
[0151] A converted maximum interval range is generated based on the difference value and the preset reference value, wherein the value corresponding to the right endpoint of the converted maximum interval range is the difference value, and the value corresponding to the left endpoint of the converted maximum interval range is the preset reference value.
[0152] In one embodiment, determining the multi-level numbering interval corresponding to the maximum interval range includes:
[0153] Performing multiplication decomposition processing on the difference based on a specified number of levels to obtain a maximum value at each level;
[0154] The numbering interval corresponding to each level is determined based on the preset minimum value and the maximum value of each level.
[0155] In one embodiment, the converting of the sequence number into a level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level includes:
[0156] Get the first product of the maximum values of all the number intervals of the lower layers of the number interval of the current layer;
[0157] Performing a remainder processing based on the product and the maximum value of the numbering interval of the current level to obtain a target remainder;
[0158] The sequence number is rounded based on the target remainder to obtain a level number corresponding to the current level.
[0159] In one embodiment, the level number of each level is converted into a provisional conversion value of each level based on a reference value corresponding to each level, a specified offset value, and a maximum value of a numbering interval, including:
[0160] Obtaining a second product of the level number of the current level and the reference value of the current level;
[0161] Obtaining a first sum of the second product and a specified offset value of the current level;
[0162] A modulo process is performed based on the first sum value and the maximum value of the numbering interval of the current level to obtain a provisional conversion value of the current level.
[0163] In one embodiment, the converting of the provisional conversion value of each level into the mapped provisional conversion value of each level based on the maximum value of the interval range of other levels below each level includes:
[0164] Obtain the third product of the maximum values of the interval ranges of all other levels below the current level;
[0165] A fourth product between the third product and the provisional conversion value of the current level is obtained as the mapped provisional conversion value of the current level.
[0166] In one embodiment, after generating the converted maximum interval range based on the difference value and the preset reference value, the method further includes:
[0167] Determine whether the value of the right endpoint of the maximum interval range after the conversion is a prime number;
[0168] If so, then select an intermediate value in the maximum interval range after the conversion, and determine the first numerical interval range and the second numerical interval range based on the difference, the preset reference value and the intermediate value, and determine the selected target interval range for generating a disordered identifier according to the size relationship between the sequence number and the intermediate value, wherein the leftmost value of the first numerical interval range is the preset reference value, the rightmost value of the first numerical interval range is the intermediate value, the leftmost value of the second numerical interval range is the intermediate value, and the rightmost value of the second numerical interval range is the difference.
[0169] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0170] Optional, such as Figure 4 As shown, the computer device 300 further includes: a touch screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307, respectively. Those skilled in the art can understand that Figure 4 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0171] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-EmittingDiode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 301, and can receive the command sent by the processor 301 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to realize the input function.
[0172] In the embodiment of the present application, the processor 301 executes the game application to generate a graphical user interface on the touch screen 303. The touch screen 303 is used to present the graphical user interface and receive operation instructions generated by the user acting on the graphical user interface.
[0173] The radio frequency circuit 304 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0174] The audio circuit 305 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data, and then the audio data is output to the processor 301 for processing, and then sent to another computer device through the radio frequency circuit 304, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earphone jack to provide communication between an external headset and the computer device.
[0175] The input unit 306 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0176] The power supply 307 is used to supply power to various components of the computer device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 307 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0177] although Figure 4 Not shown, the computer device 300 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0178] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0179] As can be seen from the above, the computer device provided in this embodiment, when detecting that a game object in a target game needs to be processed for generating a random identifier, obtains the number of identification digits of the random identifier that needs to be generated for the game object, and the sequential number generated by the game object in the target game according to a preset numbering sequence rule; determines the maximum interval range of the identifier value under the number of identification digits; determines the multi-level numbering interval corresponding to the maximum interval range; based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, converts the sequential number into the level number corresponding to each level; based on the numbering interval of each level, obtains the reference value and the specified offset value corresponding to each level; for the level number of each level, converts it into a provisional conversion value of each level based on the reference value, the specified offset value and the maximum value of the numbering interval corresponding to each level; based on the maximum value of the interval range of other levels below each level, converts the provisional conversion value of each level into the mapped provisional conversion value of each level; sums the mapped provisional conversion values of each level to obtain the target random identifier. The embodiment of the present application generates a random identification of a game object according to the number of identification digits and the sequential numbering as needed, thereby determining the multi-level numbering intervals for hash mapping processing, thereby obtaining a random identification, which can improve the security of the random identification and enhance the anti-attack capability of the game system.
[0180] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0181] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any of the game object number generation methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0182] When it is detected that a game object in a target game needs to be processed for random identification generation, the number of identification digits of the random identification that needs to be generated for the game object and the sequence number generated by the game object in the target game according to a preset numbering sequence rule are obtained;
[0183] Determine the maximum interval range of the identifier value under the number of identifier digits;
[0184] Determine the multi-level number intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level number intervals is the number of identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range;
[0185] Based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, the sequential number is converted into the level number corresponding to each level;
[0186] Based on the numbering interval of each level, a reference value and a designated offset value corresponding to each level are obtained, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value obtained from each level;
[0187] For each level number, the level number is converted into a provisional conversion value for each level based on the reference value corresponding to each level, the specified offset value, and the maximum value of the number interval;
[0188] Based on the maximum value of the interval range of other levels below each level, the tentative conversion value of each level is converted into the mapped tentative conversion value of each level;
[0189] The tentative conversion values after mapping at each level are summed to obtain the target disorder mark.
[0190] In one embodiment, after determining the maximum interval range of the identifier value under the number of identifier bits, the method further includes:
[0191] The maximum interval range is converted based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain a converted maximum interval range.
[0192] In one embodiment, the converting process of the maximum interval range based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain the converted maximum interval range includes:
[0193] Obtain the difference between the value corresponding to the right endpoint of the maximum interval range and the left endpoint of the maximum interval range;
[0194] A converted maximum interval range is generated based on the difference value and the preset reference value, wherein the value corresponding to the right endpoint of the converted maximum interval range is the difference value, and the value corresponding to the left endpoint of the converted maximum interval range is the preset reference value.
[0195] In one embodiment, determining the multi-level numbering interval corresponding to the maximum interval range includes:
[0196] Performing multiplication decomposition processing on the difference based on a specified number of levels to obtain a maximum value at each level;
[0197] The numbering interval corresponding to each level is determined based on the preset minimum value and the maximum value of each level.
[0198] In one embodiment, the converting of the sequence number into a level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level includes:
[0199] Get the first product of the maximum values of all the number intervals of the lower layers of the number interval of the current layer;
[0200] Performing a remainder processing based on the product and the maximum value of the numbering interval of the current level to obtain a target remainder;
[0201] The sequence number is rounded based on the target remainder to obtain a level number corresponding to the current level.
[0202] In one embodiment, the level number of each level is converted into a provisional conversion value of each level based on a reference value corresponding to each level, a specified offset value, and a maximum value of a numbering interval, including:
[0203] Obtaining a second product of the level number of the current level and the reference value of the current level;
[0204] Obtaining a first sum of the second product and a specified offset value of the current level;
[0205] A modulo process is performed based on the first sum value and the maximum value of the numbering interval of the current level to obtain a provisional conversion value of the current level.
[0206] In one embodiment, the converting of the provisional conversion value of each level into the mapped provisional conversion value of each level based on the maximum value of the interval range of other levels below each level includes:
[0207] Obtain the third product of the maximum values of the interval ranges of all other levels below the current level;
[0208] A fourth product between the third product and the provisional conversion value of the current level is obtained as the mapped provisional conversion value of the current level.
[0209] In one embodiment, after generating the converted maximum interval range based on the difference value and the preset reference value, the method further includes:
[0210] Determine whether the value of the right endpoint of the maximum interval range after the conversion is a prime number;
[0211] If so, then select an intermediate value in the maximum interval range after the conversion, and determine the first numerical interval range and the second numerical interval range based on the difference, the preset reference value and the intermediate value, and determine the selected target interval range for generating a disordered identifier according to the size relationship between the sequence number and the intermediate value, wherein the leftmost value of the first numerical interval range is the preset reference value, the rightmost value of the first numerical interval range is the intermediate value, the leftmost value of the second numerical interval range is the intermediate value, and the rightmost value of the second numerical interval range is the difference.
[0212] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0213] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0214] Due to the computer program stored in the storage medium, when it is detected that a game object in a target game needs to be processed for generating a random identifier, the number of identification bits of the random identifier that needs to be generated for the game object and the sequential number generated by the game object in the target game according to a preset numbering sequence rule are obtained; the maximum interval range of the identifier value under the number of identification bits is determined; the multi-level numbering interval corresponding to the maximum interval range is determined; based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, the sequential number is converted into a level number corresponding to each level; based on the numbering interval of each level, a reference value and a specified offset value corresponding to each level are obtained; for the level number of each level, the reference value, the specified offset value and the maximum value of the numbering interval corresponding to each level are converted into a provisional conversion value of each level; based on the maximum value of the interval range of other levels below each level, the provisional conversion value of each level is converted into a mapped provisional conversion value of each level; the mapped provisional conversion values of each level are summed to obtain the target random identifier. The embodiment of the present application generates a random identification of a game object according to the number of identification digits and the sequential numbering as needed, thereby determining the multi-level numbering intervals for hash mapping processing, thereby obtaining a random identification, which can improve the security of the random identification and enhance the anti-attack capability of the game system.
[0215] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0216] The above is a detailed introduction to a method, device, computer equipment and storage medium for generating game object numbers provided in an embodiment of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the technical solution and its core idea of the present application. Ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents; and these modifications or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiments of the present application.
Claims
1. A method for generating numbers for game objects, characterized in that: include: When it is detected that a game object in a target game needs to be processed for random identification generation, the number of identification digits of the random identification that needs to be generated for the game object and the sequence number generated by the game object in the target game according to a preset numbering sequence rule are obtained; Determine the maximum interval range of the identifier value under the number of identifier digits; Determine the multi-level number intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level number intervals is the number of identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range; Based on the maximum value of the numbering interval of each level and the maximum value of the numbering interval of the lower level, the sequential number is converted into the level number corresponding to each level; Based on the numbering interval of each level, a reference value and a designated offset value corresponding to each level are obtained, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value obtained from each level; For each level number, the level number is converted into a provisional conversion value for each level based on the reference value corresponding to each level, the specified offset value, and the maximum value of the number interval; Based on the maximum value of the interval range of other levels below each level, the tentative conversion value of each level is converted into the mapped tentative conversion value of each level; The tentative conversion values after mapping at each level are summed to obtain the target disorder mark.
2. The method for generating game object numbers according to claim 1, characterized in that: After determining the maximum interval range of the identifier value under the number of identifier bits, the method further includes: The maximum interval range is converted based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain a converted maximum interval range.
3. The method for generating game object numbers according to claim 2, characterized in that: The converting process of the maximum interval range based on the value corresponding to the right endpoint of the maximum interval range, the value corresponding to the left endpoint of the maximum interval range, and a preset reference value to obtain the converted maximum interval range includes: Obtain the difference between the value corresponding to the right endpoint of the maximum interval range and the left endpoint of the maximum interval range; A converted maximum interval range is generated based on the difference value and the preset reference value, wherein the value corresponding to the right endpoint of the converted maximum interval range is the difference value, and the value corresponding to the left endpoint of the converted maximum interval range is the preset reference value.
4. The method for generating game object numbers according to claim 3, characterized in that: The determining of the multi-level numbering interval corresponding to the maximum interval range includes: Performing multiplication decomposition processing on the difference based on a specified number of levels to obtain a maximum value at each level; The numbering interval corresponding to each level is determined based on the preset minimum value and the maximum value of each level.
5. The method for generating game object numbers according to claim 1, characterized in that: The converting of the sequence number into the level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level includes: Get the first product of the maximum values of all the number intervals of the lower layers of the number interval of the current layer; Performing a remainder processing based on the product and the maximum value of the numbering interval of the current level to obtain a target remainder; The sequence number is rounded based on the target remainder to obtain a level number corresponding to the current level.
6. The method for generating game object numbers according to claim 1, characterized in that: The level number of each level is converted into a provisional conversion value of each level based on the reference value corresponding to each level, the specified offset value and the maximum value of the numbering interval, including: Obtaining a second product of the level number of the current level and the reference value of the current level; Obtaining a first sum of the second product and a specified offset value of the current level; A modulo process is performed based on the first sum value and the maximum value of the numbering interval of the current level to obtain a provisional conversion value of the current level.
7. The method for generating game object numbers according to claim 1, characterized in that: The converting of the provisional conversion value of each level into the mapped provisional conversion value of each level based on the maximum value of the interval range of other levels below each level includes: Get the third product of the maximum values of the interval ranges of all other levels below the current level; A fourth product between the third product and the provisional conversion value of the current level is obtained as the mapped provisional conversion value of the current level.
8. The method for generating game object numbers according to claim 3, characterized in that: After generating the converted maximum interval range based on the difference value and the preset reference value, the method further includes: Determine whether the value of the right endpoint of the maximum interval range after the conversion is a prime number; If so, then select an intermediate value in the maximum interval range after the conversion, and determine the first numerical interval range and the second numerical interval range based on the difference, the preset reference value and the intermediate value, and determine the selected target interval range for generating a disordered identifier according to the size relationship between the sequence number and the intermediate value, wherein the leftmost value of the first numerical interval range is the preset reference value, the rightmost value of the first numerical interval range is the intermediate value, the leftmost value of the second numerical interval range is the intermediate value, and the rightmost value of the second numerical interval range is the difference.
9. A device for generating numbers for game objects, characterized in that: include: A first acquisition unit is used to, when detecting that a game object in a target game needs to be processed for random sequence identification generation, acquire the number of identification digits of the random sequence identification that needs to be generated for the game object, and the sequence number generated by the game object in the target game according to a preset numbering sequence rule; A first determining unit, used to determine a maximum interval range of the identifier value under the number of identifier digits; A second determining unit is used to determine the multi-level numbering intervals corresponding to the maximum interval range, wherein the number of digits of the product of the maximum values of the level numbering intervals is the number of the identification digits and is not less than the value corresponding to the right endpoint of the maximum interval range; A first conversion unit, configured to convert the sequence number into a level number corresponding to each level based on the maximum value of the number interval of each level and the maximum value of the number interval of the lower level; A second acquisition unit is used to acquire a reference value and a designated offset value corresponding to each level based on the number interval of each level, wherein the reference value of each level is a value that is mutually prime with the value corresponding to the right endpoint of each level, and the designated offset value of each level is a value acquired from each level; A second conversion unit, configured to convert the level number of each level into a tentative conversion value of each level based on the reference value corresponding to each level, the specified offset value and the maximum value of the numbering interval; A third conversion unit, configured to convert the tentative conversion value of each level into a mapped tentative conversion value of each level based on the maximum value of the interval range of other levels below each level; The processing unit is used to sum the mapped tentative conversion values of each level to obtain a target disorder mark.
10. A computer device, characterized in that: The computer device includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the steps in the method for generating game object numbers as described in any one of claims 1 to 8 by calling the computer program stored in the memory.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the method for generating numbers of game objects as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Game creation method and device
CN112206531A
Information interaction method and device in game and electronic equipment
CN113457156A