Identification allocation method, identification information acquisition method, device, electronic equipment, storage medium and program product
By obtaining and storing the remaining identifier information from the identifier segment construction server after the service partition is initialized, and constructing the target identifier segment, the waste caused by identifier loss in the allocation server is solved, and the utilization rate of identifier space is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2024-11-29
- Publication Date
- 2026-05-29
AI Technical Summary
The identifiers cached in the allocation server were lost due to reasons such as the migration of example processes, resulting in a waste of identifier space.
After the service partition is initialized, the remaining identifier information of the target service partition is obtained and stored by the identifier segment construction server, the target identifier segment is constructed and stored in the cache for subsequent identifier allocation.
This avoids wasting identifiers due to initialization and improves the utilization rate of identifier space.
Smart Images

Figure CN122120244A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to an identifier allocation method, an identifier information acquisition method, an apparatus, an electronic device, a storage medium, and a program product. Background Technology
[0002] To speed up identifier allocation, the allocation server typically pre-caches a certain number of identifiers and, upon receiving an identifier allocation request from the business party, directly retrieves the identifier from the cache for allocation.
[0003] However, the identifiers cached in the allocation server may be lost due to example process migration, resulting in a waste of identifier space. Summary of the Invention
[0004] This disclosure provides an identifier allocation method, an identifier information acquisition method, an apparatus, an electronic device, a storage medium, and a program product to improve the utilization rate of identifier space.
[0005] In a first aspect, this disclosure provides an identifier allocation method, which, after initializing the target service partition corresponding to the target business party, sends an initialization message to an identifier segment construction server and receives a response message returned by the identifier segment construction server in response to the initialization message.
[0006] Based on the response message, the target remaining identifier information of the target service partition is obtained. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization.
[0007] The target identifier segment of the target service partition is constructed based on the target remaining identifier information, and the target identifier segment is stored in the cache of the target service partition;
[0008] Based on the target identifier segment, an original identifier is allocated to the target business party, so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier.
[0009] Secondly, embodiments of this disclosure provide a method for obtaining identification information, the method being executed by an identification segment construction server, the method comprising:
[0010] Receive the initialization message sent by the identifier allocation server after initializing the target service partition;
[0011] In response to the initialization message, the target remaining identifier information of the target service partition is obtained. The target remaining identifier information is the identifier information that has been stored and not yet allocated before the initialization of the target service partition. The target remaining identifier information is stored by the identifier segment construction server.
[0012] A response message to the initialization message is generated based on the target remaining identifier information, and the response message is sent to the identifier allocation server. The response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
[0013] Thirdly, embodiments of this disclosure also provide an identifier allocation device, the device being configured within an identifier allocation server, the identifier allocation server including multiple service partitions, the device comprising:
[0014] The initialization message sending module is used to send an initialization message to the identifier segment construction server after initializing the target service partition corresponding to the target business party, and to receive the response message returned by the identifier segment construction server in response to the initialization message.
[0015] The first information acquisition module is used to acquire the target remaining identification information of the target service partition based on the response message. The target remaining identification information is the identification information that the target service partition has stored and has not yet been allocated before initialization.
[0016] The identifier segment construction module is used to construct the target identifier segment of the target service partition based on the target remaining identifier information, and store the target identifier segment in the cache of the target service partition;
[0017] The identifier allocation module is used to allocate an original identifier to the target business party based on the target identifier segment, so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier.
[0018] Fourthly, embodiments of this disclosure also provide an identification information acquisition device, the device being configured within an identification segment construction server, the device comprising:
[0019] The initialization message receiving module is used to receive the initialization message sent by the identifier allocation server after initializing the target service partition;
[0020] The second information acquisition module is used to acquire the target remaining identifier information of the target service partition in response to the initialization message. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization. The target remaining identifier information is stored by the identifier segment construction server.
[0021] The response information sending module is used to generate a response message to the initialization message based on the target remaining identifier information, and send the response message to the identifier allocation server. The response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
[0022] Fifthly, embodiments of this disclosure also provide an electronic device, including:
[0023] One or more processors;
[0024] Memory, used to store one or more programs.
[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the identifier allocation method or identifier information acquisition method as described in the embodiments of this disclosure.
[0026] Sixthly, embodiments of this disclosure also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the identifier allocation method or identifier information acquisition method as described in embodiments of this disclosure.
[0027] In a seventh aspect, embodiments of this disclosure also provide a computer program product that, when executed by a computer, enables the computer to implement the identifier allocation method or identifier information acquisition method as described in embodiments of this disclosure.
[0028] The identifier allocation method, identifier information acquisition method, apparatus, electronic device, storage medium, and program product provided in this disclosure store the remaining identifier information of each service partition through an identifier segment construction server. After initializing a service partition, the identifier allocation server constructs an identifier segment for this service partition based on the remaining identifier information stored in the identifier segment construction server. This allows the remaining identifier segments of this service partition before initialization to continue to be used for identifier allocation, avoiding identifier waste due to initialization and improving the utilization rate of identifier space. Attached Figure Description
[0029] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0030] Figure 1 A flowchart illustrating an identifier allocation method provided in an embodiment of this disclosure;
[0031] Figure 2A flowchart illustrating another identifier allocation method provided in this embodiment of the disclosure;
[0032] Figure 3 This is a schematic diagram of another business object identifier provided in an embodiment of the present disclosure;
[0033] Figure 4 A flowchart illustrating a method for obtaining identification information provided in an embodiment of this disclosure;
[0034] Figure 5 This is a schematic diagram of the structure of an identifier generation system provided in an embodiment of the present disclosure;
[0035] Figure 6 A schematic diagram of system components for an identifier generation system deployed in a cloud-native manner, as provided in an embodiment of this disclosure;
[0036] Figure 7 A structural block diagram of an identifier allocation device provided in an embodiment of this disclosure;
[0037] Figure 8 A structural block diagram of an identification information acquisition device provided in an embodiment of this disclosure;
[0038] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0039] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0040] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0041] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0042] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0043] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0044] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0045] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0046] Figure 1 This is a flowchart illustrating an identifier allocation method provided in an embodiment of this disclosure. The method can be executed by an identifier allocation device configured within an identifier allocation server. This device can be implemented in software and / or hardware and can be configured in an electronic device, typically a computer. The identifier allocation method provided in this disclosure is applicable to scenarios where, during service partition initialization, the cached identifier segments of the service partition prior to initialization are restored.
[0047] When initializing a service partition in the identifier allocation server, the relevant instance processes in the target service partition (such as the identifier allocation process) also need to be initialized. Taking the identifier allocation process as an example, when initializing the identifier allocation process in the service partition, the cached identifier segments in the target service partition need to be deleted. After initialization, the identifier allocation process typically waits for the identifier supplementation server to supplement the initialized service partition with identifier segments, and then uses the supplemented identifier segments to allocate identifiers to the business. This identifier allocation method results in the deleted identifier segments not being allocated to the business, causing a waste of identifier space.
[0048] In view of this, the present disclosure provides an identifier allocation method that restores the identifier segments deleted during initialization after initialization, so as to avoid the waste of identifier segments due to initialization and improve the utilization rate of identifier space.
[0049] like Figure 1 As shown, the identifier allocation method provided in this embodiment may include:
[0050] S101. After initializing the target service partition corresponding to the target business party, send an initialization message to the identifier segment construction server and receive the response message returned by the identifier segment construction server in response to the initialization message.
[0051] In this embodiment, the identifier allocation server includes multiple service partitions. Each service partition is a processing unit within the identifier allocation server used to handle identifier allocation requests forwarded by a proxy. Multiple service partitions can be divided within the identifier allocation server to provide services to different business parties, thereby achieving isolation between them. For example, a business party can have one or more service partitions in each data center, and these service partitions can be distributed across different identifier allocation instances. Each service partition can record an identifier segment provided by the identifier supplementation server in its memory and use this segment for identifier allocation.
[0052] The identifier allocation server can be understood as a server used to allocate identifiers to business users. It contains multiple service partitions. Identifier allocation servers can be deployed within the identifier generation system, and the number of identifier allocation servers is unlimited; for example, the identifier generation system can be configured with one or more identifier allocation servers. The identifier segment construction server can be understood as a server used to store the remaining identifier information of each service partition within the identifier allocation servers in the identifier generation system.
[0053] The target service partition can be understood as the service partition in the identifier allocation server that needs to be initialized. The target service partition can be any partition in the identifier allocation service area. For example, when initializing each service partition in the identifier allocation server, this service partition can be used as the target service partition to execute the identifier allocation method provided in the embodiments of this disclosure.
[0054] The target service provider can be the service provider corresponding to the target service partition, that is, the service provider that provides services to the target service partition after its initialization. This service provider can be, for example, a tenant; for instance, the service provider can access the platform as a tenant.
[0055] An initialization message can be sent by the identifier allocation server to the identifier segment construction server after the initialization of a service partition. This message is used to retrieve the remaining identifier information of that service partition before initialization. The type of initialization message is not limited; for example, it can be an initialization barrier message. This initialization message may carry the session control identifier of the target service partition. The response message can be understood as the message returned by the identifier segment construction server in response to this initialization message.
[0056] Specifically, after initializing the target service partition corresponding to the target business, an initialization message can be sent to the identifier segment construction server. This initialization message notifies the identifier segment construction server that the target service partition corresponding to the target business has been initialized. Upon receiving this initialization message, the identifier segment construction server can process the remaining identifier information of the target service partition before initialization based on this initialization message, and then return a response message to the identifier allocation server after processing. Correspondingly, the identifier allocation server can receive the response message returned by the identifier segment construction server.
[0057] In this embodiment, the timing of initializing the identifier partition in the identifier allocation server is not limited. For example, each identifier allocation server can be configured with an identifier allocation instance. Identifier allocation instances of different identifier allocation servers can select the identifier allocation right of the business party within the identifier generation system through the reliable coordination system of the distributed system (Zookeeper, ZK). After the current identifier allocation server selects and obtains the identifier allocation right of the target business party, it needs to migrate the target service partition of the target business party to this identifier allocation server. When migrating the target service partition, the target service partition needs to be initialized.
[0058] S102. Obtain the target remaining identifier information of the target service partition based on the response message. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization.
[0059] The target remaining identifier information can be understood as the latest remaining identifier information of the target service partition before initialization. This remaining identifier information can be understood as the identifier information stored in the target service partition's cache before initialization that has not yet been allocated to the target service party. For example, the information of the remaining identifier segments stored in the target service partition's cache before initialization that have not yet been allocated to the target service party. The remaining identifier information may include the endpoint information of this remaining identifier segment, and may also include the length information of this remaining identifier segment, that is, the number of identifiers contained in this remaining identifier segment.
[0060] Specifically, after receiving the response message returned by the identifier segment construction server, the remaining identifier information of the target service partition before initialization can be obtained based on this response message.
[0061] There are no restrictions on the method of obtaining the target remaining identifier information of the target service partition based on the response message. For example, the response message may carry the storage location information of the target remaining identifier information, such as the storage address. Thus, after receiving the response message returned by the identifier segment construction server, the identifier allocation server can parse the response message to obtain the storage location information carried in the response message, and obtain the target remaining identifier information of the target service partition based on the storage location information.
[0062] In some implementations, the response message may carry target remaining identifier information for the target service partition. The identifier segment construction server may send the target remaining identifier information for the target service partition, which it stores, to the identifier allocation server in the response message.
[0063] Therefore, after receiving the response message returned by the identifier segment construction server, the identifier allocation server can parse the response message to obtain the target remaining identifier information of the target service partition carried in the response message.
[0064] Optionally, obtaining the target remaining identifier information of the target service partition based on the response message includes: parsing the response message to obtain the target remaining identifier information carried in the response message.
[0065] In other implementations, the response message may not carry the target remaining identifier information of the target service partition. Considering the delay between the identifier allocation event being written to the preset message queue of the target service partition and the identifier allocation event becoming visible to the identifier segment construction server, and the time interval between the identifier segment construction server reading the identifier allocation event and updating the remaining identifier information stored in the identifier segment construction data, after receiving the initialization message from the identifier allocation server, the identifier segment construction server can update the latest remaining identifier information of the target service partition stored in its own cache to the identifier segment construction database corresponding to the identifier segment construction server without reaching the preset update cycle. After the update is completed, it sends a response message to the identifier allocation server to ensure that the target remaining identifier information obtained by the identifier allocation server from the identifier segment construction database is the latest remaining identifier information before the target service partition was initialized.
[0066] Therefore, when the identifier allocation server receives the response message returned by the identifier segment construction server, it indicates that the identifier segment construction database already stores the latest remaining identifier information of the target service partition before initialization. In response to this response message, the identifier allocation server can access the identifier segment construction database corresponding to the identifier segment construction server and obtain the aforementioned latest remaining identifier information of the target server from this identifier segment construction database as the target remaining identifier information of the target server.
[0067] Optionally, obtaining the target remaining identifier information of the target service partition based on the response message includes: in response to the response message, obtaining the remaining identifier information of the target service partition stored in the identifier segment construction database as the target remaining identifier information; the response message is sent after the remaining identifier information of the target service partition stored in the identifier segment construction database is updated; the identifier segment construction database corresponds to the identifier segment construction server.
[0068] S103. Construct the target identifier segment of the target service partition based on the target remaining identifier information, and store the target identifier segment in the cache of the target service partition.
[0069] The target identifier segment can be understood as an identifier segment corresponding to the target service partition, which can be used to allocate identifiers for the target business party corresponding to the target service partition. This identifier segment can be used to indicate a continuous range of original identifiers; for example, the identifier segment can be stored in the form of an identifier interval. The target identifier segment is stored in the cache of the target service partition. For example, after receiving an identifier allocation request from the target business party, the identifier allocation server can directly allocate identifiers for the target business party based on the target identifier segment stored in the target service partition cache, without needing to obtain it from the identifier supplementation server, thus improving the identifier allocation rate.
[0070] For example, after obtaining the target remaining identifier information of the target service partition before initialization, the identifier allocation server can restore the remaining identifier segment of the target service partition before initialization based on this target remaining identifier information, use it as the target identifier segment of the target service partition, and store this target identifier segment in the cache of the target service partition so that the target service party can be assigned an identifier based on the target identifier segment cached by the target service partition.
[0071] S104. Based on the target identifier segment, an original identifier is allocated to the target business party so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier.
[0072] In this embodiment, identifiers can be allocated to the target service provider based on the target identifier segment. For example, upon receiving an identifier allocation request from the target service provider, an original identifier can be obtained from the target identifier segment and allocated to the target service provider. This original identifier can be understood as the identifier contained in the target identifier segment, and the target service provider can generate the final service object identifier for its service object based on this original identifier.
[0073] In this embodiment, the identifier segments cached in each service partition (including the target service partition) of the identifier allocation server can be supplemented by the identifier allocation server. For example, the identifier allocation server can detect the remaining number of identifier segments cached in each service partition, and when the remaining number of identifier segments meets the preset supplementation conditions, send supplementary identifier segments to the corresponding service partition.
[0074] The supplementary identifier segment can be understood as a newly added identifier segment sent by the identifier supplementation server to supplement the identifier segments cached in the service partition. The method for determining the number of original identifiers contained in the supplementary identifier segment (i.e., the number of identifiers in a single supplement) is not limited. Preset supplementation conditions can be flexibly set as needed; for example, the preset supplementation conditions can be set to the ratio between the remaining number of identifiers in the service partition and the number of identifiers in a single supplement for this service partition being less than or equal to a first preset ratio threshold.
[0075] In some implementations, a single replenishment quantity can be pre-set for each service partition, and the single replenishment quantities for different service partitions can be the same or different. Thus, when the identification server detects that the remaining number of identifiers for a service partition meets the preset replenishment conditions, it can obtain an identifier segment based on the pre-set single replenishment quantity for that service partition, use it as a replenishment identifier segment for that service partition, and send it to the identifier allocation server to which that service partition belongs. Correspondingly, after receiving the replenishment identifier segment sent by the identifier replenishment server, the identifier allocation server can add this replenishment identifier segment to the identifier segments cached for that service partition.
[0076] In some implementations, the number of identifiers supplemented at one time for each service partition can be determined based on the identifier generation rate of the service provider corresponding to that service partition. Optionally, the identifier allocation method may further include: when receiving a supplementary identifier segment sent by the identifier supplementation server for the target service partition, adding the supplementary identifier segment to the target identifier segment, wherein the identifier quantity information of the supplementary identifier segment is the single-time supplementary quantity information of the target service provider, and the single-time supplementary quantity information is determined based on the identifier generation rate of the target service provider.
[0077] For example, the identifier replenishment server can obtain the identifier generation rate of the business party corresponding to each service partition, and determine the single replenishment quantity information of the corresponding identifier service partition based on this identifier generation rate. For instance, it can multiply the identifier generation rate of the business party corresponding to the service partition by a first preset coefficient, and use the resulting product as the single replenishment quantity of this service partition, thereby realizing dynamic identifier replenishment for service partitions corresponding to different business parties. Therefore, when the identifier server detects that the remaining identifier quantity of a certain service partition (such as a target service partition) meets the preset replenishment conditions, it can obtain an identifier segment based on the calculated single replenishment quantity of this identifier service partition, use it as a replenishment identifier segment for this service partition, and send it to the identifier allocation server to which this service partition belongs. Correspondingly, after receiving the replenishment identifier segment sent by the identifier replenishment server, the identifier allocation server can add this replenishment identifier segment to the identifier segments cached for this service partition.
[0078] The single replenishment quantity information for a service partition can be understood as the quantity of original identifiers replenished to this service partition in a single instance, such as the length information of the replenished identifier segment sent to this service partition in a single instance. The identifier replenishment server can be a server used to replenish new identifier segments for service partitions in the identifier allocation server. For example, the identifier replenishment server can maintain a large identifier segment. For instance, the identifier replenishment server can register an identifier segment in the identifier space and store this replenished identifier segment. When the remaining number of identifiers in this replenished identifier segment is less than a set proportion, it can register another identifier segment and add it to the original identifier segment maintained by the identifier replenishment server. Furthermore, it can delete the occupied portion of this original identifier segment, thereby maintaining a replenishable identifier segment within the identifier replenishment server.
[0079] For example, the identifier supplementation server can extract an unused sub-identifier segment from the unused portion of its maintained identifier segment based on the single supplementation quantity of the corresponding service partition and the occupied identifier information of the supplementation identifier segment, and send it to the corresponding service partition to supplement the identifier segment cached by this service partition.
[0080] Occupied identifier information can be understood as identifier information that has been used, which can be used to indicate the sub-identifier segments that have been supplemented to the service partition in the identifier segments maintained by the identifier supplementation server. The storage method of occupied identifier information can be flexibly configured. Optionally, the identifier supplementation server adopts distributed heterogeneous storage technology to store the occupied identifier information with strong consistency, so as to further improve the accuracy of the stored occupied identifier information.
[0081] For cases where occupied identifier information is stored with strong consistency using distributed heterogeneous storage technology, for example, when the identifier allocation server is supplementing identifiers, it can first query the occupied identifier information of the supplementary identifier segment from multiple distributed heterogeneous storage databases. If the number of databases where the occupied identifier information is successfully read meets a preset condition, the occupied identifier information can be considered to have been successfully read, and the occupied identifier information with the largest version number can be obtained as the valid occupied identifier information of the supplementary identifier segment. Conversely, if the number of databases where the occupied identifier information is successfully read does not meet the preset condition, the occupied identifier information can be considered to have failed to be read, and the current identifier supplementation process ends.
[0082] After obtaining valid occupied identifier information for the supplementary identifier segment, a sub-identifier segment can be extracted from the unoccupied portion of the maintained identifier segment based on this occupied identifier information and the single supplement quantity information corresponding to the service partition for which identifier supplementation is performed this time, and used as the supplementary identifier segment for this service partition.
[0083] After obtaining the supplementary identifier segment, the occupied identifier information of the identifier segment maintained by the identifier supplementation server can be updated based on the supplementary identifier segment, and the updated occupied identifier information can be written to multiple distributed heterogeneous storage databases. If the number of databases whose occupied identifier information has been successfully written meets a preset condition, the occupied identifier information can be considered to have been written successfully. After successful writing, the obtained supplementary identifier segment can be added to the corresponding service partition. Conversely, if the number of databases whose occupied identifier information has been successfully written does not meet the preset condition, the occupied identifier information writing can be considered to have failed, and the identifier supplementation process ends.
[0084] As an optional implementation, taking the existence of three distributed heterogeneous (Quorum) storage databases as an example, the preset condition can be set to ensure that all databases are successfully read (i.e., the preset success threshold R = 3). In this case, any failed query will end the current round of identifier replenishment. When R = 3, if a type of storage remains unreadable for a period of time (which usually means unusable), the replenishment of identifiers is directly abandoned, thus avoiding waste of identifier segments. However, if identifier replenishment is continuously abandoned, it may result in too few remaining identifiers in the service partition. Therefore, when the identifier segments in the service partition are consumed to a certain extent, such as when the proportion of remaining identifiers is less than a set proportion threshold (e.g., 0.3 or 0.4), the value of R can be reduced, for example, by adjusting R to 2, to replenish new identifier segments in the identifier partition of the identifier allocation server.
[0085] The identifier allocation method provided in this embodiment, after initializing the target service partition corresponding to the target business party, sends an initialization message to the identifier segment construction server and receives a response message returned by the identifier segment construction server for this initialization message; based on this response message, it obtains the target remaining identifier information of the target service partition, which is the identifier information that was stored but not yet allocated before the target service partition was initialized; it constructs a target identifier segment of the target service partition according to the target remaining identifier information and stores the target identifier segment in the cache of the target service partition; it allocates identifiers to the target business party based on the target identifier segment, wherein the original identifier allocated to the target business party is used to generate the business object identifier of the target business party, and this original identifier is located within the target identifier segment. This embodiment utilizes the above technical solution, storing the remaining identifier information of each service partition through the identifier segment construction server, and after initializing a certain service partition, constructing an identifier segment for this service partition through the identifier allocation server based on the remaining identifier information stored by the identifier segment construction server, thereby continuing to use the remaining identifier segment before the initialization of this service partition for identifier allocation, avoiding the waste of identifiers due to initialization, and improving the utilization rate of identifier space.
[0086] Figure 2 This is a flowchart illustrating another identifier allocation method provided in an embodiment of this disclosure. The scheme in this embodiment can be combined with one or more optional schemes in the above embodiments. Optionally, the step of allocating an original identifier to the target service party based on the target identifier segment includes: responding to a target identifier allocation request sent by the target service party, obtaining a sub-identifier segment to be allocated from the target identifier segment as the identifier segment to be allocated for the target service party, wherein the identifier segment to be allocated contains at least one original identifier; updating the target remaining identifier information according to the identifier segment to be allocated; generating an identifier allocation event carrying the updated target remaining identifier information, and adding the identifier allocation event to a preset message queue of the target service partition, wherein the preset message queue supports reading by the identifier segment construction server; when the identifier allocation event is successfully added, sending the identifier segment to be allocated to the target service party.
[0087] Correspondingly, such as Figure 2 As shown, the identifier allocation method provided in this embodiment may include:
[0088] S201. After initializing the target service partition corresponding to the target business party, send an initialization message to the identifier segment construction server and receive the response message returned by the identifier segment construction server in response to the initialization message.
[0089] S202. Obtain the target remaining identifier information of the target service partition based on the response message. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization.
[0090] S203. Construct the target identifier segment of the target service partition based on the target remaining identifier information, and store the target identifier segment in the cache of the target service partition.
[0091] S204. In response to the target identifier allocation request sent by the target service provider, obtain the sub-identifier segment to be allocated from the target identifier segment, and use it as the identifier segment to be allocated by the target service provider. The identifier segment to be allocated contains at least one original identifier.
[0092] The target identifier allocation request can be understood as an identifier allocation request sent by the target service provider. A target identifier allocation request can be used to request the allocation of a new identifier segment to the target service provider. The identifier segment to be allocated can be understood as the identifier segment allocated to the target service provider by the identifier allocation server in response to the target identifier allocation request sent by the target service provider.
[0093] For example, when the target business has only a small number of original identifiers remaining locally, such as when the ratio between the number of original identifiers and the number of identifiers replenished in a single instance is less than or equal to a second preset ratio threshold, it can send an identifier allocation request to the identifier allocation server.
[0094] Correspondingly, the identifier allocation server can receive the identifier allocation request sent by the target service party, and in response to the identifier allocation request, retrieve an unallocated sub-identifier segment from the target identifier segment stored in the cache of the target service partition, as the identifier segment to be allocated to the target service party.
[0095] The method for obtaining the identifier segment to be allocated can be flexibly set. For example, the single allocation quantity information of the target business party can be obtained, and based on this single allocation quantity information, an unallocated sub-identifier segment can be obtained from the target identifier segment as the identifier segment to be allocated.
[0096] The single allocation quantity information of a certain business party (such as the target business party) can be understood as the quantity information of original identifiers allocated to this business party in a single instance, such as the length information of the identifier segment to be allocated sent to this business party in a single instance. The single allocation quantity information corresponding to different business parties can be the same or different. For example, the single allocation quantity information of each business party can be preset and stored; or the single allocation quantity information of each business party can be determined based on the identifier generation rate of each business party, such as multiplying the identifier generation rate of a certain business party by a second preset coefficient and using the resulting product as the single allocation quantity information of this business party, so as to realize dynamic identifier allocation of different business parties. In this case, optionally, obtaining the sub-identifier segment to be allocated from the target identifier segment includes: obtaining the single allocation quantity information of the target business party, the single allocation quantity information being determined based on the identifier generation rate of the target business party; and obtaining the sub-identifier segment to be allocated from the target identifier segment according to the single allocation quantity information.
[0097] S205. Update the target remaining identifier information based on the identifier segment to be allocated.
[0098] In this embodiment, after determining the target business party's identifier segment to be allocated, the target remaining identifier information can be updated based on this identifier segment to be allocated, that is, the target remaining identifier information is updated to the remaining identifier information after this identifier segment to be allocated is allocated to the target business party.
[0099] S206. Generate an identifier allocation event carrying updated target remaining identifier information, and add the identifier allocation event to a preset message queue of the target service partition, wherein the preset message queue supports the identifier segment construction server to read.
[0100] The preset message queue can be a message queue related to identifier generation. A preset message queue for a service partition (such as a target service partition) can be used to add identifier allocation events for this service partition, as well as initialization messages for this service partition. For example, after initialization of this service partition, its initialization messages can be added to its preset message queue for the identifier segment construction server to read. The preset message queue supports reading by the identifier segment construction server.
[0101] An identifier allocation event can be an event that performs identifier allocation. This event may carry information about the remaining identifiers of the target service partition, such as the total number of remaining identifiers after this allocation and the endpoint information of the remaining identifier segments. As an optional example, the identifier allocation transaction may also carry the partition identifier of the target service partition, the session identifier of the target service partition, and / or the event identifier of this identifier allocation event. Within each session, the event identifier can be incremented sequentially according to the order of its generation.
[0102] For example, after the target remaining identifier information is updated, an identifier allocation event carrying the updated target remaining identifier information can be generated and added to the preset message queue of the target service partition. Thus, the identifier segment construction server can read the identifier allocation event from the preset message queue of the target service partition, and based on the updated target remaining identifier information stored in the identifier allocation event, update the target remaining identifier information of the target service partition stored on the identifier segment construction server side, so as to restore the remaining identifier segments of the target service partition before initialization based on the target remaining identifier information stored on the identifier segment construction server side after the target service partition is initialized.
[0103] S207. When the identifier allocation event is successfully added, the identifier segment to be allocated is sent to the target business party so that the target business party can generate a business object identifier for the target business party's business object based on the original identifier.
[0104] In this embodiment, after the identifier allocation event is successfully added to the preset message queue of the target service partition, the obtained identifier segment to be allocated can be sent to the target service party to realize the identifier allocation to the target service party.
[0105] The target business entity can generate business object identifiers based on the identifier segment allocated by the identifier allocation server. A business object can be understood as an identifier for a business object. This business object can be any type of object whose identifier needs to be generated during business implementation, such as a database primary key, user, order, and / or system event. For example, a business object identifier can be a unique code (Identity Document, ID) for the business object.
[0106] For example, when generating a business object identifier, the target business party can directly use the original identifier assigned by the identifier allocation server as the business object identifier.
[0107] Considering that identifier generation systems can be deployed separately in different geographical regions, to avoid duplicate business object identifiers generated by identifier generation systems in different geographical regions, a regional identifier of the geographical region can be embedded in the business object identifier. This ensures that the generated business object ID remains unique in the globally distributed environment. Thus, when a geographical region-level failure occurs, traffic can be switched to data centers in other geographical regions. For example, traffic can be switched by the business side to other available geographical regions for recovery; and / or, proxy side-switching can be performed based on an automated traffic switching mechanism. For example, if the error rate in the current geographical region rises to a preset threshold, circuit breaking can be used to switch traffic to other available geographical regions for recovery, achieving the effect of multi-data center deployment and disaster recovery isolation.
[0108] Optionally, the business object identifier generated by the target business party is obtained by concatenating the original identifier in the identifier segment to be allocated with the regional identifier of the target geographical location, wherein the target geographical location is the geographical location of the identifier allocation server.
[0109] The geographic location region can be pre-defined as needed, such as by country, geographic region, and / or province. The target geographic location region can be understood as the geographic location region where the target identifier allocation server is located.
[0110] Taking a business object identifier as a 64-bit integer, where the original identifier is 56-59 bits and the region identifier is 5-8 bits, when generating the business object identifier, the region identifier of the target geographical location can be concatenated before or after the original identifier, or concatenated between two adjacent bits in the original identifier. For example, the region identifier of the target geographical location can be concatenated after the last bit of the original identifier, such as... Figure 3 As shown, the concatenated identifier is used as the business object identifier.
[0111] The identifier allocation method provided in this embodiment can restore the remaining identifiers in the service partition before initialization, thereby reducing the waste of identifier space.
[0112] Figure 4 This is a flowchart illustrating a method for obtaining identification information according to an embodiment of this disclosure. The method can be executed by an identification information acquisition device configured in an identification segment construction server. This device can be implemented in software and / or hardware and can be configured in an electronic device, typically a computer. The identification information acquisition method provided in this disclosure is applicable to scenarios where the identification segments cached by a service partition before initialization are restored during service partition initialization. Figure 4As shown, the method for obtaining identification information provided in this embodiment may include:
[0113] S301. Receive the initialization message sent by the identifier allocation server after initializing the target service partition.
[0114] Specifically, after initializing the target service partition, the identifier allocation server can send an initialization message to the identifier segment construction server. Correspondingly, the identifier segment construction server can receive the initialization message sent by the identifier allocation server.
[0115] For example, after initializing the target service partition, the identifier allocation server can generate an initialization message for the target service partition and add it to a preset message queue for the target service partition. Correspondingly, the identifier segment construction server can read this initialization message from the preset message queue of the target service partition.
[0116] S302. In response to the initialization message, obtain the target remaining identifier information of the target service partition. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization. The target remaining identifier information is stored by the identifier segment construction server.
[0117] Specifically, after receiving the initialization message sent by the identifier allocation server, the remaining identifier information of the target service partition corresponding to this initialization message can be obtained from the identifier allocation server, such as obtaining the remaining identifier information of the target service partition from its own cache.
[0118] S303. Generate a response message to the initialization message based on the target remaining identifier information, and send the response message to the identifier allocation server. The response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
[0119] In this embodiment, after obtaining the target remaining identifier information of the target service partition, the identifier segment construction server can generate a response message for this initialization message based on this target remaining identifier information, and send this response message to the identifier allocation server that sent this initialization message. Thus, the identifier allocation server can obtain the target remaining identifier information of the target service partition before initialization based on the response message sent by the identifier segment construction server, and construct the remaining identifier segment of the target service partition before initialization based on this target remaining identifier information, as the target identifier segment of the target service partition.
[0120] In some implementations, the identifier segment construction server can generate a response message carrying target remaining identifier information of the target service partition. Optionally, generating the response message for the initialization message based on the target remaining identifier information includes generating a response message carrying the latest stored target remaining identifier information. In this case, after receiving the response message returned by the identifier segment construction server, the identifier allocation server can parse the response message to obtain the target remaining identifier information of the target service partition carried in the response message.
[0121] In other embodiments, after obtaining the target remaining identifier information of the target service partition, the identifier segment construction server synchronizes it to the identifier segment construction database corresponding to the identifier segment construction server, and sends a response message of the initialization message to the identifier allocation server after synchronization is completed. Optionally, generating the response message of the initialization message based on the target remaining identifier information includes: updating the remaining identifier information of the target server stored in the identifier segment construction database to the latest target remaining identifier information stored by the identifier segment construction server, and generating the response message of the initialization message after the update is completed. In this case, after receiving the response message returned by the identifier segment construction server, the identifier allocation server can obtain the latest remaining identifier information of the target server from the identifier segment construction database corresponding to the identifier segment construction server, and use it as the target remaining identifier information of the target server.
[0122] The identifier segment construction database can be understood as the database corresponding to the identifier segment construction server, which can be used to store the remaining identifier information of each service partition. The deployment method of the identifier segment construction database is not limited; optionally, the identifier segment construction database can use distributed heterogeneous storage technology to store the remaining identifier information of each service partition with strong consistency.
[0123] In some implementations, the method for obtaining the identification information may further include: when an identification allocation event exists in a preset message queue of the target service partition, reading the identification allocation event to obtain the target remaining identification information carried in the identification allocation event; and storing the target remaining identification information.
[0124] Specifically, when assigning identifiers to the business entities corresponding to each service partition, an identifier allocation event carrying the remaining identifier information after this identifier allocation for that service partition can be generated and written to the preset message queue of that service partition. Thus, the identifier segment construction server can read the identifier allocation events of each service partition from the preset message queue of each service partition, and update the remaining identifier information of the corresponding service partition stored on the construction segment construction server side based on the remaining identifier information carried in these identifier allocation events.
[0125] Taking the target service partition as an example, the identifier segment construction server can read the identifier allocation event of the target service partition from the preset message queue of the target service partition. Based on the session control identifier carried in the identifier allocation event, it can obtain the remaining identifier information of the target service partition stored in the identifier segment construction server cache. Based on the event identifier carried in the identifier allocation event, it can confirm whether the identifier allocation event is later than the identifier allocation event corresponding to the remaining identifier information of the target service partition stored in the identifier segment construction server cache. If so, the remaining identifier information of the target service partition carried in the identifier allocation event can be used to overwrite the remaining identifier information of the target service partition stored in the identifier segment construction server cache.
[0126] In addition, the identifier segment construction server can periodically write the remaining identifier information of each service partition stored in it into the identifier segment construction database. For example, when the preset update cycle is reached, it can update the remaining identifier information of each service partition stored in the identifier segment construction database based on the remaining identifier information of each service partition stored in the identifier segment construction server.
[0127] Optionally, storing the remaining target identifier information includes: storing the remaining target identifier information carried in the identifier allocation event in the cache of the identifier segment construction server; when a preset update cycle is reached, updating the remaining target identifier information of the target server stored in the identifier segment construction database to the latest remaining target identifier information stored by the identifier segment construction server, wherein the identifier segment construction database corresponds to the identifier segment construction server.
[0128] The method for obtaining identification information provided in this embodiment receives an initialization message sent by an identifier allocation server after initializing a target service partition; in response to this initialization message, it obtains the target remaining identifier information of the target service partition stored in an identifier segment construction server; based on this target remaining identifier information, it generates a response message to the initialization message and sends this response message to the identifier allocation server. This response message is used to enable the identifier allocation server to obtain the target remaining identifier information, which is used to construct the target identifier segment of the target service partition. This embodiment utilizes the above technical solution, storing the remaining identifier information of each service partition through an identifier segment construction server. After initializing a service partition, the identifier allocation server constructs an identifier segment for this service partition based on the remaining identifier information stored in the identifier segment construction server. This allows the remaining identifier segments before the initialization of this service partition to continue to be used for identifier allocation, avoiding identifier waste due to initialization and improving the utilization rate of identifier space.
[0129] Figure 5 This is a schematic diagram of the structure of an identifier generation system provided in an embodiment of this disclosure. Figure 5 As shown in the figure (only one identifier generation module 51, one identifier allocation server 52, one identifier supplementation server 53, and one identifier segment construction server 54 are shown), the identifier generation system can include at least one identifier allocation server 52, at least one identifier supplementation server 53, and at least one identifier segment construction server 54. Furthermore, the identifier generation system can also include an identifier generation module 51, which can be deployed locally on the business side to generate business object identifiers for the business side. For example, this identifier generation module 51 can be configured in the form of a Software Development Kit (SDK), such as an identifier generation SDK.
[0130] The deployment method of the identifier generation system is not limited; for example, it can be deployed in a cloud-native or non-cloud-native manner. Optionally, the identifier generation system can be deployed in a cloud-native manner to improve resource utilization efficiency, thereby enabling customized resource utilization strategies for different business users. In a cloud-native deployment, each server in the identifier generation system can be deployed as a corresponding module.
[0131] Figure 6 This diagram illustrates system components of an identifier generation system deployed in a cloud-native manner, as provided in an embodiment of this disclosure. Figure 6 As shown, the identifier supplementation server can be deployed as an identifier supplementation module, the identifier supplementation database corresponding to the identifier supplementation server can be deployed as an identifier distributed heterogeneous storage module using distributed heterogeneous technology, the identifier segment construction server can be deployed as an identifier segment construction module, the identifier segment construction database of the identifier segment construction server can be deployed as an identifier segment construction storage module, the identifier allocation server can be deployed as an identifier allocation module, and the identifier generation SDK can be deployed within the application service module on the business side.
[0132] In addition, please continue to refer to Figure 6 In some examples, the identifier generation system may also include a selection storage module, a business party metadata service module, a business party metadata storage module, a transaction inspection service module, a tracking service module, and / or a tracking storage module.
[0133] The selection storage module can be used to store the election results of the identifier supplementation instances in each identifier supplementation module for the right to run the identifier supplementation process, and / or the election results of the identifier supplementation instances in each identifier supplementation module for the right to run the identifier supplementation process for each business party and its corresponding service partition. For example, in the identifier generation system, the identifier supplementation instance in each identifier supplementation module can select the right to run the identifier supplementation process of a business party, and / or, the identifier allocation instance in each identifier allocation module can select the right to run the identifier allocation process of a business party through the reliable coordination system (Zookeeper, ZK) of the distributed system. The selection storage module can be used to store the corresponding selection results.
[0134] The business-side metadata service module manages business-side metadata. The business-side metadata storage module stores business-side metadata. The transaction inspection service module provides transaction inspection services. The tracking service module provides tracking services, such as unique identifier detection, and can promptly notify relevant administrators when duplicate identifiers are detected. The tracking storage module stores relevant detection data from the tracking service module.
[0135] The identifier generation system provided in this embodiment can store the remaining identifier information of each service partition through an identifier segment construction server. After initializing a service partition, an identifier allocation server constructs an identifier segment for this service partition based on the remaining identifier information stored in the identifier segment construction server. This allows the remaining identifier segments of this service partition before initialization to continue to be used for identifier allocation, avoiding the waste of identifiers due to initialization and improving the utilization rate of identifier space.
[0136] Figure 7 This is a structural block diagram of an identifier allocation device provided in an embodiment of the present disclosure. The device can be implemented in software and / or hardware and can be configured in an electronic device. Typically, it can be configured in an identifier allocation server, which contains multiple service partitions. The identifier allocation method can be executed to restore the identifier segments cached by the service partitions before initialization during service partition initialization. Figure 7 As shown, the identifier allocation device provided in this embodiment may include: an initialization message sending module 701, a first information acquisition module 702, an identifier segment construction module 703, and an identifier allocation module 704, wherein,
[0137] The initialization message sending module 701 is used to send an initialization message to the identifier segment construction server after initializing the target service partition corresponding to the target business party, and to receive a response message returned by the identifier segment construction server in response to the initialization message.
[0138] The first information acquisition module 702 is used to acquire the target remaining identification information of the target service partition based on the response message. The target remaining identification information is the identification information that the target service partition has stored and has not yet been allocated before initialization.
[0139] The identifier segment construction module 703 is used to construct the target identifier segment of the target service partition based on the target remaining identifier information, and store the target identifier segment in the cache of the target service partition;
[0140] The identifier allocation module 704 is used to allocate an original identifier to the target business party based on the target identifier segment, so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier.
[0141] The identifier allocation device provided in this embodiment, after initializing the target service partition corresponding to the target business party, sends an initialization message to the identifier segment construction server through the initialization message sending module, and receives a response message returned by the identifier segment construction server in response to the initialization message; the first information acquisition module obtains the target remaining identifier information of the target service partition based on the response message, which is the identifier information that has been stored and not yet allocated before the initialization of the target service partition; the identifier segment construction module constructs the target identifier segment of the target service partition according to the target remaining identifier information, and stores the target identifier segment in the cache of the target service partition; the identifier allocation module allocates identifiers to the target business party based on the target identifier segment, wherein the original identifier allocated to the target business party is used to generate the business object identifier of the target business party, and this original identifier is located within the target identifier segment. This embodiment utilizes the above technical solution to store the remaining identifier information of each service partition through the identifier segment construction server. After initializing a certain service partition, the identifier allocation server constructs an identifier segment for this service partition based on the remaining identifier information stored in the identifier segment construction server. This allows the remaining identifier segments of this service partition before initialization to continue to be used for identifier allocation, avoiding the waste of identifiers due to initialization and improving the utilization rate of identifier space.
[0142] Optionally, the identifier allocation module 704 includes: an identifier segment acquisition unit, configured to, in response to a target identifier allocation request sent by the target service party, acquire a sub-identifier segment to be allocated from the target identifier segment, and use it as the identifier segment to be allocated for the target service party, wherein the identifier segment to be allocated contains at least one original identifier; an identifier information update unit, configured to update the target remaining identifier information according to the identifier segment to be allocated; an event addition unit, configured to generate an identifier allocation event carrying the updated target remaining identifier information, and add the identifier allocation event to a preset message queue of the target service partition, wherein the preset message queue supports reading by the identifier segment construction server; and an identifier segment sending unit, configured to send the identifier segment to be allocated to the target service party when the identifier allocation event is successfully added.
[0143] Optionally, the identifier segment acquisition unit may be specifically used to: acquire single allocation quantity information of the target business party, the single allocation quantity information being determined based on the identifier generation rate of the target business party; and acquire sub-identifier segments to be allocated from the target identifier segments based on the single allocation quantity information.
[0144] Optionally, the business object identifier generated by the target business party is obtained by concatenating the original identifier in the identifier segment to be allocated with the regional identifier of the target geographical location region, wherein the target geographical location region is the geographical location region where the identifier allocation server is located.
[0145] Optionally, the first information acquisition module 702 is specifically used to: parse the response message to obtain the target remaining identifier information carried in the response message; or, in response to the response message, obtain the target service partition's remaining identifier information stored in the identifier segment construction database as the target remaining identifier information, and send the response message after the target service partition's remaining identifier information stored in the identifier segment construction database is updated, wherein the identifier segment construction database corresponds to the identifier segment construction server.
[0146] Furthermore, the identifier allocation device may further include: an identifier segment addition module, configured to add the supplementary identifier segment to the target identifier segment when receiving a supplementary identifier segment sent by the identifier supplementation server for the target service partition, wherein the identifier quantity information of the supplementary identifier segment is the single supplementation quantity information of the target service party, and the single supplementation quantity information is determined based on the identifier generation rate of the target service party.
[0147] Optionally, the identifier supplementation server uses distributed heterogeneous storage technology to store the occupied identifier information in a strongly consistent manner.
[0148] The identifier allocation apparatus provided in this disclosure can execute the identifier allocation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the identifier allocation method. Technical details not described in detail in this embodiment can be found in the identifier allocation method provided in any embodiment of this disclosure.
[0149] Figure 8 This is a structural block diagram of an identification information acquisition device provided in an embodiment of this disclosure. The device can be implemented in software and / or hardware, and can be configured in an electronic device. Typically, it can be configured in an identification segment construction server, and can restore the identification segments cached by the service partition before initialization by executing the identification information acquisition method during service partition initialization. Figure 8 As shown, the identification information acquisition device provided in this embodiment may include: an initialization message receiving module 801, a second information acquisition module 802, and a response information sending module 803, wherein,
[0150] The initialization message receiving module 801 is used to receive the initialization message sent by the identifier allocation server after initializing the target service partition;
[0151] The second information acquisition module 802 is used to acquire the target remaining identifier information of the target service partition in response to the initialization message. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization. The target remaining identifier information is stored by the identifier segment construction server.
[0152] The response information sending module 803 is used to generate a response message to the initialization message based on the target remaining identifier information, and send the response message to the identifier allocation server. The response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
[0153] The identification information acquisition device provided in this embodiment receives an initialization message sent by the identification allocation server after initializing a target service partition through an initialization message receiving module; responds to this initialization message through a second information acquisition module, acquiring the target remaining identification information of the target service partition stored in the identification segment construction server; and generates a response message to the initialization message based on this target remaining identification information through a response information sending module, and sends this response message to the identification allocation server. This response message is used to enable the identification allocation server to acquire the target remaining identification information, which is used to construct the target identification segment of the target service partition. This embodiment utilizes the above technical solution, whereby the identification segment construction server stores the remaining identification information of each service partition, and after initializing a service partition, the identification allocation server constructs an identification segment for this service partition based on the remaining identification information stored in the identification segment construction server. This allows the remaining identification segments of this service partition before initialization to continue to be used for identification allocation, avoiding identification waste due to initialization and improving the utilization rate of identification space.
[0154] Furthermore, the device for acquiring the identification information may further include: an event reading module, used to read the identification allocation event when there is an identification allocation event in the preset message queue of the target service partition, and obtain the target remaining identification information carried in the identification allocation event; and an identification information storage module, used to store the target remaining identification information.
[0155] Optionally, the identification information storage module is specifically used to: store the target remaining identification information carried in the identification allocation event in the cache of the identification segment construction server; when the preset update cycle is reached, update the target server's remaining identification information stored in the identification segment construction database to the latest target remaining identification information stored by the identification segment construction server, wherein the identification segment construction database corresponds to the identification segment construction server.
[0156] Optionally, the response information sending module 803 can be used to: generate a response message carrying the latest stored target remaining identifier information; or, update the remaining identifier information of the target server stored in the identifier segment construction database to the latest stored target remaining identifier information of the identifier segment construction server, and generate a response message of the initialization message after the update is completed.
[0157] The identification information acquisition device provided in this disclosure can execute the identification information acquisition method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the identification information acquisition method. Technical details not described in detail in this embodiment can be found in the identification information acquisition method provided in any embodiment of this disclosure.
[0158] The following is for reference. Figure 9 The diagram illustrates a structural schematic of an electronic device (e.g., a server) 900 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0159] like Figure 9 As shown, electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from storage device 908 into random access memory (RAM) 903. RAM 903 also stores various programs and data required for the operation of electronic device 900. Processing device 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0160] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0161] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0162] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0163] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0164] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0165] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: after initializing the target service partition corresponding to the target business party, send an initialization message to an identifier segment construction server and receive a response message returned by the identifier segment construction server in response to the initialization message; obtain target remaining identifier information of the target service partition based on the response message, wherein the target remaining identifier information is identifier information that has been stored but not yet allocated by the target service partition before initialization; construct a target identifier segment of the target service partition based on the target remaining identifier information and store the target identifier segment in the cache of the target service partition; allocate an original identifier to the target business party based on the target identifier segment, so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier. Alternatively
[0166] The system receives an initialization message sent by the identifier allocation server after initializing the target service partition; in response to the initialization message, it obtains the target remaining identifier information of the target service partition, wherein the target remaining identifier information is the identifier information that has been stored and not yet allocated before the initialization of the target service partition, and the target remaining identifier information is stored by the identifier segment construction server; it generates a response message to the initialization message based on the target remaining identifier information, and sends the response message to the identifier allocation server, wherein the response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
[0167] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0168] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0169] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of modules do not, in some cases, constitute a limitation on the unit itself.
[0170] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0171] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0172] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0173] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0174] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for assigning identifiers, characterized in that, The method is executed by an identifier allocation server, which contains multiple service partitions, and the method includes: After initializing the target service partition corresponding to the target business party, an initialization message is sent to the identifier segment construction server, and a response message is received from the identifier segment construction server in response to the initialization message. Based on the response message, the target remaining identifier information of the target service partition is obtained. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization. The target identifier segment of the target service partition is constructed based on the target remaining identifier information, and the target identifier segment is stored in the cache of the target service partition; Based on the target identifier segment, an original identifier is allocated to the target business party, so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier.
2. The method according to claim 1, characterized in that, The allocation of the original identifier to the target business party based on the target identifier segment includes: In response to the target identifier allocation request sent by the target service provider, a sub-identifier segment to be allocated is obtained from the target identifier segment as the identifier segment to be allocated by the target service provider. The identifier segment to be allocated contains at least one original identifier. Update the remaining target identifier information based on the identifier segment to be allocated; Generate an identifier allocation event carrying updated target remaining identifier information, and add the identifier allocation event to a preset message queue of the target service partition, the preset message queue being readable by the identifier segment construction server; When the identifier allocation event is successfully added, the identifier segment to be allocated is sent to the target business party.
3. The method according to claim 2, characterized in that, The step of obtaining the sub-identifier segment to be allocated from the target identifier segment includes: Obtain the single allocation quantity information of the target business party, wherein the single allocation quantity information is determined based on the identifier generation rate of the target business party; The sub-identifier segments to be allocated are obtained from the target identifier segments based on the single allocation quantity information.
4. The method according to claim 2, characterized in that, The business object identifier generated by the target business party is obtained by concatenating the original identifier in the identifier segment to be allocated with the regional identifier of the target geographical location, wherein the target geographical location is the geographical location of the identifier allocation server.
5. The method according to claim 1, characterized in that, The step of obtaining the target remaining identifier information of the target service partition based on the response message includes: The response message is parsed to obtain the remaining target identifier information carried in the response message; or In response to the response message, the remaining identifier information of the target service partition stored in the identifier segment construction database is obtained as the target remaining identifier information. The response message is sent after the remaining identifier information of the target service partition stored in the identifier segment construction database is updated. The identifier segment construction database corresponds to the identifier segment construction server.
6. The method according to any one of claims 1-5, characterized in that, Also includes: When a supplementary identifier segment is received from the identifier supplementation server for the target service partition, the supplementary identifier segment is added to the target identifier segment. The identifier quantity information of the supplementary identifier segment is the single supplementation quantity information of the target service party, and the single supplementation quantity information is determined based on the identifier generation rate of the target service party.
7. The method according to claim 6, characterized in that, The identifier supplementation server uses distributed heterogeneous storage technology to store the occupied identifier information in a strongly consistent manner.
8. A method for obtaining identification information, characterized in that, The method is executed by an identifier segment construction server, and the method includes: Receive the initialization message sent by the identifier allocation server after initializing the target service partition; In response to the initialization message, the target remaining identifier information of the target service partition is obtained. The target remaining identifier information is the identifier information that has been stored and not yet allocated before the initialization of the target service partition. The target remaining identifier information is stored by the identifier segment construction server. A response message to the initialization message is generated based on the target remaining identifier information, and the response message is sent to the identifier allocation server. The response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
9. The method according to claim 8, characterized in that, Also includes: When an identifier allocation event exists in the preset message queue of the target service partition, the identifier allocation event is read to obtain the target remaining identifier information carried in the identifier allocation event; Store the remaining identifier information of the target.
10. The method according to claim 9, characterized in that, The storage of the remaining identifier information of the target includes: The target remaining identifier information carried in the identifier allocation event is stored in the cache of the identifier segment construction server; When the preset update cycle is reached, the remaining identifier information of the target server stored in the identifier segment construction database is updated to the latest target remaining identifier information stored in the identifier segment construction server. The identifier segment construction database corresponds to the identifier segment construction server.
11. The method according to any one of claims 8-10, characterized in that, The response message for generating the initialization message based on the target remaining identifier information includes: Generate a response message carrying the latest stored target remaining identifier information; or The remaining identifier information of the target server stored in the identifier segment construction database is updated to the latest target remaining identifier information stored in the identifier segment construction server, and a response message to the initialization message is generated after the update is completed.
12. A labeling and distributing device, characterized in that, The device is configured within an identifier allocation server, which contains multiple service partitions. The device includes: The initialization message sending module is used to send an initialization message to the identifier segment construction server after initializing the target service partition corresponding to the target business party, and to receive the response message returned by the identifier segment construction server in response to the initialization message. The first information acquisition module is used to acquire the target remaining identification information of the target service partition based on the response message. The target remaining identification information is the identification information that the target service partition has stored and has not yet been allocated before initialization. The identifier segment construction module is used to construct the target identifier segment of the target service partition based on the target remaining identifier information, and store the target identifier segment in the cache of the target service partition; The identifier allocation module is used to allocate an original identifier to the target business party based on the target identifier segment, so that the target business party can generate a business object identifier for the target business party's business object based on the allocated original identifier.
13. A device for acquiring identification information, characterized in that, The device is configured within the identifier segment construction server, and the device includes: The initialization message receiving module is used to receive the initialization message sent by the identifier allocation server after initializing the target service partition; The second information acquisition module is used to acquire the target remaining identifier information of the target service partition in response to the initialization message. The target remaining identifier information is the identifier information that the target service partition has stored and has not yet been allocated before initialization. The target remaining identifier information is stored by the identifier segment construction server. The response information sending module is used to generate a response message to the initialization message based on the target remaining identifier information, and send the response message to the identifier allocation server. The response message is used for the identifier allocation server to obtain the target remaining identifier information, and the target remaining identifier information is used to construct the target identifier segment of the target service partition.
14. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the identifier allocation method of any one of claims 1-7 or the identifier information acquisition method of any one of claims 8-11.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the identifier allocation method of any one of claims 1-7 or the identifier information acquisition method of any one of claims 8-11.
16. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the identifier allocation method of any one of claims 1-7 or the identifier information acquisition method of any one of claims 8-11.