Short message channel security authentication method based on dynamic route adjustment
By standardizing encoding and generating complete message commitment values and logical message group identifiers in the SMS communication system, the problems of mis-segmentation and resource consumption in SMS fragmentation under dynamic routing environment are solved, achieving higher reassembly accuracy and transmission reliability.
Patent Information
- Application Number
- CN202611668312.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-24
AI Technical Summary
Existing SMS communication systems lack message-level logical identity identification, authentication constraints, and secure reassembly mechanisms in complex environments such as high concurrency, out-of-order arrival, quotation number wrapping, and route switching. This leads to problems such as mis-splitting of cross-logical message fragments, cross-route generational mixed reassembly, and resource consumption by invalid fragments.
Before sending logical SMS messages, normalized encoding is performed to generate whole message commitment values and independent logical message group identifiers. After fragmentation, these are bound to routing context identifiers. The receiving end performs fragment-level pre-authentication and whole message commitment verification to establish a secure reassembly context and ensure fragment ownership and content consistency.
It reduces the probability of mis-segmentation across messages under out-of-order and routing switching conditions, improves the accuracy and transmission reliability of long SMS reassembly, and reduces the resource consumption of invalid fragments.
Smart Images

Figure CN123164432A_ABST
Abstract
Description
Technical Field
[0001] This application relates to communication security technology, and more particularly to a method for secure authentication of SMS channels based on dynamic routing adjustment. Background Technology
[0002] In SMS communication systems, for logical SMS messages that exceed the length of a single SMS message, it is usually necessary to first split the logical SMS message into multiple SMS fragments and then send them separately. The receiving end then reassembles the multiple SMS fragments based on fields such as source address, destination address, concatenation reference number, total number of fragments, and current fragment sequence number.
[0003] Because each SMS fragment may pass through different SMS centers, gateway nodes, protocol channels, or next-hop routes during transmission, and there are differences in queuing delays, retry mechanisms, congestion levels, and failover strategies between different routes, multiple SMS fragments often arrive at the receiving end out of order, with delays, or in duplicate.
[0004] Existing long SMS reassembly mechanisms typically rely on existing concatenated reference numbers and fragment sequence numbers as the primary basis for reassembly. However, they lack a unified identity identifier for the entire logical SMS message, message-level authentication constraints, and a secure reassembly mechanism consistent with the dynamic routing process. Consequently, in scenarios involving high concurrency, reference number wrapping, gateway rewriting of reference numbers, shared channels among different tenants, or malicious construction of fragmentation fields, legitimate fragments from different logical SMS messages are easily mistakenly included in the same reassembly context and incorrectly concatenated. Summary of the Invention
[0005] This application provides a SMS channel security authentication method based on dynamic routing adjustment to solve the problem of insufficient security isolation at the whole message level caused by the inconsistency of the boundaries between the sending object, authentication object, routing object and reassembly object in long SMS fragmentation in the prior art.
[0006] This application provides a method for secure authentication of SMS channels based on dynamic routing adjustment. Before sending a logical SMS message, the method standardizes and encodes the message to generate a complete message commitment value. Simultaneously, it generates a logical message group identifier independent of existing SMS concatenation reference numbers. After fragmentation, the logical message group identifier, complete message commitment value, total number of fragments, current fragment sequence number, and routing context identifier are written into the fragment authentication binding relationship. This allows the receiving end to perform fragment-level pre-authentication after receiving each SMS fragment. Then, based on the authentication sender identifier, authentication receiver identifier, logical message group identifier, complete message commitment value, and routing context identifier, a secure reassembly key is constructed, and a secure reassembly context is established. This allows for the exclusion of abnormal fragments, duplicate fragments, or cross-routing generation fragments that do not belong to the same logical SMS message before formal reassembly. After all valid fragments are reassembled, the complete message commitment verification confirms that the reassembly result is consistent with the original logical SMS message sent by the sending end. This reduces the probability of cross-message mis-assembly under existing conditions of citation collision, dynamic route switching, and fragment out-of-order delivery, avoids mixed submission of different message fragments, reduces the occupation of reassembly cache resources by invalid fragments, and improves the reassembly accuracy, submission determinism, and overall transmission reliability of long SMS messages in complex transmission environments. Attached Figure Description
[0007] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0008] Figure 1 This is a flowchart illustrating a method for SMS channel security authentication based on dynamic routing adjustment, according to an example embodiment of this application.
[0009] Figure 2 This is a schematic flowchart of S400 shown in the first example embodiment of this application;
[0010] Figure 3 This is a schematic flowchart of S400 shown in the second example embodiment of this application;
[0011] Figure 4 This is a schematic diagram of S400 shown in the third example embodiment of this application. Detailed Implementation
[0012] In existing SMS communication systems, when the content of an SMS message to be sent exceeds the length of a single SMS message, it is usually necessary to first split the logical SMS message corresponding to the content into multiple SMS fragments before sending them separately. After receiving multiple SMS fragments, the receiving end reassembles them according to preset fragment association fields to restore the original logical SMS message. In existing technologies, commonly used fragment association fields at the receiving end typically include the sender's address, the receiver's address, the concatenation reference number, the total number of fragments, and the current fragment sequence number. Among these, the concatenation reference number is usually used as the main identifier to distinguish different long SMS groups, while the total number of fragments and the current fragment sequence number are used to sort and concatenate the SMS fragments.
[0013] However, in real-world communication networks, multiple fragments of a single logical SMS message are often not transmitted along the same physical or logical path. This is especially true in scenarios involving SMS aggregation platforms, SMSC centers, multi-carrier gateways, SMPP / HTTP access channels, and multiple next-hop forwarding nodes. Different SMS fragments may enter different routing paths. These different routing paths typically have different queuing depths, congestion states, failure retry policies, forwarding priorities, connection establishment delays, and failover mechanisms. Therefore, the arrival order of multiple SMS fragments at the receiving end is often inconsistent, and out-of-order arrival, duplicate arrival, delayed arrival, or even arrival across multiple sending rounds may occur.
[0014] While existing long SMS reassembly mechanisms can complete basic fragment reassembly in general scenarios, their core reassembly basis largely revolves around existing concatenation reference numbers and fragment sequence numbers. These mechanisms typically assume that as long as multiple SMS fragments have the same or compatible sender address, receiver address, concatenation reference number, and total fragment count / fragment sequence number, these fragments can be included in the same reassembly context. This approach usually works under conditions of low concurrency, single routing, single tenant, or stable intermediate node behavior, but it has significant limitations in complex SMS network environments.
[0015] First, existing concatenated reference numbers primarily serve fragmented transmission and terminal concatenation, and their value space is limited. For example, in common implementations, the concatenated reference number is an 8-bit or 16-bit field, which does not correspond to a cryptographically meaningful identifier for the entire message. When business concurrency is high, the reassembly cache retention time is long, or multiple business tenants share the same SMS channel, the probability of different logical SMS messages reusing the same concatenated reference number within the same time window increases significantly. Second, during protocol conversion, compatibility adaptation, or fault switching, intermediate gateways, protocol adaptation layers, or SMS centers may rewrite, reassemble, or regenerate existing concatenation control fields, causing the concatenated reference number seen by the receiver to no longer strictly correspond to the boundary of the original logical message at the sender. Third, dynamic routing mechanisms typically use individual SMS fragments as the scheduling granularity, rather than the entire logical SMS message. Therefore, different fragments of the same logical SMS message may experience different routing generations, different sending rounds, or different transmission strategies.
[0016] Under the above conditions, if the receiving end still relies solely on the existing concatenation reference number, the total number of fragments, and the current fragment sequence number to establish a reassembly cache, it may include multiple legitimate fragments that do not actually belong to the same logical SMS message into the same reassembly context. This would formally complete the concatenation of all fragments, but the concatenated result would not be the original message actually generated by the sending end. In other words, while existing technologies can handle the issue of fragment ordering, they cannot effectively solve the problem of whether these fragments truly belong to the same logical SMS message.
[0017] For example, in a scenario where an SMS aggregation platform sends long SMS verification codes and marketing SMS messages to a terminal in parallel, the first two fragments of the verification code SMS arrive at the receiving end via route A, while the last two fragments of the marketing SMS arrive via route B. If the two logical SMS messages happen to exhibit the same concatenation reference number and compatible fragmentation fields on the receiving side, the receiving end may mistakenly include the first two fragments of the verification code SMS and the last two fragments of the marketing SMS in the same reassembly cache, ultimately forming a new message with mixed content. Another example is in a scenario where multiple tenants share an SMS exit point. Different tenants may share the same display sending number. If the existing reassembly only uses the display number and concatenation reference number as the association basis, fragments from one tenant may be incorrectly aggregated with fragments from another tenant. Yet another example is in a route failure switching scenario. When the original route has not yet fully converged, some fragments from the old route continue to arrive, while the new route has begun retransmitting new fragments. If the receiving end does not distinguish between different route generations, it may also mix and reassemble fragments from the old route and fragments from the new route.
[0018] Therefore, existing technologies have the following shortcomings in the dynamic routing transmission and reassembly of long text messages: First, they lack a whole-message-level logical identity identifier that is independent of the existing splicing reference number; second, they lack whole-message-level authentication constraints that cover the sender, receiver, whole message content, fragment location, and routing context; and third, they lack a secure reassembly mechanism that keeps the boundaries of the sending, routing, and receiving reassembly stages consistent.
[0019] The aforementioned defects collectively lead to problems in existing systems under conditions such as high concurrency, out-of-order arrival, reference number wrapping, route switching, and intermediate gateway rewriting fields, such as mis-assembling of cross-logical message fragments, cross-route generational mixed reassembly, invalid fragments occupying reassembly resources for a long time, and error messages being submitted to the application layer.
[0020] Analysis revealed that the aforementioned technical problems did not stem merely from the superficial phenomenon of out-of-order fragmentation. The deeper reason lies in the disconnect between the fragmentation identification boundary, authentication boundary, routing boundary, and reassembly boundary in the existing SMS system. This makes it difficult for the receiving end to determine whether multiple SMS fragments truly belong to the same logical SMS message based on a unified and reliable technical basis.
[0021] First, existing concatenated reference numbers are merely auxiliary identifiers within a limited space, not logical message identities with strong uniqueness and unforgeability. Taking common 8-bit or 16-bit concatenated reference numbers as examples, their value space is limited. When a large number of long SMS groups that have not yet been reassembled exist concurrently within the cache's effective time window in the same sending domain, the probability of different logical SMS messages being assigned the same concatenated reference number increases. The essence of this problem is not whether the reference number is randomly generated, but that its identifier space is limited and can be reused over time. As long as the number of active logical SMS groups continues to approach or occupy this identifier space, reference number collisions will evolve from sporadic events to observable events. Furthermore, intermediate gateways may regenerate concatenated reference numbers during protocol adaptation and compatibility processing, resulting in the same logical message using different reference numbers in different network segments, or different logical messages exhibiting the same reference number at the receiving end.
[0022] Secondly, even when existing solutions authenticate individual SMS fragments, the authentication scope often only covers the content of that fragment itself or a few partial fields, failing to cover the unified identity and complete content of the entire logical SMS message. In other words, the authentication result of a single fragment usually only proves that the fragment's origin is legitimate or that its content has not been individually tampered with, but it cannot prove which other fragments that fragment should constitute the same logical SMS message. Without message-level binding information, two legitimate fragments, even those originating from different logical messages, may simultaneously pass their respective fragment authentications and be incorrectly placed into the same reassembly context at the receiving end. Therefore, fragment-level authenticity alone does not automatically imply message-level consistency.
[0023] Secondly, from a routing mechanism perspective, dynamic routing systems typically treat each SMS fragment as an independently schedulable transmission object. Routing selection can be influenced by factors such as channel congestion, operator policies, session state, failure retries, link switching, cost optimization, and real-time health checks. Therefore, multiple fragments of the same logical SMS message may be split and sent across different channels or even different failover generations. In this case, the sending end's scheduling boundary is a single fragment, while the receiving end needs to recover the entire message. If there is no additional, unified binding information between the two that runs throughout the entire sending and receiving process, the receiving end cannot determine, based solely on the existing fragment fields, whether a currently received fragment is a legitimate component of the current logical message, or a fragment of another retransmitted message, another concurrent message, or another routing generation message.
[0024] Furthermore, while the total number of fragments and the current fragment sequence number describe the position of fragments within a long message group, these fields are typically just reassembly control information and do not inherently possess integrity protection. If these fields are not included in a higher-level authentication binding, they can only express a claimed position, not a credible attribution relationship. In other words, the fragment sequence number only tells the receiver which fragment it claims to be in, but cannot independently prove that the fragment actually belongs to the logical message being reassembled. Similarly, the total number of fragments field can only tell the receiver how many fragments should theoretically exist, but cannot guarantee that this quantity information is consistent with the original message sent by the sender.
[0025] From a system resource perspective, to support long SMS reassembly, the receiving end typically needs to allocate caches, bitmaps, index tables, timeout controls, or persistent records for each logical message to be reassembled. When the reassembly key lacks sufficient security differentiation capabilities, erroneous or malicious fragments can enter these reassembly resources. On the one hand, the receiving end may allocate caches for forged reassembly groups that should not exist; on the other hand, even if the entire message verification ultimately fails, erroneous fragments may still occupy the cache and reassembly context for a long time in the early stages. This indicates that without a "fragment ownership verification mechanism before it enters the formal reassembly resource," existing reassembly systems can easily logically accept erroneous fragments and amplify the impact of errors on resources.
[0026] To facilitate understanding, let's illustrate the underlying reasons using a specific scenario. In a certain SMS platform, the sender sends two long SMS messages to a user using the same service number: the first is a verification code notification, consisting of 4 fragments; the second is a business marketing message, also consisting of 4 fragments. Because the platform uses multi-route parallel sending, the first two fragments of the first SMS are delivered quickly via channel X, while the last two fragments of the second SMS are delivered slightly later via channel Y. Simultaneously, because the concatenation reference number uses a limited bit width and is reused during gateway adaptation, the receiving end observes that these 4 fragments have the same display sender number, receiver number, concatenation reference number, and compatible total fragment count / sequence number. If the system only establishes the reassembly context based on existing fields, these 4 fragments formally meet the reassembly conditions, and the receiving end may perform incorrect concatenation. The root cause of this result is not a single field error, but rather: the field used to distinguish message identity does not have strong uniqueness, the authentication used to prove the legitimacy of the source only covers a single fragment, and the routing mechanism used to schedule the sending allows fragments to be scattered across paths, ultimately resulting in a lack of reliable consistency basis during the reassembly phase.
[0027] Therefore, the technical reasons for the problems addressed by the embodiments of this application can be summarized as follows: In the prior art, existing splicing fields can only provide limited transmission association capabilities and cannot provide a unique identity at the whole message level; fragment-level authentication can only provide partial authenticity and cannot provide ownership proof at the whole message level; dynamic routing uses single fragments as the scheduling granularity, resulting in highly discrete fragment source timing and arrival context; and receiver reassembly lacks a unified security key that simultaneously binds the sender, receiver, whole message content, fragment location, and routing context. It is the superposition of these multiple underlying factors that makes it difficult to avoid problems such as cross-logical message splicing, cross-routing generational mixed submission, and invalid fragment resource occupation in existing systems from a mechanism perspective.
[0028] To address the aforementioned issues, the core technical concept of the embodiments provided in this application is not simply to expand the value space of the concatenation reference number, nor to perform source authentication for each SMS fragment separately. Instead, it establishes a unified security context that runs through message generation, fragment sending, dynamic routing, pre-authentication of reception, secure reassembly, and whole message submission before logical SMS message fragmentation. This ensures that the sending boundary, authentication boundary, routing boundary, and reassembly boundary are logically consistent, thereby eliminating the conditions for cross-message concatenation from the underlying mechanism.
[0029] Specifically, the first step is to normalize the logical SMS message to be sent, obtaining the target byte sequence. Normalization encoding refers to converting the same logical message into a unified byte representation at the sending end using deterministic, stable, and repeatable encoding rules. The technical significance of this is that when the receiving end performs full message verification, it no longer relies on unstable displayed text formats but instead compares the results based on the underlying byte semantics consistent with the sending end. By first solidifying the underlying byte representation of the message, subsequent full message commitment calculations become deterministic, thus avoiding inconsistencies in the calculation results between the sending and receiving ends of the same logical message due to encoding differences, character set differences, or intermediate node format changes.
[0030] After obtaining the target byte sequence, this embodiment further generates a whole message commitment value based on the authenticated sender identifier, the authenticated receiver identifier, and the target byte sequence. This whole message commitment value corresponds to the overall content commitment of the entire logical SMS message before fragmentation, rather than the local check value of any single fragment. Its technical function is to fix "what the whole message originally was" before sending. In this way, even if out-of-order, duplicate, or routing switching occurs during subsequent fragmentation transmission, as long as the byte sequence finally reassembled by the receiving end is inconsistent with the whole message commitment value, it can be determined that the reassembled result is not the original message from the sending end. In other words, the whole message commitment value provides a judgment criterion that changes from "partial fragmentation correctness" to "overall message consistency".
[0031] Meanwhile, this application embodiment also generates a logical message group identifier independent of the traditional SMS concatenation reference number. This logical message group identifier does not rely on the short-width concatenation reference number in the existing UDH, but rather serves as an internal identifier for uniquely grouping a logical SMS message under the security mechanism of this invention. Its underlying technical significance lies in the fact that even if the traditional concatenation reference number wraps around, is reused, collides, or is rewritten by intermediate nodes, this invention can still rely on the logical message group identifier to maintain the consistent identity of the entire logical message within the local security domain. In this way, traditional fields can continue to serve compatibility transmission or auxiliary sorting functions, while the actual basis for secure grouping shifts to the logical message group identifier and its related authentication information.
[0032] After forming the overall message commitment value and logical message group identifier, this embodiment of the application fragments the logical SMS message and assigns a routing context identifier to the logical message. The routing context identifier describes the sending context of the logical message under a specific sending round, routing policy, or routing generation. Its function is not merely to record "from which route," but more importantly, to incorporate the routing state within a security boundary. This is because if fragments generated under different routing generations enter the same reassembly context indiscriminately, erroneous mixing may occur between old route remnant fragments and new route retransmission fragments; by explicitly introducing the routing context identifier, fragments under different routing contexts can be isolated into different secure reassembly spaces at the receiving end.
[0033] Furthermore, in this embodiment, a fragment authentication binding relationship is established for each SMS fragment. This binding relationship associates at least the logical message group identifier, the overall message commitment value, the total number of fragments, the current fragment sequence number, and the routing context identifier. The key technical idea here is that instead of requiring a single fragment to only prove "who I am," it requires a single fragment to simultaneously prove "which logical message I belong to, my position in that logical message, and which routing context I am in." Through this binding, each fragment is no longer an isolated transmission unit, but becomes a constrained node in the overall message security structure. Thus, when the receiving end processes any fragment, it can not only see the fragment content itself, but also simultaneously obtain the association relationship between the fragment and the overall message identity, the overall message content commitment, the fragment position, and the routing context.
[0034] At the receiving end, this embodiment does not directly include the fragment in the formal reassembly cache upon arrival. Instead, it first obtains the authentication sender identifier and authentication receiver identifier from the access authentication context, parses the authentication binding information corresponding to the fragment, and performs pre-authentication. The underlying technical significance of this step is that it moves the judgment of "whether to allow entry into the formal reassembly process" forward to the fragment arrival stage. Only when a fragment meets the constraints in terms of identity, ownership, location, and routing context is it allowed to participate in subsequent reassembly. Thus, erroneous fragments, cross-message fragments, cross-routing generational fragments, and forged fragments can be excluded before formally occupying reassembly resources, thereby suppressing the consumption of cache resources by invalid fragments from a mechanism perspective.
[0035] For pre-authenticated SMS fragments, this embodiment constructs a secure reassembly key based on the authentication sender identifier, authentication receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier in the access authentication context, and establishes a secure reassembly context accordingly. In other words, the reassembly context in this embodiment is no longer determined solely by the traditional concatenation reference number, but is jointly determined by the identities of both communicating parties, the logical message identity, the whole message commitment, and the routing context. With this design, even if two fragments behave identically at the traditional reference number level, as long as their corresponding logical message group identifiers, whole message commitment values, routing context identifiers, or the authentication communicating parties are different, the receiving end will not include them in the same reassembly context. Thus, the message ownership boundary, authentication boundary, and reassembly boundary are unified.
[0036] After the formal reassembly is completed, this embodiment of the application also performs a whole-message commitment verification on the reassembled byte sequence. This step is the final consistency verification in the entire technical loop. Its necessity lies in the fact that even if all fragments entering the reassembly context have passed pre-authentication, the receiving end still needs to further confirm that the overall byte sequence obtained by reassembling these fragments in order is indeed consistent with the original logical message before the sending end's fragmentation. Only when the result of the recalculated whole message after reassembly is consistent with the original whole message commitment value is the corresponding logical SMS message submitted. Thus, this embodiment of the application further advances from correct fragment admission to correct overall output, avoiding situations where individual fragments are legal at the fragment level but the overall combination result is not the original message.
[0037] To facilitate understanding, the following practical working conditions can be used as examples:
[0038] For example, in a scenario of sending a long SMS message with 4 fragments, the sender first normalizes and encodes the original message into a target byte sequence, generates a total message commitment value based on this, generates a logical message group identifier G1, and assigns a routing context identifier E1. Subsequently, the 4 fragments are sent, each carrying its own authentication binding relationship with G1, the total message commitment value, the total number of fragments (4), its own fragment sequence number, and E1. Assume that fragments 1 and 2 arrive first via channel A, and fragment 3 is delayed during transmission. Due to a routing switch, the sender initiates a new transmission round for this logical message with a new routing context E2. The new fragments 3 and 4 arrive at the receiver via channel B. In this case, if a traditional approach is used, the receiver might mix and concatenate the first two fragments from the E1 context with the last two fragments from the E2 context. However, in this invention, since both E1 and E2 are included in the fragment authentication binding relationship and secure reassembly key, the receiving end will include fragments belonging to E1 and fragments belonging to E2 in different secure reassembly contexts, making cross-generational mixed reassembly impossible. Furthermore, even if an attacker attempts to disguise a legitimate fragment of another message as the 4th fragment of the current message, it will be excluded during the pre-authentication stage as long as the logical message group identifier or whole message commitment value corresponding to the forged fragment is inconsistent with the current secure reassembly key; even if the attacker copies a fragment with a similar local structure, since the final reassembly still requires whole message commitment verification, non-original message combinations cannot be submitted.
[0039] For example, in a gateway environment where multiple tenants share the same display sender number, tenant A and tenant B may simultaneously send different long SMS messages to the same user. Under traditional technology, if the fragments are reassembled solely based on the display number, the receiver number, and the concatenated reference number, there is a risk of cross-aggregation of fragments from different tenants. However, in this invention, the authenticated sender identifier is not simply a displayable number, but rather a trusted sender identity from the access authentication context, which, along with the logical message group identifier, the entire message commitment value, and the routing context identifier, participates in the establishment of the secure reassembly key. Therefore, even if the display layer is the same, the embodiments of this application can still isolate fragments from different tenants at the security layer, thereby avoiding cross-tenant message concatenation.
[0040] Therefore, the underlying technical principle for achieving the technical effects in the embodiments of this application can be summarized as the following closed-loop process: fixing the underlying byte representation of the logical message through standardized encoding; fixing the original whole message content of the sender through the whole message commitment value; establishing a message identity that does not rely on traditional concatenated quoting numbers through an independent logical message group identifier; enabling a single fragment to have verifiable whole message ownership by incorporating the logical message group identifier, whole message commitment value, total number of fragments, fragment sequence number, and routing context identifier into the fragment authentication binding relationship; completing ownership filtering and context isolation before the fragment enters the formal reassembly process through receiver pre-authentication and secure reassembly key establishment; and achieving overall verification of the final output result through whole message commitment verification after reassembly.
[0041] It is precisely because of the seamless connection and layered constraints of the above steps that the embodiments of this application can prevent cross-logical message splicing and cross-routing generation mixed submission under complex operating conditions such as dynamic routing, fragmentation out-of-order, traditional reference number collision, routing generation switching, and multi-tenant shared channels, and correspondingly improve the reassembly accuracy, submission certainty, and overall system reliability of long SMS transmission.
[0042] Figure 1 This is a flowchart illustrating a dynamic routing adjustment-based SMS channel security authentication method according to an example embodiment of this application. Figure 1 As shown, the method provided in this embodiment includes:
[0043] S100: Obtain the authentication sender identifier and authentication receiver identifier corresponding to the logical SMS message to be sent, and perform normalized encoding on the logical SMS message to obtain the target byte sequence.
[0044] On the sending side, after a logical SMS message enters the sending processing flow, the access authentication context corresponding to that logical SMS message is first read. The access authentication context can be formed from the sending interface authentication result, channel access authentication result, or tenant access authentication result, and includes at least the sending subject identifier, receiving target identifier, tenant affiliation information, and access session identifier. In implementation, the identifier field corresponding to the sending subject is extracted from the access authentication context as the original value of the authenticated sender identifier; the identifier field corresponding to the receiving target is extracted as the original value of the authenticated receiver identifier. Subsequently, the original values undergo unified representation processing. Specifically, for the authenticated sender identifier, at least the character encoding, character case, separator representation, and prefix representation are unified; for the authenticated receiver identifier, at least the country code representation in the number is unified, non-number separator characters are removed, and it is converted into a single number string representation. After completing the unified representation processing, the results are written into the sending metadata record of the logical SMS message, serving as the authenticated sender identifier and authenticated receiver identifier used subsequently for generating the entire message commitment value, establishing fragmented authentication binding relationships, and performing secure reassembly. In scenarios where a single logical SMS message corresponds to multiple recipients, an independent logical SMS message record can be generated for each authenticated recipient, and each record can then proceed to the next processing step.
[0045] After obtaining the authenticated sender and receiver identifiers, the logical SMS message undergoes normalized encoding processing. In implementation, the encoding scheme corresponding to the logical SMS message is first determined. When the message content contains only characters representable by the GSM 7-bit character set, the GSM 7-bit encoding scheme is used; when the message content contains characters outside the GSM 7-bit character set, the UCS2 encoding scheme is used; when the logical SMS message itself is a byte data service, an 8-bit data encoding scheme is used. Subsequently, the message content undergoes unified formatting processing, which includes at least: unifying the carriage return and line feed character "CRLF" and the single carriage return character "CR" into a single line feed representation, removing byte order markers, and maintaining the valid character order in the message body. For the case using the GSM 7-bit encoding scheme, each character is mapped to a corresponding 7-bit character unit, and a target byte sequence for commitment calculation and fragmentation processing is generated with one character unit corresponding to one byte storage unit. During subsequent SMS fragmentation, the corresponding character units are converted into the actual transmitted byte stream according to GSM 03.38 rules. When using the UCS2 encoding scheme, each character is encoded according to double-byte network byte order and concatenated sequentially to obtain the target byte sequence. When using the 8-bit data encoding scheme, the input byte stream is directly used as the target byte sequence. Through these methods, the same logical SMS message can have a unique byte representation on both the sending and receiving sides, thus providing a consistent data foundation for calculating the entire message commitment value and for reassembly verification.
[0046] S200: Generate the whole message commitment value based on the authentication sender identifier, the authentication receiver identifier, and the target byte sequence, and generate a logical message group identifier that is independent of the SMS concatenation reference number.
[0047] After obtaining the target byte sequence, the total number of fragments corresponding to the logical SMS message is calculated based on the encoding scheme. In implementation, the total number of fragments is determined according to the effective payload length that a single SMS message can carry under the encoding scheme: when the total length does not exceed the maximum capacity of a single SMS message, the total number of fragments is 1; when the total length exceeds the maximum capacity of a single SMS message, the total number of fragments is calculated by dividing by and rounding up the effective payload length of each fragment after concatenation. Subsequently, the input byte string of the integer message commitment value is constructed according to a fixed field order. The fixed field order includes at least the domain identifier, protocol version, authenticated sender identifier, authenticated receiver identifier, tenant identifier, encoding scheme, total number of fragments, and target byte sequence. Each field is concatenated with its length value first, followed by its content, to avoid different field combinations producing the same input representation. A key digest operation or hash operation is performed on the input byte string to obtain the integer message commitment value; in a specific implementation, HMAC-SHA256 operation can be used, and all bytes of the output result or the first 16 or 20 bytes are taken as the integer message commitment value for storage and transmission.
[0048] While generating the entire message commitment value, a logical message group identifier, independent of the SMS concatenation reference number, is also generated. In implementation, the logical message group identifier is not derived from the traditional SMS concatenation reference number, but is generated jointly based on the sending node identifier, generation time, monotonically increasing sequence number within the node, and a random number. For example, the sending node identifier, millisecond-level time value, increasing sequence number, and random byte can be concatenated sequentially and encoded into a fixed-length string as the logical message group identifier. After generation, the logical message group identifier and the entire message commitment value are written together into the message header record and sending task record of the logical SMS message for sharing among SMS fragments. Because the logical message group identifier is independent of the traditional SMS concatenation reference number, even if different logical SMS messages use the same traditional SMS concatenation reference number at the transport layer, it will not affect subsequent secure reassembly based on the logical message group identifier and the entire message commitment value.
[0049] S300: The logical SMS message is fragmented according to the target byte sequence to obtain multiple SMS fragments, and a routing context identifier is assigned to the logical SMS message.
[0050] After obtaining the total message commitment value, logical message group identifier, and total number of fragments, the logical SMS message is fragmented according to the target byte sequence. In implementation, the payload length of a single SMS fragment is determined based on the encoding scheme and whether a user data header is included. When the total number of fragments is 1, the entire target byte sequence is loaded according to the payload length of a single SMS message. When the total number of fragments is greater than 1, the message is continuously fragmented according to the byte order in the target byte sequence, based on the payload length after including the user data header, resulting in multiple SMS fragments. Each SMS fragment is then assigned a current fragment number. For the GSM 7-bit encoding scheme, fragmentation is first performed at character unit boundaries, then each SMS fragment is encapsulated with a user data header and converted into an actual transmitted byte stream. For the UCS2 encoding scheme, fragmentation is performed at double-byte character boundaries to avoid splitting a single character into two SMS fragments. For the 8-bit data encoding scheme, fragmentation is performed directly according to byte length.
[0051] A routing context identifier can be assigned to a logical SMS message either before or after fragmentation processing. In implementation, the currently effective routing version information is first read as the routing generation identifier; then, the authorized route set corresponding to the logical SMS message is obtained, and the authorized route set is sorted according to a fixed order of routing identifiers before a digest is calculated to obtain the routing policy digest. The routing context identifier can include the routing generation identifier, the routing policy digest, or both. Subsequently, the routing context identifier is written into the logical SMS message record and the authentication binding information generation input for each SMS fragment, so that all SMS fragments of the same logical SMS message share the same set of routing context identifiers during transmission; when a subsequent route switch occurs and all SMS fragments are retransmitted, a new routing context identifier is generated so that the receiving end can establish independent secure reassembly contexts for different routing generations.
[0052] S400: Establish a segment authentication binding relationship for each SMS segment. The segment authentication binding relationship shall associate at least the logical message group identifier, the total message commitment value, the total number of segments, the current segment sequence number, and the routing context identifier.
[0053] Figure 2 This is a schematic flowchart of S400 according to the first example embodiment of this application. Figure 2 As shown, the above S400 includes:
[0054] S411. Calculate the content summary of each SMS segment separately.
[0055] After completing the logical SMS message fragmentation, the sending end extracts the fragment content byte string corresponding to the target byte sequence for each SMS fragment, and calculates the corresponding fragment content digest based on the fragment content byte string.
[0056] In specific implementation, the fragment content byte string only includes the business content bytes carried by the corresponding SMS fragment, excluding the traditional SMS concatenation reference number, the traditional total number of fragments, the traditional fragment sequence number, and the authentication binding information written subsequently. This ensures that the sending and receiving ends can obtain consistent digest results for the same SMS fragment content. For logical SMS messages using the GSM 7-bit encoding scheme, after fragmentation by character unit boundaries, the byte string formed by the character unit sequence corresponding to each SMS fragment is used as the fragment content byte string. For logical SMS messages using the UCS2 encoding scheme, after fragmentation by double-byte character boundaries, the double-byte sequence corresponding to each SMS fragment is used as the fragment content byte string. For logical SMS messages using the 8-bit data encoding scheme, the data byte sequence corresponding to each SMS fragment is directly used as the fragment content byte string. Subsequently, a hash operation is performed on each fragment content byte string to obtain the corresponding fragment content digest. In one specific implementation, a SHA-256 operation can be performed on the fragment content byte string, and the first 16 bytes of the output result can be used as the fragment content digest. After the calculation is completed, the content digest of each fragment is associated with the corresponding current fragment number and written into the fragment processing record of the sending end, so as to be used for subsequent generation of fragment authentication tags and fragment-by-fragment verification by the receiving end.
[0057] S412. Generate the corresponding fragment authentication tag based on the key, domain identifier, logical message group identifier, whole message commitment value, routing context identifier, authentication sender identifier, authentication receiver identifier, total number of fragments, current fragment sequence number, fragment content digest, and reassembly deadline.
[0058] After obtaining the fragment content digest for each SMS fragment, the sender generates a corresponding fragment authentication tag for each fragment. Specifically, the valid key corresponding to the domain identifier is first read. This valid key is jointly held by the sender and receiver and used to perform a consistent key-digest operation on the SMS fragment authentication binding information. Then, the tag input data is organized according to a fixed field order, which includes at least: domain identifier, logical message group identifier, total message commitment value, routing context identifier, authentication sender identifier, authentication receiver identifier, total number of fragments, current fragment sequence number, fragment content digest, and reassembly deadline. During field organization, each field is concatenated with its length first, followed by its content, to avoid different field combinations forming the same input byte representation. The reassembly deadline can be represented in milliseconds from a unified start time and encoded with a fixed byte length. After organizing the tag input byte string, a key-digest operation is performed on the tag input byte string to obtain the corresponding fragment authentication tag. In one specific implementation, HMAC-SHA256 operation can be used, and the first 16 bytes of the output result are taken as the fragment authentication tag. Then, the logical message group identifier, the entire message commitment value, the routing context identifier, the total number of fragments, the current fragment sequence number, the fragment content summary, the reassembly deadline, and the fragment authentication tag are written into the authentication binding information of the corresponding SMS fragment, so that each SMS fragment has an independent and complete authentication binding relationship.
[0059] S413. When SMS fragments arrive out of order, the receiving end performs verification according to the fragment authentication tag corresponding to each SMS fragment.
[0060] Upon receiving an SMS fragment, the receiving end does not require the fragments to arrive in the order of their current fragment sequence number. Instead, it performs verification independently for each arrived fragment. Specifically, it first parses the authentication binding information from the corresponding fragment to obtain the logical message group identifier, total message commitment value, routing context identifier, total number of fragments, current fragment sequence number, fragment content digest, reassembly deadline, and fragment authentication tag. Simultaneously, it obtains the authentication sender identifier and authentication receiver identifier from the access authentication context. Then, following the same rules as when the sending end calculates the fragment content digest, it extracts the fragment content byte string from the currently received fragment and recalculates the target fragment content digest. The recalculated target fragment content digest is compared with the parsed fragment content digest; if they are inconsistent, it is determined that the fragment content has changed, and the fragment is either discarded or isolated. If the two match, the valid key corresponding to the domain identifier is read further, and the tag input byte string is reorganized according to the same field order as the sender. Then, a key digest operation is performed on the tag input byte string to obtain the target fragment authentication tag. The target fragment authentication tag is compared with the fragment authentication tag in the authentication binding information. If they match, the SMS fragment is determined to have passed authentication, and the SMS fragment is included as an authenticated SMS fragment in the corresponding security reassembly context. If they do not match, the SMS fragment authentication is determined to have failed, and the corresponding SMS fragment is discarded or isolated.
[0061] Since each SMS fragment carries its own fragment content summary and fragment authentication tag, and the verification process only relies on the information carried by the SMS fragment itself and the access authentication context, even if the SMS fragments arrive out of order, the receiving end can still complete the verification of each SMS fragment separately without waiting for the preceding SMS fragments to arrive first.
[0062] Figure 3 This is a schematic flowchart of S400 according to the second example embodiment of this application. Figure 3 As shown, the above S400 includes:
[0063] S421. Generate an authentication list, which includes at least the logical message group identifier, the whole message commitment value, the routing context identifier, the total number of fragments, the fragment content summary corresponding to each SMS fragment, and the reassembly deadline.
[0064] After logical SMS message fragmentation, the sending end extracts the corresponding fragment content byte string for each SMS fragment and calculates the fragment content digest for each fragment. Specifically, the fragment content byte string only includes the business content bytes carried by the corresponding SMS fragment, excluding the traditional SMS concatenation reference number, the total number of traditional fragments, the traditional fragment sequence number, and the subsequently written authentication binding information. This ensures that the sending and receiving ends obtain consistent fragment content digests for the same SMS fragment content. After obtaining the fragment content digests for each SMS fragment, the sending end organizes the authentication list content in ascending order of the current fragment sequence number. The authentication list sequentially writes the logical message group identifier, the entire message commitment value, the routing context identifier, the total number of fragments, the reassembly deadline, and the fragment content digest corresponding to each current fragment sequence number. To avoid different field combinations resulting in identical byte representations, in one specific implementation, fields are concatenated sequentially with the field length first, followed by the field content. The digest entries corresponding to each current fragment number are written one by one in the format of "current fragment number + fragment content digest," and the number of digest entries matches the total number of fragments. This authentication list establishes a complete digest mapping relationship for all fragments of a logical SMS message, enabling the receiving end to locate the corresponding fragment content digest and perform verification based on the current fragment number when receiving any subsequent SMS fragment.
[0065] S422. Generate a list of authentication labels for the authentication list.
[0066] After generating the authentication list, the sending end further generates an authentication label. Specifically, the sending end first reads the valid key corresponding to the domain identifier, and then organizes the label input data for calculating the authentication label according to a fixed field order. Besides the authentication list itself, the label input data also includes the domain identifier, the authentication sender identifier, and the authentication receiver identifier, thus binding the authentication list to the specific communication domain and the identities of the communicating parties. After organizing the label input data, the sending end performs a key digest operation on the label input data to obtain the authentication label. In one specific implementation, HMAC-SHA256 operation can be used, and the first 16 bytes of the output result are taken as the authentication label. After generating the authentication label, the sending end appends the authentication label to the authentication list, forming authentication data that the receiving end can independently verify. If the length of the authentication list does not exceed the length that a single SMS message can carry, the authentication list and the list authentication tag can be sent as a single SMS message. If the length of the authentication list exceeds the length that a single SMS message can carry, the authentication list can be split into multiple list SMS messages according to the list sequence number and sent with a common logical message group identifier and list authentication tag in each list SMS message, so that the receiving end can reconstruct the complete authentication list and perform unified verification after collecting them.
[0067] S423. Make each SMS fragment carry the corresponding logical message group identifier, routing context identifier, total number of fragments, current fragment sequence number and fragment content summary.
[0068] After generating the authentication list and its authentication tags, the sender writes basic authentication information for fragment-level verification to each SMS fragment. Specifically, the sender writes the logical message group identifier, routing context identifier, total number of fragments, current fragment sequence number, and fragment content summary corresponding to each SMS fragment into the authentication binding information for that fragment, and sends this information along with the business content of that SMS fragment. In this way, even if the receiver has not yet completed the reassembly of all SMS fragments, it can still associate the SMS fragment with the corresponding authentication list verification process based solely on the logical message group identifier, routing context identifier, total number of fragments, current fragment sequence number, and fragment content summary carried in a single SMS fragment. To maintain compatibility with existing SMS delivery methods, traditional SMS concatenation reference numbers, traditional total number of fragments, and traditional fragment sequence numbers can still be retained in the SMS fragments for compatibility transmission, auxiliary sorting, or debugging, but they are not the sole basis for performing verification on SMS fragments according to the authentication list. In this way, each SMS segment has basic authentication attributes that can be independently identified and verified, thus providing a data foundation for the receiving end to perform verification segment by segment in out-of-order reception scenarios.
[0069] S424. The receiving end first verifies the authentication list, and then performs verification on each SMS fragment according to the fragment content digest in the authentication list.
[0070] After receiving the authentication list corresponding to the logical message group identifier, the receiving end first verifies the authentication list, and then verifies the business SMS fragments. In specific implementation, the receiving end first parses the logical message group identifier, whole message commitment value, routing context identifier, total number of fragments, fragment content summary corresponding to each current fragment sequence number, reassembly deadline, and list authentication tag in the authentication list, and obtains the authentication sender identifier and authentication receiver identifier from the access authentication context.
[0071] Subsequently, the receiving end verifies whether the reassembly deadline has expired, reads the valid key corresponding to the domain identifier, reorganizes the tag input data according to the same field order as the sending end, performs key digest operation on it, and obtains the target list authentication tag; if the target list authentication tag is consistent with the list authentication tag, it is determined that the authentication list verification is successful, and establishes the correspondence between the current fragment sequence number and the fragment content digest according to the current fragment sequence number.
[0072] Subsequently, when the receiving end receives each SMS fragment, it first parses the logical message group identifier, routing context identifier, total number of fragments, current fragment sequence number, and fragment content digest carried in the SMS fragment. Then, it extracts the target fragment content byte string from the SMS fragment service content according to the same rules as the sending end and recalculates the target fragment content digest. Then, it compares the recalculated target fragment content digest with the fragment content digest carried by the SMS fragment itself, and compares the fragment content digest carried by the SMS fragment itself with the fragment content digest corresponding to the current fragment sequence number in the authentication list.
[0073] Only when all the above comparison results are consistent, and the logical message group identifier, routing context identifier, and total number of fragments in the SMS fragment are consistent with the authentication list, is the SMS fragment considered to have passed verification, and the SMS fragment is included in the corresponding security reassembly context; if any comparison is inconsistent, the corresponding SMS fragment is discarded or isolated. For SMS fragments that arrive before the authentication list, the receiving end can temporarily store its SMS fragment content and corresponding authentication binding information. After the authentication list verification is successful, the temporarily stored SMS fragments will be verified one by one according to the fragment content digest in the authentication list.
[0074] Figure 4 This is a schematic flowchart of S400 according to the third exemplary embodiment of this application. Figure 4 As shown, the above S400 includes:
[0075] S431. Generate the chain start point based on the logical message group identifier, the whole message commitment value, the routing context identifier, and the total number of shards.
[0076] After completing the logical SMS message fragmentation and obtaining the logical message group identifier, the total message commitment value, the routing context identifier, and the total number of fragments, the sender first organizes the starting input byte string used to generate the chain starting point. Specifically, the sender writes the logical message group identifier, the total message commitment value, the routing context identifier, and the total number of fragments in a fixed field order. To avoid different field combinations forming the same byte representation, each field is encoded with its length first, followed by its content. After organizing the starting input byte string, the sender performs a hash operation on the starting input byte string to obtain the chain starting point. In one specific implementation, SHA-256 can be used, and the first 16 or 32 bytes of the output result can be taken as the chain starting point. The chain starting point generated in this way corresponds one-to-one with the logical message group identifier, the total message commitment value, the routing context identifier, and the total number of fragments, thus enabling the same logical SMS message to obtain different chain starting points under different routing contexts or different fragment sizes.
[0077] S432. Generate the current chain value sequentially based on the previous chain value, the current segment number, and the segment content summary of the corresponding SMS segment.
[0078] After obtaining the chain start point, the sender generates the current chain value for each SMS segment sequentially, from 1 to the total number of segments, according to the current segment sequence number. Specifically, the sender first extracts the corresponding segment content byte string for each SMS segment and performs a hash operation on the segment content byte string to obtain a segment content digest. The segment content byte string only includes the business content bytes carried by that SMS segment, excluding the traditional SMS concatenation reference number, the traditional total number of segments, the traditional segment sequence number, and the authentication binding information written into the SMS segment. For an SMS segment with a current segment sequence number of 1, the chain start point is used as the previous chain value; for SMS segments with a current segment sequence number greater than 1, the current chain value corresponding to the previous current segment sequence number is used as the previous chain value. Subsequently, the sender concatenates the previous chain value, the current segment sequence number, and the segment content digest according to a fixed field order and performs a hash operation on the concatenation result to obtain the current chain value corresponding to that SMS segment. After calculating the current chain value for all SMS fragments in sequence, the current chain value corresponding to the last SMS fragment is taken as the chain endpoint. Through the above chain value generation method of passing chain values one fragment at a time, each SMS fragment is included in the same continuous link, thus forming an irreplaceable and non-jumpable sequential association relationship between SMS fragments.
[0079] S433, Generate chain authentication tags for the chain start point and chain end point.
[0080] After generating the chain start and end points, the sender further generates chain authentication tags for them. Specifically, the sender first reads the key corresponding to the domain identifier, and then organizes the tag input data according to a fixed field order. The tag input data includes at least the chain start and end points; in one implementation, it may further include an authentication sender identifier, an authentication receiver identifier, a logical message group identifier, and a routing context identifier, so that the chain authentication tag is simultaneously associated with the identities of both communicating parties and the current sending context. After completing the tag input data organization, the sender performs a key digest operation on the tag input data to obtain the chain authentication tag. In one implementation, HMAC-SHA256 operation can be used, and the first 16 bytes of the output result are taken as the chain authentication tag. After generating the chain authentication tag, the sender writes the chain authentication tag into the authentication binding information corresponding to the logical SMS message; to facilitate verification by the receiver when any SMS fragment arrives, each SMS fragment can carry the same chain authentication tag.
[0081] S434. Make each SMS segment carry the current segment number, the previous chain value, the current chain value, and the segment content summary.
[0082] After generating the previous chain value, current chain value, and fragment content digest for each SMS fragment, the sender constructs corresponding authentication binding information for each SMS fragment. Specifically, the sender writes the current fragment sequence number, previous chain value, current chain value, and fragment content digest of the SMS fragment into the authentication binding information of the SMS fragment, and sends it along with the service content carried by the SMS fragment. In one implementation, a chain authentication tag can also be written into the authentication binding information. For an SMS fragment with a current fragment sequence number of 1, its previous chain value is the chain start point; for an SMS fragment with a current fragment sequence number equal to the total number of fragments, its current chain value is the chain end point. Thus, even if SMS fragments arrive out of order, the receiver can still perform content consistency verification and link continuity verification on the SMS fragment based on the current fragment sequence number, previous chain value, current chain value, and fragment content digest carried in a single SMS fragment.
[0083] S435. The receiving end performs continuity verification on each SMS fragment based on the adjacent chain value relationship, and completes fragment reassembly when the fragments are continuously connected from the starting point to the ending point of the chain.
[0084] After receiving each SMS fragment, the receiving end first parses the current fragment sequence number, previous chain value, current chain value, fragment content digest, and chain authentication tag carried in each fragment, and obtains the authentication sender identifier and authentication receiver identifier from the access authentication context. Then, for each SMS fragment, the receiving end extracts the target fragment content byte string from the service content of that fragment, recalculates the target fragment content digest, and compares the recalculated target fragment content digest with the fragment content digest carried by that SMS fragment. If they match, the receiving end further concatenates the previous chain value, current fragment sequence number, and fragment content digest carried by that SMS fragment according to the same field order as the sending end, recalculates the target current chain value, and then compares the target current chain value with the current chain value carried by that SMS fragment.
[0085] Only when all the above comparison results are consistent is the SMS fragment deemed to have passed chain value verification. For multiple SMS fragments that have passed chain value verification, the receiving end compares the chain value relationships corresponding to adjacent current fragment sequence numbers: if the current chain value of the SMS fragment corresponding to the previous current fragment sequence number is consistent with the previous chain value of the SMS fragment corresponding to the next current fragment sequence number, then the two are determined to be continuously connected; if they are inconsistent, then the link is determined to be interrupted, and the corresponding SMS fragment is discarded or isolated. After obtaining the candidate chain start point and candidate chain end point, the receiving end recalculates the target chain authentication tag based on the candidate chain start point and candidate chain end point, and compares it with the received chain authentication tag; when the chain authentication tag verification is successful, and a complete link is formed from the current fragment sequence number 1 to the total number of fragments, continuously connecting the chain start point to the chain end point, the receiving end combines the SMS fragments in the order of the current fragment sequence number, completes the fragment reassembly, and enters the subsequent whole message commitment verification process.
[0086] In response to the above Figures 2-4 The illustrated embodiments provide three parallel implementation methods for fragment authentication binding relationships: fragment independent authentication, authentication list authentication, and chained continuous authentication. Among these, fragment independent authentication is more conducive to improving the instant authentication capability when a single fragment arrives; authentication list authentication is more conducive to reducing the authentication burden and improving batch processing efficiency in multi-fragment scenarios; and chained continuous authentication is more conducive to enhancing the constraints on fragment continuity, sequential consistency, and resistance to splicing attacks. Therefore, the embodiments of this application can flexibly configure security, processing efficiency, and continuity verification strength according to different SMS service scenarios, thereby improving the adaptability of SMS fragment authentication and secure reassembly in dynamic routing environments.
[0087] Among them, for Figure 2 The illustrated embodiment is used in scenarios such as when a bank sends a text message notification containing long transaction details to a user, the various text message fragments may be forwarded through different gateways and arrive out of order. If... Figure 2 In the illustrated embodiment, even if the third fragment arrives before the first fragment, the receiving end can immediately perform independent authentication on the third fragment. If the third fragment is maliciously replaced, its content is altered, or it originates from an incorrect channel context, the fragment can be directly rejected before entering the reassembly cache. This avoids erroneous fragmentation from polluting the reassembly process.
[0088] for Figure 3 The illustrated embodiment is used in scenarios where, for example, enterprises send lengthy service notifications to a large number of users, with each logical SMS message often split into 5, 6, or even more segments. If each segment carries a relatively complete authentication tag, the total number of authentication fields will increase significantly with the number of segments. Figure 3 In the illustrated embodiment, a single authentication list can uniformly describe all fragments, with each fragment carrying only the necessary identifier and fragment content digest. This is more conducive to reducing the overall authentication overhead in high-concurrency, high-volume transmission scenarios.
[0089] for Figure 4 The illustrated embodiment is used in scenarios such as cross-carrier emergency alarm systems, where a long message may traverse multiple forwarding links due to routing congestion, and some fragments may be delivered repeatedly. If an attacker attempts to insert a legitimate fragment from another older message into the middle of the current message, simply relying on fragment digest comparison may not always reveal whether the sequential relationship is valid; however, using... Figure 4 After chain authentication in the illustrated embodiment, the inserted fragment will disrupt the relationship between adjacent chain values, making it impossible for the chain to close continuously from the start point to the end point, thus enabling it to be identified.
[0090] S500 dynamically routes and sends each SMS fragment according to the routing context identifier.
[0091] In one possible implementation, a target route can be selected before logical SMS message fragmentation, and a route lease can be assigned to the logical SMS message. The route lease includes at least a logical message group identifier, a route context identifier, a target route, and a lease validity period. Each SMS fragment is added to the same group-level sending queue, and during the validity period of the same route lease, each SMS fragment is restricted to being sent only through the target route. When the target route fails, unacknowledged SMS fragments are withdrawn, and all SMS fragments of the logical SMS message are resent based on the new route context identifier.
[0092] In the above implementation, by determining the target route and establishing a route lease before logical SMS message fragmentation, each SMS fragment of the same logical SMS message is restricted to being sent via the same route during the lease's validity period. When the route fails, all SMS fragments are resent based on the new route context identifier. This effectively reduces the possibility of SMS fragments on different routes being cross-reassembled at the receiving end, and improves the clarity of the entire message sending boundary and the consistency of reassembly in a dynamic routing environment.
[0093] For example, a government platform sends a long disaster warning SMS message, which is split into four SMS fragments. Normally, all fragments are sent via route A. After the second fragment is sent, route A fails. If the above implementation method is used, the third and fourth fragments are not sent via route B. Instead, the unacknowledged parts are withdrawn, and all four fragments are resent via route B under a new routing context.
[0094] The result of this is that the receiving end does not see a mixed state of "the first two pieces from the old route and the last two pieces from the new route", but can more clearly distinguish between the old batch and the new batch, thereby reducing erroneous reassembly.
[0095] In the second possible implementation, the routing context identifier includes a routing generation identifier. This could be achieved by using a first routing generation identifier during initial transmission. When the current routing becomes abnormal, the submission of new SMS fragments to the first routing generation identifier is stopped, and the first routing generation identifier is marked as closed. Then, a second routing generation identifier is generated, and the corresponding fragment authentication binding relationship is re-established using the logical message group identifier, the whole message commitment value, and the second routing generation identifier. The receiving end establishes independent security reassembly contexts corresponding to the first and second routing generation identifiers respectively, and submits only one complete and verified logical SMS message.
[0096] In the above implementation, by stopping the submission of new SMS fragments to the old routing generation and generating new routing generation identifiers when a routing anomaly occurs, and establishing fragment authentication binding relationships and security reassembly contexts for different generations respectively, generational isolation can be achieved when old fragment remnants and new fragment retransmissions coexist, avoiding cross-generational grouping, while ensuring the ability to quickly recover sending capabilities after a routing anomaly.
[0097] For example, consider an industrial maintenance alarm SMS message split into five parts. The first three parts have already been sent via route A. If route A suddenly malfunctions, and it's uncertain whether the first three parts have been received by the receiving end, the above implementation would stop sending the remaining fragments to the first route generation, generate a second route generation identifier, rebuild the fragment authentication binding relationship via route B, and then resend the message. The receiving end would establish independent security reassembly contexts for both the first and second generations.
[0098] Even if some fragments from the old generation are later added, the receiving end will not mix them with the second generation fragments, and will only submit a complete and verified result.
[0099] In the third possible implementation, the routing context identifier includes a routing policy digest. Correspondingly, for the above S500, this could involve generating an authorized route set for the logical SMS message, sorting the authorized route set, generating a routing policy digest, and associating each SMS fragment with the routing policy digest. The receiving end verifies whether the actual transmission route of each SMS fragment belongs to the authorized route set and includes SMS fragments with the same logical message group identifier, whole message commitment value, routing context identifier, and routing policy digest into the same secure reassembly context.
[0100] In the above implementation, by establishing an authorized route set for logical SMS messages and generating a route policy summary, the receiving end can determine whether SMS fragments are allowed to participate in reassembly based on whether the actual transmission route belongs to the authorized set. This allows for flexible scheduling of multiple routes while suppressing the security risks caused by unauthorized route injection, and improves the routing adaptability and secure reassembly capability in multi-channel high-concurrency scenarios.
[0101] For example, an internet notification platform sends service notifications to users nationwide. The system allows SMS fragments to be scheduled between operator channels A, B, and C, but not through unregistered external channel D. If the above implementation method is used, the sending side first forms an authorized route set consisting of A, B, and C, and generates a corresponding routing policy summary. The receiving end, upon receiving a fragment, checks whether its actual transmission route belongs to one of A, B, or C.
[0102] In this way, even if some fragments go through A and some fragments go through B, as long as they are still within the authorized scope and the policy digest is consistent, they can be included in the same secure reassembly context; while fragments from D will be blocked.
[0103] S600: After receiving each SMS segment, obtain the authentication sender identifier and authentication receiver identifier in the access authentication context, parse the authentication binding information corresponding to each SMS segment, and perform pre-authentication on each SMS segment.
[0104] The authentication binding information includes the reassembly deadline, fragment content digest, and authentication tag; the routing context identifier includes the routing generation identifier and / or routing policy digest. Correspondingly, the aforementioned pre-authentication of each SMS fragment can include:
[0105] Verify that the total number of fragments is within the allowed range;
[0106] Check if the current fragment number belongs to the range of 1 to the total number of fragments;
[0107] Verify whether the reorganization deadline has expired;
[0108] Verify that the authentication sender identifier and authentication receiver identifier in the access authentication context are consistent with the authentication binding information;
[0109] Verify whether the authentication label has passed verification;
[0110] Verify whether the SMS segment content matches the corresponding segment content summary;
[0111] And verify whether the route generation identifier and / or route policy summary belong to an allowed route context.
[0112] S700 constructs a secure reassemble key for pre-authenticated SMS fragments based on the authentication sender identifier, authentication receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier in the access authentication context.
[0113] For SMS fragments that have passed pre-authentication, the authentication sender identifier and authentication receiver identifier are read from the access authentication context, and the logical message group identifier, whole message commitment value, and routing context identifier are obtained from the authentication binding information corresponding to the SMS fragment. The authentication sender identifier, authentication receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier are encoded sequentially according to a fixed field order. When writing each field, the field identifier is written first, followed by the field length, and finally the field value, thus obtaining the reassembly key input sequence. In specific implementation, the field identifier can be represented using a single byte, and the field length can be represented using two bytes or four bytes, with the field length written according to network byte order. If the relevant field is already saved as a byte sequence in the access authentication context or authentication binding information, its original byte representation is written directly; if the relevant field is saved as a character, it is converted to a byte sequence according to UTF-8 encoding before being written.
[0114] A digest calculation is performed on the recombined key input sequence to obtain the key digest. In practice, SM3 or SHA-256 can be used to calculate the digest, and the complete output of the result is used as the key digest. When a fixed-length index is used internally, a fixed-length byte can be extracted from the digest result as the key digest, ensuring consistency between the sender and receiver during extraction. By calculating the digest of the recombined key input sequence formed by the authenticated sender identifier, authenticated receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier, a fixed-length representation of the secure recombined key can be achieved, facilitating unified processing in caches, indexes, and recombination logs.
[0115] A secure reassembly key is constructed by associating the key digest with the authenticated sender identifier, authenticated receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier in the access authentication context. In practice, the key digest can be used as a primary lookup item, while the authenticated sender identifier, authenticated receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier are used as consistency comparison items to collectively form the secure reassembly key. When establishing a secure reassembly context subsequently, candidate items are first located based on the key digest, and then the authenticated sender identifier, authenticated receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier are compared item by item to confirm the secure reassembly context to which the current SMS fragment belongs.
[0116] When the routing context identifier includes a routing generation identifier and a routing policy digest, the routing context identifier is written in the order of routing generation identifier first, followed by routing policy digest. In specific implementation, the field values corresponding to the routing context identifier can be further encoded using a field identifier, field length, and field value format. Specifically, the field identifier, field length, and field value corresponding to the routing generation identifier are written first, followed by the field identifier, field length, and field value corresponding to the routing policy digest. This ensures that different receiving nodes receive a consistent byte representation of the routing context identifier.
[0117] When the routing context identifier only includes the routing generation identifier, the field identifier, field length, and field value corresponding to the routing generation identifier are written when encoding the routing context identifier, and the encoded result is used as the field value of the routing context identifier. Using this method, even if a route switch occurs during transmission, the receiving end can still distinguish SMS fragments of different generations into different secure reassembly contexts based on the routing generation identifier.
[0118] When the routing context identifier only includes a routing policy digest, the field identifier, field length, and field value corresponding to the routing policy digest are written when encoding the routing context identifier, and the encoded result is used as the field value of the routing context identifier. Using this method, the receiving end can include the authorized routing range in the same key space when constructing the secure reassembly key, thereby distinguishing SMS fragments with the same logical message group identifier and the same whole message commitment value but different routing policy digests.
[0119] Then, using the key digest as the lookup term, the corresponding secure reorganization context is searched in the secure reorganization context cache. In practice, a hash table, key-value store, or segmented index table can be used to store the secure reorganization contexts, and the set of candidate secure reorganization contexts can be located by the key digest; when multiple candidate secure reorganization contexts with the same key digest exist, subsequent field comparisons are performed.
[0120] When the authenticated sender identifier, authenticated receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier recorded in the target security reassembly context match the current SMS fragment, the current SMS fragment is included in the target security reassembly context. In practice, the authenticated sender identifier, authenticated receiver identifier, logical message group identifier, whole message commitment value, and routing context identifier are compared item by item in a fixed order. If all match, the current SMS fragment and the target security reassembly context are considered to belong to the same security reassembly key.
[0121] When the key digests are the same and at least one of the following is inconsistent: the authenticated sender identifier, the authenticated receiver identifier, the logical message group identifier, the whole message commitment value, and the routing context identifier, an independent secure reassembly context is established. This approach avoids the situation where contexts from different logical SMS messages or SMS fragments from different routing contexts are incorrectly included in the same reassembly process due to directly merging contexts based solely on the digest results. This ensures a balance between indexing efficiency and reassembly isolation for the secure reassembly key.
[0122] S800: Establish a secure reassembly context based on the secure reassembly key and perform fragmented reassembly.
[0123] Specifically, received SMS fragments can be recorded according to their current fragment sequence number. When a target SMS fragment with the same current fragment sequence number is received, the fragment content digests of the two are compared. If the comparison results are the same, the target SMS fragment is treated as a duplicate SMS fragment; if the comparison results are different, it is determined that a fragment conflict has occurred in the corresponding security reassembly context, and the corresponding security reassembly context is closed.
[0124] The secure reassembly context includes an absolute reassembly deadline. After fragment reassembly is completed, an integer message commitment verification is performed on the reassembled byte sequence. If the verification passes, the corresponding logical SMS message is submitted, including: after receiving SMS fragments with different current fragment sequence numbers corresponding to the total number of fragments, combining them in the order of the current fragment sequence numbers to obtain the reassembled byte sequence; recalculating the target integer message commitment value based on the reassembled byte sequence, the authenticated sender identifier, the authenticated receiver identifier, the tenant identifier, the encoding scheme, and the total number of fragments; if the target integer message commitment value matches the integer message commitment value, the logical SMS message is submitted atomically; if they do not match, the corresponding secure reassembly context is discarded or isolated.
[0125] Optionally, the existing SMS concatenation reference number, the existing total number of fragments, and the existing fragment sequence number carried in the SMS fragment are used for compatibility transmission, auxiliary sorting, or debugging, and are not used as the sole basis for establishing a secure reassembly key.
[0126] Based on the above embodiments, in a first possible implementation of S800, a receiving bitmap can be created based on the total number of fragments; after each SMS fragment passes pre-authentication, the receiving bitmap is updated based on the current fragment sequence number; and when all bits in the receiving bitmap are set and the entire message commitment verification passes, a logical SMS message is submitted.
[0127] In applications requiring high-concurrency reception and rapid reassembly, the aforementioned fragment reassembly method based on the receive bitmap can be adopted. This method creates a receive bitmap based on the total number of fragments and updates it according to the current fragment sequence number after each SMS fragment passes pre-authentication. The logical SMS message is submitted when all bits in the receive bitmap are set and the overall message commitment verification passes. Since each current fragment sequence number corresponds one-to-one with a specific position in the receive bitmap, even when SMS fragments arrive out of order, the system can still record the arrival status of each fragment with low state maintenance overhead and quickly determine whether all fragments have been received. Compared to scanning fragment records one by one, this implementation reduces the complexity of fragment reception state management and improves the efficiency of reassembly completion determination, making it more suitable for business environments with high requirements for processing throughput and response time, such as SMS gateways and aggregation receiving nodes.
[0128] In the second possible implementation, the cache can be divided into a security metadata cache and an authenticated business data cache. After receiving a text message fragment, the logical message group identifier, the total message commitment value, the routing context identifier, the total number of fragments, the current fragment sequence number, and the corresponding authentication information are first written to the security metadata cache. After the pre-authentication is passed, the corresponding text message fragment content is then written to the authenticated business data cache. The upper limit of the number of caches and the upper limit of the number of bytes are set for the sender, the tenant, and the logical message group, respectively.
[0129] In application scenarios that are open to the public network, pose a risk of abnormal traffic input, or require multi-tenant resource isolation, a fragmentation and reassembly method that separates the security metadata cache from the authenticated business data cache can be adopted. This method first writes the logical message group identifier, total message commitment value, routing context identifier, total number of fragments, current fragment sequence number, and corresponding authentication information into the security metadata cache. After the SMS fragment passes pre-authentication, the corresponding SMS fragment content is then written into the authenticated business data cache. Maximum cache size and maximum number of bytes are set for the sender, tenant, and logical message group, respectively. Because this implementation stores the information required for authentication and the business fragment content in a hierarchical manner, it can limit the occupation of business data storage space by invalid fragments before authentication passes. Furthermore, it controls the spread of abnormal sending behavior to system resources through multi-dimensional cache limits, thereby improving the system's stability and resource isolation capabilities under conditions such as malicious traffic surges and multi-tenant concurrent contention.
[0130] In a third possible implementation, pre-authenticated SMS fragments can be appended to the reassembly log. The reassembly log records at least the secure reassembly key, the current fragment sequence number, the fragment content digest, and the storage offset. After receiving all SMS fragments, each fragment is read from the reassembly log in order of its current sequence number, and a complete message commitment verification is performed. Upon successful verification, an atomic commit flag is written, and if an atomic commit flag exists, the corresponding logical SMS message is output to the application layer.
[0131] In application scenarios with high requirements for fault recovery capabilities, result consistency, and traceability of processing, the above-mentioned fragment reassembly method based on append-only reassembly logs can be adopted. This method appends pre-authenticated SMS fragments to the reassembly log, recording the secure reassembly key, current fragment sequence number, fragment content summary, and storage offset. After receiving all SMS fragments, it reads each fragment from the reassembly log in order of its current sequence number and performs a full message commitment verification. Upon successful verification, an atomic commit flag is written, and the corresponding logical SMS message is output to the application layer when the atomic commit flag exists. Because critical processing traces after pre-authentication are continuously written to the reassembly log, the system can recover the reassembly process based on the reassembly log after an interruption or restart. Simultaneously, by setting the atomic commit flag, successful verification and external output can be strictly bound, thereby reducing the risk of erroneous intermediate state commits. Therefore, this implementation method is more suitable for application environments with high requirements for reliability, consistency, and audit trails, such as financial notifications, industrial alarms, and critical business SMS delivery.
[0132] The aforementioned solutions are applicable to different business scenarios that emphasize high concurrency processing efficiency, resource isolation and resistance to abnormal traffic, and process logging and anomaly recovery capabilities, respectively. By providing multiple parallel implementation methods under the same security reconfiguration framework, the embodiments of this application can balance reconfiguration efficiency, system stability, and result consistency under different deployment conditions and different business objectives.
[0133] S900. After the fragmentation and reassembly are completed, perform a full message commitment verification on the reassembled byte sequence. If the verification passes, submit the corresponding logical SMS message.
[0134] Once the receiving end has received a number of SMS fragments with different current fragment numbers corresponding to the total number of fragments in the corresponding secure reassembly context, it reads the content of each SMS fragment sequentially from 1 to the total number of fragments according to the current fragment number, and concatenates them continuously according to the fragment boundaries to obtain the reassembled byte sequence. Subsequently, it reads the various fields involved in generating the whole message commitment value from the secure reassembly context, including at least the authenticated sender identifier, authenticated receiver identifier, tenant identifier, encoding scheme, and total number of fragments. The receiving end writes the above fields and the reassembled byte sequence into the commitment calculation input area in the same field arrangement order, byte representation method, and calculation method as when generating the whole message commitment value, and recalculates the target whole message commitment value. After calculation, a length check and byte-by-byte comparison are performed on the target whole message commitment value and the whole message commitment value. When the two have the same length and all corresponding bytes are the same, the whole message commitment verification is deemed to have passed. When the two have different lengths or any corresponding byte is different, the whole message commitment verification is deemed to have failed, and the corresponding security reassembly context is marked as verification failure, and the subsequent submission process is stopped. When it is necessary to retain the exception handling traces, the logical message group identifier, routing context identifier, verification failure time and verification failure reason are also recorded, and the corresponding security reassembly context is transferred to isolation processing or directly deleted.
[0135] Once the entire message commitment verification passes, the receiving end reverse-decodes the reassembled byte sequence according to the encoding scheme to obtain the corresponding logical SMS message. Using the logical message group identifier, the entire message commitment value, the authenticated sender identifier, and the authenticated receiver identifier as the basis for submission deduplication, it first checks if a submission record already exists. If a submission record already exists, the current logical SMS message is treated as a duplicate submission and further output is stopped. If no submission record exists, the logical message group identifier, the entire message commitment value, the routing context identifier, the authenticated sender identifier, the authenticated receiver identifier, the submission time, and the logical SMS message are written into the submission record, and a submission completion flag is written atomically. If a submission completion flag exists, the corresponding logical SMS message is output to the application layer. After output, the corresponding secure reassembly context is closed, and the fragment storage space and status record corresponding to the logical SMS message are released, thereby preventing the same logical SMS message from being repeatedly submitted due to duplicate arrivals, repeated reassemblies, or parallel arrivals during routing changes.
[0136] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A dynamic route adjustment based short message channel security authentication method, characterized in that, include: Obtain the authentication sender identifier and authentication receiver identifier corresponding to the logical SMS message to be sent, and perform normalized encoding on the logical SMS message to obtain the target byte sequence; Generate an integer message commitment value based on the authentication sender identifier, the authentication receiver identifier, and the target byte sequence, and generate a logical message group identifier that is independent of the SMS concatenation reference number; The logical SMS message is fragmented according to the target byte sequence to obtain multiple SMS fragments, and a routing context identifier is assigned to the logical SMS message, and a fragment authentication binding relationship is established for each SMS fragment; Dynamically route and send each SMS segment according to the routing context identifier; After receiving each of the SMS segments, obtain the authentication sender identifier and authentication receiver identifier in the access authentication context, parse the authentication binding information corresponding to each SMS segment, and perform pre-authentication on each SMS segment; For SMS fragments that have passed pre-authentication, a secure reassembly key is constructed to establish a secure reassembly context based on the secure reassembly key, and fragment reassembly is performed. After fragment reassembly is completed, the corresponding logical SMS message is submitted.
2. The method of claim 1, wherein, The execution of fragment reassembly includes: Record the received SMS segments according to the current segment number; When a target SMS segment with the same current segment number is received, the corresponding segment content digests of the two are compared.
3. The method of claim 2, wherein, The secure reconfiguration context includes an absolute reconfiguration deadline.
4. The method of claim 3, wherein, The SMS segment carries the existing SMS concatenation reference number, the existing total number of segments, and the existing segment sequence number.
5. The method of claim 1, wherein, The step of establishing a segment authentication binding relationship for each of the aforementioned SMS segments includes: For each SMS segment, calculate the segment content digest and generate the corresponding segment authentication tag; When SMS fragments arrive out of order, the receiving end performs verification according to the fragment authentication tag corresponding to each SMS fragment.
6. The method according to claim 1, characterized in that, The step of establishing a segment authentication binding relationship for each of the aforementioned SMS segments includes: Generate an authentication list, and generate authentication tags for the authentication list; The receiving end first verifies the authentication list, and then performs verification on each SMS fragment according to the fragment content digest in the authentication list.
7. The method according to claim 1, characterized in that, The step of establishing a segment authentication binding relationship for each of the aforementioned SMS segments includes: The chain start point is generated based on the logical message group identifier, the whole message commitment value, the routing context identifier, and the total number of shards; The current chain value is generated sequentially based on the previous chain value, the current segment number, and the segment content summary of the corresponding SMS segment; Generate chain authentication tags for the chain start point and chain end point; The receiving end performs continuity verification on each SMS fragment based on the adjacent chain value relationship, and completes fragment reassembly when the fragments are continuously connected from the starting point of the chain to the ending point of the chain.
8. The method according to claim 1, characterized in that, The step of dynamically routing and sending each SMS segment according to the routing context identifier includes: Before fragmenting a logical SMS message, a target route is selected, and a route lease is assigned to the logical SMS message. The route lease includes at least the logical message group identifier, the route context identifier, the target route, and the lease validity period. Add each of the aforementioned SMS fragments to the same group-level sending queue; During the validity period of the same route lease, each of the aforementioned SMS fragments is restricted to be sent only through the target route; When the target route fails, unconfirmed SMS fragments are withdrawn, and all SMS fragments of the logical SMS message are resent based on the new route context identifier.
9. The method according to claim 1, characterized in that, The routing context identifier includes a routing generation identifier; the step of dynamically routing and sending each SMS fragment according to the routing context identifier includes: Use the first routing generation identifier during initial transmission; When the current route is abnormal, stop submitting new SMS fragments to the first route generation identifier and mark the first route generation identifier as closed. Generate a second-generation routing identifier; The corresponding sharding authentication binding relationship is re-established using the logical message group identifier, the whole message commitment value, and the second route generation identifier; The receiving end establishes independent security reconfiguration contexts corresponding to the first routing generation identifier and the second routing generation identifier, and submits only one of them as a complete and verified logical SMS message.
10. The method according to any one of claims 1 to 6, characterized in that, The routing context identifier includes a routing policy summary; the step of dynamically routing and sending each SMS fragment according to the routing context identifier includes: Generate an authorized route set for the logical SMS message; Sort the authorized route set and generate the route policy summary; Associate each of the SMS fragments with the routing policy summary; The receiving end verifies whether the actual transmission route of each SMS fragment belongs to the authorized route set, and includes SMS fragments with the same logical message group identifier, whole message commitment value, route context identifier and route policy summary into the same security reassembly context.
