Virtual dress-up number processing method, system and device and storage medium
By using pre-constructed ring graphics and random number algorithms in virtual dress number generation, querying the unused minimum number numbers, solving the problem of lack of randomness and inefficiency of numbers in the prior art, and achieving efficient and fair number allocation.
Patent Information
- Application Number
- CN202510154245.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-10
AI Technical Summary
The prior art lacks randomness in generating virtual dress numbers, resulting in allocation conflicts and inefficiency, and lack of fairness.
Through the pre-constructed ring graph, a random number is generated as a data anchor based on the random number algorithm, so as to query the minimum number that is greater than or equal to the data anchor and is not used, generate a virtual dress number, and mark its status as used.
The randomness, simplicity and uniqueness of virtual dress codes are realized, the efficiency and fairness of number allocation are improved, and the allocation conflicts are avoided.
Smart Images

Figure CN120124657A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a method, system, device and storage medium for processing a virtual costume number. Background Art
[0002] At present, in order to increase user participation, enhance the stickiness of top users, and associate user identities on Internet platforms, thereby improving user activity, virtual costumes are often distributed through sales, lotteries, task rewards, etc. For example, in game platforms, virtual costumes can be game character skin special effects and virtual game equipment; in live social platforms, virtual costumes can display special effects and user identity identification on personal homepages. For different virtual costumes, they need to be numbered with unique identifiers to help platforms and users manage, identify and track these virtual costumes. When generating virtual costume numbers, common methods include: 1. Based on the self-increment sequence generation method, an ordered virtual costume number can be generated by using the database self-increment function; 2. Generate a globally unique number based on the snowflake algorithm; 3. Generate a random number based on a random algorithm, check whether the generated number already exists, and if so, generate it repeatedly until it does not repeat.
[0003] However, the virtual costume numbers generated by the self-incrementing sequence generation method lack randomness. The snowflake algorithm generates a 64-bit integer, and the virtual costume numbers are relatively long and complex. The simple random number algorithm will have a high probability of repeated generation when the random number has been used too much, and its efficiency in generating random numbers will be significantly reduced.
[0004] In addition, the related virtual costume number allocation technology generally has the following problems:
[0005] Allocation conflict problem: When a large number of users request numbers at the same time, allocation conflicts may occur due to duplicate numbers, affecting user experience. For example, a simple linear allocation algorithm cannot respond quickly to high-concurrency scenarios.
[0006] Allocation efficiency issue: In related virtual costume number generation methods, number allocation is usually completed through sequential search or global scanning. When the number resources are close to exhaustion, the time complexity of finding unused numbers will increase significantly.
[0007] Lack of fairness: Some methods do not make full use of randomization technology, resulting in obvious regularity or tendency in number allocation, which is not conducive to fair management of virtual costumes. Summary of the invention
[0008] The embodiments of the present application provide a method, system, device and storage medium for processing virtual costume numbers, which can efficiently generate random and simple virtual costume numbers, significantly improve the efficiency of allocating virtual costume numbers, effectively avoid allocation conflicts, and achieve randomness and fairness in allocating virtual costume numbers. The technical problem of low efficiency in generating virtual costume numbers and lack of simplicity and uniqueness is solved.
[0009] In a first aspect, an embodiment of the present application provides a method for processing a virtual costume number, comprising:
[0010] In response to the virtual costume number request, a pre-built ring graphic is called, and the ring graphic is pre-configured with different digital numbers along the ring sequence in a fixed clockwise direction;
[0011] Generate a random number based on a random number algorithm, and select a corresponding digital number from the ring graphic as a data anchor point according to the random number;
[0012] Taking the data anchor point as the starting position, search along the ring of the ring graphic in a fixed clockwise direction for the smallest digital number that is greater than or equal to the data anchor point and is in an unused state, output the virtual costume number corresponding to the virtual costume number request based on the smallest digital number, and mark the status of the current smallest digital number as used.
[0013] In a second aspect, an embodiment of the present application provides a system for processing a virtual costume number, including:
[0014] A calling module is configured to call a pre-built circular graphic in response to a virtual costume number request, wherein the circular graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular sequence;
[0015] An anchor point module, configured to generate a random number based on a random number algorithm, and select a corresponding digital number from the ring graphic as a data anchor point according to the random number;
[0016] The output module is configured to use the data anchor point as the starting position, and to search for the smallest digital number that is greater than or equal to the data anchor point and is in an unused state along the ring of the ring graphic in a fixed clockwise direction, output the virtual costume number corresponding to the virtual costume number request based on the smallest digital number, and mark the status of the current smallest digital number as a used state.
[0017] In a third aspect, an embodiment of the present application provides a virtual costume number processing device, including:
[0018] memory and one or more processors;
[0019] The memory is configured to store one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing virtual costume numbers as described in the first aspect.
[0021] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, they are configured to execute the method for processing virtual costume numbers as described in the first aspect.
[0022] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the method for processing virtual costume numbers as described in the first aspect.
[0023] The embodiment of the present application responds to a virtual costume number request by calling a pre-constructed circular ring graphic, which is pre-configured with different digital numbers in a fixed clockwise direction along the circular ring sequence; generating a random number based on a random number algorithm, and selecting a corresponding digital number from the circular ring graphic as a data anchor point according to the random number; taking the data anchor point as the starting position, querying the smallest digital number that is greater than or equal to the data anchor point and is in an unused state along the circular ring of the circular ring graphic in a fixed clockwise direction, outputting the virtual costume number corresponding to the virtual costume number request based on the smallest digital number, and marking the status of the current smallest digital number as a used state. By adopting the above technical means, a data anchor point is randomly selected through a circular ring graphic, and then the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is queried according to the data anchor point, so as to efficiently generate a virtual costume number corresponding to the virtual costume number request based on the smallest digital number, so that the virtual costume number meets the requirements of randomness, simplicity and uniqueness, improves the efficiency of virtual costume number configuration, and optimizes the management effect of virtual costume.
[0024] In addition, the virtual costume number is marked with a status mark to identify the usage status, thus avoiding duplicate numbering and thus avoiding allocation conflicts. The virtual costume number is queried in the specified clockwise direction of the ring graphic based on random anchor points to avoid obvious regularity or tendency problems in number allocation, thereby ensuring the fairness of number allocation. At the same time, a random anchor point combined with a fixed clockwise query method is used on the ring graphic to achieve rapid number allocation and improve the efficiency of virtual costume number allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flowchart of a method for processing a virtual costume number provided in an embodiment of the present application;
[0026] Figure 2is a schematic diagram of random anchor point generation of a circular ring graphic in an embodiment of the present application;
[0027] Figure 3 This is one of the virtual costume number query schematic diagrams in the embodiment of the present application;
[0028] Figure 4 This is the second schematic diagram of virtual costume number query in the embodiment of the present application;
[0029] Figure 5 This is the third schematic diagram of virtual costume number query in the embodiment of the present application;
[0030] Figure 6 This is the fourth schematic diagram of virtual costume number query in the embodiment of the present application;
[0031] Figure 7 is a flow chart of generating a virtual costume number in an embodiment of the present application;
[0032] Figure 8 It is a structural diagram of a virtual costume number processing system provided in an embodiment of the present application;
[0033] Figure 9 It is a structural diagram of a virtual costume number processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0035] The processing method of virtual costume numbers provided in the present application aims to randomly select a data anchor point through a circular graphic, and then query the minimum digital number that is greater than or equal to the data anchor point and is in an unused state based on the data anchor point, so as to efficiently generate a virtual costume number corresponding to the virtual costume number request based on the minimum digital number, so that the virtual costume number meets the requirements of randomness, simplicity and uniqueness.
[0036] In order to increase user participation, enhance the stickiness of top users, associate user identities, and thus improve user activity on Internet platforms, virtual costumes are often distributed through sales, lotteries, task rewards, etc. For example, on game platforms, virtual costumes can be game character skin special effects and virtual game equipment; on live social platforms, virtual costumes can be displayed on personal homepages. Special effects, user identity identification, etc. are displayed. Different virtual costumes need to be numbered with unique identifiers to help platforms and users manage, identify, and track these virtual costumes. Therefore, virtual costume numbers need to be concise, unique, and random. Using a short random number as a number can meet these feature requirements.
[0037] Commonly used methods for generating virtual costume numbers are usually the following:
[0038] 1. Generate based on auto-increment sequence. This method usually requires the use of the database auto-increment function, and the generated numbers are in order. Since the generated numbers are in order, they are not random, and also expose the system's data scale and number generation rules, bringing risks to system security.
[0039] 2. Based on the snowflake algorithm. The snowflake algorithm is a distributed ID generation algorithm that can be used to generate a globally unique 64-bit integer. The length of a 64-bit integer is too large and not concise.
[0040] 3. Based on random number algorithm. Generate a random number and check whether the generated number already exists. If it exists, generate it repeatedly until it is not repeated. This method will increase the probability of random number duplication after the random number has been used for a long time, and the performance of generating random numbers will be significantly reduced.
[0041] Obviously, in order to facilitate the management, identification and tracking of virtual costumes, they need to be numbered when they are generated. However, the relevant virtual costume numbering methods cannot simultaneously meet the requirements of simplicity, uniqueness, randomness and high-efficiency generation.
[0042] In addition, with the widespread application of virtual costumes in online games, virtual social platforms and other fields, different users need to assign unique numbers to their selected virtual costumes for subsequent storage, identification and management. However, the related virtual costume number assignment technology generally has the following problems:
[0043] Allocation conflict problem: When a large number of users request numbers at the same time, allocation conflicts may occur due to duplicate numbers, affecting user experience. For example, a simple linear allocation algorithm cannot respond quickly to high-concurrency scenarios.
[0044] Allocation efficiency issue: In related virtual costume number generation methods, number allocation is usually completed through sequential search or global scanning. When the number resources are close to exhaustion, the time complexity of finding unused numbers will increase significantly.
[0045] Lack of fairness: Some methods do not make full use of randomization technology, resulting in obvious regularity or tendency in number allocation, which is not conducive to fair management of virtual costumes.
[0046] Based on this, a method for processing virtual costume numbers in an embodiment of the present application is provided to solve the technical problems of low efficiency, lack of simplicity and uniqueness in the generation of virtual costume numbers. Through this method, not only can the allocation efficiency of virtual costume numbers be significantly improved, but also allocation conflicts can be effectively avoided, and randomness and fairness in number allocation can be achieved.
[0047] Example:
[0048] Figure 1 A flowchart of a method for processing a virtual costume number provided in an embodiment of the present application is provided. The method for processing a virtual costume number provided in this embodiment can be executed by a processing device for a virtual costume number. The processing device for the virtual costume number can be implemented by software and / or hardware. The processing device for the virtual costume number can be composed of two or more physical entities or one physical entity. Generally speaking, the processing device for the virtual costume number can be a processing device such as a virtual costume server.
[0049] The following description is made by taking the virtual costume server as the main body of the processing method for executing the virtual costume number as an example. Figure 1 The method for processing the virtual costume number specifically includes:
[0050] S110 . In response to a virtual costume number request, a pre-constructed circular graphic is called, where the circular graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular sequence.
[0051] For example, when a user requests a new virtual costume in an application such as a game platform or a live social platform, the user's request is sent to the server through the client. Based on this request, the server triggers a virtual costume number request, which is sent to the corresponding virtual costume server for processing.
[0052] A donut graphic is pre-built inside the virtual costume server, and different digital numbers are configured along the circumference of the donut. These digital numbers are unique and arranged in a fixed clockwise direction (such as clockwise or counterclockwise). The design of the donut graphic can make the search and allocation of numbers intuitive and efficient.
[0053] ReferenceFigure 2 , the digital numbers 1-10 are arranged on the circular pattern in a clockwise direction, and the unique, concise and random digital number can be queried through the circular pattern later for the generation of the virtual costume number.
[0054] Optionally, before calling the pre-built donut graphic, also include:
[0055] Obtaining a digital numbering interval preconfigured based on the current virtual costume service, where the digital numbering interval is pre-divided according to a set numbering range and corresponds to virtual costume services in different service areas;
[0056] The digital numbers of the digital numbering interval are extracted one by one in sequence, and the digital numbers are arranged on the ring in a fixed clockwise direction along the ring sequence to generate a ring figure.
[0057] Before generating the circular graphic, first obtain the pre-configured digital number interval related to the current virtual costume service. The digital number interval is divided according to the set number range and for different service areas (such as different game servers, live broadcast platform partitions, etc.). Each service area has its own unique number interval to ensure the uniqueness and regional management of the number.
[0058] The virtual costume server will extract all the digital numbers from the acquired digital number range one by one in a preset order. The extracted digital numbers will be configured one by one on the ring in a fixed clockwise direction (clockwise or counterclockwise). This process ensures the order and continuity of the numbers on the ring, which facilitates the subsequent number search and allocation. After the configuration is completed, you can get a ring graphic containing all the pre-configured digital numbers. For example, assuming the digital number range is 1-10, the digital numbers are extracted one by one from 1 to 10 in order and configured clockwise at the corresponding positions of the ring graphic, so as to get the following Figure 2 The donut graphic shown.
[0059] Through the pre-configured digital numbering interval, the virtual costume server can flexibly adapt to the needs of different service areas, ensuring that the virtual costume numbers in each area are unique and orderly. And combining the numbering interval with the ring graphic can make the numbering management more intuitive and convenient.
[0060] Subsequently, based on the received virtual costume number request, the corresponding ring graphic can be called to query the virtual number. Since the numbers have been configured on the ring in a fixed order, the virtual costume server can quickly find available numbers when querying new numbers, thereby improving allocation efficiency.
[0061] S120, generating a random number based on a random number algorithm, and selecting a corresponding digital number from the circular graph as a data anchor point according to the random number.
[0062] Further, based on the donut graphic, a random number is first generated using a random number algorithm (such as a pseudo-random number generator). The random number is required to be generated in the digital number interval where the digital number of the donut graphic is located. The random number is used to determine the starting search position on the donut graphic, that is, the data anchor point. According to the generated random number, the server finds the corresponding digital number on the donut graphic as the data anchor point, that is, finds the starting position of the unused number.
[0063] Optionally, in order to improve the generation efficiency of virtual costume numbers, random numbers can be reused multiple times, and there is no need to randomly generate a random number each time a new virtual costume number is generated. At the same time, considering the time consumed in the subsequent query of unused digital numbers based on the data anchor point, for the data anchor point with a short time consumption for querying unused digital numbers (such as the time consumption is less than n, or the number of digital numbers traversed in sequence is less than N), the corresponding random number can be reused A times; on the contrary, for the data anchor point with a long time consumption for querying unused digital numbers (such as the time consumption is higher than n, or the number of digital numbers traversed in sequence is greater than N), the random number is discarded and a random number is generated again using the random number algorithm. This application does not impose fixed restrictions on the method of generating random numbers, and will not be elaborated here.
[0064] S130, taking the data anchor point as the starting position, search along the ring of the ring graphic in a fixed clockwise direction for the smallest digital number that is greater than or equal to the data anchor point and is in an unused state, output a virtual costume number corresponding to the virtual costume number request based on the smallest digital number, and mark the state identifier of the current smallest digital number as a used state.
[0065] Furthermore, starting from the data anchor point, the smallest digital number that is greater than or equal to the data anchor point and is currently unused is searched along the fixed clockwise direction of the ring. This step ensures that the digital number found is unique and as close to the data anchor point as possible, thereby maintaining the simplicity of the number and improving the efficiency of generating virtual costume numbers. Based on the smallest digital number found, it can be directly output as the virtual costume number. At the same time, the status flag of the number needs to be updated to the used state to prevent it from being allocated again in the future.
[0066] Optionally, in actual applications, the above randomly generated minimum digital number can be combined with corresponding information to generate the final virtual costume number. For example, the minimum digital number is combined with information such as user ID and service area number to generate the final virtual costume number.
[0067] Based on the above virtual costume number processing method, a virtual costume number with simplicity, uniqueness and randomness can be quickly generated when generating virtual costumes. It is only necessary to determine the number range in advance to quickly number the generated virtual costumes. And by dividing the number range and handing it over to different service units, the service throughput can be improved to ensure the user experience.
[0068] In addition, the virtual costume number is marked with a status mark to identify the usage status, thus avoiding duplicate numbering and thus avoiding allocation conflicts. The virtual costume number is queried in the specified clockwise direction of the ring graphic based on random anchor points to avoid obvious regularity or tendency problems in number allocation, thereby ensuring the fairness of number allocation. At the same time, a random anchor point combined with a fixed clockwise query method is used on the ring graphic to achieve rapid number allocation and improve the efficiency of virtual costume number allocation.
[0069] Specifically, the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is searched along the ring of the ring graphic in a fixed clockwise direction, including:
[0070] Create a joint index based on the digital number and status identifier, and set the index type of the joint index to a specified tree structure;
[0071] Based on the joint index and in a fixed clockwise direction, the donut graphic is queried along the donut to determine the smallest unused digital number that is greater than or equal to the data anchor point.
[0072] like Figure 2 As shown in the figure, to obtain the digital number between 1-10 for demonstration, first generate the digital number between 1-10 and arrange them in order on the ring. Then use the random number generation method to generate a random number between 1-10 as the data anchor point. Assuming that the data anchor point generated at this time is 3, start from 3 and find an unused number from the anchor point clockwise, and use this number as the result of this acquisition and mark it as used. Figure 3 As shown, assuming that digital number 3 is not used at this time, digital number 3 is first queried as the minimum digital number to generate the corresponding virtual costume number, and 3 is marked as used.
[0073] The virtual costume server will create a corresponding data table, which contains the fields is_used (whether it has been used, used to identify the usage status) and num (specific digital number), and create a joint index (is_used, num). The index type is selected as b+tree, and the random number to be used is initialized. B+tree is a self-balancing tree data structure used in database indexes and file systems, especially in scenarios that require efficient search, insertion, deletion and other operations. After generating a random number as a data anchor point based on a random number algorithm, the smallest unused digital number that is greater than or equal to the data anchor point can be found through the joint index (is_used, num), and the "is_used" of the corresponding row of the number is updated to be used, thereby completing the generation of the virtual costume number.
[0074] Further, refer to Figure 4 In the subsequent virtual costume number generation process, a random number is also generated based on the random number algorithm. Assuming that the random number is still 3 at this time, 3 is used as the data anchor point, and the smallest number that is greater than or equal to the data anchor point and is in an unused state is queried clockwise. Since the number 3 has been used, the smallest number found at this time is 4. Figure 5 As shown, the smallest digital number 4 that is greater than or equal to the data anchor point 3 and is in an unused state is used as the virtual costume number, and the digital number 4 is marked as being in a used state.
[0075] And so on, after n queries, refer to Figure 6 ,When the randomly generated data anchor point is 10 and 1 has been used, 2 is retrieved in sequence as the virtual costume number and 2 is marked as used.
[0076] In practical applications, in order to improve the system throughput, virtual numbers can be generated through distributed system design. Figure 7 , divide the random number into multiple intervals and send them to different dressing service units for processing. After receiving the virtual dressing request from the client, the server randomly forwards the virtual dressing number request to different dressing service units for processing. By implementing a distributed system with different virtual dressing service units and splitting random number intervals, the load capacity of the system can be improved.
[0077] Specifically, the client's virtual costume request can be sent to the corresponding server nearby, and the server will then send it to the corresponding virtual costume service unit for processing according to the random routing strategy. The random strategy is a random routing polling strategy, which is based on the load balancing algorithm and randomly distributes requests to a group of available servers or nodes to achieve load balancing and rational use of resources. After receiving the virtual costume number request, the corresponding virtual costume service unit executes the above virtual costume number generation method according to the digital number interval range managed by itself, and returns the corresponding virtual costume number to the client.
[0078] Optionally, after outputting the virtual costume number corresponding to the virtual costume number request based on the minimum digital number, the method further includes:
[0079] The virtual costume number is bound to a user identifier corresponding to the virtual costume number request to generate mapping information, and the mapping information is synchronized to the virtual costume service in the associated service area.
[0080] After outputting the virtual costume number, the virtual costume service needs to bind this number with the user ID (such as user ID, account name, etc.) who requested the number. The binding operation will generate a mapping information, which contains the user ID and the corresponding virtual costume number. Figure 7 As shown, the generated mapping information is synchronized to the virtual dress-up service in the associated service area through the local database to ensure that the virtual dress-up service can accurately identify and process each user's dress-up request, correctly display the user's virtual dress-up, and ensure data consistency.
[0081] After that, the user can obtain the resources used by the costume from the mapping information configured in the database. When giving away virtual costumes, check whether the user can give away the number based on the virtual costume number and user ID, change the user bound to the virtual costume to the recipient user, keep the virtual costume number unchanged, and write the costume data into the database, thus realizing the gift of virtual costumes.
[0082] Each virtual costume service unit processes the digital number range managed by it, so there will be no overlap, so there will be no conflict between service units, and data consistency is guaranteed. In addition, multiple service units can improve the throughput of the service. At the same time, through the two-way synchronization of the database, each service unit saves the full amount of data. When a single service unit fails, the digital number range it manages can be entrusted to other service units, thereby improving the disaster recovery capability of the service.
[0083] After generating the donut graphic, it also includes:
[0084] The state identification of each digital number on the circular ring graphic is detected, and when it is determined based on the detection result that the circular ring graphic is in a set state, the number of digital numbers of the circular ring graphic is expanded.
[0085] It is understandable that, since the random numbers available on the donut graphic are limited, if the currently initialized random numbers are about to run out, the number of digital numbers of the donut graphic can be expanded to avoid a long time spent on obtaining the virtual costume numbers.
[0086] Among them, by checking the status identifier of each digital number on the circular ring graphic (i.e. "used" or "unused"). By traversing all the numbers on the ring and reading their status information. If the detection result meets the judgment condition (i.e. the circular ring graphic is in the set state, and the number of digital numbers that have been used is large), it is necessary to expand the number of digital numbers of the circular ring graphic. At this time, the number of digital numbers of the circular ring graphic is expanded by adding a new numbering interval, reallocating the numbering range, etc. Based on the updated digital numbering interval range, referring to the above-mentioned construction method of the circular ring graphic, a new circular ring graphic can be reconstructed.
[0087] Optionally, determining that the circular ring graphic is in a set state based on the detection result includes:
[0088] When it is determined based on the detection result that the proportion of digital numbers in the status identification as being in the used state reaches a set proportion threshold, it is determined that the circular ring graphic is in the set state.
[0089] By calculating the proportion of digital numbers with a status mark of "used" on the circular graphic. Compare the calculated proportion with the preset set ratio threshold. The set ratio threshold is determined according to actual business needs and system design, and is used to determine when the number of digital numbers in the circular graphic needs to be expanded. If the proportion of used numbers reaches or exceeds the set ratio threshold, the system determines that the circular graphic is in a set state, that is, expansion measures need to be taken. Optionally, the set state can also be that the generation time of the virtual costume number reaches a set time, the number of used virtual costume numbers reaches a set number, etc. This application does not impose fixed restrictions on the specific set state, which will not be elaborated here.
[0090] Furthermore, the number of numbers of the donut graphics is expanded to include:
[0091] Get the update number interval, extend the number interval based on the update number interval, and update the donut graphic based on the extended number interval.
[0092] When the number of digital numbers of the donut graphic needs to be expanded, the update number interval is obtained. The update number interval is a new number range, based on the merge of the update number interval and the existing number interval, to obtain the expanded number interval. Then, referring to the construction method of the donut graphic, the donut graphic is constructed using the expanded number interval.
[0093] For example, refer to Figure 2 When the number of used numbers in the circular ring is detected to be large, the digital number interval of 11-20 can be increased, and the digital number interval range 1-10 can be changed to 1-20. Through the above circular ring construction process, the range of digital number intervals in any range can be expanded, thereby avoiding the time-consuming search for unused random numbers and improving the efficiency of virtual costume number generation.
[0094] In the above, by responding to the virtual costume number request, a pre-constructed circular ring graphic is called, and the circular ring graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular ring sequence; a random number is generated based on a random number algorithm, and a corresponding digital number is selected from the circular ring graphic as a data anchor point according to the random number; with the data anchor point as the starting position, the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is queried along the circular ring of the circular ring graphic in a fixed clockwise direction, and the virtual costume number corresponding to the virtual costume number request is output based on the smallest digital number, and the status identifier of the current smallest digital number is marked as a used state. By adopting the above technical means, a data anchor point is randomly selected through a circular ring graphic, and then the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is queried according to the data anchor point, so as to efficiently generate a virtual costume number corresponding to the virtual costume number request based on the smallest digital number, so that the virtual costume number meets the requirements of randomness, simplicity and uniqueness, improves the efficiency of virtual costume number configuration, and optimizes the management effect of virtual costume.
[0095] Based on the above embodiments, Figure 8 This is a schematic diagram of the structure of a virtual costume number processing system provided by this application. Figure 8 The processing system of the virtual costume number provided in this embodiment specifically includes: a calling module 21, an anchor module 22 and an output module 23.
[0096] The calling module 21 is configured to call a pre-built circular graphic in response to a virtual costume number request, and the circular graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular sequence;
[0097] The anchor point module 22 is configured to generate a random number based on a random number algorithm, and select a corresponding digital number from the ring graphic as a data anchor point according to the random number;
[0098] The output module 23 is configured to use the data anchor point as the starting position, and to search along the ring of the circular graphic in a fixed clockwise direction for the smallest digital number that is greater than or equal to the data anchor point and is in an unused state, output the virtual costume number corresponding to the virtual costume number request based on the smallest digital number, and mark the status of the current smallest digital number as being in a used state.
[0099] Specifically, before calling the pre-built donut graphic, it also includes:
[0100] Obtaining a digital numbering interval preconfigured based on the current virtual costume service, where the digital numbering interval is pre-divided according to a set numbering range and corresponds to virtual costume services in different service areas;
[0101] The digital numbers of the digital numbering interval are extracted one by one in sequence, and the digital numbers are arranged on the ring in a fixed clockwise direction along the ring sequence to generate a ring figure.
[0102] Specifically, the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is searched along the ring of the ring graphic in a fixed clockwise direction, including:
[0103] Create a joint index based on the digital number and status identifier, and set the index type of the joint index to a specified tree structure;
[0104] Based on the joint index and in a fixed clockwise direction, the donut graphic is queried along the donut to determine the smallest unused digital number that is greater than or equal to the data anchor point.
[0105] After outputting the virtual costume number corresponding to the virtual costume number request based on the minimum digital number, the method further includes:
[0106] The virtual costume number is bound to a user identifier corresponding to the virtual costume number request to generate mapping information, and the mapping information is synchronized to the virtual costume service in the associated service area.
[0107] Specifically, after generating the donut graphic, the following steps are also included:
[0108] The state identification of each digital number on the circular ring graphic is detected, and when it is determined based on the detection result that the circular ring graphic is in a set state, the number of digital numbers of the circular ring graphic is expanded.
[0109] The circular ring graphic is determined to be in a set state based on the detection result, including:
[0110] When it is determined based on the detection result that the proportion of digital numbers in the status identification as being in the used state reaches a set proportion threshold, it is determined that the circular ring graphic is in the set state.
[0111] Expand the number of donut graphics, including:
[0112] Get the update number interval, extend the number interval based on the update number interval, and update the donut graphic based on the extended number interval.
[0113] In the above, by responding to the virtual costume number request, a pre-constructed circular ring graphic is called, and the circular ring graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular ring sequence; a random number is generated based on a random number algorithm, and a corresponding digital number is selected from the circular ring graphic as a data anchor point according to the random number; with the data anchor point as the starting position, the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is queried along the circular ring of the circular ring graphic in a fixed clockwise direction, and the virtual costume number corresponding to the virtual costume number request is output based on the smallest digital number, and the status identifier of the current smallest digital number is marked as a used state. By adopting the above technical means, a data anchor point is randomly selected through a circular ring graphic, and then the smallest digital number that is greater than or equal to the data anchor point and is in an unused state is queried according to the data anchor point, so as to efficiently generate a virtual costume number corresponding to the virtual costume number request based on the smallest digital number, so that the virtual costume number meets the requirements of randomness, simplicity and uniqueness, improves the efficiency of virtual costume number configuration, and optimizes the management effect of virtual costume.
[0114] In addition, the virtual costume number is marked with a status mark to identify the usage status, thus avoiding duplicate numbering and thus avoiding allocation conflicts. The virtual costume number is queried in the specified clockwise direction of the ring graphic based on random anchor points to avoid obvious regularity or tendency problems in number allocation, thereby ensuring the fairness of number allocation. At the same time, a random anchor point combined with a fixed clockwise query method is used on the ring graphic to achieve rapid number allocation and improve the efficiency of virtual costume number allocation.
[0115] The processing system for virtual costume numbers provided in the embodiments of the present application can be configured to execute the processing method for virtual costume numbers provided in the above embodiments, and has corresponding functions and beneficial effects.
[0116] Based on the above practical example, the present application embodiment also provides a virtual costume number processing device, referring to Figure 9, the processing device of the virtual dress number includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The memory, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the processing method of the virtual dress number described in any embodiment of the present application (for example, a calling module, an anchor module and an output module in the processing system of the virtual dress number). The communication module is configured to perform data transmission. The processor executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, realizes the above-mentioned processing method of the virtual dress number. The input device can be configured to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device may include a display device such as a display screen. The processing device of the virtual dress number provided above can be configured to execute the processing method of the virtual dress number provided in the above-mentioned embodiment, and has corresponding functions and beneficial effects.
[0117] On the basis of the above-mentioned embodiments, the embodiments of the present application further provide a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are configured to execute a method for processing a virtual costume number when executed by a computer processor, and the storage medium may be any of various types of memory devices or storage devices. Of course, the non-volatile computer-readable storage medium provided in the embodiments of the present application, whose computer-executable instructions are not limited to the method for processing a virtual costume number as described above, may also execute related operations in the method for processing a virtual costume number provided in any embodiment of the present application.
[0118] On the basis of the above embodiments, the embodiments of the present application also provide a computer program product. The essence of the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium, including a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the method for processing virtual costume numbers described in each embodiment of the present application.
Claims
1. A method for processing a virtual costume number, characterized in that: include: In response to the virtual costume number request, a pre-built circular graphic is called, wherein the circular graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular sequence; Generate a random number based on a random number algorithm, and select a corresponding digital number from the circular graphic as a data anchor point according to the random number; Taking the data anchor point as the starting position, query along the ring of the circular ring graphic in a fixed clockwise direction for the smallest digital number that is greater than or equal to the data anchor point and is in an unused state, output a virtual costume number corresponding to the virtual costume number request based on the smallest digital number, and mark the current state of the smallest digital number as being in a used state.
2. The method for processing virtual costume numbers according to claim 1, characterized in that: Before calling the pre-built donut graphic, it also includes: Obtaining a digital numbering interval preconfigured based on the current virtual costume service, wherein the digital numbering interval is pre-divided according to a set numbering range and corresponds to virtual costume services in different service areas; The digital numbers of the digital numbering interval are extracted one by one in sequence, and the digital numbers are arranged on a ring along a ring in a fixed clockwise direction to generate the ring graphic.
3. The method for processing virtual costume numbers according to claim 2, characterized in that: After generating the circular ring graphic, the method further includes: The state identifiers of the digital numbers on the circular ring graphic are detected, and when it is determined based on the detection result that the circular ring graphic is in a set state, the number of digital numbers of the circular ring graphic is expanded.
4. The method for processing virtual costume numbers according to claim 3, characterized in that: The number of digital numbers of the expanded circular graphic includes: An updated numbering interval is obtained, the digital numbering interval is extended based on the updated numbering interval, and the circular ring graphic is updated based on the extended digital numbering interval.
5. The method for processing virtual costume numbers according to claim 3, characterized in that: The determining, based on the detection result, that the annular graphic is in a set state comprises: When it is determined based on the detection result that the ratio of digital numbers in the status identification that are in the used state reaches a set ratio threshold, it is determined that the circular ring graphic is in a set state.
6. The method for processing virtual costume numbers according to any one of claims 1 to 5, characterized in that: The querying along the ring of the ring graphic in a fixed clockwise direction for the smallest digital number that is greater than or equal to the data anchor point and is in an unused state includes: Establishing a joint index based on the digital number and the state identifier, and setting the index type of the joint index to a specified tree structure; Based on the joint index and in a fixed clockwise direction, the circular ring graphic is queried along the circular ring to determine the smallest digital number that is greater than or equal to the data anchor point and is in an unused state.
7. The method for processing virtual costume numbers according to any one of claims 1 to 5, characterized in that: After outputting the virtual costume number corresponding to the virtual costume number request based on the minimum digital number, the method further includes: The virtual costume number is bound to a user identifier corresponding to the virtual costume number request to generate mapping information, and the mapping information is synchronized to the virtual costume service in the associated service area.
8. A system for processing virtual costume numbers, characterized in that: include: A calling module is configured to call a pre-built circular graphic in response to a virtual costume number request, wherein the circular graphic is pre-configured with different digital numbers in a fixed clockwise direction along the circular sequence; An anchor point module, configured to generate a random number based on a random number algorithm, and select a corresponding digital number from the circular ring graphic as a data anchor point according to the random number; The output module is configured to use the data anchor point as a starting position, and to search along the ring of the circular ring graphic in a fixed clockwise direction for a minimum digital number that is greater than or equal to the data anchor point and is in an unused state, output a virtual costume number corresponding to the virtual costume number request based on the minimum digital number, and mark the current state of the minimum digital number as a used state.
9. A device for processing virtual costume numbers, characterized in that: include: memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing virtual costume numbers as described in any one of claims 1-7.
10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, they are configured to execute the method for processing virtual costume numbers according to any one of claims 1-7.
11. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the method for processing a virtual costume number as described in any one of claims 1 to 7.