Shared Memory Block Indexing for Concurrent Vehicle Data Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In vehicle control systems with service-oriented architecture, multiple data publishers face difficulties in simultaneously writing data to a shared memory due to the need for locking the memory during writing operations, which prevents simultaneous reading and writing by other publishers and subscribers.
Innovation Solution
A data processing method that uses a writing index value to lock only the specific storage block being written to, allowing other publishers to write to different blocks simultaneously, while subscribers can read data from the shared memory without locking, using an ascending sequence to manage storage blocks effectively.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the shared memory is locked during writing operation, then data consistency is ensured, but simultaneous writing by multiple publishers is prevented
Solution Approach 1:
The shared memory is divided into multiple storage blocks, and the writing index value is used to lock only the specific storage block being written to, rather than locking the entire shared memory. This allows multiple publishers to write to different blocks simultaneously while maintaining data consistency within each block.
2Reliability
If the shared memory is locked during writing operation, then data consistency is ensured, but reading operations are blocked
Solution Approach 1:
The shared memory is segmented into multiple storage blocks with independent locking via the writing index value. Readers can access the shared memory without acquiring the lock, allowing simultaneous reading and writing operations on different blocks, thus improving reading efficiency while maintaining data consistency.
3Productivity
If multiple publishers write to the same storage block simultaneously, then writing throughput increases, but data inconsistency occurs
Solution Approach 1:
The writing index value is incremented before the actual writing operation to determine the target storage block. This preliminary action ensures that multiple publishers are directed to different storage blocks, preventing simultaneous writes to the same block and avoiding data inconsistency.
Data Source
AI summary
A data processing method for a shared memory includes: receiving a writing operation request of target data, the writing operation request being configured to request to write the target data to the shared memory; obtaining a writing index value in the shared memory, and updating the writing index value, an updated writing index value being 1 greater than the writing index value obtained before the updating, and the writing index value being configured to lock a storage block to which data is to be written; determining a storage block corresponding to the updated writing index value as a target storage block; and writing the target data to the target storage block.


