Multi-business Long Connection Sharing via Dynamic Heartbeat
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current long connection systems have low utilization rates due to idle connections and inconsistent heartbeat times, leading to high CPU consumption and potential network instability, as they are not optimized for varied terminal types and network environments.
Innovation Solution
A method for establishing a shared long connection channel among multiple businesses, where a unique business ID is configured and a dynamic heartbeat time is calculated based on network conditions to maintain connection stability, allowing for efficient data transmission and information push between clients and servers.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a long connection is established for each business, then the connection can maintain stability, but the utilization rate of the long connection is low and most connections are in idle state
Solution Approach 1:
The patent merges multiple business long connections into a single shared long connection channel. The server establishes one long connection with each terminal, and multiple businesses share this connection through business ID identification. This eliminates idle connections while maintaining stability, as the shared connection remains active and can serve multiple businesses simultaneously.
Solution Approach 2:
The shared long connection channel is designed to serve multiple businesses universally. By introducing business ID as an identification mechanism, the same connection channel can handle different business types (e.g., news pushing, weather information, app updates) without requiring separate dedicated connections for each business, thus improving utilization while maintaining reliability.
2Reliability
If heartbeat time is unified to the lowest value to ensure connection survival in poor networks, then connection reliability is improved, but CPU consumption increases and energy is highly consumed
Solution Approach 1:
The patent implements dynamic heartbeat time adjustment where each terminal determines its own heartbeat interval based on its specific network environment and terminal type. Instead of using a unified conservative heartbeat time, terminals with good network conditions can use longer intervals (reducing CPU and energy consumption), while terminals with poor networks use shorter intervals (maintaining connection survival). This dynamic adaptation resolves the contradiction between reliability and energy consumption.
Solution Approach 2:
The heartbeat time parameter is changed from a fixed unified value to a variable value that adapts to different network conditions and terminal types. The system allows terminals to adjust the heartbeat interval parameter according to their specific circumstances, enabling optimal balance between connection reliability and energy efficiency for each individual terminal.
3Reliability
If separate long connections are established for each terminal business, then each business can maintain stable connection, but device complexity increases and management becomes difficult
Solution Approach 1:
The patent combines multiple business connections into a single shared connection channel per terminal. Instead of managing separate connections for each business, the system uses one long connection with business ID identification to manage all business communications, significantly reducing connection management complexity while maintaining individual business stability through ID-based routing.
Data Source
AI summary
The present disclosure discloses a long connection sharing method for multi-businesses. The method includes the following steps: a client of the long connection establishes a channel, and obtains heartbeat time; the server of the long connection configures an unique business ID for each business, and sends the business ID to the client of the long connection; the client of the long connection transmits the business ID to a business client, and then the business client reports the business ID to a business server corresponding to the business client; after receiving business information, the server of the long connection sends the business information to the client of the long connection through the channel; and the client of the long connection pushes the business information to the business client. The present disclosure also discloses a long connection sharing system for multi-businesses, and a device and a terminal thereof.


