Tabular construction of a program data structure

By constructing a JSON data structure using tables, the problems of low efficiency and unclear structure in existing technologies are solved, making the data structure easy to understand, maintain, and disseminate, and suitable for both technical and non-technical personnel.

CN115934715BActive Publication Date: 2026-01-30SHAOGUAN ZHONGLIAN DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211531270.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-01
Publication Date
2026-01-30
Estimated Expiration
2042-12-01

AI Technical Summary

Technical Problem

Existing technologies for constructing JSON data structures are inefficient, have unclear structures, and are difficult to define, read, maintain, and distribute. They also have poor universality, and the construction process is complex, especially for non-technical personnel.

Method used

A tabular construction method is adopted to determine the basic table structure corresponding to each basic data type. By nesting table structures in parent tables, HTML element code is dynamically constructed, and table elements are traversed layer by layer to build multidimensional tables to express data structures of arbitrary complexity.

Benefits of technology

It improves the intuitiveness and understandability of data structures, reduces output error rates, is easy to communicate and maintain, supports starting from scratch or referencing tabular structure templates, and is suitable for both technical and non-technical personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934715B_ABST
    Figure CN115934715B_ABST
Patent Text Reader

Abstract

This invention proposes a tabular construction method for program data structures, relating to the technical field of computer data structure construction. First, it determines the basic table structure corresponding to each basic data type, visually representing commonly used data types in computer programming in a tabular manner. This facilitates understanding and reading of the program structure and improves efficiency. Then, by nesting table structures within parent tables, multidimensional tables are obtained to express any data structure of varying complexity. This further clarifies the data structure based on a tabular approach, resulting in a low error rate in the output and making it easy to understand and communicate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of computer data structure construction, and more specifically, to a tabular construction method for program data structures. Background Technology

[0002] Combining multiple data types into a single dataset is a common technique in computer programming, which involves the use of different computer languages ​​(such as XML and JSON), and different computer languages ​​have different ways of expressing data structures.

[0003] For example, with JSON, computer programmers often manually construct JSON data structures by writing code based on JSON syntax. To facilitate readability, they format the blocky code of JSON data into line segments. However, this method of directly constructing data by hand is time-consuming, inefficient, and lacks scalability. This is mainly because when constructing data structures for large amounts of JSON data, programmers often repeatedly review and confirm the rationality, consistency, and completeness of the data structure due to its unclear nature, leading to inefficiency. Furthermore, each programmer constructs JSON data structures differently (for example, the same key name can be interpreted differently by different people), resulting in comprehension barriers or semantic misunderstandings when sharing data. Therefore, how to quickly construct complex data structures that are easy to define, read, maintain, and disseminate is a pressing technical problem that needs to be solved.

[0004] The prior art discloses a method and apparatus for data format conversion. In this scheme, firstly, the user constructs a dictionary by manually inputting configuration or reading other APIs. The dictionary has certain requirements: it must consist of mapping pairs containing two attributes. Then, a dictionary with a mapping relationship containing one element is constructed to generate columns of a two-dimensional table (the number of columns generated corresponds to the number of dictionaries defined). The display name in the mapping relationship is the column name, and the first column is the row identifier column. Secondly, based on the content attributes filled in the content column, the operation type (including single field, single selection, multiple field, multiple selection, and mapping) is pre-set for each column. Different operation types correspond to different data types and the final JSON data structure will be different. After setting, the user inputs the relevant content of the column according to actual needs. Finally, a parsing program is used to obtain the corresponding JSON content based on the operation type and data type of the column, thereby generating JSON structured data. However, this solution only allows defining the JSON data structure using a single table, which is relatively limited in functionality. It requires building a dictionary, binding the dictionary to the table columns and determining the operation types, constructing a two-dimensional table, inputting content, and then converting it to a standard JSON data structure using its built-in methods. For non-technical users, constructing JSON data still requires a certain level of data structure knowledge, and for professional programmers, it is overly complex. Furthermore, this method lacks versatility, only allowing the creation of a JSON data structure from a single two-dimensional table. Due to the fixed nature of the two-dimensional table, the JSON data structure is relatively fixed and cannot be used to construct arbitrary JSON data structures. It only implements tabularization for the outermost layer of the JSON data structure, and the table content is incomplete; the content displayed in the two-dimensional table is entirely in Chinese names (i.e., display names) and JSON values, while the code names still need to be looked up using a dictionary. Summary of the Invention

[0005] To address the issues of low efficiency and unclear structure in current data structure construction methods, this invention proposes a tabular method for constructing program data structures. This method outputs data structures in a tabular format, which is intuitive, efficient, and clear, with a low probability of errors in the output, and facilitates understanding and communication.

[0006] To achieve the above-mentioned technical effects, the technical solution of the present invention is as follows:

[0007] A method for tabularly constructing program data structures, the method comprising the following steps:

[0008] S1. Determine the basic table structure corresponding to each basic data type;

[0009] S2. Based on the data type to be constructed, select the corresponding basic table structure as the parent table, dynamically construct the HTML element code, and nest the corresponding table structure in the parent table according to the data type inside the data structure.

[0010] S3. Extract the element code of the table structure, traverse the table elements step by step from the outside to the inside, and build the array structure of the table;

[0011] S4. Iterate through all sub-items in the array structure, creating objects or arrays to obtain the program's data structure or program data.

[0012] This technical solution first determines the basic table structure corresponding to each basic data type, and intuitively represents the data types commonly used in computer programming in a tabular way. This is beneficial for both technical and non-technical personnel to understand and read the program structure, and improves efficiency. Then, by nesting table structures in the parent table, multidimensional tables are obtained to express any data structure of different complexity. This further clarifies the data structure based on a tabular approach, resulting in a low probability of data structure output errors and making it easy to understand and communicate.

[0013] Preferably, the data types mentioned in step S1 include: key-value objects, one-dimensional arrays, and two-dimensional arrays.

[0014] Preferably, when the data type is a key-value object, its corresponding basic table structure is represented by a multi-row, two-column sub-table. Each row represents a key-value pair of the object. The first input box of the row maps the key of the code, and records the Chinese name of the key in the input box and the relevant detailed description of the key in the hidden field. The second input box of the row maps the value of the key, which can be a string, number, object, or array.

[0015] Here, the Chinese name can be displayed simultaneously in the code point input box of the table, and a detailed description of the key can be recorded in the hidden field, which is more conducive to the understanding and reading of the structure by both technical and non-technical personnel.

[0016] Preferably, when the data type is a one-dimensional array, its corresponding basic table structure is represented by a two-row, multi-column sub-table. The first row is the header column, and each column of the first row maps the subscript code of the array in sequence. The subscript of the array and its corresponding Chinese name are noted in each column to clarify the meaning of the defined array. The second row maps the input value of the one-dimensional array, which is a string, number, object, or array.

[0017] Preferably, when the data type is a two-dimensional array, its corresponding basic table structure is represented by a multi-row, multi-column sub-table. The first row is the header column, and each column of the first row maps the subscript code of the array in sequence. The subscript of the array and its corresponding Chinese name are noted in each column to clarify the meaning of the defined array. The number of rows in the table can be increased indefinitely. The second row and the newly added rows are used to record the values ​​of the two-dimensional array. Starting from the second row, in row order, each row corresponds to a one-dimensional array value that constitutes a two-dimensional array. Its value is a string, number, object, or array.

[0018] Preferably, the data types to be constructed in step S2 include: key-value objects, one-dimensional arrays, and two-dimensional arrays. According to the data types to be created, the corresponding basic table structure is selected as the parent table. According to the data types to be created in the input boxes of the parent table, HTML element code is dynamically constructed and nested in the input boxes of the parent table to obtain a nested table of the corresponding program data structure.

[0019] In contrast to the problem of the single structure in existing solutions, this approach is based on three basic table structures and can construct any program data structure through table nesting, thus realizing the full table format expression of program data structures.

[0020] Preferably, in step S3, the process of traversing the table elements layer by layer from the outside in to construct a nested array structure is as follows:

[0021] S31. Obtain the data type corresponding to the current parent table, and confirm whether the program type is a key-value object, a one-dimensional array, or a two-dimensional array;

[0022] S32. Continue to search for nested sub-levels and construct an array with the following format for the nested structure: ['key id', 'key name', 'type', 'description', 'default value', 'style', 'event', [sub-structure]];

[0023] S33. Execute steps S31 to S32 in the order of table hierarchy from the outside to the inside until the traversal is complete, and obtain the final array structure of nested tables.

[0024] Preferably, in step S4, all sub-item structures in the array are traversed layer by layer. Starting from the obtained structure type, an object or array is created. When it is an object, key-value pairs are created. When it is an array, each item of the array is created. When the next level item is still an object or array, the above operation is repeated. The final data structure is consistent with the array structure.

[0025] Here, the resulting array structure is used to record and store information about the table structure, while the data structure is the content of the table input.

[0026] Preferably, after step S3, the method further includes: based on the array structure of the nested tables, calling the required event methods to form a program data table structure, then filling the table with program data values, and calling the event methods to generate program data according to the filled program data values. The specific process is as follows:

[0027] Extract the program code structure from the table, traverse the nested table elements layer by layer, first obtain the data type of the current table to determine whether the data type is a key-value object, a one-dimensional array, or a two-dimensional array, and create the corresponding data object. When there is no lower level, directly retrieve the value entered in the table and assign it to the current key; when it is a nested table, traverse and retrieve the object value of the lower level and assign it to the current key.

[0028] Here, this operation constructs program data, which includes the program data structure. It supports not only building the structure from scratch in a tabular format but also directly referencing a tabular structure template. This means there's a tabular structure, but the input boxes are empty. The structure can be modified further based on the application. In practical applications, if many API interfaces are defined, and the structure of the method parameters is roughly the same, there's no need to redefine the same structure for each interface; the existing structure can be directly applied.

[0029] Preferably, the existing program structure is transformed and reconstructed into a tabular form, the process of which is as follows:

[0030] The existing program structure code is converted into a memory object, and then the object is traversed layer by layer to destructure and obtain the data type. Based on whether the data type is a key-value object, a one-dimensional array or a two-dimensional array, and whether there is a substructure, a structure array is constructed in the following format: ['key id', 'key name', 'type', 'description', 'default value', 'style', 'event', [substructure array]];

[0031] After traversing all elements, the final structure array is obtained;

[0032] The code iterates through the resulting structure array and constructs a table structure based on the three data types: key-value objects, one-dimensional arrays, and two-dimensional arrays. The object table is constructed as a horizontal sub-table structure with two columns and multiple rows, the one-dimensional array is constructed as a vertical sub-table structure with two rows and multiple columns, and the two-dimensional array is constructed as a vertical sub-table structure with multiple rows and multiple columns. Finally, a nested table structure is constructed, thus realizing the tabulation of the existing program structure.

[0033] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0034] This invention proposes a tabular construction method for program data structures. First, the basic table structure corresponding to each basic data type is determined, and the data types commonly used in computer programming are represented intuitively in a tabular manner, which is conducive to understanding and reading the program structure and improves efficiency. Then, by nesting table structures in parent tables, multidimensional tables are obtained to express any data structure of different complexity. This further clarifies the data structure based on a tabular approach, resulting in a low probability of data structure output errors and easy understanding and communication. Attached Figure Description

[0035] Figure 1 A flowchart illustrating the tabular construction method of the program data structure proposed in Embodiment 1 of the present invention;

[0036] Figure 2 This diagram illustrates how the basic table structure corresponding to the data type key-value object, as proposed in Embodiment 1 of the present invention, is represented by a multi-row, two-column sub-table.

[0037] Figure 3 This diagram illustrates how the basic table structure proposed in Embodiment 1 of the present invention, when the data type is a one-dimensional array, is represented by a two-row, multi-column sub-table.

[0038] Figure 4 This diagram illustrates how the basic table structure corresponding to a two-dimensional array, as proposed in Embodiment 1 of the present invention, is represented by a multi-row, multi-column sub-table.

[0039] Figure 5 This is a schematic diagram illustrating the nested table structure of a multidimensional table proposed in Embodiment 1 of the present invention, which involves nesting table structures within a parent table.

[0040] Figure 6 This is a schematic diagram of the interface of the platform content editing area proposed in Embodiment 2 of the present invention;

[0041] Figure 7 A schematic diagram illustrating the JSON table defined in Embodiment 2 of the present invention;

[0042] Figure 8 This is a schematic diagram illustrating the program data table structure with program values ​​formed based on the defined nested table array structure proposed in Embodiment 3 of the present invention.

[0043] Figure 9 This is a schematic diagram illustrating the table structure created in Embodiment 4 of the present invention for existing JSON structures or data. Detailed Implementation

[0044] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this patent.

[0045] To better illustrate this embodiment, some parts of the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual dimensions;

[0046] It is understandable to those skilled in the art that some well-known details may be omitted from the accompanying drawings.

[0047] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments;

[0048] The positional relationships depicted in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this patent.

[0049] Example 1

[0050] like Figure 1 As shown, this embodiment proposes a tabular construction method for program data structures, which includes the following steps:

[0051] S1. Determine the basic table structure corresponding to each basic data type;

[0052] S2. Based on the data type to be constructed, select the corresponding basic table structure as the parent table, dynamically construct the HTML element code, and nest the corresponding table structure in the parent table according to the data type inside the data structure.

[0053] S3. Extract the element code of the table structure, traverse the table elements step by step from the outside to the inside, and build the array structure of the table;

[0054] S4. Iterate through all sub-items in the array structure, creating objects or arrays to obtain the program's data structure or program data.

[0055] This embodiment first determines the basic table structure corresponding to each basic data type, and intuitively represents the data types commonly used in computer programming in a tabular way. This is beneficial for both technical and non-technical personnel to understand and read the program structure, and improves efficiency. Then, by nesting table structures in the parent table, multidimensional tables are obtained to express any data structure of different complexity. This further clarifies the data structure in a tabular way, resulting in a low probability of data structure output errors and making it easy to understand and communicate.

[0056] Different computer languages ​​express data structures differently, such as XML and JSON. This embodiment uses JSON data as an example, but it is not limited to constructing JSON data. Similarly, XML data and other similar data structures used in the computer field can be constructed. Any complex data structure basically contains three basic data types: key-value objects, one-dimensional arrays, and two-dimensional arrays. When the data type is a key-value object, such as... Figure 2As shown, its corresponding basic table structure is represented by a multi-row, two-column sub-table. Each row represents a key-value pair of an object. The first input box of the row maps the key of the code. The Chinese name of the key is recorded in the input box, and the relevant detailed description of the key is recorded in the hidden field. This is more conducive to the understanding and reading of the structure by both technical and non-technical personnel, such as product number. The second input box of the row maps the value of the key, which can be a string, number, object, or array, such as xj-001.

[0057] like Figure 3 As shown, when the data type is a one-dimensional array, its corresponding basic table structure is represented by a two-row, multi-column sub-table. The first row is the title column, such as "Login User", "IP Address", and "Login Time". Each column of the first row maps the subscript code of the array in order, such as [0], [1] and [2]. The Chinese name corresponding to the subscript of the array is noted in each column to clarify the meaning of the defined array. The second row maps the input value of the one-dimensional array, which is a string, number, object or array.

[0058] like Figure 4 As shown, when the data type is a two-dimensional array, its corresponding basic table structure is represented by a multi-row, multi-column sub-table. The first row is the header column, such as "Production Line", "Product Number" and "Production Status". Each column of the first row maps the subscript code of the array in order, such as [0], [1] and [2]. The Chinese name corresponding to the subscript of the array is noted in each column to clarify the meaning of the defined array. The number of rows in the table can be increased indefinitely. The second row and the newly added rows are used to record the value of the two-dimensional array. Starting from the second row, in row order, each row corresponds to a one-dimensional array value that constitutes the two-dimensional array. Its value is a string, number, object or array.

[0059] Based on the above basic table structure, if the input value in the table is an object, a one-dimensional array, or a two-dimensional array, the corresponding table can be nested in the input box of the parent table according to the value type. The data types to be constructed in step S2 include key-value objects, one-dimensional arrays, and two-dimensional arrays. According to the data type to be created, the corresponding basic table structure is selected as the parent table. According to the data type to be created in the input box of the parent table, HTML element code is dynamically constructed and nested in the input box of the parent table to obtain the nested table of the corresponding program data structure.

[0060] Here, based on three basic table structures, and through table nesting, any program data structure can be constructed. Figure 5 For example, as shown, Figure 5The parent table is a basic table structure with 4 rows and 2 columns. The first column of the basic table structure contains "Company Name", "Company ID", "Employees" and "Department Structure". The second column contains the corresponding values ​​from the first column. The input boxes for "Employees" and "Department Structure" each contain a nested basic table structure. There are also nested basic table structures within nested basic table structures. All of this content realizes a full tabular representation of the program's data structure, replacing code with tabular representation, making the data clear at a glance.

[0061] In practical applications, the method proposed in this embodiment first involves entering the platform's editing interface, such as... Figure 6 As shown, each function key of the editing device is bound to various required event methods to define a JSON table in the content editing area. The purpose of table formatting is to clearly express the structure of the JSON. In this step, based on the data type required by the content input box, HTML element code is dynamically constructed to form the corresponding table, resulting in the following: Figure 7 The code then translates the defined JSON table into a set of code structures, which serve as storage information for future use. These structures can be converted to and from the defined JSON table via event methods. During this process, the following is executed:

[0062] The process of traversing table elements layer by layer from the outside in to construct a nested array structure is as follows:

[0063] S31. Obtain the data type corresponding to the current parent table, and confirm whether the program type is a key-value object, a one-dimensional array, or a two-dimensional array;

[0064] S32. Continue to search for nested sub-levels and construct an array with the following format for the nested structure: ['key id', 'key name', 'type', 'description', 'default value', 'style', 'event', [sub-structure]];

[0065] S33. Execute steps S31-S32 in the order of the table hierarchy from the outside in, until the traversal is complete, resulting in the final array structure of the nested tables: ['JSON structure id', 'JSON structure name', 'JSON structure type', 'JSON load event', [JSON data structure array]]. Specifically:

[0066] ["","","oj","",[["User","Employee","oj","","","","","",[["UserName","Name","sw","","","","",""],["UserID","Employee ID","sw","","","",""]]],["WorkExper","Work Experience","ab","","","","","",[["0","Position","sw","","","",""],["1","Time","sw","","","",""]]],["Department","Department","aa","","","","","",[["0","Department ID","sw","","","","",""],["1","Department Position","sw","","","",""]]]]]

[0067] Finally, the JSON structure is defined in a tabular format. All sub-items in the array are traversed level by level. Starting from the obtained structure type, an object or array is created. If it's an object, key-value pairs are created; if it's an array, each item in the array is created. The above operations are repeated when the next level item is still an object or array. The final data structure is consistent with the array structure, as follows:

[0068] {

[0069] "User":{

[0070] "UserName":"",

[0071] "UserID":""

[0072] },

[0073] "WorkExper":["",""],

[0074] "Department":["",""]

[0075] }

[0076] Example 2

[0077] This embodiment mainly implements: calling a predefined tabular JSON structure to output JSON data.

[0078] The code retrieves the predefined JSON table structure and calls events as shown on the right. Figure 7The JSON table structure shown is based on an array structure of nested tables. The required event methods are called to form the program data table structure. Then, program data values ​​are filled into the table. The structure of the filled JSON program data values ​​is as follows: Figure 8 As shown, the process of calling the event method to generate program data is as follows:

[0079] Extract the program code structure from the table, and traverse the nested table elements layer by layer. First, obtain the data type of the current table to determine whether it is a key-value object, a one-dimensional array, or a two-dimensional array, and create the corresponding data object. When there are no lower-level objects, directly retrieve the value entered in the table and assign it to the current key. When it is a nested table, traverse and retrieve the value of the lower-level object and assign it to the current key. The final objects and values ​​are shown below:

[0080] {

[0081] "User":{

[0082] "UserID":"sc01-0001",

[0083] UserName: "Zhang San"

[0084] },

[0085] "WorkExper":[["Production Worker","2017-08-03-Present"]],

[0086] "Department":["sc01","A group of production workers"]

[0087] }

[0088] This method not only supports building a tabular structure from scratch, but also supports directly referencing tabular structure templates. That is, even if there is a tabular structure but the input boxes are empty, the structure can still be modified after application. In practical applications, if many API interfaces are defined, and the structure of the method parameters is roughly the same, there's no need to redefine the same structure for each interface; the original structure can be directly applied.

[0089] Example 3

[0090] This embodiment mainly achieves the following: Based on an existing JSON structure or JSON data, a corresponding table structure is created. First, a standard JSON data structure is copied or directly input using a dedicated input device. Let the standard JSON data structure be as follows:

[0091] {

[0092] "User":{

[0093] "UserName":"",

[0094] "UserID":""

[0095] },

[0096] "WorkExpe":["",""],

[0097] "Department":["",""],

[0098] "sw2":["",""]

[0099] }

[0100] Based on the input standard JSON data structure, the event method is invoked to translate it into a corresponding tabular JSON structure. The existing program structure is then transformed and reconstructed into a tabular form; the process is as follows:

[0101] The existing program structure code is converted into a memory object, and then the object is traversed layer by layer to destructure and obtain the data type. Based on whether the data type is a key-value object, a one-dimensional array or a two-dimensional array, and whether there is a substructure, a structure array is constructed in the following format: ['key id', 'key name', 'type', 'description', 'default value', 'style', 'event', [substructure array]];

[0102] After traversing all elements, the final structure array is obtained;

[0103] The code iterates through the resulting array of structures, identifying three data types: key-value objects, one-dimensional arrays, and two-dimensional arrays. It then constructs a table structure based on these data types. Specifically, object tables are constructed as horizontal sub-tables with two columns and multiple rows; one-dimensional arrays are constructed as vertical sub-tables with two rows and multiple columns; and two-dimensional arrays are constructed as vertical sub-tables with multiple rows and multiple columns. Ultimately, this results in a nested table structure, as shown below. Figure 9 As shown, this implements the tabulation of the existing program structure.

[0104] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A tabular construction method of a program data structure, characterized by, The method comprises the following steps: S1. Determine the basic table structure corresponding to each basic data type; S2. According to the required data type to be constructed, select the corresponding basic table structure as the parent table, dynamically construct the html element code, and according to the data type inside the data structure, nest the table structure corresponding to the data type in the parent table; S3. Extract the element code of the table structure, and step by step from outside to inside to traverse the table element, and construct the array structure of the table; S4. Traverse all the child items in the array structure layer by layer, create objects or arrays, and obtain the data structure or program data of the program; In step S2, the required data type to be constructed includes key-value objects, one-dimensional arrays and two-dimensional arrays. According to the data type to be created, the corresponding basic table structure is selected as the parent table, and the html element code is dynamically constructed according to the data type to be created in the input box of the parent table, and is nested in the input box of the parent table to obtain the nested table of the corresponding program data structure; In step S4, all the child item structures in the array are traversed layer by layer, starting from the obtained structure type, objects or arrays are created, when it is an object, key-value pairs are created, when it is an array, each item of the array is created, and when the lower level is still an object or an array, the above operation is repeated, and finally the data structure is consistent with the array structure; After step S3, it further comprises: based on the array structure of the nested table constructed, calling the required event method to form the program data table structure, and then filling in the program data values in the table, according to the filled program data values, calling the event method to generate the program data, and the specific process is: Extract the program code structure in the table, traverse layer by layer in the nested table element, first obtain the data type of the current table, confirm whether the data type is a key-value object, a one-dimensional array or a two-dimensional array, create the corresponding data object, when there is no lower level, directly take out the value filled in the table and assign it to the current key; when it is a nested table, traverse and take out the object value of the lower level and assign it to the current key.

2. The tabular construction method of program data structures according to claim 1, characterized in that, The data type in step S1 includes: key-value objects, one-dimensional arrays and two-dimensional arrays.

3. The tabular construction method of program data structures according to claim 2, characterized in that, When the data type is a key-value object, the corresponding basic table structure is represented by a plurality of rows and two columns of sub-tables, each row represents a key-value pair of the object, wherein the first input box of the row maps the key of the code, and the Chinese name of the key is recorded in the input box and the related detailed description of the key is recorded in the hidden field; the second input box of the row maps the value of the key, which is a string, a number, an object or an array.

4. The tabular construction method of program data structures according to claim 2, characterized in that, When the data type is a one-dimensional array, the corresponding basic table structure is represented by two rows and a plurality of columns of sub-tables, wherein the first row is a title column, each column of the first row maps the subscript code of the array in order, and the subscript and the corresponding Chinese name of the array are noted in each column to clearly define the meaning of the defined array; the second row maps the input value of the one-dimensional array, which is a string, a number, an object or an array.

5. The tabulating method of program data structures according to claim 2, characterized in that, When the data type is a two-dimensional array, the corresponding basic table structure is represented by a multi-row and multi-column sub-table, the first row is the title column, and each column of the first row maps the subscript code of the array in order. The subscript and corresponding Chinese name of the array are noted in each column to clearly define the meaning of the defined array. The number of rows of the table can be increased indefinitely, and the second row and the newly added rows are used to record the values of the two-dimensional array. From the second row, each row corresponds to a one-dimensional array value that constitutes a two-dimensional array, and the value is a string, a number, an object, or an array.

6. The tabulating method of program data structures according to claim 1, characterized in that, In step S3, the table elements are traversed layer by layer from the outside to the inside, and the process of constructing the nested array structure is as follows: S31. Obtain the data type corresponding to the current parent table, and confirm whether the program type is a key-value object, a one-dimensional array, or a two-dimensional array; S32. Continue to find out whether there is a nested lower level, and construct the nested array format as follows: ['key id', 'key name', 'type', 'description', 'default value','style', 'event', [subordinate structure]]; S33. Execute steps S31-S32 in the order of table hierarchy from the outside to the inside, until the traversal is completed, and the final nested table array structure is obtained.

7. The table construction method of program structure according to Claim 2, wherein, For the current existing program structure, the table transformation and construction process is as follows: Convert the current existing program structure code into an in-memory object, and then traverse the object layer by layer to obtain the data type. According to whether the data type is a key-value object, a one-dimensional array, or a two-dimensional array, and whether there is a lower level structure, construct the structure array format as follows: ['key id', 'key name', 'type', 'description', 'default value','style', 'event', [subordinate structure array]]; After traversal, the final structure array is obtained; Traverse the final structure array, and according to the structure type, construct the table structure code in three data types: key-value object, one-dimensional array, and two-dimensional array. Among them, the object table is constructed as a horizontal two-column multi-row sub-table structure, the one-dimensional array is constructed as a vertical two-row multi-column sub-table structure, and the two-dimensional array is constructed as a vertical multi-row multi-column sub-table structure. Finally, a nested table structure is constructed.

Citation Information

Patent Citations

  • Method and apparatus for displaying tabular data

    CN101620636A

  • Method for realizing visualization of xml format table structure and generation of table building statement

    CN114647647A