Redis data dynamic mapping method and device, terminal and storage medium
Redis query conditions are generated through custom annotation @RedisMap and reflection mechanisms, which solves the code bloat problem caused by hard coding in Redis cached data reading and parsing operations, and realizes dynamic mapping and format conversion, reducing R&D costs and maintenance complexity.
Patent Information
- Application Number
- CN202510548157.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the reading and parsing of Redis cached data is hard-coded, resulting in high code base expansion and maintenance complexity and increased R&D costs.
By custom annotation @RedisMap, iterate through the target class attribute fields, and use the reflection mechanism to generate Redis query conditions to realize dynamic mapping and format conversion, avoid hard-coded and redundant code.
It reduces the complexity of code maintenance, reduces redundant code, improves development efficiency and system maintainability, and adapts to changes in dynamic cache structures.
Smart Images

Figure CN120407634A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of databases, and in particular, to a Redis data dynamic mapping method, device, terminal, and storage medium. Background Art
[0002] In the prior art, the reading and parsing operations of Redis cache data are usually implemented in a hard-coded manner. Developers need to explicitly write Redis query statements and data conversion logics for each business object. When facing changes in different business entities or field structures, it is necessary to repeatedly develop underlying code modules such as key name splicing, hash table parsing, and type conversion, resulting in the generation of a large amount of redundant code. This mechanical coding mode not only causes the code library to expand, but also makes it necessary to synchronously modify multiple associated codes during subsequent maintenance for any adjustment of the data structure, significantly increasing the complexity and error probability of code maintenance and raising the R & D cost.
[0003] Therefore, the prior art has defects and needs to be improved and developed. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a Redis data dynamic mapping method, device, terminal, and storage medium for the above-mentioned defects of the prior art, aiming to solve the problem of increased R & D cost caused by the hard-coded method in the prior art.
[0005] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a Redis data dynamic mapping method, and the method includes:
[0007] Traverse all attribute fields in the target class to determine the attribute fields carrying custom annotations;
[0008] For each attribute field carrying a custom annotation, use its custom annotation to perform a Redis query to obtain the corresponding original data;
[0009] Convert the format of the original data and map it to the corresponding attribute field carrying the custom annotation.
[0010] In an implementation manner, traversing all attribute fields in the target class to determine the attribute fields carrying custom annotations includes:
[0011] Traverse all attribute fields in the target class;
[0012] Perform annotation scanning on each attribute field through the reflection mechanism;
[0013] Identify the attribute fields carrying custom annotations.
[0014] In one embodiment, a Redis query is performed using its custom annotation to obtain corresponding original data, including:
[0015] Determine the source data field value corresponding to the custom annotation, and process the source data field value and the custom annotation to obtain a query condition;
[0016] Execute a Redis query operation according to the query condition to obtain the corresponding original data.
[0017] In one embodiment, determining the source data field value corresponding to the custom annotation includes:
[0018] Parse the custom annotation to obtain a key template;
[0019] According to the placeholder in the key template, read the property field value with the corresponding name in the target class instance through the reflection mechanism, and use the property field value as the source data field value, and the source data field value can be single or multiple.
[0020] In one embodiment, parsing the custom annotation also obtains a target field; processing the source data field value and the custom annotation to obtain a query condition includes:
[0021] When the source data field value is single, generate a single Redis data key according to the source data field value and the key template of the custom annotation;
[0022] When the source data field value is multiple, generate multiple Redis data keys according to the source data field value and the key template of the custom annotation;
[0023] Based on the single or multiple Redis data keys and the name of the target field defined in the custom annotation, a query condition is formed.
[0024] In one embodiment, executing a Redis query operation according to the query condition to obtain the corresponding original data includes:
[0025] When the query condition contains a single Redis data key, execute a hash table field query operation to obtain the corresponding original data;
[0026] When the query condition contains multiple Redis data keys, use a batch query operation to obtain the corresponding original data in the order of Redis key names.
[0027] In one embodiment, converting the format of the original data and mapping it to the property field carrying the custom annotation includes:
[0028] When the original data is a single JSON data, parse the JSON data into a MAP container, extract the value of the target field from it, and map the value of the target field to the corresponding property field with a custom annotation through the Java reflection mechanism;
[0029] When the original data is multiple JSON data, parse each JSON data into a MAP container, extract the value of the target field from it, splice the extracted multiple values of the target field into a string in the query order, and map the string to the corresponding property field with a custom annotation through the Java reflection mechanism.
[0030] In a second aspect, an embodiment of the present invention further provides a Redis data dynamic mapping device, and the device includes:
[0031] A traversal module, configured to traverse all property fields in a target class to determine the property fields with custom annotations;
[0032] A Redis query module, configured to perform a Redis query for each property field with a custom annotation by using its custom annotation to obtain the corresponding original data;
[0033] A mapping module, configured to perform format conversion on the original data and map it to the corresponding property field with a custom annotation.
[0034] In a third aspect, an embodiment of the present invention further provides a terminal, and the terminal includes: a memory, a processor, and a Redis data dynamic mapping program stored on the memory and executable on the processor. When the Redis data dynamic mapping program is executed by the processor, the steps of the Redis data dynamic mapping method described above are implemented.
[0035] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, and the computer-readable storage medium stores a Redis data dynamic mapping program, and the Redis data dynamic mapping program can be executed to implement the steps of the Redis data dynamic mapping method described above.
[0036] The beneficial effects of the present invention: By traversing all property fields in a target class, the present invention determines the property fields with custom annotations; for each property field with a custom annotation, a Redis query is performed by using its custom annotation to obtain the corresponding original data; the original data is subjected to format conversion and mapped to the corresponding property field with a custom annotation. By setting a custom annotation and using the custom annotation to perform a Redis query, the present invention avoids the generation of redundant code and is convenient for maintenance, effectively reducing the R & D cost. Description of the Drawings
[0037] Figure 1 It is a flowchart of a preferred embodiment of the Redis data dynamic mapping method in the present invention.
[0038] Figure 2 It is a schematic diagram of Redis query in the present invention.
[0039] Figure 3 It is a flowchart of a single JSON data mapping in the present invention.
[0040] Figure 4 It is a schematic structural diagram of a preferred embodiment of the Redis data dynamic mapping device in the present invention.
[0041] Figure 5 It is a schematic block diagram of the terminal principle in the present invention. Specific implementation manners
[0042] To make the objectives, technical solutions and advantages of the present invention clearer and more explicit, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0043] In the prior art, the reading and parsing operations of Redis cache data are usually implemented in a hard-coded manner. Developers need to explicitly write Redis query statements and data conversion logics for each business object. When facing changes in different business entities or field structures, it is necessary to repeatedly develop underlying code modules such as key name splicing, hash table parsing, and type conversion, resulting in the generation of a large amount of redundant code. This mechanical coding mode not only causes the code library to expand, but also makes it necessary to synchronously modify multiple associated codes during subsequent maintenance for any adjustment of the data structure, significantly increasing the complexity and error probability of code maintenance and raising the R & D cost.
[0044] In view of the above defects of the prior art, the present invention provides a Redis data dynamic mapping method, device, terminal and storage medium. The method includes: traversing all attribute fields in the target class to determine the attribute fields carrying custom annotations; for each attribute field carrying custom annotations, using its custom annotation to perform a Redis query to obtain the corresponding original data; performing format conversion on the original data and mapping it to the corresponding attribute field carrying custom annotations. The present invention avoids the generation of redundant code and is convenient for maintenance by setting custom annotations and using custom annotations to perform Redis queries, effectively reducing the R & D cost.
[0045] Please refer to Figure 1 , the Redis data dynamic mapping method described in the embodiment of the present invention includes the following steps:
[0046] Step S100: Traverse all the attribute fields in the target class to determine the attribute fields with custom annotations.
[0047] Specifically, traverse all the attribute fields in the target class, perform annotation scanning on each attribute field through the reflection mechanism, and identify the attribute fields with custom annotations. The custom annotation can be declared as @RedisMap. That is to say, traverse all the attribute fields in the class, and as long as there is an attribute field declared with @RedisMap, it can be considered to carry a custom annotation. The subsequent steps will generate Redis query conditions based on the rules defined in this annotation (such as key templates, target field names, etc.). This design realizes declarative configuration, decouples the logic of "what data to query and how to query" from the business code, and effectively reduces the generation of redundant code.
[0048] Please refer to Figure 1 , the Redis data dynamic mapping method described in the embodiments of the present invention further includes the following steps:
[0049] Step S200: For each attribute field with a custom annotation, use its custom annotation to perform a Redis query to obtain the corresponding original data.
[0050] Specifically, determine the source data field value corresponding to the custom annotation, process the source data field value and the custom annotation to obtain a query condition; execute a Redis query operation according to the query condition to obtain the corresponding original data. The present invention defines the query logic through annotations, avoids hard-coding key name splicing, and reduces the code coupling degree. Even when the Redis storage structure is adjusted, only the annotation configuration needs to be modified instead of the business code, effectively reducing redundant code and reducing the R & D cost.
[0051] In one implementation, determining the source data field value corresponding to the custom annotation includes:
[0052] Parse the custom annotation to obtain a key template;
[0053] According to the placeholder in the key template, read the attribute field value with the corresponding name in the target class instance through the reflection mechanism, and use this attribute field value as the source data field value. The source data field value can be single or multiple.
[0054] Specifically, the custom annotation contains a key template and a target field. The key template contains placeholders that are the same as the property field names in the target class instance. The target field is the field to be queried in Redis. For example, if the placeholder in the key template is Venueid, the property field value of Venueid in the target class instance is read through the reflection mechanism. If the Venueid field value is 12, then this field value is used as the source data field value, and at this time the source data field value is single. If the property field value of Venueid in the target class instance read through the reflection mechanism is 13, 14, 15, then these three field values are used as the source data field values, and at this time the source data field values are multiple. The present invention automatically injects runtime property values through placeholders, eliminating the maintenance cost of hard-coded key names. It supports single ID and multiple IDs, and can batch process queries without modifying the mapping logic, avoiding errors that may be caused by manual key name assembly, and effectively improving the R & D efficiency.
[0055] In one implementation, parsing the custom annotation also obtains the target field; processing the source data field value and the custom annotation to obtain a query condition, including:
[0056] When the source data field value is single, generate a single Redis data key according to the source data field value and the key template of the custom annotation;
[0057] When the source data field value is multiple, generate multiple Redis data keys according to the source data field value and the key template of the custom annotation;
[0058] Based on the single or multiple Redis data keys, and the name of the target field defined in the custom annotation, form a query condition.
[0059] Specifically, substituting the source data field value into the placeholder of the key template can obtain the Redis data key. If the source data field value is multiple, substitute it into the placeholder of the key template respectively to obtain multiple Redis data keys. The key generation rule of the present invention is encapsulated in the custom annotation, eliminating errors caused by manual splicing. In addition, the business code is completely isolated from the cache structure change, effectively enhancing the maintainability of the system and avoiding redundant code.
[0060] In one implementation, perform a Redis query operation according to the query condition to obtain the corresponding original data, including:
[0061] When the query condition contains a single Redis data key, perform a hash table field query operation to obtain the corresponding original data;
[0062] When the query condition contains multiple Redis data keys, use a batch query operation to obtain the corresponding original data in the order of Redis key names.
[0063] Specifically, as Figure 2 shown, when there is only one Redis data key, the hash table is directly queried to obtain the original data. When multiple Redis data keys are included, the original data is obtained by means of batch query. For example: if the target field in the custom annotation is name and the Redis key is Venueid: 12, then a query condition is formed according to the target field and the Redis key, and a hash table field query is executed to obtain the corresponding name as "A Gymnasium". If the target field in the custom annotation is name and the Redis keys are Venueid: 12, Venueid: 13, Venueid: 14, then a query condition is formed according to the target field and the Redis keys, and a batch query is executed to obtain the corresponding names as "A Gymnasium", "B Gymnasium", "C Gymnasium". Existing annotation technologies such as JPA's @Column only support the definition of static metadata and cannot handle dynamic cache data structures. However, the present invention combines a custom annotation @RedisMap with a dynamic key generation and reflection mechanism to break through the limitations of traditional static metadata annotations and achieve flexible adaptation to dynamic cache data structures. It can effectively handle dynamic cache data structures.
[0064] Please refer to Figure 1 , the Redis data dynamic mapping method described in the embodiment of the present invention further includes the following steps:
[0065] Step S300, convert the format of the original data and map it to the corresponding attribute field carrying the custom annotation.
[0066] Specifically, as Figure 3 shown, when the original data is a single JSON data, the JSON data is parsed into a MAP container, and the value of the target field is extracted therefrom, and the value of the target field is mapped to the corresponding attribute field carrying the custom annotation through the Java reflection mechanism. When the original data is multiple JSON data, each JSON data is parsed into a MAP container, and the value of the target field is extracted therefrom, and the extracted multiple target field values are concatenated in the query order, and the string is mapped to the corresponding attribute field carrying the custom annotation through the Java reflection mechanism. The present invention realizes the dynamic binding of cache data and object fields by automatically parsing JSON data and intelligently processing single-value mapping and multi-value concatenation. Its core function is to eliminate the repetitive labor of manual parsing code, and at the same time ensure mapping flexibility through the reflection mechanism, enabling developers to complete the standardized processing of complex cache structures only by declaring annotations, significantly improving development efficiency and data consistency.
[0067] In addition, in existing splicing technologies, it is common for multiple data splices to generate the trailing comma problem. For example, when splicing A, B, and C, it is easy to form a string like "A,B,C, ". Developers need to manually process the trailing delimiter. In the process of splicing the values of multiple target fields in the order of query, the present invention avoids the trailing comma by limiting the delimiter to be inserted only between elements. In this way, a string like "A,B,C" can be formed, eliminating the need to manually truncate the trailing comma and reducing code branches.
[0068] In summary, the present invention sets custom annotations and uses them for Redis queries, avoiding the generation of redundant code and facilitating maintenance, effectively reducing R & D costs. Through the combination of the custom annotation @RedisMap with the dynamic key generation and reflection mechanism, the present invention breaks through the limitations of traditional static metadata annotations and realizes flexible adaptation to dynamic cache data structures, effectively handling dynamic cache data structures. In the process of splicing the values of multiple target fields in the order of query, the present invention avoids the trailing comma by limiting the delimiter to be inserted only between elements, eliminating the need to manually truncate the trailing comma and reducing code branches. The technical solution of the present invention can be widely applied to high-concurrency, multi-source heterogeneous data interaction scenarios, such as e-commerce, Internet of Things, fintech and other fields.
[0069] In one embodiment, as Figure 4 shown, based on the above Redis data dynamic mapping method, the present invention also correspondingly provides a Redis data dynamic mapping device, which includes:
[0070] A traversal module for traversing all the attribute fields in the target class to determine the attribute fields carrying custom annotations;
[0071] A Redis query module for, for each attribute field carrying a custom annotation, using its custom annotation to perform a Redis query to obtain the corresponding original data;
[0072] A mapping module for converting the format of the original data and mapping it to the corresponding attribute field carrying the custom annotation.
[0073] In one embodiment, the traversal module includes:
[0074] A traversal subunit for traversing all the attribute fields in the target class;
[0075] A scanning unit for performing annotation scanning on each attribute field through the reflection mechanism;
[0076] An identification unit for identifying the attribute fields carrying custom annotations.
[0077] In one embodiment, the device further includes:
[0078] A query condition generation unit, configured to determine the source data field value corresponding to the custom annotation, process the source data field value and the custom annotation, and obtain a query condition;
[0079] A query execution unit, configured to perform a Redis query operation according to the query condition and obtain the corresponding original data.
[0080] In one embodiment, the apparatus further includes:
[0081] A parsing unit, configured to parse the custom annotation to obtain a key template;
[0082] A source data field value determination unit, configured to read the property field value with the corresponding name in the target class instance through the reflection mechanism according to the placeholder of the key template, and use the property field value as the source data field value, where the source data field value can be single or multiple.
[0083] In one embodiment, parsing the custom annotation further obtains a target field; the apparatus further includes:
[0084] A first data key generation unit, configured to generate a single Redis data key according to the source data field value and the key template of the custom annotation when the source data field value is single;
[0085] A second data key generation unit, configured to generate multiple Redis data keys according to the source data field value and the key template of the custom annotation when the source data field value is multiple;
[0086] A query condition formation unit, configured to form a query condition based on the single or multiple Redis data keys and the name of the target field defined in the custom annotation.
[0087] In one embodiment, the apparatus further includes:
[0088] A first query execution unit, configured to perform a hash table field query operation to obtain the corresponding original data when the query condition includes a single Redis data key;
[0089] A second query execution unit, configured to perform a batch query operation to obtain the corresponding original data in the order of the Redis key names when the query condition includes multiple Redis data keys.
[0090] In one embodiment, the mapping module includes:
[0091] A single JSON data mapping unit, which is used to parse the JSON data into a MAP container when the original data is a single JSON data, extract the value of the target field therefrom, and map the value of the target field to the corresponding attribute field carrying a custom annotation through the Java reflection mechanism;
[0092] Multiple JSON data mapping units, which are used to parse each JSON data into a MAP container when the original data is multiple JSON data, extract the value of the target field therefrom, splice the extracted multiple target field values into a string in the query order, and map the string to the corresponding attribute field carrying a custom annotation through the Java reflection mechanism.
[0093] Based on the above embodiments, the present invention further provides a terminal, and its structural schematic diagram can be as Figure 5 shown. The above terminal includes a processor, a memory, a network interface, and a display screen connected through a device bus. Among them, the processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device and a Redis data dynamic mapping program. The internal memory provides an environment for the operation of the operating device and the Redis data dynamic mapping program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal through a network connection. When the Redis data dynamic mapping program is executed by the processor, the steps of any one of the above Redis data dynamic mapping methods are implemented. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen.
[0094] Those skilled in the art can understand that Figure 5 the structural schematic diagram shown in
[0095] is only a schematic diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0096] The embodiment of the present invention further provides a computer-readable storage medium, on which a Redis data dynamic mapping program is stored. When the Redis data dynamic mapping program is executed by a processor, the steps of any one of the Redis data dynamic mapping methods provided by the embodiment of the present invention are implemented.
[0097] It should be understood that the sequence numbers of the steps in the above embodiments do not imply the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0098] Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the above device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit exists physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of mutual distinction and do not limit the protection scope of the present invention. The specific working process of the units and modules in the above device can refer to the corresponding process in the foregoing method embodiments and will not be elaborated here.
[0099] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0100] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0101] In the embodiments provided by the present invention, it should be understood that the disclosed device / terminal device and method can be implemented in other ways. For example, the device / terminal device embodiments described above are only illustrative. For example, the above division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0102] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not essentially depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A Redis data dynamic mapping method, characterized in that, The method includes: Traverse all the attribute fields in the target class to determine the attribute fields carrying custom annotations; For each attribute field carrying a custom annotation, perform a Redis query using its custom annotation to obtain the corresponding original data; Convert the format of the original data and map it to the corresponding attribute field carrying the custom annotation.
2. The Redis data dynamic mapping method according to claim 1, characterized in that Traverse all the attribute fields in the target class to determine the attribute fields carrying custom annotations, including: Traverse all the attribute fields in the target class; Perform annotation scanning on each attribute field through the reflection mechanism; Identify the attribute fields carrying custom annotations.
3. The Redis data dynamic mapping method according to claim 2, wherein Perform a Redis query using its custom annotation to obtain the corresponding original data, including: Determine the source data field value corresponding to the custom annotation, process the source data field value and the custom annotation to obtain a query condition; Execute a Redis query operation according to the query condition to obtain the corresponding original data.
4. The Redis data dynamic mapping method according to claim 3, wherein Determine the source data field value corresponding to the custom annotation, including: Parse the custom annotation to obtain a key template; According to the placeholder in the key template, read the attribute field value with the corresponding name in the target class instance through the reflection mechanism, and use this attribute field value as the source data field value. The source data field value can be single or multiple.
5. The Redis data dynamic mapping method according to claim 4, wherein Parsing the custom annotation also obtains the target field; processing the source data field value and the custom annotation to obtain a query condition, including: When the source data field value is single, generate a single Redis data key according to the source data field value and the key template of the custom annotation; When the source data field value is multiple, generate multiple Redis data keys according to the source data field value and the key template of the custom annotation; Based on the single or multiple Redis data keys, and the name of the target field defined in the custom annotation, form a query condition.
6. The Redis data dynamic mapping method according to claim 5, executing a Redis query operation according to the query condition to obtain the corresponding original data, including: When the query condition contains a single Redis data key, execute a hash table field query operation to obtain the corresponding original data; When the query condition contains multiple Redis data keys, use a batch query operation to obtain the corresponding original data in the order of Redis key names.
7. The Redis data dynamic mapping method according to claim 6, wherein Convert the format of the original data and map it to the attribute field carrying the custom annotation, including: When the original data is a single JSON data, parse the JSON data into a MAP container, extract the value of the target field from it, and map the value of the target field to the corresponding attribute field carrying the custom annotation through the Java reflection mechanism; When the original data is multiple JSON data, parse each JSON data into a MAP container, extract the value of the target field from it, splice the extracted multiple target field values into a string in the query order, and map the string to the corresponding attribute field carrying the custom annotation through the Java reflection mechanism.
8. A Redis data dynamic mapping device, characterized in that, Includes: A traversal module, used to traverse all the attribute fields in the target class and determine the attribute fields carrying custom annotations; A Redis query module, used to perform Redis queries for each attribute field carrying custom annotations by using its custom annotations to obtain the corresponding original data; A mapping module, used to convert the format of the original data and map it to the corresponding attribute fields carrying custom annotations.
9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a Redis data dynamic mapping program stored on the memory and executable on the processor. When the Redis data dynamic mapping program is executed by the processor, the steps of the Redis data dynamic mapping method according to any one of claims 1-7 are implemented.
10. A computer-readable storage medium, characterized in that, A Redis data dynamic mapping program is stored on the computer-readable storage medium. When the Redis data dynamic mapping program is executed by the processor, the steps of the Redis data dynamic mapping method according to any one of claims 1-7 are implemented.