Nested data processing method, apparatus and related product

CN122964150APending Publication Date: 2026-10-23CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610866984.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-16
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

然而,该处理方法无法根据不同的应用场景动态调整扁平化规则

Benefits of technology

[0008]借由上述技术方案,本申请实施例提供的嵌套数据处理方法、装置及相关产品,该方法可以通过响应用户的模板选择指令确定包含分隔符参数、键名处理规则参数的基础数据处理模板,搭建起数据扁平化的基础配置框架,接着根据用户对基础模板配置参数的修改指令调整生成适配具体场景的执行规则集,实现扁平化处理规则的自定义配置,最终依托执行规则集对嵌套数据进行处理得到一维键值对形式的扁平化数据,能够在一定程度上解决现有通用JSON库仅支持固定分隔符和拼接方式、无法动态调整扁平化规则的缺陷,可灵活适配不同应用场景的差异化格式需求,无需开发者为每个场景单独编写嵌套数据处理脚本,可大幅降低多云环境中嵌套数据处理的开发和维护成本,有效提升嵌套数据扁平化处理的整体效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122964150A_ABST
    Figure CN122964150A_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field and discloses a nested data processing method and device and related products; the method comprises the following steps: obtaining to-be-processed nested data; in response to a template selection instruction sent by a user, determining a basic data processing template; configuration parameters in the basic data processing template at least comprise a separator parameter and a key name processing rule parameter; in response to a modification instruction sent by the user for the configuration parameters in the basic data processing template, modifying the data and the basic data processing template according to the configuration parameters in the modification instruction to generate an execution rule set; and processing the to-be-processed nested data by using the execution rule set to obtain flattened data corresponding to the to-be-processed nested data, wherein the flattened data is a one-dimensional key-value pair set. The application can dynamically adapt to the flattened format requirements of the nested data in different scenes by template configuration and self-defined modification of the flattened rule, thereby significantly improving the nested data flattening processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a nested data processing method, apparatus, and related products. Background Technology

[0002] With the widespread adoption of cloud computing technology, multi-cloud architecture has become the mainstream direction for enterprise digital transformation. However, the interface design standards of different cloud platforms vary significantly, and their interaction messages generally contain complex structures such as multi-level nested dictionaries and lists. These hierarchical relationships not only increase the difficulty of data parsing but also cause great inconvenience to subsequent storage, analysis, and cross-platform exchange. Therefore, flattening nested data is particularly necessary. By converting complex hierarchical structures into simple key-value pairs, the barriers caused by data heterogeneity can be effectively eliminated, ensuring data consistency and operability in a multi-cloud environment.

[0003] Currently, common methods for handling nested data mainly rely on general-purpose JSON libraries, such as Python's `flatten_dict` library and the `pandas.json_normalize` method. These tools can flatten nested structures by concatenating parent and child keys using fixed delimiters, such as using underscores by default to merge multi-level keys into a single key, thus expanding the nested structure into a flat format. However, this approach cannot dynamically adjust the flattening rules according to different application scenarios. For example, API interfaces typically require dot delimiters (e.g., `user.address.city`), while database storage commonly uses underscore delimiters (e.g., `user_address_city`), but existing tools only support fixed delimiters and concatenation methods, making it difficult to adapt to these diverse needs. Because it is impossible to meet diverse format requirements through simple configuration, developers have to write separate processing scripts for each scenario, leading to a significant increase in development and maintenance costs when dealing with complex data in multi-cloud environments, and hindering overall efficiency improvement. Therefore, it is urgent to solve this technical problem. Summary of the Invention

[0004] In view of the above situation, this application provides a nested data processing method, apparatus and related products, which aim to solve the above problems or at least partially solve the above problems.

[0005] In a first aspect, embodiments of this application provide a nested data processing method, the method comprising: Retrieve nested data to be processed; In response to a template selection instruction sent by the user, a basic data processing template is determined; the configuration parameters in the basic data processing template include at least: delimiter parameters and key name processing rule parameters; In response to a user's instruction to modify the configuration parameters in the basic data processing template, the data and the basic data processing template are modified according to the configuration parameters in the instruction, and an execution rule set is generated. The nested data to be processed is processed using the set of execution rules to obtain flattened data corresponding to the nested data to be processed. The flattened data is a set of one-dimensional key-value pairs.

[0006] Secondly, embodiments of this application also provide a nested data processing apparatus, the apparatus comprising: The acquisition module is used to acquire nested data to be processed. The template selection module is used to determine the basic data processing template in response to the template selection command sent by the user; the configuration parameters in the basic data processing template include at least: delimiter parameters and key name processing rule parameters; A custom module is used to respond to user-sent instructions to modify configuration parameters in the basic data processing template, modify data and the basic data processing template according to the configuration parameters in the modification instructions, and generate an execution rule set; The processing module is used to process the nested data to be processed using the execution rule set to obtain flattened data corresponding to the nested data to be processed, wherein the flattened data is a one-dimensional key-value pair set.

[0007] Thirdly, embodiments of this application also provide an electronic device, including: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the steps of the nested data processing method described above.

[0008] By utilizing the above technical solutions, the nested data processing method, apparatus, and related products provided in this application embodiment can determine a basic data processing template containing delimiter parameters and key name processing rule parameters in response to the user's template selection instruction, thereby establishing a basic configuration framework for data flattening. Then, based on the user's modification instruction on the basic template configuration parameters, an execution rule set adapted to specific scenarios is generated to achieve custom configuration of flattening processing rules. Finally, the nested data is processed based on the execution rule set to obtain flattened data in the form of one-dimensional key-value pairs. This can, to a certain extent, solve the shortcomings of existing general-purpose JSON libraries that only support fixed delimiters and concatenation methods and cannot dynamically adjust flattening rules. It can flexibly adapt to the differentiated format requirements of different application scenarios, eliminating the need for developers to write nested data processing scripts separately for each scenario. This can significantly reduce the development and maintenance costs of nested data processing in multi-cloud environments and effectively improve the overall efficiency of nested data flattening processing.

[0009] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating the nested data processing method provided in an embodiment of this application is shown; Figure 2 A schematic diagram of the structure of the nested data processing apparatus provided in an embodiment of this application is shown; Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0011] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0012] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the term "comprising" and its variations should be interpreted as open-ended terms meaning "including but not limited to."

[0014] As mentioned earlier, existing methods for processing nested data mainly rely on general JSON libraries, such as Python's `flatten_dict` library and the `pandas.json_normalize` method. These tools can flatten the nested structure by concatenating parent and child keys using a fixed delimiter, such as using underscores by default to merge multi-level keys into a single key. However, this method cannot dynamically adjust the flattening rules according to different application scenarios. For example, API interfaces typically require dot delimiters (e.g., `user.address.city`), while database storage commonly uses underscore delimiters (e.g., `user_address_city`), but existing tools only support fixed delimiters and concatenation methods, making it difficult to adapt to these diverse needs. Because it is impossible to meet diverse format requirements through simple configuration, developers have to write separate processing scripts for each scenario, resulting in significantly increased development and maintenance costs and difficulty in improving overall efficiency when dealing with complex data in multi-cloud environments. Based on this, this invention proposes a nested data processing method, apparatus, and related products, which will be described in detail below through specific embodiments.

[0015] To facilitate understanding of this embodiment, a detailed description of the nested data processing method disclosed in this application embodiment will be provided first. The execution subject of the nested data processing method provided in this application embodiment is generally a computer device with a certain computing capability. This computer device includes, for example, a terminal device, a server, or other processing devices. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a personal digital assistant (PDA), a handheld device, etc. In some possible implementations, the nested data processing method can be implemented by the processor calling computer-readable instructions stored in the memory.

[0016] Figure 1 This document illustrates a flowchart of a nested data processing method provided in an embodiment of this application. Figure 1 It can be seen that the embodiments of this application include at least steps S101-S104: S101: Obtain the nested data to be processed; S102: In response to the template selection instruction sent by the user, determine the basic data processing template; the configuration parameters in the basic data processing template include at least: delimiter parameters and key name processing rule parameters; S103: In response to a user-sent instruction to modify the configuration parameters in the basic data processing template, modify the data and the basic data processing template according to the configuration parameters in the instruction, and generate an execution rule set; S104: Using the execution rule set, process the nested data to be processed to obtain flattened data corresponding to the nested data to be processed, wherein the flattened data is a one-dimensional key-value pair set.

[0017] As can be seen, this embodiment determines a basic data processing template containing delimiter parameters and key name processing rule parameters by responding to the user's template selection instruction, thus establishing a basic configuration framework for data flattening. Then, based on the user's modification instruction on the basic template configuration parameters, it adjusts and generates an execution rule set adapted to specific scenarios, realizing the custom configuration of flattening processing rules. Finally, it processes nested data based on the execution rule set to obtain flattened data in the form of one-dimensional key-value pairs. This can, to a certain extent, solve the shortcomings of existing general-purpose JSON libraries that only support fixed delimiters and concatenation methods and cannot dynamically adjust flattening rules. It can flexibly adapt to the differentiated format requirements of different application scenarios, eliminating the need for developers to write nested data processing scripts separately for each scenario. This can significantly reduce the development and maintenance costs of nested data processing in multi-cloud environments and effectively improve the overall efficiency of nested data flattening processing.

[0018] The following provides a detailed explanation of S101-S104.

[0019] Regarding the above S101: In this embodiment, the nested data to be processed is first obtained. The nested data is structured data with a multi-level key-value pair nested structure. In specific application scenarios, the sources of the nested data to be processed are diverse, including HTTP / HTTPS messages from cloud platform API interfaces, local message data (JSON format), or nested data structures such as dictionaries / lists in memory. For example, the nested data to be processed originates from a JSON message returned by the cloud platform API: "projects": { "regions": [ { "region_id": "test-1", "region_status": "normal", }, { "region_id": "Test-2", "region_status": "normal", } ], "id": "edbd05f7238d4b6b8024fa185852b145", "name": "hf1_ag_rs", "description": "Safety Management Network", "enabled": true, "tenant_name": "cncb_hftest_vdc", "level": 2, "parent": { "id": "adbd05f7238d4b874124fa185852b154", "name": "hf1_sc_rs } } In practice, a specified data source can be accessed through a pre-defined data reading interface to retrieve and load the original multi-level nested data. Furthermore, for HTTP / HTTPS messages from API interfaces, an HTTP / HTTPS adapter can be invoked for preprocessing; for local JSON files, a JSON parser can be invoked for parsing preprocessing; and for nested dictionary / list structures in memory, a recursive preprocessor can be invoked for traversal preprocessing. All three types of preprocessing tools filter out garbled characters, non-standard formats, and other abnormal data, ultimately yielding standardized nested data to be processed.

[0020] Regarding S102 above: In this step, the basic data processing template is a configuration template pre-stored in the template library, used to constrain the logic of nested data flattening. The separator parameter is used to set the character for concatenating nested level key names, and can take values ​​such as periods and underscores. The key name processing rule parameter is used to limit the processing logic such as key name filtering, whether to perform renaming mapping, and whether to convert capitalization. The template selection command is an operation command sent by the user through the interactive terminal, carrying the target template identification information.

[0021] In practice, the execution entity of this application embodiment can receive template selection instructions transmitted by the user in real time, parse the template identifier in the instructions, and match and determine the corresponding basic data processing template from the preset template library based on the identifier.

[0022] In some embodiments, the basic data processing template is an API interface data processing template; The value of the separator parameter is the English period (full stop). The parameter values ​​for the key name processing rule parameters include the option to select key name simplification; The configuration parameters also include a null value policy parameter, the value of which is to skip null values.

[0023] In this embodiment, the basic data processing template is specifically an API interface data processing template. This template is a dedicated preset configuration template designed to adapt to the flattening of cloud platform API interface messages and meet the API interface data interaction requirements.

[0024] In this template, the separator parameter is set to a period (.), meaning key names are concatenated using the format "parent key.child key," for example, concatenating multi-level nested keys as "user.address.city." The key name processing rule parameter includes a key name simplification option, which performs operations such as removing redundant key names and compressing key name length. The null value strategy parameter is a new configuration parameter in this embodiment, used to specify how null values ​​are handled in nested data. Its parameter value is "skip null values," meaning null key-value pairs in the data are filtered out.

[0025] In practice, in response to the user's selection of an API interface data processing template, the preset parameters for the template, including the delimiter, key name processing rules, and null value strategy, are automatically loaded to form the initial configuration content adapted to the API interface scenario, providing a scenario-based configuration foundation for the subsequent generation of execution rule sets.

[0026] This embodiment provides a dedicated API interface data processing template, along with configurations for English period separators, simplified key name rules, and a null value skipping strategy. This ensures that the format of the nested data after flattening fully conforms to the field naming conventions of the API interface. At the same time, it simplifies key name length and filters null data to reduce the volume of transmitted data, effectively improving the data transmission efficiency of the API interface. Developers do not need to manually adjust various configuration parameters for API scenarios. It can directly achieve precise adaptation between nested data processing and API interface interaction requirements, greatly improving the convenience and standardization of nested data processing in API scenarios.

[0027] In other embodiments, the basic data processing template is a data template after ETL process; The parameter value of the separator parameter is an English underscore; The parameter values ​​for the key name processing rule parameters include the option to retain the original key name; The configuration parameters also include a null value policy parameter, the value of which is to retain null values ​​and add a null value marker; The configuration parameters also include a timestamp parameter, the value of which is the added timestamp.

[0028] In this embodiment, the basic data processing template is specifically the data template after ETL process processing. This template is a dedicated preset configuration template that adapts to the ETL data cleaning, processing and transfer needs of the data platform and data warehouse, and ensures the traceability of data processing.

[0029] In this template, the separator parameter is set to an English underscore, meaning the key names are concatenated using the format "parent key_child key," which conforms to common field naming conventions in ETL data processing. The key name processing rule parameter includes an option to retain the original key name. This option preserves the original key name and all key hierarchy paths, facilitating data traceability throughout the ETL process. The null value policy parameter retains null values ​​and adds a null flag. This setting preserves null values ​​in the data and adds a corresponding identifier, meeting the data quality verification requirements of the ETL process. The timestamp parameter is a new configuration parameter in this embodiment. Its value is to add a timestamp. This setting adds the data processing time information to the flattened data, enabling time-series traceability of the ETL data flow process.

[0030] In practice, in response to the user's selection of a data template after ETL process, the system automatically loads the preset delimiter, key name processing rules, null value strategy, and timestamp-related parameter values ​​of the template to form the initial configuration content adapted to the ETL scenario, providing a configuration foundation that conforms to the characteristics of the ETL process for the subsequent generation of execution rule sets.

[0031] This embodiment provides a dedicated ETL process template with parameters for configuring English underscore delimiters, preserving original key names, preserving null values ​​with added markers, and adding timestamps. This allows the flattened data to conform to the ETL processing specifications of the data platform and data warehouse, fully preserving data hierarchy information to support data traceability, improving the efficiency of ETL data quality verification with null value marking, and enabling time-series traceability of data processing and flow through timestamps. This effectively ensures the integrity, standardization, and traceability of ETL data processing, eliminating the need for developers to configure relevant parameters separately for ETL scenarios, and significantly improving the convenience and professionalism of nested data processing in the ETL process.

[0032] In some other embodiments, the basic data processing template is a database storage data processing template; The value of the separator parameter is the English period (full stop). The parameter values ​​for the key name processing rule parameters include the option to remove spaces; The configuration parameters also include a null value policy parameter, the value of which is to retain null values; The configuration parameters also include whether to perform key name uniqueness verification, and the value of the key name uniqueness verification parameter is yes.

[0033] In this embodiment, the basic data processing template is specifically a database storage data processing template. This template is a dedicated preset configuration template that is adapted to the direct writing of flat data into a relational database and conforms to the database table field design specifications.

[0034] In this template, the separator parameter is set to a period (.). The key name processing rule parameter includes a space removal option, which automatically removes all whitespace characters from key names. This is to prevent data write failures caused by spaces or other special characters in database field names. The null value strategy parameter is set to retain null values, directly mapping null values ​​in the data to NULL values ​​in the database. This setting ensures that the subsequent flattened data conforms to the null value storage standard of relational databases. The key name uniqueness verification parameter is a new configuration parameter in this embodiment, used to determine whether to perform duplicate checks on the flattened key names. If the parameter value is yes, the execution entity in this embodiment will automatically verify the uniqueness of key names and perform suffix correction processing on duplicate key names, thereby preventing database field name duplication from causing table creation or data write anomalies. In practice, in response to the user's selection of a database storage data processing template, the system automatically loads the preset delimiter, key name processing rules, null value strategy, and key name uniqueness verification parameters of the template, forming the initial configuration content adapted to the database storage scenario. This provides a configuration foundation that conforms to the characteristics of database storage for the subsequent generation of execution rule sets.

[0035] This embodiment provides a dedicated database storage processing template, and configures parameters such as using English period separators, removing spaces in key names, retaining null values, and enabling key name uniqueness verification. This ensures that the flattened data fully conforms to the field design and storage specifications of relational databases, effectively avoiding table creation and data writing failures caused by issues such as spaces in key names and duplicate key names. At the same time, it maps null values ​​to database NULL values, ensuring the stability and standardization of data storage. Developers do not need to write separate adaptation logic for database storage scenarios, significantly improving the reliability and processing efficiency of flattened nested data before storage.

[0036] Regarding the above S103: Next, it can respond to user-sent modification commands for configuration parameters in the basic data processing template, modifying data and generating an execution rule set based on the configuration parameters in the modification commands. The modification commands are operation instructions from the user to adjust parameters such as delimiters and key name processing rule parameters within the basic data processing template, while the modified configuration parameter data is the new parameter values ​​or rule adjustment information carried in the modification commands.

[0037] In practice, after receiving the configuration parameter modification instruction sent by the user, the configuration parameter modification data inside the instruction is extracted. Based on this data, the delimiter parameter and key name processing rule parameter in the basic data processing template are updated and modified, and then integrated to form the final execution rule set.

[0038] Regarding S104 above: Finally, the entire hierarchical key-value structure of the nested data to be processed can be traversed, and the key names at each level can be concatenated and the nested structure can be expanded according to the delimiter parameters and key name processing rule parameters in the execution rule set. Finally, flattened data in the form of one-dimensional key-value pairs can be generated and output.

[0039] Specifically, in some embodiments, the step of processing the nested data to be processed using the execution rule set to obtain flattened data corresponding to the nested data to be processed includes: Generate the nested structure tree of the nested data to be processed; Starting from the root node of the nested structure tree, read the parent key corresponding to the current node, and traverse the child node data of each level in order as the child node to be processed. Based on the parameter values ​​of the parent key and the delimiter parameter, an initial flat key is generated; If the node data of the child node to be processed is a nested structure, then the initial flat key is used as the new parent key, and the steps of reading the parent key corresponding to the current node and traversing the child nodes are executed recursively. If the node data of the child node to be processed is a leaf value, then the initial flat key is processed using the key name processing rule parameters to obtain the processed flat key. Based on the processed flat key and the leaf value, a single key-value pair is generated; all single key-value pairs together constitute the flattened data.

[0040] In this embodiment, when generating a nested structure tree, the input nested data to be processed is first parsed, and a tree data structure is constructed according to its hierarchical relationship. Each node contains a key name, a corresponding value, and a list of child nodes, and the root node represents the top level of the entire data.

[0041] When traversing from the root node, a pointer to the current node can be maintained, initially pointing to the root node and obtaining its corresponding parent key (the root node usually has an empty parent key). Then, each child node is taken out as a child node to be processed in the order in which the child nodes appear in the original data, ensuring the determinism of the traversal.

[0042] For the currently traversed child node, the parent key of the current node is concatenated with the preset separator parameter (such as a period "." or an underscore "_") to form an initial flat key. For example, if the parent key is "a" and the separator is ".", "a." is generated as the prefix.

[0043] When the node data of the child node to be processed is still a nested structure (i.e., containing child nodes), the currently generated initial flat key is used as the new parent key, and the same traversal logic is recursively called. That is, the step of "reading the parent key corresponding to the current node and traversing the child nodes" is executed again, thus entering the next level to continue processing. In practice, if the node data of the child node to be processed is a list type, each element in the list can be traversed first to obtain the index value of the element in the list. The generated initial flat key and the index value are then concatenated with a separator to form a flat key with an index prefix.

[0044] If the node data of the child node to be processed is a leaf value (i.e. no longer contains child nodes, and is a basic data type such as string, number, etc.), then the initial flat key is processed according to the preset key name processing rule parameters to obtain the final processed flat key used for output.

[0045] Finally, the processed flat key is combined with the leaf value to form a key-value pair record, and all such key-value pairs generated during the recursive process are collected and summarized to form a complete flattened dataset, thus completing the transformation from a nested structure to a flat structure.

[0046] The nested data flattening method provided in this embodiment can intuitively and accurately depict the hierarchical structure of the data by generating a nested structure tree of the nested data to be processed. Reading the parent key from the root node of the nested structure tree and sequentially traversing the child nodes ensures that the data traversal process is orderly and without omissions. Generating an initial flat key based on the parent key and delimiter parameters provides a stable basis for the hierarchical construction of key names. The recursive processing method for child nodes with nested structures can effectively adapt to nested data scenarios of different depths. Optimizing the flat key for leaf value nodes using key name processing rule parameters can improve the regularity of the final key names. Then, generating key-value pairs based on the processed flat key and leaf values ​​can completely preserve the mapping relationship of the original data. Finally, this embodiment can obtain more standardized, stable, and adaptable flattened data for complex and deep nested scenarios.

[0047] In some embodiments, the configuration parameters in the basic data processing template further include a maximum recursion depth; after the step of generating the nested structure tree of the nested data to be processed, the method further includes: The actual nesting depth of the nested structure tree is calculated using a depth-first traversal algorithm. If the actual nesting depth is greater than or equal to the maximum recursion depth, then the target node is marked as exceeding the depth limit; the target node is the nested type branch node in the nested structure tree whose traversal level reaches the maximum recursion depth. Before recursively executing the steps of reading the parent key corresponding to the current node and traversing the child nodes using the initial flat key as the new parent key, the method further includes: If the child node to be processed has a depth limit exceeded flag, then stop the recursive traversal of the child nodes of the child node to be processed, and return to the step of sequentially traversing the child node data of each level as the child node to be processed, so as to continue processing the child nodes in the current level other than the child node to be processed. If the child node to be processed does not have a depth limit exceeding flag, then return to the step of sequentially traversing the child node data of each level as the child node to be processed, so as to continue processing the child nodes of the child node to be processed.

[0048] For example, suppose the nested data to be processed is: {"level1":{"level2":{"level3":{"level4":1,"level5":2}},"level6":3}} The maximum recursion depth configured in the basic data processing template is 3. First, the nested structure tree of the nested data is generated. The root node corresponds to the outermost data, level1 is the first-level child node, level2 is the second-level child node, level3 is the third-level child node, level4 and level5 are the fourth-level child nodes, and level6 is the second-level child node.

[0049] Subsequently, using the existing depth-first traversal algorithm, the actual nesting depth of the nested structure tree is calculated, which is found to be 4. This value is greater than the maximum recursion depth of 3. Therefore, the nested type branch node level3, which has reached a traversal level of 3 in the nested structure tree, is marked as having exceeded the depth limit. Then, before recursively processing child nodes with the initial flat key as the new parent key, when traversing to the child node to be processed level3, the depth limit is detected, so the recursive traversal of the child nodes level4 and level5 of level3 is stopped, and the process returns to the step of traversing the child nodes of the current level (level2 level) to continue processing the child nodes level6 of the current level other than level3. The final flattened data only contains level1.level2.level3 (marked as having exceeded the depth limit) and level1.level2.level6:3, without expanding the deep child nodes of level3, thus achieving a controllable limit on the nesting depth.

[0050] This embodiment proposes a method for controlling the recursive depth of nested data. Specifically, a depth-first traversal algorithm is first used to calculate the actual nesting depth of the nested structure tree, accurately obtaining the true hierarchical information of the data. Then, by configuring the maximum recursion depth and marking target nodes that exceed the depth limit, the termination boundary of recursive processing is clearly defined. Before recursive execution, the depth-exceeding status of the child nodes to be processed is judged, thereby stopping the recursive traversal of the excess branch in time and continuing to process other child nodes at the same level, thus avoiding memory overflow and improving the stability of the entire data processing system.

[0051] In some embodiments, generating the nested structure tree of the nested data to be processed includes: Identify all data blocks in the nested data to be processed; the data blocks are dictionaries or lists. Using a preset hash algorithm, each data block is processed to obtain the corresponding data block memory address hash value, which is then stored in a temporary hash table in real time. Based on the hash value of the memory address of the data block currently being traversed and the existing hash value in the temporary hash table, the result of hash value duplication is determined. Based on the hash value duplicate determination result, a loop node report containing the loop path is generated and the corresponding data block is marked; Based on the marked data blocks and the circular node report, output the circular reference detection result; Based on the circular reference detection results, a processing confirmation instruction is sent to the user; In response to the user's confirmation command, a nested structure tree corresponding to the nested data to be processed is generated.

[0052] In this embodiment, all data blocks in the nested data to be processed are first identified, and dictionaries and lists are used as the smallest unit of data blocks to complete the location and extraction of all data blocks.

[0053] Next, a preset hash algorithm, such as SHA256, is used to calculate and process each extracted data block to obtain the corresponding data block memory address hash value, and each set of hash values ​​is stored in real time in a specially constructed temporary hash table.

[0054] Subsequently, during the traversal process, the memory address hash value of the currently processed data block is compared one by one with the hash values ​​already stored in the temporary hash table to determine whether the hash value is duplicated. If the hash value is found to be duplicated, it is determined that there is a circular reference in the data. Then, a circular node report containing the circular path is generated and the corresponding data block with the circular reference is marked. After that, based on the marked data block and the circular node report, the final circular reference detection result is output. Then, based on the detection result, a confirmation instruction is sent to the user whether to continue processing. Finally, the user's confirmation instruction is received and responded to. After the circular reference verification is completed, the nested structure tree corresponding to the nested data to be processed is officially generated.

[0055] This embodiment proposes a circular reference detection method. First, it identifies dictionary and list data blocks in the nested data to be processed. It calculates the hash value of the data block using a preset hash algorithm and stores it in a temporary hash table in real time, thereby efficiently recording the memory characteristics of the data block. Then, by comparing the current hash value with the existing hash values, it quickly determines whether a circular reference exists, generates a circular node report and marks the corresponding data block, which can accurately locate the circular path and abnormal nodes. It outputs the circular reference detection result and sends a processing confirmation command to the user, realizing human-machine collaborative anomaly verification. After responding to the confirmation command, it generates a nested structure tree, which can avoid processing anomalies caused by circular references from the source. Finally, this embodiment can obtain a more secure, accurate, and circular reference-free nested structure tree.

[0056] In some embodiments, the configuration parameters in the basic data processing template further include: whether to retain data type and nested path parameters, and if the parameter value of whether to retain data type and nested path parameters is yes, then the initial flat key is processed using the key name processing rule parameter to obtain the processed flat key. After this step, the method further includes: Obtain the data type of the leaf value and generate a type label according to a preset format; Using the type label, the processed flat key is updated to obtain a new processed flat key, and the step of generating a single key-value pair based on the processed flat key and the leaf value continues; Based on the new processed flat key, the nested path of the leaf value, and the type label, output the data structure mapping table of the flattened data to the nested data to be processed.

[0057] In this embodiment, the configuration parameters in the basic data processing template also include: whether to retain data type and nested path parameters, and the parameter value for whether to retain data type and nested path parameters is set to yes. Under this condition, this embodiment first extracts the actual data type of the leaf value from the current leaf node, such as identifying it as an integer, string, array, or boolean, and generates a corresponding type label for the type according to a predefined format specification, such as converting the integer type to the suffix "[int]".

[0058] Subsequently, the generated type label is concatenated with the current processed flat key to form a new processed flat key. For example, if the original flat key is "user.age" and the type label is "[int]", it will be updated to "user.age[int]", thus directly embedding the data type information into the key name.

[0059] After the key name update is completed, continue to execute the original key-value pair generation step, that is, use the new processed flat key and the original leaf value to combine into a single key-value pair data.

[0060] At the same time, an additional mapping table construction operation is performed: based on the newly processed flat key, the complete nesting path of the leaf value in the original nested structure (such as the hierarchical key name sequence from the root node to the current leaf node), and the generated type label, these three pieces of information are output as a record to a special data structure mapping table. This mapping table is usually organized in a structured format such as a list or an array of objects to record the correspondence between each flattened key and the original data position and type.

[0061] The flattened data processing method provided in this embodiment can flexibly enable data type and path recording functions by configuring whether to retain data type and nested path parameters. It can obtain the data type of the leaf value and generate type labels to attach corresponding type identifiers to the flat key. By updating the processed flat key with type labels, the key name can carry complete data type information. Combined with the new processed flat key nested path and type labels, a data structure mapping table is output. This table can completely retain the hierarchical relationship information of the original nested data. Finally, this embodiment can obtain flattened data with more traceability and complete structural information, so that the nested data to be processed can be quickly retrieved when needed.

[0062] For example, by processing the JSON message returned by the cloud platform API in step S101 using the embodiments of this application, the following flat keys can be obtained: projects_id[str],projects_name[str],projects_description[str],projects_enabled[bool],projects_level[int],projects_regions_0_region_id[str],projects_regions_0_region_status[str],projects_regions_1_region_id[str]…… Ultimately, the flattened data (supporting JSON / CSV / database table structure formats, users can choose as needed) is as follows: JSON format { "projects_regions_0_region_id[str]": "test-1", "projects_regions_0_region_status[str]": "normal", "projects_regions_1_region_id[str]": "Test-2", "projects_regions_1_region_status[str]": "normal", "projects_id[str]": "edbd05f7238d4b6b8024fa185852b145", "projects_name[str]": "hf1_ag_rs", "projects_description[str]": "Anguanwang", "projects_enabled[bool]": true, "projects_tenant_name[str]": "cncb_hftest_vdc", "projects_level[int]": 2, "projects_parent_id[str]": "adbd05f7238d4b874124fa185852b154", "projects_parent_name[str]": "hf1_sc_rs" } CSV format

[0063] The synchronous output data structure mapping table is shown in Table 1 below:

[0064] Those skilled in the art will understand that in the above-described method of the specific embodiments, the order in which the steps are written does not imply a strict execution order, but constitutes no limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0065] It should be noted that in practical applications, all the above-described possible implementation methods can be combined in any way to form possible embodiments of this application, and will not be described in detail here. The information (including but not limited to device information, user information, etc.) and data (including but not limited to data used for analysis, storage, and display) involved in this application are all information and data authorized by the user or fully authorized by all parties. The software tools or components appearing in the embodiments of this application are merely illustrative examples and do not represent actual use.

[0066] Based on the same concept, this application also provides a nested data processing device, which corresponds one-to-one with the nested data processing method in the above embodiments. Figure 2 A schematic diagram of the structure of the nested data processing apparatus provided in an embodiment of this application is shown. See also: Figure 2 As shown, the nested data processing apparatus 200 provided in this application embodiment includes: Module 201 is used to acquire nested data to be processed; The template selection module 202 is used to determine the basic data processing template in response to the template selection instruction sent by the user; the configuration parameters in the basic data processing template include at least: delimiter parameters and key name processing rule parameters; Custom module 203 is used to respond to a user's instruction to modify the configuration parameters in the basic data processing template, modify the data and the basic data processing template according to the configuration parameters in the instruction, and generate an execution rule set; The processing module 204 is used to process the nested data to be processed using the execution rule set to obtain flattened data corresponding to the nested data to be processed, wherein the flattened data is a one-dimensional key-value pair set.

[0067] In some embodiments, in the above-described apparatus, the basic data processing template is an API interface data processing template; The value of the separator parameter is the English period (full stop). The parameter values ​​for the key name processing rule parameters include the option to select key name simplification; The configuration parameters also include a null value policy parameter, the value of which is to skip null values.

[0068] In some embodiments, in the above-described apparatus, the basic data processing template is a data template after ETL process processing; The parameter value of the separator parameter is an English underscore; The parameter values ​​for the key name processing rule parameters include the option to retain the original key name; The configuration parameters also include a null value policy parameter, the value of which is to retain null values ​​and add a null value marker; The configuration parameters also include a timestamp parameter, the value of which is the added timestamp.

[0069] In some embodiments, in the above-described apparatus, the basic data processing template is a database storage data processing template; The value of the separator parameter is the English period (full stop). The parameter values ​​for the key name processing rule parameters include the option to remove spaces; The configuration parameters also include a null value policy parameter, the value of which is to retain null values; The configuration parameters also include whether to perform key name uniqueness verification, and the value of the key name uniqueness verification parameter is yes.

[0070] In some embodiments, in the above-described apparatus, the processing module 204 is specifically used for: Generate the nested structure tree of the nested data to be processed; Starting from the root node of the nested structure tree, read the parent key corresponding to the current node, and traverse the child node data of each level in order as the child node to be processed. Based on the parameter values ​​of the parent key and the delimiter parameter, an initial flat key is generated; If the node data of the child node to be processed is a nested structure, then the initial flat key is used as the new parent key, and the steps of reading the parent key corresponding to the current node and traversing the child nodes are executed recursively. If the node data of the child node to be processed is a leaf value, then the initial flat key is processed using the key name processing rule parameters to obtain the processed flat key. Based on the processed flat key and the leaf value, a single key-value pair is generated; all single key-value pairs together constitute the flattened data.

[0071] In some embodiments, the configuration parameters in the basic data processing template of the above-described apparatus further include a maximum recursion depth; the apparatus also includes an over-limit marking module and a stopping module. The over-limit marking module is used for: After generating the nested structure tree of the nested data to be processed, the actual nesting depth of the nested structure tree is calculated using a depth-first traversal algorithm. If the actual nesting depth is greater than or equal to the maximum recursion depth, then the target node is marked as exceeding the depth limit; the target node is the nested type branch node in the nested structure tree whose traversal level reaches the maximum recursion depth. The stop module is used for: Before recursively executing the steps of reading the parent key corresponding to the current node and traversing the child nodes, using the initial flat key as the new parent key, if the child node to be processed has a depth limit exceeding flag, then the recursive traversal of the child nodes of the child node to be processed is stopped, and the process returns to the step of sequentially traversing the child node data of each level as the child node to be processed, so as to continue processing the child nodes in the current level other than the child node to be processed. If the child node to be processed does not have a depth limit exceeding flag, then return to the step of sequentially traversing the child node data of each level as the child node to be processed, so as to continue processing the child nodes of the child node to be processed.

[0072] In some embodiments, in the above-described apparatus, the processing module 204, when generating the nested structure tree of the nested data to be processed, is specifically used for: Identify all data blocks in the nested data to be processed; the data blocks are dictionaries or lists. Using a preset hash algorithm, each data block is processed to obtain the corresponding data block memory address hash value, which is then stored in a temporary hash table in real time. Based on the hash value of the memory address of the data block currently being traversed and the existing hash value in the temporary hash table, the result of hash value duplication is determined. Based on the hash value duplicate determination result, a loop node report containing the loop path is generated and the corresponding data block is marked; Based on the marked data blocks and the circular node report, output the circular reference detection result; Based on the circular reference detection results, a processing confirmation instruction is sent to the user; In response to the user's confirmation command, a nested structure tree corresponding to the nested data to be processed is generated.

[0073] In some embodiments, in the above-described apparatus, the configuration parameters in the basic data processing template further include: whether to retain data type and nested path parameters, and if the parameter value for whether to retain data type and nested path parameters is yes, then the apparatus further includes a generation module, used for: After processing the initial flat key using the key name processing rule parameters to obtain the processed flat key, the data type of the leaf value is obtained, and a type label is generated according to a preset format. Using the type label, the processed flat key is updated to obtain a new processed flat key, and the step of generating a single key-value pair based on the processed flat key and the leaf value continues; Based on the new processed flat key, the nested path of the leaf value, and the type label, output the data structure mapping table of the flattened data to the nested data to be processed.

[0074] This invention provides a nested data processing device that can determine a basic data processing template containing delimiter parameters and key-name processing rule parameters by responding to the user's template selection instruction, thus establishing a basic configuration framework for data flattening. Then, based on the user's modification instructions for the basic template configuration parameters, it adjusts and generates an execution rule set adapted to specific scenarios, enabling custom configuration of flattening processing rules. Finally, it processes the nested data using the execution rule set to obtain flattened data in the form of one-dimensional key-value pairs. This invention can, to some extent, solve the shortcomings of existing general-purpose JSON libraries that only support fixed delimiters and concatenation methods and cannot dynamically adjust flattening rules. It can flexibly adapt to the differentiated format requirements of different application scenarios, eliminating the need for developers to write separate nested data processing scripts for each scenario. This significantly reduces the development and maintenance costs of nested data processing in multi-cloud environments and effectively improves the overall efficiency of nested data flattening processing.

[0075] Specific limitations regarding the nested data processing device can be found in the limitations of the nested data processing method described above, and will not be repeated here. Each module in the aforementioned nested data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0076] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Figure 3 As shown, at the hardware level, this electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may include non-volatile memory, such as at least one disk drive. Of course, this electronic device may also include other hardware required for other business operations.

[0077] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0078] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0079] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a nested data processing device at the logical level. The processor executes the program stored in memory and specifically performs the aforementioned methods.

[0080] The processor may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0081] The electronic device can execute the nested data processing methods provided in several embodiments of this application, and can be implemented as a nested data processing device. Figure 2 The functions of the embodiments shown are not described again in this application.

[0082] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform the nested data processing methods provided in various embodiments of this application.

[0083] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0085] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0086] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0087] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0088] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0089] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0090] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A nested data processing method, characterized in that, The method includes: Retrieve nested data to be processed; In response to a template selection instruction sent by the user, a basic data processing template is determined; the configuration parameters in the basic data processing template include at least: delimiter parameters and key name processing rule parameters; In response to a user's instruction to modify the configuration parameters in the basic data processing template, the data and the basic data processing template are modified according to the configuration parameters in the instruction, and an execution rule set is generated. The nested data to be processed is processed using the set of execution rules to obtain flattened data corresponding to the nested data to be processed. The flattened data is a set of one-dimensional key-value pairs.

2. The nested data processing method according to claim 1, characterized in that, The basic data processing template is an API interface data processing template; The value of the separator parameter is the English period (full stop). The parameter values ​​for the key name processing rule parameters include the option to select key name simplification; The configuration parameters also include a null value policy parameter, the value of which is to skip null values.

3. The nested data processing method according to claim 1, characterized in that, The basic data processing template is the data template after ETL process; The parameter value of the separator parameter is an English underscore; The parameter values ​​for the key name processing rule parameters include the option to retain the original key name; The configuration parameters also include a null value policy parameter, the value of which is to retain null values ​​and add a null value marker; The configuration parameters also include a timestamp parameter, the value of which is the added timestamp.

4. The nested data processing method according to claim 1, characterized in that, The basic data processing template is a database storage data processing template; The value of the separator parameter is the English period (full stop). The parameter values ​​for the key name processing rule parameters include the option to remove spaces; The configuration parameters also include a null value policy parameter, the value of which is to retain null values; The configuration parameters also include whether to perform key name uniqueness verification, and the value of the key name uniqueness verification parameter is yes.

5. The nested data processing method according to claim 1, characterized in that, The step of processing the nested data to be processed using the execution rule set to obtain flattened data corresponding to the nested data to be processed includes: Generate the nested structure tree of the nested data to be processed; Starting from the root node of the nested structure tree, read the parent key corresponding to the current node, and traverse the child node data of each level in order as the child node to be processed. Based on the parameter values ​​of the parent key and the delimiter parameter, an initial flat key is generated; If the node data of the child node to be processed is a nested structure, then the initial flat key is used as the new parent key, and the steps of reading the parent key corresponding to the current node and traversing the child nodes are executed recursively. If the node data of the child node to be processed is a leaf value, then the initial flat key is processed using the key name processing rule parameters to obtain the processed flat key. Based on the processed flat key and the leaf value, a single key-value pair is generated; all single key-value pairs together constitute the flattened data.

6. The nested data processing method according to claim 5, characterized in that, The configuration parameters in the basic data processing template also include the maximum recursion depth; after the step of generating the nested structure tree of the nested data to be processed, the method further includes: The actual nesting depth of the nested structure tree is calculated using a depth-first traversal algorithm. If the actual nesting depth is greater than or equal to the maximum recursion depth, then the target node is marked as exceeding the depth limit; the target node is the nested type branch node in the nested structure tree whose traversal level reaches the maximum recursion depth. Before recursively executing the steps of reading the parent key corresponding to the current node and traversing the child nodes using the initial flat key as the new parent key, the method further includes: If the child node to be processed has a depth limit exceeded flag, then stop the recursive traversal of the child nodes of the child node to be processed, and return to the step of sequentially traversing the child node data of each level as the child node to be processed, so as to continue processing the child nodes in the current level other than the child node to be processed. If the child node to be processed does not have a depth limit exceeding flag, then return to the step of sequentially traversing the child node data of each level as the child node to be processed, so as to continue processing the child nodes of the child node to be processed.

7. The nested data processing method according to claim 5, characterized in that, The process of generating the nested structure tree of the nested data to be processed includes: Identify all data blocks in the nested data to be processed; the data blocks are dictionaries or lists. Using a preset hash algorithm, each data block is processed to obtain the corresponding data block memory address hash value, which is then stored in a temporary hash table in real time. Based on the hash value of the memory address of the data block currently being traversed and the existing hash value in the temporary hash table, the result of hash value duplication is determined. Based on the hash value duplicate determination result, a loop node report containing the loop path is generated and the corresponding data block is marked; Based on the marked data blocks and the circular node report, output the circular reference detection result; Based on the circular reference detection results, a processing confirmation instruction is sent to the user; In response to the user's confirmation command, a nested structure tree corresponding to the nested data to be processed is generated.

8. The nested data processing method according to any one of claims 5-7, characterized in that, The configuration parameters in the basic data processing template also include: whether to retain data type and nested path parameters. If the value of the parameter for whether to retain data type and nested path parameters is yes, then the initial flat key is processed using the key name processing rule parameter to obtain the processed flat key. After this step, the method further includes: Obtain the data type of the leaf value and generate a type label according to a preset format; Using the type label, the processed flat key is updated to obtain a new processed flat key, and the step of generating a single key-value pair based on the processed flat key and the leaf value continues; Based on the new processed flat key, the nested path of the leaf value, and the type label, output the data structure mapping table of the flattened data to the nested data to be processed.

9. A nested data processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire nested data to be processed. The template selection module is used to determine the basic data processing template in response to the template selection command sent by the user; the configuration parameters in the basic data processing template include at least: delimiter parameters and key name processing rule parameters; A custom module is used to respond to user-sent instructions to modify configuration parameters in the basic data processing template, modify data and the basic data processing template according to the configuration parameters in the modification instructions, and generate an execution rule set; The processing module is used to process the nested data to be processed using the execution rule set to obtain flattened data corresponding to the nested data to be processed, wherein the flattened data is a one-dimensional key-value pair set.

10. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, characterized in that, when executed, the executable instructions cause the processor to perform the steps of the nested data processing method as described in any one of claims 1-8.