Identification assigning method, device, equipment and storage medium

HK40084173BActive Publication Date: 2026-09-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
HK42023072806
Authority / Receiving Office
HK · HK
Patent Type
Patents
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2026-09-04
Estimated Expiration
2041-08-29

AI Technical Summary

Technical Problem

The existing Snowflake distributed auto-incrementing ID algorithm lacks distinctiveness in ID allocation and has difficulty accurately distinguishing IDs from different business scenarios.

Method used

By introducing a combination of business identifier and object identifier fields into the ID, a unique identifier is generated, ensuring that each ID can be accurately identified to its corresponding business scenario.

Benefits of technology

It provides a general-purpose ID allocation system that can concurrently allocate IDs for multiple business scenarios and accurately identify the business scenario of each ID through the business identifier field, thereby improving daily work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The application discloses a kind of identification allocation method, device, equipment and storage medium, belong to data processing field.The method comprises: receiving the identification allocation request sent by client;Determine the business identification field corresponding to the first business scenario, and determine the multiple unallocated identities corresponding to the first business scenario;In the multiple unallocated identities corresponding to the first business scenario, determine the object identification field of this allocation;According to business identification field and object identification field, the identification of this allocation is combined and generated.The application can realize high concurrency type identification allocation and identify the current business scenario from the business identification field in identification, improve the identification of identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to an identifier allocation method, apparatus, device, and storage medium. Background Technology

[0002] Currently, many business scenarios require users to log in using a unique identity (ID). A unique identity ID means that all users in the business scenario have unique IDs, meaning that no two IDs will conflict.

[0003] In related technologies, the Snowflake distributed auto-incrementing ID algorithm can be used to allocate IDs. This algorithm uses a 63-bit format: a timestamp (41 bits), a machine identifier (10 bits), and a sequence number (12 bits). The timestamp uses a millisecond-level timestamp to ensure a certain degree of order in ID allocation; the machine identifier uses 10 bits, which can accommodate up to 1024 allocators; and the final 12-bit sequence number can support the generation of 4096 unique IDs within 1 ms.

[0004] However, when using the Snowflake distributed auto-incrementing ID algorithm to allocate IDs, the IDs obtained by this algorithm lack distinctiveness. Summary of the Invention

[0005] This application provides an identifier allocation method, apparatus, device, and storage medium, which can distinguish different business scenarios based on the business identifier field in the ID. The technical solution is as follows:

[0006] According to one aspect of this application, an identifier allocation method is provided, the method comprising:

[0007] Receive the identifier allocation request sent by the client. The identifier allocation request is used to request the allocation of identifiers for business objects in the first business scenario. The first business scenario is one of the different business scenarios.

[0008] Determine the business identifier field corresponding to the first business scenario, and determine the multiple unassigned identifiers corresponding to the first business scenario;

[0009] Among the multiple unassigned identifiers corresponding to the first business scenario, determine the object identifier field to be assigned this time;

[0010] The identifier for this allocation is generated by combining the business identifier field and the object identifier field.

[0011] According to another aspect of this application, an identifier allocation device is provided, the device comprising:

[0012] The receiving module is used to receive the identifier allocation request sent by the client. The identifier allocation request is used to request the allocation of identifiers for business objects in the first business scenario. The first business scenario is one of the different business scenarios.

[0013] The first determining module is used to determine the business identifier field corresponding to the first business scenario;

[0014] The second determination module is used to determine multiple unassigned identifiers corresponding to the first business scenario;

[0015] The third determination module is used to determine the object identifier field to be allocated this time from among multiple unallocated identifiers corresponding to the first business scenario;

[0016] The allocation module is used to generate the identifier for this allocation by combining the business identifier field and the object identifier field.

[0017] According to another aspect of this application, an identifier allocation system is provided, the system comprising: at least one server and at least one client, wherein the at least one server is used to perform the identifier allocation method as described above.

[0018] According to another aspect of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the identifier allocation method as described above.

[0019] According to another aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the identifier allocation method as described above.

[0020] According to another aspect of this application, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the identifier allocation method described above.

[0021] The beneficial effects of the technical solution provided in this application include at least the following:

[0022] Upon receiving an identifier allocation request from the client, the system determines the business identifier field corresponding to the first business scenario, as well as multiple unassigned identifiers corresponding to the first business scenario. From these unassigned identifiers, the object identifier field for this allocation is determined. Finally, the identifier for this allocation is generated by combining the business identifier field and the object identifier field. Because the final generated ID contains the business identifier field, the business scenario of each ID can be accurately identified through this field. This provides a general-purpose ID allocation system capable of concurrently allocating IDs for multiple business scenarios. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram illustrating the composition of an identifier structure provided in an exemplary embodiment of this application;

[0025] Figure 2 This is a schematic diagram of an identifier allocation system provided in an exemplary embodiment of this application;

[0026] Figure 3 This is a flowchart of an exemplary embodiment of the identifier allocation method provided in this application;

[0027] Figure 4 This is a flowchart of an exemplary embodiment of the identifier allocation method provided in this application;

[0028] Figure 5 This is a flowchart of an exemplary embodiment of the identifier allocation method provided in this application;

[0029] Figure 6 This is a monitoring flowchart of the identifier allocation process provided in an exemplary embodiment of this application;

[0030] Figure 7 This is a flowchart of an exemplary embodiment of the identifier allocation method provided in this application;

[0031] Figure 8 This is a structural block diagram of memory allocation in an identifier provided by an exemplary embodiment of this application;

[0032] Figure 9 This is a structural block diagram of an identifier allocation device provided in an exemplary embodiment of this application;

[0033] Figure 10This is a structural block diagram of a terminal provided in an exemplary embodiment of this application.

[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0036] Figure 1 A schematic diagram of the ID structure provided in this application embodiment is shown. In this application, the ID is divided into three fields: a business identifier field, an object identifier field, and an extended identifier field.

[0037] The business identifier field is used to uniquely identify a business scenario. A business scenario refers to a scenario in which an identifier is assigned to a business object. For example, a business scenario could be an identifier assigned to an employee, an identifier assigned to an enterprise, or an identifier assigned to a group chat session; this embodiment does not limit this. Optionally, business scenarios can be divided according to the purpose of the ID, or according to the function, or according to the type of client. Illustratively, the business identifier field occupies 16 bits and can identify a maximum of 65,535 business scenarios; this embodiment does not limit this. For simplicity, a 4-bit business identifier field is used as an example, such as business identifier field = 0101 representing business scenario 1; business identifier field = 1111 representing business scenario 2.

[0038] The object identifier field is used to uniquely identify business objects in a business scenario. A business object is an individual in a business scenario that needs to be assigned an ID. Depending on the business scenario, the business object can be different. For example, a business object can be one or more of an employee, enterprise, department, user, or group chat, but is not limited to these, and this application embodiment does not limit this. Illustratively, the object identifier field occupies 32 bits and can identify a maximum of 4,294,967,295 business objects, i.e., 4.2 billion numbers. This application embodiment can divide the 4,294,967,295 numbers into multiple object identifier number segments (referred to as number segments). For example, using 1 million consecutive numbers as a number segment, the object identifier field can include a maximum of 4,294 number segments. Each number segment consists of consecutive numbers. For example, using 1 million consecutive numbers as a number segment, the first number segment represents a decimal value range of [0, 999,999], and the second number segment represents a decimal value range of [1,000,000, 1,999,999].

[0039] The extended identifier field is used to expand the available number of bits in the object identifier field. The extended identifier field can be 16 bits. If the object identifier field meets the required number of bits to be allocated, the extended identifier field uses a default value; if the object identifier field does not meet the required number of bits to be allocated, changing the value of the extended identifier field once can expand it to generate another set of 4,294,967,295 numbers. The extended identifier field is optional and can be used or not in the ID. In this embodiment, the fields are arranged in the order of business identifier field, extended identifier field, and object identifier field. Different embodiments may have different arrangements, and this embodiment does not limit this arrangement.

[0040] The maximum extended identifier field refers to the largest extended identifier field configured during the identifier allocation process.

[0041] Figure 2 The illustration shows a schematic diagram of an identifier allocation system provided in an embodiment of this application. The system includes multiple clients 10 and an identifier allocation server 20 located in multiple business scenarios.

[0042] Client 10 is used to generate an identifier allocation request. An identifier allocation request refers to Client 10 requesting the allocation of an identifier for a business object in the business scenario. Client 10 can be a computer device such as a smartphone, tablet, laptop, or desktop computer, but is not limited to these. Client 10 can be one or more computer devices; this embodiment of the application does not limit this.

[0043] A business scenario refers to a scenario in which identifiers are assigned to business objects. For example, a business scenario could be a scenario in which identifiers are assigned to employees, a scenario in which identifiers are assigned to enterprises, or a scenario in which identifiers are assigned to group chat sessions, but it is not limited to these.

[0044] The clients corresponding to different business scenarios can be the same or different; different business scenarios can correspond to one or more clients, and this application embodiment does not limit this.

[0045] Those skilled in the art will understand that the number of clients 10 described above can be more or less. For example, there may be only one client 10, or there may be dozens or hundreds of clients 10, or even more. This application does not limit the number or type of clients 10.

[0046] Client 10 connects to identifier allocation server 20 via wireless network or wired network, but this embodiment does not limit the connection.

[0047] The identifier allocation server 20 is used to receive identifier allocation requests generated by the client 10 and to allocate identifiers to business objects in each first business scenario. The identifier allocation server 20 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The identifier allocation server 20 is the server corresponding to the client 10 and is used to provide background identifier allocation services to the client 10.

[0048] Optionally, both the client 10 and the identifier allocation server 20 can be computer devices.

[0049] In an illustrative example, clients 10 in different business scenarios generate different identifier allocation requests. Taking business scenarios 1, 2, and 3 as examples, after receiving the identifier allocation request from client 10, the identifier allocation server 20 determines the business identifier field corresponding to each business scenario. For example, the business identifier field corresponding to business scenario 1 is 247, the business identifier field corresponding to business scenario 2 is 158, and the business identifier field corresponding to business scenario 3 is 16733. After determining the business identifier field corresponding to the business scenario, the extended identifier field and object identifier field corresponding to the business scenario are determined. The extended identifier field is used to extend the available number of bits of the object identifier field. The extended identifier field is only used when the object identifier field cannot meet the allocation conditions. For example, if the object identifier field in business scenario 1 cannot meet the allocation conditions, the object identifier field is extended, and the corresponding extended identifier field in business scenario 1 is 3658, and the object identifier field is 489654132; if the object identifier field in business scenario 2 can meet the allocation conditions, the corresponding extended identifier field in business scenario 2 is 0, and the object identifier field is 3671192255.

[0050] Figure 3 A flowchart illustrating an exemplary embodiment of this application is provided. This method can be applied to the aforementioned identifier allocation server 20. In this embodiment, the identifier allocation server 20 is used as the executing entity, hereinafter referred to as the server. The method may include the following steps:

[0051] Step 302: Receive the identifier allocation request sent by the client;

[0052] The identifier allocation request is used to request the allocation of identifiers for business objects in the first business scenario. The server receives the identifier allocation request sent by the client.

[0053] The business scenario can be one or more of the following: assigning identifiers to employees, assigning identifiers to enterprises, or assigning identifiers to group chat sessions.

[0054] The target audience is at least one of the following: employees, enterprises, departments, users, and group chats.

[0055] Indicatively, the allocation request carries: scenario information of the first business scenario, object information of the business object to be allocated this time, and the number of IDs to be allocated this time.

[0056] Step 304: Determine the business identifier field corresponding to the first business scenario;

[0057] The value of the business identifier field is used to uniquely identify the first business scenario, and different business scenarios correspond to different business identifier fields.

[0058] The server obtains the scenario information of the first business scenario from the identifier allocation request. The server determines the business identifier field corresponding to the first business scenario based on the scenario information.

[0059] For illustrative purposes, the scenario information for the first business scenario is represented by at least one of the following: the name of the business scenario, the ID of the business scenario, the type of the client, and the IP address of the client. For example, the first type of client corresponds to business scenario 1, the second type of client corresponds to business scenario 2, and the third type of client corresponds to business scenario 3; or, for example, clients belonging to the first set of IP addresses correspond to business scenario 1, clients belonging to the second set of IP addresses belong to business scenario 2, and clients belonging to the third set of IP addresses belong to business scenario 3.

[0060] The server stores the mapping between scene information and business identifier values. An example is shown in Table 1:

[0061] Table 1

[0062] Scenario information for business scenarios Business identifier value Scene Information 1 Business Identifier 1 Scene Information 2 Business Identifier 2 Scene Information 3 Business Identifier 3

[0063] As an illustration, when the identifier allocation request carries "scenario information 2", the server determines "business identifier 2" as the specific value of the business identifier field corresponding to the first business scenario.

[0064] Step 306: Identify the multiple unassigned identifiers corresponding to the first business scenario;

[0065] One or more number segments can correspond to the same business scenario. Based on the remaining capacity, each number segment can be divided into: available number segments or unavailable number segments.

[0066] Number segments are used to represent a series of consecutive numbers. For example, 1 million consecutive numbers can be used as a number segment. If the range of the first number segment is [0, 999999], then the range of the second number segment is [1000000, 1999999].

[0067] In some embodiments, an available identifier range refers to an identifier range that the business scenario has the right to use. An unavailable identifier range refers to an identifier range that the business scenario does not have the right to use.

[0068] In some embodiments, the first business scenario has access to multiple number segments. An available identifier number segment refers to a number segment among multiple number segments where the remaining unassigned identifiers are not less than a preset threshold value; that is, a number segment with sufficient unassigned identifiers. For example, the first business scenario corresponds to one or more available identifier number segments.

[0069] An unavailable identifier segment refers to a segment among multiple segments where the number of remaining and unassigned identifiers is less than a preset threshold. In other words, a segment with insufficient unassigned identifiers is a segment with a preset threshold of 100. If only 82 numbers remain unassigned out of 1 million numbers in a segment, that segment will be set as an unavailable identifier segment.

[0070] Step 308: Among the multiple unassigned identifiers corresponding to the first business scenario, determine the object identifier field to be assigned this time;

[0071] The value of the object identifier field is used to uniquely identify the business object in the first business scenario.

[0072] The server selects, sequentially or randomly, the object identifier field to be assigned from among multiple unassigned identifiers in the available identifier range.

[0073] Step 310: Combine the business identifier field and the object identifier field to generate the identifier for this allocation.

[0074] The business identifier field is used to represent the first business scenario and distinguish different business scenario types. The type of the first business scenario can be easily identified through the business identifier field. The object identifier field is used to represent the business object in the corresponding first business scenario. The business object in the first business scenario can be identified through the object identifier field.

[0075] As an illustration, the server combines the business identifier field and the object identifier field in a cascading manner to generate the identifier of the business object corresponding to the first business scenario.

[0076] It should be noted that the above-described identifier allocation method is executed by any node in the distributed system, and the cached data of each node includes multiple unassigned identifiers corresponding to different first business scenarios. The various business scenarios are independent of each other, therefore the ID allocation process for different business scenarios can be executed concurrently; multiple number segments within the same business scenario are also independent of each other, therefore the ID allocation process for different number segments within the same business scenario can be executed concurrently.

[0077] In summary, the method provided in this embodiment, after receiving an identifier allocation request sent by the client, determines the business identifier field corresponding to the first business scenario and the object identifier field to be allocated. Finally, it generates the allocated identifier based on the combination of the business identifier field and the object identifier field. Since the final generated ID contains the business identifier field, the business scenario of each ID can be accurately identified through the business identifier field, providing a general-purpose ID allocation system capable of concurrently allocating IDs for multiple business scenarios.

[0078] An example for an ID that includes: "Business Identifier Field" + "Object Identifier Field":

[0079] Figure 4 This is a flowchart illustrating an identifier allocation method according to another embodiment of this application. This method can be applied to the identifier allocation server 20 described above; in this embodiment, the identifier allocation server 20 is used as the execution entity. This embodiment may include the following steps:

[0080] Step 302: Receive the identifier allocation request sent by the client;

[0081] The identifier allocation request is used to request the allocation of identifiers for business objects in the first business scenario.

[0082] Step 304: Determine the business identifier field corresponding to the first business scenario;

[0083] The value of the business identifier field is used to uniquely identify the business scenario, and different business scenarios correspond to different business identifier fields.

[0084] The server obtains the scenario information of the first business scenario from the identifier allocation request. The server determines the business identifier field corresponding to the business scenario based on the scenario information of the first business scenario.

[0085] For illustrative purposes, the scenario information for the first business scenario is represented by at least one of the following: the name of the business scenario, the ID of the business scenario, the type of the client, and the IP address of the client. For example, the first type of client corresponds to business scenario 1, the second type of client corresponds to business scenario 2, and the third type of client corresponds to business scenario 3; or, for example, clients belonging to the first set of IP addresses correspond to business scenario 1, clients belonging to the second set of IP addresses belong to business scenario 2, and clients belonging to the third set of IP addresses belong to business scenario 3.

[0086] Step 306: Identify the multiple unassigned identifiers corresponding to the first business scenario;

[0087] One or more number segments can correspond to the same business scenario. Based on the remaining capacity, each number segment can be divided into: available number segments or unavailable number segments.

[0088] Number segments are used to represent a series of consecutive numbers. For example, 1 million consecutive numbers can be used as a number segment. If the range of the first number segment is [0, 999999], then the range of the second number segment is [1000000, 1999999].

[0089] In this embodiment, an available identifier segment refers to a segment among multiple number segments where the number of remaining and unassigned identifiers is not less than a preset threshold value, that is, a segment with sufficient remaining unassigned identifiers. For example, the first business scenario corresponds to one or more available identifier segments. An unavailable identifier segment refers to a segment among multiple number segments where the number of remaining and unassigned identifiers is less than a preset threshold value, that is, a segment with insufficient remaining unassigned identifiers. For example, if the preset threshold value is 100, and only 82 digits remain unassigned out of 1 million digits in a certain number segment, that segment will be set as an unavailable identifier segment.

[0090] For the current first business scenario, the server obtains the unavailable identifier number range corresponding to the first business scenario in the historical records (initially empty), and obtains the available identifier number range of the first business scenario based on the difference between all number ranges with usage rights in the first business scenario and the unavailable identifier number range.

[0091] Assume the available identifier ranges for the first business scenario include: a first available identifier range and a second available identifier range. Optionally, multiple unassigned identifiers from the first available identifier range will be pre-cached in the cached data in memory. These unassigned identifiers can be directly used for ID allocation, thereby shortening the response time of identifier allocation requests.

[0092] Step 308: Among the multiple unassigned identifiers corresponding to the first business scenario, determine the object identifier field to be assigned this time;

[0093] S1: Determine whether the first number of the requested number of identifiers is greater than the second number of unallocated identifiers cached in memory;

[0094] The first quantity indicates the number of identifiers allocated in this application request. The first available identifier range indicates one of the available identifier ranges corresponding to the first business scenario. The second quantity indicates the number of unallocated identifiers cached in the cached data in memory.

[0095] Assume that the cached data in memory contains multiple unallocated identifiers. If the number of unallocated identifiers cached in memory is sufficient to satisfy the number of identifiers requested in the identifier allocation request, then step S2 is executed to determine the object identifier field to be allocated in this instance from the unallocated identifiers cached in memory. If the number of unallocated identifiers cached in memory is insufficient to satisfy the number of identifiers requested for allocation, then step S3 is executed, requiring one or more unallocated identifiers to be cached again from the database into memory.

[0096] S2: Determine the object identifier field for this allocation from the unallocated identifiers in the memory cache;

[0097] The object identifier field is used to represent the business object in the business scenario. For example, the business object is at least one of the following: employee, enterprise, department, user, group chat, but is not limited to this.

[0098] If the number of unallocated identifiers cached in the memory cache data is sufficient to satisfy the number of identifiers requested in the identifier allocation request, the object identifier field to be allocated this time is determined from the unallocated identifiers cached in the memory cache data.

[0099] Optionally, the server may sequentially or randomly select the object identifier field to be assigned from among multiple unassigned identifiers in the available identifier range.

[0100] S3: Whether the fourth quantity of unallocated identifiers in the first available identifier segment is greater than the cache threshold;

[0101] The cache threshold value represents the minimum number of unallocated identifiers that need to be cached in memory, such as 100 or 3000. If the number of unallocated identifiers in the first available identifier segment cached in the memory cache is insufficient to meet the number of identifiers requested in the identifier allocation request, one or more unallocated identifiers need to be cached from the database into memory again.

[0102] The fourth quantity represents the remaining amount of unallocated identifiers in the database for the first available identifier segment. The server determines whether the fourth quantity is greater than the cache threshold. The cache threshold can be an empirical value, and this embodiment does not limit it.

[0103] If the fourth quantity is less than the cache threshold, proceed to step S6, set the first available identifier segment to an unavailable identifier segment, and proceed to step S7, select the second available identifier segment from the available identifier field corresponding to the first business scenario in the database to replace the first available identifier segment, and re-determine the fourth quantity, i.e., re-execute step S3; if the fourth quantity is greater than the cache threshold, proceed to step S4.

[0104] For example, the cache threshold is set to 100. If the fourth quantity is less than 100, the first available identifier segment is set to an unavailable identifier segment. The second available identifier segment is selected from the available identifier field corresponding to the first business scenario in the database to replace the first available identifier segment, and the fourth quantity is judged again.

[0105] S4: Is the fourth quantity of the unallocated identifier remaining quantity less than the third quantity, which is the sum of the difference between the first and second quantities plus the cache threshold?

[0106] The fourth quantity represents the remaining amount of unallocated identifiers in the database for the first available identifier segment. The first quantity represents the number of identifiers in this allocation request. The second quantity represents the number of unallocated identifiers in the first available identifier segment cached in memory.

[0107] If the fourth quantity is greater than the cache threshold, it is further determined whether the fourth quantity is less than the third quantity, which is the sum of the difference between the first and second quantities plus the cache threshold. If the fourth quantity is less than the third quantity, step S5 is executed to set the first available identifier segment as the available identifier segment to be selected next or in the future, and step S7 is executed to select the second available identifier segment from the available identifier field corresponding to the first business scenario in the database to replace the first available identifier segment, and the fourth quantity is judged again, that is, step S3 is executed again.

[0108] If the fourth quantity is greater than the third quantity, which is the sum of the difference between the first and second quantities plus the cache threshold, then step S8 is executed to cache the third quantity of unallocated identifiers in the first available identifier segment from the database into memory, and step S2 is executed to determine the object identifier field to be allocated this time from the third quantity of unallocated identifiers cached in memory.

[0109] For example, a threshold value is set for the remaining amount of unallocated identifiers in the database for the available identifier segment, i.e., a cache threshold value of 100. If the fourth quantity is less than 100, the first available identifier segment is set as an unavailable identifier segment. The second available identifier segment is selected from the available identifier field corresponding to the first business scenario in the database to replace the first available identifier segment, and the judgment of the remaining fourth quantity of unallocated identifiers is performed again.

[0110] If the fourth quantity is greater than 100, further determine whether the fourth quantity is less than the third quantity. For example, if the number of identifiers in the identifier allocation request in this application is a1, and the number of unallocated identifiers in the first available identifier segment cached in memory is b1, then the third quantity can be represented as a1-b1+100. If the fourth quantity is greater than 100 but less than a1-b1+100, set the first available identifier segment as the available identifier segment to be selected next time, select the second available identifier segment from the available identifier field corresponding to the first business scenario in the database to replace the first available identifier segment, and re-determine the fourth quantity.

[0111] If the fourth number is greater than a1-b1+100, the third number of unallocated identifiers in the first available identifier segment are cached from the database and stored in memory, and the object identifier field to be allocated is determined from the third number of unallocated identifiers cached in memory.

[0112] S5: Set the first available identifier segment as the next available identifier segment to be selected;

[0113] Setting the first available identifier segment as the next available identifier segment means that even if the available identifier segments are cached again in the database, the first available identifier segment can still be selected as the target. After setting the first available identifier segment as the next available identifier segment, it is recorded in the database, generating a table of identifier segments to be allocated, as shown in Table 2.

[0114] Table 2

[0115]

[0116]

[0117] S6: Set the first available identifier segment to an unavailable identifier segment;

[0118] After setting the first available identifier segment as an unavailable identifier segment, this is recorded in the database, generating an unavailable identifier segment table, as shown in Table 3. When the database caches available identifier segments again, it will automatically avoid the unavailable identifier segment and select other available identifier segments instead.

[0119] Table 3

[0120] Serial Number Field Name Field type 1 Unavailable identifier range 64 bits 2 Business Identifier Field 64 bits 3 Extended Identifier Field 64 bits 4 Object Identifier Field 64 bits

[0121] S7: Select the second available identifier segment to replace the first available identifier segment;

[0122] The second available identifier segment is one of the available identifier segments corresponding to the business scenario.

[0123] S8: Cache the third number of unallocated identifiers from the database into memory;

[0124] The third quantity is used to represent the sum of the difference between the number of identifiers in the identifier allocation request in this application, the first quantity, and the number of unallocated identifiers in the first available identifier segment cached in the cached data in memory, plus the cache threshold value. The cache threshold value is used to represent the minimum threshold value of unallocated identifiers that need to be cached in memory.

[0125] Taking a cache threshold of 100 as an example, the third quantity = the first quantity - the second quantity + 100.

[0126] Step 310: Combine the business identifier field and the object identifier field to generate the identifier for this allocation.

[0127] The business identifier field indicates the first business scenario type, distinguishing different business scenario types. The business identifier field makes it easy to identify the type of the first business scenario. The object identifier field indicates the corresponding business object within the first business scenario, allowing you to determine the business object within that scenario. The identifier for the corresponding business object in the first business scenario is generated by combining the business identifier field and the object identifier field.

[0128] In summary, the method provided in this embodiment determines the business identifier field corresponding to the first business scenario and the object identifier field corresponding to the first business scenario from the available identifier number ranges cached in the cached data in memory. When the available identifier number ranges in the cached data in memory are insufficient to meet the number of identifiers requested in the identifier allocation request, one or more available identifier number ranges are cached from the database into memory. Finally, the identifier corresponding to the business object in the first business scenario is generated by combining the business identifier field and the object identifier field. This allows users to easily identify the type of the first business scenario represented by the identifier through the business identifier field, solving the problem that users have difficulty identifying identifier information. It makes it convenient for users to identify the type of business scenario through the business identifier field, thus improving daily work efficiency.

[0129] For an example where the ID includes: "Business Identifier Field" + "Extended Identifier Field" + "Object Identifier Field":

[0130] Figure 5 A flowchart illustrating an exemplary embodiment of the present application is shown. This method can be applied to the aforementioned identifier allocation server 20; in this embodiment, the identifier allocation server 20 is used as the execution entity for description. Compared to Figure 4 This embodiment also includes:

[0131] Step 305a: Does the remaining number of unallocated identifiers in the available identifier range meet the margin threshold?

[0132] Before allocating the object identifier field, the extended identifier field for this allocation is first determined. The server determines whether the number of remaining unallocated identifiers in the available identifier segments meets the reserve threshold. The reserve threshold is used to indicate whether the number of remaining unallocated identifiers in all segments of the first business scenario is sufficient. The reserve threshold is represented by the number of remaining unallocated identifiers, or by the ratio of remaining unallocated identifiers to all identifiers, or by the above. Figure 4 The number of number segment replacements or allocation failures in step 308 are used to indicate this. For example, if the allocation cannot be completed after switching 10 available number segments consecutively, or if the allocation fails 10 times consecutively.

[0133] If the remaining number of unassigned identifiers in the available identifier segment meets the margin threshold, then step 305b is executed to determine the default extended identifier as the extended identifier field corresponding to the first business scenario.

[0134] If the remaining number of unallocated identifiers in the available identifier segment does not meet the margin threshold, then step 305c is executed to increment or decrement the default extended identifier and determine it as the extended identifier field corresponding to the first business scenario.

[0135] Step 305b: Determine the default extended identifier as the extended identifier field corresponding to the first business scenario;

[0136] If the remaining number of unassigned identifiers in the available identifier segment meets the margin threshold, the default extended identifier will be determined as the extended identifier field corresponding to the first business scenario.

[0137] Optionally, the default extended identifier is an empirical value configured by the R&D personnel. For example, assuming that two sets of 4,294,967,295 numbers can definitely meet the upper limit of the allocation quantity, if the maximum value of the extended identifier field is n, then the default extended identifier is set to n-1.

[0138] Step 305c: Increment or decrement the default extended identifier and determine the extended identifier field corresponding to the first business scenario;

[0139] If the remaining number of unassigned identifiers in the available identifier segment does not meet the margin threshold, the default extended identifier will be incremented or decremented to determine the extended identifier field corresponding to the first business scenario.

[0140] For example, assuming the maximum extended identifier field is n, when determining the extended identifier field, the default extended identifier n-1 is preferentially selected as the value of the extended identifier field. If the allocation process of the extended identifier field n-1 triggers the margin threshold, the default extended identifier n-1 is incremented to n, and the extended identifier n is selected as the value of the extended identifier field, which is determined as the extended identifier field corresponding to the first business scenario.

[0141] In this embodiment, the next extended identifier field is selected by incrementing. In different embodiments, a decrementing method can also be selected. This application does not limit this method.

[0142] Step 310: Combine the business identifier field, extended identifier field, and object identifier field to generate the identifier for this allocation.

[0143] The business identifier field indicates the first business scenario type, distinguishing different first business scenario types and making it easy to identify the first business scenario type. The object identifier field indicates the corresponding business object in the first business scenario, identifying the business object in the first business scenario. The extended identifier field extends the object identifier field. By combining the business identifier field, object identifier field, and object identifier field, an identifier for the corresponding business object in the first business scenario is generated.

[0144] In this embodiment, the identifier is generated by arranging the business identifier field, the extended identifier field, and the object identifier field in that order. Different arrangements may be made in different implementations, and this embodiment does not limit this arrangement.

[0145] In summary, the method provided in this embodiment determines the business identifier field corresponding to the first business scenario, the extended identifier field corresponding to the first business scenario, and the object identifier field corresponding to the first business scenario from the available identifier number range cached in memory. When determining the extended identifier field corresponding to the first business scenario, if the number of remaining unallocated identifiers in the available identifier number range corresponding to the first business scenario meets the margin threshold, the default extended identifier is determined as the extended identifier field corresponding to the first business scenario; if the number of remaining unallocated identifiers in the available identifier number range corresponding to the first business scenario does not meet the margin threshold, the default extended identifier is incremented or decremented before being determined as the extended identifier field corresponding to the first business scenario.

[0146] After determining the extended identifier field corresponding to the first business scenario, the object identifier field corresponding to the first business scenario is determined. If the available identifier number range in the cached data in memory is insufficient to meet the number of identifiers requested in the identifier allocation request, one or more available identifier number ranges are cached from the database into memory. Finally, the identifier corresponding to the business object in the first business scenario is generated by combining the business identifier field, the extended identifier field, and the object identifier field. This allows users to easily identify the type of the first business scenario represented by the identifier through the business identifier field, solving the problem that users have difficulty identifying identifier information. This makes it convenient for users to identify the type of business scenario through the business identifier field, improving daily work efficiency.

[0147] In some embodiments, the identification allocation process further includes a monitoring process. Optionally, the above method further includes step 309, such as... Figure 6 As shown:

[0148] Step 309a: Monitor the identification allocation process during the process of generating the identification for this allocation based on the business identification field and the object identification field, and obtain monitoring data;

[0149] Monitoring data refers to the data obtained during the identification allocation process. When the monitoring data triggers warning conditions, alarm processing operations are performed.

[0150] Step 309b: If the number of identifiers allocated in the first business scenario within a unit of time exceeds the first threshold, output the first alarm event;

[0151] The first business scenario refers to any one of the business scenarios. For example, in the first business scenario, if the number of identifiers assigned to the corresponding business object within a unit of time exceeds a first threshold, an alarm processing operation is performed. The first threshold can be a default value or can be manually set; this embodiment does not impose any restrictions on this. For instance, in the business scenario of assigning identifiers to employees, the first threshold is set to 1000; if the number of identifiers assigned to employees exceeds 1000 within 2 hours, an alarm processing operation is performed.

[0152] The first alarm event is used to indicate that the number of identifiers allocated per unit time in the first business scenario is abnormal. This application embodiment outputs the first alarm event. The first alarm event may include issuing a warning or suspending the current allocation, but is not limited to these, and this application embodiment does not impose any limitations on this.

[0153] Step 309c: If the number of identifiers requested in a single identifier allocation exceeds the second threshold in the first business scenario, the allocation will be blocked.

[0154] The first business scenario refers to any one of the business scenarios. For example, in the first business scenario, if the number of identifiers requested in a single identifier allocation exceeds a second threshold, an alarm processing operation is performed. The second threshold can be a default value or can be manually set; this application embodiment does not impose any restrictions on this. For instance, in the business scenario of allocating identifiers to employees, the second threshold is set to 2000. If the number of identifiers allocated to employees in a single identifier allocation process exceeds 2000, an alarm processing operation is performed.

[0155] The second alarm event is used to indicate that the number of identifiers allocated in a single transaction in the first business scenario is abnormal, and this application embodiment intercepts this allocation. The second alarm event may include issuing a warning or suspending this allocation, but is not limited to these, and this application embodiment does not impose any limitations on this.

[0156] Step 309d: Assume that the target IDs in the first business scenario and the second business scenario are related and that the upper limit of the identifier allocation for the target ID has a third threshold. If the number of identifiers allocated in the first business scenario reaches the third threshold corresponding to the target ID, output the second alarm event.

[0157] The first business scenario represents the business scenario where identifiers are to be assigned, and the second business scenario is a business scenario related to the first business scenario. Given a fixed number of identifiers to be assigned in the second business scenario, the number of identifiers to be assigned in the first business scenario is limited by the number of identifiers to be assigned in the second business scenario. If the number of identifiers to be assigned in the first business scenario exceeds the third threshold limit set by the second business scenario, a second alarm event is output.

[0158] The third threshold is determined based on a second business scenario that is related to the first business scenario.

[0159] For example, in a business scenario of assigning identifiers to employees, if the identifiers are assigned solely based on the employee's identifier assignment dimension, an employee can apply for 500 identifiers. However, since the employee's identifier assignment business scenario is related to Company A's identifier assignment business scenario, Company A can apply for 100 identifiers. Therefore, the identifiers will be assigned to the employee according to the dimension of Company A's identifier assignment, meaning that the number of identifiers that the employee can be assigned is 100.

[0160] The second alarm event indicates that, given a fixed number of identifiers allocated in the second business scenario, the number of identifiers allocated in the first business scenario is limited by the number of identifiers allocated in the second business scenario. If the number of identifiers allocated in the first business scenario exceeds a third threshold set by the second business scenario, the number of identifiers allocated in the first business scenario is abnormal, and this embodiment outputs the second alarm event. The second alarm event may include issuing a warning or suspending the current allocation, but is not limited to these, and this embodiment does not impose any restrictions on them.

[0161] Step 309e: If the remaining amount of unassigned identifiers corresponding to the first business scenario is lower than the fourth threshold, output the third alarm event.

[0162] For example, the remaining amount of unassigned identifiers corresponding to the first business scenario is obtained through periodic scanning. In the first business scenario, if the remaining amount of unassigned identifiers is lower than a fourth threshold value, an alarm processing operation is performed. The fourth threshold value can be a default value or can be actively set; this application embodiment does not impose any restrictions on this. For example, in the business scenario of assigning identifiers to employees, the fourth threshold value is set to 100. Every hour, the remaining amount of unassigned identifiers corresponding to the employee identifier assignment business scenario is scanned. When the remaining amount of unassigned identifiers is lower than 100, an alarm processing operation is performed to prompt the business manager to prepare for identifier expansion.

[0163] The third alarm event is used to indicate that the remaining amount of unallocated identifiers corresponding to the first business scenario obtained from periodic scanning is abnormal. This application embodiment outputs the third alarm event. The third alarm event may include issuing a warning or suspending the current allocation, but is not limited to these, and this application embodiment does not impose any limitations on this.

[0164] Figure 7 This is a flowchart illustrating an identifier allocation method provided in an embodiment of this application. This method can be applied to the identifier allocation server 20 described above; in this embodiment, the identifier allocation server 20 is used as the execution entity. This embodiment may include the following steps:

[0165] Step 701: Begin;

[0166] Step 702: Receive the identifier allocation request;

[0167] The identifier allocation request is used to request the allocation of identifiers for business objects in the first business scenario.

[0168] Before receiving an identifier allocation request, one or more identifier number segments are cached in the cached data in memory; the extended identifier field configured during the allocation process is read into memory; at the same time, the unavailable identifier number segments corresponding to the first business scenario in the historical records are obtained into memory, and the available identifier number segments are obtained in memory based on the difference between at least one identifier number segment and the unavailable identifier number segments.

[0169] Available identifier segments refer to segments in which the remaining unassigned identifiers exceed a certain limit; these segments are also known as segments with sufficient margin.

[0170] Step 703: Read the extended identifier field;

[0171] Read the extended identifier field of the identifier to be assigned and execute step 703 to determine whether the extended identifier field of the identifier to be assigned is greater than the maximum extended identifier field configured during the allocation process.

[0172] Step 704: Check if the extended identifier field is greater than the maximum extended identifier field configured during the allocation process;

[0173] By reading the extended identifier field of the identifier to be assigned, it is determined whether the extended identifier field of the identifier to be assigned is greater than the maximum extended identifier field configured during the allocation process. If the extended identifier field of the identifier to be assigned is greater than the maximum extended identifier field configured during the allocation process, step 705 is executed. In this first business scenario, the identifier allocation fails.

[0174] For example, assuming the maximum extended identifier field is n, when determining the extended identifier field, if the extended identifier field of the identifier to be assigned is greater than the maximum extended identifier field n, the identifier assignment fails.

[0175] Step 705: Allocation failed;

[0176] In this first business scenario, if the extended identifier field of the identifier to be assigned is greater than the maximum extended identifier field configured during the assignment process, the identifier assignment will fail.

[0177] Step 706: Is there a sufficient number of available identifier segments cached in memory?

[0178] If the extended identifier field of the identifier to be assigned is less than the maximum extended identifier field configured during the allocation process, for example, assuming the maximum extended identifier field is n, when determining the extended identifier field, if the extended identifier field of the identifier to be assigned is less than the maximum extended identifier field n, the default extended identifier n-1 is preferentially selected as the value of the extended identifier field, and step 706 is executed to determine whether the first available identifier segment cached in memory is sufficient. The first available identifier segment is one of the available identifier segments corresponding to the business scenario. If the first available identifier segment cached in memory is sufficient, step 711 is executed to allocate the identifier from the first available identifier segment cached in memory; if the first available identifier segment cached in memory is insufficient, step 707 is executed to select the first available identifier segment from the database.

[0179] Optionally, the default extended identifier is an empirical value configured by the R&D personnel. For example, assuming that two sets of 4,294,967,295 numbers can definitely meet the upper limit of the allocation quantity, if the maximum value of the extended identifier field is n, then the default extended identifier is set to n-1.

[0180] Step 707: Select the first available identifier segment from the database;

[0181] If the cached first available identifier segment in the cached data in memory is insufficient, the first available identifier segment is selected from the database. When selecting from the database, step 708 is executed to determine whether the number of unallocated identifiers in the first available identifier segment in the database is sufficient.

[0182] Step 708: Is there a sufficient number of unassigned identifiers in the first available identifier segment of the database?

[0183] If the number of unallocated identifiers in the first available identifier segment in the database is sufficient, proceed to step 709 to allocate the first available identifier segment from the database to memory. If the number of unallocated identifiers in the first available identifier segment in the database is insufficient, proceed to step 712 to determine whether the number of unallocated identifiers in the first available identifier segment is less than 100.

[0184] Step 709: Allocate the first available identifier segment from the database to memory;

[0185] If there are enough unallocated identifiers in the first available identifier segment in the database, allocate the first available identifier segment from the database to memory.

[0186] Step 710: Update the number of the first available identifier segments cached in memory;

[0187] After allocating the first available identifier segment from the database to memory, update the number of the first available identifier segments cached in memory.

[0188] Step 711: Allocate an identifier from memory;

[0189] If there are sufficient available identifier segments cached in memory, identifiers are allocated from the first available identifier segments cached in memory.

[0190] Step 712: Is the number of unassigned identifiers in the first available identifier segment less than 100?

[0191] If the number of unallocated identifiers in the first available identifier segment in the database is insufficient, it is determined whether the number of unallocated identifiers in the first available identifier segment in the database is less than 100. 100 is a cache threshold value, which represents the remaining amount of unallocated identifiers in the database for the available identifier segment. This threshold value can be set manually, and this embodiment does not limit it. In this embodiment, a cache threshold value of 100 is used as an example. Different embodiments can set different cache threshold values, and this embodiment does not limit them. If the number of unallocated identifiers in the first available identifier segment in the database is less than 100, step 713 is executed, and the first available identifier segment is recorded as an unavailable identifier segment in the database. If the number of unallocated identifiers in the first available identifier segment in the database is greater than 100, step 714 is executed.

[0192] Step 713: Record the first available identifier segment as an unavailable identifier segment;

[0193] If the number of unassigned identifiers in the first available identifier segment in the database is less than 100, then the first available identifier segment is recorded as an unavailable identifier segment in the database.

[0194] Step 714: Check if the extended identifier field is equal to the maximum extended identifier field configured during the allocation process;

[0195] If the number of unallocated identifiers in the first available identifier segment in the database is greater than 100, determine whether the extended identifier field to be allocated is equal to the maximum extended identifier field configured during the allocation process. If the allocation process of extended identifier field n-1 triggers the margin threshold, then the default extended identifier n-1 is incremented to n, and extended identifier n is selected as the value of the extended identifier field, which is determined as the extended identifier field corresponding to the first business scenario. If the extended identifier field to be allocated is equal to the maximum extended identifier field configured during the allocation process, execute step 715 to determine whether the number of times the first available identifier segment is selected from the first available identifier segment in the memory cache exceeds 10 times.

[0196] Step 715: Check if the number of times the first available identifier segment is selected from memory exceeds 10;

[0197] If the number of times the first available identifier segment is selected from the first available identifier segment in the memory cache exceeds 10, then step 703 is executed to reread the extended identifier field; if the number of times the first available identifier segment is selected from the memory does not exceed 10, then step 707 is executed to select the first available identifier segment from the database again. In this embodiment, the number of times the first available identifier segment is selected from the memory is set to 10. In different embodiments, it can be set to different values, and this application embodiment does not limit this.

[0198] Step 716: End.

[0199] Figure 8 This is a schematic diagram of the memory structure during the identifier allocation process provided in the embodiments of this application.

[0200] In the process of identifier allocation, in order to achieve fast allocation, the available identifier number range corresponding to each first business scenario is usually stored in memory 80. At the same time, a portion of the identifier number range is cached in memory 80. When allocating identifiers, allocation is first performed from the cached data in memory 80. If the available identifier number range in the cached data in memory 80 is insufficient, a portion of the available identifier number range is cached again from the database and then stored in memory 80.

[0201] The structure of memory 80 includes a management section 82 and a cache section 84.

[0202] The management section 82 can be applied to multiple business scenarios. For example, in business scenario 1, which corresponds to business identifier field 1, after selecting the default extended identifier field N-1, the business identifier field and the extended identifier field are locked. The object identifier field is then selected, generating a list of available identifier segments, a list of unavailable identifier segments, and the extended identifier field N-1. If assigning the default extended identifier field N-1 fails, the extended identifier field is incremented to select extended identifier field N. The business identifier field and the extended identifier field are locked, and the object identifier field is selected, generating a list of available identifier segments, a list of unavailable identifier segments, and the extended identifier field N during the selection process.

[0203] The cache section 84 is used to cache available identifier ranges corresponding to multiple business scenarios. For example, in business scenario 1, business scenario 1 corresponds to business identifier field 1. After selecting the default extended identifier field N-1, the business identifier field and the extended identifier field are locked. The object identifier field is then selected. During the selection process, the currently allocated identifiers and the maximum allocated identifiers of the available identifier range cached in memory are continuously updated. If the allocation of the default extended identifier field N-1 fails, the extended identifier field is incremented to select extended identifier field N. The business identifier field and the extended identifier field are locked. During the selection of the object identifier field, the currently allocated identifiers and the maximum allocated identifiers of the available identifier range cached in memory are continuously updated. After the unallocated identifiers of the available identifier range cached in memory are exhausted, an application can be made to the database to allocate identifiers from cache 2 to memory.

[0204] Figure 9 A structural block diagram of an identifier allocation apparatus provided in an exemplary embodiment of this application is shown. The apparatus includes:

[0205] The receiving module 1010 is used to receive the identifier allocation request sent by the client. The identifier allocation request is used to request the allocation of identifiers for business objects in the first business scenario. The first business scenario is one of the different business scenarios.

[0206] The first determining module 1020 is used to determine the business identifier field corresponding to the first business scenario;

[0207] The second determining module 1030 is used to determine multiple unassigned identifiers corresponding to the first business scenario;

[0208] The third determining module 1040 is used to determine the object identifier field to be allocated this time from among multiple unallocated identifiers corresponding to the first business scenario;

[0209] The allocation module 1060 is used to generate the identifier for this allocation by combining the business identifier field and the object identifier field.

[0210] Optionally, the third determining module 1040 is used to determine the object identifier field to be allocated this time from the cached unallocated identifiers when there are multiple unallocated identifiers corresponding to the first business scenario cached in the cached data in memory.

[0211] Optionally, the third determining module 1040 is used to cache a third number of unallocated identifiers from the first available identifier segment in the database into the cache data in memory when the first number is greater than the second number; wherein, the first number is the number of identifiers requested in this application, the second number is the number of unallocated identifiers in the first available identifier segment cached in the cache data in memory, and the third number is equal to the sum of the first difference and the cache threshold value, and the first difference is the difference between the first number and the second number.

[0212] Optionally, the third determining module 1040 is further configured to set the first available identifier field as an unavailable identifier field when the fourth quantity is less than the cache threshold; and to select the second available identifier field to replace the first available identifier field from the available identifier fields corresponding to the business scenario when the fourth quantity is greater than the cache threshold and less than the third quantity; wherein the first available identifier number segment is one of the available identifier number segments corresponding to the first business scenario.

[0213] Optionally, the second determining module 1030 is used to determine at least one identifier segment corresponding to the first business scenario; obtain the unavailable identifier segment corresponding to the first business scenario based on the historical records; and obtain the available identifier segment corresponding to the first business scenario based on the difference between the at least one identifier segment and the unavailable identifier segment.

[0214] Optionally, the device further includes a fourth determining module 1050, configured to determine the extended identifier field corresponding to the first business scenario, wherein the extended identifier field is a field used to extend the number of available bits of the object identifier field; if the number of remaining unallocated identifiers in the available identifier segment corresponding to the first business scenario meets the margin threshold, the default extended identifier is determined as the extended identifier field corresponding to the first business scenario; if the number of remaining unallocated identifiers in the available identifier segment corresponding to the first business scenario does not meet the margin threshold, the default extended identifier is incremented or decremented and then determined as the extended identifier field corresponding to the first business scenario.

[0215] Optionally, the allocation module 1060 is used to generate the identifier for this allocation by combining the business identifier field, the extended identifier field, and the object identifier field.

[0216] This application also provides an identifier allocation system, which includes at least one server and at least one client, wherein the at least one server is used to execute the identifier allocation method provided in the above-described method embodiments.

[0217] At least one server includes: a first server and a second server; under different business scenarios, the first server is used to execute the identifier allocation method provided in the above method embodiments for a first business scenario; the second server is used to execute the identifier allocation method provided in the above method embodiments for a second business scenario.

[0218] At least one server further includes: a third server and a fourth server; under the same business scenario, the third server can be used to execute the identifier allocation method provided in the above method embodiments for the first group of available identifier number segments in the first business scenario; the fourth server can be used to execute the identifier allocation method provided in the above method embodiments for the second group of available identifier number segments in the first business scenario.

[0219] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the video data tracking method provided in the above-described method embodiments.

[0220] Alternatively, the computer device is a server. For example, Figure 10 This is a structural block diagram of a server provided in an exemplary embodiment of this application.

[0221] Typically, server 1100 includes a processor 1101 and memory 1102.

[0222] Processor 1101 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1101 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). Processor 1101 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, processor 1101 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, processor 1101 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0223] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1102 are used to store at least one instruction, which is executed by the processor 1101 to implement the video data tracking method provided in the method embodiments of this application.

[0224] In some embodiments, server 1100 may optionally include an input interface 1103 and an output interface 1104. Processor 1101, memory 1102, and input interface 1103 and output interface 1104 can be connected via a bus or signal lines. Various peripheral devices can be connected to input interface 1103 and output interface 1104 via a bus, signal lines, or circuit board. Input interface 1103 and output interface 1104 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1101 and memory 1102. In some embodiments, processor 1101, memory 1102, and input interface 1103 and output interface 1104 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1101, memory 1102, and input interface 1103 and output interface 1104 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.

[0225] Those skilled in the art will understand that Figure 10 The structure shown does not constitute a limitation on server 1100 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0226] This application also provides a computer-readable storage medium storing at least one piece of program code. When the program code is loaded and executed by the processor of a computer device, it implements the identifier allocation method provided in the above-described method embodiments.

[0227] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the identifier allocation method provided in the above-described method embodiments.

[0228] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0229] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent switching, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for assigning identifiers, characterized in that, The method is executed by any node in a distributed network, and the cached data of the node includes multiple unassigned identifiers corresponding to different business scenarios. The method includes: Receive an identifier allocation request sent by the client, the identifier allocation request being used to request the allocation of an identifier for a business object in a first business scenario, the first business scenario being one of the different business scenarios; Determine the business identifier field corresponding to the first business scenario, multiple unassigned identifiers corresponding to the first business scenario, and at least one identifier number segment corresponding to the first business scenario; and obtain the unavailable identifier number segment corresponding to the business scenario in the historical records. Based on the difference between the at least one identifier segment and the unavailable identifier segment, the available identifier segment corresponding to the first business scenario is obtained; If the number of remaining unallocated identifiers in the available identifier segment corresponding to the first business scenario meets the margin threshold, the default extended identifier is determined as the extended identifier field corresponding to the first business scenario. The extended identifier field is a field used to extend the number of available bits of the object identifier field. If the number of remaining unallocated identifiers in the available identifier segment corresponding to the first business scenario does not meet the margin threshold, the default extended identifier is incremented or decremented and then determined as the extended identifier field corresponding to the first business scenario. If the first quantity is less than or equal to the second quantity, the object identifier field to be allocated this time is determined from the unallocated identifiers cached in the cached data in memory; the cached data caches multiple unallocated identifiers corresponding to the first business scenario, the first quantity is the number of identifiers requested in this application, and the second quantity is the number of unallocated identifiers cached in the cached data; If the first quantity is greater than the second quantity, obtain the remaining amount of unallocated identifiers in the database for the first available identifier segment as the fourth quantity, and: If the fourth quantity is less than the cache threshold, the first available identifier segment is set to an unavailable identifier segment; If the fourth quantity is greater than the cache threshold and less than the third quantity, the second available identifier segment is selected from the available identifier segments corresponding to the first business scenario to replace the first available identifier segment; If the fourth quantity is greater than the third quantity, the third quantity of unallocated identifiers from the first available identifier segment are cached in the cached data from the database, and the object identifier field for this allocation is determined from the unallocated identifiers cached in the cached data; wherein, the third quantity is equal to the sum of the first difference and the cache threshold value, the first difference is the difference between the first quantity and the second quantity, the cache threshold value is the minimum threshold value of the cached unallocated identifiers, and the first available identifier segment is one of the available identifier segments corresponding to the first business scenario; The assigned identifier is generated by combining the business identifier field, the extended identifier field, and the object identifier field in a cascading manner.

2. The method according to claim 1, characterized in that, The method further includes: The identifier allocation process is monitored to obtain monitoring data; If the monitored data triggers a warning condition, an alarm processing operation is performed.

3. The method according to claim 2, characterized in that, The monitoring data includes: the number of identifiers allocated in the first business scenario per unit time. When the monitoring data triggers a warning condition, the alarm processing operation is performed, including: If the number of identifiers allocated in the first business scenario within the unit time exceeds a first threshold, a first alarm event is output.

4. The method according to claim 2, characterized in that, The monitoring data includes: the number of identifiers allocated in a single allocation for the first business scenario; When the monitoring data triggers a warning condition, the alarm processing operation is performed, including: If the number of identifiers requested in a single identifier allocation in the first business scenario exceeds the second threshold, the allocation will be blocked.

5. The method according to claim 2, characterized in that, The monitoring data includes: the number of identifiers allocated in the first business scenario; the target IDs in the first business scenario and the second business scenario are related, and the upper limit of identifier allocation for the target IDs has a third threshold value; When the monitoring data triggers a warning condition, the alarm processing operation is performed, including: If the number of identifiers allocated in the first business scenario reaches the third threshold value corresponding to the target ID, a second alarm event is output.

6. The method according to claim 2, characterized in that, The monitoring data includes: the remaining identifier allocation for the first business scenario obtained through periodic scanning; When the monitoring data triggers a warning condition, the alarm processing operation is performed, including: If the remaining amount of the unassigned identifier corresponding to the first business scenario is lower than the fourth threshold, a third alarm event is output.

7. A labeling and distributing device, characterized in that, The device includes: The receiving module is used to receive an identifier allocation request sent by the client. The identifier allocation request is used to request the allocation of an identifier for a business object in a first business scenario. The first business scenario is one of a series of different business scenarios. The first determining module is used to determine the business identifier field corresponding to the first business scenario; The second determining module is used to determine the business identifier field corresponding to the first business scenario, multiple unassigned identifiers corresponding to the first business scenario, and at least one identifier number segment corresponding to the first business scenario; and to obtain the unavailable identifier number segment corresponding to the business scenario from historical records; and to obtain the available identifier number segment corresponding to the first business scenario based on the difference between the at least one identifier number segment and the unavailable identifier number segment. The fourth determining module is used to determine the default extended identifier as the extended identifier field corresponding to the first business scenario when the number of remaining unallocated identifiers in the available identifier segment corresponding to the first business scenario meets the margin threshold. The extended identifier field is a field used to extend the number of available bits of the object identifier field. When the number of remaining unallocated identifiers in the available identifier segment corresponding to the first business scenario does not meet the margin threshold, the default extended identifier is incremented or decremented and then determined as the extended identifier field corresponding to the first business scenario. The third determining module is used to determine the object identifier field to be allocated this time from the cached multiple unallocated identifiers when there are multiple unallocated identifiers corresponding to the first business scenario in the cached data in memory; The third determining module is further configured to: when the first quantity is less than or equal to the second quantity, determine the object identifier field to be allocated in this allocation from the unallocated identifiers cached in the cached data in memory; the cached data caches multiple unallocated identifiers corresponding to the first business scenario, the first quantity is the number of identifiers requested in this application, and the second quantity is the number of unallocated identifiers cached in the cached data; when the first quantity is greater than the second quantity, obtain the remaining amount of unallocated identifiers of the first available identifier segment in the database as a fourth quantity, and: when the fourth quantity is less than the cache threshold, set the first available identifier segment to an unavailable identifier segment; when the fourth quantity is greater than the cache threshold and If the number is less than the third quantity, the second available identifier segment is selected from the available identifier segments corresponding to the first business scenario to replace the first available identifier segment; if the fourth quantity is greater than the third quantity, the third quantity of unallocated identifiers from the first available identifier segment are cached in the cache data from the database, and the object identifier field for this allocation is determined from the unallocated identifiers cached in the cache data; wherein, the third quantity is equal to the sum of the first difference and the cache threshold value, the first difference is the difference between the first quantity and the second quantity, the cache threshold value is the minimum threshold value of the cached unallocated identifiers, and the first available identifier segment is one of the available identifier segments corresponding to the first business scenario; The allocation module is used to generate the identifier for this allocation by combining the business identifier field, the extended identifier field, and the object identifier field.

8. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the identifier allocation method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the identifier allocation method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program or instructions that, when executed by a processor, implement the identifier allocation method as described in any one of claims 1 to 6.