Identification code generation method and device, server and storage medium
By generating out-of-order identifiers using auto-incrementing variables, the problem of insufficient uniqueness and confidentiality of identifiers in existing technologies is solved, achieving efficient generation and display of identifiers and improving user experience.
Patent Information
- Application Number
- CN202210667242.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-06-13
AI Technical Summary
Existing technologies cannot generate unique, out-of-order, and confidential identifiers simultaneously, which affects user experience and personal information security.
The target identifier code is generated by generating a first numerical sequence based on an incrementing variable, then scrambling the sequence to generate a second numerical sequence, and finally compressing the sequence to achieve the desired length.
Ensure the uniqueness and random order of the identification code, reduce the length of the identification code, improve the display effect on the user terminal, and enhance the user experience.
Smart Images

Figure CN115186785B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, server and storage medium for generating identification codes. Background Technology
[0002] With the continuous development of technology, various online activities have emerged. Among them, the most common type is the online identification code selection activity. This activity involves the event organizer distributing multiple identification codes online. Among these codes are codes designated by the organizer for users to redeem resources (virtual currency, online red envelopes, physical products, etc.). Each user can select one or more identification codes from the distributed codes. When a user selects the code corresponding to their redeemed resource, they can redeem that resource using that code. The more identification codes a user obtains, the higher their probability of redeeming a resource.
[0003] To ensure a good user experience, identification codes often have certain requirements. For example, the code length should not be too long, as the display area on a user's mobile device is limited; shorter codes are easier to display on a mobile screen. Identification codes must be unique, as duplicate codes can cause problems for subsequent code redemption. They must be confidential, as preventing others from deducing information such as the number of participants, their gender, and age from the code effectively protects their personal information. Furthermore, the code should be randomized, as a more scrambled string indicates a closer probability of each participant obtaining the code needed to redeem resources, leading to higher user engagement. However, current technologies lack a method for generating identification codes that simultaneously possess all of these characteristics. Summary of the Invention
[0004] This disclosure provides a method, apparatus, server, and storage medium for generating identification codes. These methods ensure the uniqueness of identification codes corresponding to different generation requests, guaranteeing that the final generated target identification code has no fixed pattern, possesses random ordering and confidentiality, and reduces the length of the final generated identification code, making it easier to display on user terminals and improving user experience. The technical solution of this disclosure is as follows:
[0005] According to a first aspect of the present disclosure, an identifier generation method is provided, comprising:
[0006] Receive user account identifier code generation request;
[0007] Based on the set auto-incrementing variable, a first numerical sequence identifier code corresponding to the identifier code generation request is generated;
[0008] The first numerical sequence is shuffled to generate a second numerical sequence;
[0009] The second numerical sequence is compressed to generate a target identifier code corresponding to the identifier code generation request.
[0010] In some embodiments, the method further includes:
[0011] Receive an activity participation request triggered by the user account, which includes the target identifier code;
[0012] If the target identifier code meets the selection conditions corresponding to the activity participation request, then the target identifier code is displayed on the interface;
[0013] The virtual object corresponding to the selected condition is sent to the user account corresponding to the target identifier.
[0014] In some embodiments, the step of scrambling the first numerical sequence to generate a second numerical sequence includes:
[0015] Obtain the total number of identifiers that can be generated and the set prime numbers;
[0016] Determine the product of the first numerical sequence and the prime number;
[0017] The remainder of the product and the total number of identifier codes is determined and used as the second numerical sequence.
[0018] In some embodiments, the prime number is not divisible by the total number of identifier codes.
[0019] In some embodiments, the length compression process performed on the second numerical sequence to generate a target identifier code corresponding to the identifier code generation request includes:
[0020] The second numerical sequence is converted to a set number base to obtain the converted string;
[0021] If the length of the string is the same as the preset identifier code length, then the string is determined as the target identifier code corresponding to the identifier code generation request.
[0022] In some embodiments, the method further includes:
[0023] If the length of the string is less than the length of the identifier code, then the string obtained by adding a preset character of the difference length to the string is determined as the target identifier code corresponding to the identifier code generation request, wherein the difference length is the difference between the length of the identifier code and the length of the string.
[0024] In some embodiments, the total number of identification codes is less than or equal to the power of N of the number base, where N is the length of the identification code.
[0025] According to a second aspect of the present disclosure, an identification code generation apparatus is provided, comprising:
[0026] The receiving unit is configured to execute a request to generate an identifier code for a user account.
[0027] The first generation unit is configured to generate a first numerical sequence identifier code corresponding to the identifier code generation request by executing an auto-incrementing variable based on a set setting.
[0028] The second generation unit is configured to perform scrambling on the first numerical sequence to generate a second numerical sequence;
[0029] The third generation unit is configured to perform length compression processing on the second numerical sequence to generate a target identifier code corresponding to the identifier code generation request.
[0030] In some embodiments, the apparatus further includes:
[0031] The first unit is configured to execute an activity participation request containing the target identifier code triggered by the user account;
[0032] The second unit is configured to display the target identifier on the interface if the target identifier meets the selection condition corresponding to the activity participation request.
[0033] The third unit is configured to send the virtual object corresponding to the selected condition to the user account corresponding to the target identifier.
[0034] In some embodiments, the second generation unit is further configured to perform:
[0035] Obtain the total number of identifiers that can be generated and the set prime numbers;
[0036] Determine the product of the first numerical sequence and the prime number;
[0037] The remainder of the product and the total number of identifier codes is determined and used as the second numerical sequence.
[0038] In some embodiments, the prime number is not divisible by the total number of identifier codes.
[0039] In some embodiments, the third generation unit is further configured to perform:
[0040] The second numerical sequence is converted to a set number base to obtain the converted string;
[0041] If the length of the string is the same as the preset identifier code length, then the string is determined as the target identifier code corresponding to the identifier code generation request.
[0042] In some embodiments, the apparatus is further configured to perform:
[0043] If the length of the string is less than the length of the identifier code, then the string obtained by adding a preset character of the difference length to the string is determined as the target identifier code corresponding to the identifier code generation request, wherein the difference length is the difference between the length of the identifier code and the length of the string.
[0044] In some embodiments, the total number of identification codes is less than or equal to the power of N of the number base, where N is the length of the identification code.
[0045] According to a third aspect of the present disclosure, a server is provided, comprising:
[0046] processor;
[0047] Memory used to store the processor's executable instructions;
[0048] The processor is configured to execute the instructions to implement the above-described identifier generation method.
[0049] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which, when the instructions in the computer-readable storage medium are executed by a processor of a server, enables the server to perform the above-described identifier generation method.
[0050] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described identifier generation method.
[0051] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0052] Upon receiving a user account identifier generation request, this embodiment generates a first numerical sequence identifier corresponding to the identifier generation request based on a pre-defined auto-incrementing variable, ensuring the uniqueness of identifiers corresponding to different identifier generation requests. By scrambling the first numerical sequence to generate a second numerical sequence, it ensures that the final target identifier has no fixed pattern, possessing both randomness and confidentiality. By compressing the length of the second numerical sequence to generate the target identifier corresponding to the identifier generation request, the length of the final identifier is reduced, making it easier to display on the user terminal and improving the user experience. Furthermore, the identifier generation method provided in this disclosure performs each step independently, without using additional storage space, resulting in low time and space complexity.
[0053] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0054] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0055] Figure 1 This is a flowchart illustrating an identifier generation method according to an exemplary embodiment;
[0056] Figure 2 This is yet another flowchart illustrating an identifier generation method according to an exemplary embodiment;
[0057] Figure 3 This is a flowchart illustrating a method for generating a second numerical sequence according to an exemplary embodiment;
[0058] Figure 4 This is a block diagram illustrating an identification code generation apparatus according to an exemplary embodiment;
[0059] Figure 5 This is a block diagram illustrating a server according to an exemplary embodiment. Detailed Implementation
[0060] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0061] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0062] With the continuous development of technology, various online activities have emerged. Among them, the most common type is the online identification code selection activity. This activity involves the event organizer distributing multiple identification codes online. Among these codes are codes designated by the organizer for users to redeem resources (virtual currency, online red envelopes, physical products, etc.). Each user can select one or more identification codes from the distributed codes. When a user selects the code corresponding to their redeemed resource, they can redeem that resource using that code. The more identification codes a user obtains, the higher their probability of redeeming a resource. To ensure a good user experience, identification codes often have certain requirements. For example, the code length should not be too long, as the display area on a user's mobile device is limited; shorter codes are easier to display on a mobile screen. Identification codes must be unique, as duplicate codes can cause problems for subsequent redemption. They must be confidential, as preventing others from deducing information such as the number of participants, their gender, and age from the code effectively protects their personal information. Furthermore, the code should be randomized, as a more scrambled string indicates a closer probability of each participant obtaining the code needed to redeem resources, leading to higher user engagement. However, currently, there is no method to generate identification codes that simultaneously possess all of these characteristics.
[0063] In view of this, embodiments of this disclosure provide an identifier code generation method. Upon receiving an identifier code generation request from a user account, a first numerical sequence identifier code corresponding to the identifier code generation request is generated based on a set auto-incrementing variable, ensuring the uniqueness of identifier codes corresponding to different identifier code generation requests. By scrambling the first numerical sequence to generate a second numerical sequence, it is ensured that the final target identifier code has no fixed pattern, possessing both randomness and confidentiality. By compressing the length of the second numerical sequence to generate the target identifier code corresponding to the identifier code generation request, the length of the final identifier code is reduced, making it easier to display on the user terminal and improving the user experience. Furthermore, the identifier code generation method provided in this disclosure performs each step independently, without using additional storage space, resulting in low time and space complexity.
[0064] Figure 1 This is a flowchart illustrating an exemplary embodiment of a method for generating an identifier, which can be executed by a server. Figure 1 As shown, the method includes the following steps:
[0065] In step S11, a request to generate an identifier code for a user account is received.
[0066] In this embodiment of the disclosure, a user account can request the generation of an identification code based on its own actual situation. The identification code can be applied to identification code selection activities in different scenarios.
[0067] like Figure 2 As shown, the method provided in this disclosure embodiment further includes the following steps:
[0068] In step S111, an activity participation request containing a target identifier code triggered by a user account is received.
[0069] In step S112, if the target identifier code meets the selection conditions corresponding to the activity participation request, the target identifier code is displayed on the interface.
[0070] In step S113, the virtual object corresponding to the selected condition is sent to the user account corresponding to the target identifier code.
[0071] In practical applications, upon receiving a user account's request to select an activity using a target identifier, the system determines whether the target identifier meets the selection criteria corresponding to the request (e.g., whether the target identifier is the identifier designated by the activity organizer for user resource redemption). If it does, the target identifier is displayed on the interface (any terminal interface, such as a computer interface, mobile phone interface, etc.), and the resource corresponding to the selection criteria (which could be virtual currency, online red envelopes, physical products, etc.) is sent to the user account corresponding to the target identifier. It should be noted that if the resource redeemed by the user is a physical product, such as a refrigerator or television, the user can send their delivery address to the activity organizer for receipt.
[0072] In step S12, a first numerical sequence identifier code corresponding to the identifier code generation request is generated based on the set auto-incrementing variable.
[0073] In practical applications, a globally incrementing variable can be pre-defined. Each time an identifier generation request is received, the pre-defined value is incremented, forming a first numerical sequence identifier code corresponding to the request. This first numerical sequence identifier code is denoted as idSeq. For example, suppose the current idSeq is 1, and the increment value is 1 each time. Then, when an identifier generation request is received, the current idSeq will become 2, and so on. In specific implementations, to ensure the global nature of idSeq across all machines in a cluster deployment, and the atomicity of the increment in high-concurrency scenarios, Redis can be used. Its INCR command can be used to increment a specific key value to achieve the auto-increment of the first numerical sequence identifier code.
[0074] In step S13, the first numerical sequence is shuffled to generate the second numerical sequence.
[0075] It should be understood that since the first numerical sequence is generated in an auto-incrementing manner, it has a certain pattern of change and poor confidentiality. Therefore, in this embodiment, the first numerical sequence is scrambled to generate the second numerical sequence, as follows: Figure 3 As shown, the specific steps for generating the second numerical sequence are as follows:
[0076] In step S131, the total number of identifier codes that can be generated and the set prime numbers are obtained.
[0077] In step S132, the product of the first numerical sequence and the prime number is determined.
[0078] In step S133, the remainder of the product and the total number of identifier codes is determined and used as the second numerical sequence.
[0079] In practice, the total number of identifiers that can be generated is denoted as CODE_NUM_MAXIMUM, for example, it can be 56800235584. A pre-defined prime number can be denoted as PRIME_MAXIMUM, which can be 3987654271. Then, the product of the first numerical sequence and the prime number is determined. Taking 2 as an example, the product of 2 and 3987654271 is 7975308542. The remainder of this product (7975308542) divided by the total number of identifiers (56800235584) is taken as the second numerical sequence, denoted as idSeqMod. It should be understood that taking the remainder of 7975308542 and 56800235584 still results in 7975308542. Below is an example of the change between the first numerical sequence idSeq and the second numerical sequence idSeqMod:
[0080] idSeq idSeqMod token 1 3987654271 4lRN2n 2 7975308542 8HJA4K 3 11962962813 d3Bn77 4 15950617084 hpta9u 5 19938271355 lLkXbR 6 23925925626 q7cKee 7 27913579897 ut4xgB 8 31901234168 yOWkiY 9 35888888439 HwFUnI
[0081] Table 1
[0082] As can be seen from Table 1 above, the changes in the second numerical sequence idSeqMod do not follow a fixed pattern, and there are very few repeated numbers, which ensures the disorder and confidentiality of the identifier code.
[0083] Furthermore, since the first numerical sequence idSeq is globally unique, to ensure the uniqueness of the second numerical sequence idSeqMod, in this embodiment, prime numbers cannot divide the total number of identifier codes. This is proven using mathematical formulas below:
[0084] For ease of representation, we denote the prime number PRIME_MAXIMUM as p and the CODE_NUM_MAXIMUM as n.
[0085] Assuming that idSeqMod is not globally unique within n, then there exist two values i and j of idSeq (assuming i is greater than j) such that:
[0086] i×p≡j×p(mod n) (1)
[0087] j<i<n, and i, j, n∈Z + (2)
[0088] Among them, Z + Let be the set of positive integers. From the congruence relation in equation (1), we can obtain:
[0089] (i-j)×p=k×n,k∈Z + (3)
[0090] Further simplification yields:
[0091]
[0092] Since p cannot divide n and p is a prime number, equation (4) holds if and only if k is a multiple of p. Therefore:
[0093] i = j + α × n, α ∈ Z + (5)
[0094] It is evident that the conditions of equation (5) contradict those of equation (2). Therefore, the original assumption is not valid. In this embodiment, the prime number cannot divide the total number of identifier codes.
[0095] In step S14, the second numerical sequence is compressed to generate a target identifier code corresponding to the identifier code generation request.
[0096] Based on the example in step S13 above, the target identifier code can be denoted as token, and its transformation can be seen in Table 1 above. It should be understood that, in order to facilitate the display of the identifier code on the user terminal and improve the user experience, this embodiment of the disclosure performs length compression processing on the second numerical sequence, the specific process of which is as follows:
[0097] In step S141, the second numerical sequence is converted to a set base to obtain the converted string.
[0098] In practice, assuming the second numerical sequence idSeqMod is 3987654271, and the string to be converted includes uppercase letters, lowercase letters, and numbers, then the second numerical sequence idSeqMod can be converted to base 62 (it should be understood that uppercase and lowercase letters are each 26 bits, and numbers 0-9 are 10 bits. When the second numerical sequence idSeqMod needs to be converted into a target identifier code represented by uppercase letters, lowercase letters, and numbers, a base-62 conversion is performed), resulting in the converted string 4lRN2n.
[0099] In this embodiment of the disclosure, the total number of identifiers is less than or equal to the power of N of the base number, where N is the identifier length. For example, assuming the total number of identifiers is 56800235584, the base number is 62, and the identifier length N is 6, then 56800235584 ≤ 62. 6 .
[0100] In step S142, if the length of the string is consistent with the preset identifier length, then the string is determined as the target identifier corresponding to the identifier generation request.
[0101] It should be understood that, during actual number system conversion, the length of the string may differ from the preset identifier length. Only when the string length matches the preset identifier length will the string be determined as the target identifier corresponding to the identifier generation request.
[0102] Furthermore, if the length of the string is less than the length of the identifier code, then the string obtained by adding a preset character of the difference length to the string is determined as the target identifier code corresponding to the identifier code generation request, where the difference length is the difference between the identifier code length and the string length.
[0103] In practical implementation, for example, if the preset identifier code length is 6 bits (4lRN2n), and the actual converted string length is 5 bits (lRN2n), it means the lengths of the two are equal to 1. In this case, add one character to the string to make its length 6 bits. Specifically, you can add a 0 at the beginning of the string (0lRN2n). This is just one example. If the difference between the string length and the preset identifier code length is 2, then add two 0s at the beginning of the string, and so on.
[0104] In summary, upon receiving a user account's identifier generation request, this embodiment generates a first numerical sequence identifier code corresponding to the request, based on a pre-defined auto-incrementing variable, ensuring the uniqueness of identifier codes corresponding to different requests. By scrambling the first numerical sequence to generate a second numerical sequence, it ensures that the final target identifier code has no fixed pattern, possessing both randomness and confidentiality. By compressing the second numerical sequence to generate the target identifier code corresponding to the request, the length of the final identifier code is reduced, making it easier to display on the user terminal and improving the user experience. Furthermore, the identifier code generation method provided in this disclosure performs each step independently, without using additional storage space, resulting in low time and space complexity.
[0105] Figure 4 This is a block diagram illustrating an identification code generation apparatus according to an exemplary embodiment. (Refer to...) Figure 4 The device includes a receiving unit 401, a first generating unit 402, a second generating unit 403, and a third generating unit 404.
[0106] The receiving unit 401 is configured to execute a request to generate an identifier code for a user account;
[0107] The first generation unit 402 is configured to generate a first numerical sequence identifier code corresponding to the identifier code generation request by executing an incrementing variable based on a set value.
[0108] The second generation unit 403 is configured to perform scrambling on the first numerical sequence to generate the second numerical sequence;
[0109] The third generation unit 404 is configured to perform length compression processing on the second numerical sequence to generate a target identifier code corresponding to the identifier code generation request.
[0110] In some embodiments of this disclosure, the apparatus further includes:
[0111] The first unit is configured to receive an activity participation request containing a target identifier code triggered by a user account;
[0112] The second unit is configured to display the target identifier on the interface if the target identifier meets the selection conditions corresponding to the activity participation request;
[0113] The third unit is configured to send the virtual object corresponding to the selected condition to the user account corresponding to the target identifier.
[0114] In some embodiments of this disclosure, the second generation unit 403 is further configured to perform:
[0115] Obtain the total number of identifiers that can be generated and the set prime numbers;
[0116] Determine the product of the first numerical sequence and prime numbers;
[0117] The remainder of the product and the total number of identifiers is determined and used as the second numerical sequence.
[0118] In some embodiments of this disclosure, prime numbers are not divisible by the total number of identifier codes.
[0119] In some embodiments of this disclosure, the third generation unit 404 is further configured to perform:
[0120] The second numerical sequence is converted to a set number base to obtain the converted string;
[0121] If the length of the string is the same as the preset identifier length, then the string is determined as the target identifier corresponding to the identifier generation request.
[0122] In some embodiments of this disclosure, the identifier generation apparatus is further configured to perform:
[0123] If the length of the string is less than the length of the identifier code, then the string obtained by adding a preset character of the difference length to the string is determined as the target identifier code corresponding to the identifier code generation request, where the difference length is the difference between the identifier code length and the string length.
[0124] In some embodiments of this disclosure, the total number of identifier codes is less than or equal to the power of N in the base, where N is the identifier code length.
[0125] Figure 5 This is a block diagram illustrating a server according to an exemplary embodiment. The server can be a server used by a user. The server can be, for example, a smartphone, smartwatch, desktop computer, laptop, laptop server, desktop server, or other names.
[0126] Typically, a server includes a processor 501 and a memory 502.
[0127] The processor 501 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0128] The memory 502 may include one or more storage media, which may be non-transitory. The memory 502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash storage devices.
[0129] In some embodiments, the server may also optionally include: a peripheral device interface 503 and at least one peripheral device. The processor 501, memory 502, and peripheral device interface 503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 504, a display screen 505, a camera assembly 506, an audio circuit 507, a positioning assembly 508, and a power supply 509.
[0130] Peripheral interface 503 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 501 and memory 502. In some embodiments, processor 501, memory 502 and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 501, memory 502 and peripheral interface 503 can be implemented on separate chips or circuit boards, and this embodiment is not limited thereto.
[0131] The radio frequency (RF) circuit 504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 504 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 504 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 504 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 504 may also include circuitry related to NFC (Near Field Communication), which is not limited in this disclosure.
[0132] Display screen 505 is used to display a UI (User Interface). This UI may include images, text, icons, videos, and any combination thereof. When display screen 505 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 501 for processing. In this case, display screen 505 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 505, serving as the front panel of the server; in other embodiments, there may be at least two display screens, respectively disposed on different surfaces of the server or in a folded design; in still other embodiments, display screen 505 may be a flexible display screen, disposed on a curved or folded surface of the server. Furthermore, display screen 505 may be configured as a non-rectangular, irregularly shaped image, i.e., a non-rectangular screen. Display screen 505 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0133] The camera assembly 506 is used to acquire images or videos. Optionally, the camera assembly 506 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 506 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0134] The audio circuit 507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 501 for processing, or to the radio frequency circuit 504 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, positioned at different locations on the server. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 501 or the radio frequency circuit 504 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 507 may also include a headphone jack.
[0135] Positioning component 508 is used to locate the current geographic location of the server to enable navigation or LBS (Location Based Service). Positioning component 508 can be a positioning component based on the US GPS (Global Positioning System), China's BeiDou system, Russia's Granas system, or the EU's Galileo system.
[0136] Power supply 509 is used to power the various components in the server. Power supply 509 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 509 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0137] In some embodiments, the server further includes one or more sensors 510. The one or more sensors 510 include, but are not limited to: an accelerometer 511, a gyroscope 512, a pressure sensor 513, a fingerprint sensor 514, an optical sensor 515, and a proximity sensor 516.
[0138] Accelerometer 511 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by the server. For example, accelerometer 511 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 501 can control display screen 505 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 511. Accelerometer 511 can also be used for collecting game or user motion data.
[0139] The gyroscope sensor 512 can detect the server's orientation and rotation angle. The gyroscope sensor 512, in conjunction with the accelerometer sensor 511, can collect 3D motion data from the user interacting with the server. Based on the data collected by the gyroscope sensor 512, the processor 501 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0140] The pressure sensor 513 can be installed on the side bezel of the server and / or on the lower layer of the display screen 505. When the pressure sensor 513 is installed on the side bezel of the server, it can detect the user's grip signal on the server, and the processor 501 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 513. When the pressure sensor 513 is installed on the lower layer of the display screen 505, the processor 501 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 505. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0141] The fingerprint sensor 514 is used to collect the user's fingerprint. The processor 501 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 514, or the fingerprint sensor 514 identifies the user's identity based on the collected fingerprint. When the user's identity is recognized as trusted, the processor 501 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 514 can be located on the front, back, or side of the server. When the server has physical buttons or a manufacturer's logo, the fingerprint sensor 514 can be integrated with the physical buttons or manufacturer's logo.
[0142] An optical sensor 515 is used to collect ambient light intensity. In one embodiment, the processor 501 can control the display brightness of the display screen 505 based on the ambient light intensity collected by the optical sensor 515. Specifically, when the ambient light intensity is high, the display brightness of the display screen 505 is increased; when the ambient light intensity is low, the display brightness of the display screen 505 is decreased. In another embodiment, the processor 501 can also dynamically adjust the shooting parameters of the camera assembly 506 based on the ambient light intensity collected by the optical sensor 515.
[0143] The proximity sensor 516, also known as a distance sensor, is typically installed on the front panel of the server. The proximity sensor 516 is used to detect the distance between the user and the front of the server. In one embodiment, when the proximity sensor 516 detects that the distance between the user and the front of the server is gradually decreasing, the processor 501 controls the display screen 505 to switch from a screen-on state to a screen-off state; when the proximity sensor 516 detects that the distance between the user and the front of the server is gradually increasing, the processor 501 controls the display screen 505 to switch from a screen-off state to a screen-on state.
[0144] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the server and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0145] In an exemplary embodiment, this disclosure also provides a computer-readable storage medium including instructions, such as a memory including instructions, which can be executed by a processor 501 of a server to complete the above-described identifier generation method. Optionally, the storage medium may be a non-transitory storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0146] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0147] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for generating an identifier code, characterized in that, include: Receive user account identifier code generation request; Based on the set auto-incrementing variable, execute the atomic command to generate the first numerical sequence identifier code corresponding to the identifier code generation request; Obtain the total number of identifier codes that can be generated and the set prime number, and determine the product of the first numerical sequence and the prime number; The remainder of the product and the total number of identifier codes is determined and used as the second numerical sequence; The second numerical sequence is compressed to generate a target identifier code corresponding to the identifier code generation request.
2. The identification code generation method according to claim 1, characterized in that, The method further includes: Receive an activity participation request triggered by the user account, which includes the target identifier code; If the target identifier code meets the selection conditions corresponding to the activity participation request, then the target identifier code is displayed on the interface; The virtual object corresponding to the selected condition is sent to the user account corresponding to the target identifier.
3. The identification code generation method according to claim 1, characterized in that, The prime number cannot be divided by the total number of the identifier codes.
4. The identification code generation method according to claim 1, characterized in that, The step of compressing the length of the second numerical sequence to generate a target identifier code corresponding to the identifier code generation request includes: The second numerical sequence is converted to a set number base to obtain the converted string; If the length of the string is the same as the preset identifier code length, then the string is determined as the target identifier code corresponding to the identifier code generation request.
5. The identification code generation method according to claim 4, characterized in that, The method further includes: If the length of the string is less than the length of the identifier code, then the string obtained by adding a preset character of the difference length to the string is determined as the target identifier code corresponding to the identifier code generation request, wherein the difference length is the difference between the length of the identifier code and the length of the string.
6. The identification code generation method according to claim 4, characterized in that, The total number of the identifier codes is less than or equal to the Nth power of the number in the base, where N is the length of the identifier code.
7. An identification code generation device, characterized in that, include: The receiving unit is configured to execute a request to generate an identifier code for a user account. The first generation unit is configured to execute an atomic command based on a set auto-incrementing variable to generate a first numerical sequence identifier code corresponding to the identifier code generation request. The second generation unit is configured to perform the following operations: obtain the total number of identifier codes that can be generated and a set prime number, and determine the product of the first numerical sequence and the prime number; The remainder of the product and the total number of identifier codes is determined and used as the second numerical sequence; The third generation unit is configured to perform length compression processing on the second numerical sequence to generate a target identifier code corresponding to the identifier code generation request.
8. The identification code generation device according to claim 7, characterized in that, The device further includes: The first unit is configured to execute an activity participation request containing the target identifier code triggered by the user account; The second unit is configured to display the target identifier on the interface if the target identifier meets the selection condition corresponding to the activity participation request. The third unit is configured to send the virtual object corresponding to the selected condition to the user account corresponding to the target identifier.
9. The identification code generation device according to claim 7, characterized in that, The prime number cannot be divided by the total number of the identifier codes.
10. The identification code generation device according to claim 7, characterized in that, The third generation unit is also configured to perform: The second numerical sequence is converted to a set number base to obtain the converted string; If the length of the string is the same as the preset identifier code length, then the string is determined as the target identifier code corresponding to the identifier code generation request.
11. The identification code generation device according to claim 10, characterized in that, The device is also configured to perform: If the length of the string is less than the length of the identifier code, then the string obtained by adding a preset character of the difference length to the string is determined as the target identifier code corresponding to the identifier code generation request, wherein the difference length is the difference between the length of the identifier code and the length of the string.
12. The identification code generation device according to claim 10, characterized in that, The total number of the identifier codes is less than or equal to the Nth power of the number in the base, where N is the length of the identifier code.
13. A server, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the identifier code generation method as described in any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the server, the server is able to perform the identification code generation method as described in any one of claims 1 to 6.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the identification code generation method according to any one of claims 1-6.
Citation Information
Patent Citations
Data processing method and device, readable medium and electronic equipment
CN113742774A