Redis Key Name Generation via Member Structure Library
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Redis database's key management lacks uniformity when used for communication between different processes, leading to increased difficulty and workload due to diverse data structures and key combinations required for data access.
Innovation Solution
A key name generation method and apparatus that constructs a member structure library based on a set data structure template and member categories, allowing for unified management of key names by retrieving target member structure information and determining key description information for data access, enabling easy access to a Redis database.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If key descriptions are temporarily combined according to header file definitions for each data access operation, then data access flexibility is maintained, but development difficulty and workload increase significantly
Solution Approach 1:
The patent applies preliminary action by pre-defining key description templates and member structure information in the header file before runtime. Instead of combining keys temporarily during each access operation, the system pre-processes and stores structured key description templates that can be directly instantiated during data access, eliminating the need for complex runtime key combination logic and reducing development workload.
Solution Approach 2:
The patent introduces an intermediary layer in the form of key description templates and member structure information that mediates between the header file definitions and actual data access operations. This intermediary structure standardizes the key formation process, allowing flexible data access while reducing development complexity through a uniform access pattern.
2Adaptability or versatility
If diverse key descriptions are defined for different data structures, then specific data access requirements are met, but key management uniformity is lost
Solution Approach 1:
The patent applies universality by designing a unified key description template structure that can accommodate multiple data structures and access patterns. The template includes universal fields such as key prefix, member name, and path information that can be instantiated for different data structures while maintaining a consistent access methodology, thus achieving both diverse data structure coverage and uniform key management.
Solution Approach 2:
The patent uses parameter changes by allowing the key description template to be instantiated with different parameter values for different data structures. The template structure remains uniform, but specific parameters such as key prefix, member name, and path can be changed to suit different data access requirements, maintaining uniformity in management while providing adaptability.
3Productivity
If all key combination rules for a data structure are memorized, then complete data structure access is enabled, but development time and effort increase
Solution Approach 1:
The patent applies copying by using key description templates that serve as reusable patterns. Instead of manually constructing and memorizing key combinations for each data structure member, developers can copy and instantiate the standardized template with appropriate parameters, significantly reducing development time and effort while maintaining complete data structure access capability.
Data Source
AI summary
A key name generation method includes constructing a member structure library according to a set data structure template and member categories contained in various types of components, wherein the member structure library contains member structure information corresponding to each member category; upon acquiring a reading instruction for data, retrieving, from the member structure library on the basis of a data identifier carried in the reading instruction for the data, target member structure information matching the data identifier; and determining, on the basis of the target member structure information and a structure array identifier contained therein, key description information corresponding to the target member structure information, and taking the key description information as a key name of the data. A key name generation apparatus and a medium are also disclosed herein.

