Message processing method and apparatus
By maintaining multi-layered identity chains and session generations in the robot's fixed-screen terminal, and performing entry verification and semantic temporary storage, the issues of message identity consistency and semantic security during binding switching are resolved, ensuring the security and consistency of message replay.
Patent Information
- Application Number
- CN202611620159.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-20
- Publication Date
- 2026-11-17
AI Technical Summary
During the binding and switching process of robot fixed screen terminals, existing technologies cannot effectively guarantee the consistency of message identity and semantic security, resulting in old messages overwriting new sessions, old touch actions being sent under new binding, or insufficient message identity verification, leading to cross-identity pollution and semantic disorder issues.
By maintaining local configuration identities and their states, actual routing contexts, current interaction session boundaries, and session generations, a minimum trusted session boundary is established. Entry verification based on message envelopes and channel metadata is performed, bounded semantic temporary storage is carried out, and identity verification and flow sequence verification are performed after identity is determined to ensure the semantic security of message replay.
It ensures that messages belong to the currently acceptable identity chain during identity loading, switching, or recovery, preserves necessary streaming semantics, and guarantees that replay after recovery does not exceed the regular verification boundaries, thus avoiding cross-identity pollution and semantic out-of-order delivery.
Smart Images

Figure CN123123306A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of identity verification and semantic security message playback technology for robot fixed-screen terminals, specifically to a message processing method and apparatus. Background Technology
[0002] Unlike regular mobile applications, which typically use login accounts as a relatively stable business boundary, fixed-screen terminals for commercial robots may experience binding changes due to equipment deployment, store adjustments, repairs, robot replacements, factory resets, network reconnections, or configuration center refreshes. Ongoing voice conversations, product recommendations, task prompts, and touch actions on the fixed screen must belong to the current robot, the current store, the current display device, and the current business session.
[0003] In distributed robot systems, binding configurations, message subscriptions, and business messages typically arrive via different asynchronous links. Configuration storage might still be loading, the transport layer might be revoking old subscriptions and establishing new ones, and the business layer might have already received wake-up messages, streaming text, or page updates. Even if each message is correctly formatted when viewed individually, inconsistencies in identity hierarchy or time boundaries can still lead to cross-identity contamination, such as old store content appearing on new store terminals, old session messages overwriting new sessions, and old touch actions being routed from new robot routes.
[0004] In existing technologies, one approach switches topics or connections solely based on robot identifiers. For example, it listens for changes in robot identifiers, cancels the old topic subscription, and subscribes to the new topic when the identifier changes. This approach can reduce obvious routing errors, but timing misalignments still exist: old messages that entered the client buffer before cancellation may still arrive; if the robot identifier remains unchanged but the store or display device changes, the topic may not necessarily change; asynchronous tasks at the business layer may also hold the sending channel from before the switch and continue publishing after the switch.
[0005] Therefore, simply switching topics cannot simultaneously prove that the message comes from the current terminal installation instance, belongs to the current business session, is consistent with the current store and display device, nor can it prevent non-idempotent uplink actions that have captured old routes from being sent under the new binding.
[0006] Another approach places the original message into a first-in-first-out queue while initialization is incomplete, and then replays it directly after configuration loading is finished. This approach has the following drawbacks: First, it does not establish a minimum trusted session boundary, so external or old session messages may also enter the queue; second, complete snapshots and a large number of increments are saved equivalently, and streaming messages can easily fill the queue; third, replay may bypass the current identity, sequence, and state machine verification; and fourth, if new messages are processed directly during replay, they may surpass old messages in the queue, causing semantic out-of-order delivery.
[0007] Simply increasing the queue capacity does not solve the above problems; instead, it prolongs the lifespan of old messages. Simply discarding the oldest messages may delete the incremental fragments necessary to construct the currently visible objects, resulting in incomplete replay results.
[0008] Another approach only verifies the tenant, robot, or session fields in the business payload. Some systems only compare the robot identifier, store identifier, or sessionId in the JSON payload. This approach treats the message's self-declared identity as the sole evidence, failing to bind the payload identity to the message channel's native attachments, the actual subscription route, the terminal installation session, and local configuration snapshots. When old cached payloads are redelivered on new routes, or different installation instances share the same robot identifier, simple payload comparison is insufficient to identify risks.
[0009] In addition, payload verification generally only covers downlink; if the identity is valid when the uplink action is created but has been switched when it is actually sent, identity crossover in the opposite direction may still occur.
[0010] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section. Summary of the Invention
[0011] In order to solve at least one of the above-mentioned problems in the prior art, embodiments of the present invention provide a message processing method and apparatus.
[0012] This invention provides a message processing method, including: Maintain the local configuration identity and its state, actual routing context, current interaction session boundary, and session generation; the local configuration identity is determined by the local binding snapshot and has a loading state and a ready state; the actual routing context is provided by the currently active transport connection or subscription; In response to the trusted session initiation signal, the current interaction session boundary is established and the session generation is updated; Receive downlink messages and perform entry verification based on the message envelope and message channel metadata of the downlink messages; If the entry verification passes and the downlink message belongs to the current interaction session boundary, and the local configuration identity is in a loading state, then the downlink message is temporarily stored with bounded semantics. After the local configured identity is transitioned to the ready state, the current session identity is established based on the local configured identity, the actual routing context, and the unchanged session generation. The establishment is successful only if the actual routing context is consistent with the local configured identity and the session generation has not changed. After successful establishment, the temporarily stored messages will be processed in the order of receipt for identity verification, stream order verification, and state reduction path processing, in order to perform semantically secure replay.
[0013] In some embodiments, the local configuration identity includes a robot identifier, a store identifier, and a display device identifier; the actual routing context includes an actual subscribed robot identifier and a terminal installation session identifier; the method also maintains a terminal installation session identifier, which is used to distinguish different installation instances or reinstallation instances on the same robot and is included in the message channel metadata.
[0014] In some embodiments, establishing the current interaction session boundary and updating the session generation in response to a trusted session initiation signal includes: The service session corresponding to the trusted session initiation signal is identified as the current interaction session to establish the boundary of the current interaction session; When establishing the current interaction session boundary, the accepted service session identifier and the runtime session identifier of the service session are recorded; In response to the establishment of the current interactive session boundary, the session generation is incremented or replaced so that the previous session becomes invalid relative to the current interactive session; After a session is incremented or replaced, the semantic temporary content of the previous session is cleared. The previous session refers to the interactive session that was active before the current interactive session boundary was established.
[0015] In some embodiments, the entry verification based on the message envelope and message channel metadata of the downlink message includes: Verify whether the communication protocol identifier, robot identifier, terminal installation session identifier, and source identifier in the message channel metadata meet the preset requirements; wherein, for downlink messages of type wake-up and which are the first messages of the current interaction session, the terminal installation session identifier is allowed to be omitted in its message channel metadata, but the communication protocol identifier, robot identifier, and source identifier are still verified; Verify that the target field in the message envelope exists and that its field type is correct; wherein, the target field includes at least one of the following: message type, communication protocol version, request identifier, message identifier, session identifier, robot identifier, store identifier, and display device identifier.
[0016] In some embodiments, the method further includes: If the entry verification fails, the downlink message is rejected.
[0017] In some embodiments, the bounded semantic temporary storage of the downlink message includes: When the session identifier of the downlink message is consistent with the accepted service session identifier and the runtime session identifier, the downlink message and the existing messages in the temporary storage queue are semantically merged and temporarily stored according to the message object, update mode and semantic mergeability; wherein, the semantic mergeability means that after merging the downlink message and the existing messages in the temporary storage queue, the page state obtained by state reduction is the same as when it is not merged.
[0018] In some embodiments, the message object is determined by an object identifier in the downlink message, the object identifier including at least one of a block identifier, a stream key, and a slot; The update modes include at least one of full snapshot, incremental append, patch, and wipe.
[0019] In some embodiments, the semantic merging includes: If a new message for the same identifier carries a semantic snapshot, then delete the incremental and / or old snapshots of that identifier in the temporary queue, and retain the semantic snapshot. If both the tail message and the new message contain only the semantic increment of the same identifier, and belong to the same interface, content type, and update semantics, then the two semantic increments will be merged into one increment.
[0020] In some embodiments, the locally configured identity further includes a determined failure status; the method further includes: If the local identity configuration fails to be determined, the downlink message is rejected from entering the bounded semantic temporary storage.
[0021] In some embodiments, it also includes: After establishing the current interactive session boundary and updating the session generation, an asynchronous identity resolution task is initiated. The asynchronous identity resolution task carries the accepted business session identifier, runtime session identifier, and session generation at the time of initiation.
[0022] In some embodiments, after the locally configured identity transitions to a ready state, establishing the current session identity based on the locally configured identity, the actual routing context, and the unchanged session generation includes: Read the local configuration identity and the actual routing context; Verify whether the robot identifier in the actual routing context is consistent with the robot identifier in the locally configured identity; Verify whether the currently accepted service session identifier is consistent with the accepted service session identifier carried by the asynchronous identity resolution task; Verify whether the current runtime session identifier is consistent with the runtime session identifier carried by the asynchronous identity resolution task; Verify whether the current session generation is consistent with the session generation carried by the asynchronous identity resolution task; If all the above verifications pass, the current session identity is established, and the local configuration identity, actual routing context, accepted service session identifier, runtime session identifier, and session generation are used as the current session identity metadata.
[0023] In some embodiments, the method further includes: If any of the above verifications fails, the current session identity will be refused.
[0024] In some embodiments, if the ingress verification passes and the downlink message belongs to the current interaction session boundary, the method further includes: If the local configured identity is in a ready state, then identity verification, flow sequence verification, and state reduction are performed on the downlink message.
[0025] In some embodiments, performing identity verification, stream order verification, and state reduction path processing on the temporarily stored messages in the order of receipt for semantically secure replay includes: Take a temporary message from the head of the temporary queue and perform the same identity verification, stream order verification and state reduction as the real-time downlink message on the temporary message to perform semantically secure replay; Set an emptying flag. New messages from the same session that arrive during replay are appended to the end of the temporary queue until the temporary queue is empty, at which point the emptying flag is removed. If the local configuration identity changes during playback, subsequent temporary messages will be rejected and the remaining temporary queue will be cleared.
[0026] In some embodiments, the identity verification includes: Verify whether the local configuration identity is in a ready state, and whether the robot identifier, store identifier, and display device identifier in the local configuration identity are currently valid values and not placeholder values; Verify whether the actual subscribed robot identifier in the actual routing context matches the robot identifier in the locally configured identity; Verify whether the robot identifier and terminal installation session identifier in the message channel metadata are consistent with the current session identity metadata; Verify whether the session identifier of the downlink message or temporary message is equal to the accepted service session identifier and the runtime session identifier; Verify whether the session generation carried by the asynchronous identity resolution task or the sending task is the current session generation; Verify whether the robot identifier, store identifier, and display device identifier in the message envelope are consistent with the current session identity metadata; Verify that the request identifier and message identifier in the message envelope exist; If all the above checks pass, then subsequent flow sequence checks and state reduction path processing are performed on the downlink message or temporary message.
[0027] In some embodiments, after the identity verification is passed, the stream sequence verification includes: Verify whether the interface, slot, stream key, and stream sequence number of the downlink message or temporary message correspond to the current stream; If the above verification passes, the downlink message or temporary message is processed according to the update mode of the unified state machine, which includes replacement, append, patch and clear.
[0028] In some embodiments, after the flow sequence verification passes, the state reduction path processing includes: Based on the interface, slot, stream key, stream sequence number, and update mode of the downlink message or temporary message, determine the position of the downlink message or temporary message in the current page state machine; Update the page state corresponding to the determined location based on the update mode.
[0029] In some embodiments, the method further includes: When the local configuration identity changes or fails to be determined, invalidate the current interactive session and its temporary storage that were established before the change or failure.
[0030] In some embodiments, invalidating the current interactive session and its temporary storage established before the change or failure includes: Record the current session identifier as the expired session identifier; After recording the failed session identifier, increment the session generation and clear the accepted service session identifier, runtime session identifier, session identity metadata, and active route snapshot; After incrementing the session generation, clear the semantic temporary queue and reset the workbench page state.
[0031] In some embodiments, the method further includes: After recording the failed session identifier, the page is refused to be recreated with the same failed session identifier.
[0032] In some embodiments, the method further includes: When the robot's identifier changes, unsubscribe from the old robot theme and subscribe to the new robot theme corresponding to the changed robot identifier; If the robot identifier remains unchanged while the store identifier or display device identifier changes, the currently subscribed robot theme will remain unchanged, and if the locally configured identity changes, the current interactive session and its temporary storage will be invalidated.
[0033] In some embodiments, the method further includes: When creating an up action such as a touch operation, query request, shopping cart action, or action result confirmation, capture the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context, generate a request identifier, and construct a task to be sent. Before actually executing asynchronous transmission, read again the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context; The captured accepted service session identifier, runtime session identifier, session generation, and local configuration identity are compared with the currently accepted service session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context, respectively. The captured actual routing context is then compared with the current actual routing context at the time of transmission. If the above comparison results are consistent, then the above action is sent.
[0034] In some embodiments, the method further includes: If there is an inconsistency in the above comparison results, the up action will be rejected and the task to be sent will be marked as invalid.
[0035] In some embodiments, the terminal installation session identifier is generated and persistently stored when the terminal is installed or reinstalled; the terminal installation session identifier is sent to the peer with the session ready response so that subsequent downlink messages can restore the complete terminal installation session identifier verification.
[0036] In some embodiments, the local configuration identity may further include at least one of a tenant identifier, a site identifier, a device certificate identifier, or a bound version.
[0037] This invention also provides a message processing apparatus, comprising: The maintenance module is used to maintain the local configuration identity and its state, the actual routing context, the current interaction session boundary, and the session generation; the local configuration identity is determined by the local binding snapshot and has a loading state and a ready state; the actual routing context is provided by the currently valid transport connection or subscription; The response module is used to establish the current interactive session boundary in response to the trusted session initiation signal and update the session generation; The verification module is used to receive downlink messages and perform entry verification based on the message envelope and message channel metadata of the downlink messages; The temporary storage module is used to perform bounded semantic temporary storage of the downlink message if the local configuration identity is in a loading state, provided that the entry verification is successful and the downlink message belongs to the boundary of the current interaction session. The module is used to establish the current session identity based on the local configuration identity, the actual routing context, and the unchanged session generation after the local configuration identity has been converted to the ready state. The establishment is successful only if the actual routing context is consistent with the local configuration identity and the session generation has not changed. The processing module is used to perform identity verification, stream order verification, and state reduction path processing on the temporarily stored messages in the order of receipt after successful establishment, so as to perform semantic security replay.
[0038] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the program to implement the method described in any of the above embodiments.
[0039] This invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any of the above embodiments.
[0040] This invention also provides a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.
[0041] The message processing method and apparatus proposed in this invention maintain local configuration identity and its state, actual routing context, current interaction session boundary, and session generation, separating and modeling "who the terminal belongs to," "where the message actually comes from," "which interaction it belongs to," and "its sequential relationship with the previous session," avoiding the use of a single field or a self-reported field of the service payload as the basis for identity determination; by responding to the trusted session initiation signal to establish the current interaction session boundary and update the session generation, a minimum trusted session boundary is established for subsequent messages, and the ABA-type problem that cannot be solved by comparing session identifiers alone is solved; by entry verification based on message envelope and message channel metadata, messages that are obviously not belonging to the current terminal or whose format is unqualified are filtered before entering temporary storage or identity verification; and by, under the premise that the entry verification passes and the message belongs to the current interaction session boundary, but the local configuration identity is not determined... Bounded semantic caching is implemented to retain necessary streaming content of the trusted session within the unready binding window (the time interval during which the terminal has received the trusted session start signal, but the configured identity is still loading, the route subscription is not yet stable, or the identity resolution is not yet complete). This reduces blanking and jumps caused by cold starts or configuration refreshes, while not reducing the final identity verification strength. After the local configured identity transitions to a ready state, the current session identity is jointly established based on the local configured identity, the actual routing context, and the unchanged session generation. This ensures that the session identity is established on the basis of multiple fact consistency, reducing the risk of old identities being reinstalled in the new runtime. After successful establishment, the cached messages are re-verified for identity verification, stream order verification, and state reduction path processing in the order of receipt for semantically secure replay. This ensures that the replay is consistent with the real-time path and avoids semantic out-of-order issues caused by new messages exceeding the cached messages during replay. The above steps work together to form a complete technical closed loop of "constrained temporary storage when identity is uncertain and secure replay after identity is determined". This ensures that during the binding of identity loading, switching, failure or recovery, it can prove that the message still belongs to the current acceptable identity chain, retain the necessary streaming semantics, and ensure that the replay after recovery does not exceed the conventional verification boundaries. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0043] Figure 2 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0044] Figure 3 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0045] Figure 4 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0046] Figure 5 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0047] Figure 6 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0048] Figure 7 This is a schematic diagram of a multi-layer identity verification and status application overall architecture provided by an embodiment of the present invention.
[0049] Figure 8 This is a secure convergence timing diagram during binding switching provided in an embodiment of the present invention.
[0050] Figure 9 This is a schematic diagram of a hierarchical processing flow for downlink messages provided in an embodiment of the present invention.
[0051] Figure 10 This is a flowchart of semantic storage and secure replay in a not-ready window provided by an embodiment of the present invention.
[0052] Figure 11 This is a schematic diagram of semantic compression based on interactive objects and update patterns provided by an embodiment of the present invention.
[0053] Figure 12 This is a schematic diagram illustrating an operation that ensures new messages in real time do not exceed the order of temporarily stored messages during the emptying period, as provided in an embodiment of the present invention.
[0054] Figure 13 This is a flowchart illustrating a bidirectional failure protection operation for downlink old messages and uplink old actions provided in an embodiment of the present invention.
[0055] Figure 14 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention.
[0056] Figure 15 This is a schematic diagram of the structure of a message processing device provided in an embodiment of the present invention.
[0057] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0058] Detailed reference is made to exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings, wherein the same reference numerals in different drawings denote the same or similar elements unless otherwise stated. In the following description of exemplary embodiments, the described embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with several aspects of the invention as described in the appended claims.
[0059] The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. In this invention and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein is intended to represent and include any or all possible combinations of one or more of the associated listed items.
[0060] It should be understood that although the terms “first,” “second,” “third,” etc., may be used herein to describe various types of information, such information should not be limited by these terms. These terms are only used to distinguish the types of information. For example, without departing from the scope of the invention, first information may be referred to as second information, and similarly, second information may be referred to as first information. The term “if” as used herein may be understood, depending on the context, to mean “at the time,” “at this moment,” or “in response to a judgment.”
[0061] A robot's fixed-screen terminal is a display and touch terminal that is permanently installed on the body of a commercial robot, such as a horizontal Android Pad on the robot's chest. Its displayed content, touch actions, and local recovery are related to the current robot, store, and display device's binding relationship.
[0062] The fundamental flaw in existing technologies lies in treating identity as a static field and replay as a storage problem. In reality, the effective identity of a robot's fixed-screen terminal is composed of a configuration layer, a transport layer, an installation instance layer, a business session layer, a message envelope layer, and a semantic stream layer, and these layers are not updated simultaneously during binding switching. Based on this, this invention models identity determination as a multi-layered constraint chain that changes over time, and models replay as a re-input process constrained by both the identity chain and the semantic state machine.
[0063] Specifically, the core problem solved by this invention is not simply message loss, but how to prove that a message still belongs to the currently acceptable identity chain when the bound identity is in the process of loading, switching, failure or recovery, and to retain the necessary streaming semantics when the identity cannot be fully confirmed temporarily, while ensuring that the replay after recovery does not exceed the conventional verification boundary.
[0064] The bound identity is a tuple used to describe the current affiliation of the robot's fixed-screen terminal. For example, it must include at least the robot identifier, store identifier, and display device identifier; it can also be extended to include tenant identifier, site identifier, device certificate identifier, or bound version.
[0065] To address the aforementioned technical problems, embodiments of the present invention provide a message processing method.
[0066] Figure 1 This is a flowchart illustrating a message processing method provided in an embodiment of the present invention. Figure 1 As shown, the message processing method provided in this embodiment of the invention includes: S1. Maintain the local configuration identity and its state, actual routing context, current interactive session boundary, and session generation; the local configuration identity is determined by the local binding snapshot and has a loading state and a ready state; the actual routing context is provided by the currently valid transport connection or subscription; In step S1, the local configuration identity refers to the tuple determined by the local binding snapshot, which describes the current affiliation of the robot's fixed screen terminal. This tuple includes at least the robot identifier, store identifier, and display device identifier, and may also include tenant identifier, site identifier, device certificate identifier, or binding version.
[0067] The status of the local configuration identity includes a loading state and a ready state. The loading state indicates that the configuration has not yet reached an authoritative conclusion; at this time, the previous configuration must not be used to impersonate the current configuration. The ready state indicates that the required bound fields have been committed with the same atomic snapshot and meet the validity conditions. The status of the local configuration identity determines whether the downlink message enters the bounded semantic storage or the identity verification branch.
[0068] The actual routing context refers to the routing context actually used by the message channel, such as the current robot identifier and the terminal installation session identifier. It is provided by the currently active transport connection or subscription and cannot be inferred solely from the service load.
[0069] The current interaction session boundary refers to the boundary of a single business interaction process established by the terminal in response to a trusted session initiation signal. This boundary defines which downlink messages belong to the currently acceptable session range. Messages that do not belong to the current interaction session boundary are rejected and do not enter the bounded semantic storage.
[0070] Session generation refers to the local generation flag that a fixed-screen terminal increments or changes each time it receives a new trusted service session boundary. It is used to prevent asynchronous identity resolution results, late callbacks, or old publication tasks from affecting subsequent sessions. Session generation can resolve ABA-type problems that may still occur even when only session identifiers are compared.
[0071] S2. In response to the trusted session initiation signal, establish the current interactive session boundary and update the session generation; In step S2, the trusted session initiation signal refers to the signal used to establish the boundary of the current interactive session, such as a session status message of type wake-up. During entry verification, terminals typically reject messages lacking a terminal-installed session identifier or whose terminal-installed session identifier is inconsistent with their own. However, considering that the first wake-up message of a new service session may learn the terminal-installed session identifier earlier than the peer, it is allowed to default the terminal-installed session identifier only for the first wake-up packet. This exception does not bypass protocol, robot, and source verification; subsequent messages still undergo complete verification.
[0072] S3. Receive downlink messages and perform entry verification based on the message envelope and message channel metadata of the downlink messages; In step S3, the message envelope refers to the message header information carried by the downlink message itself, which includes fields such as message type, protocol version, request identifier, message identifier, session identifier, robot identifier, store identifier, and display device identifier. The message envelope is used for field existence and field type verification in the entry verification, and serves as the object of envelope identity verification in subsequent identity verification.
[0073] Message channel metadata refers to transport layer metadata provided by the message channel that cannot be modified by the service payload. This includes communication protocol identifiers, robot identifiers, terminal installation session identifiers, and source identifiers. Message channel metadata differs from message envelope metadata in origin: message envelopes originate from the downlink message itself, while message channel metadata originates from the message channel. Both are used together for entry verification to confirm that the downlink message originates from a message channel acceptable to the current terminal.
[0074] Entry verification refers to a low-cost, relatively identity-independent basic verification performed by the terminal after receiving a downlink message, based on the message envelope and message channel metadata. Entry verification confirms that the downlink message originates from a message channel acceptable to the current terminal and meets the admission criteria for subsequent processing. Passing entry verification is a prerequisite for the message to enter bounded semantic storage or identity verification; messages that fail entry verification are rejected.
[0075] S4. If the entry verification passes and the downlink message belongs to the current interaction session boundary, and the local configuration identity is in a loading state, then the downlink message is temporarily stored with bounded semantics. In step S4, bounded semantic temporary storage refers to the bounded temporary storage based on the message object, update mode, and semantic merging capability after the entry verification and pre-interaction session boundary verification are completed, rather than saving arbitrary original bytes. Bounded semantic temporary storage is used to retain necessary streaming semantics during the period when the bound identity is not ready, reducing blanks and jumps caused by cold starts or configuration refreshes, while not reducing the strength of the final identity verification.
[0076] In this context, a message object refers to the interaction object targeted by a downlink message, identified by an object identifier within the downlink message, such as a block identifier (blockId), stream key (streamKey), or slot. Updates to different message objects cannot be merged.
[0077] Update mode refers to the update method used by downlink messages on message objects, including full snapshots, incremental appends, patches, and cleanups. For example, a full snapshot can completely express the current content of an interactive object, such as providing the complete text (text) for the same dialogue text block; an increment only expresses relative changes, such as appending a semantic increment (textDelta) to the same dialogue text block. The update mode and the message object together determine whether two messages are semantically mergible.
[0078] Semantic mergibility refers to the fact that after merging downlink messages with existing messages in the temporary queue, the resulting page state after state reduction is the same as before merging. Only messages with semantic mergibility are semantically merged; messages whose semantic mergibility cannot be proven, such as those with different block identifiers, different interfaces, different content types, different business operations, or patches whose equivalence cannot be proven, are not merged but are temporarily stored as independent queue elements. Bounded semantic temporary storage is also subject to a preset capacity limit. If the capacity limit is still reached after semantic merging, new messages are rejected and the cache is marked as full (buffer_full).
[0079] S5. After the local configured identity is converted to the ready state, the current session identity is established based on the local configured identity, the actual routing context, and the unchanged session generation. The establishment is successful only if the actual routing context is consistent with the local configured identity and the session generation has not changed. In step S5, the current session identity refers to the identity established for the current interactive session after the local configuration identity transitions to the ready state, based on the local configuration identity, the actual routing context, and the unchanged session generation. The current session identity is successfully established only when the actual routing context is consistent with the local configuration identity and the session generation remains unchanged. The current session identity is the basis for subsequent identity verification, flow sequence verification, and state reduction.
[0080] S6. After successful establishment, the temporarily stored messages are processed in the order of receipt for identity verification, stream order verification, and state reduction path processing, so as to perform semantic security replay.
[0081] In step S6, identity verification refers to a consistency check performed on temporary messages or real-time downlink messages based on a multi-layered identity chain. The multi-layered identity chain includes: configuration identity verification, requiring the local configuration identity to be in a ready state and its fields to be valid; routing and message channel metadata verification, requiring the actual subscribed robot to be consistent with the configured robot, and the communication protocol identifier, robot identifier, terminal installation session identifier, and source identifier in the message channel metadata to meet the requirements; business session and session generation verification, requiring the message session identifier to be equal to the accepted business session identifier and the runtime session identifier, and the session generation carried by the asynchronous parsing or sending task to remain the current generation; and message envelope identity verification, requiring the robot identifier, store identifier, and display device identifier in the message envelope to be consistent with the current session identity metadata, and the request identifier and message identifier to exist. Application is rejected if any layer of verification fails.
[0082] Stream order verification refers to the validation of the order of messages within the current page's state machine. This includes verifying whether the surface, slot, stream key, and stream sequence number correspond to the current stream, and processing update modes according to a unified state machine. Update modes include replace, append, patch, and clear. Stream order verification is used to prevent semantic out-of-order delivery.
[0083] State reduction path processing refers to the process of determining the position of a message in the current page's state machine based on the message's interface, slot, stream key, stream sequence number, and update mode, and then updating the page state corresponding to that position. State reduction path processing updates the page state in a deterministic manner, ensuring that replay messages and real-time messages follow the same state reduction path.
[0084] Semantic security replay refers to the process where, after identity binding is complete, temporarily stored messages are re-entered sequentially through the identity verification, flow order verification, and state reduction chain, instead of being directly written to the interface state. During replay, a temporarily stored message is retrieved from the head of the temporary storage queue, and the same identity verification, flow order verification, and state reduction processes as for real-time downlink messages are performed on it for semantic security replay. A flushing flag is set during replay; new messages arriving from the same session are appended to the tail of the temporary storage queue until the queue is empty, at which point the flushing flag is removed. If the locally configured identity changes during replay, subsequent temporarily stored messages are rejected, and the remaining temporary storage queue is cleared.
[0085] The message processing method provided in this invention maintains the locally configured identity and its state, the actual routing context, the current interaction session boundary, and the session generation. It separates and models "who the terminal belongs to," "where the message actually comes from," "which interaction it belongs to," and "its sequential relationship with the previous session," avoiding the use of a single field or a self-reported field of the service payload as the basis for identity determination. By responding to the trusted session initiation signal, it establishes the current interaction session boundary and updates the session generation, creating a minimum trusted session boundary for subsequent messages and resolving ABA-type problems that cannot be solved by simply comparing session identifiers. Through entry verification based on message envelopes and message channel metadata, it filters messages that clearly do not belong to the current terminal or have unqualified formats before entering temporary storage or identity verification. It further addresses the issue of messages not belonging to the current terminal or having incorrect formats, provided that the entry verification passes and the message belongs to the current interaction session boundary, but before the locally configured identity is determined. Line-bounded semantic caching preserves the necessary streaming content of a trusted session within the unready binding window (the time interval during which the terminal has received the trusted session start signal, but the configured identity is still loading, the route subscription is not yet stable, or the identity resolution is not yet complete). This reduces blanking and jumps caused by cold starts or configuration refreshes, while not reducing the final identity verification strength. After the local configured identity transitions to a ready state, the current session identity is jointly established based on the local configured identity, the actual routing context, and the unchanged session generation. This ensures that the session identity is established on the basis of multiple fact consistency, reducing the risk of old identities being reinstalled in the new runtime. After successful establishment, the caching messages are re-verified in the order of receipt for identity verification, stream order verification, and state reduction path processing for semantically secure replay. This ensures that the replay is consistent with the real-time path and avoids semantic out-of-order issues caused by new messages exceeding the caching messages during replay. The above steps work together to form a complete technical closed loop of "constrained temporary storage when identity is uncertain and secure replay after identity is determined". This ensures that during the binding of identity loading, switching, failure or recovery, it can prove that the message still belongs to the current acceptable identity chain, retain the necessary streaming semantics, and ensure that the replay after recovery does not exceed the conventional verification boundaries.
[0086] In some embodiments, the local configuration identity includes a robot identifier, a store identifier, and a display device identifier; the actual routing context includes an actual subscribed robot identifier and a terminal installation session identifier; the method also maintains a terminal installation session identifier, which is used to distinguish different installation instances or reinstallation instances on the same robot, and is included in the message channel metadata, that is, it can be persistently saved and carried with native message attachments.
[0087] like Figure 2 As shown, in some embodiments, establishing the current interaction session boundary and updating the session generation in response to the trusted session initiation signal includes: S21. Determine the service session corresponding to the trusted session initiation signal as the current interaction session to establish the boundary of the current interaction session; In step S21, a business session refers to a session of a single voice or multimodal interaction. A business session is not equivalent to an identity binding, nor is it equivalent to a terminal installation session. Business sessions are used to distinguish different interaction rounds and are the basis for establishing session generations and session boundaries.
[0088] The current interaction session refers to the service session corresponding to the trusted session initiation signal that the terminal recognizes as the currently ongoing interaction session after responding to the trusted session initiation signal. The current interaction session is the object that establishes the boundary of the current interaction session, and the subsequently recorded accepted service session identifier and runtime session identifier are all for this current interaction session.
[0089] S22. When establishing the current interaction session boundary, record the accepted service session identifier and the runtime session identifier of the service session; In step S22, the accepted service session identifier refers to the identifier recorded by the terminal when establishing the current interaction session boundary, indicating that a service session has been accepted. This identifier is used to determine whether subsequent downlink messages belong to the currently accepted service session. When establishing the current session identity, the currently accepted service session identifier also needs to be verified for consistency with the accepted service session identifier carried by the asynchronous identity resolution task.
[0090] The runtime session identifier is an identifier recorded by the terminal when establishing the boundary of the current interactive session, representing the current runtime service session. The runtime session identifier, together with the accepted service session identifier, is used for session attribution determination. When establishing the current session identity, the current runtime session identifier also needs to be verified for consistency with the runtime session identifier carried by the asynchronous identity resolution task.
[0091] S23. In response to the establishment of the current interactive session boundary, increment or replace the session generation so that the previous session becomes invalid relative to the current interactive session. In step S23, the previous session refers to the interactive session that was active before the current interactive session boundary was established. The previous session corresponds to the current interactive session. When the current interactive session boundary is established, the previous session becomes invalid relative to the current interactive session, and its semantically stored content is cleared.
[0092] Session generation is a local generation marker that is incremented or replaced each time a fixed-screen terminal accepts a new trusted service session boundary. By incrementing or replacing the session generation, the previous session becomes invalid relative to the current interactive session, thereby preventing asynchronous identity resolution results, late callbacks, or old publication tasks from affecting subsequent sessions. Session generation increment or replacement refers to incrementing or replacing the session generation in response to the establishment of the current interactive session boundary.
[0093] S24. After the generational increment or replacement of the session, clear the semantic temporary content of the previous session; wherein, the previous session is the interactive session that was active before the establishment of the current interactive session boundary.
[0094] In step S24, clearing the semantic temporary storage content of the previous session refers to clearing the content of the previous session in the semantic temporary storage queue after the session generation is incremented or replaced. Semantic temporary storage is a bounded temporary storage of messages belonging to the same accepted session and whose basic verification has passed, performed by the terminal while the bound identity is not ready. After the boundary of the current interaction session is established, the previous session has expired, and its semantic temporary storage content no longer needs to be retained, so it is cleared to avoid the temporary messages of the old session affecting the current interaction session.
[0095] like Figure 3 As shown, in some embodiments, the entry verification based on the message envelope and message channel metadata of the downlink message includes: S31. Verify whether the communication protocol identifier, robot identifier, terminal installation session identifier, and source identifier in the message channel metadata meet the preset requirements; wherein, for downlink messages of type wake-up and which are the first messages of the current interaction session, the terminal installation session identifier is allowed to be omitted in the message channel metadata, but the communication protocol identifier, robot identifier, and source identifier are still verified; In step S31, the communication protocol identifier refers to the identifier used to identify the type and / or version of the communication protocol followed by the downlink message. During the entry verification, the terminal verifies whether the communication protocol identifier in the message channel metadata meets the preset requirements to confirm that the downlink message comes from a message channel acceptable to the current terminal.
[0096] The robot identifier (robotCode) is an identifier used to identify the robot to which the robot's fixed-screen terminal belongs. During entry verification, the robot identifier appears in both the message channel metadata and the message envelope to confirm that the downlink message originates from the current robot. In the multi-layered identity chain, the robot identifier is a common comparison field for the configured identity, the actual routing context, and the message envelope identity.
[0097] The terminal installation session identifier (padSessionId) is a stable identifier used to distinguish different installation or reinstallation instances on the same robot. This embodiment persistently stores it and includes it in the message channel metadata. During entry verification, messages lacking a terminal installation session identifier or with an identifier inconsistent with the local machine are typically rejected. However, a default terminal installation session identifier is only allowed for downlink messages of type "wake-up" that are the first message in the current interaction session.
[0098] The source identifier is an identifier used to identify the source of a downlink message. During entry verification, the terminal verifies whether the source identifier in the message channel metadata meets preset requirements to confirm that the downlink message originates from a trusted source. The source identifier, along with the communication protocol identifier, robot identifier, and terminal installation session identifier, constitutes the verification object of the message channel metadata.
[0099] Preset requirements refer to the verification conditions pre-set by the terminal for entry verification. These preset requirements are used to determine whether the communication protocol identifier, robot identifier, terminal installation session identifier, and source identifier in the message channel metadata meet the requirements, and whether the target field in the message envelope exists and whether its type is correct. The preset requirements can be determined according to the actual system configuration, and this embodiment of the invention does not impose any limitations.
[0100] A wake-up message, of type wake-up, is used as a trusted session initiation signal to establish the boundary of the current interactive session. The first wake-up message of a new service session may arrive before the peer learns that its local terminal has a session identifier installed. Therefore, this embodiment allows the first wake-up packet to default to the terminal having a session identifier installed, but still verifies the communication protocol identifier, robot identifier, and source identifier. This exception does not apply to page updates, action results, or other service messages.
[0101] The first message of the current interactive session refers to the first downlink message received during the establishment of the current interactive session boundary, preferably a session status message of type wake-up. For the first message of the current interactive session, the default terminal-installed session identifier is allowed in its message channel metadata, but the communication protocol identifier, robot identifier, and source identifier are still verified.
[0102] S32. Verify whether the target field in the message envelope exists and whether its field type is correct; wherein, the target field includes at least one of the following: message type, communication protocol version, request identifier, message identifier, session identifier, robot identifier, store identifier, display device identifier.
[0103] In step S32, the validation of the target field is part of the entry validation, which is used to confirm that the message meets the admission conditions for subsequent processing.
[0104] Message type refers to a field used to identify the type of downlink message, such as wake-up message, page update message, action result message, etc.
[0105] Communication protocol version refers to a field used to identify the communication protocol version followed by downlink messages.
[0106] The request identifier (requestId) is a field used to identify a request. When establishing the current session identity, it's also necessary to verify whether the request identifier exists in the message envelope. In the previous action, the terminal generates the request identifier and constructs the task to be sent.
[0107] The message identifier (messageId) is a field used to identify a message. When establishing the current session identity, it is also necessary to verify whether the message identifier exists in the message envelope.
[0108] The session identifier (sessionId) is a field used to identify a single business session. In subsequent processing, the session identifier of a message must be equal to both the accepted business session identifier and the runtime session identifier.
[0109] The store identifier (storeId) is a field used to identify a store. In a multi-layered identity chain, the store identifier is a common comparison field between the local configuration identity and the message envelope identity.
[0110] The display device identifier (displayDeviceId) is a field used to identify the display device. In a multi-layered identity chain, the display device identifier is a common comparison field for both the local configuration identity and the message envelope identity. The display device identifier can be an optional field in the message envelope.
[0111] Field type refers to the data type of the target field, such as string, integer, enumeration, etc. In entry validation, the terminal verifies whether the target field exists in the message envelope and whether its field type is correct. Field type validation is used to confirm that the message meets the admission criteria for subsequent processing.
[0112] In some embodiments, the method further includes: rejecting the downlink message if the entry verification fails. This ensures that downlink messages failing the entry verification are rejected before entering the bounded semantic buffer or subsequent identity verification, thereby guaranteeing that only trusted session messages that have passed basic verification are retained in the buffer queue. This prevents illegal messages from occupying buffer capacity or triggering subsequent invalid processing, and forms a layered protection with subsequent verifications in the multi-layered identity chain.
[0113] In some embodiments, the bounded semantic temporary storage of the downlink message includes: when the session identifier of the downlink message is consistent with the accepted business session identifier and the runtime session identifier, the downlink message and existing messages in the temporary storage queue are semantically merged and then temporarily stored based on the message object, update mode, and semantic merging capability; wherein, the semantic merging capability means that after merging the downlink message and existing messages in the temporary storage queue, the page state obtained by state reduction is the same as when it was not merged. In this way, the consistency of the session identifier ensures that the temporary message belongs to the current trusted session, the semantic merging improves the capacity of fixed capacity for high-frequency streaming text, and the strict definition of semantic merging capability prevents the capacity policy from tampering with the business semantics. Thus, during the period when the bound identity is not ready, the necessary streaming semantics are preserved, and the final identity verification strength or business semantics is not reduced or changed due to temporary storage, providing semantically complete temporary storage content for subsequent semantic security replay.
[0114] In some embodiments, the message object is determined by an object identifier in the downlink message, the object identifier including at least one of block identifier, stream key, and slot; the update mode includes at least one of full snapshot, incremental append, patch, and wipe.
[0115] Specifically, the object identifier is an identifier used in a downlink message to determine the message object. The object identifier is used to determine the interaction object to which the downlink message targets, thereby determining whether the downlink message targets the same object as existing messages in the temporary queue, and whether they are semantically mergingable. The object identifier is the basis for determining the message object. A block identifier (blockId) is an identifier used to identify interactive objects such as dialog text blocks. During semantic merging, when a new message with the same block identifier carries a complete text snapshot, the increment and / or old snapshot of that block identifier are deleted from the temporary queue, and the complete text snapshot is retained. When both the tail message and the new message contain only semantic increments of the same block identifier, and belong to the same interface, content type, and update semantics, the two semantic increments are merged into one increment. Updates of different block identifiers are not merged.
[0116] A stream key is a key used to identify the current stream. It's a type of object identifier used to determine the interaction object to which a downstream message corresponds. In stream sequence verification, the stream key, along with the interface, slot, and stream sequence number, are used to verify whether a message corresponds to the current stream.
[0117] A slot is an identifier used to determine the location of an interactive object. A slot is a type of object identifier used to determine the interactive object to which a downstream message is targeted. In stream order verification, slots, along with the interface, stream key, and stream sequence number, are used to verify whether a message corresponds to the current stream. In state reduction path processing, slots, along with the interface, stream key, stream sequence number, and update mode, are used to determine the message's position in the current page's state machine.
[0118] A complete snapshot refers to an update that fully expresses the current content of an interactive object, such as providing the complete text for the same block of dialogue text. In semantic merging, if a new message for the same block identifier carries a complete text snapshot, the incremental and / or old snapshots of that block identifier are deleted from the staging queue, and the complete text snapshot is retained.
[0119] Incremental appending refers to updates that only express relative changes, such as adding semantic increments to the same block of dialogue text. In semantic merging, if the tail message and the new message both contain semantic increments of the same identifier and belong to the same interface, content type, and update semantics, then the two semantic increments are merged into one increment.
[0120] A patch is an update that makes partial modifications to an interactive object. Patching is one of the update patterns. Patches with different block identifiers, different interfaces, different content types, different business operations, or whose semantic merging cannot be proven are not merged, but are temporarily stored as independent queue elements.
[0121] Clearing refers to updating interactive objects by removing them. Clearing is one of the update modes. In stream sequencing, clearing, replacement, appending, and patching are all applied according to a unified state machine.
[0122] In some embodiments, the semantic merging includes: If a new message for the same identifier carries a semantic snapshot, then delete the incremental and / or old snapshots of that identifier in the temporary queue, and retain the semantic snapshot. If both the tail message and the new message contain only the semantic increment of the same identifier, and belong to the same interface, content type, and update semantics, then the two semantic increments will be merged into one increment.
[0123] Specifically, an old snapshot refers to an update in the staging queue that was received earlier for the same identifier and that fully expresses the content of an interaction object. Old snapshots correspond to semantic snapshots. When a new message for the same identifier carries a semantic snapshot, the old snapshot is replaced by the new snapshot; that is, the old snapshot for that identifier is deleted from the staging queue, and only the newly received semantic snapshot is retained.
[0124] The tail message refers to the message at the end of the temporary queue, i.e., the most recently temporary message. In semantic merging, it's determined whether the tail message and the new message both contain only the same semantic increment, and whether they belong to the same interface, content type, and update semantics. If these conditions are met, the two semantic increments are merged into one.
[0125] A semantic increment (textDelta) refers to an update that only expresses a relative change, such as appending text content to the same block of dialogue text. Semantic increments correspond to semantic snapshots: a semantic snapshot can fully express the current content of an interactive object, while a semantic increment only expresses relative changes. In semantic merging, if both the tail message and the new message contain only the same semantic increment, and belong to the same interface, content type, and update semantics, then the two semantic increments are merged into one increment.
[0126] The "surface" refers to the type of interactive interface the message targets, such as a dialog interface. In semantic merging, determining whether the tail message and the new message belong to the same surface is one of the conditions for whether to perform incremental merging. Updates from different surfaces are not merged.
[0127] Content type refers to the type of content carried by the message, such as text, list, progress, task status, etc. In semantic merging, determining whether the tail message and the new message belong to the same content type is one of the conditions for whether to perform incremental merging. Updates of different content types are not merged.
[0128] Update semantics refers to the semantics expressed when a message updates an interaction object, such as appending, replacing, patching, and clearing. In semantic merging, determining whether the tail message and the new message belong to the same update semantics is one of the conditions for whether to perform incremental merging. Updates with different update semantics are not merged.
[0129] A semantic snapshot refers to an update that fully expresses the current content of a block of dialogue text, such as providing the complete text for the same block. When a new message carrying a semantic snapshot is sent to the same block identifier, the incremental and / or old snapshots of that block identifier are deleted from the temporary queue, and the semantic snapshot is retained. A complete text snapshot is a specific form of a complete snapshot in a text context.
[0130] In some embodiments, the locally configured identity also has a determined failure state; the method further includes: when the locally configured identity is in a determined failure state, rejecting the downlink message from entering the bounded semantic storage. Thus, by introducing a determined failure state and treating it differently from the loading state, rejecting downlink messages from entering the bounded semantic storage when the locally configured identity is determined to fail, the method implements the failure closure principle (refusing to apply or send when the identity is missing, failed, conflicting, or changed, instead of using the old identity, placeholder identity, or unrestricted degradation), fulfilling the key invariant that "failed cannot be stored," avoiding infinite waiting in the storage queue or subsequent error recovery, and complementing the storage in the loading state, providing a triggering basis for subsequent failure processes, thereby ensuring that the terminal will not use the old identity, placeholder identity, or perform unrestricted degradation processing when the configuration clearly fails.
[0131] In some embodiments, the method further includes: after establishing the current interaction session boundary and updating the session generation, initiating an asynchronous identity resolution task, wherein the asynchronous identity resolution task carries the accepted business session identifier, runtime session identifier, and session generation at the time of initiation. This decouples identity resolution from message processing, avoiding blocking message reception; by carrying the accepted business session identifier, runtime session identifier, and session generation at the time of initiation, a comparison benchmark is provided for subsequent consistency verification; the session generation solves ABA-type problems that cannot be solved by comparing only session identifiers; and it provides a premise for the subsequent "reject establishing the current session identity if any condition changes," thereby ensuring that the asynchronous identity resolution result is only adopted when the session and generation remain unchanged, preventing the old identity from being reinstalled in the new runtime.
[0132] In some embodiments, after the locally configured identity transitions to a ready state, establishing the current session identity based on the locally configured identity, the actual routing context, and the unchanged session generation includes: Read the local configuration identity and the actual routing context; Verify whether the robot identifier in the actual routing context is consistent with the robot identifier in the locally configured identity; Verify whether the currently accepted service session identifier is consistent with the accepted service session identifier carried by the asynchronous identity resolution task; Verify whether the current runtime session identifier is consistent with the runtime session identifier carried by the asynchronous identity resolution task; Verify whether the current session generation is consistent with the session generation carried by the asynchronous identity resolution task; If all the above verifications pass, the current session identity is established, and the local configuration identity, actual routing context, accepted service session identifier, runtime session identifier, and session generation are used as the current session identity metadata. If any of the above verifications fails, the current session identity will be refused.
[0133] In this way, by verifying the consistency between the actual routing context and the locally configured identity, it is ensured that the actual source of the message and the terminal should be consistent; by verifying the consistency between the currently accepted business session identifier, runtime session identifier, and session generation and the values carried by the asynchronous task, it is ensured that the asynchronous resolution result is still applicable to the current session, and the ABA-type problem that cannot be solved by comparing only the session identifier is resolved; the current session identity is established only after multiple verifications pass, ensuring that the session identity is established on the basis of consistency of multiple facts; and by forming the current session identity metadata, a comparison benchmark is provided for subsequent identity verification. This avoids the asynchronous identity resolution result being incorrectly installed when the session has changed, the generation has been changed, or the routing is inconsistent, reducing the risk of old identities being reinstalled in new runtime environments.
[0134] In some embodiments, if the entry verification passes and the downlink message belongs to the current interaction session boundary, the method further includes: if the local configured identity is in a ready state, then performing identity verification, flow sequence verification, and state reduction on the downlink message.
[0135] like Figure 4 As shown, in some embodiments, the step of performing identity verification, stream order verification, and state reduction path processing on the temporarily stored messages in the order of receipt for semantically secure replay includes: S61. Take a temporary message from the head of the temporary queue and perform the same identity verification, stream order verification and state reduction as the real-time downlink message on the temporary message to perform semantic security replay. S62. Set an emptying flag. New messages from the same session that arrive during playback are appended to the end of the temporary queue until the temporary queue is empty, at which point the emptying flag is canceled. S63. If the local configuration identity changes during the replay process, then subsequent temporary messages will be rejected and the remaining temporary queue will be cleared.
[0136] Specifically, by retrieving the same verification path as the real-time message from the head of the queue and re-entering it, the replay process ensures that it does not bypass the regular verification boundaries. By setting an empty flag and appending it to the tail of the queue, the process ensures that new messages during replay do not exceed the temporarily stored messages that have not yet been replayed. By combining the empty flag with the queue empty check, the process achieves a smooth switch between real-time processing and replay processing. By detecting changes in local configuration identity during replay and rejecting subsequent temporarily stored messages and clearing the remaining temporarily stored queue, the process achieves replay interruption and failure protection. By performing the same identity verification, stream order verification, and state reduction as the real-time downlink message, the process ensures that the replay path is consistent with the real-time path in terms of rules. This enables semantically secure replay after identity convergence, avoiding semantic out-of-order delivery and cross-identity pollution.
[0137] In some embodiments, the identity verification includes: Verify whether the local configuration identity is in a ready state, and whether the robot identifier, store identifier, and display device identifier in the local configuration identity are currently valid values and not placeholder values; Verify whether the actual subscribed robot identifier in the actual routing context matches the robot identifier in the locally configured identity; Verify whether the robot identifier and terminal installation session identifier in the message channel metadata are consistent with the current session identity metadata; Verify whether the session identifier of the downlink message or temporary message is equal to the accepted service session identifier and the runtime session identifier; Verify whether the session generation carried by the asynchronous identity resolution task or the sending task is the current session generation; Verify whether the robot identifier, store identifier, and display device identifier in the message envelope are consistent with the current session identity metadata; Verify that the request identifier and message identifier in the message envelope exist; If all the above checks pass, then subsequent flow sequence checks and state reduction path processing are performed on the downlink message or temporary message.
[0138] In this way, a multi-layered identity chain is formed through identity validity verification, actual route consistency verification, message channel metadata consistency verification, current session identity metadata consistency verification, business session identifier consistency verification, session generation verification, message envelope identity verification, and request identifier and message identifier existence verification. Only when all the above verifications pass will subsequent flow sequence verification and state reduction path processing be performed on downlink messages or temporary messages, thereby ensuring that the message is consistent with the current session identity at the configuration layer, routing layer, installation instance layer, business session layer, and message envelope layer, and preventing messages with inconsistent identities at any layer from changing the page state.
[0139] like Figure 5 As shown, in some embodiments, after the identity verification is passed, the stream sequence verification includes: S611. Verify whether the interface, slot, stream key, and stream sequence number of the downlink message or temporary message correspond to the current stream; S612. If the above verification passes, the downlink message or temporary message is processed according to the update mode of the unified state machine, which includes replacement, appending, patching and clearing.
[0140] Specifically, by verifying the interface, slots, stream keys, and stream sequence numbers, it is ensured that the message corresponds to the current stream; by processing the update mode according to the unified state machine, it is ensured that replacement, appending, patching, and clearing are applied according to unified rules; it provides the premise of semantic flow layer for subsequent state reduction path processing; and it prevents semantic out-of-order generation when temporarily stored messages are replayed, thereby ensuring that the message, based on the trustworthiness of its identity, further enters the state reduction in an orderly and consistent manner at the semantic flow layer.
[0141] like Figure 6 As shown, in some embodiments, after the flow sequence verification passes, the state reduction path processing includes: S613. Determine the position of the downlink message or temporary message in the current page state machine based on the interface, slot, stream key, stream sequence number and update mode of the downlink message or temporary message. S614. Update the page state corresponding to the determined position according to the determined position and the update mode.
[0142] Specifically, precise positioning is achieved by determining the message's position in the current page's state machine based on the interface, slot, stream key, stream sequence number, and update mode; deterministic state updates are achieved by updating the corresponding page state according to the determined position and update mode; the key invariant of "playback without directly writing to the UI (human-computer interaction interface)" is implemented; and the real-time path and playback path are ensured to be consistent in terms of state update rules. Thus, based on trusted identity and correct stream sequence, the complete processing from message reception to page state update is completed, ensuring that the final page state is consistent with the case without temporary storage.
[0143] In some embodiments, the method further includes: invalidating the current interaction session and its temporary storage that were established before the change or failure when the local configuration identity changes or fails to be determined.
[0144] Specifically, when the locally configured identity changes, the old session is terminated promptly to prevent the old identity from continuing to affect the new state; when identity configuration fails, invalidation is performed to avoid using the old or placeholder identity; by invalidating the old session and its temporary storage, old downlink messages are blocked from entering the new state; a clean starting state is provided for the establishment of subsequent new sessions, thus ensuring that the old session and its temporary storage will not pollute the new state when binding switchover or configuration failure occurs, achieving the downlink direction in bidirectional failure protection. Bidirectional failure protection means that during binding switchover, downlink messages of the old identity are simultaneously prevented from entering the new state, and queued uplink actions of the old identity are prevented from being sent from the new route.
[0145] In some embodiments, invalidating the current interactive session and its temporary storage established before the change or failure includes: Record the current session identifier as the expired session identifier; After recording the failed session identifier, increment the session generation and clear the accepted service session identifier, runtime session identifier, session identity metadata, and active route snapshot; After incrementing the session generation, clear the semantic temporary queue and reset the workbench page state; After recording the failed session identifier, the page is refused to be recreated with the same failed session identifier.
[0146] Specifically, by recording the failed session identifier, a comparison basis is provided for subsequently rejecting the re-creation of pages for the same failed session; by incrementing the session generation, the previous session becomes invalid relative to the current session, and asynchronous tasks are prevented from reinstalling the old identity; by clearing the accepted business session identifier, runtime session identifier, session identity metadata, and active route snapshot, the old identity becomes unusable; by clearing the semantic temporary queue, the temporary messages of the old session are prevented from being replayed later; by resetting the workbench page state, the page state of the old session is no longer left; by the sequence of each operation, a logically inseparable failure process is formed; and a failed session barrier is formed, so that when binding switching or configuration fails, the old session and its temporary messages are completely invalidated, avoiding the old identity, old temporary messages, and old page state from polluting the new state.
[0147] In some embodiments, the method further includes: When the robot's identifier changes, unsubscribe from the old robot theme and subscribe to the new robot theme corresponding to the changed robot identifier; If the robot identifier remains unchanged while the store identifier or display device identifier changes, the currently subscribed robot theme will remain unchanged, and if the locally configured identity changes, the current interactive session and its temporary storage will be invalidated.
[0148] Specifically, when the robot identifier changes, the message routing is made to correspond to the changed robot identifier by switching the robot topic, reducing obvious routing errors. When the robot identifier remains unchanged but the store identifier or display device identifier changes, the current interaction session and its temporary storage are invalidated while keeping the topic unchanged. This overcomes the defect of the topic-only solution that misses changes in store or display device when the robot identifier remains unchanged, and covers the scenario of "same topic, different business affiliation". In conjunction with the aforementioned invalidation handling, the old session and its temporary storage are completely invalidated and cannot be reactivated, so that the binding switching processing does not depend on the inevitable change of topic, improving the completeness of the binding switching scenario coverage.
[0149] In some embodiments, the method further includes: When creating an up action such as a touch operation, query request, shopping cart action, or action result confirmation, capture the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context, generate a request identifier, and construct a task to be sent. Before actually executing asynchronous transmission, read again the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context; The captured accepted service session identifier, runtime session identifier, session generation, and local configuration identity are compared with the currently accepted service session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context, respectively. The captured actual routing context is then compared with the current actual routing context at the time of transmission. If the above comparison results are consistent, then the above action is sent; If there is an inconsistency in the above comparison results, the up action will be rejected and the task to be sent will be marked as invalid.
[0150] Specifically, by capturing the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context during action creation, a comparison benchmark is provided for pre-send verification. By reading and comparing again before sending, it prevents uplink actions from being sent with the old identity after binding switch. By comparing the actual routing context at two points in time, it prevents old uplink actions from using the new route for sending. By sending if consistent and rejecting and marking as invalid if inconsistent, a complete sending decision closed loop is formed to avoid old uplink actions being incorrectly resent. By cooperating with downlink failure protection, bidirectional failure protection is formed. By not rewriting old requests into new robot or new store requests, identity cross-line is avoided, thus achieving symmetrical failure protection in the uplink direction and the downlink direction, ensuring consistency of uplink and downlink identities during binding switch, which is especially suitable for fixed-screen terminals involving shopping carts, orders, payments, or robot tasks.
[0151] In some embodiments, the terminal installation session identifier is generated and persistently stored when the terminal is installed or reinstalled; the terminal installation session identifier is sent to the peer with the session ready response so that subsequent downlink messages can restore the complete terminal installation session identifier verification.
[0152] Specifically, a terminal installation session identifier is generated and persistently saved during terminal installation or reinstallation to ensure that different installation or reinstallation instances on the same robot can be stably distinguished. The terminal installation session identifier is sent to the peer with the session ready response, so that the peer knows the local installation session identifier and provides conditions for subsequent downlink message restoration of complete verification. In conjunction with the aforementioned exception that allows the default terminal installation session identifier in the wake-up first packet, it avoids startup handshake deadlock and prevents the first packet exception from expanding to general unidentified reception, thereby ensuring that a session can be established during the startup phase while enabling subsequent messages to restore complete terminal installation session identifier verification.
[0153] In some embodiments, the local configuration identity may further include at least one of a tenant identifier, a site identifier, a device certificate identifier, or a bound version.
[0154] Specifically, by expanding the multi-dimensional group of locally configured identities, the granularity of identity descriptions is improved; by adding comparison dimensions such as tenant identifiers, site identifiers, device certificate identifiers, or binding versions, the probability of identity confusion in multi-tenant, multi-site, multi-device certificate, or multi-binding version scenarios is reduced; by expanding identity fields, the detection sensitivity of binding switching and configuration changes is improved, covering more granular changes; and the solution supports expansion to non-robot fixed screen scenarios such as hospital self-service terminals, warehouse workstations, vehicle-mounted fixed screens, store digital human terminals, or industrial control panels, thereby enhancing the constraint capability of multi-layer identity chains and further reducing the probability of cross-identity contamination.
[0155] To better understand the present invention, the message processing method provided by the present invention will be described in detail below through specific embodiments.
[0156] The message processing method provided in this embodiment aims to solve the following technical problem: When binding configurations, route subscriptions, and business messages arrive asynchronously, how can we avoid using old configurations, placeholder configurations, or message self-reporting identities as the current authoritative identity? How to jointly verify the configuration identity, actual routing identity, terminal installation session, business session, message envelope identity, and semantic stream identity to prevent inconsistent messages from any layer from entering the current interface state; When the first trusted wake-up has arrived but the bound identity is not yet ready, how can we temporarily store necessary messages while avoiding the temporary storage of any old sessions or illegal messages? How to compress streaming semantics in a bounded queue to prevent a large number of increments from exhausting the capacity without destroying the final visible content; How to ensure the global order of replay messages and new messages arriving during replay, and ensure that each replay message is re-verified and its state reduced; How to simultaneously clear the old downlink state and block the old uplink tasks when binding switches, binding fails, or routes change, thus forming a two-way failure protection.
[0157] The method provided in this embodiment involves the terminal maintaining its configuration identity, actual routing identity, terminal installation session, accepted service session, session generation, message envelope identity, and semantic stream state. Before a message enters the service state, it verifies the transmission attachments and required envelope fields, and then selects rejection, semantic storage, or normal application based on the current binding state. After binding is complete, the terminal performs joint resolution of the configuration identity, the current actual routing identity, and the still valid session generation. Only after successful resolution is the message replayed in sequence. Replay does not directly restore the UI, but rather re-enters the identity verification, stream verification, and Reducer (reducer / reduction function) state reduction chain.
[0158] When the configured identity changes, binding fails to load, the actual route is inconsistent with the configured robot, or the session generation has changed, the terminal invalidates the old session, clears its temporary queue and workbench state, and refuses to reactivate the same invalidated session. The up-action verifies the identity at both the creation and actual sending points, and compares the route identity captured at creation with the current route identity at sending, thereby preventing the old action from borrowing the new route.
[0159] The fixed-screen terminal implementing the present invention includes at least the following logic modules: The snapshot module is bound to obtain fields such as robot, store and display device from persistent configuration or configuration service, form configuration snapshots in an atomic manner, and output the loading, ready or failed status.
[0160] The route subscription module establishes or switches subscriptions based on the current route identity; receives native attachments provided by the message channel; cancels old subscriptions when the route changes, and provides reconfirmation of the current route for the publish action.
[0161] The transmission attachment verification module verifies the protocol identifier, robot identifier, terminal installation session, and message source; it also restricts the message types allowed by the default installation session.
[0162] The session boundary module accepts trusted wake-up calls to form business sessions, records accepted sessions, runtime sessions, and session generations, and prevents invalid sessions from re-entering.
[0163] The envelope identity verification module verifies the required fields such as requestId, messageId, sessionId, robotCode, storeId, and displayDeviceId, and their relationship with the current identity.
[0164] The semantic storage module only stores messages that are consistent with the accepted session and have passed basic verification. It performs semantic compression based on the interaction object, update mode, and adjacency relationship, and executes the capacity limit.
[0165] The identity resolution module, after configuration is complete, jointly reads the configured identity, the actual route identity, the business session, and the session generation to generate non-mismatchable identity metadata for the current session.
[0166] The sequential replay module maintains the replay marker during the emptying process; the old queue is re-entered into the normal processing chain in order, and new messages continue to be appended to the tail of the queue to avoid overrunning.
[0167] The state reduction module performs semantic flow validations such as surface, slot, streamKey, streamSeq, and updateMode, and updates the page state in a deterministic manner.
[0168] The bidirectional transmission protection module captures the configuration identity, session generation, and routing identity when the uplink action is created; it re-compares the current values before actual transmission, and refuses to send if they are inconsistent.
[0169] This invention does not require all identity chain implementations to use exactly the same fields, but it does require at least layered processing of local authority configuration, message channel facts, and business semantic boundaries. An identity hierarchy of a preferred embodiment is shown in Table 1 below: Table 1: Identity Hierarchy
[0170] The aforementioned identity chain is not simply a matter of concatenating multiple fields into a single string. Each layer corresponds to a different source of fact and a point of expiration: the configuration identity specifies who the terminal should belong to, the routing identity specifies where the message actually enters or is sent from, the business session specifies which round the current interaction belongs to, and the semantic flow identity specifies the sequence of messages within the current page's state machine. Only when all these constraints are simultaneously met during use can a message be eligible to change its state or trigger external actions. Figure 7 This embodiment illustrates the multi-layered identity chain and state application architecture provided.
[0171] The snapshot binding module outputs at least three states: Loading, Ready, and Failed. Loading indicates that the configuration has not yet reached an authoritative conclusion, and the previous configuration should not be used to impersonate the current configuration; Ready indicates that the required binding fields have been committed with the same atomic snapshot and meet the validity conditions; Failed indicates that a reliable identity cannot be established in this round of loading.
[0172] When the state transitions from Loading to Ready, the terminal compares the newly configured identity with the currently active configured identity. If there is no active configuration, identity resolution is initiated; if they match, the current session is allowed to continue; if they differ, the current session is immediately invalidated, and the session's identity metadata, temporary messages, and page runtime state are cleared. Invalidation and shutdown are also performed when the binding state becomes Failed, instead of continuing to use the historical identity.
[0173] Snapshot configurations should ideally write fields such as robot, store, device, and update time simultaneously in a single transaction or atomic edit to avoid reading fragmented combinations of "new robot + old store." The update time can be used to determine if a snapshot is complete, but it doesn't need to be a mandatory comparison field for binding identity plurals. Figure 8 The safe convergence process during binding switching is illustrated.
[0174] Trusted wake-up and restricted installation session default exceptions. The terminal verifies the protocol identifier, robot identifier, terminal installation session, and source identifier at the transmission entry point. Typically, messages lacking a terminal installation session or inconsistent with the local installation session are rejected. Considering that the first wake-up message of a new service session may be known to the peer earlier than the local installation session, this embodiment allows for a narrow exception to predefined session initiation messages: only session status messages of type wake can omit padSessionId.
[0175] This exception does not bypass protocol, robot, and origin verification, nor does it apply to page updates, action results, or other business messages. After accepting this trusted wake-up call, the terminal establishes a minimal business session boundary and can notify the terminal to install the session via responses such as `session_ready` (a status flag / event name indicating that the session has been initialized), allowing subsequent messages to resume full attachment verification. This avoids both initiating a handshake deadlock and preventing the "first packet exception" from being extended to universal unidentified reception.
[0176] Session generation and asynchronous identity resolution. When accepting a new trusted business session, the terminal records the acceptedSessionId (accepted session identifier), initializes the runtime session, increments or replaces the sessionGeneration (session generation), and clears the temporary content of the previous session. Then, asynchronous identity resolution is initiated. In addition to the sessionId, the identity resolution task also carries its generation at startup.
[0177] After the asynchronous task obtains the configuration identity and the actual routing identity, it does not immediately install the result. Instead, it re-verifies that: the current acceptedSessionId is still equal to the task session, the current runtime session is still equal to the task session, the current generation is still equal to the task generation, the current configuration identity is still equal to the read configuration identity, and the actual routing robot is still consistent with the configuration robot. Any change in any of these conditions will invalidate the resolution result.
[0178] Session generation solves the ABA-like problem that can still occur even when comparing only sessionId. For example, if an old asynchronous task arrives late after the session has been cleared, even if an external system mistakenly reuses the same sessionId, the task's generation will be different from the current generation, and the old identity cannot be reinstalled in the new runtime.
[0179] The hierarchical processing flow for downlink messages. When a downlink message arrives, it is preferably processed in the following order. The order itself constitutes a security boundary: only after low-cost, binding-independent basic checks pass can the message be temporarily stored; after the binding identity is complete, a strict comparison requiring the current identity is then performed. Figure 9 The hierarchical processing flow of downlink messages is illustrated. For example... Figure 9 As shown: S101: Obtain the original payload and native attachments that cannot be replaced by the service payload from the message channel, and verify the protocol, source, routing robot, and terminal installation session; only allow limited defaults for the preset wake-up first packet.
[0180] S102. Parse the message envelope and verify the required fields and field types, such as message type, protocol version / protocol identifier, request identifier, message identifier, session identifier, robot identifier, and store identifier; unqualified messages shall not be allowed to enter the temporary storage.
[0181] S103. Determine whether the message belongs to the currently accepted service session and the currently running session. Messages from other sessions, expired sessions, or sessions without trusted session boundaries are rejected directly.
[0182] S104. If the binding is in the loading state, the current session identity resolution has not been completed, or the system is emptying the temporary queue of the session, then the semantic temporary storage judgment is entered; the binding failure state does not enter the temporary storage.
[0183] S105. Perform semantic compression based on the interface, block identifier, content type, update mode, and queue tail relationship; if the compression still exceeds the capacity limit, reject new messages and record a clear reason, without fabricating missing content.
[0184] S106. If temporary storage is not required, read the current session identity metadata and compare the business session, configuration robot, store, optional display device and actual routing context.
[0185] S107. After the identity chain verification is successful, the message is handed over to the normal operation to continue executing the stream key, stream sequence number, update mode, idempotent deduplication, and reducer state reduction.
[0186] S108. If any identity layer or semantic flow layer verification fails, the application will be rejected, and de-identified diagnostic information containing the session, message, and reason for rejection will be output.
[0187] The above process ensures that temporary storage is not a bypass for identity verification. The message format and minimum session ownership are confirmed before temporary storage, and full identity and semantic flow verification are performed during playback.
[0188] Semantic queuing eligibility. A message can only be queued if all of the following conditions are met simultaneously: an accepted session exists; the message's sessionId equals both the accepted session and the runtime session; the binding status is not ready rather than explicitly failed, or the current queue is being emptied for the same session; the message's required fields and underlying protocol validations have passed; and the message has not been marked as originating from an expired session.
[0189] The eligibility for temporary storage differs from "message is eventually applicable." Temporary storage only indicates that the message is worth retaining while its identity is temporarily unknown; it does not guarantee approval once the binding is complete. During replay, if the robot, store, display device, message sequence, or update pattern is found to be inconsistent with the current state, the message should still be rejected. Figure 10 It demonstrates the complete process from trusted wake-up, semantic storage, identity resolution to normal playback.
[0190] Semantic-preserving bounded compression. To preserve the semantics of the streaming interface within a fixed capacity, this embodiment does not blindly discard bytes or messages, but instead identifies updates to interactive objects that can be safely merged. A preferred embodiment applies the following rules to a single message block on the conversation surface: Rule A – Full Snapshot Overwrite: When a new message with the same blockId carries a full text snapshot, delete the previous incremental or old snapshots of that blockId in the queue, and only retain the new snapshot that can represent the current full content.
[0191] Rule B – Merging Adjacent Increments: When both the tail message and the new message contain only textDelta with the same blockId, and belong to the same surface, content type, and update semantics, the two increments are concatenated into an equivalent increment.
[0192] Rule C – Cross-object merging is prohibited: Patches with different blockIds, different surfaces, different content types, different business operations, or those that cannot be proven to be equivalent should not be merged.
[0193] Rule D – Capacity Failure Shutdown: If the queue still reaches its limit after provably safe compression, reject new messages and mark buffer_full. Do not delete old messages that cannot be proven to be recoverable, and do not generate business compensation results on your own.
[0194] For example, 80 consecutive adjacent textDelta values belonging to the same text block can be merged into fewer queue elements, still resulting in identical text upon replay; if a complete snapshot of that text block is subsequently reached, the previous increments can be replaced by the snapshot. Conversely, updates to add-to-cart results, payment results, or different dialog blocks cannot be merged simply because of queue congestion. Figure 11 The process of snapshot replacement and adjacent incremental merging is shown.
[0195] Semantic security replay after identity is ready. After configuration enters Ready state, the identity resolution module reads the currently configured identity and the actual routing identity of the message port, verifies that the routing robot is consistent with the configured robot, and installs session identity metadata assuming that the session and generation have not changed. Subsequently, the sequential replay module sets the flushing flag and begins flushing.
[0196] During emptying, one message is retrieved from the head of the queue each time, and the same processing entry point as for real-time messages is invoked, but branches temporarily stored due to incomplete binding are closed. The message still needs to undergo validation by the current session, configured identity, envelope identity, stream order, and Reducer. If the binding changes again during replay, the normal processing entry point will reject subsequent messages, and the failed process will simultaneously clear the remaining queue.
[0197] The flushing flag is also used to resolve concurrency issues during replay. When the queue is not completely empty, newly arriving messages from the same session do not immediately enter the state machine; instead, they are appended to the tail of the queue. This prevents new messages from overriding previously received but not yet replayed messages. The flushing flag is only removed after the queue is confirmed to be empty, and subsequent messages resume real-time processing. Figure 12 The order guarantee is shown.
[0198] Binding switch and invalidation session barriers. When the new configured identity differs from the active configured identity, the terminal executes an atomic or logically inseparable invalidation process: record the current sessionId as configurationInvalidatedSessionId (the session ID invalidated due to configuration change); clear acceptedSessionId, runtime session, session identity metadata, and active route snapshot; increment the session generation; clear the semantic temporary queue; and reset the workbench page state.
[0199] After a session fails, messages from the same failed sessionId, even if correctly formatted, cannot recreate the page. A new session can only begin if a new trusted wakeup has a different session boundary than the failed session. This barrier prevents the old session from being reactivated by retransmissions or delayed messages from the old DM (Session Management) after a configuration switch.
[0200] When a robot's identifier changes, the routing subscription module cancels the old robot topic and subscribes to the new robot topic through a cancelable latest value subscription mechanism. When only the store or display device changes while the robot's identifier remains the same, the topic can remain unchanged, but the configuration identity change will still trigger the aforementioned session invalidation, thus covering the situation of "same topic, different business affiliation".
[0201] Dual-time identity verification for uplink messages. Uplink messages such as touch operations, Golden Query (standard question), shopping cart actions, and action result confirmations are also affected by binding switching. In this embodiment, when an action is created, the current acceptedSessionId, runtime sessionId, sessionGeneration, configured identity, and route identity are obtained to generate a requestId and construct the task to be sent. Before actually executing asynchronous sending, the current values are read again and compared.
[0202] The task only enters the message port if the session, generation, configured identity, and captured route remain unchanged. The message port also compares the captured route identity with the actual route identity at the time of sending. Any inconsistency is rejected for reasons such as stale_session (old session), identity_changed (identity changed), or routing_identity_changed (route identity changed), and the old request is not rewritten as a new robot or new store request.
[0203] For non-idempotent actions such as placing orders, making payments, and adding items to cart, recovery after rejection should not automatically create a new requestId and resend the request. Whether to retry should be determined by re-initiating the new session and should comply with business idempotency rules. Figure 13This demonstrates the bidirectional failure protection consisting of downlink and uplink.
[0204] In summary, the above modules, such as Figure 14 As shown, the method in this embodiment can be summarized as follows: S201. Establish and persist the installation session on this terminal, and monitor the binding snapshot status and the actual message routing status.
[0205] S202. Receive the native attachments and service payloads of the message channel, and first perform attachment verification and required field verification.
[0206] S203. Establish minimum service session boundaries and new session generations for trusted wake-up; only this initiation message can install sessions by default according to preset rules.
[0207] S204. During the binding not ready period, only messages from the same accepted session that have passed the basic verification are sent to the semantic storage module.
[0208] S205. Maintain bounded queues according to the rules of full snapshot overwrite, incremental merging of adjacent objects, prohibition of cross-object merging, and capacity failure shutdown.
[0209] S206. After binding is complete, resolve session identity metadata by combining the currently configured identity, the actual route identity, the business session, and the session generation.
[0210] S207. Set an empty flag and resend the temporarily stored messages into the complete identity verification and state reduction chain in the order of receipt; new messages during the emptying period are appended to the end of the queue.
[0211] S208. When the binding identity changes or fails, invalidate the old session and clear the identity metadata, temporary queue, and interface runtime. Reject the reconstruction of the same invalidated session.
[0212] S209. Save the configuration identity, routing identity, session and generation at the time of creation for the above action, and compare it with the current value before actual transmission. If they are inconsistent, reject the action.
[0213] S210. Record auditable reason codes for all rejection, temporary storage, compression, playback, and invalidation results, and desensitize sensitive fields.
[0214] The key invariants in this embodiment are shown in Table 2 below.
[0215] Table 2: Key Invariants
[0216] The following are several specific embodiments of each stage of the method of the present invention.
[0217] Example 1: During a cold start, the system first receives a wake-up message and a streaming text message.
[0218] After a cold start of the terminal, the bound snapshot is in Loading mode. The message port receives a wake message from the current robot route with correct source, protocol, and robot attachments. Since the peer has not yet obtained the local padSessionId, this field is left blank. The terminal accepts the wake message according to the restricted exception, establishes session-A and generation-1, but does not fabricate a store or display the device identity.
[0219] The continuous streaming text then arrives at session-A. Each frame first passes the required envelope field verification, and then enters semantic buffering due to unresolved identity. 80 adjacent textDeltas belonging to the same block are merged; if a complete text snapshot is reached midway, the increments before that block are deleted. After binding to Ready, the configured bot matches the actual routed bot, and session-A and generation-1 remain unchanged, indicating successful identity metadata installation. The queue is re-entered into the Reducer in order, and the final text is completely identical to the version without buffering.
[0220] Example 2: Switching from binding A to binding B during an active session
[0221] The original terminal was configured with identities (robot-A, store-A, display-A), and the active session was session-A. The configuration service atomically committed a new snapshot (robot-B, store-B, display-B). The configuration observation module detected the identity difference, immediately marked session-A as invalid due to the configuration change, cleared its runtime and queue, and added a session generation. The routing subscription module revoked the robot-A topic and subscribed to the robot-B topic.
[0222] Subsequently, even if a session-A message arrives late in the old subscription buffer, at least one layer of the transmission attachment, bot, or expired session barrier will reject it. If an upaction has been created but not yet sent before the switch, and a pre-send check reveals a change in configuration identity, routing identity, or generation, the posting will also be rejected. New bindings must establish a different session via a new trusted wake before interaction can resume.
[0223] Example 3: The robot remains the same, but the store or display device changes.
[0224] The configuration is switched from (robot-A, store-A, display-A) to (robot-A, store-B, display-B). Since the robotCode remains unchanged, the transmission topic can remain the same; however, the configuration identity tuple has changed, and the active session is still invalidated. Even if old messages pass robot-level topic and attachment validation, they will be rejected at the envelope storeId, displayDeviceId, or invalid session checkpoints. This example illustrates that the protection of this invention does not depend on the inevitable change of the topic.
[0225] Example 4: New message arrives during playback
[0226] The terminal begins flushing messages M1, M2, and M3. After M1 is applied, the real-time channel reaches M4. Since flushing is true, M4 does not directly enter the Reducer but is appended to the end of the queue. The processing order remains M1, M2, M3, M4. If M2 triggers a binding failure, M3 and M4 are removed from the queue and will not be applied under the new identity.
[0227] Example 5: The queue is full and messages cannot be safely merged.
[0228] If the queue reaches its set limit, and a new message belongs to a different surface or block and does not have a complete snapshot overwrite relationship, the terminal rejects the message and records `binding_downlink_buffer_full`. The terminal does not delete an irrecoverable payment result, does not concatenate different product operations, and does not construct a false compensation frame. After identity is restored, existing messages are processed according to normal rules, and missing business results are resynchronized by the authoritative business party, rather than being guessed by the fixed screen.
[0229] Example 6: Scalable to non-robot fixed screens
[0230] This method can also be used in hospital self-service terminals, warehouse workstations, vehicle-mounted fixed screens, store digital human terminals, or industrial control panels. By replacing robot identifiers, store identifiers, and display device identifiers with device, site, workstation, vehicle, or tenant identities, the combination of configuration snapshots, routing facts, business sessions, generations, semantic caching, and two-way failover protection can still be used.
[0231] The message processing method provided in this invention does not rely on the page-level multimodal consistency between the page instance number and the revision, nor on the state fingerprint verification of a visible object after streaming interface rendering. Its core lies in controlling which messages are eligible for temporary storage, how they are replayed after identity convergence, and how old uplink and downlink messages simultaneously become invalid during the time window when the bound identity is uncertain or switching. These three methods can be used in conjunction, but they each address different technical problems, verify different objects, and take effect at different times. Compared to existing solutions, it has at least the following differences: Regarding the source of identity, the solution that only switches topics usually only has robot routing; the original FIFO (first-in, first-out) caching solution does not limit the source of identity; the solution that only verifies the payload field relies on the message self-reporting field; while the embodiment of this invention uses configuration snapshot, actual route, native attachment, session and semantic stream to jointly determine the source of identity.
[0232] Regarding changes in store / display devices, the solution of only switching topics may miss them when the robot remains unchanged; the original FIFO caching solution usually does not handle them; the solution of only verifying the payload field can be compared but lacks routing facts; the embodiment of the present invention will invalidate the session even if the topic remains unchanged when the configuration identity changes.
[0233] In the context of the in-prepared period, schemes that only switch topics discard messages or incorrectly reuse old values; the original FIFO caching scheme enqueues arbitrary messages; and schemes that only validate the payload field often fail due to missing identity. The embodiments of the present invention perform semantic temporary storage within a trusted session after basic validation.
[0234] Regarding streaming capacity, there is no processing for the Topic-only switching scheme; the original FIFO caching scheme discards entries by number or grows indefinitely; there is no processing for the payload field-only verification scheme; the embodiments of this invention adopt a strategy of snapshot overwriting, incremental merging of adjacent objects of the same type, and rejection if it cannot be proven.
[0235] Regarding replay security, the Topic-only switching scheme is not involved; the original FIFO caching scheme often directly replays or writes the state; the payload field-only verification scheme may only compare the payload again; the embodiment of the present invention re-enters the complete identity, stream order and reducer chain.
[0236] Regarding replay concurrency, the scheme that only switches topics is not involved; new messages may exceed the limit in the original FIFO caching scheme; the scheme that only verifies the payload field is not involved; in this embodiment of the invention, new messages are appended to the tail of the queue during flushing.
[0237] Regarding uplink protection, in a scheme that only switches topics, old tasks may take the new route; the original FIFO caching scheme usually has no uplink protection; the scheme that only verifies the payload field usually verifies it once at creation; the embodiment of this invention adopts dual time-point verification at creation and sending, and then checks the port to capture the route.
[0238] Regarding failure strategies, the Topic-only switching scheme depends on the connection result; the original FIFO caching scheme continues to wait or silently discards; the payload-only field verification scheme has an uncertain strategy when the field is missing; the embodiments of the present invention fail and shut down when binding fails and identity conflicts occur.
[0239] In summary, the embodiments of the present invention are superior to existing solutions such as only switching topics, original FIFO caching, and only payload field verification in terms of identity source, store / display device changes, handling during the unready period, streaming capacity, playback security, playback concurrency, uplink protection, and failure strategy.
[0240] Therefore, compared with the prior art, the message processing method provided by the embodiments of the present invention has at least the following beneficial effects: Separate the modeling of "who the terminal belongs to", "where the message actually comes from", "which interaction it belongs to", and "where it is located in the interface flow" to reduce the probability of cross-referencing where a single field is correct but the overall identity is wrong.
[0241] By using session generational constraints for asynchronous identity resolution and delayed publication, late tasks are prevented from reverting to old identities after session cleanup, reconstruction, or identity reuse.
[0242] The necessary streaming content of the trusted session is retained in the unready window to reduce blanking and jumps caused by cold starts or configuration refreshes, without reducing the strength of final identity verification.
[0243] Semantic equivalence compression improves the capacity of a fixed volume to handle high-frequency streaming text; rejection if unprovable prevents the capacity strategy from altering the semantics of the business.
[0244] By re-entering the regular processing chain during replay and queuing during emptying, we ensure that identity, flow order, idempotency, and page state machine rules are consistent in the real-time and replay paths.
[0245] With bidirectional uplink and downlink failure protection, it prevents old messages from polluting the new interface and also prevents old actions from being sent using the new binding, making it especially suitable for fixed-screen terminals involving shopping carts, orders, payments, or robot tasks.
[0246] Furthermore, in the message processing method provided in the embodiments of the present invention: The bound identity can be an ordered tuple, a structured object, a hash value of a normalized sequence, a versioned identity token, or an identity claim with a lease; the core is that it originates from the current authoritative configuration and is cross-validated with the actual route.
[0247] Session generations can be represented by monotonically increasing integers, random non-repeatable tokens, time-ordered identifiers, epochs, or combinations of binding versions and session identifiers.
[0248] Native attachments can reside in the message bus attachment, message header, transport metadata, mTLS certificate (mutual TLS certificate) mapping, trusted gateway injection fields, or other channels that cannot be modified by ordinary business payloads. Cryptographic signatures can be used as an enhancement, but are not a necessary condition for implementing this invention.
[0249] Semantic caching can be stored in an in-memory queue, a local database with session keys, or a persistent log; if a cross-process recovery is required, the configured identity, session generation, and message validity period should still be re-verified during recovery.
[0250] Queue limits can be set by number of entries, number of bytes, number of objects, time window, or a combination of quotas; regardless of the quota used, compression should be based on provable semantic equivalence.
[0251] In addition to text snapshots and increments, dedicated merging rules can be established for list replace and subsequent patches, the latest value of the same progress object, and overwriteable updates of the same task status, but non-idempotent business results must not be arbitrarily collapsed.
[0252] Route switching can be achieved through Flow flatMapLatest, Actor, event loop, subscription generation, or explicit cancellation token; the core is that the old route being closed and the current route being verified can be read by identity verification.
[0253] During the emptying process, a single-consumer queue, mutex lock, Actor mailbox, or transactional log can be used to guarantee order; the key is that new messages cannot overwrite already received and stored messages.
[0254] If the binding fails, you can also go to the manual recovery page or the read-only downgrade page, but you must not continue to perform page updates or non-idempotent up actions on the old identity.
[0255] This method can be deployed on a fixed screen local, a trusted edge gateway, or a system that combines both; as long as the current configuration facts, actual routing facts, and service session boundaries can be obtained.
[0256] Based on the same inventive concept, embodiments of the present invention also provide a message processing device.
[0257] Figure 15This is a schematic diagram of the structure of a message processing device provided in an embodiment of the present invention. Figure 15 As shown, the message processing apparatus provided in this embodiment of the invention includes: The maintenance module 21 is used to maintain the local configuration identity and its state, the actual routing context, the current interactive session boundary, and the session generation; the local configuration identity is determined by the local binding snapshot and has a loading state and a ready state; the actual routing context is provided by the currently valid transport connection or subscription; The response module 22 is used to establish the current interactive session boundary in response to the trusted session initiation signal and update the session generation; Verification module 23 is used to receive downlink messages and perform entry verification based on the message envelope and message channel metadata of the downlink messages; The temporary storage module 24 is used to perform bounded semantic temporary storage of the downlink message if the local configuration identity is in a loading state, provided that the entry verification is successful and the downlink message belongs to the boundary of the current interaction session. Module 25 is used to establish the current session identity based on the local configuration identity, the actual routing context, and the unchanged session generation after the local configuration identity is converted to the ready state. The establishment is successful only if the actual routing context is consistent with the local configuration identity and the session generation has not changed. The processing module 26 is used to perform identity verification, stream order verification, and state reduction path processing on the temporarily stored messages in the order of receipt after successful establishment, so as to perform semantic security replay.
[0258] The message processing apparatus provided in this invention maintains the locally configured identity and its state, the actual routing context, the current interaction session boundary, and the session generation. It separates and models "who the terminal belongs to," "where the message actually comes from," "which interaction it belongs to," and "its sequential relationship with the previous session," avoiding the use of a single field or a self-reported field of the service payload as the basis for identity determination. By responding to a trusted session initiation signal to establish the current interaction session boundary and update the session generation, it establishes a minimum trusted session boundary for subsequent messages and solves the ABA problem that cannot be solved by simply comparing session identifiers. Through entry verification based on message envelope and message channel metadata, it filters messages that clearly do not belong to the current terminal or have unqualified formats before entering temporary storage or identity verification. It further enables entry verification to proceed even when the locally configured identity is not determined, provided the entry verification passes and the message belongs to the current interaction session boundary. Line-bounded semantic caching preserves the necessary streaming content of a trusted session within the unready binding window (the time interval during which the terminal has received the trusted session start signal, but the configured identity is still loading, the route subscription is not yet stable, or the identity resolution is not yet complete). This reduces blanking and jumps caused by cold starts or configuration refreshes, while not reducing the final identity verification strength. After the local configured identity transitions to a ready state, the current session identity is jointly established based on the local configured identity, the actual routing context, and the unchanged session generation. This ensures that the session identity is established on the basis of multiple fact consistency, reducing the risk of old identities being reinstalled in the new runtime. After successful establishment, the caching messages are re-verified in the order of receipt for identity verification, stream order verification, and state reduction path processing for semantically secure replay. This ensures that the replay is consistent with the real-time path and avoids semantic out-of-order issues caused by new messages exceeding the caching messages during replay. The above steps work together to form a complete technical closed loop of "constrained temporary storage when identity is uncertain and secure replay after identity is determined". This ensures that during the binding of identity loading, switching, failure or recovery, it can prove that the message still belongs to the current acceptable identity chain, retain the necessary streaming semantics, and ensure that the replay after recovery does not exceed the conventional verification boundaries.
[0259] Figure 16 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, as shown below. Figure 16 As shown, the electronic device may include a processor 301, a communications interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communications interface 302, and the memory 303 communicate with each other via the communication bus 304. The processor 301 may call logical instructions in the memory 303 to execute the methods described in any of the above embodiments.
[0260] Furthermore, the logical instructions in the aforementioned memory 303 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0261] This embodiment of the invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can perform the methods provided in the above-described method embodiments.
[0262] This embodiment provides a computer-readable storage medium storing a computer program that causes the computer to perform the methods provided in the above-described method embodiments.
[0263] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0264] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0265] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0266] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0267] In the description of this specification, the references to terms such as "an embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0268] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A message processing method, characterized in that, include: Maintain the local configuration identity and its state, the actual routing context, the current interaction session boundaries, and the session generation; The local configuration identity is determined by the local bound snapshot and has a loading state and a ready state; The actual routing context is provided by the currently active transport connection or subscription; In response to the trusted session initiation signal, the current interaction session boundary is established and the session generation is updated; Receive downlink messages and perform entry verification based on the message envelope and message channel metadata of the downlink messages; If the entry verification passes and the downlink message belongs to the current interaction session boundary, and the local configuration identity is in a loading state, then the downlink message is temporarily stored with bounded semantics. After the local configured identity is transitioned to the ready state, the current session identity is established based on the local configured identity, the actual routing context, and the unchanged session generation. The establishment is successful only if the actual routing context is consistent with the local configured identity and the session generation has not changed. After successful establishment, the temporarily stored messages will be processed in the order of receipt for identity verification, stream order verification, and state reduction path processing, in order to perform semantically secure replay.
2. The method according to claim 1, characterized in that, The local configuration identity includes a robot identifier, a store identifier, and a display device identifier; the actual routing context includes an actual subscribed robot identifier and a terminal installation session identifier; the method also maintains a terminal installation session identifier, which is used to distinguish different installation instances or reinstallation instances on the same robot and is included in the message channel metadata.
3. The method according to claim 1, characterized in that, The process of establishing the current interaction session boundary in response to the trusted session initiation signal and updating the session generation includes: The service session corresponding to the trusted session initiation signal is identified as the current interaction session to establish the boundary of the current interaction session; When establishing the current interaction session boundary, the accepted service session identifier and the runtime session identifier of the service session are recorded; In response to the establishment of the current interactive session boundary, the session generation is incremented or replaced so that the previous session becomes invalid relative to the current interactive session; After a session is incremented or replaced, the semantic temporary content of the previous session is cleared. The previous session refers to the interactive session that was active before the current interactive session boundary was established.
4. The method according to claim 1, characterized in that, The entry verification based on the message envelope and message channel metadata of the downlink message includes: Verify whether the communication protocol identifier, robot identifier, terminal installation session identifier, and source identifier in the message channel metadata meet the preset requirements; wherein, for downlink messages of type wake-up and which are the first messages of the current interaction session, the terminal installation session identifier is allowed to be omitted in its message channel metadata, but the communication protocol identifier, robot identifier, and source identifier are still verified; Verify that the target field in the message envelope exists and that its field type is correct; wherein, the target field includes at least one of the following: message type, communication protocol version, request identifier, message identifier, session identifier, robot identifier, store identifier, and display device identifier.
5. The method according to claim 1 or 4, characterized in that, The method further includes: If the entry verification fails, the downlink message is rejected.
6. The method according to claim 1 or 4, characterized in that, The bounded semantic temporary storage of the downlink message includes: When the session identifier of the downlink message is consistent with the accepted service session identifier and the runtime session identifier, the downlink message and the existing messages in the temporary storage queue are semantically merged and temporarily stored according to the message object, update mode and semantic mergeability; wherein, the semantic mergeability means that after merging the downlink message and the existing messages in the temporary storage queue, the page state obtained by state reduction is the same as when it is not merged.
7. The method according to claim 6, characterized in that, The message object is determined by the object identifier in the downlink message, and the object identifier includes at least one of block identifier, stream key, and slot. The update modes include at least one of full snapshot, incremental append, patch, and wipe.
8. The method according to claim 6, characterized in that, The semantic merging includes: If a new message for the same identifier carries a semantic snapshot, then delete the incremental and / or old snapshots of that identifier in the temporary queue, and retain the semantic snapshot. If both the tail message and the new message contain only the semantic increment of the same identifier, and belong to the same interface, content type, and update semantics, then the two semantic increments will be merged into one increment.
9. The method according to claim 1, characterized in that, The locally configured identity also has a failure status; the method further includes: If the local identity configuration fails to be determined, the downlink message is rejected from entering the bounded semantic temporary storage.
10. The method according to claim 1, characterized in that, Also includes: After establishing the current interactive session boundary and updating the session generation, an asynchronous identity resolution task is initiated. The asynchronous identity resolution task carries the accepted business session identifier, runtime session identifier, and session generation at the time of initiation.
11. The method according to claim 10, characterized in that, After the locally configured identity transitions to a ready state, the current session identity is established based on the locally configured identity, the actual routing context, and the unchanged session generation, including: Read the local configuration identity and the actual routing context; Verify whether the robot identifier in the actual routing context is consistent with the robot identifier in the locally configured identity; Verify whether the currently accepted service session identifier is consistent with the accepted service session identifier carried by the asynchronous identity resolution task; Verify whether the current runtime session identifier is consistent with the runtime session identifier carried by the asynchronous identity resolution task; Verify whether the current session generation is consistent with the session generation carried by the asynchronous identity resolution task; If all the above verifications pass, the current session identity is established, and the local configuration identity, actual routing context, accepted service session identifier, runtime session identifier, and session generation are used as the current session identity metadata.
12. The method according to claim 11, characterized in that, The method further includes: If any of the above verifications fails, the current session identity will be refused.
13. The method according to claim 1, characterized in that, If the entry verification passes and the downlink message belongs to the current interaction session boundary, the method further includes: If the local configured identity is in a ready state, then identity verification, flow sequence verification, and state reduction are performed on the downlink message.
14. The method according to claim 13, characterized in that, The step of performing identity verification, stream order verification, and state reduction path processing on the temporarily stored messages in the order of receipt for semantically secure replay includes: Take a temporary message from the head of the temporary queue and perform the same identity verification, stream order verification and state reduction as the real-time downlink message on the temporary message to perform semantically secure replay; Set an emptying flag. New messages from the same session that arrive during replay are appended to the end of the temporary queue until the temporary queue is empty, at which point the emptying flag is removed. If the local configuration identity changes during playback, subsequent temporary messages will be rejected and the remaining temporary queue will be cleared.
15. The method according to claim 13, characterized in that, The identity verification includes: Verify whether the local configuration identity is in a ready state, and whether the robot identifier, store identifier, and display device identifier in the local configuration identity are currently valid values and not placeholder values; Verify whether the actual subscribed robot identifier in the actual routing context matches the robot identifier in the locally configured identity; Verify whether the robot identifier and terminal installation session identifier in the message channel metadata are consistent with the current session identity metadata; Verify whether the session identifier of the downlink message or temporary message is equal to the accepted service session identifier and the runtime session identifier; Verify whether the session generation carried by the asynchronous identity resolution task or the sending task is the current session generation; Verify whether the robot identifier, store identifier, and display device identifier in the message envelope are consistent with the current session identity metadata; Verify that the request identifier and message identifier in the message envelope exist; If all the above checks pass, then subsequent flow sequence checks and state reduction path processing are performed on the downlink message or temporary message.
16. The method according to claim 15, characterized in that, After the identity verification is passed, the flow sequence verification includes: Verify whether the interface, slot, stream key, and stream sequence number of the downlink message or temporary message correspond to the current stream; If the above verification passes, the downlink message or temporary message is processed according to the update mode of the unified state machine, which includes replacement, append, patch and clear.
17. The method according to claim 16, characterized in that, After the flow sequence verification passes, the state reduction path processing includes: Based on the interface, slot, stream key, stream sequence number, and update mode of the downlink message or temporary message, determine the position of the downlink message or temporary message in the current page state machine; Update the page state corresponding to the determined location based on the update mode.
18. The method according to claim 9, characterized in that, The method further includes: When the local configuration identity changes or fails to be determined, invalidate the current interactive session and its temporary storage that were established before the change or failure.
19. The method according to claim 18, characterized in that, The invalidation of the current interactive session and its temporary storage established before the change or failure includes: Record the current session identifier as an expired session identifier; After recording the failed session identifier, increment the session generation and clear the accepted service session identifier, runtime session identifier, session identity metadata, and active route snapshot; After incrementing the session generation, clear the semantic temporary queue and reset the workbench page state.
20. The method according to claim 19, characterized in that, The method further includes: After recording the failed session identifier, the page is refused to be recreated with the same failed session identifier.
21. The method according to claim 19, characterized in that, The method further includes: When the robot's identifier changes, unsubscribe from the old robot theme and subscribe to the new robot theme corresponding to the changed robot identifier; If the robot identifier remains unchanged while the store identifier or display device identifier changes, the currently subscribed robot theme will remain unchanged, and if the locally configured identity changes, the current interactive session and its temporary storage will be invalidated.
22. The method according to claim 1, characterized in that, The method further includes: When creating an up action such as a touch operation, query request, shopping cart action, or action result confirmation, capture the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context, generate a request identifier, and construct a task to be sent. Before actually executing asynchronous transmission, read again the currently accepted business session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context; The captured accepted service session identifier, runtime session identifier, session generation, and local configuration identity are compared with the currently accepted service session identifier, runtime session identifier, session generation, local configuration identity, and actual routing context, respectively. The captured actual routing context is then compared with the current actual routing context at the time of transmission. If the above comparison results are consistent, then the above action is sent.
23. The method according to claim 22, characterized in that, The method further includes: If there is an inconsistency in the above comparison results, the up action will be rejected and the task to be sent will be marked as invalid.
24. The method according to claim 2, characterized in that, The terminal installation session identifier is generated and persistently stored when the terminal is installed or reinstalled; the terminal installation session identifier is sent to the peer with the session ready response so that subsequent downlink messages can restore the complete terminal installation session identifier verification.
25. The method according to claim 2, characterized in that, The local configuration identity also includes at least one of the following: tenant identifier, site identifier, device certificate identifier, or bound version.
26. A message processing apparatus, characterized in that, include: The maintenance module is used to maintain the local configured identity and its state, the actual routing context, the current interaction session boundary, and the session generation; The local configuration identity is determined by the local bound snapshot and has a loading state and a ready state; The actual routing context is provided by the currently active transport connection or subscription; The response module is used to establish the current interactive session boundary in response to the trusted session initiation signal and update the session generation; The verification module is used to receive downlink messages and perform entry verification based on the message envelope and message channel metadata of the downlink messages; The temporary storage module is used to perform bounded semantic temporary storage of the downlink message if the local configuration identity is in a loading state, provided that the entry verification is successful and the downlink message belongs to the boundary of the current interaction session. The module is used to establish the current session identity based on the local configuration identity, the actual routing context, and the unchanged session generation after the local configuration identity has been converted to the ready state. The establishment is successful only if the actual routing context is consistent with the local configuration identity and the session generation has not changed. The processing module is used to perform identity verification, stream order verification, and state reduction path processing on the temporarily stored messages in the order of receipt after successful establishment, so as to perform semantic security replay.
27. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 25.
28. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 25.
29. A computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 25.
