A method, apparatus, device, and storage medium for releasing routing identifiers based on pending transactions and continuously confirmed water levels.
By establishing an occupancy code for each route identifier occupancy and combining it with the continuous acknowledgment level of transaction reference registration and internal event log partitioning, the problem of late events polluting new occupancy in communication route identifier reuse is solved, thereby improving resource utilization.
Patent Information
- Application Number
- CN202611325974.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-29
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies cannot effectively prevent late call detail records, delivery receipts, or recording events from polluting new occupancy after unbinding during the reuse of limited communication route identifiers. Furthermore, relying on fixed idle time cannot cover all long-tail cases, resulting in low resource utilization.
An occupancy code is established for each route identifier occupancy. Combining the transaction reference registration, service transaction association key, and continuous acknowledgment level of the internal event log partition, the return to the pool is determined by releasing the fence condition, ensuring that late events are isolated from new occupancy.
It effectively isolates late events without relying on fixed idle time, improves the utilization of limited routing resources, avoids pollution of newly occupied resources by late events, and ensures timely release of resources.
Smart Images

Figure CN123123254A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of communication routing resource management, asynchronous event processing, and communication transaction state management, and particularly to a method, apparatus, electronic device, and computer-readable storage medium for releasing reusable communication route identifiers based on cross-service pending transactions and continuous acknowledgment levels. Background Technology
[0002] Communication routing identifiers, such as privacy numbers, SIP routing addresses, message sending addresses, and callback routing keys, typically come from a limited resource pool. When a business relationship is established, the platform assigns the routing identifier to a group of communication participants; after the business relationship ends or an unbinding request is received, the platform releases the identifier for reuse in subsequent businesses.
[0003] The lifecycle of communication transactions often exceeds the business-side binding relationship. After a call ends, the final call detail record (CDR), recording file completion event, or quality inspection task result may still arrive; after a message is submitted, the final delivery receipt may also be delayed. If the platform immediately reclaims the routing identifier upon unbinding, the late event may be attached to a new business relationship based on that identifier, causing a mismatch in CDR, recording, or delivery status.
[0004] Current implementations often set fixed binding durations or fixed idle times. Idle times that are too short cannot cover long-tail late events; idle times that are too long occupy number or routing resources, reducing reuse rates. Fixed durations also cannot prove that all communication transactions created before unbinding have been processed to their final state.
[0005] Other implementations use the end of the call as the release condition, but the same business relationship may simultaneously involve message delivery, final call detail records, and recording. The final state of a single service does not necessarily mean that cross-service pending transactions have been cleared. Simply searching for late events by the current route identifier also fails to distinguish whether the event belongs to an old occupancy before release or a new occupancy after release.
[0006] In general asynchronous processing systems, reference counting, generation identification, or event checkpointing can also be used to determine whether resources are reclaimable. If these mechanisms are not stored together with the historical occupancy relationships of the communication service's native transaction identifier, service-specific final state, and routing identifier, it is still impossible to determine which occupancy should be updated for a certain late call detail record, delivery receipt, or recording event, nor can it rule out events that have entered different event partitions before unbinding but have not yet completed occupancy attribution processing.
[0007] Therefore, a technical solution is needed that moves transaction reference registration forward to before the communication request is sent, establishes a release barrier during unbinding, and uses the clearing of cross-service pending references and the continuous acknowledgment level of the internal event log partition to jointly determine the return to the pool. Summary of the Invention
[0008] The technical problem this invention aims to solve is: how to avoid polluting new occupancy with late call detail records, delivery receipts, or recording events after unbinding, when limited communication route identifiers need to be reused, without relying on a fixed settling time that covers all long-tail cases.
[0009] This invention establishes an occupation code for each route identifier occupation. The occupation code is persisted together with the reusable communication route identifier, the communication participant or service tenant, the allowed service type, and the current occupation status. Each reallocation generates a different occupation code.
[0010] Before a communication request is sent to the communication service provider via the service provider adapter, the system persists a transaction reference. The transaction reference must contain at least an internal transaction identifier, service type, occupancy code, and creation status. After the communication service provider returns the transaction identifier, the system establishes a service transaction association key consisting of the communication service provider identifier, service account identifier, service type, and service provider transaction identifier, and then appends this key to the original transaction reference.
[0011] Transaction reference pre-registration enables the enumeration of currently occupied transactions that have been initiated but not yet completed during unbinding. If the synchronous response does not return a service provider's transaction identifier, the transaction reference remains pending and is marked as requiring completion; it is then completed after the service provider's transaction identifier is obtained through a query. If the query clearly indicates that the request was not accepted and no corresponding service transaction was established, evidence of the uncreated state is preserved and the reference is cleared; if the query result is unclear, the reference remains pending and is written to the verification area. Before a clear result is obtained, the route identifier is prohibited from being converted to an assignable state.
[0012] Upon receiving an unbinding request, the route identifier manager closes the current new external communication request entry point by verifying the occupancy record status and version number through a conditional transaction. Transaction reference registration for external communication requests uses the same occupancy status and version verification conditions. External communication requests concurrent with unbinding either complete reference registration first and are sent after the conditional transaction is committed, or are rejected because the entry point is closed, thus preventing the formation of a sent but unregistered transaction. The aforementioned occupancy status conditions do not apply to internal transactions derived from parent transactions already registered under this occupancy; such internal derived transactions can be registered when the occupancy status is occupancy or pending release. In the occupancy status, it must be verified that the parent transaction reference still exists, the derived transaction inherits the fixed occupancy code from the parent transaction reference, the occupancy code in the occupancy record matches the fixed occupancy code, and the current version number matches the version number read by the registration operation. In the pending release status, it must also be verified that its corresponding event log partition belongs to the relevant internal event log partition that was fixed during unbinding and successfully recorded the release barrier. If any condition is not met, the parent transaction reference remains pending and is re-verified.
[0013] The unbinding operation determines and solidifies all internal event log partitions that carry the events corresponding to the registered transactions and possible derived subsidiary processing transactions under the current occupation, based on the service type and final state configuration declaration of the registered transactions, combined with the communication service provider, service account, service type, and routing sharding rules. After closing the entry point for new external communication requests, the system records a release barrier in each of the partitions; the partitions that have been solidified and should have release barriers recorded are referred to as the relevant internal event log partitions. Each partition has an independent monotonic sequence number field, and the release barrier can be the partition log offset, monotonic event sequence number, or a barrier message confirmed by the receiving gateway. If any relevant internal event log partition fails to record a release barrier, the current occupation remains pending release and is prohibited from returning to the pool. The release barrier is used to prove whether all events that have entered the internal event system before unbinding have been occupied and assigned for processing, without requiring waiting for a full-platform partition unrelated to the current occupation; partitions corresponding to derived transactions that may be registered after the entry point is closed are already included in this solidified partition set.
[0014] Different communication services retain the original event and the service provider's transaction identifier, while the final state normalization unit maps the original event to an intermediate or final state. The normalization result only determines whether the transaction reference can be cleared; it does not replace the original event or change the event's ownership.
[0015] The term "clear transaction reference" as used in this specification means removing the transaction reference from the set of pending references; the service transaction association key, native event summary, and final state evidence continue to be saved with the current occupancy record until the occupancy record is archived.
[0016] Voice communication transactions requiring call detail record (CDR) integrity use a combination of SIP termination events and final CDRs; when SIP events are not provided, a combination of status query final state and final CDRs is used. Message communication transactions use the final delivery success receipt or final delivery failure receipt generated by the communication service provider, or the final state of "cannot continue processing" returned by the status query; recording processing transactions use the result of file completion and integrity verification, or the final state of "unrecoverable failure".
[0017] A native event first looks up the transaction reference using the service transaction association key, and then retrieves the occupancy code that was fixed at the time of creation from the transaction reference. The system does not first look up the current occupancy using the current route identifier, nor does it change the event's attribution even if the route identifier has been reassigned.
[0018] An empty pending reference set indicates that all registered transactions have obtained final state evidence or non-created state evidence allowing the clearing of their corresponding transaction references; all relevant internal event log partitions for this occupancy request have been determined and solidified, and the release barriers for each partition have been successfully recorded; the continuous confirmation level for each partition is not less than its corresponding release barrier, indicating that the sequence number of each release barrier and the events that entered the corresponding partition before it have been continuously persisted and occupancy ownership processed. Return to the pool is only executed when all three conditions are met simultaneously: an empty pending reference set, successful recording of all necessary release barriers, and the confirmation level for each partition being met.
[0019] The joint constraint between pending transaction references and partition water levels can be expressed as:
[0020] U g = ∅ ∧ ∀ p ∈ P g , W p ≥ F g,p
[0021] In the formula, g Indicates current occupancy; U g This represents the currently occupied set of pending transaction references; P g This indicates the set of internal event log partitions that, when unbinded, contain records with corresponding release barriers. p Represents any partition in the set; W p This indicates the continuously confirmed water level of the zone; F g,p This indicates the release of the fence currently occupied in this partition.
[0022] The empty set condition indicates that there are no pending transaction references in the current occupancy; the universal condition indicates that for each relevant partition involved in the current occupancy, the consecutive acknowledgment level has reached or exceeded the release barrier of the occupancy in the corresponding partition.
[0023] Returning to the pool uses atomic operations: verifying that the occupancy status is still pending release, the pending set is still empty, the relevant internal event log partition set determined based on registered transactions and possible derived transactions declared in the final state configuration is still complete, each necessary release barrier has been successfully recorded, and the continuous confirmation water level still meets the conditions, then adding the current occupancy to the historical occupancy record and changing the route identifier to an allocable state. At this point, no new occupancy code is generated in advance; a new occupancy code, different from all historical occupancy codes, is generated only when the route identifier is successfully allocated next time. If any conditions change before commit, cancel the current return to the pool and re-verify.
[0024] Duplicate events or long-tailed late events that arrive after release may still carry the old service transaction association key. The system uses this association key to find the historical occupancy record and appends the event to the corresponding historical occupancy; old events must not update the call detail records, recordings, message status, or billing status of the new occupancy.
[0025] Events without an associated transaction identifier are not allowed to enter the verification area and cannot be automatically assigned to a new occupancy based solely on the current routing identifier. For telephone number-type routing identifiers, the communication initiator, communication receiver, and service type can also be used as routing association parameters to reduce ambiguity when multiplexing the same number.
[0026] This invention has at least the following beneficial effects: First, it determines whether a resource is still occupied based on the final state evidence or the uncreated state evidence of a registered transaction, rather than a fixed duration; Second, it unifies the release conditions for cross-service pending items such as voice, messages, call detail records, and recordings, avoiding the return of resources to the pool immediately after a single call ends; Third, it eliminates race conditions where events have entered the platform but have not yet completed their attribution processing by using the continuous confirmation level of the internal event log partition; Fourth, it isolates late events by using service transaction association keys and historical occupancy records, avoiding contamination of new occupancy; Fifth, it can release resources in a timely manner when the pending reference set is empty and the water level of each partition reaches the release barrier, improving the utilization rate of limited routing resources. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of the reusable communication routing identifier management system according to an embodiment of the present invention.
[0028] Figure 2 This is a schematic diagram of the routing identifier release process according to an embodiment of the present invention.
[0029] Figure 3 This is a schematic diagram illustrating the relationship between the occupancy code, transaction reference set, and release barrier in an embodiment of the present invention.
[0030] Figure 4 This is a schematic diagram illustrating cross-service final state normalization in an embodiment of the present invention.
[0031] Figure 5 This is a schematic diagram illustrating the isolation between late arrival events and new / old occupancy in an embodiment of the present invention.
[0032] Figure 6 This is a schematic diagram illustrating the unbinding and release timing in an embodiment of the present invention. Detailed Implementation
[0033] The embodiments of the present invention will be further described below with reference to the accompanying drawings. These embodiments are used to illustrate the technical solution and do not limit the scope of protection of the claims.
[0034] like Figure 1As shown, business system 101 requests a reusable communication route identifier from route identifier manager 110. Route identifier manager 110 includes an occupancy record database 111, a pending reference set 112, a final state normalization unit 113, a release transaction unit 114, historical occupancy records 115, and continuous acknowledgment level records 116. Communication service gateway 120 initiates a communication transaction to service provider 140, and event receiving channel 130 receives asynchronous events.
[0035] In the device implementation, the occupancy management module is implemented by the route identifier manager 110 in conjunction with the occupancy record database 111; the transaction reference registration module is implemented by the route identifier manager 110 in conjunction with the pending reference set 112; the conditional closure and fence module is implemented by the route identifier manager 110 in conjunction with the occupancy record database 111 and the event receiving channel 130; the event attribution and final state processing module is implemented by the event receiving channel 130 and the final state normalization unit 113; the continuous confirmation water level module is implemented by the event receiving channel 130 in conjunction with the continuous confirmation water level record 116; the release transaction module is implemented by the release transaction unit 114; and the late event isolation module is implemented by the event receiving channel 130 in conjunction with the historical occupancy record 115. These modules are logical modules divided according to function, and can be implemented individually by the aforementioned units or collaboratively by multiple units.
[0036] like Figure 2As shown, the route identifier release process includes: S201, obtaining a reusable communication route identifier from the allocable pool, generating an occupation code for this occupation, and establishing an occupation record; S202, registering a transaction reference inheriting the occupation code before sending a communication request, and sending a communication request only after the conditional transaction that registers the transaction reference and updates the occupation record version number has been successfully committed; S203, after obtaining the service party's transaction identifier, establishing a service transaction association key; S204, responding to the unbinding request, closing the entry point for new external communication requests, determining and solidifying all relevant internal event log partitions based on the registered transactions and possible derived transactions of the final state configuration declaration, and recording the release barrier F(g,p) partition by partition; S205, assigning the original event according to the service transaction association key, unifying the final state according to the final state configuration of the corresponding service type, and updating or clearing the transaction reference; S206, for the final state configuration declaration that can... The parent transaction of the derived subsidiary transaction verifies the establishment status of the derived transaction item by item after its original final state combination is satisfied; S207, for derived transactions that have been established or still need to be established, first register the transaction references that inherit the same occupancy code; for derived transactions that have not been established and will not be established again, first save clear evidence of the uncreated state, and clear the parent transaction reference after all derived items have been registered or evidenced; after the event is persisted and occupancy ownership is processed, the continuous confirmation water level W(p) of each relevant partition is advanced according to the continuous event sequence number, and it must not be crossed when there is a sequence number gap; S208, only when the set of pending references U(g) is empty, the release fences of all necessary partitions are successfully recorded, and each relevant partition satisfies W(p) not less than F(g,p), the current occupancy record is atomically archived and the routing identifier is converted to an allocable state; if any of the above conditions are not met, it is maintained as pending release and return to the pool is prohibited.
[0037] like Figure 3 As shown, 301 represents the route identifier X and its current occupancy code G28; 302 represents the voice transaction reference C1; 303 represents the message transaction reference M1; 304 represents the recording transaction reference R1; 305 represents the currently occupied pending reference set U(G28), each transaction reference is added to this set during registration, and is cleared item by item after the corresponding final state is satisfied or the uncreated state is verified; 306 represents the relevant log partition set P(G28) solidified during unbinding, where the release barrier F(G28,p) of each partition must be successfully recorded, and the corresponding continuous confirmation level W(p) must reach or exceed the release barrier; 307 represents the joint judgment on whether U(G28) is empty and whether the barrier and level conditions of all partitions are simultaneously satisfied; if the judgment result is yes, execute 308, atomically archive G28 and convert X to an allocatable state; if the judgment result is no, execute 309, maintain the pending release and prohibit return to the pool. In the diagram, call_id, msg_id, and rec_id are exemplary voice, message, and recording transaction identifier fields, respectively, without limiting the specific field names used by the communication service provider.
[0038] like Figure 4 As shown, 411 indicates that voice transactions use a combination of SIP termination event and final call detail record (CDR), or a combination of query final state and final CDR; 412 indicates that message transactions use a final delivery success receipt, a final delivery failure receipt, or a query final state that cannot be further processed; 413 indicates that recording transactions use a combination of file completion and integrity verification, or an unrecoverable failure final state; 420 indicates that it determines whether the native final state combination of the corresponding service type is satisfied. If not satisfied, 421 is executed, the transaction reference is retained, and the reference is updated only according to the intermediate state; if satisfied... If the final configuration declares that the transaction can derive subsidiary transactions, execute step 422 to determine if the final configuration declares that the transaction can derive subsidiary transactions. If it does not declare that it can derive, execute step 423 to directly clear the transaction reference. If it declares that it can derive, execute step 424 to verify the establishment status of each derived transaction. For derived transactions that have been established or still need to be established, execute step 425 to first register derived references that inherit the same occupancy code. For derived transactions that have not been established and will not be established, execute step 426 to first obtain clear evidence of the uncreated state. After all derived items have been registered or evidence obtained, execute step 427 to clear the parent transaction reference.
[0039] like Figure 5 As shown, 501 indicates that route identifier X is currently occupying G28; after G28 meets the release condition, 502 is executed to archive G28 and change X to an allocatable state; when X is successfully allocated again, 503 is executed to generate a new occupancy code G29 different from G28; 504 indicates a late native event belonging to G28 and whose service transaction association key points to the old transaction C1; 505 is executed for this late native event to hit the historical occupancy record of G28 according to the service transaction association key; then 506 is executed to append the late native event to G28 and perform idempotent processing; 507 indicates the new and old occupancy isolation rule, that is, the current occupancy is not queried according to the route identifier, and the late native event is prohibited from updating the call detail records, recordings, message status or billing status of G29.
[0040] like Figure 6As shown, 601 indicates that the business system requests the route identifier manager to unbind and occupy G28; 602 indicates that the route identifier manager sets G28 to be released and closes the entry point for new external communication requests through a conditional transaction; 603 indicates that the business system initiates a new external communication request again after the entry point is closed; 604 indicates that the route identifier manager rejects the request and does not trigger the communication service gateway to send a message to the communication service provider; 603 and 604 are used to illustrate the effect of closing the entry point and do not constitute a necessary precondition for executing 605. The rejection does not block the internal transaction derived from the registered parent transaction; 605 indicates that the route identifier manager persists the relevant internal event log partition set P(G28) and records the release barrier F(G28,p) partition by partition. If the release barrier of any necessary partition is not successfully recorded, it remains to be released and is prohibited from returning to the pool; 606 indicates that the communication service provider sends the native final state event; 607 indicates that the event receiving channel persists the event and categorizes it according to the service transaction association key. G28; 608 indicates that the route identifier manager updates the pending reference set U(G28) according to the final state configuration and processes derived transaction references or evidence of uncreated state; 609 indicates that the home handler advances the continuous confirmation level W(p) according to the consecutive sequence number after the event is persisted and the occupancy home handling is completed, and must not cross the sequence number gap; 610 is executed only when U(G28) is empty, all necessary release barriers are successfully recorded, and each relevant partition satisfies W(p) not less than F(G28,p), G28 is atomically archived and the route identifier is converted to an allocatable state, otherwise it continues to be maintained pending release and is prohibited from returning to the pool; 611 indicates that a new occupancy code G29 is generated when the same route identifier is successfully allocated again; 612 indicates that the communication service sends a late event belonging to G28; 613 indicates that the event receiving channel hits the historical occupancy record of G28 according to the service transaction association key; 614 indicates that the late event is written to the historical occupancy record of G28 and G29 is prohibited from being updated.
[0041] Reusable communication route identifiers can be privacy phone numbers, Session Initiation Protocol (SIP) Uniform Resource Identifiers, message sending addresses, or callback routing keys. One embodiment uses AXB privacy numbers, where A and B represent the numbers of the communicating parties, respectively, and X represents an intermediate privacy number allocated from a number pool; the route association parameters include the service tenant, calling number digest, called number digest, and allowed voice and SMS service types.
[0042] The occupancy record includes route identifier, occupancy code, route association parameters, status, and version number. The status must include at least allocateable, occupied, and pending release; the implementation can also set isolation status for fault handling. The occupancy code changes monotonically with each allocation or uses a globally unique value and cannot be simply reused from the business order number.
[0043] When a business system prepares to initiate a communication transaction, it first registers the transaction reference with the route identifier manager. Only after the transaction, which registers the reference and updates the occupancy record version number, is successfully committed will the communication service gateway 120 allow the request to be sent to the communication service provider. Even if the service process encounters an error after the request is sent, the transaction will still be visible in the pending reference set upon recovery.
[0044] A transaction reference includes an internal transaction identifier, occupancy code, service type, creation time, adapter identifier, and status. The service provider transaction identifier may appear in synchronization responses, status queries, or subsequent events. When this identifier is obtained in a synchronization response or query, the system uses the internal transaction identifier to locate the original reference and adds a service transaction association key consisting of the communication service provider identifier, service account identifier, service type, and service provider transaction identifier. To distinguish potentially duplicate service provider transaction identifiers under different tenants, adapter instances, or interface semantic versions, the service transaction association key may also include at least one of the business tenant identifier, adapter instance identifier, and interface semantic version. Each field is fixed when the transaction reference is registered or when the service provider transaction identifier is obtained. Historical occupancy records store historical occupancy codes, service transaction association keys, summaries of received native events, and final state evidence.
[0045] When the service provider's transaction identifier first appears in a subsequent event, and the subsequent event does not echo the internal transaction identifier, the adapter should employ at least one of the following association paths: include the internal association token echoed by the communication service provider in the request; save the mapping between the request digest and the query result and obtain the service provider's transaction identifier through a status query; or establish a candidate mapping based on a uniquely verified request digest and time interval. Events that cannot form a unique mapping enter the verification area and are not assigned according to the current route identifier.
[0046] For transactions where synchronization responses are lost, the transaction reference remains pending. The system can query the service status based on the internal transaction identifier, request summary, or communication service provider query conditions; the reference is only cleared if the query clearly indicates that the communication service provider has not accepted the request and has not established a corresponding service transaction, or if the final state of the transaction is obtained. If the query result is unclear, the reference remains pending and is written to the verification area; it cannot be directly deleted due to timeout.
[0047] Unbinding requests and external communication requests may be initiated concurrently. Transaction reference registration and entry closure for external communication requests are updated in the transaction that verifies the occupancy status is "occupied" and the version number remains unchanged. If unbinding is committed first, the occupancy status changes to "pending release" and the entry for new external communication requests is closed; subsequent external communication requests fail to register and are not sent. If registration is committed first, the transaction reference has already entered the pending reference set, and sending is only allowed afterward. The unbinding operation is re-executed based on the updated version and the release barrier is recorded. Internal transactions derived from registered parent transactions do not belong to new external communication requests; their registration is allowed when the occupancy status is "occupied" or "pending release." In both states, it is verified that the parent transaction reference still exists, its inherited occupancy code matches the occupancy code in the occupancy record, and the current version number matches the version number read by the registration operation. In the "pending release" state, it is further verified that the corresponding event log partition belongs to the relevant internal event log partition that was fixed at the time of unbinding and successfully recorded the release barrier. If any condition is not met, the parent transaction reference remains pending.
[0048] After the entry point is closed, the system determines and solidifies all relevant internal event log partitions based on the currently registered transactions and possible derived processing transactions declared in the final configuration, combined with the communication service provider, service account, service type, and routing fragmentation rules. A barrier message is written to each relevant partition, or the appended sequence number of that partition is read, forming a release barrier for that partition. Relevant partitions can respectively carry SIP events, call detail records (CDRs), message delivery receipts, and recording processing events. Even if derived transactions such as recording are registered only after the entry point is closed, the corresponding event log partitions are pre-included in a fixed set during unbinding. Each partition maintains an independent monotonic sequence number field. If any necessary partition cannot be determined or the release barrier recording fails, the system records the reason for the failure, maintains the occupied state as pending release, and prohibits return to the pool.
[0049] The continuous acknowledgment level refers to the highest consecutive event sequence number in the corresponding internal event log partition that has been persisted and whose ownership has been completed. It can be simply referred to as the acknowledgment level. If sequence numbers 100 to 105 have all been processed, the level can advance to 105; if sequence number 103 is missing, even if 104 and 105 have been processed, the level will remain at 102.
[0050] The definition of continuously confirmed water level can be expressed as:
[0051] W p = max({ b p − 1} ∪ { k | k ≥ b p ∧ ∀ n ∈ [ bp , k ], H p ( n ) = 1})
[0052] In the formula, b p Indicates partition p The starting sequence number of the current continuous confirmation interval; H p ( n A value of 1 indicates the sequence number in that partition. n The event has been persisted and its ownership has been handled.
[0053] This formula indicates that the continuously confirmed water level is the largest sequence number from the starting sequence number to the candidate sequence number that has been processed continuously; if there is a gap in the middle, the continuously confirmed water level will not exceed the gap even if a larger sequence number has been processed.
[0054] For example, when the release fence sequence number is 105, the continuous confirmation level reaching 105 indicates that events with sequence numbers no greater than 105 have been processed consecutively, and there is no need to wait for the arrival of event number 106. The continuous confirmation level only proves that the events that have entered the internal log have been processed, and does not mean that the communication service will not generate duplicate, corrective, or long-tailed events in the future.
[0055] The internal event receiving channel can use a partitioned event log. The occupancy record stores the relevant partition set fixed at the time of unbinding, the release barrier sequence number of each partition, and the barrier record status; this set covers currently registered transactions and possible derived transactions from final state configuration declarations. The continuous acknowledgment watermark is submitted by the owner processor and restored through persistent checkpoints. Barriers and continuous acknowledgment watermarks are used to resolve release race conditions when received events are still queued within the platform; if any necessary partition's barrier record is missing, a release decision is not executed.
[0056] Final State Normalization Unit 113 configures final state evidence by service type. The configuration lists the native event combinations that allow the reference to be cleared, while retaining the original service provider state. Intermediate call detail records, ringing, message submission, and recording processing states only update the reference, do not clear it.
[0057] A final state combination for a voice communication transaction is: the SIP session has been terminated and the final Call Detail Record (CDR) has been generated. For service providers that do not provide complete SIP events, the final state combination can be queried using the status query and the final CDR. If the service does not require call detail record completeness, the explicit termination event can also be set as the final state in the subordinate configuration, but this should be matched with the actual reuse risk of routing identifiers.
[0058] The final state of a message communication transaction is either a final delivery success receipt, a final delivery failure receipt, or a status query returning a state where further processing is not possible. The states of "submitted," "entered by the operator," or "temporarily failed" in the Delivery Receipt (DLR) are still intermediate states, and the corresponding references are retained.
[0059] Recording processing transactions are typically derived from voice communication transactions. After the voice recording ends, the recording file may still be in a transcoding, merging, or uploading state. Recording references are only cleared after the file is completed and passes size, digest, or container integrity checks, or after an irrecoverable failure final state is achieved.
[0060] The final state configuration also declares whether a transaction can derive subordinate processing transactions. For transactions that do not declare the ability to derive subordinate processing transactions, the corresponding transaction reference is cleared when the native final state combination declared in the final state configuration is satisfied. For parent transactions that declare the ability to derive subordinate processing transactions, the final state unification unit only verifies the establishment status of each derived transaction according to the final state configuration after the native final state combination corresponding to the service type of the parent transaction has been satisfied; if the native final state combination is not satisfied, the parent transaction reference is retained, the establishment status of the derived transaction is not judged, and the parent transaction reference is not cleared. After the native final state combination is satisfied, for recording, call detail record aggregation, or other derived transactions that have been established or still need to be established, in a conditional transaction, the transaction reference inheriting the solidified occupancy code of the parent transaction is first inserted into the set of pending references for this occupancy, and then the parent transaction reference is cleared; for derived transactions that can be determined not to be established and will not be established again based on the native result of the communication service provider or the service provider adapter record, in the same conditional transaction, clear evidence of the uncreated state is first saved, and then the parent transaction reference is cleared. Closing a new external communication request entry does not block internal transactions derived from the parent transactions already registered under this occupancy. When the occupancy status has changed to pending release, the derived transaction reference registration no longer uses the occupancy status as the commit condition. Instead, it uses the following conditions for commit: the parent transaction reference still exists; the derived transaction inherits the parent transaction's fixed occupancy code; the occupancy code in the occupancy record matches the fixed occupancy code; the current version number matches the version number read in the registration operation; and the event log partition corresponding to the derived transaction belongs to the relevant internal event log partition that was fixed and recorded with the release barrier during unbinding. If the conditional transaction fails to commit due to version changes, the occupancy record and parent transaction reference are reread and verified; the parent transaction reference must not be cleared beforehand. If the partition corresponding to the derived transaction is not in the fixed relevant internal event log partition, or the release barrier of the partition is not successfully recorded, the parent transaction reference and pending release status are maintained, and return to the pool is prohibited.
[0061] In the first embodiment, the occupancy code for privacy number X is G28. Under this occupancy, there are voice transaction C1, message transaction M1, and recording transaction R1. M1 has obtained the final delivery receipt, C1 has ended but the final CDR has not arrived, and R1 is still being processed.
[0062] After the business order is completed, an unbinding request is issued. The system closes the new external communication transaction entry point for G28 and records the release barriers for each relevant event log partition. Since C1 and R1 are still in the pending reference set, G28 remains pending release even though the binding validity period has expired, and X is not returned to the number pool.
[0063] Subsequently, the final CDR arrives and matches C1 with the service transaction association key containing the communication service provider's call identifier. The recording completion event matches R1 with the service transaction association key containing the recording identifier. The final state normalization unit confirms the termination of both references and clears them. Each partition continuously confirms that the water level continues to advance until it reaches or surpasses the release barrier recorded during unbinding.
[0064] In an atomic release transaction, transaction unit 114 verifies that G28 has no new references, the set is empty, and the watermark meets the conditions. It then adds G28 to the historical occupancy record and marks X as allocable. The next time X is allocated, an occupancy code G29 is generated instead of continuing to use G28.
[0065] After X is assigned to G29, the service provider repeatedly pushes the final CDR of C1. The event receiving channel first matches the historical occupancy record of G28 according to the call identifier of the communication service provider, appends the duplicate event to G28 and performs idempotent processing, without querying the current occupancy of X. Therefore, this event will not be written to the call detail record of G29.
[0066] In the second embodiment, the service provider did not return a message identifier in a timely manner. Upon unbinding, the internal message transaction still had an incomplete transaction reference. The system performed a status query on this reference; if the query clearly indicated that the request was not accepted and no message transaction was established, the system saved the evidence of the uncreated state and cleared the reference; if the query result was unclear, the transaction reference remained pending, the relevant record entered the verification area, and the routing identifier was prohibited from being converted to an assignable state.
[0067] The third embodiment is used to verify the continuous acknowledgment level. Before unbinding, the call detail record (CDR) event has already entered the internal log, but the home processor is experiencing a backlog. The pending set may temporarily appear empty due to other final state events, but the continuous acknowledgment level of the CDR partition has not yet reached the release threshold, and the system must not return it to the pool. Release is only allowed after the backlog of events has been processed and correctly assigned to the occupancy, and the level has reached or exceeded the threshold.
[0068] The fourth embodiment illustrates the concurrency of registering and unbinding new external communication requests. One thread registers a new voice transaction, while another thread unbinds simultaneously, both performing condition updates on the same occupancy record version. If the external request registration is committed first, the transaction reference enters the pending set, and the communication request is sent after the commit. The unbinding operation rereads the updated version and subsequently closes the entry and records the release barrier. If the unbinding is committed first, the external request registration fails due to occupancy status or version conditions not being met. After rereading the pending release status, the request is rejected. This concurrent processing will not create external communication requests that have been sent but not registered. For internal transactions derived from registered parent transactions, registration is completed in the pending release status according to the aforementioned independent conditions, and the occupancy status restriction for new external communication requests in this embodiment does not apply.
[0069] Event matching prioritizes the use of service transaction association keys. If the native event only has a route identifier but no transaction identifier, the system can also use communication participants, service type, and occurrence time for candidate retrieval; if the candidates are not unique, they enter the verification area and are not automatically assigned to the currently occupied event.
[0070] For new incoming calls initiated by users of the Public Switched Telephone Network (PSTN) and whose signaling does not carry a platform transaction identifier, this method does not treat the call as a late event of a prior transaction. The phone number class implementation continues to use the routing association parameters consisting of the calling, called, and privacy numbers, or processes the call according to pre-configured incoming call routing rules. This method isolates asynchronous events that can be traced back using the service provider's transaction identifier.
[0071] Historical occupancy records are retained at least until the end of the service provider's event retention period, or as an irreversible index of the service provider's transaction identifier. Records can be stored using a hot-cold tiered system; even if the main data becomes cold, the transaction identifier index can still be used to prevent late events from contaminating new occupancy.
[0072] The return-to-pool operation is idempotent. If the response is lost after the release transaction is committed, the old occupancy number and occupancy record version are used for verification during retry. If it is found that the old occupancy has been archived and the routing identifier has been changed to an allocable state, or has been reassigned under a new occupancy number, the existing release result is returned, and the number pool count is not changed again.
[0073] During system failure recovery, first restore the occupancy records, pending reference sets, and continuous acknowledgment levels for each channel, then restore the automatic release task. If it cannot be proven that the set matches the level, maintain the unassignable state of the route identifier and do not directly return the empty set in the cache to the pool.
[0074] A set of functional verification processes includes: delaying the final CDR after unbinding; delaying the recording completion event after the call ends; temporarily emptying the pending set of message receipt channels; creating concurrency between unbinding and transaction registration; and repeatedly sending events with the old communication service provider's call identifier after a new occupancy is established. Late event isolation, delayed release, conditional return to pool, and historical event attribution are verified separately.
[0075] During implementation, logs are saved for binding, unbinding, occupation codes, transaction references, service transaction association keys, final state evidence, release barriers, continuous acknowledgment levels, return-to-pool transactions, and late event attribution. These logs are used for fault reproduction and to verify the differences between the fixed static strategy and this method in terms of resource occupation time and the number of misattributions.
[0076] Voice, messaging, and recording services each retain their native state machines. The adapter declares final state evidence that can clear transaction references for each service, while retaining the communication service provider, service account, and service provider transaction identifier.
[0077] This invention can be used for the multiplexing management of privacy numbers, cloud call access numbers, SIP routing identifiers, message sending addresses and other limited communication routing resources, and is especially suitable for cloud communication platforms where call, message, call detail record and recording events arrive asynchronously from different channels. Fifth Implementation Example: Verification of Release Condition Function
[0078] This embodiment provides a deterministic event scenario for verifying release conditions. Each scenario predetermines the occupancy status, transaction reference, event arrival order, partition sequence number, and service provider return status. Verification objects include the set of pending references, release barriers, continuous acknowledgment levels, occupancy record version, historical occupancy attribution, and corresponding log fields. The expected behavior described below represents the state transitions and log entries that should occur according to the aforementioned steps, and does not indicate that statistical testing has been completed for a specific sample size.
[0079] Scenario 1 involves a delay in the final call detail record. Voice transaction C1 under occupancy code G1 has received a SIP termination event, but the final call detail record required by the final state configuration has not yet arrived. At this point, an unbinding request is received, and the release barriers of the relevant partitions are recorded. The expected behavior is as follows: the transaction reference for C1 remains, the occupancy state remains pending release, and even if the consecutive acknowledgment levels of other partitions have reached the release barriers, the routing identifier should not be changed to an assignable state. After the final call detail record arrives, it should be assigned to G1 based on the service transaction association key. C1 should be cleared after the final state combination is satisfied, and the return to the pool should only be performed when the consecutive acknowledgment levels of all relevant partitions have reached or exceeded their respective release barriers. The corresponding logs should sequentially display the missing final state evidence, the final call detail record being assigned to G1, the reference clearing, and the fulfillment of the release conditions.
[0080] Scenario 2 involves a delay in the recording completion event. The parent voice transaction has ended and the recording transaction R1, inheriting the same occupancy code, has been registered according to the final state configuration. The recording event partition corresponding to R1 has been fixed as a possible derived transaction partition and its release barrier has been recorded during unbinding. After unbinding, R1 is still in the transcoding, merging, or uploading state. The expected behavior is: the termination of the parent transaction will not cause R1 to be prematurely cleared, and the pending reference set will be prevented from returning to the pool because R1 is not empty; R1 will only be allowed to be cleared after receiving the recording file completion event and obtaining the size, digest, or container integrity verification result, or after obtaining an unrecoverable failure final state. The corresponding log should retain R1's occupancy code, derivation source, corresponding partition identifier, original state, integrity evidence, and reason for clearing, in order to distinguish between the two situations: the recording has not yet been completed and the recording has been definitively stopped.
[0081] Scenario 3 involves a partition sequence number gap. During unbinding, the release of the barrier FP is recorded in the relevant internal event log partition P. An event with a sequence number no greater than FP has not yet completed persistence or ownership processing, while a larger sequence number following the gap has been processed. The expected behavior is: the continuous confirmation level of partition P remains before the gap, not exceeding it due to the observation of a larger sequence number; even if the pending reference set is temporarily empty, the ownership remains pending release. After the gap event is processed, the continuous confirmation level can then continuously advance to FP or a larger sequence number and participate in the return-to-pool condition verification. The corresponding logs should record the processed discrete sequence number, the gap position, the continuous confirmation level, and the reason for its advancement.
[0082] Scenario 4 involves concurrent unbinding and registration of new external communication requests. The external request registration and unbinding operations read the same persistent record version. The expected behavior is as follows: if the registration condition transaction commits first, the transaction reference enters the pending reference set and the version is updated first, and the communication request can only be sent subsequently; the unbinding operation should be re-executed based on the updated version. If the unbinding condition transaction commits first, the status changes to pending release and the entry point is closed; the registration operation fails due to unmet status or version conditions, and after rereading, the external communication request is rejected and cannot be sent. The corresponding logs should be able to prove, in the transaction commit order, that each sent external request has a prior persistent transaction reference.
[0083] Scenario 5 involves registering a derived transaction before clearing the parent transaction. The final state configuration declaration of parent transaction C2 allows the derivation of a recording transaction R2. The native final state combination corresponding to C2 is satisfied, the occupancy status is pending release when processing its final state event, and the recording event partition corresponding to R2 has been solidified during unbinding and the release barrier has been successfully recorded. The expected behavior is as follows: In the same conditional transaction, first register R2, which inherits the solidified occupancy code from C2 and records the fixed partition identifier, then clear C2; upon commit, verify that the parent transaction reference still exists, the occupancy code in the occupancy record matches the solidified occupancy code of C2, the current version number matches the version number read by the registration operation, and the partition corresponding to R2 belongs to the solidified relevant internal event log partition. If any condition is not met, it should be reread and verified, leaving no gap where the parent transaction has been cleared but R2 has not been registered; if it can be determined that R2 has not been established and will not be established again, then clear the uncreated state evidence first, then clear C2. The corresponding logs should ensure that the recording order of derived reference registration or uncreated state evidence precedes the parent transaction reference clearing and is included in the same commit result.
[0084] Scenario 6 involves a delayed old event after route identifier reuse. Occupancy G1 has met the release conditions and been archived, and the same route identifier is subsequently assigned to a new occupancy G2. Afterwards, a duplicate or delayed native event carrying the service transaction association key of G1 is received. The expected behavior is: the event should match the historical occupancy record of G1 according to the service transaction association key and be appended to G1. The current occupancy of the route identifier should not be queried to rewrite the attribution, nor should the call detail records, recordings, message status, or billing status of G2 be updated. The corresponding logs should simultaneously record the service transaction association key, the matched historical occupancy code, the current occupancy code, and the isolation processing result to verify that there is no write path between the old event and the new occupancy.
[0085] The above scenarios illustrate verifiable state transitions, submission order, and log observation points. The implementation system can construct corresponding inputs based on the native event types, final state configurations, and partitioning methods of the actual communication service; the verification criteria are based on whether pending references, continuous confirmation levels, occupancy codes, and conditional transaction rules are met, and are not limited to fixed waiting times, statistical sample sizes, or specific operating environments.
Claims
1. A method for releasing a reusable communication route identifier, executed by a communication route identifier manager, characterized in that, include: S1. When obtaining a reusable communication route identifier from the allocatable pool, generate an occupation code for this occupation and establish an occupation record containing occupation status, version number, and route association parameters; S2. Before the communication request corresponding to this occupation is sent to the communication service provider via the service provider adapter, add a transaction reference containing service type, internal transaction identifier, and the occupation code to the pending reference set of this occupation. The persistence of the transaction reference and the update of the occupation record version number are completed in the same conditional transaction. The communication request is only sent after the conditional transaction is successfully committed; S3. After obtaining the service provider transaction identifier, establish a service transaction association key consisting of the communication service provider identifier, service account identifier, service type, and the service provider transaction identifier; S4. In response to the unbinding request, through another... The transaction updates the occupancy status to pending release and closes the new external communication request entry point for the occupancy. After the other conditional transaction is committed, based on the service type of the registered transactions under this occupancy and the possible derived auxiliary processing transactions declared in the pre-set final state configuration, combined with the communication service provider identifier, service account identifier, service type and routing fragmentation rules, the relevant internal event log partitions that carry the events corresponding to the registered transactions and the possible derived auxiliary processing transactions and have independent monotonic sequence number fields are determined and fixed. The corresponding release barrier is recorded in each of the relevant internal event log partitions. If the release barrier of any of the relevant internal event log partitions is not recorded, the occupancy status is maintained as pending release and the reusable communication route identifier is prohibited from being converted to an allocable state. S5. Receive native events generated by the communication service provider, match transaction references according to the service transaction association key, and classify the native events into the occupancy code fixed when the transaction reference was created; the pre-set final state configuration declares the native final state combination required to clear the transaction reference according to the service type, and declares whether the transaction of the corresponding service type can derive auxiliary processing transactions. Hereinafter, the pre-set final state configuration is simply referred to as the final state configuration; for transactions that the final state configuration declares cannot derive auxiliary processing transactions, when the native final state combination corresponding to the service type of the transaction is satisfied, the transaction reference of the transaction is cleared from the set of pending references; S6. For parent transactions that the final state configuration declares can derive auxiliary processing transactions, after the native final state combination corresponding to the service type of the parent transaction is satisfied and before clearing the parent transaction reference, verify the establishment status of each derived transaction declared by the final state configuration; S7. For derived transactions that have been established or still need to be established according to the final state configuration, register them as transaction references that inherit the same occupancy code and record the corresponding partition identifier determined according to the routing sharding rules, and add them to the set of pending references for this occupancy; when the occupancy status is pending release, the corresponding partition identifier is determined from each relevant internal event log partition that has been solidified in step S4 and successfully recorded the release barrier. For derived transactions that can be determined not to be established and will not be established again based on the native results of the communication service provider or the service provider adapter records, obtain clear evidence of the uncreated state indicating that the derived transaction has not been established and will not be established again; after each derived transaction has completed the registration or obtained the evidence of the uncreated state, remove the parent transaction reference from the pending reference set; S8, only when the pending reference set occupied this time is empty, the release barrier of each related internal event log partition has been successfully recorded, and the continuous acknowledgment level of each related internal event log partition is not less than its corresponding release barrier, archive the current transaction through atomic operations. The previous occupancy record is recorded and the reusable communication route identifier is converted to an allocable state; otherwise, the occupancy record is maintained in a pending release state and the conversion of the reusable communication route identifier to an allocable state is prohibited. The continuous confirmation level is the largest consecutive event sequence number in the corresponding partition that has been persisted and completed the occupancy ownership processing; S9, when the reusable communication route identifier is reassigned, a new occupancy code different from each historical occupancy code is generated; S10, the late native event that matches the historical occupancy code according to the service transaction association key is written into the historical occupancy record, and the late native event is prohibited from updating the occupancy record corresponding to the new occupancy code.
2. The method according to claim 1, characterized in that, The reusable communication route identifier includes a private phone number, a SIP Uniform Resource Identifier, a message sending address, or a callback route key; the route association parameters include at least two of the following: communication initiator identifier, communication receiver identifier, service tenant identifier, and allowed service type.
3. The method according to claim 1, characterized in that, When the synchronous response does not return a service provider transaction identifier, the transaction reference is retained in the pending reference set and marked as an identifier to be completed; after obtaining the service provider transaction identifier through a status query, the identifier is written; when the status query clearly indicates that the communication service provider has not accepted the communication request and has not established a corresponding service transaction, the query result is saved as evidence of no creation status and the corresponding transaction reference is removed from the pending reference set; when the query result is unclear, the transaction reference is kept in a pending state and the transaction reference and query result are written to the verification area, and the reusable communication route identifier is prohibited from being converted to an allocatable state before a clear result is obtained.
4. The method according to claim 1, characterized in that, The final state configuration declaration specifies the native final state combination required for clearing transaction references for each service type, including: voice communication transactions requiring call detail record (CDR) integrity use a combination of SIP termination event and final CDR; communication service providers that do not provide SIP events use a combination of status query final state and final CDR; message communication transactions use a final delivery success receipt, a final delivery failure receipt generated by the communication service provider, or a final state that cannot be processed further returned by status query; and recording processing transactions use a combination of file completion identifier and integrity verification result, or an unrecoverable failure final state.
5. The method according to claim 1, characterized in that, The release barrier is the barrier sequence number of the unbinding operation in the internal event log partition; when there is a sequence number gap in any partition, the continuous confirmation level of that partition does not exceed the sequence number gap; when the continuous confirmation level is equal to the corresponding release barrier, it indicates that all events in the internal event log partition with a sequence number not greater than the release barrier have been continuously persisted and assigned ownership.
6. The method according to claim 1, characterized in that, The conditional transactions corresponding to the transaction reference registration for external communication requests and the conditional transactions corresponding to the entry point closure are both committed under the condition that the occupancy status is occupied and the current version number is consistent with the version number read by the corresponding transaction. Only after the conditional transactions corresponding to the transaction reference registration for external communication requests are successfully committed can the external communication request be sent to the communication service provider. The release barrier is only recorded after the conditional transaction corresponding to the closure of the entry point has been successfully committed. When the conditional transaction corresponding to the transaction reference registration for external communication requests fails to commit due to version number inconsistency, the occupancy record is reread, and the transaction reference registration is re-executed or the external communication request is rejected based on the reread occupancy status. For the internal transaction derived from the registered parent transaction under this occupation in step S7, when the occupation status is in occupation, the registration and submission conditions are: the parent transaction reference still exists, the internal transaction inherits the fixed occupation code in the parent transaction reference, the occupation code in the occupation record is consistent with the fixed occupation code, and the current version number is consistent with the version number read by the registration operation. When the occupancy status is pending release, in addition to meeting the above registration and submission conditions, the registration and submission condition is also that the event log partition corresponding to the internal transaction belongs to the relevant internal event log partition that has been solidified in step S4 and successfully recorded the release barrier; if any of the registration and submission conditions are not met, the parent transaction reference is kept in the pending state, and the occupancy record, parent transaction reference and relevant internal event log partition information are reread for verification.
7. The method according to claim 1, characterized in that, The historical occupancy record stores the historical occupancy code, service transaction association key, native event summary, and final state evidence; the service transaction association key also includes at least one of the business tenant identifier, adapter instance identifier, and interface semantic version; native events that do not match a transaction reference or whose matching result is not unique are written to the pending verification area and are not directly assigned to the new occupancy code according to the current route identifier.
8. A release device for a reusable communication route identifier, characterized in that, It includes a occupancy management module, a transaction reference registration module, a condition closure and fence module, an event attribution and final state processing module, a continuous confirmation water level module, a transaction release module, and a late event isolation module; each module is configured to perform the method described in any one of claims 1 to 7.
9. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.
