Hot-Update Method Using Just-In-Time Compilation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing hot-update methods require specific design requirements for system programs, making it challenging to implement efficient online updates without losing runtime status and object availability.
Innovation Solution
A hot-update method that uses just-in-time compilation to generate update native code for modified functions, allowing the update native code to run in place of existing native code, while maintaining identical metadata identifiers to preserve existing objects and data recording dynamics.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the original DLL is unloaded to implement hot-update, then the updated DLL can be loaded, but the running status recorded in variables will be lost
Solution Approach 1:
The patent segments the DLL into multiple independent modules (e.g., module A, module B, module C) that can be unloaded and loaded independently. This allows the system to update specific modules without unloading the entire DLL, thereby preserving running status in other modules and avoiding complete loss of information.
Solution Approach 2:
The patent performs preliminary actions by creating backup copies of modules before unloading them and establishing mapping relationships between old and new modules. This ensures that running status can be preserved or restored by redirecting references to the appropriate module versions, preventing loss of information during updates.
2Reliability
If class definitions are separated from method definitions to enable hot-update, then objects can be preserved, but the system design becomes more complex
Solution Approach 1:
The patent segments the DLL into multiple modules with clear separation of class definitions and method definitions. Each module can be independently updated while preserving objects defined in other modules. This segmentation enables hot-update functionality while maintaining a manageable level of design complexity through modular organization.
Solution Approach 2:
The patent creates a universal mapping mechanism that works across all modules and handles both object preservation and method updates through a unified approach. The mapping table serves multiple purposes: tracking module versions, preserving object references, and enabling hot-update functionality across the entire system, thereby reducing overall design complexity despite the modular structure.
Data Source
AI summary
The embodiments of the present invention provide a hot-update method and apparatus. For example, the method can include: obtaining, in response to receiving a hot-update instruction by a running program, an update assembly and difference descriptions for describing differences between the update assembly and an existing assembly of the running program, wherein, identical metadata in the update assembly and existing assembly have identical identifiers; loading the update assembly into memory, and finding, in the update assembly, functions which have been modified with respect to the existing assembly according to the difference descriptions; performing just-in-time compilation to the modified functions thus found to obtain update native code; and running the update native code in place of corresponding existing native code of the modified functions when the existing native code is required to be run.


