BS-based page plug-in-free communication system

By using a plugin-free communication system based on Service Workers, the problems of excessive resource consumption and business logic disorder caused by network instability under multi-tab concurrency are solved. It achieves efficient utilization of browser resources and persistent disaster recovery of communication data, ensuring consistent request order and seamless recovery under network fluctuations.

CN121603486APending Publication Date: 2026-03-03NINGXIA VOCATIONAL & TECH COLLEGE (NINGXIA OPEN UNIV)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511884336.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as excessive browser resource consumption, network instability leading to disordered business logic, and lack of persistent disaster recovery for communication data in multi-tab concurrent scenarios.

Method used

A Service Worker-based, plug-in-free communication system is adopted. A unique streaming backbone tunnel is established through a virtual gateway layer module. Request serialization and persistence are achieved using a virtual logical clock and a transactional mailbox module. A failover and refactoring module ensures the continuity and consistency of communication.

Benefits of technology

It reduces the resource consumption of concurrent connections for multiple browser tabs, ensures the consistency of request order and seamless fault recovery under network fluctuations, and realizes the persistent disaster recovery capability of communication data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121603486A_ABST
    Figure CN121603486A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer network communication, and discloses a BS-based page plug-in-free communication system, which runs in a Service Worker environment, intercepts a view layer request through a virtual gateway layer, and establishes a unique streaming backbone tunnel with a server by using a standard HTTP protocol. A request interception and serialization module is arranged in the system, a global time sequence label is distributed for a concurrent request by maintaining a virtual logic clock, and a strict total-sequence data frame sequence is constructed; a transactional sender box module is adopted, data are synchronously written into local persistent storage before network sending, and data integrity is ensured. And when monitoring that the network is abnormal, the failover reconstruction module freezes a sending state, and performs data sequence replay based on a breakpoint confirmed by the server after connection reconstruction. According to the method, the problem of resource consumption of multi-tab connection is solved, the service logic sequence consistency is guaranteed, and persistent disaster recovery and network-off non-inductive recovery of communication data are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer network communication technology, specifically to a browser-based page-based plug-in-free communication system. Background Technology

[0002] With the rapid development of internet technology and the continuous evolution of web standards, browser-server architecture-based applications have gradually transformed from simple static page displays to complex rich internet applications and single-page applications. In scenarios such as collaborative office work, instant messaging, online financial transactions, and large enterprise management systems, high-frequency, real-time data interaction between front-end pages and back-end services has become a basic requirement. To achieve real-time data push and bidirectional communication, existing technical solutions typically rely on technologies such as the WebSocket protocol, HTTP long polling, or server-sent events.

[0003] However, in real-world production environments, the aforementioned existing technical solutions face significant architectural bottlenecks and resource challenges when dealing with the multi-tab usage scenarios of modern browsers. Traditional communication models typically employ a one-page-one-connection strategy, meaning each independent browser tab or iframe window needs to establish an independent WebSocket connection or long polling channel with the server. When users habitually open multiple tabs on the same system for parallel operations, the client initiates multiple long connections simultaneously. This not only rapidly exhausts the browser's port resources, triggering the browser's maximum connection limit for the same origin domain, thus blocking or suspending subsequent page requests, but also significantly increases the server's concurrent connection maintenance pressure, resulting in an ineffective waste of server memory and CPU resources.

[0004] Furthermore, in mobile internet and weak network environments, network connectivity instability is an unavoidable reality. Existing HTTP requests or WebSocket connections often lack system-level state protection and transaction consistency mechanisms when encountering network fluctuations, base station switching, or momentary disconnections. Traditional retry mechanisms typically involve simply resending the request, but in scenarios with multiple tabs operating concurrently, simple retries can easily lead to discrepancies between the order in which the server receives requests and the order in which the user operates on the client, resulting in logical errors or state conflicts in business data. Simultaneously, most existing communication solutions temporarily store data to be sent in the browser's memory variables. If the browser crashes, closes unexpectedly, or the user accidentally closes a tab, the unsent data accumulated in memory will be permanently lost, lacking persistent disaster recovery capabilities.

[0005] Furthermore, regarding network penetration and compatibility, while the WebSocket protocol provides full-duplex communication capabilities, its unique handshake protocol and non-standard data frame format are easily identified and blocked by enterprise firewalls, proxy servers, or web application firewalls. Some strict network environments only allow standard HTTP / HTTPS traffic to pass through, making it difficult to deploy WebSocket-based applications. Early solutions such as Flash or Silverlight plugins have been completely abandoned by mainstream browsers due to security concerns and cannot be relied upon by modern web applications. Therefore, there is an urgent need for a communication solution that can achieve multi-tab shared links, strong transaction consistency, and seamless recovery from network outages without relying on additional plugins or consuming excessive connection resources. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a browser-based page-based plug-in-free communication system, which solves the problems of excessive connection resource consumption in multi-tab concurrent scenarios, out-of-order business logic due to asynchronous requests in weak network environments, and lack of local persistence and disaster recovery guarantees for communication data in existing browser-based web applications.

[0007] To achieve the above objectives, the first aspect of this invention provides a browser-based, plugin-free communication system. This system runs in a browser environment that supports the Service Worker standard. The system includes a view layer module, a virtual gateway layer module, and a server access layer.

[0008] The view layer module consists of browser tabs or browsing contexts and is used to initiate HTTP business requests and receive response data.

[0009] The virtual gateway layer module is used as a Service Worker instance residing in the browser background to intercept business requests initiated by the view layer module and establish a unique streaming backbone tunnel with the server access layer. The virtual gateway layer module further includes a backbone tunnel control module, a request interception and serialization module, a transactional mailbox module, and a failover and refactoring module.

[0010] The backbone tunnel control module is used to establish a full-duplex connection tunnel with the server based on the HTTP protocol through the Fetch API or Stream API, and to maintain the lifecycle status of the connection.

[0011] The request interception and serialization module is used to capture business requests initiated by the view layer module and maintain a monotonically increasing virtual logical clock inside the module. The module uses the value generated by the virtual logical clock to assign a globally unique time sequence label to each business request and convert concurrent business requests into a data frame sequence with a strict total order relationship.

[0012] The transactional mail box module is used to build a persistent queue based on the browser's local storage. Before sending data through the streaming backbone tunnel, the module performs a synchronous write operation to write the business request data with time-series tags into the persistent queue. The module is also used to receive the server's confirmation signal and clean up the data that has been transmitted in the persistent queue according to the maximum time-series tag confirmed by the server.

[0013] The failover and reconstruction module is used to monitor the status of the streaming backbone tunnel. When an abnormality in a streaming object or a heartbeat timeout is detected, the module switches the system status to reconnection status. In reconnection status, the virtual gateway layer module continues to intercept, serialize, and write service requests to the transactional mailbox module, but stops sending requests to the network. The failover and reconstruction module is also used to perform handshake synchronization and sequence replay operations after rebuilding the streaming backbone tunnel, and send the requests backlogged in the transactional mailbox module to the server in an orderly manner based on the server's confirmation status.

[0014] A second aspect of this invention provides a browser-based, browser-based, plugin-free communication system and a browser-based, browser-based, plugin-free communication method. This method is applied to a browser environment that supports Service Workers and includes the following steps: Step 1: Use a Service Worker residing in the browser's background to intercept HTTP business requests initiated by the view layer.

[0015] Step 2: Perform serialization operations based on a virtual logical clock within the Service Worker. The system maintains a global counter. The initial value is 0. When the first one is intercepted... Business Request At that time, perform atomic update operation. Subsequently, the system constructs a data frame. And use the current clock value as the timing tag. Assign this data frame: ; in, The view identifier that initiated the request. A unique identifier for the request. , This is the business data payload. This step maps concurrent requests from different view layers into a total order set.

[0016] Step 3: Perform a transactional enqueue operation. Enqueue the data frame. Write to the local transactional sender queue : ; This step is performed before data is sent through the streaming backbone tunnel to ensure that the data has been persistently stored.

[0017] Step 4: Send request data through the unique streaming backbone tunnel established with the server via the Service Worker. If the data is sent successfully and an acknowledgment signal is received from the server, then use the maximum sequence number confirmed by the server. Clean up the queue that meets the requirements Data frames.

[0018] Step 5: Perform fault monitoring and state freeze. When an interruption of the streaming backbone tunnel is detected, mark the system connection status as reconnection status. During this period, keep the view layer in a waiting state, do not return network errors to the view layer, and continue to receive new requests and execute steps 2 and 3.

[0019] Step Six: Perform tunnel reconstruction and handshake synchronization. After re-establishing the physical connection with the server, initiate a handshake request to obtain the confirmation sequence number corresponding to the last instruction successfully processed by the server. And use this sequence number as the system's consistency synchronization breakpoint. ,Right now .

[0020] Step 7: Perform sequence reconstruction and replay. The system retrieves data from the transactional outgoing mail queue. Extract the set of data frames that need to be retransmitted. : ; The system for sets Data frames in the middle are categorized by time sequence tag The data is sorted in ascending order and sent sequentially to the server through the reconstructed streaming backbone tunnel to restore communication consistency.

[0021] This invention provides a browser-based (BS) page-based plug-in-free communication system. It has the following advantages: 1. This invention establishes a unique streaming backbone tunnel in the virtual gateway layer module, multiplexing concurrent business requests from multiple tabs in the view layer into a single physical connection for transmission. This avoids the situation in traditional technologies where each tab needs to establish an independent WebSocket connection or long polling connection, thereby significantly reducing the concurrent connection maintenance overhead on the server side and the handshake resource consumption on the client side, and effectively solving the problem of connection resource contention in browser multi-context environments.

[0022] 2. This invention maintains a monotonically increasing virtual logical clock through a request interception and serialization module, assigns a globally unique time sequence label to each intercepted business request, and maps concurrent and asynchronous requests from different view layer contexts into a data frame sequence with a strict total order relationship. This ensures that in multi-tab concurrent operation scenarios, the order in which the server receives and processes requests is strictly consistent with the logical order generated by the client user's operation, eliminating the risk of business logic out-of-order due to differences in network transmission latency.

[0023] 3. This invention freezes the system state when the streaming backbone tunnel is interrupted by a failover and reconstruction module, and performs sequence replay based on the last sequence number confirmed by the server after the connection is rebuilt. This achieves seamless fault recovery at the network layer, so that the upper-layer view module does not need to write complex error capture and retry logic to cope with network fluctuations, shields the instability of the underlying network, and ensures the continuous execution of business processes. Attached Figure Description

[0024] Figure 1 This is a system architecture diagram of the present invention; Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] Example: Please see the appendix Figure 1 This invention provides a browser-based page-based plug-in-free communication system, comprising: The view layer module, consisting of browser tabs or browsing context, is used to initiate standard HTTP business requests and receive response data.

[0027] In this embodiment, the view layer module serves as the front-end interactive carrier of the browser-based, plug-in-free communication system of this invention, and its physical deployment location is within the browser application of the user terminal. This module specifically consists of one or more independent browsing contexts, which in practical applications manifest as multiple browser tabs opened by the user, embedded frames, or independent windows of a progressive web application. The main responsibilities of the view layer module are to host the user interface, initiate requests for business data, and render and display the data returned by the server.

[0028] In this embodiment, the view layer module is designed to completely decouple from the underlying network transmission details in terms of communication mechanism. Specifically, the business logic code in the view layer module does not need to introduce third-party real-time communication plugins such as WebSocket client libraries and Socket.IO, nor does it need to write network maintenance code such as heartbeat protection and reconnection after disconnection for TCP long connections. The view layer module is used to initiate business requests only through the standard HTTP interface natively supported by the browser. When the view layer module needs to send data to the server or request data updates, its behavior pattern is to initiate a short connection request to the standard Uniform Resource Locator. This design makes the traffic sent by the view layer module appear as a regular document or script request in the network panel of the browser console, thereby achieving the invisibility of the communication protocol at the application layer and effectively avoiding the risk of traditional WebSocket connections being blocked by enterprise firewalls or proxy servers due to their obvious protocol characteristics.

[0029] In this embodiment, the view layer module is also configured with a state awareness and feedback mechanism to cooperate with the virtual gateway layer to achieve streaming backpressure control. Considering the limitations of computing resources and rendering capabilities in a browser multi-tab environment, the view layer module will monitor the lifecycle state and rendering performance indicators of the current browsing context in real time. Based on the above monitoring data, the view layer module will calculate the view entropy of the current page. This indicator represents the page's urgency and consumption capacity for data updates. When the view layer module detects that the page is in the background or the frame rate is decreasing, it will actively send a control signal containing the view entropy parameter to the virtual gateway layer, so that the underlying virtual gateway layer can dynamically adjust the data density delivered to the view layer module accordingly, thereby reducing the CPU usage of the browser's main thread and the device power consumption.

[0030] In this embodiment, the view layer module is used to process asynchronous responses forwarded by the virtual gateway layer when receiving data. Although the view layer module initiates seemingly independent HTTP requests, in this system architecture, the response process for these requests is taken over by the virtual gateway layer through an interception mechanism. The view layer module maintains a set of pending Promise objects, each corresponding to a business request. After the virtual gateway layer receives the data packet returned by the server from the streaming backbone tunnel and completes the routing distribution, the view layer module receives the specific business load data through a message callback mechanism. At this point, the view layer module parses the payload data in binary or text format into objects that the application can recognize, and triggers an update of the DOM tree to complete the redraw of the interface.

[0031] In this embodiment, the view layer module also serves as the trigger source for generating the virtual logical clock. Whenever the view layer module initiates a new service request... Each request carries a unique identifier of the browsing context that initiated the request. And the temporary identifier of the request itself. These identifiers are passed as input parameters to the virtual gateway layer, triggering the atomic increment operation of the global counter inside the gateway layer, thereby driving the timing marking process of the entire system. In this way, although the view layer module does not directly maintain the global clock, each interactive event it generates becomes the driving force for the system's logical time to advance, ensuring that the operation sequence generated by the user in the view layer can be strictly mapped to a transaction flow with total order relation.

[0032] The virtual gateway layer module, residing as a Service Worker instance in the browser's background, is used to intercept business requests initiated by the view layer module and establish a unique streaming backbone tunnel with the server.

[0033] In this embodiment, the virtual gateway layer module serves as the core hub of the entire plug-in-free communication system, and it is constructed as a Service Worker instance residing in the browser's background thread. This module has the characteristic of operating independently of the webpage view layer's lifecycle. Even if the foreground page is closed or refreshed, as long as it is within the browser's allowed grace period, the module can still maintain its running state. The virtual gateway layer module is used to establish and maintain a unique network communication link between the client and the server, acting as a local proxy and scheduling center for all upper-layer view service requests, thereby achieving unified management of the underlying network connections.

[0034] In this embodiment, the virtual gateway layer module includes a backbone tunnel control unit. This unit is used to establish a persistent connection tunnel with the server using the browser's natively supported Fetch API or Streams API. Specifically, this unit initiates an HTTP request to the server and keeps the response stream of the request open, thereby constructing a full-duplex or half-duplex streaming backbone tunnel. This tunnel manifests as standard HTTPS traffic at the transport layer, thus naturally penetrating enterprise-level firewalls, proxy servers, and deep packet inspection devices without requiring special port configurations or protocol upgrade handshakes. The backbone tunnel control unit also maintains the system's connection status, monitoring the health of stream objects in real time to distinguish between connected, disconnected, and reconnecting states.

[0035] In this embodiment, the virtual gateway layer module achieves full control over business requests by registering a fetch event listener. When an HTTP request initiated by the view layer is detected, the module blocks the browser's default network sending behavior and instead initiates an internal request serialization process. During this process, the virtual gateway layer module maintains a monotonically increasing integer variable as a virtual logical clock. Its initial value is set to 0. Whenever a new business request event is intercepted, the module performs an atomic update operation, increasing the value of the global counter by a unit step. .

[0036] In this embodiment, based on the updated logical clock value, the virtual gateway layer module generates a globally unique time sequence tag for the current request. And associate the tag with the identifier of the request initiator. Request a unique identifier and business load data They are encapsulated together into standardized data frames. Through this mechanism, the virtual gateway layer module maps the discrete HTTP requests that were originally generated concurrently and asynchronously in a multi-tab environment into a logical transaction sequence with a strict total order relationship, thereby providing the necessary timing benchmark for subsequent data consistency verification and fault recovery.

[0037] In this embodiment, to ensure high communication reliability, the virtual gateway layer module integrates a transactional outgoing mailbox mechanism. This module is used to first send data frames out before attempting to transmit any data frames through the streaming backbone tunnel. Write to a persistent queue built on browser local storage. In this module, the write operation is designed as a synchronous blocking transaction. This means that the data frame is only allowed to enter the network send buffer after the data has been successfully written to disk and a success callback has been received from the storage system. Simultaneously, the module listens for acknowledgment signals returned by the server via the downlink and determines the data frame based on the maximum sequence number confirmed by the server. Periodically clean up persistent queues with sequence numbers less than or equal to Historical data can be used to free up storage space.

[0038] In this embodiment, the virtual gateway layer module possesses the capabilities of seamless failover and sequence reconstruction. When the backbone tunnel control unit detects a network flow interruption, heartbeat timeout, or transmission error, it switches the system state to reconnection mode. In this mode, the module continues to intercept and store new requests generated by the view layer, but suspends network transmission and does not report errors to the upper-layer view, thereby shielding against temporary network fluctuations. After the module successfully reconstructs the physical connection through the exponential backoff algorithm, it immediately initiates a handshake synchronization process, obtains the sequence number of the last successfully processed instruction from the server, and marks this sequence number as the system's consistency synchronization breakpoint. .

[0039] In this embodiment, based on the acquired consistent synchronization breakpoint, the virtual gateway layer module executes sequence replay logic. This module will process the local persistent queue. Perform a full scan and filter out all serial numbers that are strictly greater than 10 ... Data frames constitute the retransmission set Subsequently, the module uses the time sequence tags carried in the data frame. The retransmission set is sorted in ascending order, and data frames are sent to the server sequentially through the newly established backbone tunnel in the sorted order. This mechanism ensures that no matter how long the network interruption lasts or how many requests from different tabs are backed up, the order in which these requests finally arrive at the server is always strictly consistent with the logical order generated by the user's operation, effectively avoiding the out-of-order and data loss problems common in distributed systems.

[0040] In this embodiment, the virtual gateway layer module also undertakes the responsibility of routing and distributing downlink data. This module continuously reads the response stream of the backbone tunnel, and when it receives a response data packet pushed by the server, it parses the original request identifier contained therein. Based on this identifier, the module looks up the corresponding Promise controller or communication port in the locally maintained request context mapping table, and accurately calls back the business response data to the specific view layer context that initiated the request, thereby completing a complete request-response loop.

[0041] The backbone tunnel control module is used to establish a full-duplex long-term connection tunnel with the server via the Fetch API or Stream API, and to maintain the lifecycle state of the connection.

[0042] In this embodiment, the backbone tunnel control module, as the interface unit for physical interaction between the virtual gateway layer and the external network environment, is responsible for building, maintaining, and managing the unique long-term communication link between the client and the server.

[0043] The design purpose of this module is to break the resource occupation mode of one page and one connection in the traditional browser communication model. By establishing a persistent streaming backbone tunnel in the global scope of Service Worker, it realizes the unified carrying and transmission of all upper-layer view business data. This module is not only responsible for the underlying network handshake and protocol negotiation, but also undertakes the responsibility of monitoring and managing the connection lifecycle to ensure the stability and availability of the data transmission channel.

[0044] In this embodiment, when establishing a connection, the trunk tunnel control module preferably uses the FetchAPI or Streams API natively supported by the browser.

[0045] Specifically, this module is used to construct HTTP request objects with special attributes. When constructing the request, the module sets the request method field to POST or PUT and uses a ReadableStream object for the request body. Alternatively, in a browser environment that supports full-duplex communication, the module can configure the duplex parameter to half or full to explicitly tell the browser to keep the request stream open. In this way, the backbone tunnel control module makes the HTTP request no longer follow the traditional request-response-close short connection pattern, but instead transforms it into an uplink data pipeline that can continuously send binary data frames, thereby simulating a continuous communication capability similar to TCP sockets above the application layer.

[0046] In this embodiment, the backbone tunnel control module is used to prioritize establishing connections based on HTTP / 2 or HTTP / 3 protocols. This is because HTTP / 2 and HTTP / 3 protocols natively support multiplexing and header compression, which can greatly improve the transmission efficiency of small binary data packets. More importantly, since all network traffic generated by this module fully conforms to the standard HTTPS encrypted traffic specifications and uses the standard port 443, this streaming backbone tunnel has extremely strong network penetration.

[0047] When faced with enterprise-grade firewalls, deep packet inspection devices, or web application firewalls, this tunnel will be recognized as a normal long-running file upload or download session, thus avoiding the risks of being blocked or rate-limited as with non-standard WebSocket protocols.

[0048] In this embodiment, the main tunnel control module maintains a connection state machine to accurately describe the current life cycle state of the main tunnel.

[0049] The system connection states are defined by this state machine. It includes at least three states: connected, disconnected, and reconnecting. The module updates the state machine values ​​in real time by listening to events of the underlying stream object. When the state is connected, the module exposes a WritableStream interface for the transactional mailbox module to write data, and a ReadableStream interface for the routing and distribution module to read data. This stream-based interface design achieves a high degree of decoupling between the network layer and the logic processing layer.

[0050] In this embodiment, in order to deal with silent packet loss or timeout disconnection strategies of intermediate proxy servers in the network, the backbone tunnel control module is used to perform an active health check mechanism.

[0051] This module has a built-in heartbeat keep-alive logic and a preset heartbeat cycle. During the link idle period, if more than If no uplink or downlink data activity is detected within the specified time window, the module will automatically construct a very small Ping frame and write it to the request stream. Simultaneously, the module will start a watchdog timer. If no Pong response is received from the server within a specified time after sending the Ping frame, or if the maximum silence threshold is exceeded without any data interaction, the module will proactively determine that the current physical connection has failed, triggering the underlying AbortController to abort the current request and update the state machine's state. The connection is changed to reconnection in progress, thereby notifying the upper-layer module to initiate the failover process.

[0052] The request interception and serialization module is used to capture business requests, maintain a monotonically increasing virtual logical clock, and assign a globally unique time sequence label to each business request using the value generated by the virtual logical clock.

[0053] In this embodiment, the request interception and serialization module, as the entry logic unit for processing uplink data in the virtual gateway layer, is used to take over and reshape the browser's native network request process.

[0054] The core function of this module is to solve the problem of timing uncertainty of concurrent requests in a multi-tab environment. By introducing a serialization mechanism at the gateway entry point, the originally asynchronous and discrete HTTP request stream is transformed into a logical transaction stream with a strict total order relationship. This module uses the event-driven model of the Service Worker standard to capture every network interaction attempt initiated by the view layer by registering and listening to the fetch event.

[0055] In this embodiment, the request interception and serialization module is configured with a specific interception strategy. When a FetchEvent that matches the business rules is captured, the module immediately calls the respondWith() method of the event object. This operation has a dual meaning: On the one hand, it effectively prevents browsers from initiating direct TCP connections to external networks according to their default behavior, thereby preventing the leakage and dispersion of connection resources; On the other hand, it completely transfers control of the request to the script logic inside the Service Worker, enabling the module to read, modify, and encapsulate the request content in preparation for subsequent tunnel transmission.

[0056] In this embodiment, in order to establish a deterministic timing relationship between stateless HTTP requests, the request interception and serialization module maintains a crucial state variable, namely a virtual logical clock.

[0057] In implementation, this clock is a global counter residing in the Service Worker's memory scope, denoted as... Its initial value is set to zero.

[0058] This module is designed with a single-threaded execution model or employs atomic operation mechanisms to ensure that access to the counter is mutually exclusive and atomic when handling high-concurrency requests. Whenever an intercepted event is triggered and enters the processing flow, this module performs a clock step operation, increasing the current global counter value by a unit step, i.e., executing... This mechanism ensures that no matter how frequently requests arrive, the system's internal time always progresses monotonically forward.

[0059] In this embodiment, the request interception and serialization module uses the updated logical clock value to perform data frame encapsulation and serialization operations. For each intercepted request... The module first extracts its metadata, including the browsing context identifier that initiated the request. and the unique transaction identifier generated for this request. .

[0060] Then, the module will... Numerical values ​​as time series labels Upon receiving this request, the module will ultimately combine the aforementioned identification information with the original request's service load data. Together they are packaged to build a standardized internal data frame. .

[0061] In this embodiment, through the above encapsulation process, the request interception and serialization module realizes the mapping from the physical time domain to the logical time domain in the BS-based plug-in-free page communication system.

[0062] Although requests from different tabs may differ by only microseconds in physical time, or even appear as physical concurrency on multi-core processors, after processing by this module, any two data frames... and An absolute order relationship was established between them: like The time tag is less than If the time sequence label is not found, the system will determine... Prior to This strict total order relationship is the basis for the ordered storage of subsequent transactional mail boxes and the ordered replay of the failover module. It eliminates the out-of-order problem of last-to-first delivery caused by differences in network paths, which is common in distributed systems.

[0063] In this embodiment, after the data frame is constructed, the request interception and serialization module does not directly initiate network transmission, but instead passes the encapsulated data frame to the subsequent transactional mailbox module.

[0064] During this process, the module can also be used to optimize the original request body. At the same time, the module will temporarily suspend the Promise object corresponding to the original request, waiting for the subsequent module to realize the status after receiving the server response, so as to keep the calling logic of the view layer script uninterrupted.

[0065] The transactional mailbox module is used to build a persistent queue based on the browser's local storage. Before sending data through the streaming backbone tunnel, business request data with time-series tags is written to the persistent queue.

[0066] In this embodiment, the transactional mail box module, as a key component to ensure the integrity and reliability of communication data, is used to build an intermediate buffer system with persistent storage capabilities inside the virtual gateway layer.

[0067] The design philosophy of this module is to change the volatile nature of traditional network requests, which are sent and discarded immediately. By introducing a storage-first transaction processing mechanism, it ensures that business data is first written to disk locally before being physically sent to the network. This mechanism enables the system to cope with extreme situations such as browser crashes, unexpected shutdowns, or momentary network disconnections, ensuring that the business intentions generated by users are not lost due to fluctuations in the operating environment.

[0068] In this embodiment, the transactional mailbox module relies on the local database technology provided by the browser to build its underlying storage architecture.

[0069] Preferably, this module uses the IndexedDB standard or Cache Storage API as the physical storage medium. This is because, compared to localStorage, IndexedDB supports larger storage capacity, more complex index queries, and more critical asynchronous transaction processing capabilities. This module maintains a queue called the Outbox in the storage medium. This data structure, the queue, is used strictly according to the time tag carried in the data frame. The requests are sorted to preserve the global logical order of business requests at the physical storage level.

[0070] In this embodiment, the transactional mailbox module is used to execute a strict synchronous write process. Specifically, when a packaged data frame generated by the request interception and serialization module is received... Afterwards, the module does not immediately trigger network transmission. Instead, it initiates a write transaction, storing the data frame in the local outgoing mail queue. This operation is designed as a logically blocking step, meaning the system must wait for the storage engine to return a callback signal indicating successful write before releasing the data frame into the subsequent network transmission channel. Through this mechanism, the transactional outgoing mail module constructs atomic operation units locally. In other words, request generation and request persistence are treated as a whole; they either succeed or fail simultaneously, eliminating the intermediate state of data floating in memory.

[0071] In this embodiment, the transactional mail box module also integrates an acknowledgment and cleanup mechanism to prevent the local storage space from expanding indefinitely.

[0072] This module continuously monitors the downlink of the streaming backbone tunnel, or receives acknowledgment signals from the server via a specific control channel. These acknowledgment signals contain the maximum logical clock value that the server has successfully received and processed. Whenever I receive a new This module will trigger a garbage collection operation, traversing the outgoing mail queue. The module compares the time sequence tags of the data frames. For all data frames whose time sequence tags are less than or equal to the server's confirmation value, the module determines that they have been safely delivered and permanently deletes them from the local database, thereby dynamically releasing storage resources.

[0073] In this embodiment, the transactional outgoing mail module automatically switches to offline buffer mode when the system is in a state of network disconnection or reconnection. When the backbone tunnel control module reports a connection interruption, this module continues to receive new requests generated by the upper-layer view and continues to perform write operations, accumulating data frames in the outgoing mail queue. At this time, the queue no longer serves as a simple transmission buffer, but acts as a distributed transaction log.

[0074] This design ensures that even during network outages, the user's sequence of actions is recorded locally in a complete and orderly manner, providing a data foundation for replaying the sequence when the connection is restored.

[0075] In this embodiment, in order to ensure data consistency under high-concurrency writes, the transactional mailbox module is preferably configured with a resource mutex lock.

[0076] In scenarios where multiple tabs generate a large number of requests simultaneously, mutex locks ensure that write operations to the outbox queue are serialized or controlled concurrent, preventing index conflicts or data overwriting issues caused by concurrent writes. At the same time, this module provides an efficient query interface, supporting the failover and reconstruction module to quickly retrieve and batch export the set of data frames to be sent based on a specific time-series tag range when replay is required.

[0077] The failover and reconfiguration module is used to extract unfinished requests from the transactional mail box module and replay them in an orderly manner based on the timing status confirmed by the server after the streaming backbone tunnel is interrupted and the connection is restored.

[0078] In this embodiment, the failover and reconfiguration module, as the core fault-tolerant unit that ensures the continuity of communication and data consistency of the system in an unstable network environment, is used to reside inside the virtual gateway layer to perform real-time monitoring of the operating status of the backbone tunnel control module throughout its entire lifecycle.

[0079] The purpose of this module is to shield the physical interruption of the underlying TCP / IP connection from the impact on the upper-layer business logic. By building a logical session persistence mechanism on top of the transport layer, the communication process perceived by the view layer always appears to be continuously available. Even in scenarios where the physical network switches or experiences momentary jitter, it can ensure zero loss and strict ordering of business data.

[0080] In this embodiment, the failover and reconfiguration module is configured with highly sensitive fault detection logic. This module continuously monitors the event streams of the ReadableStream and WritableStream objects in the streaming backbone tunnel. When a StreamClosed event, an underlying NetworkError exception, or no heartbeat response is received from the server within a preset heartbeat monitoring period is detected, the module determines that the current physical connection has failed. At this point, the module immediately triggers a system state freeze operation, transferring the connection state machine... Switching from connected to reconnecting.

[0081] In this state, the module sends an instruction to the backbone tunnel control module to suspend physical write operations to the network, but at the same time, it keeps the request interception and serialization module working normally, allowing new business requests to continue to be generated and accumulate in the local queue of the transactional outgoing mail box.

[0082] In this embodiment, the failover and reconstruction module incorporates an adaptive reconnection scheduling algorithm to attempt to rebuild the backbone tunnel after a network failure. To prevent invalid retries due to network jitter and the thundering herd effect on the server caused by a large number of clients reconnecting simultaneously, this module preferably adopts an exponential backoff strategy with jitter. Specifically, let... Given the current number of retries, this module calculates the waiting time for the next retry. This calculation process is based on a reference time slice. Multiply it by 2 The power of 1, and set the maximum waiting limit. Furthermore, to introduce randomness, the calculation result is multiplied by a random jitter factor. The coefficient. In this way, the module dynamically adjusts the retry frequency, reducing network load while ensuring recovery speed.

[0083] In this embodiment, after the main tunnel control module successfully establishes a new physical connection, the failover and reconfiguration module does not immediately allow arbitrary data transmission. Instead, it first takes over the channel and initiates a handshake synchronization process. This module constructs a synchronization frame containing client identity information and sends it to the server. After receiving the frame, the server queries its receive buffer or transaction log and returns the logical sequence tag of the last instruction that it has successfully processed and confirmed. The failover and reconfiguration module receives this return value and marks it as a consistency synchronization breakpoint of the system. That is, setting This step establishes a common benchmark for data consistency between the client and the server.

[0084] In this embodiment, based on the established consistency synchronization breakpoint, the failover and reconstruction module initiates the core sequence reconstruction and replay logic. This module sends a retrieval request to the transactional mailbox module to scan the local persistent queue. In all data frames to be sent, the module determines the timing tag encapsulated in the data frame. The data frames that meet the condition of having a time sequence label that is strictly greater than the synchronization breakpoint are filtered out, thus constructing the data set to be retransmitted. .

[0085] This collection precisely covers new data generated during the network outage, as well as data that has been sent but not yet acknowledged by the server.

[0086] In this embodiment, the fault transfer and reconstruction module generates a retransmission set. Perform strict sorting operations. The module is based on timing labels. The numerical values ​​are used to sort the data frames in the set in ascending order.

[0087] After sorting, the module sequentially writes these data frames into the newly established streaming backbone tunnel. Through this strictly ordered replay mechanism, the system ensures that even during network outages, complex operation sequences performed by users in different tabs can still be received and executed by the server in the original logical order after the connection is restored. This completely eliminates the risk of out-of-order execution common in distributed network environments and guarantees the eventual consistency of business logic.

[0088] Please see the appendix Figure 2 A browser-based page plugin-free communication system and method include the following steps: S1. Use a Service Worker residing in the browser background to intercept HTTP business requests initiated by the view layer; S2. Maintain a virtual logical clock inside the Service Worker. Update the clock value every time a request is intercepted, and assign the value as a time sequence label to the request. S3. Write the request data with time-series tags to the local transactional mail box for persistent storage; S4. Send request data through the unique streaming backbone tunnel established between Service Worker and the server; S5. When an interruption of the streaming trunk tunnel is detected, keep the view layer in a waiting state without reporting an error, and continue to receive new requests and store them in the transactional outgoing mail box during this period. S6. After the tunnel connection is re-established, a handshake is performed with the server to obtain the last sequence number confirmed by the server. S7. Retrieve all requests with time tags greater than the last sequence number from the transactional outgoing mail box, and replay them through the new tunnel in the order of the time tags.

[0089] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A browser-based page-based plug-in-free communication system, characterized in that, include: The view layer module, consisting of browser tabs or browsing context, is used to initiate standard HTTP business requests and receive response data; The virtual gateway layer module, as a Service Worker instance residing in the browser background, is used to intercept business requests initiated by the view layer module and establish a unique streaming backbone tunnel with the server. The backbone tunnel control module is used to establish a full-duplex long-term connection tunnel with the server via the Fetch API or Stream API, and to maintain the lifecycle state of the connection. The request interception and serialization module is used to capture the business request, maintain a monotonically increasing virtual logical clock, and use the value generated by the virtual logical clock to assign a globally unique time sequence label to each business request. The transactional mail box module is used to build a persistent queue based on the browser's local storage. Before sending data through the streaming backbone tunnel, business request data with time-series tags is written into the persistent queue. The failover and reconfiguration module is used to extract unfinished requests from the transactional mail box module and replay them in an orderly manner based on the timing status confirmed by the server after the streaming trunk tunnel is interrupted and the connection is restored.

2. The browser-based page-based plug-in-free communication system according to claim 1, characterized in that, The streaming trunk tunnel established by the trunk tunnel control module is a transmission channel based on the HTTP / 2 or HTTP / 3 protocol. The virtual gateway layer module is used to multiplex concurrent HTTP service requests initiated by multiple view layer modules into the single streaming backbone tunnel for transmission, without having to establish an independent WebSocket connection for each view layer module.

3. The browser-based page-based plug-in-free communication system according to claim 1, characterized in that, The request interception and serialization module executes the following logic when processing the virtual logical clock: A global counter is maintained within the virtual gateway layer module. Whenever a new service request is intercepted, the value of the global counter is increased by a unit step, and the updated value is assigned as the time sequence label to the data frame generated by the service request, thereby mapping concurrent requests from different view layer modules into a strictly total order request set.

4. The browser-based page-based plug-in-free communication system according to claim 1, characterized in that, The transactional mail box module writes data in a synchronous blocking manner, and only triggers the sending operation of the streaming backbone tunnel after the business request data is successfully written to the browser's IndexedDB or Cache Storage. The transactional mail box module is also used to receive confirmation signals from the server and clean up the data that has been transmitted in the persistent queue according to the maximum time tag confirmed by the server.

5. The browser-based page-based plug-in-free communication system according to claim 1, characterized in that, The failover and reconfiguration module is used to monitor the status of the streaming trunk tunnel. When an abnormality in the streaming object or a heartbeat timeout is detected, the system status is switched to reconnection status. In the reconnection state, the virtual gateway layer module continues to perform the operations of intercepting, serializing, and writing requests to the transactional mailbox module, but suspends the sending operation to the network.

6. The browser-based page-based plug-in-free communication system according to claim 5, characterized in that, After rebuilding the streaming trunk tunnel, the failover and reconstruction module first initiates a handshake synchronization process with the server. The handshake synchronization process is used to obtain the server confirmation sequence number corresponding to the last instruction that has been successfully processed by the server, and to use the server confirmation sequence number as the consistency synchronization breakpoint of the system.

7. The browser-based page-based plug-in-free communication system according to claim 6, characterized in that, The specific method by which the failover reconstruction module performs the ordered replay is as follows: Traverse the persistent queue in the transactional mailbox module, filter out all data frames whose time sequence tag is greater than the consistency synchronization breakpoint, and construct a retransmission set; The data frames in the retransmission set are sent to the server in strict order of time tag from smallest to largest through the reconstructed streaming backbone tunnel.

8. The browser-based page-based plug-in-free communication system according to claim 1, characterized in that, The virtual gateway layer module also includes a routing distribution module; The routing and distribution module is used to monitor the downlink response stream of the streaming backbone tunnel, parse the original request identifier in the response data packet returned by the server, and call back the response data to the corresponding view layer module according to the locally maintained request context mapping table.

9. The browser-based page-based plug-in-free communication system according to claim 5, characterized in that, The failover and reconfiguration module is also configured with an adaptive backoff strategy; When tunnel reconstruction fails, the waiting time for the next retry is calculated based on the exponential backoff algorithm, and a random jitter factor is introduced into the calculation result to prevent server connection congestion.

10. A browser-based page plugin-free communication system and a browser-based page plugin-free communication method, wherein the browser-based page plugin-free communication system according to any one of claims 1-9 is characterized in that, Includes the following steps: S1. Use a Service Worker residing in the browser background to intercept HTTP business requests initiated by the view layer; S2. Maintain a virtual logical clock inside the Service Worker. Update the clock value every time a request is intercepted, and assign the value as a time sequence label to the request. S3. Write the request data with time-series tags to the local transactional mail box for persistent storage; S4. Send request data through the unique streaming backbone tunnel established between Service Worker and the server; S5. When an interruption of the streaming trunk tunnel is detected, keep the view layer in a waiting state without reporting an error, and continue to receive new requests and store them in the transactional outgoing mail box during this period. S6. After the tunnel connection is re-established, a handshake is performed with the server to obtain the last sequence number confirmed by the server. S7. Retrieve all requests with time sequence tags greater than the last sequence number from the transactional outgoing mail box, and replay them through the new tunnel in the order of the time sequence tags.