Resource File Loading via Cached Data and Change Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing resource file loading methods for engines, such as game or special effect engines, suffer from low loading efficiency due to the need for parsing and converting resource files with inconsistent formats, which increases editing and loading time.
Innovation Solution
A method that involves acquiring an editable first resource file and storing both the file and its cached data, where the cached data is un-editable and smaller in size. The method determines if the resource file has changed and loads either the cached data if unchanged or the updated resource file if changed.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If resource files are stored in editable formats (e.g., FBX, PNG) for frequent user editing, then ease of operation is improved, but loading efficiency deteriorates due to parsing and conversion requirements
Solution Approach 1:
The patent pre-processes editable resource files into cached data formats during asset import or editing sessions. This preliminary action converts files into optimized formats suitable for runtime loading, eliminating the need for parsing and conversion during actual loading operations, thus resolving the contradiction between editable formats and loading efficiency
Solution Approach 2:
The patent creates cached copies of editable resource files in optimized formats. These cached copies are stored separately and used for loading operations, while the original editable files remain available for modification. This copying approach allows the system to load optimized data without sacrificing the ability to edit original files
2Productivity
If cached data is used to improve loading efficiency, then loading speed is improved, but file size reduction must be maintained without losing editability
Solution Approach 1:
The patent transforms resource files into cached data with different parameters - specifically converting to formats with smaller file sizes and optimized structures suitable for runtime. This parameter change allows the cached data to be more efficient for loading while the system manages both the original and cached versions appropriately
3Productivity
If the system checks for file changes to determine whether to load cached data or original files, then loading efficiency is improved, but additional processing time is required for change detection
Solution Approach 1:
The patent replaces manual or complex file comparison mechanisms with hash value-based change detection. By computing hash values of files and comparing them, the system efficiently determines whether files have changed without extensive processing, thus maintaining loading efficiency while minimizing additional processing time
Data Source
AI summary
The present application relates to a resource file loading method, apparatus, electronic device and storage medium, which are applied in the field of Internet technology. The method includes: acquiring an editable first resource file, storing the first resource file and cache data of the first resource file; wherein the cached data is un-editable, and the file size of the cached data is smaller than that of the first resource file; in response to a loading instruction for the first resource file, determining whether the first resource file has changed; if the first resource file has not changed, acquiring the cached data of the first resource file and loading the cached data of the first resource file; if the first resource file has changed, acquiring the first resource file and loading the first resource file.


