Redis Publish-Subscribe Data Interaction for Stable Process Communication
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data interaction methods in software systems, such as socket communication and internal memory sharing, lead to instability and reduced robustness due to reliance on other module implementations and shared memory contamination, affecting system performance and code stability.
Innovation Solution
A data interaction method using redis database publish-subscribe mechanisms to monitor and manage communication information through function and command words, ensuring decoupling of modules and maintaining data integrity by integrating valid information into local storage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional inter-process communication methods (socket, pipeline, internal memory sharing) are used for data interaction between modules, then modules can communicate with each other, but system stability and code robustness deteriorate due to reliance on other module implementations and shared memory contamination
Solution Approach 1:
The patent segments the communication mechanism by introducing a message queue system that divides data interaction into independent producer and consumer processes. Each process can independently publish or subscribe to messages without direct dependencies on other processes' implementation states, thereby improving system stability while maintaining modular communication capabilities.
Solution Approach 2:
The patent introduces a message queue as an intermediary component between different functional modules. This mediator receives messages from producers and delivers them to consumers without requiring the consuming process to be in a specific state, thus decoupling module dependencies and improving reliability without adding significant complexity.
2Productivity
If internal memory sharing communication is configured for interaction between multiple processes and threads, then data can be shared efficiently, but data security and system robustness worsen due to contamination risks when one functional module fails
Solution Approach 1:
The patent extracts data from shared internal memory and stores it in a structured message queue format. Messages are taken out of the shared memory context and encapsulated with metadata (function words, command words, timestamps), allowing efficient data interaction while preventing contamination spread. Failed modules cannot contaminate the entire system since each message is independently validated and stored.
Solution Approach 2:
The patent changes the data structure parameters by introducing function words, command words, and timestamp fields to messages. These parameter changes enable the system to track message origins, validate data integrity, and detect changes efficiently, thereby maintaining data security while preserving interaction efficiency through structured formatting.
3Measurement precision
If polling code logics are used to detect changes in shared internal memory, then data changes can be monitored, but system performance and operation efficiency deteriorate due to numerous useless polling operations
Solution Approach 1:
The patent replaces continuous polling with periodic action by using event-driven message publishing. Instead of continuously checking for changes, the system publishes messages periodically or on-demand when changes occur. Consumers subscribe to specific channels and are notified only when relevant messages are published, eliminating useless polling operations while maintaining accurate change detection.
Solution Approach 2:
The patent implements feedback mechanisms through message acknowledgments and change notifications. When data changes occur, the system publishes messages with feedback information (function words indicating change types, command words indicating operations needed). Consumers receive this feedback and take appropriate actions, eliminating the need for continuous polling while maintaining precise change detection.
4Ease of operation
If socket communication is used for restful interface to communicate with IPMI module, then data can be obtained from web interface, but system robustness worsens when IPMI function is abnormal or process exits
Solution Approach 1:
The patent applies beforehand cushioning by implementing message queuing and buffering mechanisms. When the IPMI module or web interface experiences abnormalities, messages are buffered in the message queue rather than being lost. The system can recover and resume normal operation once the abnormality is resolved, ensuring service continuity without requiring direct real-time connectivity between all components.
Data Source
AI summary
The present application relates to a data interaction method and apparatus, and a computer device and a storage medium. The method includes: constructing function words and command words, which are related to communication information configured for performing interaction with a software system; setting a channel for publishing and subscribing to a remote dictionary server database monitoring the function words and the command words on the channel in real time to identify a changed function word and/or command word; determining whether the changed function word and/or command word is data information required or maintained by a target process; if yes, maintaining corresponding communication information to a storage space of the target process; writing the obtained communication information into the remote dictionary server database; and publishing the function words and the command words onto the channel for use by other processes.


