Association processing method and device of data model, electronic equipment and storage medium

By establishing a connection between the target model and the associated model, and utilizing the mapping relationship between the associated primary key and attributes, data association is automatically achieved, solving the problem of low data association efficiency in existing technologies, reducing development costs, and improving data association efficiency.

CN116737695BActive Publication Date: 2026-01-06YGSOFT INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310742174.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2026-01-06
Estimated Expiration
2043-06-20

AI Technical Summary

Technical Problem

Existing technologies have low efficiency in data association between different table files, which cannot meet the needs of flexible association query analysis, and the code development leads to a large performance load and loss.

Method used

By establishing relationships between multiple models, the target model and related models are determined. The target table data is generated using the mapping relationship between the primary key and related attributes, thus avoiding code development and automatically realizing data association.

Benefits of technology

It improves data association efficiency, reduces development costs, enables accurate association of data from different table files without code development, and simplifies the model association process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737695B_ABST
    Figure CN116737695B_ABST
Patent Text Reader

Abstract

The application discloses a kind of association processing method, device, electronic equipment and storage medium of data model.Therein, the method comprises: determining at least one target model from multiple models;Determine the associated model associated with the target model from multiple models, wherein the mapping relationship exists between the association attribute of the target model and the association primary key in the associated model;According to the association primary key, the association attribute and the association mode between the target model and the associated model, generate target table data, wherein at least the same to-be-processed information between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key in target table data, information related to to-be-processed information in the target model and information related to to-be-processed information in the associated model are included.The application solves the technical problem of low data association efficiency when data association is performed on data of different table files in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and more specifically, to a method, apparatus, electronic device, and storage medium for associating data models. Background Technology

[0002] In the daily business data query and analysis process, it is known that there are obvious relationships between different business information tables. However, since there are no rules to support automatic association of models, cross-data table queries are generally implemented through project development.

[0003] However, designing and developing related query attributes and rules based on actual business needs and code development cannot meet the requirements for flexible and on-demand related query analysis. Furthermore, since a business entity may have multiple expandable related attributes, different query scenarios may require linking different attributes. Implementing all attribute links at once through code would result in significant database performance load and overhead, hindering users from quickly accessing queries.

[0004] Therefore, it is evident that existing technologies suffer from low data association efficiency when performing data association on data from different table files. Summary of the Invention

[0005] This application provides a data model association processing method, apparatus, electronic device, and storage medium to at least solve the technical problem of low data association efficiency in the prior art when performing data association on data from different table files.

[0006] According to one aspect of this application, a method for associating data models is provided, comprising: determining at least one target model from a plurality of models, wherein the model is a data model composed of at least one table file in a database, and the target model is any one of the plurality of models; determining an association model associated with the target model from the plurality of models, wherein the association attribute of the target model has a mapping relationship with the association primary key in the association model, the association attribute is a field in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the association model; generating target table data based on the association primary key, the association attribute, and the association method between the target model and the association model, wherein the target table data includes at least unprocessed information that is identical between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the association model.

[0007] Optionally, the data model association processing method further includes: before determining the associated models related to the target model from multiple models, obtaining the association rules corresponding to each model in the multiple models, wherein the association rules corresponding to each model are used to define the models associated with each model, the association attributes of each model, and the association primary key of the models associated with each model, and there is a mapping relationship between the association attributes and the association primary key; and recording the association rules in an association relationship record table, wherein the association relationship record table is a table file in the database.

[0008] Optionally, the data model association processing method further includes: reading the association relationship record table from the database; determining the association rule corresponding to the target model based on the association relationship record table; and determining the association model associated with the target model, the association attribute of the target model, and the association primary key in the association model according to the association rule corresponding to the target model.

[0009] Optionally, the data model association processing method further includes: querying the first field information corresponding to the association attribute from the target model, and querying the second field information corresponding to the association primary key from the association model; merging the same information in the second field information and the first field information into information to be processed; and generating target table data based on the information to be processed and the association method.

[0010] Optionally, the data model association processing method further includes: before generating target table data based on the association primary key, association attributes, and the association method between the target model and the association model, determining the association method between the target model and the association model as a first association method or a second association method, wherein the first association method is used to associate query the first target information in the target model and the second target information in the association model, and the second association method is used to associate query the second target information in the association model and all field information in the target model, wherein the first target information is information related to the first field information in the target model, and the second target information is information related to the second field information in the association model.

[0011] Optionally, the data model association processing method further includes: when the association method is the first association method, taking the information in the target model that is in the same table file and in the same row as the information to be processed as the first target information; taking the information in the association model that is in the same table file and in the same row as the information to be processed as the second target information; and generating target table data based on the information to be processed, the first target information, and the second target information.

[0012] Optionally, the data model association processing method further includes: when the association method is the second association method, taking the information in the association model that is in the same table file and in the same row as the information to be processed as the second target information, and taking all information in the target model other than the information to be processed as the third target information; generating target table data based on the information to be processed, the second target information and the third target information.

[0013] According to another aspect of this application, a data model association processing apparatus is also provided, comprising: a first determining unit, configured to determine at least one target model from a plurality of models, wherein the model is a data model composed of at least one table file in a database, and the target model is any one of the plurality of models; a second determining unit, configured to determine an association model associated with the target model from the plurality of models, wherein the association attribute of the target model has a mapping relationship with the association primary key in the association model, the association attribute is a field in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the association model; and a generating unit, configured to generate target table data based on the association primary key, the association attribute, and the association method between the target model and the association model, wherein the target table data includes at least unprocessed information that is identical between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the association model.

[0014] According to another aspect of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, wherein the associated processing method of the data model of any one of the above is controlled by the computer program when it is running.

[0015] According to another aspect of this application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the associated processing method of the data model of any of the above.

[0016] In this application, a method of establishing relationships between multiple models is adopted. First, at least one target model is determined from the multiple models. Then, associated models related to the target model are determined from the multiple models. Each model is a data model composed of at least one table file in a database, and the target model is any one of the multiple models. The association attributes of the target model are mapped to the association primary keys in the associated models. The association attributes are fields in a table file corresponding to the target model, and the association primary keys are fields in a table file corresponding to the associated models. Finally, target table data is generated based on the association primary keys, association attributes, and the relationship between the target model and the associated models. The target table data includes at least the unprocessed information that is identical between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the associated models.

[0017] As can be seen from the above, this application achieves the goal of automatically associating related models with the target model after determining a target model from multiple models, and automatically querying the target table data with correlation between the target model and the related primary key in the related model by establishing the association method between the target model and the related model, and the mapping relationship between the association attribute of the target model and the association primary key in the related model. This avoids unnecessary software project development work, saves development costs, and improves the data association efficiency when associating data in different table files.

[0018] Therefore, the technical solution of this application achieves the goal of accurately associating different data models with related data in different models without the need for code development. This avoids the technical defects of high development costs and low model association efficiency caused by the need for code development, and solves the technical problem of low data association efficiency when associating data in different table files in the prior art. Attached Figure Description

[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0020] Figure 1 This is a flowchart of an optional data model association processing method according to an embodiment of this application;

[0021] Figure 2 This is a flowchart illustrating the use of a data processing system according to an embodiment of this application;

[0022] Figure 3This is a flowchart of an optional method for generating target table data according to an embodiment of this application;

[0023] Figure 4 This is a schematic diagram of an optional data processing system according to an embodiment of this application;

[0024] Figure 5 This is a schematic diagram of an optional data model association processing apparatus according to an embodiment of this application;

[0025] Figure 6 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] It should also be noted that all relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0029] The present application will be further described below with reference to various embodiments.

[0030] Example 1

[0031] In the process of daily business data query and analysis, it is known that there are obvious relationships between different business information tables. However, since there are no rules to support automatic model association, the current approach is to use project-based software development to achieve model association for query scenarios. However, this software development approach is time-consuming and labor-intensive, and therefore does not meet the growing demand for flexible query and analysis.

[0032] Specifically, existing software-based methods for linking different data models have at least the following problems.

[0033] 1. There are clear and definable business relationships between different models in the business system, such as the relationship between the main table and sub-tables of the analysis model, and the relationship between the object type attributes in the business document and the management object model. However, because no relationship records are formed in the business system, users cannot quickly determine the relationship model when they encounter scenarios that require relationship analysis, making it difficult to carry out relationship modeling work smoothly.

[0034] 2. The same analytical field in the analysis model may have multiple scenarios related to multiple data models. Ordinary users who are not proficient in the business are unlikely to accurately understand such multiple scenarios related to the analysis model.

[0035] 3. Conventional model association methods require manually defining the primary and foreign key relationships between models, which is a tedious and complex process with a high technical threshold. Therefore, it is difficult to meet the needs of general users who require simple and quick association modeling.

[0036] To address the aforementioned issues, according to an embodiment of this application, an embodiment of a data model association processing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0037] Figure 1 This is a flowchart of an optional data model association processing method according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0038] Step S101: Determine at least one target model from multiple models.

[0039] In step S101, the model is a data model consisting of at least one table file in the database, and the target model is any one of the multiple models.

[0040] Optionally, in this embodiment of the application, a data processing system is provided as the execution subject of the association processing method of the data model in this embodiment of the application. The data processing system can be a software system or an embedded system.

[0041] Optionally, the multiple models can be multiple data models deployed in the database corresponding to the business system. Here, the business system refers to the database-based software system used in different business domains, such as an accounting software system used in the financial business domain, a software system used to link logistics data in the logistics business domain, and a software system used to manage production data in the production business domain.

[0042] In addition, each model consists of at least one table file (also called a data table) in the database. For example, Table 1 shows an optional data model based on a single table file according to an embodiment of this application.

[0043] Table 1

[0044] time Document Number Recipient payer Payment amount Payment matters 2023.01.02 0011 AAA BBBB 10000 Salary

[0045] In step S102, the associated models that are related to the target model are determined from multiple models.

[0046] In step S102, there is a mapping relationship between the association attributes of the target model and the association primary key in the association model. The association attributes are fields in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the association model.

[0047] Optionally, a relationship record table is pre-deployed in the data processing system. The relationship record table is used to record whether there is a relationship between any two models among multiple models, the relationship method between any two models that are related, and the specific fields that are related between any two models that are related.

[0048] Furthermore, after determining the target model, the data processing system can identify the associated models from multiple models based on the association record table. These associated models can be one or more. Additionally, the data processing system can determine, based on the association record table, which specific fields link the target model and the associated models. To distinguish them, the fields in the target model that establish the association with the associated models can be called the association attributes of the target model, and the fields in the associated models that establish the association with the target model can be called the association primary keys of the associated models.

[0049] For example, Table 2 shows another optional data model according to an embodiment of this application.

[0050] Table 2

[0051] Company Name Payment time Payment Account Payment Manager BBB 2023.01.01 1023356 FF

[0052] Assuming Table 1 is the target model and Table 2 is the associated model corresponding to Table 1, then the "Payer" field in Table 1 can be the associated attribute of the target model (Table 1), and the "Unit Name" field in Table 2 can be the associated primary key of the associated model (Table 2).

[0053] Step S103: Generate target table data based on the associated primary key, associated attributes, and the association method between the target model and the associated models.

[0054] In step S103, the target table data includes at least the same unprocessed information between the first field information corresponding to the associated attribute and the second field information corresponding to the associated primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the associated model.

[0055] Optionally, in order to achieve data association analysis between the target model and the associated model, the data processing system can query related data from the target model and the associated model based on the associated primary key, associated attributes, and the association method between the target model and the associated model, and then generate a target table data, thereby assisting the users of the data processing system to perform association analysis on data in different table files.

[0056] For example, based on Table 1 and Table 2, the data processing system can generate Table 3 as the target table data so that users can perform correlation analysis on Table 1 and Table 2.

[0057] Table 3

[0058]

[0059] Based on the content of steps S101 to S103 above, this application adopts a method of establishing association relationships between multiple models. First, at least one target model is determined from the multiple models. Then, associated models related to the target model are determined from the multiple models. Each model is a data model composed of at least one table file in a database, and the target model is any one of the multiple models. The association attributes of the target model and the association primary keys in the associated models have a mapping relationship. The association attributes are fields in a table file corresponding to the target model, and the association primary keys are fields in a table file corresponding to the associated models. Finally, target table data is generated based on the association primary keys, association attributes, and the association method between the target model and the associated models. The target table data includes at least the same unprocessed information between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the associated models.

[0060] As can be seen from the above, this application achieves the goal of automatically associating related models with the target model after determining a target model from multiple models, and automatically querying the target table data with correlation between the target model and the related primary key in the related model by establishing the association method between the target model and the related model, and the mapping relationship between the association attribute of the target model and the association primary key in the related model. This avoids unnecessary software project development work, saves development costs, and improves the data association efficiency when associating data in different table files.

[0061] Therefore, the technical solution of this application achieves the goal of accurately associating different data models with related data in different models without the need for code development. This avoids the technical defects of high development costs and low model association efficiency caused by the need for code development, and solves the technical problem of low data association efficiency when associating data in different table files in the prior art.

[0062] In one optional embodiment, before determining the associated models related to the target model from multiple models, the data processing system can obtain the association rules corresponding to each model among the multiple models. Each association rule defines the models associated with each model, the association attributes of each model, and the association primary key of the models associated with each model, with a mapping relationship between the association attributes and the association primary key. Then, the data processing system records the association rules in an association relationship record table, which is a table file in the database.

[0063] Furthermore, in order to determine the associated models related to the target model from multiple models, the data processing system can read the association record table from the database, then determine the association rules corresponding to the target model based on the association record table, and finally determine the associated models, association attributes, and association primary keys in the associated models based on the association rules corresponding to the target model.

[0064] Optionally, Figure 2 This is a flowchart illustrating the use of a data processing system according to an embodiment of this application, such as... Figure 2 As shown, firstly, developers sort out common, definable, general and extractable association rules between multiple data models according to the model association types of the business system, and record the relationship types, corresponding association attributes and association primary keys between models through the association relationship record table, and save the association relationship record table in the data processing system.

[0065] Subsequently, the data analyst accesses the data processing system's analysis model management page, selects and maintains two or more models from the multiple models corresponding to the business system as the models to be analyzed, and saves them (e.g., Figure 2 (Analysis Model A, Analysis Model B, and Analysis Model C).

[0066] Furthermore, when a data analyst enters the model association settings page and selects an analysis model as the target model, the data processing system checks the association record table to see if a corresponding associated model exists for the target model. If so, it recommends the model to the data analyst for selection, and simultaneously returns the relationship type between the target model and the associated model, the association attributes of the target model, and the association primary key of the associated model. When an associated model is selected, the data processing system automatically populates the corresponding association rules based on the association record table.

[0067] Finally, data analysts can access the analysis chart generation page, select the saved association model, and then perform perspective analysis and generate visualization charts for the associated business data.

[0068] As can be seen from the above, unlike the existing technology that uses customized development and hard coding to achieve data association between different models, this application provides a set of front-end page functions that automatically realize the association of analysis models. By sorting out and defining a set of association rules between models, a relationship record table is formed. Combined with the front-end page functions, the purpose of automatically matching and recommending association attributes for users to choose from is achieved. Since users do not need to manually select and configure association rules, it is simple and easy to understand, thus greatly reducing the configuration threshold and achieving the technical effect of efficient association modeling.

[0069] In one alternative embodiment, Figure 3 This is a flowchart of an optional method for generating target table data according to an embodiment of this application, such as... Figure 3 As shown, it includes the following steps:

[0070] Step S301: Query the first field information corresponding to the associated attribute from the target model, and query the second field information corresponding to the associated primary key from the associated model;

[0071] Step S302: Merge the identical information in the second field and the first field into information to be processed;

[0072] Step S303: Generate target table data based on the information to be processed and the association method.

[0073] Optionally, since the association record table also records the association attributes of the target model and the association primary key of the association model, the data processing system can determine the association attributes of the target model based on the association record table and determine the field information corresponding to the association attributes as the first field information. At the same time, the data processing system can also determine the association primary key of the association model based on the association record table and determine the field information corresponding to the association primary key as the second field information.

[0074] It should be noted that since the related attributes and related primary keys actually express the same field meaning, but in different data forms, the actual field information corresponding to the two may have some identical content, the data processing system can merge the identical information in the second field information and the first field information into the information to be processed, and then generate the target table data based on the information to be processed and the relationship between the related model and the target model.

[0075] In an optional embodiment, before generating target table data based on the associated primary key, associated attributes, and the association method between the target model and the associated model, the data processing system determines the association method between the target model and the associated model as a first association method or a second association method. The first association method is used to query the first target information in the target model and the second target information in the associated model. The second association method is used to query the second target information in the associated model and all field information in the target model. The first target information is information related to the first field information in the target model, and the second target information is information related to the second field information in the associated model.

[0076] Optionally, the first association method mentioned above is also called the internal association method. The internal association method is mainly used to associate information related to the first field information in the target model and information related to the second field information in the association model.

[0077] The second association method, also known as the left association method, mainly involves associating information related to the second field information in the association model with all field information in the target model while retaining all field information in the target model.

[0078] Specifically, when the association method is the first association method, the data processing system takes the information in the target model that is in the same table file and in the same row as the information to be processed as the first target information, and takes the information in the association model that is in the same table file and in the same row as the information to be processed as the second target information. Finally, the data processing system generates target table data based on the information to be processed, the first target information, and the second target information.

[0079] Optionally, assume that Table 4 is the target model and Table 5 is the associated model corresponding to the target model.

[0080] Table 4

[0081] time Document Code Contract Unit Recipient Payment amount 1-3 00002 Unit A-1 Unit A-1 2000 1-6 00005 Unit B-1 Unit C-1 600 1-8 00006 Unit C-1 Unit C-1 320

[0082] Table 5

[0083] Company Name Region unit leader Unit A-1 East China Person in charge 1 Unit B-1 South China Person in charge 2

[0084] Alternatively, assuming the association between Table 4 and Table 5 is an internal association, when the "payee" in Table 4 is used as the association attribute and the "company name" in Table 5 is used as the association primary key, the target table data (Table 6) can be generated.

[0085] Table 6

[0086]

[0087] In Table 6, the field information "Unit A-1" under the "Payee" field is the same as the information in the first and second fields, i.e., information to be processed. Meanwhile, the information in the same row as this information to be processed in Table 4 is the information in the second row of Table 4, i.e., the first target information; and the information in the same row as this information to be processed in Table 5 is the information in the second row of Table 5, i.e., the second target information. As can be seen from Table 6, in addition to the information to be processed, Table 6 also contains the first and second target information.

[0088] In one optional embodiment, when the association method is the second association method, the data processing system uses information in the association model that is in the same table file and in the same row as the information to be processed as the second target information, and uses all information in the target model other than the information to be processed as the third target information. Finally, the data processing system generates target table data based on the information to be processed, the second target information, and the third target information.

[0089] Alternatively, assuming the association between Table 4 and Table 5 is a left association, when the association is performed using "Contract Unit" in Table 4 as the association attribute and "Unit Name" in Table 5 as the association primary key, the target table data (Table 7) can be generated.

[0090] Table 7

[0091]

[0092] In Table 7, the fields "Unit A-1" and "Unit B-1" under the "Contract Unit" field are the same as those in the first and second fields, i.e., information to be processed. Meanwhile, the information in Table 5 that is in the same row as this information to be processed is the information in the second and third rows of Table 5, i.e., the second target information. All information in Table 4 other than this information to be processed is the third target information. As can be seen from Table 7, in addition to the information to be processed, Table 7 also contains the second and third target information.

[0093] In one alternative embodiment, Figure 4 A schematic diagram of an optional data processing system according to an embodiment of this application is shown. Figure 4 As shown, the data processing system includes: a management rule generation controller, a model recommendation association controller, an association model query controller, and a data transformation rule controller.

[0094] Among them, the management rule generation controller is used to automatically generate and update association rules for various standard business models during service initialization and runtime.

[0095] Specifically, the management rule generation controller can define the relationship types between multiple data models commonly used in the business system, such as the relationship between the main table and sub-tables of the analysis model, and the relationship between object type attributes in business documents and the management object model. The management rule generation controller can also define the default relationship type between analysis models, specifying whether the relationship between two models is a left join or an inner join. The management rule generation controller also provides a backend service / relationship record table, which records the relationship rules between commonly used entity models in the business system, recording the relationship type, relationship attributes, and relationship primary keys.

[0096] In addition, the model recommendation association controller is used to automatically push recommended association models that are related to the target model to the user when performing multi-table association modeling.

[0097] Specifically, the model recommendation association controller can automatically identify and match the corresponding association model based on the fields in the target model, and record the association attributes corresponding to the target model and the association primary key corresponding to the association model. The model recommendation association controller supports one association attribute matching multiple association primary keys, and multiple association primary keys correspond to different association models. For example, the payee field of a business document contains two attributes: employee and business partner. Through automatic matching, the payee can select the associated employee or business partner object attribute model.

[0098] In addition, the association model query controller is used to generate multi-table association query statements based on the message settings for multi-table association modeling when executing analysis model queries. It then queries and returns the data.

[0099] Specifically, the association model query controller determines the association primary key corresponding to the association attribute based on the association attribute of the target model. For example, if the association attribute is the payee field of a business document, the matching primary key is the employee object ID corresponding to the payee object ID, or the business partner object ID corresponding to the payee object ID.

[0100] Finally, the data transformation rule controller is used to automatically transform and control the data of field columns in a multi-table association model.

[0101] As can be seen from the above, unlike the existing technology that uses customized development and hard coding to achieve data association between different models, this application sorts out and defines a set of association rules between models, forms an association relationship record table, and combines it with the front-end page function to achieve the purpose of automatically matching and recommending association attributes for users to choose from. Since users do not need to manually select and configure association rules, it is simple and easy to understand, thus greatly reducing the configuration threshold and achieving the technical effect of efficient association modeling.

[0102] Example 2

[0103] This embodiment provides a data model association processing device, in which each implementation unit / module corresponds to each implementation step in Embodiment 1.

[0104] Figure 5 This is a schematic diagram of an optional data model association processing apparatus according to an embodiment of this application, such as... Figure 5 As shown, the data model association processing device includes the following units: a first determining unit 501, a second determining unit 502, and a generating unit 503.

[0105] The first determining unit 501 is used to determine at least one target model from multiple models, wherein the model is a data model composed of at least one table file in a database, and the target model is any one of the multiple models; the second determining unit 502 is used to determine the associated model related to the target model from multiple models, wherein the association attribute of the target model and the association primary key in the associated model have a mapping relationship, the association attribute is a field in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the associated model; the generating unit 503 is used to generate target table data based on the association primary key, the association attribute, and the association method between the target model and the associated model, wherein the target table data includes at least the unprocessed information that is the same between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the associated model.

[0106] Optionally, the data model association processing device further includes an acquisition unit and a recording unit. The acquisition unit is used to acquire the association rules corresponding to each model among multiple models. The association rules for each model define the models associated with each model, the association attributes of each model, and the association primary key of the models associated with each model, with a mapping relationship between the association attributes and the association primary key. The recording unit is used to record the association rules in an association relationship record table, where the association relationship record table is a table file in the database.

[0107] Optionally, the first determining unit includes: a reading subunit, a first determining subunit, and a second determining subunit. The reading subunit is used to read the association record table from the database; the first determining subunit is used to determine the association rules corresponding to the target model based on the association record table; and the second determining subunit is used to determine the association model associated with the target model, the association attributes of the target model, and the association primary key in the association model according to the association rules corresponding to the target model.

[0108] Optionally, the generation unit includes: a query subunit, a merge subunit, and a generation subunit. The query subunit is used to retrieve the first field information corresponding to the associated attribute from the target model and the second field information corresponding to the associated primary key from the associated model; the merge subunit is used to merge identical information in the second field information and the first field information into information to be processed; and the generation subunit is used to generate target table data based on the information to be processed and the association method.

[0109] Optionally, the data model association processing device further includes: a third determining unit, used to determine whether the association method between the target model and the association model is a first association method or a second association method, wherein the first association method is used to associate query the first target information in the target model and the second target information in the association model, and the second association method is used to associate query the second target information in the association model and all field information in the target model, wherein the first target information is information related to the first field information in the target model, and the second target information is information related to the second field information in the association model.

[0110] Optionally, the generation subunit includes: a first target information processing module, a second target information processing module, and a generation module. The first target information processing module, when the association method is a first association method, uses information in the target model that is in the same table file and in the same row as the information to be processed as the first target information; the second target information processing module, when the association model is in the same table file and in the same row as the information to be processed, uses information in the association model that is in the same table file and in the same row as the information to be processed as the second target information; and the generation module, when generating target table data based on the information to be processed, the first target information, and the second target information.

[0111] Optionally, the generation subunit includes: a third target information processing module and a first generation module. The third target information processing module is used, when the association method is the second association method, to take information in the association model that is in the same table file and in the same row as the information to be processed as the second target information, and to take all information in the target model other than the information to be processed as the third target information; the first generation module is used to generate target table data based on the information to be processed, the second target information, and the third target information.

[0112] Example 3

[0113] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the association processing method of the data model of any one of the embodiments 1 above by executing the executable instructions.

[0114] Figure 6 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 6 As shown, this application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the data model association processing method in embodiment 1 above.

[0115] Alternatively, the processor may perform the following steps when executing the program:

[0116] From multiple models, at least one target model is determined, wherein each model is a data model consisting of at least one table file in a database, and the target model is any one of the multiple models; from multiple models, an associated model related to the target model is determined, wherein the association attributes of the target model and the association primary key in the associated model have a mapping relationship, the association attributes are fields in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the associated model; target table data is generated based on the association primary key, association attributes, and the association method between the target model and the associated model, wherein the target table data includes at least the unprocessed information that is the same between the first field information corresponding to the association attribute and the second field information corresponding to the association primary key, information related to the unprocessed information in the target model, and information related to the unprocessed information in the associated model.

[0117] Optionally, when the processor executes the program, it may also perform the following steps: before determining the associated models related to the target model from multiple models, obtain the association rules corresponding to each model in the multiple models, wherein the association rules corresponding to each model are used to define the models associated with each model, the association attributes of each model, and the association primary key of the models associated with each model, and there is a mapping relationship between the association attributes and the association primary key; record the association rules in the association relationship record table, wherein the association relationship record table is a table file in the database.

[0118] Optionally, when the processor executes the program, it may also perform the following steps: read the association record table from the database; determine the association rule corresponding to the target model based on the association record table; and determine the association model associated with the target model, the association attribute of the target model, and the association primary key in the association model based on the association rule corresponding to the target model.

[0119] Optionally, when the processor executes the program, it may also perform the following steps: query the first field information corresponding to the associated attribute from the target model, and query the second field information corresponding to the associated primary key from the associated model; merge the identical information in the second field information and the first field information into information to be processed; generate target table data based on the information to be processed and the association method.

[0120] Optionally, the processor may also perform the following steps when executing the program: before generating the target table data based on the associated primary key, associated attributes, and the association method between the target model and the associated model, determine whether the association method between the target model and the associated model is a first association method or a second association method. The first association method is used to query the first target information in the target model and the second target information in the associated model. The second association method is used to query the second target information in the associated model and all field information in the target model. The first target information is the information in the target model related to the first field information, and the second target information is the information in the associated model related to the second field information.

[0121] Optionally, when the processor executes the program, it may also perform the following steps: when the association method is the first association method, the information in the target model that is in the same table file and in the same row as the information to be processed is taken as the first target information; the information in the association model that is in the same table file and in the same row as the information to be processed is taken as the second target information; and target table data is generated based on the information to be processed, the first target information, and the second target information.

[0122] Optionally, when the processor executes the program, it may also perform the following steps: when the association method is the second association method, the information in the association model that is in the same table file and in the same row as the information to be processed is taken as the second target information, and all information in the target model except for the information to be processed is taken as the third target information; and target table data is generated based on the information to be processed, the second target information and the third target information.

[0123] Example 4

[0124] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, which includes a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the association processing method of the data model in Embodiment 1 above.

[0125] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0126] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0127] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0129] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0130] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0131] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method of association processing of a data model, characterized by, The method comprises the following steps: determining at least one target model from a plurality of models, wherein the models are data models composed of at least one table file in a database, and the target model is any one of the plurality of models; determining an associated model associated with the target model from the plurality of models, wherein an association attribute of the target model has a mapping relationship with an association primary key in the associated model, the association attribute is a field in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the associated model; generating target table data according to the association primary key, the association attribute, and an association manner between the target model and the associated model, wherein the target table data at least includes the same to-be-processed information between first field information corresponding to the association attribute and second field information corresponding to the association primary key, information related to the to-be-processed information in the target model, and information related to the to-be-processed information in the associated model; wherein generating target table data according to the association primary key, the association attribute, and an association manner between the target model and the associated model comprises: querying the first field information corresponding to the association attribute from the target model, and querying the second field information corresponding to the association primary key from the associated model; merging the same information in the second field information and the first field information into the to-be-processed information; generating the target table data according to the to-be-processed information and the association manner; wherein, before generating target table data according to the association primary key, the association attribute, and the association manner between the target model and the associated model, the association processing method of the data model further comprises: determining that the association manner between the target model and the associated model is a first association manner or a second association manner, wherein the first association manner is used for associatively querying first target information in the target model and second target information in the associated model, and the second association manner is used for associatively querying the second target information in the associated model and all field information in the target model, wherein the first target information is information related to the first field information in the target model, and the second target information is information related to the second field information in the associated model; wherein generating the target table data according to the to-be-processed information and the association manner comprises: in the case where the association manner is the first association manner, taking information in the target model which is in the same table file and the same row as the to-be-processed information as the first target information; taking information in the associated model which is in the same table file and the same row as the to-be-processed information as the second target information; generating the target table data according to the to-be-processed information, the first target information, and the second target information.

2. The association processing method of a data model according to claim 1, characterized by, before determining the associated model associated with the target model from the plurality of models, the association processing method of the data model further comprises: acquire an association rule corresponding to each of the plurality of models, wherein the association rule corresponding to each of the models is used to define a model associated with the each of the models, an association attribute of the each of the models, and an association primary key of the model associated with the each of the models, and the association attribute and the association primary key have a mapping relationship therebetween; record the association rule in an association relationship record table, wherein the association relationship record table is one table file in the database.

3. The association processing method of a data model according to claim 2, wherein, determine an association model associated with the target model from the plurality of models, comprising: reading the association relationship record table from the database; determine an association rule corresponding to the target model according to the association relationship record table; determine an association model associated with the target model, an association attribute of the target model, and an association primary key in the association model according to the association rule corresponding to the target model.

4. The association processing method of a data model according to claim 1, characterized by, generate the target table data according to the target information and the association manner, comprising: in a case where the association manner is the second association manner, taking information in the association model which is in a same table file and a same row as the to-be-processed information as the second target information, and taking all information in the target model except the to-be-processed information as third target information; generating the target table data according to the to-be-processed information, the second target information, and the third target information.

5. An apparatus for association processing of a data model, characterized by, comprise: a first determination unit configured to determine at least one target model from a plurality of models, wherein the models are data models composed of at least one table file in a database, and the target model is any one of the plurality of models; a second determination unit configured to determine an association model associated with the target model from the plurality of models, wherein an association attribute of the target model has a mapping relationship with an association primary key in the association model, the association attribute is a field in a table file corresponding to the target model, and the association primary key is a field in a table file corresponding to the association model; a generation unit configured to generate target table data according to the association primary key, the association attribute, and an association manner between the target model and the association model, wherein the target table data at least includes same to-be-processed information between first field information corresponding to the association attribute and second field information corresponding to the association primary key, information in the target model related to the to-be-processed information, and information in the association model related to the to-be-processed information; wherein the generation unit comprises: a query subunit configured to query the first field information corresponding to the association attribute from the target model, and query the second field information corresponding to the association primary key from the association model; a merging subunit configured to merge the same information in the second field information and the first field information into the to-be-processed information; and a generation subunit configured to generate the target table data according to the to-be-processed information and the association manner. The apparatus further comprises a third determining unit configured to determine that the association manner between the target model and the association model is a first association manner or a second association manner, wherein the first association manner is used to associate the first target information in the target model and the second target information in the association model, and the second association manner is used to associate the second target information in the association model and all field information in the target model, wherein the first target information is information related to the first field information in the target model, and the second target information is information related to the second field information in the association model. The generating sub-unit comprises: a first target information processing module configured to, in the case that the association manner is the first association manner, take information in the target model which is in the same table file and in the same row as the to-be-processed information as the first target information; a second target information processing module configured to take information in the association model which is in the same table file and in the same row as the to-be-processed information as the second target information; and a generating module configured to generate the target table data according to the to-be-processed information, the first target information and the second target information.

6. A computer-readable storage medium, characterized in that, The computer readable storage medium has stored therein a computer program, wherein the computer program, when executed, controls a device in which the computer readable storage medium is located to perform the data model association processing method according to any one of claims 1 to 4.

7. An electronic device, comprising: The apparatus comprises one or more processors and a memory configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data model association processing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Foreign key mapping method and device of database table, electronic equipment and storage medium

    CN111680506A

  • Field conversion method and device of analysis model, storage medium and computer equipment

    CN115328949A