Multi-channel message intelligent routing and unified pushing method and system
By introducing anti-duplicate concurrent race condition flags and broadcast mechanisms into the multi-channel message push system, the contradiction between concurrent reach rate and anti-duplicate control in multi-channel message push is resolved, achieving real-time and efficient message transmission and optimized user experience.
Patent Information
- Application Number
- CN202611314720.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-20
AI Technical Summary
Existing multi-channel push mechanisms have a contradiction between concurrent delivery rate and anti-duplicate control, resulting in degraded message delivery timeliness and high user disturbance rate, and lack the ability to coordinate and dynamically intervene in the multi-channel delivery queue.
By injecting anti-duplicate concurrent race state identifiers into each heterogeneous message and introducing a first-delivery confirmation and broadcast mechanism based on these identifiers, targeted matching and cancellation of cross-channel data redundancy are achieved. Message reassembly and delivery are then performed in conjunction with multi-dimensional feature vectors and protocol encapsulation constraints.
It effectively overcomes the multi-level retry delay and message duplication phenomenon of indiscriminate concurrent push in traditional serial push, ensuring message real-time performance and delivery probability, reducing user disturbance rate, and improving system expansion flexibility.
Smart Images

Figure CN123145206A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication data processing technology, and discloses a method and system for intelligent routing and unified push of multi-channel messages. Background Technology
[0002] As mobile internet service scenarios become increasingly complex, service providers typically need to use various heterogeneous communication channels (such as in-app long connections, vendor-level system push notifications, SMS / MMS, etc.) to send important business messages to end users. However, existing multi-channel message push mechanisms have significant engineering implementation flaws. If a serial degradation push strategy is adopted, i.e., trying a backup channel only after the main channel times out or fails, multi-level retry delays will inevitably be introduced, resulting in a severe deterioration in the real-time performance of message delivery. If a simple concurrent push strategy is adopted, because the heterogeneous communication channels are independent of each other and lack underlying state coordination, it is very easy for the same terminal device to receive a large number of messages with duplicate content, which not only wastes the server's processing performance and network bandwidth, but also brings a very high user interruption rate.
[0003] From the perspective of the underlying data flow mechanism, once existing multi-channel concurrent systems push format-converted messages into their respective network transmission queues, they lose cross-domain control over messages in the "pending transmission" state. When a certain channel completes transmission first and obtains terminal acknowledgment, the existing architecture lacks a high-speed and efficient cross-channel race-state broadcasting and interception mechanism. It cannot accurately locate and cancel redundant data that has not yet been transmitted in other channel queues, causing the system to passively execute invalid duplicate transmission operations. In summary, current message routing and push technologies have an irreconcilable contradiction between concurrent reach rate and anti-duplicate control, and lack the ability to globally coordinate and dynamically intervene in multi-channel transmission queues. A new method is urgently needed to solve the problems of cross-channel data redundancy concurrency and invalid resource consumption. Summary of the Invention
[0004] To overcome the aforementioned deficiencies of the prior art and to achieve the above objectives, the present invention provides the following technical solution: a multi-channel message intelligent routing and unified push method, comprising: S1: Extract the terminal addressing identifier and content payload from the initial message, perform a routing query operation based on the terminal addressing identifier, match multiple target communication channels, and obtain the protocol encapsulation constraint specifications of each target communication channel; S2: Reassemble the content payload according to the protocol encapsulation constraint specification to generate heterogeneous delivery messages adapted to each target communication channel, and inject anti-duplicate concurrency race state identifiers into the protocol headers contained in each heterogeneous delivery message; S3: Push each heterogeneous message into the network transmission queue contained in the corresponding target communication channel to perform the sending operation; S4: When any of the target communication channels receives an acknowledgment carrying the anti-duplicate concurrency race condition flag, the anti-duplicate concurrency race condition flag is broadcast to the other target communication channels, and the corresponding pending message is removed from the network transmission queue contained in the other target communication channels.
[0005] Preferably, step S1, which involves performing a routing query based on the terminal addressing identifier to match multiple target communication channels, specifically includes: Extract the current context activity features of the terminal associated with the terminal addressing identifier, and retrieve the real-time network link quality matrix of each candidate communication channel; A multi-dimensional feature vector is constructed based on the terminal context activity characteristics and the real-time network link quality matrix, and then input into the preset routing decision model to output the reach probability score of each candidate communication channel. Several candidate communication channels with reach probability scores greater than a preset threshold are selected as multiple target communication channels.
[0006] Preferably, obtaining the protocol encapsulation constraint specifications for each target communication channel in S1 specifically includes: The distributed configuration center retrieves the channel identifiers that match each of the target communication channels. The corresponding protocol adaptation template is loaded according to the channel identifier. The maximum transmission unit (MTU) limit, message header byte arrangement rules, and heartbeat keep-alive period defined in the protocol adaptation template for the corresponding target communication channel are used as the protocol encapsulation constraint specifications.
[0007] Preferably, step S2 involves reassembling the content payload according to the protocol encapsulation constraint specifications, specifically including: Allocate a read-only anchor memory block for the content payload in the shared memory of the push system; According to the protocol encapsulation constraint specifications, each target communication channel is independently allocated a front memory page containing a customized protocol header; By using memory addressing pointers, each preceding memory page is logically concatenated with a read-only anchored memory block, and heterogeneous delivery messages are generated using a zero-copy method.
[0008] Preferably, the injection of anti-repetition and concurrency race condition flags into the protocol header of each heterogeneous message in S2 specifically includes: Collect the arrival timestamp of the initial message, the digest hash value of the content payload, and the global auto-incrementing sequence number of the push system; A distributed unique ID generation algorithm is used to perform displacement fusion calculation on the arrival timestamp, the digest hash value, and the global auto-incrementing sequence number to generate a globally unique identifier with lifecycle attributes as an anti-duplicate concurrency race condition identifier, and the anti-duplicate concurrency race condition identifier is written into the reserved extension field of each front-end memory page.
[0009] Preferably, step S3, which involves pushing each heterogeneous message into the network transmission queue of the corresponding target communication channel for delivery, specifically includes: Evaluate the service priority parameters carried in the initial message; Construct multi-level priority sub-queues within the network transmission queues contained in each target communication channel; Based on the service priority parameter, heterogeneous packets are pushed into the corresponding priority sub-queue, and the distribution rate of each network transmission queue is controlled by the token bucket algorithm.
[0010] Preferably, in step S3, while performing the operation of pushing each heterogeneous sent message into the network transmission queue contained in the corresponding target communication channel, the method further includes: Obtain the memory address pointer of each heterogeneous distributed message in the corresponding network transmission queue; A global withdrawal hash mapping table is synchronously constructed in the memory space of the push system, using the anti-concurrency race state identifier as the key and the corresponding resident memory address pointer as the value for key-value pair storage.
[0011] Preferably, in step S4, when any of the target communication channels receives an acknowledgment carrying the anti-concurrency race condition flag, the anti-concurrency race condition flag is broadcast to the remaining target communication channels, specifically including: Analyze the first confirmation receipt to verify the legality and effective lifespan of the anti-duplicate and concurrent race state identifier it carries; If the verification is successful, a global interrupt signal carrying an anti-concurrency race condition flag is broadcast to the protocol daemon coroutines of the other target communication channels via a high-speed asynchronous event bus in a publish-subscribe mode, thus completing the broadcast operation.
[0012] Preferably, step S4, which involves matching and removing corresponding pending messages from the network transmission queues included in the remaining target communication channels, specifically includes: In response to the anti-concurrency race condition flag received by the broadcast operation, each of the remaining target communication channels looks up the corresponding target resident memory address pointer in the global withdrawal hash mapping table. By using the atomic compare and swap (CAS) instruction of the operating system, the status bit of the data block pointed to by the target resident memory address pointer is flipped to the discard state, so that the consumption thread of the network transmission queue will silently discard the data block when it is read.
[0013] A multi-channel message intelligent routing and unified push system, comprising: The addressing and matching module extracts the terminal addressing identifier and content payload from the initial message, performs a routing query operation based on the terminal addressing identifier, matches multiple target communication channels, and obtains the protocol encapsulation constraint specifications of each target communication channel; The message reassembly module reassembles the content payload according to the protocol encapsulation constraint specification, generates heterogeneous delivery messages adapted to each target communication channel, and injects anti-duplicate concurrency race state identifiers into the protocol headers contained in each heterogeneous delivery message. The queue delivery module pushes each heterogeneous delivery message into the network transmission queue contained in the corresponding target communication channel to perform the delivery operation. The broadcast withdrawal module, when any of the target communication channels receives an acknowledgment receipt carrying the anti-concurrency race condition flag, broadcasts the anti-concurrency race condition flag to the other target communication channels, and matches and removes the corresponding pending message from the network transmission queue contained in the other target communication channels.
[0014] Compared with the prior art, the present invention has the following beneficial effects: This invention effectively overcomes the multi-level retry delay caused by traditional serial push by injecting anti-duplicate concurrent race condition flags into each heterogeneous message and introducing a first-delivery confirmation and broadcast mechanism based on these flags on the basis of multi-channel concurrent push. It also eliminates the message duplication phenomenon caused by conventional indiscriminate concurrent push. The system can ensure that important business messages have extremely high real-time performance and delivery probability while avoiding redundant information received by the same terminal from the business source, significantly reducing user disturbance rate.
[0015] This invention enables dynamic collaborative control of the underlying network transmission queue. When any channel completes the transmission and obtains the terminal receipt first, the system can quickly target and silently remove the corresponding pending message from the queues of other channels through a broadcast mechanism, blocking invalid repeated transmission actions and effectively releasing the server's processing performance and network bandwidth.
[0016] This invention extracts the terminal addressing identifier for routing lookup before delivery and reassembles the common content payload according to the protocol encapsulation constraints of each target channel. This unified constraint and reassembly mechanism allows the upper-layer business logic to be completely decoupled from the complex heterogeneous transmission protocols at the lower layer. This not only ensures high compatibility of the message format with various delivery channels but also gives the system excellent scalability when accessing new communication channels in the future. Attached Figure Description
[0017] Figure 1This is a schematic diagram of a multi-channel message intelligent routing and unified push method according to the present invention; Figure 2 This is a schematic diagram of the structure of a multi-channel message intelligent routing and unified push system according to the present invention; Figure 3 This is a timing diagram of the concurrent withdrawal logic of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example
[0019] Please see Figures 1 to 3 As shown, this embodiment provides a method and system for intelligent routing and unified push of multi-channel messages, specifically including the following steps: Routing lookup operations are performed based on terminal addressing identifiers to match multiple target communication channels, specifically including: The system extracts the current context activity features of the terminal associated with the terminal addressing identifier and retrieves the real-time network link quality matrix of each candidate communication channel.
[0020] The terminal's current context activity feature is used to characterize the physical and system real-time operating status of the target device from multiple dimensions. This feature includes the device's screen being on or off, whether the target application is currently running in the foreground or background, and the device's current remaining battery percentage. The screen status determines whether the user is looking at the device, the application's running status affects the process keep-alive probability of the application-level long-connection channel, and the remaining battery percentage determines whether the operating system has enabled strict power-saving network restriction policies.
[0021] Meanwhile, the system uses probe clusters distributed across network nodes to retrieve real-time network link quality matrices for various candidate communication channels, including in-application long-connection channels, mobile phone manufacturer system-level push channels, and traditional SMS channels. The real-time network link quality matrix covers the network physical communication metrics of each candidate communication channel at the current moment, specifically including the network latency in milliseconds at the current moment, and the average packet loss rate percentage within a historical preset time window, i.e., the most recent 10 minutes.
[0022] The system constructs a multi-dimensional feature vector based on terminal context activity characteristics and real-time network link quality matrix.
[0023] When constructing the multidimensional feature vector, the system performs unified data encoding and numerical processing on terminal context activity features and network link quality matrix. For discrete features such as screen on / off state and application foreground / background state, the system converts different states into corresponding numerical fields; for continuous features such as network latency and packet loss rate, the system performs scaling uniformity according to preset numerical processing rules. After completing the above processing, the system combines the features according to a pre-defined field arrangement order to form a multidimensional feature vector.
[0024] The system inputs multidimensional feature vectors into a preset routing decision model and outputs a reach probability score for each candidate communication channel.
[0025] In this embodiment, the preset routing decision model is a gradient boosting tree machine learning model built on an extreme gradient boosting framework. This model is trained on massive amounts of historical push log data in the system's offline training cluster. The specific training process is as follows: multi-dimensional feature vectors from historical records are used as sample inputs, and whether the corresponding message successfully reaches the target terminal within 3 seconds is used as the true verification label, where 1 represents successful delivery and 0 represents failure. This machine learning model uses binary cross-entropy as the target loss function and employs first-order gradient and second-order Hessian derivative to guide the splitting and growth of multiple decision trees within the system. In terms of specific training parameter settings, the maximum tree depth of the decision trees is strictly controlled between 5 and 8 layers, and the learning rate is set between 0.01 and 0.1. The system iterates through each tree and fits the residuals of the previous stage model to ultimately generate a complete routing decision model.
[0026] During real-time route evaluation, the system inputs the currently constructed multi-dimensional feature vector into the routing decision model corresponding to each candidate communication channel. The data contained in this multi-dimensional feature vector, according to specific feature judgment conditions, sequentially passes through the split nodes of each decision tree within the model and finally falls into the corresponding leaf node. The system controller processes the model output to obtain the reach probability score corresponding to each candidate communication channel and converts the reach probability score to a numerical range of 0 to 1.
[0027] The system selects several candidate communication channels with a reach probability score greater than a preset threshold as multiple target communication channels.
[0028] The preset threshold is a channel reach probability screening threshold pre-set by the system, used to determine the target communication channel based on the reach probability score of each candidate communication channel.
[0029] For example, the current preset threshold set in the configuration center is 0.80. In a real-world concurrent push scenario, the system extracts feature data representing that the screen is on, the application is running in the background, the long connection channel latency is 40 milliseconds, and the system-level channel packet loss rate is 0%, and constructs the current multi-dimensional feature vector according to the aforementioned rules. After the system inputs this multi-dimensional feature vector into the routing decision model, the model outputs a reach probability score of 0.85 for the application-internal long connection channel, a reach probability score of 0.92 for the mobile phone manufacturer's system-level channel, and a reach probability score of 0.12 for the traditional SMS channel. The underlying routing controller of the system performs concurrent comparison and judgment on the scores of each candidate channel. The judgment results show that the score of 0.85 for the application-internal long connection channel and the score of 0.92 for the mobile phone manufacturer's system-level channel are both greater than the preset threshold of 0.80, while the score of 0.12 for the traditional SMS channel is far below this threshold and is therefore directly and silently eliminated. Therefore, the system accurately selects and binds the in-application long connection channel and the mobile phone manufacturer's system-level channel to serve as multiple target communication channels for this heterogeneous concurrent push task.
[0030] Obtain the protocol encapsulation constraints for each target communication channel, specifically including: The system retrieves channel identifiers that match the communication channels of each target in the distributed configuration center.
[0031] A distributed configuration center is a foundational middleware service system used in a distributed server cluster architecture to uniformly store, manage, and dynamically distribute various configuration parameter files. By introducing a distributed configuration center, the system can achieve dynamic hot updates of the underlying parameters of various heterogeneous communication channels without restarting the core push service process. A channel identifier is a globally unique numeric code or string code that uniquely represents a specific communication push channel within the system.
[0032] For example, when the system determines that messages need to be sent concurrently to both the application's long-connection channel and the mobile phone manufacturer's system-level push channel, the server will initiate an internal network request to the distributed configuration center for retrieval and comparison. After matching in its underlying relational database or key-value storage engine, the distributed configuration center returns the channel identifier 1001 corresponding to the application's long-connection channel to the server, and simultaneously returns the channel identifier 1002 corresponding to the mobile phone manufacturer's system-level push channel.
[0033] The system loads the corresponding protocol adapter template based on the channel identifier and uses the specific parameters defined in the protocol adapter template as protocol encapsulation constraint specifications.
[0034] The protocol adapter template is structured configuration data pre-stored in the configuration center, used to define the message fields and encapsulation parameters of the corresponding communication channel. The system loads the corresponding protocol adapter template according to the channel identifier and loads it into the runtime memory to guide the encapsulation of subsequent heterogeneous message distribution.
[0035] The protocol adaptation template clearly defines three core underlying communication parameters: the maximum transmission unit (MTU) limit required for the corresponding target communication channel, the message header byte arrangement rules, and the heartbeat keep-alive cycle.
[0036] The Maximum Transmission Unit (MTU) limit indicates the maximum length of a data unit allowed in a single transmission on a corresponding communication channel. The system determines the allowed payload length of a single transmitted message based on the MTU limit and the corresponding protocol header length; when the payload exceeds the allowed length, it is fragmented. This limit directly determines whether the system needs to perform application-layer splitting for excessively large service payloads. For example, the template defines a maximum transmission unit MTU limit of 4096 bytes for long-connection channels within an application, while the mobile phone manufacturer's system-level channel has a maximum transmission unit MTU limit of 2048 bytes.
[0037] The header byte arrangement rule refers to the specific memory byte length occupied by each control and verification field when constructing the underlying network data packet, as strictly defined by the system, and the relative physical order of these fields concatenated in memory. For example, in the protocol adaptation template corresponding to channel identifier 1001, the header byte arrangement rule is as follows: the first 4 bytes are filled with the network protocol magic number, the next 2 bytes are filled with the packet version number, the following 4 bytes are filled with the total packet length, and the last 8 bytes are filled with the security check code, totaling 18 bytes in header length. The rule for channel identifier 1002 is defined as: the first 8 bytes are filled with the device authentication token, and the following 4 bytes are filled with the service type status code, totaling 12 bytes in header length.
[0038] The heartbeat keep-alive period refers to the time interval in seconds required by the underlying system to periodically send probe empty packets to the terminal in order to maintain the long-lived connection of the network transmission control protocol between the client and the server and prevent it from being silently blocked by the intermediate network address translation gateway of the operator. For example, the heartbeat keep-alive period of the application's long-lived connection channel is set to 30 seconds in the template, that is, the underlying network module sends a probe packet every 30 seconds; while the heartbeat keep-alive period of the mobile phone manufacturer's system-level channel, which uses a stateless short-connection interface for request and interaction, is explicitly defined as 0 seconds in the template, that is, the keep-alive probe daemon thread is not started at all.
[0039] The system caches these parameters—precise down to the byte length, relative memory location of fields, and time in seconds—in a unified variable structure within local high-speed memory. These parameters serve as protocol encapsulation constraints to guide subsequent reassembly of common content payloads and encapsulation of heterogeneous delivery messages. Through this templated definition and dynamic loading mechanism supported by real data structures, upper-layer business logic is completely decoupled from the complex heterogeneous transmission protocols at the lower level, ensuring the determinism and feasibility of message encapsulation processes for each channel.
[0040] The content payload is reassembled according to the protocol encapsulation constraints, specifically including: The system allocates a read-only anchor memory block in the shared memory space of the operating system for the content payload of the initial message.
[0041] Shared memory refers to a data area within the physical memory space of a server's operating system that can be accessed by multiple distribution channel processing threads. Read-only anchored memory blocks, on the other hand, refer to memory spaces used to store the original common business message content, which are forcibly locked into an unmodifiable state through memory access control mechanisms. For example, for a 1024-byte business content payload, the system will select a contiguous space in the server's physical memory, allocate this memory, and set its access control permission attribute to read-only. This underlying permission management mechanism ensures that, in highly concurrent cross-channel read scenarios, the common payload data will never be subject to dirty writes or accidental tampering. More importantly, regardless of how many heterogeneous channels the system needs to concurrently distribute messages to, this common content payload always exists in only one copy in the server's running memory, significantly saving system memory overhead.
[0042] Based on the aforementioned protocol encapsulation constraint specifications, the system independently allocates a front memory page containing a customized protocol header for each target communication channel.
[0043] Before executing the allocation action, the system first verifies whether the total byte length of the content payload to be sent exceeds the available difference between the maximum transmission unit limit of the corresponding target communication channel and the packet header length. If the content payload length exceeds this available difference, the system performs packet fragmentation on the content payload at the application layer and allocates a corresponding front memory page for each independent fragment; if it does not exceed the limit, the system directly allocates a small-capacity memory allocation unit, i.e., a front memory page, to each target communication channel to store network packet control header information. Subsequently, the system generates a customized protocol header control byte stream according to the unique protocol adaptation template requirements of each target channel and writes it into its respective front memory page. For example, the system allocates an 18-byte front memory page for the application-internal long connection channel and fills it with control parameters containing the network protocol magic number and length checksum; at the same time, the system allocates a 12-byte front memory page for the mobile phone manufacturer's system-level channel and fills it with control parameters containing the device authentication token.
[0044] The system uses memory addressing pointers to logically concatenate each front memory page with a read-only anchored memory block, and generates heterogeneous outgoing messages using a zero-copy method.
[0045] To avoid duplicate copying of the common content payload between different communication channels, this embodiment employs a send description structure that supports distributed / aggregated I / O. For each heterogeneous delivery message, the system establishes a corresponding send description structure, setting the protocol header buffer and the shared read-only content payload buffer of the corresponding channel as send description items respectively. Simultaneously, it records the buffer address and data length corresponding to each send description item, enabling the protocol header and common content payload to be combined during the transmission phase to form a heterogeneous delivery message without copying the common content payload.
[0046] The system submits the transmission description structure to the network transmission module, which reads the protocol header buffer and the common content payload buffer according to the buffer address and data length recorded in the transmission description structure, and combines them to form the corresponding heterogeneous transmission message before sending it to the target communication channel.
[0047] Inject anti-repetition and concurrency race condition flags into the protocol headers of messages sent from various heterogeneous environments, specifically including: The system collects the arrival timestamp of the initial message, extracts the digest hash value of the content payload, and obtains the global auto-incrementing sequence number of the push system.
[0048] The system first collects the arrival timestamp in milliseconds from the current absolute time. For the common content payload, the system uses a non-cryptographic hash algorithm, such as the third-generation Mermaid hash algorithm, for high-speed feature extraction. After obtaining the 32-bit integer hash result, the system performs a low-level bitwise AND operation on the integer result and the binary mask corresponding to decimal 1023. This bitwise AND operation mechanism aims to securely truncate the original long sequence hash value and strictly compress it into a digest hash value that occupies a fixed length of 10 bits, thereby ensuring that its value range is strictly limited to between 0 and 1023. Simultaneously, the system requests the continuously accumulating global auto-incrementing sequence number within the current millisecond time window from the global sequence generator within the cluster. This global auto-incrementing sequence number is configured in the system to occupy a fixed 12 bits, and its cyclically allocated value range is strictly defined between 0 and 4095.
[0049] The system adopts a distributed unique identifier generation algorithm to perform low-level displacement fusion calculation on arrival timestamp, digest hash value and global auto-incrementing sequence number to generate a globally unique identifier with lifecycle attributes as an anti-duplicate concurrency race state identifier.
[0050] To eliminate the risk of memory data overlap and pollution caused by carry-over from discrete variables to higher bits during extremely high-concurrency operations, this embodiment employs a highly rigorous physical bit-field partitioning for the anti-concurrency race condition flag. The total length of this flag is strictly limited to a 64-bit long integer. In this 64-bit microstructure, the highest bit is fixed as a sign bit (0) to ensure the long integer is always positive. The following 41 bits are used to store the millisecond offset relative to a preset epoch time, which is a pre-configured time base point of the system. The system obtains the millisecond time difference between the initial message arrival time and the preset epoch time, converts this difference into a non-negative integer, and writes it into the 41 bits. Since 41 bits can represent 0 to... It is an integer within the range, so when milliseconds are used as the time unit, it can cover a time span of about 69 years.
[0051] During the underlying shift fusion calculation, the system's hardware control unit first shifts the 41-bit arrival timestamp 22 bits to the left, ensuring it precisely occupies the high-order bits of the 64-bit long integer. Then, the system shifts the 10-bit digest hash value 12 bits to the left, ensuring it precisely occupies the middle bit of the target integer. Finally, the system performs a low-level bitwise OR fusion operation on the arrival timestamp of the completed shift, the digest hash value of the completed shift, and the globally incrementing sequence number held in the lowest 12 bits without any shift. Through this rigid physical bit field isolation and non-overlapping bitwise OR operation, the system concatenates three discrete data fragments into a single, continuous 64-bit long integer.
[0052] It should be noted that the 10-bit digest hash value is used to preserve the characteristics of the initial message content in the fixed-length anti-concurrency race condition identifier, and is not used as the sole basis for determining whether two initial messages belong to the same message. Since the digest hash value is compressed by 10 bits, different initial messages may generate the same digest hash value. Therefore, when generating the anti-concurrency race condition identifier, the system simultaneously assigns a globally auto-incrementing sequence number to each initial message, and establishes an association between the anti-concurrency race condition identifier and the message index, target communication channel identifier, and resident memory address pointer of the heterogeneous sent message in the global withdrawal hash mapping table.
[0053] When the system performs a retraction operation based on the confirmation receipt, it does not directly determine the message to be retracted based on the 10-bit digest hash value. Instead, it uses the complete 64-bit anti-concurrency race condition identifier as the lookup key to search for the mapping record corresponding to the complete identifier in the global retraction hash mapping table. Only when a valid mapping record corresponding to the complete identifier is found will the data block to be retracted be determined based on the target communication channel identifier and resident memory address pointer in the mapping record. Therefore, even if different initial messages generate the same 10-bit digest hash value, the identical digest hash value will not trigger erroneous retractions between different messages.
[0054] Furthermore, since the high-order bits of this 64-bit long integer physically store the millisecond offset relative to the preset epoch time when the message was generated, this identifier itself carries time information corresponding to the generation time. In the subsequent concurrent anti-duplicate processing, the system parses the 41-bit time field from the anti-duplicate concurrent race state identifier, restores the 41-bit time field to the millisecond offset relative to the same preset epoch time, and then obtains the millisecond offset of the current time relative to the preset epoch time, calculating the difference between the two; when the difference exceeds the preset valid lifetime, the corresponding anti-duplicate concurrent race state identifier is determined to be invalid; otherwise, it is determined to be within the valid lifetime.
[0055] In the subsequent concurrent anti-duplicate processing stage, the system does not need to query external databases or caching engines at all. It can directly determine whether the message has exceeded the preset effective lifespan threshold, such as 3000 milliseconds, since its generation by simply extracting and parsing the timestamp carried in the high-order bits of the identifier and comparing the difference with the current system absolute time. This provides independent closed-loop data support for subsequent decisions on whether to continue the withdrawal intervention.
[0056] The system writes the generated anti-concurrency race condition flag into the reserved extended field of each front memory page.
[0057] The reserved extension field refers to a blank physical byte area in the control header of various underlying network communication protocols specifically reserved for developers to define custom control instructions. The system directly writes instructions into memory to append this 8-byte (64-bit) anti-concurrency race condition flag to the end extension area of the protocol header of each heterogeneous channel's front memory page. Through this operation, the race condition flag is sent along with network data packets to the underlying physical link, ensuring that each heterogeneous packet carries a unified and unique credential for subsequent cross-channel state coordination and precise targeted location of withdrawals when queuing in different network media and channels.
[0058] Each heterogeneous message is pushed into the network transmission queue of its corresponding target communication channel for distribution. Specifically, this includes: The system evaluates the service priority parameters carried in the initial message.
[0059] The business priority parameter refers to the numerical label assigned to messages in the upper-layer business system based on different application scenarios, indicating the degree of urgency. In this embodiment, the business priority parameter is specifically divided into three independent levels, from 1 to 3. Level 1 represents extremely urgent core businesses such as payment verification codes or security alarms; Level 2 represents routine system notifications and status transitions; and Level 3 represents non-urgent commercial marketing and promotional activities. When the system memory routing controller receives a message to be sent, its primary action is to parse and extract the numerical label, which serves as the absolute basis for subsequent queue distribution and resource allocation.
[0060] The system constructs multi-level priority sub-queues in the network transmission queues contained in each target communication channel.
[0061] Multi-level priority subqueues refer to multiple independent linked list data structures that are parallelly split in the physical memory of the operating system, based on the original single first-in-first-out channel queue architecture. These independent linked list data structures are used to strictly isolate message data of different urgency levels at the physical storage level. Specifically, for each selected target communication channel, the system instantiates and constructs high-priority subqueues, regular subqueues, and low-priority subqueues in the corresponding network transmission queue memory area, each corresponding to a specific service priority parameter.
[0062] The system pushes heterogeneous packets into the corresponding priority sub-queues based on the business priority parameters.
[0063] After the heterogeneous packet is constructed and its send description address pointer in system memory is obtained, the memory routing controller accurately distributes and queues the packet according to the pre-assessed service priority parameter level. When the service priority parameter is 1, the controller pushes the packet's memory address pointer into the high-priority sub-queue of the corresponding communication channel, ensuring that it is scheduled and read first when the underlying network resources are idle; similarly, when the service priority parameter is 2, it is pushed into the regular sub-queue, and when the service priority parameter is 3, it is pushed into the low-priority sub-queue. When the network queue consumption thread performs a queue reading operation, it is forcibly restricted by the underlying system to first clear all data blocks in the high-priority sub-queue. Only when the high-priority sub-queue is verified to be completely empty is the consumption thread allowed to traverse and read the regular and low-priority sub-queues. This ensures, from an operational mechanism perspective, that high-priority core service packets have absolute preemption rights over the central processing unit and network card resources.
[0064] The system controls the distribution rate of each network transmission queue through the token bucket algorithm.
[0065] The token bucket algorithm is a low-level network traffic shaping and rate limiting mechanism. To prevent data surges caused by extremely high concurrency from overwhelming the underlying physical network interface card hardware or triggering network blocking by the operator, the system independently configures a token bucket control layer for each priority sub-queue of each target communication channel. Developers pre-set a maximum capacity limit for a virtual token bucket, for example, 10,000 tokens, and set the token bucket to be in a fully loaded initial state during system initialization. A global timer driven by a high-precision hardware clock in the system kernel continuously replenishes the token buckets with newly generated valid tokens at a constant generation rate of 5,000 tokens per second.
[0066] In the actual network delivery execution phase of the underlying consumer thread, this traffic shaping control mechanism requires that after retrieving the packet node to be sent from the priority sub-queue, and before calling the underlying system kernel's sending interface to transfer the data to the hardware network card, the consumer thread must first attempt to deduct one valid token from the corresponding token bucket. If the deduction attempt succeeds, i.e., it verifies that there are remaining available tokens in the bucket, the system allows the packet to continue and complete the subsequent network physical delivery. If the deduction attempt fails, i.e., the token bucket has been cleared and there are no available tokens, the consumer thread will immediately suspend the current packet's transmission process and place the execution thread containing the packet into a blocked waiting state until the next global timer generation cycle arrives and replenishes the bucket with a new valid token. Only then will the system wake up the blocked thread to continue executing the token deduction and network card transmission actions.
[0067] Furthermore, for the token bucket corresponding to the high-priority sub-queue of level 1, the system specifically grants it the privilege of forcibly borrowing or even depriving the remaining available tokens from the token buckets corresponding to levels 2 and 3 when it is in an extreme resource-scarce state due to its own token exhaustion. In specific implementation, after confirming that its own token bucket is empty, the network consumption thread of the high-priority sub-queue directly attempts to deduct the concurrent counter variable in the low-priority token bucket through the operating system's atomic decrement instruction. If the value returned by the atomic decrement operation is greater than or equal to zero, the borrowing is considered successful and the packet is allowed to pass; if a negative value is returned, it means that the low-priority queue also has no tokens, and the thread immediately uses an atomic increment instruction to roll back the counter to compensate. This lock-free cross-level borrowing mechanism based on low-level atomic instructions not only achieves smooth peak-shaving control of the overall channel's maximum throughput rate, but also strengthens the highest-priority delivery defense line for core business packets when the network is severely congested. Through the above detailed configuration, the token bucket algorithm is no longer just a concept, but constitutes a complete and unambiguous technical closed loop through explicit capacity limits, constant generation rate, and micro-level token deduction timing.
[0068] While performing the operation of pushing each heterogeneous distributed message into the network transmission queue contained in the corresponding target communication channel, it also includes: The system obtains the memory address pointers of each heterogeneous message in the corresponding network transmission queue.
[0069] The resident memory address pointer refers to the specific physical or virtual memory address dynamically allocated by the operating system's memory management module for a packet data block that has just entered the network transmission queue and is waiting to be sent. Since the underlying network transmission queue is physically represented as a contiguous array of memory or independent linked list nodes, obtaining this memory address pointer is equivalent to obtaining the precise resident memory address of the packet data block on the server's memory module. This coordinate-based direct tracking and positioning provides the most fundamental data structure support for subsequent low-level memory state intervention and status bit modification, bypassing long queue traversal.
[0070] For example, after the system pushes the first heterogeneous delivery message generated by reassembling the same initial message into the transmission queue of the application's long connection channel, the operating system kernel returns the memory address pointer of the message data block currently residing as 8388608 to the business layer; at the same time, after the system concurrently pushes the second heterogeneous delivery message generated by reassembly into the transmission queue of the mobile phone manufacturer's system-level channel, the kernel returns the memory address pointer of its residing as 16777216.
[0071] The system synchronously constructs a global withdrawal hash mapping table in the memory space of the push system.
[0072] In a single-machine deployment, a global reversal hash table refers to a dictionary-based data structure specifically allocated in the server's main memory, based on a hash algorithm. Compared to traditional disk-based relational databases, a hash table residing entirely in main memory can perform precise point-to-point queries on massive amounts of data with constant-time complexity. When extended to a multi-machine distributed cluster mode, this global table is instantiated using a memory-sharded distributed caching middleware to achieve cross-node key-value pair storage and millisecond-level ultra-fast reverse lookups. Within the same time slice when the system executes actions from the queue, it simultaneously begins writing location tracking data into this dictionary data structure.
[0073] The system uses the anti-concurrency race condition identifier as the key and the corresponding resident memory address pointer as the value to store key-value pairs.
[0074] Due to the business characteristics of multi-channel concurrent push, the payload of the same core message will be pushed concurrently into the transmission queues of multiple different heterogeneous channels. Therefore, the global recall hash mapping table must adopt a one-to-many key-value pair storage architecture at the underlying level. In specific implementation, the system uses the unique 64-bit anti-concurrency race condition identifier generated in the previous steps as the globally unique query key, and uses a channel address set object containing multiple data elements as the value corresponding to the key.
[0075] The mapping records in the global recall hash table have the same lifecycle as the corresponding initial message. When heterogeneous packets enter the network transmission queue of their respective target communication channels, the system creates a mapping record corresponding to the anti-concurrency race condition identifier and writes the channel identifier, resident memory address pointer, and current state of the corresponding data block of each target communication channel into the mapping record. When any target communication channel generates a valid first-delivery acknowledgment, the system queries the corresponding mapping record based on the complete anti-concurrency race condition identifier and performs recall processing on the remaining target communication channels based on the channel address set in the mapping record, while updating the data block state of each target communication channel.
[0076] When a data block corresponding to a target communication channel successfully transitions from the ready state to the discarded state, the status of that channel in the mapping record is updated to "withdrawn." When a data block of a target communication channel has entered the sending state and cannot be withdrawn, the status of the corresponding channel is updated to "sent." After all target communication channels corresponding to the anti-concurrency race condition flag have completed status confirmation, the system deletes the mapping record corresponding to that anti-concurrency race condition flag.
[0077] For mapping records that have not generated a valid first-delivery confirmation within the preset valid lifespan, the system marks the mapping record as invalid and deletes the mapping record and its associated resident memory address pointer after the valid lifespan is reached. For mapping records that have exceeded their valid lifespan, the system deletes the corresponding invalid records and their associated address information through a periodic cleanup mechanism; when using a distributed cache to store mapping records, the invalid record cleanup can be automatically completed through the cache record expiration time mechanism. For cases that have entered the sending state or have completed the obsolescence process but have not yet completed the mapping record cleanup, the corresponding status information is retained until the status confirmation is completed before deletion is performed.
[0078] Each data element within this channel address set object contains precise tracking information in two dimensions: the first dimension is the target communication channel identifier, used to distinguish which physical memory range of the sending channel the pointer belongs to; the second dimension is the resident memory address pointer itself corresponding to the message in the network transmission queue of the target communication channel.
[0079] In the aforementioned concurrent task delivery scenario, the system quickly inserts a related record into the global revocation hash mapping table. The key of this record is a generated anti-recurrence race condition identifier long integer, while the corresponding mapping value is a set containing two data elements. The first data element of this set records the application-level long connection channel identifier 1001 and its corresponding resident memory address pointer 8388608, and the second data element records the mobile phone manufacturer's system-level channel identifier 1002 and its corresponding resident memory address pointer 16777216.
[0080] By building a one-to-many key-value pair storage mechanism at the underlying level, the system essentially establishes a real-time radar monitoring network for the memory coordinates of all pending messages in the background. Once the receiving side of a subsequent business system receives an initial confirmation acknowledgment from any channel, the system doesn't need to compare messages one by one in the massive network transmission queue. Instead, it can simply use the anti-concurrency race condition identifier as a key to perform a reverse lookup in the mapping table, directly locating the resident memory address corresponding to other target communication channels.
[0081] When any target communication channel receives an acknowledgment receipt carrying an anti-concurrency race condition flag, it broadcasts the anti-concurrency race condition flag to the remaining target communication channels, specifically including: The system parses the first arriving acknowledgment receipt and verifies the legality and effective lifespan of the anti-duplicate concurrency race condition flag it carries. An acknowledgment receipt is a network response data packet returned by a terminal device to the server after successfully receiving a message from a certain channel. Since different target communication channels use different transmission protocols and acknowledgment mechanisms, this embodiment configures acknowledgment receipt judgment rules for each target communication channel. For application-internal long-connection channels, the application-layer acknowledgment message returned by the terminal application containing the anti-duplicate concurrency race condition flag is used as the acknowledgment receipt; for mobile phone manufacturer system-level push channels, the successful status message returned by the push service and associated with the anti-duplicate concurrency race condition flag is used as the acknowledgment receipt; for traditional SMS channels, the status report returned by the operator and associated with the corresponding heterogeneous message is used as the acknowledgment receipt.
[0082] The system parses the received receipt data according to the protocol adaptation template corresponding to each target communication channel, and extracts the channel identifier, message association identifier, status field, and reception time information from the receipt data. Only when the status field meets the preset success status and the message association identifier can establish a corresponding relationship with the valid anti-duplicate concurrency race state identifier in the global withdrawal hash mapping table, is the receipt determined as a valid confirmation receipt and participates in the first-delivery confirmation decision. Receipts that cannot establish a corresponding relationship or whose status field does not meet the preset success status will not participate in the first-delivery confirmation decision.
[0083] In high-concurrency production environments, it is highly likely that multiple target communication channels will return acknowledgments within a very short time difference, or even simultaneously. To avoid read / write conflicts in the underlying state machine caused by processing threads on different channels triggering withdrawal operations at the same time, the system must implement a strict first-arrival decision. The specific decision criteria are as follows: the system uses the absolute timestamp of the server's underlying network interface card (NIC) receiving the acknowledgment for the first time under a globally unified clock as the sole criterion for determining the first arrival; if two acknowledgments have the same timestamp in an extreme concurrency situation, the system uses the monotonically increasing sequence number assigned by the underlying NIC hardware interrupt as the second sorting criterion, thereby locking in a globally unique first-arrival acknowledgment.
[0084] After locking the initial confirmation receipt, the system extracts the anti-duplicate concurrency race condition identifier carried within and performs a validity verification. Validity verification involves the server using this identifier as a query key and inputting it into the aforementioned globally constructed withdrawal hash mapping table for a reverse lookup. If a corresponding mapping record is found, the identifier is deemed valid and falls within the control scope of the current system, preventing malicious injection attacks using forged external messages.
[0085] The system performs a valid lifecycle verification on the identifier. Through low-level bitwise operations, the system accurately extracts the generation timestamp hidden in the high-order bits of the 64-bit anti-duplicate concurrency race condition identifier, and obtains the absolute timestamp of the first confirmation receipt received by the system. The system subtracts the millisecond offset of the current time relative to the preset epoch time from the millisecond offset of the generation time parsed from the anti-duplicate concurrency race condition identifier to obtain the time difference since the identifier's generation, and compares this time difference with the system's preset valid lifecycle threshold. In this embodiment, the effective lifespan threshold is set to 3000 milliseconds. When the time difference is less than 3000 milliseconds, the anti-duplicate concurrency race condition flag is determined to be within its effective lifespan. When the time difference exceeds 3000 milliseconds, the anti-duplicate concurrency race condition flag is determined to be invalid, and cross-channel withdrawal operations based on this flag are stopped. At the same time, the corresponding invalid mapping record is deleted according to the mapping table cleanup rules. If the difference is less than or equal to the threshold, the system determines that the message is within its effective lifespan and allows subsequent withdrawal broadcasts to be triggered. If the difference is greater than the threshold, it indicates that the message has lost its timeliness and exceeded the service waiting tolerance, and the system actively abandons subsequent withdrawal intervention.
[0086] If the above-mentioned legality and valid lifecycle verifications are both passed, the system will use a publish-subscribe model to broadcast a global interrupt signal carrying an anti-concurrency race condition flag to the protocol daemon coroutines of the other target communication channels via a high-speed asynchronous event bus, thereby completing the broadcast operation.
[0087] To meet the microsecond-level latency requirements of multi-channel, high-concurrency command withdrawal distribution, the high-speed asynchronous event bus in this embodiment comprises a two-layer architecture: cross-node routing and local distribution. Within a single machine and node, this bus is not a traditional message queue middleware based on disk or network transmission, but rather instantiated in the system's physical memory as a lock-free circular buffer queue with pre-allocated fixed contiguous memory blocks. In a multi-machine distributed cluster mode, the first acknowledgment node first uses underlying remote direct memory access technology or a high-performance RPC framework to rapidly route the global interrupt signal to the target IP node, where the target node's local lock-free circular buffer queue then takes over and executes subsequent inter-thread distribution. Within a single machine node, the high-speed asynchronous event bus uses a lock-free circular buffer queue to implement event caching; in a multi-machine distributed cluster, the first acknowledgment node sends the global interrupt signal to the target node, and the target node's local lock-free circular buffer queue then distributes the event.
[0088] Under this mechanism, the thread that triggers the first confirmation process automatically becomes the event publisher, using the cross-channel withdrawal corresponding to the anti-duplicate concurrency race condition flag as the event subject. The event publisher requests the next available write slot in the circular buffer queue by comparing and exchanging atomic instructions at the hardware level, encapsulates the global interrupt signal containing the message anti-duplicate flag, source channel identifier, event type (withdrawal instruction), and event generation time into an event payload, and writes it directly to the physical slot, then advances the publisher cursor.
[0089] Meanwhile, protocol daemon coroutines mounted in the background of each of the other target communication channels participate in the coordination as independent event subscribers. A protocol daemon coroutine is a resident, asynchronous, lightweight user-space thread running on the sending side of the corresponding target communication channel, specifically designed for extremely low-latency monitoring of the underlying scheduling and revocation events of its assigned channel. Each target communication channel's protocol daemon coroutine, as an event subscriber, reads the global interrupt signal from the circular buffer queue and performs subsequent revocation processing based on the anti-concurrency race condition flag in the global interrupt signal.
[0090] By using this high-speed asynchronous event bus based on a lock-free circular buffer queue and a publish-subscribe memory distribution mode, the broadcasting of withdrawal instructions avoids the performance overhead caused by the traditional multi-threaded exclusive global lock mechanism, thereby distributing the global interrupt signal to the protocol daemon coroutine of other target communication channels, and constructing the most critical ultra-fast underlying communication bridge in the entire intelligent withdrawal mechanism.
[0091] Match and remove the corresponding pending messages from the network transmission queues contained in the remaining target communication channels, specifically including: In response to the anti-concurrency race condition flag received by the broadcast operation, each of the other target communication channels looks up the corresponding target resident memory address pointer in the global withdrawal hash map.
[0092] When the protocol daemon coroutines in the background of the other target communication channels detect the global interrupt signal through the high-speed asynchronous event bus and extract the anti-concurrency race condition flag, they no longer need to use the traditional traversal method to compare packets one by one in their own large and complex network transmission queue. Since the system has already synchronously built a one-to-many global withdrawal hash map in the main memory during the early queuing phase, the protocol daemon coroutines directly use the anti-concurrency race condition flag as the key and input it into the global withdrawal hash map for extremely fast reverse lookup.
[0093] The system uses the operating system's atomic compare and swap instruction to flip the status bit of the data block pointed to by the target resident memory address pointer to the discarded state.
[0094] In the underlying network transmission queue design, each memory data block header corresponding to a pending message defines a dedicated state machine flag byte to accurately characterize the current lifecycle of the data block. This state machine is specifically divided into three mutually exclusive states: 0 represents the ready state, indicating the message is in the queue waiting to be consumed and sent; 1 represents the sending state, indicating the message has left the queue and entered the hardware network card's transmission critical section; and 2 represents the discarded state, indicating the message has been withdrawn due to initial acknowledgment from another channel and no longer needs to be sent.
[0095] After obtaining the pointer to the target resident memory address through the hash map table, the local protocol daemon of the node directly addresses the status bit byte of the data block. Subsequently, the local protocol daemon sends an atomic compare-and-swap instruction from the operating system to its local CPU. This mechanism ensures that regardless of the physical architecture, the final state flip is strictly guaranteed by the local hardware bus of the node where the data actually resides. The underlying physical mechanism of this instruction is that before modifying the memory state, the hardware bus checks whether the value currently stored in the memory byte is exactly equal to the expected ready state value, i.e., 0. If the hardware check result is equal, the value of the status bit is atomically replaced with the discarded state value, i.e., 2, instantaneously within the same CPU clock cycle. The atomic compare-and-swap operation guarantees the atomicity of the state modification process, thereby preventing multiple concurrent threads from modifying the state of the same data block simultaneously.
[0096] During the actual execution of atomic compare-and-swap operations, concurrency contention may lead to execution failures. If the atomic compare-and-swap instruction fails, it means that the data block status bit of the packet has been prematurely modified to "transmitting" (1) by the underlying consumer thread. This indicates that the packet has been removed from the queue and is in the absolute critical section of the hardware network card's transmission. At this point, the protocol daemon immediately and proactively abandons its intervention to withdraw the data block, avoiding bus conflicts at the hardware level.
[0097] The system enables the consuming threads of the network transmission queue to silently discard data blocks when they are read.
[0098] To mitigate the risk of state races under extreme concurrency conditions, the system strictly regulates the runtime order of the network transmission queue consumer thread and the timing of the final state verification. After the consumer thread obtains the memory address pointer of the queue node in sequence from each priority sub-queue, it does not blindly call the underlying system's kernel network sending interface. Instead, it must forcibly initiate the final read verification of the status bits of the data block at the execution line preceding the network card sending instruction.
[0099] When the consumer thread reads that the status bit value of the data block is in the ready state (0), it continues to proceed and completes the token deduction from the token bucket. Then, it atomically modifies the status bit to "transmitting" (1), and finally calls the underlying network interface to complete the normal physical transmission. When the consumer thread reads that the status bit value of the data block has been successfully flipped to the discarded state (2) by the aforementioned protocol daemon coroutine through atomic comparison and exchange instructions, the consumer thread triggers an underlying conditional jump instruction, abandoning any calls to the network transmission interface. The consumer thread directly skips this heterogeneous transmission packet, marks the data block as consumed, and the corresponding memory management mechanism reclaims it in the subsequent execution space. Through this complete technical loop, the system achieves the physical transmission interception and silent discarding of redundant packets with extremely low performance overhead at the microsecond level, without blocking the normal transmission of each channel.
[0100] The above description is merely a preferred embodiment of the present invention, and the scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for users of ordinary technical skills, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for intelligent routing and unified push of multi-channel messages, characterized in that, Applications in push systems include: S1: Extract the terminal addressing identifier and content payload from the initial message, perform a routing query operation based on the terminal addressing identifier, match multiple target communication channels, and obtain the protocol encapsulation constraint specifications of each target communication channel; S2: Reassemble the content payload according to the protocol encapsulation constraint specification to generate heterogeneous delivery messages adapted to each target communication channel, and inject anti-duplicate concurrency race state identifiers into the protocol headers contained in each heterogeneous delivery message; S3: Push each heterogeneous message into the network transmission queue contained in the corresponding target communication channel to perform the sending operation; S4: When any of the target communication channels receives an acknowledgment carrying the anti-duplicate concurrency race condition flag, the anti-duplicate concurrency race condition flag is broadcast to the other target communication channels, and the corresponding pending message is removed from the network transmission queue contained in the other target communication channels.
2. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, The routing query operation in S1, based on the terminal addressing identifier, to match multiple target communication channels, specifically includes: Extract the current context activity features of the terminal associated with the terminal addressing identifier, and retrieve the real-time network link quality matrix of each candidate communication channel; A multi-dimensional feature vector is constructed based on the terminal context activity characteristics and the real-time network link quality matrix, and then input into the preset routing decision model to output the reach probability score of each candidate communication channel. Several candidate communication channels with reach probability scores greater than a preset threshold are selected as multiple target communication channels.
3. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, The protocol encapsulation constraint specifications for each target communication channel obtained in S1 specifically include: The distributed configuration center retrieves the channel identifiers that match each of the target communication channels. The corresponding protocol adaptation template is loaded according to the channel identifier. The maximum transmission unit (MTU) limit, message header byte arrangement rules, and heartbeat keep-alive period defined in the protocol adaptation template for the corresponding target communication channel are used as the protocol encapsulation constraint specifications.
4. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, In step S2, the content payload is reassembled according to the protocol encapsulation constraint specifications, specifically including: Allocate a read-only anchor memory block for the content payload in the shared memory of the push system; According to the protocol encapsulation constraint specifications, each target communication channel is independently allocated a front memory page containing a customized protocol header; By using memory addressing pointers, each preceding memory page is logically concatenated with a read-only anchored memory block, and heterogeneous delivery messages are generated using a zero-copy method.
5. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, The injection of anti-repetition and concurrency race condition flags into the protocol headers of the messages sent under each heterogeneous environment in S2 specifically includes: Collect the arrival timestamp of the initial message, the digest hash value of the content payload, and the global auto-incrementing sequence number of the push system; A distributed unique ID generation algorithm is used to perform displacement fusion calculation on the arrival timestamp, the digest hash value, and the global auto-incrementing sequence number to generate a globally unique identifier with lifecycle attributes as an anti-duplicate concurrency race condition identifier, and the anti-duplicate concurrency race condition identifier is written into the reserved extension field of each front-end memory page.
6. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, In step S3, each heterogeneous message is pushed into the network transmission queue corresponding to the target communication channel for delivery. Specifically, this includes: Evaluate the service priority parameters carried in the initial message; Construct multi-level priority sub-queues within the network transmission queues contained in each target communication channel; Based on the service priority parameter, heterogeneous packets are pushed into the corresponding priority sub-queue, and the distribution rate of each network transmission queue is controlled by the token bucket algorithm.
7. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, In step S3, while performing the operation of pushing each heterogeneous distributed message into the network transmission queue contained in the corresponding target communication channel, the method further includes: Obtain the memory address pointer of each heterogeneous distributed message in the corresponding network transmission queue; A global withdrawal hash mapping table is synchronously constructed in the memory space of the push system, using the anti-concurrency race state identifier as the key and the corresponding resident memory address pointer as the value for key-value pair storage.
8. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, In step S4, when any of the target communication channels receives an acknowledgment carrying the anti-concurrency race condition flag, the anti-concurrency race condition flag is broadcast to the remaining target communication channels, specifically including: Analyze the first confirmation receipt to verify the legality and effective lifespan of the anti-duplicate and concurrent race state identifier it carries; If the verification is successful, a global interrupt signal carrying an anti-concurrency race condition flag is broadcast to the protocol daemon coroutines of the other target communication channels via a high-speed asynchronous event bus in a publish-subscribe mode, thus completing the broadcast operation.
9. The multi-channel message intelligent routing and unified push method according to claim 1, characterized in that, In step S4, matching and removing the corresponding pending messages from the network transmission queues included in the remaining target communication channels specifically includes: In response to the anti-concurrency race condition flag received by the broadcast operation, each of the remaining target communication channels looks up the corresponding target resident memory address pointer in the global withdrawal hash mapping table. By using the atomic compare and swap (CAS) instruction of the operating system, the status bit of the data block pointed to by the target resident memory address pointer is flipped to the discard state, so that the consumption thread of the network transmission queue will silently discard the data block when it is read.
10. A multi-channel message intelligent routing and unified push system, implemented by any one of claims 1 to 9, characterized in that, include: The addressing and matching module extracts the terminal addressing identifier and content payload from the initial message, performs a routing query operation based on the terminal addressing identifier, matches multiple target communication channels, and obtains the protocol encapsulation constraint specifications of each target communication channel; The message reassembly module reassembles the content payload according to the protocol encapsulation constraint specification, generates heterogeneous delivery messages adapted to each target communication channel, and injects anti-duplicate concurrency race state identifiers into the protocol headers contained in each heterogeneous delivery message. The queue delivery module pushes each heterogeneous delivery message into the network transmission queue contained in the corresponding target communication channel to perform the delivery operation. The broadcast withdrawal module, when any of the target communication channels receives an acknowledgment receipt carrying the anti-concurrency race condition flag, broadcasts the anti-concurrency race condition flag to the other target communication channels, and matches and removes the corresponding pending message from the network transmission queue contained in the other target communication channels.
