Data model generation method, apparatus, and terminal device
By obtaining the field data update cycle of the logical model, determining the reference physical model and selecting the target physical model, the problems of low timeliness and field redundancy caused by unreasonable physical model design are solved, and the consistency of data timeliness and query performance are improved.
Patent Information
- Application Number
- CN202310716057.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-06-15
AI Technical Summary
In existing technologies, unreasonable physical model design leads to problems such as low timeliness of physical tables, redundant fields, excessive data volume in a single table, and low query performance.
By obtaining the data update cycle of the fields in the logical model, a reference physical model is determined, and a target physical model is selected based on the difference, ensuring consistent data timeliness and improving the accuracy of the physical model.
It improves the accuracy of the target physical model, ensures the consistency of data timeliness, and avoids problems such as field redundancy and excessive data volume.
Smart Images

Figure CN116842108B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the fields of data processing, information technology industry, and the like, and in particular, relates to a data model generation method and device and a terminal device. BACKGROUND
[0002] A data warehouse designs a physical model based on a logical model. When the physical model is not reasonably and accurately designed, the physical table generated based on the physical model has problems such as low timeliness, field redundancy, large single-table data volume, and low query performance. Therefore, how to accurately determine the physical model is a problem that needs to be solved at present. SUMMARY
[0003] The present application provides a data model generation method and device to improve the accuracy of the physical model. The technical solution of the present application is as follows:
[0004] According to a first aspect of an embodiment of the present application, an embodiment of the present application provides a data model generation method, comprising:
[0005] obtaining a first data update period corresponding to each first field in each logical entity included in the newly-added logical model of the to-be-expanded business;
[0006] determining at least one first reference physical model corresponding to each first field, wherein the first reference physical model is a historical physical model created by the to-be-expanded business and having a same primary key as a logical entity corresponding to the first field;
[0007] determining a second reference physical model corresponding to each first field from the first reference physical model corresponding to each first field according to a difference between the first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field;
[0008] determining a target physical model corresponding to the logical model according to the second reference physical model.
[0009] According to a second aspect of an embodiment of the present application, an embodiment of the present application provides a data model generation device, comprising:
[0010] an obtaining module configured to obtain a first data update period corresponding to each first field in each logical entity included in a newly-added logical model of a to-be-expanded business;
[0011] a first determining module configured to determine at least one first reference physical model corresponding to each first field, wherein the first reference physical model is a historical physical model created by the to-be-expanded business and having a same primary key as a logical entity corresponding to the first field;
[0012] The second determining module is configured to determine a second reference physical model corresponding to each first field from the first reference physical model corresponding to each first field according to a difference between the first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field.
[0013] The third determining module is configured to determine a target physical model corresponding to the logical model according to the second reference physical model.
[0014] According to a third aspect of the embodiments of the present application, a terminal device is provided, comprising:
[0015] a processor;
[0016] a memory for storing processor-executable instructions;
[0017] The processor is configured to execute the instructions to implement the data model generation method according to the first aspect of the embodiments.
[0018] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, when the instructions in the computer-readable storage medium are executed by the processor of the terminal device, the terminal device can execute the data model generation method according to the first aspect of the embodiments.
[0019] According to a fifth aspect of the embodiments of the present application, a computer program product is provided, comprising a computer program, when the computer program is executed by the processor, the data model generation method according to the first aspect of the embodiments is implemented.
[0020] The technical solutions provided by the embodiments of the present application at least bring the following beneficial effects: after obtaining the first data update period corresponding to each first field in the logical model to be expanded and the logical model and each first field in each logical entity contained in the logical model, at least one first reference physical model corresponding to each first field can be determined, and a second reference physical model corresponding to each first field can be determined from the first reference physical model corresponding to each first field according to a difference between the first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field. Then, a target physical model corresponding to the logical model can be determined according to the second reference physical model. Thus, the data timeliness of each first field and the data timeliness of the target physical model are ensured to be consistent, thereby improving the accuracy of the target physical model.
[0021] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the application and, together with the description, function to explain the principles of the application, but are not intended to limit the application to the embodiments illustrated and described herein.
[0023] Figure 1 A flowchart of a data model generation method provided by a first embodiment of the application is shown in FIG. 1.
[0024] Figure 2 A flowchart of another data model generation method provided by a second embodiment of the application is shown in FIG. 2.
[0025] Figure 3 A flowchart of another data model generation method provided by a third embodiment of the application is shown in FIG. 3.
[0026] Figure 4 A structural diagram of a data model generation device provided by an eighth embodiment of the application is shown in FIG. 8.
[0027] Figure 5 A block diagram of a data model generation terminal device according to an exemplary embodiment is shown in FIG. 4. DETAILED DESCRIPTION
[0028] In order to make the ordinary person skilled in the art better understand the technical solutions of the application, the technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings.
[0029] The acquisition, storage, use, processing, etc. of data in the technical solutions of the application comply with relevant provisions of national laws and regulations.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily represent a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. The implementation described in the following exemplary embodiments does not represent all implementations consistent with the application. On the contrary, they are only examples of devices and methods consistent with some aspects of the application as detailed in the appended claims.
[0031] The data processing method of the embodiments of the application is executed by a data model generation device (hereinafter referred to as generation device) provided by the embodiments of the application. The device can be configured in a computer or other device to improve the accuracy of the physical model.
[0032] The data model generation method and device of the embodiments of the application are described below with reference to the drawings.
[0033] Figure 1A flowchart of a data model generation method provided by an embodiment of the present application includes the following steps.
[0034] In step 101, a logic model to be added for the to-be-expanded business and a first data update period corresponding to each first field in each logic entity included in the logic model are obtained.
[0035] In the present disclosure, when a certain business expands its business scope, a logic model to be added can be determined for the to-be-expanded business scope, so as to generate a physical model according to the logic model, and generate a physical table for storing data generated by the to-be-expanded business.
[0036] For example, after analyzing and summarizing the to-be-expanded business scope, the user can determine the logic entities to be added for the to-be-expanded business. For example, the "customer" entity, the "order" entity, the "goods" entity, and the "salesperson" entity in the sales business. Then, the attribute fields (referred to as fields) of each logic entity can be analyzed and determined. For example, the fields of the "customer" entity include the unit name, the contact person, the contact number, the address, and the like. Thus, the logic model to be added for the expanded business can be generated based on the fields of each logic entity, and the logic model is saved in the system.
[0037] In the present disclosure, the first data update period corresponding to each first field can be determined in advance according to the type of each first field, and is set in the system.
[0038] In step 102, at least one first reference physical model corresponding to each first field is determined, wherein the first reference physical model is a historical physical model created by the to-be-expanded business, and the primary key of the logic entity corresponding to the first field is the same as the primary key of the historical physical model.
[0039] The primary key of the logic entity can be a customer number, an order number, or the like.
[0040] In the present disclosure, the primary key of the logic entity corresponding to each first field can be matched with the primary key of each historical physical model created by the to-be-expanded business. When the primary key of a certain historical physical model is the same as the primary key of the logic entity corresponding to a certain first field, the historical physical model can be determined as the first reference physical model corresponding to the first field. Thus, the accuracy of the determined physical model is ensured.
[0041] It should be noted that the historical physical model created by the to-be-expanded business can include multiple primary keys. Therefore, multiple first fields in different logic entities can correspond to the same first reference physical model.
[0042] In step 103, a second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field according to a difference between a first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field.
[0043] The second data update period is a data update period of a historical physical table generated based on the first reference physical model.
[0044] In the present disclosure, the second data update period of the first reference physical model can be determined in advance and set in the system. Then, the difference between the first data update period corresponding to each first field and the second data update period of each first reference physical model corresponding thereto can be calculated. The second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field. Thus, the timeliness of data is ensured.
[0045] Optionally, in the case that the difference between the first data update period corresponding to a certain first field and the second data update period of a certain first reference physical model corresponding to the first field is less than a preset threshold, it is indicated that the timeliness of data corresponding to the first field is close to the data timeliness of the first reference physical model. Therefore, the first reference physical model can be determined as the second reference physical model corresponding to the first field. Thus, the data timeliness of the first field is consistent with the data timeliness of the second reference physical model corresponding thereto, so as to ensure the effectiveness of data.
[0046] Optionally, in the case that the difference between the first data update period corresponding to a certain first field and the second data update period of all first reference physical models corresponding to the first field is greater than or equal to a preset threshold, it is indicated that the data timeliness of each first reference physical model corresponding to the first field is inconsistent with the data timeliness of the first field. Therefore, a target physical model including the first field can be added. Thus, the data timeliness of the first field is consistent with the data timeliness of the target physical model corresponding thereto, so as to ensure the effectiveness of data.
[0047] In step 104, a target physical model corresponding to a logical model is determined according to the second reference physical model.
[0048] In the present disclosure, when the second reference physical model is one, the second reference physical model is determined as the target physical model corresponding to the logical model to be expanded and added by the business.
[0049] When the second reference physical model is multiple, the multiple second reference physical models can be sent to a preset client for designing the target physical model, for reference by a designer. When receiving feedback information sent by the client, the second reference physical model selected by the designer from the multiple second reference physical models can be determined as the target physical model corresponding to the logical model to be added for the expanded business according to the feedback information.
[0050] Optionally, when the second reference physical model is multiple, the target physical model corresponding to the logical model to be added for the expanded business can be further determined from the multiple second reference physical models according to redundancy of the first fields contained in the multiple second reference physical models.
[0051] It can be understood that the target physical model can be one or multiple. When the target physical model is multiple, each target physical model contains part of the first fields.
[0052] In the present disclosure, after obtaining the logical model to be added for the expanded business and the first data update period corresponding to each first field in each logical entity contained in the logical model, at least one first reference physical model corresponding to each first field can be determined, and the second reference physical model corresponding to each first field can be determined from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field. Then, the target physical model corresponding to the logical model is determined according to the second reference physical model. Thus, the data timeliness of each first field and the data timeliness of the target physical model are ensured to be consistent, thereby improving the accuracy of the target physical model.
[0053] Figure 2 Another data model generation method provided by the embodiment of the present application.
[0054] As shown in Figure 2 , the method comprises:
[0055] In step 201, a logical model to be added for an expanded business is obtained.
[0056] In the present disclosure, the specific implementation process of step 201 can be referred to the detailed description of any embodiment of the present disclosure, which will not be repeated here.
[0057] In step 202, the field type of each first field in each logical entity contained in the logical model is obtained.
[0058] In the present disclosure, the field type corresponding to each first field can be preset in the system. The field type can be a first type, a second type, etc., which is not limited in the present disclosure.
[0059] The first type corresponds to fields that do not require calculation processing, such as customer name, contact phone number, etc. The second type corresponds to fields that require calculation processing, such as monthly cumulative total consumption amount, etc.
[0060] Step 203, in the case where the field type of any first field is the first type, determining the time interval between the update times of each two adjacent data in the data source table corresponding to any first field within a preset time period.
[0061] In the present disclosure, in the case where the field type of a certain first field is the first type, the data of the first field can be directly read from the data source table, and the first data update period corresponding to the first field is related to the data update speed of the data source table. Therefore, the time interval between the update times of each two adjacent data in the data source table corresponding to the first field within a preset time period can be determined. According to the time interval, the first data update period corresponding to the first field is determined. Thus, the accuracy of the first data update period is improved, and the timeliness of the data of the first field is ensured.
[0062] Step 204, determining the first data update period corresponding to any first field according to the time interval.
[0063] In the present disclosure, the mean of the time interval between the update times of each two adjacent data in the data source table corresponding to a certain first field of the first type can be determined as the first data update period corresponding to the first field. Or the mode of the time interval between the update times of each two adjacent data in the data source table corresponding to a certain first field of the first type can be determined as the first data update period corresponding to the first field. The present disclosure does not limit this.
[0064] Step 205, in the case where the field type of any first field is the second type, determining the statistical period corresponding to any first field as the first data update period of any first field.
[0065] In the present disclosure, in the case where the field type of a certain first field is the second type, the data under the first field is determined according to a certain period of calculation, and the first data update period corresponding to the first field is related to the statistical period of the data under the first field. Therefore, the statistical period corresponding to the first field can be determined as the first data update period of the first field. Thus, the accuracy of the first data update period is improved, and the timeliness of the data of the first field is ensured.
[0066] In addition, the statistical period corresponding to each first field can be preset in the system. Alternatively, the first field can be parsed to determine the statistical period corresponding to the first field. For example, if a first field is the total consumption amount per month, the first data update period of the first field can be determined as one month. If a first field is the total daily turnover, the first data update period of the first field can be determined as one day.
[0067] In step 206, at least one first reference physical model corresponding to each first field is determined, wherein the first reference physical model is a historical physical model created by the to-be-extended business and taking the first field as the primary key.
[0068] In step 207, a second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field.
[0069] In step 208, a target physical model corresponding to the logical model is determined according to the second reference physical model.
[0070] In the present disclosure, the specific implementation process of steps 206-208 can be referred to the detailed description of any embodiment of the present disclosure, which will not be repeated here.
[0071] In the present disclosure, after obtaining the field type of each first field in each logical entity included in the newly-added logical model of the to-be-extended business, if the field type of any first field is of a first type, the time interval between the update times of any two adjacent data in the data source table corresponding to the first field in a preset period is determined, and the first data update period corresponding to the first field is determined according to the time interval. If the field type of any first field is of a second type, the statistical period corresponding to the first field is determined as the first data update period of the first field. Then, at least one first reference physical model corresponding to each first field is determined, and a second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field. Then, a target physical model corresponding to the logical model is determined according to the second reference physical model. In this way, the accuracy of the first data update period corresponding to the first field is improved, and thus the accuracy of the target physical model is improved.
[0072] Figure 3 Another data model generation method is provided.
[0073] As Figure 3As shown, the method comprises:
[0074] In step 301, a logical model to be expanded and a first data update period corresponding to each first field in each logical entity contained in the logical model are obtained.
[0075] In step 302, at least one first reference physical model corresponding to each first field is determined, wherein the first reference physical model is a historical physical model corresponding to the first field, which has been created by the to-be-expanded business and has the same primary key as the logical entity corresponding to the first field.
[0076] In step 303, a second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field.
[0077] In the present disclosure, the specific implementation process of steps 301-303 can be referred to the detailed description of any embodiment of the present disclosure, which will not be repeated here.
[0078] In step 304, in the case that the second reference physical model is multiple and the multiple second reference physical models contain the same first field, the matching degree between each first field and each second reference physical model is determined according to the difference corresponding to each first field contained in each second reference physical model.
[0079] In the present disclosure, in the case that the second reference physical model is multiple and at least two second reference physical models among all the second reference physical models contain the same first field, it is indicated that there is a redundant first field in the multiple second reference physical models. The matching degree between each first field and each second reference physical model can be determined based on the difference corresponding to each first field contained in each second reference physical model by using a preset matching degree algorithm. The greater the difference is, the smaller the matching degree between the first field corresponding to the difference and the second reference physical model is.
[0080] The matching degree algorithm can be a mapping relationship between the difference and the matching degree, or can be a function determined by fitting the difference and the matching degree corresponding thereto, and the present disclosure does not limit this.
[0081] For example, the second reference physical model 1 and the second reference physical model 2 contain the same first field 1, the difference between the first data update period of the first field 1 and the second data update period of the second reference physical model 1 is a1, and the difference between the first data update period of the first field 1 and the second data update period of the second reference physical model 2 is a2. The matching degree corresponding to the preset difference a1 is b1, and the matching degree corresponding to the difference a2 is b2. Thus, the matching degree between the first field 1 and the second reference physical model 1 is determined to be b1, and the matching degree between the first field 1 and the second reference physical model 2 is determined to be b2.
[0082] In step 305, the third reference physical model is determined from the plurality of second reference physical models according to the matching degrees.
[0083] In the present disclosure, the sum of the matching degrees corresponding to the first fields contained in each second reference physical model can be determined as the comprehensive score of each second reference physical model. Then, the second reference physical model with the highest comprehensive score can be determined as the third reference physical model. In the case where all the first fields are not contained in the third reference physical model, the second fields other than the first fields contained in the third reference physical model and the fourth reference physical model other than the third reference physical model among the plurality of second reference physical models are determined. The fourth reference physical model with the highest comprehensive score and containing part or all of the second fields is continuously determined from the fourth reference physical model, and the fourth reference physical model is determined as another third reference physical model. Until all the third reference physical models are determined. Thus, the same first field is avoided to be contained in the third reference physical model, causing the redundancy of the fields.
[0084] Optionally, different weights can also be set for each first field according to the requirements. The higher the weight of a certain first field, the higher the requirement for the matching degree between the time effectiveness of the first field and the time effectiveness of the target physical model. Therefore, the second reference physical model with the highest matching degree corresponding to the third field with the highest preset weight among the first fields can be determined as the third reference physical model. Then, in the case where all the first fields are not contained in the third reference physical model, the fourth field with the highest preset weight among the first fields other than the first fields contained in the third reference physical model is determined, and the fifth reference physical model other than the third reference physical model among the plurality of second reference physical models is determined. The fifth reference physical model with the highest matching degree corresponding to the fourth field is continuously determined from the fifth reference physical model, and the fifth reference physical model is determined as another third reference physical model. Until all the third reference physical models are determined. Thus, the same first field is avoided to be contained in the third reference physical model, causing the redundancy of the fields.
[0085] Step 306, determining a third reference physical model as a target physical model corresponding to the logical model.
[0086] In the present disclosure, after obtaining the first data update period corresponding to each first field in each logical entity contained in the logical model to be expanded and the newly added business, and the first reference physical model corresponding to each first field is determined, and according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field, the second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field, and in the case that the second reference physical model is multiple and the multiple second reference physical models contain the same first field, according to the difference corresponding to each first field contained in each second reference physical model, the matching degree between each first field and each second reference physical model is determined, then, according to the matching degree, the third reference physical model is determined from the multiple second reference physical models, and the third reference physical model is determined as the target physical model corresponding to the logical model. Thus, while ensuring the accuracy of the target physical model, the redundancy of the fields in the target physical model is avoided.
[0087] Figure 4 is a data model generation device block diagram according to an exemplary embodiment. Referring to Figure 4 The device includes an acquisition module 410, a first determination module 420, a second determination module 430, and a third determination module 440.
[0088] The acquisition module 410 is configured to acquire a first data update period corresponding to each first field in each logical entity contained in a logical model to be expanded and newly added by a business to be expanded.
[0089] The first determination module 420 is configured to determine at least one first reference physical model corresponding to each first field, wherein the first reference physical model is a historical physical model corresponding to the first field and having the same primary key as a logical entity of the first field, which has been created by the business to be expanded.
[0090] The second determination module 430 is configured to determine a second reference physical model corresponding to each first field from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field.
[0091] The third determination module 440 is configured to determine a target physical model corresponding to the logical model according to the second reference physical model.
[0092] In a possible implementation manner of the embodiment of the present application, the acquisition module 410 is configured to:
[0093] obtain the field type of each first field;
[0094] in a case where the field type of any first field is the first type, determine a time interval between update times of each two adjacent data in the data source table corresponding to any first field within a preset time period;
[0095] determine the first data update period corresponding to any first field according to the time interval.
[0096] In a possible implementation manner of the embodiment of the present application, the obtaining module 410 is further configured to:
[0097] in a case where the field type of any first field is the second type, determine the statistical period corresponding to any first field as the first data update period of any first field.
[0098] In a possible implementation manner of the embodiment of the present application, the third determining module 440 is configured to:
[0099] in a case where the second reference physical model is multiple and the multiple second reference physical models contain the same first field, determine the matching degree between each first field and each second reference physical model according to the difference corresponding to each first field contained in each second reference physical model;
[0100] determine the third reference physical model from the multiple second reference physical models according to the matching degree;
[0101] determine the third reference physical model as the target physical model corresponding to the logical model.
[0102] In a possible implementation manner of the embodiment of the present application, the third determining module 440 is configured to:
[0103] determine the sum of the matching degrees corresponding to each first field contained in each second reference physical model as the comprehensive score of each second reference physical model;
[0104] determine the second reference physical model with the highest comprehensive score and the fourth reference physical model containing the second field and with the highest comprehensive score as the third reference physical model,
[0105] wherein the fourth reference physical model is the second reference physical model other than the second reference physical model with the highest comprehensive score in the multiple second reference physical models, and the second field is the first field other than each first field contained in the second reference physical model with the highest comprehensive score in the multiple first fields.
[0106] In a possible implementation manner of the embodiment of the present application, the third determining module 440 is configured to:
[0107] determining the second reference physical model corresponding to the third field with the highest matching degree and the fifth reference physical model corresponding to the fourth field with the highest matching degree as the third reference physical model,
[0108] wherein the third field is the first field with the highest preset weight, the fifth reference physical model is a second reference physical model other than the second reference physical model corresponding to the third field with the highest matching degree among the plurality of second reference physical models, and the fourth field is the first field with the highest preset weight other than each first field contained in the second reference physical model corresponding to the third field with the highest matching degree.
[0109] In a possible implementation manner of the embodiment of the present application, the second determining module 430 is configured to:
[0110] In a case where the difference between the first data update period corresponding to any first field and the second data update period of any first reference physical model corresponding to any first field is less than the preset threshold, the any first reference physical model is determined as the second reference physical model corresponding to the any first field.
[0111] In a possible implementation manner of the embodiment of the present application, the third determining module 440 is further configured to:
[0112] In a case where the difference between the first data update period corresponding to any first field and the second data update period of all first reference physical models corresponding to any first field is greater than or equal to the preset threshold, the target physical model corresponding to the any first field is added to the logical model.
[0113] As to the apparatus in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments of the method, and thus will not be described here in detail.
[0114] In the present application, after the first data update period corresponding to each first field in the logical entity contained in the logical model to be expanded and added is obtained, at least one first reference physical model corresponding to each first field can be determined, and the second reference physical model corresponding to each first field can be determined from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field. Then, the target physical model corresponding to the logical model is determined according to the second reference physical model. In this way, the data timeliness of each first field is consistent with the data timeliness of the target physical model, thereby improving the accuracy of the target physical model.
[0115] Figure 5is a block diagram of a terminal device generated according to a data model according to an exemplary embodiment.
[0116] As shown in Figure 5 the terminal device 500 includes:
[0117] a memory 510 and a processor 520, a bus 530 connecting different components including the memory 510 and the processor 520, the memory 510 storing a computer program, and the processor 520 implementing the data model generation method of the embodiments of the present application when executing the program.
[0118] The bus 530 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or local bus using any of a variety of bus architectures. By way of example, these architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
[0119] The terminal device 500 typically includes a number of electronic devices readable media. These media can be any available media that can be accessed by the terminal device 500 and includes both volatile and nonvolatile media, removable and non-removable media.
[0120] The memory 510 can also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 540 and / or cache memory 550. The terminal device 500 can further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, a storage system 560 can be provided for reading from and writing to non-removable, non-volatile magnetic media (e.g., a "hard drive"). Figure 5 not shown, is typically provided as residual storage across the terminal device 500, and can be used for storing data that is less frequently accessed. Although exemplary computing system 500 is shown with storage system 560, this is not intended to be a limiting factor. For example, a host device (not shown) can also be provided to read from and write to the non-removable, non-volatile media. Figure 5 not shown, is typically provided as residual storage across the terminal device 500, and can be used for storing data that is less frequently accessed. Although exemplary computing system 500 is shown with storage system 560, this is not intended to be a limiting factor. For example, a host device (not shown) can also be provided to read from and write to the non-removable, non-volatile media.
[0121] Program / utility 580 having a set of program modules 570 can be stored in memory 510, for example, including an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof, can include implementation of the network environment in each of these examples or some combination thereof. Program modules 570 generally carry out the functions and / or methodologies described in embodiments of the application.
[0122] Terminal device 500 can also be communicatively coupled to one or more external devices 590 such as a keyboard, a pointing device, a display 591, etc.; one or more devices that enable a user to interact with terminal device 500; and / or one or more devices that enable terminal device 500 to communicate with one or more other computing devices. Such communication can be via input / output (I / O) interfaces 592. Furthermore, terminal device 500 can communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or the public network such as the Internet) via network adapter 593. As depicted, network adapter 593 is in communication with the other components of terminal device 500 through bus 530. It should be appreciated that other hardware and / or software modules can be used in conjunction with terminal device 500, including but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0123] Processor 520 performs functions of various applications and data model generation methods by running programs stored in memory 510.
[0124] It should be noted that the implementation process and technical principles of the terminal device of the present embodiment are described above in the explanation of the data model generation method of the present embodiment, which will not be repeated here.
[0125] In the present application, after obtaining the first data update period corresponding to each first field in each logical entity contained in the logic model to be expanded and the newly added business, at least one first reference physical model corresponding to each first field can be determined, and according to the difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field, the second reference physical model corresponding to each first field is determined from the first reference physical model corresponding to each first field, and then the target physical model corresponding to the logic model is determined according to the second reference physical model. Therefore, the data timeliness of each first field and the data timeliness of the target physical model are consistent, thereby improving the accuracy of the target physical model.
[0126] In an example embodiment, the present application also provides a computer readable storage medium comprising instructions, for example, a memory comprising instructions, which can be executed by a processor of a terminal device to complete the above method. Optionally, the computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0127] To implement the above embodiments, the present application also provides a computer program product, which is executed by a processor of a terminal device, so that the terminal device can execute the above data model generation method.
[0128] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The application is intended to cover any variations, uses or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice in the art to which the application pertains or can relate. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the application are indicated by the appended claims.
[0129] It should be understood that the application is not limited to the precise construction that has been described above and shown in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the appended claims.
Claims
1. A data model generation method, characterized by, The method comprises the following steps: obtaining a logical model to be expanded and a first data update period corresponding to each first field in each logical entity contained in the logical model; determining at least one first reference physical model corresponding to each first field, wherein the first reference physical model is a historical physical model whose primary key is the same as that of the logical entity corresponding to the first field; determining a second reference physical model corresponding to each first field from the first reference physical model corresponding to each first field according to the difference between the first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field; determining a target physical model corresponding to the logical model according to the second reference physical model.
2. The method of claim 1, wherein, The method comprises the following steps: obtaining a first data update period corresponding to each first field in each logical entity contained in the logical model, comprising: obtaining the field type of each first field; in the case that the field type of any first field is a first type, determining the time interval between the update times of adjacent two data in the data source table corresponding to the any first field within a preset period; 3. The method of claim 2, wherein, determining the first data update period corresponding to the any first field according to the time interval. The method further comprises the following steps:
4. The method of claim 1, wherein, in the case that the field type of any first field is a second type, determining the statistical period corresponding to the any first field as the first data update period of the any first field. The method of determining a target physical model corresponding to the logical model according to the second reference physical model comprises the following steps: in the case that the second reference physical model is multiple and the multiple second reference physical models contain the same first field, determining the matching degree between each first field and each second reference physical model according to the difference corresponding to each first field contained in each second reference physical model; determining a third reference physical model from the multiple second reference physical models according to the matching degree; 5. The method of claim 4, wherein, determining the third reference physical model as the target physical model corresponding to the logical model. The method of determining a third reference physical model from the multiple second reference physical models according to the matching degree comprises the following steps: determining the sum of the matching degrees corresponding to each first field contained in each second reference physical model as the comprehensive score of each second reference physical model; determining the second reference physical model with the highest comprehensive score and the fourth reference physical model containing the second field and having the highest comprehensive score as the third reference physical model; 6. The method of claim 4, wherein, wherein the fourth reference physical model is the second reference physical model other than the second reference physical model with the highest comprehensive score among the multiple second reference physical models, and the second field is the first field other than each first field contained in the second reference physical model with the highest comprehensive score among the multiple second reference physical models. The method of determining a third reference physical model from the multiple second reference physical models according to the matching degree comprises the following steps: determine the second reference physical model corresponding to the third field with the highest matching degree and the fifth reference physical model corresponding to the fourth field with the highest matching degree as the third reference physical model; wherein the third field is a first field with the highest preset weight, the fifth reference physical model is a second reference physical model other than the second reference physical model corresponding to the third field with the highest matching degree among the plurality of second reference physical models, and the fourth field is a first field with the highest preset weight other than each first field contained in the second reference physical model corresponding to the third field with the highest matching degree among the plurality of first fields.
7. The method of claim 1, wherein, The difference between the first data update period corresponding to each first field and the second data update period of the first reference physical model corresponding to each first field is used to determine the second reference physical model corresponding to each first field from the first reference physical model corresponding to each first field. In a case where the difference between the first data update period corresponding to any first field and the second data update period of any first reference physical model corresponding to the any first field is less than a preset threshold, the any first reference physical model is determined as the second reference physical model corresponding to the any first field.
8. The method of claim 1, wherein, Further comprising: In a case where the difference between the first data update period corresponding to any first field and the second data update period of all first reference physical models corresponding to the any first field is greater than or equal to a preset threshold, a target physical model corresponding to the logic model and containing the any first field is newly added.
9. A data model generation apparatus, characterized by comprising: Comprising: an acquisition module, configured to acquire a logic model to be expanded and added by a to-be-expanded business and a first data update period corresponding to each first field in each logic entity contained in the logic model; a first determination module, configured to determine at least one first reference physical model corresponding to each first field, wherein the first reference physical model is a historical physical model with a primary key of the to-be-expanded business identical to a primary key of a logic entity corresponding to the first field; a second determination module, configured to determine a second reference physical model corresponding to each first field from the first reference physical model corresponding to each first field according to a difference between the first data update period corresponding to each first field and a second data update period of the first reference physical model corresponding to each first field; a third determination module, configured to determine a target physical model corresponding to the logic model according to the second reference physical model.
10. The apparatus of claim 9, wherein, The acquisition module is configured to: acquire a field type of each first field; in a case where the field type of any first field is a first type, determine a time interval between update times of adjacent two pieces of data in a data source table corresponding to the any first field within a preset time period; determine a first data update period corresponding to the any first field according to the time interval.
11. The apparatus of claim 10, wherein, The acquisition module is further configured to: in a case where the field type of any first field is a second type, determine a statistical period corresponding to the any first field as the first data update period of the any first field.
12. The apparatus of claim 9, wherein, The third determining module is configured to: In a case where the second reference physical models are multiple and the multiple second reference physical models contain the same first field, determine a matching degree between each first field and each second reference physical model according to a difference value corresponding to each first field contained in each second reference physical model; determine a third reference physical model from the multiple second reference physical models according to the matching degrees; determine the third reference physical model as a target physical model corresponding to the logical model.
13. The apparatus of claim 12, wherein, The third determining module is configured to: determine a sum of the matching degrees corresponding to the first fields contained in each second reference physical model as a comprehensive score of each second reference physical model; determine a third reference physical model from a second reference physical model with the highest comprehensive score and a fourth reference physical model containing a second field and having the highest comprehensive score; wherein the fourth reference physical model is a second reference physical model other than the second reference physical model with the highest comprehensive score from the multiple second reference physical models, and the second field is a first field other than the first fields contained in the second reference physical model with the highest comprehensive score.
14. The apparatus of claim 12, wherein, The third determining module is configured to: determine a third reference physical model from a second reference physical model with the highest matching degree corresponding to a third field and a fifth reference physical model with the highest matching degree corresponding to a fourth field; wherein the third field is a first field with the highest preset weight, the fifth reference physical model is a second reference physical model other than the second reference physical model with the highest matching degree corresponding to the third field from the multiple second reference physical models, and the fourth field is a first field with the highest preset weight other than the first fields contained in the second reference physical model with the highest matching degree corresponding to the third field.
15. The apparatus of claim 9, wherein, The second determining module is configured to: in a case where a difference between a first data update period corresponding to any first field and a second data update period of any first reference physical model corresponding to the any first field is less than a preset threshold, determine the any first reference physical model as a second reference physical model corresponding to the any first field.
16. The apparatus of claim 9, wherein, The third determining module is further configured to: in a case where a difference between a first data update period corresponding to any first field and a second data update period of all first reference physical models corresponding to the any first field is greater than or equal to a preset threshold, add a target physical model corresponding to the logical model and containing the any first field.
17. A terminal device, comprising: comprise: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data model generation method according to any one of claims 1-8. 18.A computer readable storage medium, when instructions in the computer readable storage medium are executed by a processor of a terminal device, enabling the terminal device to perform the data model generation method according to any one of claims 1-8.
19. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the data model generation method of any one of claims 1-8.
Citation Information
Patent Citations
Method for predicting residual life of axial plunger pump
CN115640652A
Method for building adaptive soft sensor
US20110295777A1