A dynamic data binding method and system for table components based on API
By adopting API-based dynamic data binding method and dynamic binding relationship table in the table component, the problem of long search time when the data binding relationship of the table component changes is solved, and efficient data binding relationship management is achieved.
Patent Information
- Application Number
- CN202411766640.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-08
AI Technical Summary
When performing data binding in table components, the prior art requires traversing all subcontrols and data source fields, resulting in a long search time and low efficiency when the binding relationship changes.
Using the dynamic data binding method of table components based on API, efficient search is achieved by dynamically binding relation tables. The specific steps include: API configuration for web tables, obtaining raw data, creating metadata warehouses and tabular models, dynamically obtaining binding relationships, and creating data binding relationship tables based on the relationship.
When the binding relationship changes, it can quickly search and update the dynamic binding relationship table, shorten the search time and improve search efficiency.
Smart Images

Figure CN119782306A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to an API-based table component dynamic data binding method and system. Background Art
[0002] Data binding is to establish a mapping relationship between data objects and components. It is traditionally divided into static and dynamic binding, and can also be divided into one-way binding and two-way binding. Among them, static binding means that the relationship between data and components has been determined when the program is compiled, and it will not change as the program runs; dynamic binding means that the relationship between data and components is determined at runtime, and the connection between data and components can be updated according to the configuration during the program running. One-way binding means that data flows in only one direction, such as from model to view, and is usually used in simple scenarios; two-way binding means that data can flow in two directions, that is, from data model to view, and from view to data model. After modifying its value on the component, it is automatically updated to the data model, and the changes in the model will also be reflected in the view.
[0003] A table is a relatively complex component. When performing data binding, a relatively simple binding relationship is usually adopted. The properties of the sub-controls in each column of the table are respectively bound to the fields of the data set in the bound data source, and the binding relationships are recorded in the sub-control model. Not only is the number of binding operations large, but when the binding relationship changes, it is necessary to traverse and search all the sub-controls in the table component and the fields of the data set in the data source, which consumes a lot of time. Therefore, the present invention proposes an API-based table component dynamic data binding method and system, which enables efficient search when the binding relationship changes through a dynamic binding relationship table, shortens the search time, and improves the search efficiency. Summary of the invention
[0004] The purpose of the present invention is to provide an API-based table component dynamic data binding method and system to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for dynamic data binding of a table component based on an API, comprising:
[0006] Configure the API for the Web table, and obtain the original data for the table component based on the configured API to obtain the API data;
[0007] Create a metadata warehouse for API-acquired data;
[0008] Create table models for web tables;
[0009] Analyze the binding relationship of table components and dynamically obtain the binding relationship;
[0010] Create data binding relationships for the metadata warehouse and table model based on the binding relationships, and obtain the dynamic binding relationship table.
[0011] Preferably, creating a metadata warehouse for API-acquired data includes:
[0012] Determine the API to obtain data;
[0013] According to the API data contract, the data obtained by the API is converted to obtain a two-dimensional data matrix of the data obtained by the API;
[0014] Determine the metadata table view based on the two-dimensional data matrix of the data obtained from the API;
[0015] For metadata table views, data is persistently stored in the metadata warehouse.
[0016] Preferably, creating a table model for a Web table includes:
[0017] Analyze the Web form, determine the table component structure of the Web form, and divide the Web form into regions according to the table component structure to obtain multiple table regions;
[0018] Perform information identification on the table areas respectively to obtain area identification information;
[0019] Determine the features of the table area respectively to obtain the features of the table area;
[0020] Match the table area features with the area identification information, and generate table labels according to the matching results;
[0021] A table model is constructed according to the table tags and the table component structure to obtain a table model of the table component.
[0022] Preferably, creating a data binding relationship for the metadata warehouse and the table model according to the binding relationship includes:
[0023] Analyze the type of binding relationship, determine whether the binding relationship is simple binding or complex binding, and obtain preliminary analysis results;
[0024] When the preliminary analysis result shows that the binding relationship is a simple binding, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data, and the target data is used as the display content of the binding relationship to obtain the binding content;
[0025] When the preliminary analysis result shows that the binding relationship is a complex binding, further analysis is performed to determine whether there is a calculation expression in the binding relationship to obtain a secondary analysis result;
[0026] When the secondary analysis result shows that there is a calculation expression in the binding relationship, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data. Then, the target data is calculated and processed according to the calculation expression to determine the display content of the binding relationship and obtain the binding content.
[0027] When the secondary analysis result is that there is no calculation expression in the binding relationship, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data, and then the target data is processed according to the binding relationship to determine the display content of the binding relationship and obtain the binding content;
[0028] Determine binding relationship description information according to binding content and binding type, and implement binding of the binding relationship according to the binding relationship description information;
[0029] The dynamic data information of the binding implementation status of the binding relationship description information is obtained, and the dynamic binding relationship table is synchronously updated according to the dynamic data information; the dynamic binding relationship table is a binding relationship mapping table, which is composed of two-dimensional data, the first dimension data is the ID number of the sub-control with binding association in the table model as the key, and the second dimension data is the element ID in the binding data set corresponding to the first dimension data as the key, and its value is the binding expression object or calculation expression of the binding relationship.
[0030] Preferably, after obtaining the dynamic binding relationship table, maintenance and persistence processing are also performed on the dynamic binding relationship table, wherein, when the dynamic binding relationship table is maintained, it includes: monitoring and analyzing whether the binding relationship has changed, when the binding relationship has changed, obtaining change information for the binding relationship, making binding adjustments based on the change information, and adjusting the dynamic binding relationship table according to the change information to achieve maintenance of the dynamic binding relationship table; when the dynamic binding relationship table is persistently processed, it includes: monitoring and analyzing whether the Web form has a program stop or page closure phenomenon, when the Web form has a program stop or page closure phenomenon, performing persistence processing on the binding relationship mapping table, obtaining the current status information of the binding relationship mapping table, serializing the current status information and storing it in the storage module, and when the Web form is opened again, retrieving the target storage information in the storage module according to the Web form, and restoring the binding relationship mapping table for the target storage information.
[0031] An API-based table component dynamic data binding system, comprising: a configuration acquisition module, a first creation module, a second creation module, a relationship acquisition module and a data binding module;
[0032] The configuration acquisition module is used to perform API configuration for the Web table, and acquire original data for the table component based on the configured API to obtain API acquisition data;
[0033] The first creation module is used to create a metadata warehouse for API-acquired data;
[0034] The second creation module is used to create a table model for the Web table;
[0035] The relationship acquisition module is used to analyze the binding relationship of the table component and dynamically acquire the binding relationship;
[0036] The data binding module is used to create a data binding relationship for the metadata warehouse and the table model according to the binding relationship, and obtain a dynamic binding relationship table at the same time.
[0037] Preferably, the first creation module comprises: a data confirmation unit, a data conversion unit, a view table determination unit and a data storage unit;
[0038] The data confirmation unit is used to determine the API to obtain data;
[0039] The data conversion unit is used to convert the API acquired data according to the API data contract to obtain a two-dimensional data matrix of the API acquired data;
[0040] The view table determination unit is used to determine the metadata table view according to the two-dimensional data matrix of the API-acquired data;
[0041] The data storage unit is used to perform persistent storage of data in the metadata warehouse for the metadata table view.
[0042] Preferably, the second creation module includes: an analysis and division unit, a first processing unit, a second processing unit, a label generation unit and a model building unit;
[0043] The analysis and division unit is used to analyze the Web form, determine the table component structure of the Web form, and divide the Web form into regions according to the table component structure to obtain multiple table regions;
[0044] The second processing unit is used to perform information identification on the table areas respectively to obtain area identification information;
[0045] The first processing unit is used to determine features of the table areas respectively to obtain table area features;
[0046] The label generation unit is used to match the table area features with the area identification information and generate a table label according to the matching result;
[0047] The model building unit is used to build a table model according to the table tags and the table component structure to obtain the table model of the table component.
[0048] Preferably, the data binding module comprises: a binding relationship unit and a mapping table establishing unit;
[0049] The binding relationship unit is used to analyze the type of the binding relationship, determine whether the binding relationship is a simple binding or a complex binding, and obtain a preliminary analysis result; when the preliminary analysis result is that the binding relationship is a simple binding, determine the target sub-control according to the binding relationship combined with the table model, and match the target data in the metadata warehouse for the target sub-control, obtain the target data, and use the target data as the display content of the binding relationship to obtain the binding content; when the preliminary analysis result is that the binding relationship is a complex binding, further analyze whether there is a calculation expression in the binding relationship to obtain a secondary analysis result; when the secondary analysis result is that there is a calculation expression in the binding relationship, determine the target sub-control according to the binding relationship combined with the table model. The target sub-control is matched with the target data in the metadata warehouse to obtain the target data, and then the target data is calculated and processed according to the calculation expression to determine the display content of the binding relationship and obtain the binding content; when the secondary analysis result is that the calculation expression does not exist in the binding relationship, the target sub-control is determined according to the binding relationship and the table model, and the target sub-control is matched with the target data in the metadata warehouse to obtain the target data, and then the target data is processed according to the binding relationship to determine the display content of the binding relationship and obtain the binding content; the binding relationship description information is determined according to the binding content and the binding type, and the binding of the binding relationship is realized according to the binding relationship description information;
[0050] The mapping table establishment unit is used to obtain dynamic data information of the binding implementation status of the binding relationship description information, and synchronously update the dynamic binding relationship table according to the dynamic data information; the dynamic binding relationship table is a binding relationship mapping table, which is composed of two-dimensional data, the first dimension data is the ID number of the sub-control with binding association in the table model as the key, and the second dimension data is the element ID in the binding data set corresponding to the first dimension data as the key, and its value is the binding expression object or calculation expression of the binding relationship.
[0051] Preferably, the data binding module further includes: a maintenance unit and a persistence processing unit;
[0052] The maintenance unit is used to monitor and analyze whether the binding relationship has changed. When the binding relationship has changed, the change information is obtained for the binding relationship, and the binding adjustment is performed according to the change information. At the same time, the dynamic binding relationship table is adjusted according to the change information to achieve maintenance of the dynamic binding relationship table;
[0053] The persistence processing unit is used to monitor and analyze whether the Web form has a program stop or page closing phenomenon. When the Web form has a program stop or page closing phenomenon, persistence processing is performed on the binding relationship mapping table, and the current state information of the binding relationship mapping table is obtained. The current state information is serialized and stored in the storage module. When the Web form is opened again, the target storage information is retrieved from the storage module according to the Web form, and the binding relationship mapping table is restored according to the target storage information.
[0054] The present invention implements the management of data binding relationship creation through a dynamic binding relationship table, so that the information of the dynamic binding relationship table is consistent with the dynamic data binding status of the table component of the Web table, so that when the binding relationship changes, efficient search can be performed based on the dynamic binding relationship table, thereby shortening the search time and improving the search efficiency.
[0055] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0056] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0058] Figure 1 A schematic diagram of the steps of the table component dynamic data binding method of the present invention;
[0059] Figure 2 This is a schematic diagram of step 2 in the table component dynamic data binding method of the present invention;
[0060] Figure 3 This is a schematic diagram of step three in the table component dynamic data binding method of the present invention;
[0061] Figure 4 This is a flow chart of step 5 in the table component dynamic data binding method of the present invention;
[0062] Figure 5 It is a schematic diagram of the table component dynamic data binding system of the present invention;
[0063] Figure 6 A schematic diagram of a first creation module in the table component dynamic data binding system of the present invention;
[0064] Figure 7 A schematic diagram of a second creation module in the table component dynamic data binding system of the present invention;
[0065] Figure 8 A schematic diagram of a data binding module in the table component dynamic data binding system of the present invention;
[0066] Fig. 9 This is another schematic diagram of the data binding module in the table component dynamic data binding system of the present invention. DETAILED DESCRIPTION
[0067] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0068] like Figure 1 As shown, an embodiment of the present invention provides an API-based table component dynamic data binding method, including:
[0069] Step 1: Configure the API for the Web table, and obtain the original data for the table component based on the configured API to obtain the API data;
[0070] Step 2: Create a metadata warehouse for API data acquisition;
[0071] Step 3: Create a table model for the Web table;
[0072] Step 4: Analyze the binding relationship of the table component and dynamically obtain the binding relationship;
[0073] Step 5: Create a data binding relationship for the metadata warehouse and the table model based on the binding relationship, and obtain the dynamic binding relationship table.
[0074] In the above technical solution, when configuring the API for the table component, determine the API configuration items that need to be accessed to provide the display data of the table component, including: name, request type (GET or POST), URL, Header / Body parameter configuration items, return value format (JSON, XML), etc.
[0075] In the above technical solution, the metadata warehouse stores the original data.
[0076] In the above technical solution, the Web table is composed of table components, and the table component is a complex composite component that is defined and described through tags.
[0077] In the above technical solution, the dynamic binding relationship table is used to store the sub-controls of the table component in the Web table and the fields in the data table view in the metadata warehouse in the format of rows and columns.
[0078] In the above technical solution, the binding relationship is to describe the association between a metadata in the data warehouse and a specific sub-control in the Web table component.
[0079] The above technical solution realizes the management of data binding relationship creation through the dynamic binding relationship table, so that the information of the dynamic binding relationship table is consistent with the dynamic data binding situation of the table component of the Web table, so that when the binding relationship changes, it can be efficiently searched based on the dynamic binding relationship table, shortening the search time and improving the search efficiency. By configuring the API for the table component, it can be obtained through the configured API when the original data of the table component is obtained, which is convenient for reading the table component. The original data acquisition through the API realizes the data acquisition of the table component by the API, so that the API is used as the data source for data binding, and the management of the original data obtained by the API is realized through the metadata warehouse, providing data support for the creation of data binding relationships, and at the same time, by creating a table model for the table component, the table component is created in the form of a table model for data binding relationships, which provides convenience for the creation of data binding relationships. In addition, when creating a data binding relationship, by dynamically acquiring the binding relationship, it is possible to dynamically read the binding relationship in real time, create and adjust the dynamic binding relationship in time, and when the binding relationship changes, the corresponding change operation can be performed through the dynamic binding relationship table, saving search time and improving search efficiency.
[0080] like Figure 2 As shown, in one embodiment provided by the present invention, creating a metadata warehouse for API-acquired data includes:
[0081] A1. Determine the API to obtain data;
[0082] A2. Convert the data obtained by the API according to the API data contract to obtain a two-dimensional data matrix of the data obtained by the API;
[0083] A3. Determine the metadata table view based on the two-dimensional data matrix of the data obtained from the API;
[0084] A4. Persistently store data in the metadata warehouse for metadata table views.
[0085] In the above technical solution, the metadata warehouse uses views as units for persistent data storage. A metadata warehouse will store a collection of multiple metadata table views of all APIs in the entire system that obtain data.
[0086] In the above technical solution, the data obtained by the API is usually in JSON or XML format.
[0087] In the above technical solution, when converting the data obtained by the API according to the API data contract, the API data is converted into a two-dimensional data matrix, one dimension of which is used to describe the data table view level attributes, such as the name, unique code, description, etc. of the data set, and one dimension is used to describe the specific fields in the data set, such as field code, field name, data type, remarks, etc.
[0088] In the above technical solution, each API acquires data corresponding to a metadata table view.
[0089] The above technical solution implements the management of API acquired data through the metadata warehouse, so that the API is used as the data source for data binding, providing data support for the creation of data binding relationships. By converting the API acquired data according to the API data contract, it can not only achieve unified specifications for API acquired data, but also make the API acquired data organized and reduce the degree of data confusion, so that when determining the metadata table view based on the two-dimensional data matrix of the API acquired data, the metadata table view can be better determined, the efficiency of metadata table view determination can be improved, and data is persistently stored in the metadata warehouse, which can effectively ensure the existence of metadata in the metadata warehouse, and avoid metadata loss, which leads to the inability to obtain corresponding data information when reading data from the metadata warehouse, affecting the use of metadata.
[0090] like Figure 3 As shown, in one embodiment provided by the present invention, creating a table model for a Web table includes:
[0091] B1. Analyze the Web table, determine the table component structure of the Web table, and divide the Web table into regions according to the table component structure to obtain multiple table regions;
[0092] B2. Identify information for each table area to obtain area identification information;
[0093] B3, determining features for the table areas respectively to obtain table area features;
[0094] B4. Match the table area features with the area identification information, and generate table labels according to the matching results;
[0095] B5. Build a table model according to the table tags and the table component structure to obtain the table model of the table component.
[0096] In the above technical solution, the table component structure includes: title, header, body and footer.
[0097] In the above technical solution, the table area includes: title area, header area, body area and footer area. Among them, the title area mainly displays the table's ID, name, subtitle, tabulation unit, tabulator, tabulation date and other information through text labels; the header area mainly describes the properties of each column header, including ID, title, level, type, component, etc. Its level supports multi-level headers by describing the superior and subordinate relationships. The types include automatic serial number columns, data binding columns, and calculated columns. Components include label components, text input box components, radio button group components, drop-down box components, etc. The footer area includes: record statistics components and paging components. The extended functions of the table component include: data export, merging rows and columns, and sorting functions.
[0098] In the above technical scheme, features are determined for the table areas respectively, including: matching the table area with the table component structure to determine the matching result; obtaining the table component feature information, and retrieving the area identification information for the table area to obtain the table area target information; analyzing the table area target information according to the matching result combined with the table component feature information, using the table component feature information to test the table area target information, analyzing and judging whether the table area target information conforms to the corresponding table component feature information, and obtaining the test result; analyzing and judging whether the division adjustment is required based on the test result combined with the area division situation, when the table area target information does not conform to the corresponding table component feature information, and the test result is that the division adjustment is required, it is determined that it is not required. The location of the table area target information that meets the corresponding table component characteristic information is locked, and the surrounding data information is analyzed based on the abnormal data information location to determine whether there is a cross-border division, and the abnormal analysis result is obtained. Then, according to the abnormal analysis result, fine-tuning is performed on the current area division situation. When there is no table area target information that does not meet the corresponding table component characteristic information, and the inspection result is that no division adjustment is required, the table area information that does not meet the table component characteristic information is analyzed based on the inspection result to see whether it can be ignored. If it can be ignored, the table area characteristics are matched with the area identification information. If it cannot be ignored, an abnormal reminder is issued, so that relevant personnel can deal with the abnormal situation.
[0099] The above technical solution realizes the replication of the table component by creating a table model for the table component, and obtains the table model corresponding to the table component, so that when creating the data binding relationship, analysis and processing can be performed based on the table model, which provides convenience for the creation of the data binding relationship, and divides the table component into regions according to the structure, so that when generating labels, it can be done according to the regions, thereby improving the efficiency of feature determination and acquisition of regional identification information, and at the same time ensuring that the label contains all the information of the table component, ensuring the comprehensiveness and accuracy of the table model.
[0100] like Figure 4 As shown, in one embodiment provided by the present invention, a data binding relationship is created for a metadata warehouse and a table model according to the binding relationship, including:
[0101] Analyze the type of binding relationship, determine whether the binding relationship is simple binding or complex binding, and obtain preliminary analysis results;
[0102] When the preliminary analysis result shows that the binding relationship is a simple binding, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data, and the target data is used as the display content of the binding relationship to obtain the binding content;
[0103] When the preliminary analysis result shows that the binding relationship is a complex binding, further analysis is performed to determine whether there is a calculation expression in the binding relationship to obtain a secondary analysis result;
[0104] When the secondary analysis result shows that there is a calculation expression in the binding relationship, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data. Then, the target data is calculated and processed according to the calculation expression to determine the display content of the binding relationship and obtain the binding content.
[0105] When the secondary analysis result is that there is no calculation expression in the binding relationship, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data, and then the target data is processed according to the binding relationship to determine the display content of the binding relationship and obtain the binding content;
[0106] Determine binding relationship description information according to binding content and binding type, and implement binding of the binding relationship according to the binding relationship description information;
[0107] The dynamic data information of the binding implementation status of the binding relationship description information is obtained, and the dynamic binding relationship table is synchronously updated according to the dynamic data information; the dynamic binding relationship table is a binding relationship mapping table, which is composed of two-dimensional data, the first dimension data is the ID number of the sub-control with binding association in the table model as the key, and the second dimension data is the element ID in the binding data set corresponding to the first dimension data as the key, and its value is the binding expression object or calculation expression of the binding relationship.
[0108] In the above technical solution, simple bindings include: text label controls, text input box controls, etc., and complex bindings include: drop-down boxes, single-choice (multi-choice) button groups, etc.
[0109] In the above technical solution, the binding relationship describes the association between a metadata in the data warehouse and a specific sub-control in the Web table component. The binding relationship description is a binding expression object containing two data attributes: binding type and binding content.
[0110] In the above technical scheme, target data matching is performed in the metadata warehouse for the target sub-control, including: performing preliminary screening in the metadata warehouse according to the target sub-control to obtain preliminary screening results; parsing the binding relationship to obtain the binding relationship parsing data; disassembling the binding relationship parsing data, and identifying the position data for the disassembly information to determine the target position information of the target sub-control; performing effective matching screening on the target position information of the target sub-control in combination with the binding relationship to determine the final target position information; performing matching value analysis and calculation in the preliminary screening results according to the final target position information, and locking the maximum value based on the matching value analysis and calculation data, and then tracing the position in the metadata warehouse based on the maximum value, reading the storage data at the corresponding position, and obtaining the target data.
[0111] The above technical solution performs different binding processing according to the type of binding relationship through simple binding and complex binding analysis, so that the binding content can be better obtained, the correctness of the binding content can be guaranteed, and then the binding relationship description information can be guaranteed, and the accuracy of the binding relationship binding can be improved. In addition, the dynamic management of the binding relationship is realized through the dynamic binding relationship table, so that when the binding relationship changes, the search can be carried out efficiently, shortening the search time and improving the search efficiency.
[0112] In an embodiment provided by the present invention, after obtaining the dynamic binding relationship table, maintenance and persistence processing are also performed on the dynamic binding relationship table, wherein the maintenance of the dynamic binding relationship table includes: monitoring and analyzing whether the binding relationship has changed, when the binding relationship has changed, obtaining change information for the binding relationship, performing binding adjustment according to the change information, and adjusting the dynamic binding relationship table according to the change information to achieve maintenance of the dynamic binding relationship table; when performing persistence processing on the dynamic binding relationship table, it includes: monitoring and analyzing whether the Web form has a program stop or page closure phenomenon, when the Web form has a program stop or page closure phenomenon, performing persistence processing on the binding relationship mapping table, obtaining the current status information of the binding relationship mapping table, serializing the current status information and storing it in the storage module, when the Web form is opened again, retrieving the target storage information in the storage module according to the Web form, and restoring the binding relationship mapping table for the target storage information.
[0113] In the above technical solution, when the binding relationship changes, it is only necessary to scan the rows or columns of the dynamic binding relationship table to quickly find the binding relationship of the sub-control (row) or field (column) in the data table view in the data warehouse that needs to be maintained.
[0114] In the above technical solution, the serialization of the current state information stored in the storage module triggers changes according to the user's interactive operation in the Web form.
[0115] In the above technical solution, the storage module includes: a record storage unit and a temporary storage unit; when the binding relationship mapping table is persistently processed, the storage information is managed in the storage module, including: temporarily storing the current state information of the binding relationship mapping table in the temporary storage unit, and at the same time, obtaining the binding relationship mapping table identification information for the current state information of the binding relationship mapping table to obtain the binding relationship mapping table identification information; judging whether there is a historical storage record according to the binding relationship mapping table identification information to obtain a first judgment result; determining the storage location according to the first judgment result, and when the first judgment result is that there is a historical storage record, matching the storage location according to the binding relationship mapping table identification information to determine the target record storage unit, and for The target record storage unit performs historical record data analysis, and determines whether historical record data cleaning is required in combination with the data cleaning standard to obtain a second judgment result. When the second judgment result is that historical record data cleaning is required, the historical record data cleaning is performed in chronological order, and then the current status information of the binding relationship mapping table is stored in the target record storage unit. When the second judgment result is that historical record data cleaning is not required, the current status information of the binding relationship mapping table is directly stored in the target record storage unit. When the first judgment result is that there is no historical storage record, a record storage unit is created according to the binding relationship mapping table identification information, and the current status information of the binding relationship mapping table is stored in the corresponding record storage unit. Among them, the data cleaning standard is a requirement for the historical record data of the storage unit, ensuring that there are at most preset data historical record data in the storage unit, and avoiding too much historical record data in the storage unit affecting the storage of the current status information of the binding relationship mapping table.
[0116] The above technical solution maintains the dynamic binding relationship table so that the dynamic binding relationship table can be adjusted in time when the binding relationship of the table control changes, ensuring that the dynamic binding relationship between the dynamic binding relationship table and the Web table is always consistent, thereby providing a guarantee for the dynamic management of the binding relationship. Moreover, through persistence processing, the current state is stored when the program stops or the page is closed in the Web table, avoiding data loss. At the same time, it can be quickly restored when the Web table is opened again without the need to re-create the dynamic binding relationship table.
[0117] like Figure 5 As shown, an embodiment of the present invention provides an API-based table component dynamic data binding system, including: a configuration acquisition module, a first creation module, a second creation module, a relationship acquisition module and a data binding module;
[0118] The configuration acquisition module is used to perform API configuration for the Web table, and acquire original data for the table component based on the configured API to obtain API acquisition data;
[0119] The first creation module is used to create a metadata warehouse for API-acquired data;
[0120] The second creation module is used to create a table model for the Web table;
[0121] The relationship acquisition module is used to analyze the binding relationship of the table component and dynamically acquire the binding relationship;
[0122] The data binding module is used to create a data binding relationship for the metadata warehouse and the table model according to the binding relationship, and obtain a dynamic binding relationship table at the same time.
[0123] like Figure 6 As shown, in one embodiment provided by the present invention, the first creation module includes: a data confirmation unit, a data conversion unit, a view table determination unit and a data storage unit;
[0124] The data confirmation unit is used to determine the API to obtain data;
[0125] The data conversion unit is used to convert the API acquired data according to the API data contract to obtain a two-dimensional data matrix of the API acquired data;
[0126] The view table determination unit is used to determine the metadata table view according to the two-dimensional data matrix of the API-acquired data;
[0127] The data storage unit is used to perform persistent storage of data in the metadata warehouse for the metadata table view.
[0128] like Figure 7 As shown, in one embodiment provided by the present invention, the second creation module includes: an analysis and division unit, a first processing unit, a second processing unit, a label generation unit and a model building unit;
[0129] The analysis and division unit is used to analyze the Web form, determine the table component structure of the Web form, and divide the Web form into regions according to the table component structure to obtain multiple table regions;
[0130] The second processing unit is used to perform information identification on the table areas respectively to obtain area identification information;
[0131] The first processing unit is used to determine features of the table areas respectively to obtain table area features;
[0132] The label generation unit is used to match the table area features with the area identification information and generate a table label according to the matching result;
[0133] The model building unit is used to build a table model according to the table tags and the table component structure to obtain the table model of the table component.
[0134] like Figure 8 As shown, in one embodiment provided by the present invention, the data binding module includes: a binding relationship unit and a mapping table establishing unit;
[0135] The binding relationship unit is used to analyze the type of the binding relationship, determine whether the binding relationship is a simple binding or a complex binding, and obtain a preliminary analysis result; when the preliminary analysis result is that the binding relationship is a simple binding, determine the target sub-control according to the binding relationship combined with the table model, and match the target data in the metadata warehouse for the target sub-control, obtain the target data, and use the target data as the display content of the binding relationship to obtain the binding content; when the preliminary analysis result is that the binding relationship is a complex binding, further analyze whether there is a calculation expression in the binding relationship to obtain a secondary analysis result; when the secondary analysis result is that there is a calculation expression in the binding relationship, determine the target sub-control according to the binding relationship combined with the table model. The target sub-control is matched with the target data in the metadata warehouse to obtain the target data, and then the target data is calculated and processed according to the calculation expression to determine the display content of the binding relationship and obtain the binding content; when the secondary analysis result is that the calculation expression does not exist in the binding relationship, the target sub-control is determined according to the binding relationship and the table model, and the target sub-control is matched with the target data in the metadata warehouse to obtain the target data, and then the target data is processed according to the binding relationship to determine the display content of the binding relationship and obtain the binding content; the binding relationship description information is determined according to the binding content and the binding type, and the binding of the binding relationship is realized according to the binding relationship description information;
[0136] The mapping table establishment unit is used to obtain dynamic data information of the binding implementation status of the binding relationship description information, and synchronously update the dynamic binding relationship table according to the dynamic data information; the dynamic binding relationship table is a binding relationship mapping table, which is composed of two-dimensional data, the first dimension data is the ID number of the sub-control with binding association in the table model as the key, and the second dimension data is the element ID in the binding data set corresponding to the first dimension data as the key, and its value is the binding expression object or calculation expression of the binding relationship.
[0137] like Fig. 9 As shown, in one embodiment provided by the present invention, the data binding module further includes: a maintenance unit and a persistence processing unit;
[0138] The maintenance unit is used to monitor and analyze whether the binding relationship has changed. When the binding relationship has changed, the change information is obtained for the binding relationship, and the binding adjustment is performed according to the change information. At the same time, the dynamic binding relationship table is adjusted according to the change information to achieve maintenance of the dynamic binding relationship table;
[0139] The persistence processing unit is used to monitor and analyze whether the Web form has a program stop or page closing phenomenon. When the Web form has a program stop or page closing phenomenon, persistence processing is performed on the binding relationship mapping table, and the current state information of the binding relationship mapping table is obtained. The current state information is serialized and stored in the storage module. When the Web form is opened again, the target storage information is retrieved from the storage module according to the Web form, and the binding relationship mapping table is restored according to the target storage information.
[0140] An API-based table component dynamic data binding system is a system corresponding to an API-based table component dynamic data binding method. The working principle and beneficial effects of the system have been explained in its corresponding method embodiment and will not be repeated here.
[0141] Those skilled in the art should understand that the first and second in the present invention merely refer to different application stages.
[0142] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A dynamic data binding method for a table component based on an API, characterized in that: The table component dynamic data binding method comprises: Configure the API for the Web table, and obtain the original data for the table component based on the configured API to obtain the API data; Create a metadata warehouse for API-acquired data; Create table models for web tables; Analyze the binding relationship of table components and dynamically obtain the binding relationship; Create data binding relationships for the metadata warehouse and table model based on the binding relationships, and obtain the dynamic binding relationship table.
2. The table component dynamic data binding method according to claim 1, characterized in that: Create a metadata warehouse for API data acquisition, including: Determine the API to obtain data; According to the API data contract, the data obtained by the API is converted to obtain a two-dimensional data matrix of the data obtained by the API; Determine the metadata table view based on the two-dimensional data matrix of the data obtained from the API; For metadata table views, data is persistently stored in the metadata warehouse.
3. The table component dynamic data binding method according to claim 1, characterized in that: Create a table model for a web table, including: Analyze the Web form, determine the table component structure of the Web form, and divide the Web form into regions according to the table component structure to obtain multiple table regions; Perform information recognition on the table areas respectively to obtain area recognition information; Determine the features of the table area respectively to obtain the features of the table area; Match the table area features with the area identification information, and generate table labels according to the matching results; A table model is constructed according to the table tags and the table component structure to obtain a table model of the table component.
4. The table component dynamic data binding method according to claim 1, characterized in that: Create data binding relationships for the metadata warehouse and table model based on the binding relationships, including: Analyze the type of binding relationship, determine whether the binding relationship is simple binding or complex binding, and obtain preliminary analysis results; When the preliminary analysis result shows that the binding relationship is a simple binding, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data, and the target data is used as the display content of the binding relationship to obtain the binding content; When the preliminary analysis result shows that the binding relationship is a complex binding, further analysis is performed to determine whether there is a calculation expression in the binding relationship to obtain a secondary analysis result; When the secondary analysis result shows that there is a calculation expression in the binding relationship, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data. Then, the target data is calculated and processed according to the calculation expression to determine the display content of the binding relationship and obtain the binding content. When the secondary analysis result is that there is no calculation expression in the binding relationship, the target sub-control is determined according to the binding relationship combined with the table model, and the target data is matched in the metadata warehouse for the target sub-control to obtain the target data, and then the target data is processed according to the binding relationship to determine the display content of the binding relationship and obtain the binding content; Determine binding relationship description information according to binding content and binding type, and implement binding of the binding relationship according to the binding relationship description information; The dynamic data information of the binding implementation status of the binding relationship description information is obtained, and the dynamic binding relationship table is synchronously updated according to the dynamic data information; the dynamic binding relationship table is a binding relationship mapping table, which is composed of two-dimensional data, the first dimension data is the ID number of the sub-control with binding association in the table model as the key, and the second dimension data is the element ID in the binding data set corresponding to the first dimension data as the key, and its value is the binding expression object or calculation expression of the binding relationship.
5. The table component dynamic data binding method according to claim 4, characterized in that: After the dynamic binding relationship table is obtained, maintenance and persistence processing is also performed on the dynamic binding relationship table, wherein the maintenance of the dynamic binding relationship table includes: monitoring and analyzing whether the binding relationship has changed, when the binding relationship has changed, obtaining change information for the binding relationship, making binding adjustments based on the change information, and adjusting the dynamic binding relationship table according to the change information to achieve maintenance of the dynamic binding relationship table; when the dynamic binding relationship table is persistently processed, it includes: monitoring and analyzing whether the Web form has a program stop or page closure phenomenon, when the Web form has a program stop or page closure phenomenon, performing persistence processing on the binding relationship mapping table, obtaining the current status information of the binding relationship mapping table, serializing the current status information and storing it in the storage module, and when the Web form is opened again, retrieving the target storage information in the storage module according to the Web form, and restoring the binding relationship mapping table for the target storage information.
6. An API-based table component dynamic data binding system, characterized in that: The table component dynamic data binding system comprises: a configuration acquisition module, a first creation module, a second creation module, a relationship acquisition module and a data binding module; The configuration acquisition module is used to perform API configuration for the Web table, and acquire original data for the table component based on the configured API to obtain API acquisition data; The first creation module is used to create a metadata warehouse for API-acquired data; The second creation module is used to create a table model for the Web table; The relationship acquisition module is used to analyze the binding relationship of the table component and dynamically acquire the binding relationship; The data binding module is used to create a data binding relationship for the metadata warehouse and the table model according to the binding relationship, and obtain a dynamic binding relationship table at the same time.
7. The table component dynamic data binding system according to claim 6, characterized in that: The first creation module includes: a data confirmation unit, a data conversion unit, a view table determination unit and a data storage unit; The data confirmation unit is used to determine the API to obtain data; The data conversion unit is used to convert the API acquired data according to the API data contract to obtain a two-dimensional data matrix of the API acquired data; The view table determination unit is used to determine the metadata table view according to the two-dimensional data matrix of the API-acquired data; The data storage unit is used to perform persistent storage of data in the metadata warehouse for the metadata table view.
8. The table component dynamic data binding system according to claim 6, characterized in that: The second creation module includes: an analysis and division unit, a first processing unit, a second processing unit, a label generation unit and a model building unit; The analysis and division unit is used to analyze the Web form, determine the table component structure of the Web form, and divide the Web form into regions according to the table component structure to obtain multiple table regions; The second processing unit is used to perform information identification on the table areas respectively to obtain area identification information; The first processing unit is used to determine features of the table areas respectively to obtain table area features; The label generation unit is used to match the table area features with the area identification information and generate a table label according to the matching result; The model building unit is used to build a table model according to the table tags and the table component structure to obtain the table model of the table component.
9. The table component dynamic data binding system according to claim 6, characterized in that: The data binding module includes: a binding relationship unit and a mapping table establishment unit; The binding relationship unit is used to analyze the type of the binding relationship, determine whether the binding relationship is a simple binding or a complex binding, and obtain a preliminary analysis result; when the preliminary analysis result is that the binding relationship is a simple binding, determine the target sub-control according to the binding relationship combined with the table model, and match the target data in the metadata warehouse for the target sub-control, obtain the target data, and use the target data as the display content of the binding relationship to obtain the binding content; when the preliminary analysis result is that the binding relationship is a complex binding, further analyze whether there is a calculation expression in the binding relationship to obtain a secondary analysis result; when the secondary analysis result is that there is a calculation expression in the binding relationship, determine the target sub-control according to the binding relationship combined with the table model. The target sub-control is matched with the target data in the metadata warehouse to obtain the target data, and then the target data is calculated and processed according to the calculation expression to determine the display content of the binding relationship and obtain the binding content; when the secondary analysis result is that the calculation expression does not exist in the binding relationship, the target sub-control is determined according to the binding relationship and the table model, and the target sub-control is matched with the target data in the metadata warehouse to obtain the target data, and then the target data is processed according to the binding relationship to determine the display content of the binding relationship and obtain the binding content; the binding relationship description information is determined according to the binding content and the binding type, and the binding of the binding relationship is realized according to the binding relationship description information; The mapping table establishment unit is used to obtain dynamic data information of the binding implementation status of the binding relationship description information, and synchronously update the dynamic binding relationship table according to the dynamic data information; the dynamic binding relationship table is a binding relationship mapping table, which is composed of two-dimensional data, the first dimension data is the ID number of the sub-control with binding association in the table model as the key, and the second dimension data is the element ID in the binding data set corresponding to the first dimension data as the key, and its value is the binding expression object or calculation expression of the binding relationship.
10. The table component dynamic data binding system according to claim 9, characterized in that: The data binding module further includes: a maintenance unit and a persistence processing unit; The maintenance unit is used to monitor and analyze whether the binding relationship has changed. When the binding relationship has changed, the change information is obtained for the binding relationship, and the binding adjustment is performed according to the change information. At the same time, the dynamic binding relationship table is adjusted according to the change information to achieve maintenance of the dynamic binding relationship table; The persistence processing unit is used to monitor and analyze whether the Web form has a program stop or page closing phenomenon. When the Web form has a program stop or page closing phenomenon, persistence processing is performed on the binding relationship mapping table, and the current state information of the binding relationship mapping table is obtained. The current state information is serialized and stored in the storage module. When the Web form is opened again, the target storage information is retrieved from the storage module according to the Web form, and the binding relationship mapping table is restored according to the target storage information.