Flash Partition Upgrade via Virtual APP MTD Under Limited Memory

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for updating Flash partitions in resource-constrained embedded systems face challenges due to insufficient memory resources and the unpredictability of content being loaded into memory, leading to program crashes during partition upgrades.

Innovation Solution

A method and device that utilize available DDR memory information to create a target virtual APP MTD partition and modify the readsect function to ensure data reading from this partition, allowing upgrades with minimal system changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the program content is loaded into memory for Flash partition upgrade, then the upgrade can be performed, but the memory resources are consumed and content may be reclaimed under memory pressure

Engineering Contradiction:
Improveupgrade success rateVSAvoidmemory resource consumption
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent uses mlock system call to pre-lock the memory pages containing the program content before the upgrade process begins. This preliminary action ensures that the memory pages are not reclaimed during the upgrade operation, guaranteeing that the content remains in memory throughout the critical upgrade process while avoiding continuous memory pressure on the system.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a memory locking mechanism (mlock) as an intermediary between the program content and the memory management system. This intermediary prevents the memory pages from being swapped out or reclaimed by the Linux memory management system, thereby ensuring reliable access to the content during the Flash partition upgrade without permanently consuming additional memory resources.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If ping-pong partitions are used for Flash partition upgrade, then the upgrade process is simplified, but the system requires additional Flash resources that are not available in resource-constrained embedded systems

Engineering Contradiction:
Improveupgrade process simplicityVSAvoidFlash resource requirement
Core Design Contradiction:
Ease of operationVSQuantity of substance

Solution Approach 1:

Instead of using ping-pong partitions which require duplicating the entire Flash partition structure, the patent copies only the necessary program content into locked memory pages. This selective copying approach allows the upgrade process to proceed with minimal Flash resource consumption while maintaining the simplicity of the upgrade operation. The copied content is then used directly from memory without requiring additional Flash partitions.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent extracts the essential program content from the Flash partition and places it into locked memory pages, separating the upgrade-critical data from the rest of the Flash storage system. This extraction eliminates the need for ping-pong partition structures while preserving the upgrade simplicity, as only the necessary content is copied and locked in memory for the upgrade process.

Inventive Principle:
Principle #2Taking out (Extraction)

3Quantity of substance

If the Linux page fault mechanism is used to load content on demand, then memory usage is optimized, but it cannot be guaranteed that all required content is pre-loaded into memory for upgrade

Engineering Contradiction:
Improvememory usage efficiencyVSAvoidcontent pre-loading guarantee
Core Design Contradiction:
Quantity of substanceVSReliability

Solution Approach 1:

The patent applies preliminary anti-action by using mlock to prevent the Linux page fault mechanism from swapping out or reclaiming the memory pages containing the program content before the upgrade process begins. This counteracts the default behavior of the page fault mechanism, ensuring that the required content remains in memory throughout the upgrade operation while still allowing efficient memory usage for non-critical content.

Inventive Principle:
Principle #9Preliminary anti-action

Data Source

PatentUS20260064301A1Flash partition upgrade method and device, appatatus, and storage nedium
Publication Date: 2026.03.05 HANGZHOU MEARI TECH CO LTD
  • US20260064301A1 patent drawing
  • US20260064301A1 patent drawing
  • US20260064301A1 patent drawing

AI summary

A Flash partition upgrade method and device, an apparatus, and a storage medium, applied to a SquashFS system are provided. The Flash partition upgrade method includes: obtaining available DDR memory information via a kernel command line and Linux; performing virtual partition creation and Flash memory copy based on the available DDR memory information and a preset virtual partition creation rule to obtain a target virtual APP MTD partition and a copy status record identifier corresponding to an APP partition in system Flash; by modifying implementation of a preset readsect function, performing data reading based on the copy status record identifier and the target virtual APP MTD partition to obtain target data; in response to a corresponding APP partition upgrade trigger condition being met, performing partition upgrade based on the target data. In this way, Flash partition upgrade under the condition of limited resources can be effectively achieved.