CN112597125A - Data modeling method and device, storage medium and electronic device - Google Patents

Data modeling method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112597125A
CN112597125A CN202011407566.8A CN202011407566A CN112597125A CN 112597125 A CN112597125 A CN 112597125A CN 202011407566 A CN202011407566 A CN 202011407566A CN 112597125 A CN112597125 A CN 112597125A
Authority
CN
China
Prior art keywords
data model
target data
modeling
target
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011407566.8A
Other languages
Chinese (zh)
Inventor
解巧巧
吴强
赵梦婷
李乐
王鹏
彭强
田江
向小佳
丁永建
李璠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Everbright Technology Co ltd
Original Assignee
Everbright Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Everbright Technology Co ltd filed Critical Everbright Technology Co ltd
Priority to CN202011407566.8A priority Critical patent/CN112597125A/en
Publication of CN112597125A publication Critical patent/CN112597125A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • G06F16/212Schema design and management with details for data modelling support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data modeling method and device, a storage medium and an electronic device, wherein the method comprises the following steps: in response to the creation operation received in the modeling operation interface, creating a target data model, wherein the target data model has N attributes, and N is a natural number greater than 1; generating a target data table in a target database in response to a first selection operation on M attributes in a target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields correspond to the M attributes one by one, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N; and establishing an incidence relation between the target data model and the target data table, wherein the incidence relation is used for indicating that the target data table is generated based on the target data model. The invention solves the problem that the incidence relation between the established data table and the data model can not be determined in the related technology.

Description

Data modeling method and device, storage medium and electronic device
Technical Field
The invention relates to the field of computers, in particular to a data modeling method and device, a storage medium and an electronic device.
Background
The data modeling refers to abstract organization of various real world data, and determines the range of the database to be administered, the organization form of the data and the like until the data are converted into a real database. The data model for information systems, as a conceptual data model, is essentially the first canonical technique for a set of recorded data requirements. The data is first used to discuss the initial requirements of the enterprise and then transformed into a logical data model that can be implemented in a conceptual model of the data structure in the database. The implementation of one conceptual data model may require multiple logical data models. The last step in data modeling is to determine the logical data model into the physical data model to the specific requirements on data access performance and storage.
In the related art, in the data modeling process, after a data model (or referred to as a logic model) is established, a data table in a database can be established by using the established data model, but because the data modeling and table establishing process is split, for the established data table, it cannot be determined according to which data model the data table is established, that is, the association relationship between the data table and the data model cannot be determined.
Aiming at the problem that the incidence relation between the established data table and the data model cannot be determined in the related technology, an effective technical scheme is not provided yet.
Disclosure of Invention
The embodiment of the invention provides a data modeling method and device, a storage medium and an electronic device, which are used for at least solving the problem that the association relation between an established data table and a data model cannot be determined in the related technology.
According to an embodiment of the present invention, there is provided a data modeling method including: creating a target data model in response to a creation operation received in a modeling operation interface, wherein the target data model has N attributes, and N is a natural number greater than 1; generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N; establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model.
Optionally, the creating the target data model in response to the creation operation received in the modeling operation interface includes: under the condition that the creation operation is received in the modeling operation interface, displaying an input interface in a first display area of the modeling operation interface; creating the target data model upon receiving an input operation on a subject, an entity name, and a primary key of the target data model from the input interface, wherein the N attributes include the primary key.
Optionally, after the creating the target data model in response to the creating operation received in the modeling operation interface, the method further includes: and displaying the target data model in a second display area of the modeling operation interface in response to the display operation received in the modeling operation interface, wherein the second display area displays the entity name of the target data model and the preset number of attributes of the target data model, and the preset number is smaller than N.
Optionally, the creating the target data model in response to the creation operation received in the modeling operation interface further includes: and under the condition that a second selection operation is received from the modeling operation interface, displaying a first data model in the second display area, and displaying a target icon between a first attribute in the target data model and a second attribute in the first data model, wherein the second selection operation is used for indicating that the second attribute is set as a foreign key of the target data model, and the target icon is used for indicating that the first attribute corresponds to the second attribute.
Optionally, the creating the target data model in response to the creation operation received in the modeling operation interface includes: under the condition that an uploading operation is received from the modeling operation interface, extracting the content in the table uploaded through the uploading operation; creating the target data model in a case where a subject, an entity name, and a primary key of the target data model are included in the content.
Optionally, the method further comprises: receiving a deletion operation from the modeling operation interface, wherein the deletion operation is used for indicating to delete the second data model; determining whether a data table having an association relation with the second data model exists; deleting the second data model under the condition that no data table with the association relation with the second data model exists; and in the case that a data table which has an association relation with the second data model exists, forbidding to delete the second data model, and displaying prompt information, wherein the prompt information is used for indicating that the deletion of the second data model is forbidden.
According to an embodiment of the present invention, there is provided a data modeling apparatus including: the system comprises a creating module, a modeling operation interface and a data processing module, wherein the creating module is used for responding to creating operation received by the modeling operation interface and creating a target data model, the target data model has N attributes, and N is a natural number greater than 1; a generating module, configured to generate a target data table in a target database in response to a first selection operation on M attributes in the target data model, where the first selection operation is used to instruct to generate the target data table according to the M data, the target data table includes M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number greater than or equal to 1, and M is less than or equal to N; the establishing module is used for establishing an incidence relation between the target data model and the target data table, wherein the incidence relation is used for indicating that the target data table is generated based on the target data model.
Optionally, the creating module is further configured to: under the condition that the creation operation is received in the modeling operation interface, displaying an input interface in a first display area of the modeling operation interface; creating the target data model upon receiving an input operation on a subject, an entity name, and a primary key of the target data model from the input interface, wherein the N attributes include the primary key.
Optionally, the apparatus further includes a display module, configured to display, after the target data model is created in response to the creation operation received in the modeling operation interface, the target data model in a second display area of the modeling operation interface in response to the display operation received in the modeling operation interface, where an entity name of the target data model and a preset number of attributes of the target data model are displayed in the second display area, and the preset number is smaller than N.
Optionally, the creating module is further configured to: and under the condition that a second selection operation is received from the modeling operation interface, displaying a first data model in the second display area, and displaying a target icon between a first attribute in the target data model and a second attribute in the first data model, wherein the second selection operation is used for indicating that the second attribute is set as a foreign key of the target data model, and the target icon is used for indicating that the first attribute corresponds to the second attribute.
Optionally, the creating module is further configured to: under the condition that an uploading operation is received from the modeling operation interface, extracting the content in the table uploaded through the uploading operation; creating the target data model in a case where a subject, an entity name, and a primary key of the target data model are included in the content.
Optionally, the apparatus further comprises a processing module configured to: receiving a deletion operation from the modeling operation interface, wherein the deletion operation is used for indicating to delete the second data model; determining whether a data table having an association relation with the second data model exists; deleting the second data model under the condition that no data table with the association relation with the second data model exists; and in the case that a data table which has an association relation with the second data model exists, forbidding to delete the second data model, and displaying prompt information, wherein the prompt information is used for indicating that the deletion of the second data model is forbidden.
Alternatively, according to another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is arranged to perform the above-mentioned method when executed.
Alternatively, according to another embodiment of the present invention, there is provided an electronic apparatus, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the above method.
According to the method and the device, a target data model is created in response to creation operation received in a modeling operation interface, wherein the target data model has N attributes, and N is a natural number greater than 1; generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N; establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model. Because the attributes in the established data model can be directly selected to generate the data table and the incidence relation between the data model and the data table is established, the problem that the incidence relation between the established data table and the data model cannot be determined in the related technology can be solved, and the incidence relation between the established data table and the data model can be determined.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of a data modeling method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a modeling operation interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram showing a data model in a data modeling method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram showing a data model in a data modeling method according to another embodiment of the present invention;
FIG. 5 is a schematic diagram of a model management interface according to an embodiment of the present invention;
FIG. 6 is a block diagram of a data modeling apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The embodiment of the invention provides a data modeling method. Fig. 1 is a flowchart of a data modeling method according to an embodiment of the present invention, as shown in fig. 1, including:
step S102, in response to a creation operation received in a modeling operation interface, creating a target data model, wherein the target data model has N attributes, and N is a natural number greater than 1;
step S104, generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N;
step S106, establishing an incidence relation between the target data model and the target data table, wherein the incidence relation is used for indicating that the target data table is generated based on the target data model.
According to the method and the device, a target data model is created in response to creation operation received in a modeling operation interface, wherein the target data model has N attributes, and N is a natural number greater than 1; generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N; establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model. Because the attributes in the established data model can be directly selected to generate the data table and the incidence relation between the data model and the data table is established, the problem that the incidence relation between the established data table and the data model cannot be determined in the related technology can be solved, and the incidence relation between the established data table and the data model can be determined.
It should be noted that the above embodiments can be applied to a data modeling platform or a client. The platform or the client can comprise a modeling operation interface, and a target data model can be created according to the operation received in the modeling operation interface; the platform and the client may further include a data table generating interface, and may generate the target data table through operations (including but not limited to the selection operations) received in the data table generating interface. As an alternative implementation, the target data table may be generated through the above selection operation received in the modeling operation interface, that is, the data model may be created through the modeling operation interface, and the target data table may also be generated.
Optionally, the creating the target data model in response to the creation operation received in the modeling operation interface includes: under the condition that the creation operation is received in the modeling operation interface, displaying an input interface in a first display area of the modeling operation interface; creating the target data model upon receiving an input operation on a subject, an entity name, and a primary key of the target data model from the input interface, wherein the N attributes include the primary key.
The target data model is created only when input operations for the subject, the entity name and the primary key of the target data model are received, and the target data model cannot be created if any one item is absent.
Optionally, after the creating the target data model in response to the creating operation received in the modeling operation interface, the method further includes: and displaying the target data model in a second display area of the modeling operation interface in response to the display operation received in the modeling operation interface, wherein the second display area displays the entity name of the target data model and the preset number of attributes of the target data model, and the preset number is smaller than N.
In the above embodiment, as shown in fig. 2, the input interface may be displayed in a first display area of the modeling operation interface, and the established target data model may be displayed in a second display area of the modeling operation interface. Optionally, all the established data models are displayed in the second display area, where the all the data models include the target data model, and a preset number is preset to more clearly display each data model, so that only attributes of the preset number of each data model are displayed when the data models are displayed.
As shown in fig. 3, taking the preset number of 4 as an example, 4 attributes of each data model are preferentially displayed, and the number of attributes of each data model that are not displayed, for example, "57 attributes not displayed" shown in fig. 3, is displayed at a position below the last attribute of the displayed data model. And clicking '57 attributes not displayed', the 57 attributes not displayed in the data model can be continuously displayed in the second display area in an expanded mode, and accordingly expanded display of the rest attributes of the data model is achieved.
Optionally, the creating the target data model in response to the creation operation received in the modeling operation interface further includes: and under the condition that a second selection operation is received from the modeling operation interface, displaying a first data model in the second display area, and displaying a target icon between a first attribute in the target data model and a second attribute in the first data model, wherein the second selection operation is used for indicating that the second attribute is set as a foreign key of the target data model, and the target icon is used for indicating that the first attribute corresponds to the second attribute.
In the above embodiment, the attribute in one data model may be set as a foreign key in another data model, and when the data model is presented, the association relationship between the attribute in the another data model and the attribute in the above one data model is also presented by means of a target icon. As an alternative embodiment, the target icon includes, but is not limited to, an arrow. As shown in fig. 4, the foreign key "attribute 1" of the data model 1 is the attribute "attribute 1" in the data model 2, and therefore the association relationship of the foreign key "attribute 1" of the data model 1 and the attribute "attribute 1" in the data model 2 is represented by an arrow pointing from "attribute 1" in the data model 2 to "attribute 1" in the data model 1, that is, the foreign key "attribute 1" of the data model 1 corresponds to the attribute "attribute 1" in the data model 2.
Optionally, the creating the target data model in response to the creation operation received in the modeling operation interface includes: under the condition that an uploading operation is received from the modeling operation interface, extracting the content in the table uploaded through the uploading operation; creating the target data model in a case where a subject, an entity name, and a primary key of the target data model are included in the content.
In the above embodiment, when the number of the attributes of the data model to be built is large, the attributes of the data model can be input into the table and uploaded, and the contents in the table are extracted to realize the input of the attributes of the data model, so that the building process of the data model can be more convenient and faster.
Optionally, the method further comprises: receiving a deletion operation from the modeling operation interface, wherein the deletion operation is used for indicating to delete the second data model; determining whether a data table having an association relation with the second data model exists; deleting the second data model under the condition that no data table with the association relation with the second data model exists; and in the case that a data table which has an association relation with the second data model exists, forbidding to delete the second data model, and displaying prompt information, wherein the prompt information is used for indicating that the deletion of the second data model is forbidden.
In the above embodiment, when there is an associated data table in the data model, that is, when there is a data table created based on the data model, deletion of the data model is prohibited.
The data modeling method in the above embodiment is explained with reference to an example, but is not limited to the technical solution of the embodiment of the present invention.
FIG. 5 is a schematic diagram of a model management interface according to an embodiment of the invention. As shown in fig. 5, after "model management" is clicked, the data model background management page is entered, a tab is displayed in a first display area (for example, the left side) of the data model background management page, corresponding options on the tab are clicked (fig. 5 shows "new", "delete", and "modify" tabs), and the content of the tab is switched and updated. A second display area (e.g., the right side) of the data model background management page is a model preview area for previewing (i.e., presenting) the data model. After the content in the first display area is filled, the data model can be previewed in the second display area by clicking the preview key (at this time, the change of the storage model in the database does not really occur).
Clicking a 'delete' tab can delete the model, and a popup appears to prompt that deletion is completed; clicking: the 'modification' tab can modify the model, and a popup appears to prompt that the modification is finished; clicking a 'new' tab, displaying a modeling operation interface in the first display area, creating a model, and displaying a popup window to prompt that the creation is completed.
Optionally, an "export", "import", and "download template" button may also be included in the data model background management page, where: clicking on "export" can export the structure of the current base layer model (i.e., the structure of the currently built data model, including but not limited to the subject, entity name, and primary key of the data model, and other attributes); clicking 'import', and realizing the one-key import of the structure of the current base layer data model by uploading an excel table; click on the "download template" to provide the template for download.
In the above embodiment, when a data model (also referred to as an entity) is newly created, the following conditions must be satisfied: there may be no foreign key for the subject, entity name, primary key (there may be more than one primary key), and if there is a foreign key, each attribute of the foreign key must be filled in.
If one of the conditions is not met, new creation cannot be performed, preview is not allowed, and a prompt box pops up to prompt a user of the reason of the error (including but not limited to no theme selection, no entity name filling, lack of a main key, and the property of a foreign key not filling).
Alternatively, when the data model is modified, the following conditions must be satisfied: a theme must be selected; the entity name must be selected; the primary key must be left after modification. If one of the above conditions is not satisfied, the modification and the preview cannot be performed, and the user is prompted to perform the error reason (including but not limited to no theme selection, lack of entity name, lack of primary key).
Alternatively, when deleting the data model, the following condition must be satisfied: a theme must be selected; the entity name must be selected. And, when there is an affiliated data table under the data model, the data model cannot be deleted.
Optionally, a "confirm", "cancel", or "preview" button may also be included in the data model background management page, where: clicking on "confirm" indicates that: submitting a transaction operation; clicking "cancel" indicates that: canceling the transaction operation; clicking on "preview" indicates that: and previewing the model after clicking.
As an alternative embodiment, the target database includes, but is not limited to, MySQL database. Alternatively, the information of the entity name, the entity description, the entity number, and the like of the data model input in the input interface may be input into the entity table as a field in the entity table, respectively, so as to obtain the entity table (REP _ BASE _ BIZ _ TAB _ META) shown in table 1. In the embodiment of the present invention, "PK" indicates whether or not a field is a "primary key", and when the value of "PK" is "Y", this field is a primary key.
TABLE 1
Figure BDA0002819009370000101
Figure BDA0002819009370000111
Alternatively, information such as an attribute name of an attribute included in the entity may be entered into the entity attribute table, thereby forming an entity attribute table (REP _ BASE _ BIZ _ ATTR _ META) shown in table 2.
TABLE 2
Figure BDA0002819009370000112
Figure BDA0002819009370000121
Alternatively, information of the entity and the belonging category, etc. may be entered into the entity-based metadata association table, thereby forming an entity-based metadata association table (REP _ ENT _ SBJ _ RLTV) shown in table 3.
TABLE 3
Name of Chinese character English name of field Type of field PK
Entity numbering ENT_ID BIGINT(8)
Underlying metadata numbering BASE_META_ID BIGINT(3)
Alternatively, information such as a MODEL name and a MODEL description may be entered into the index MODEL table to form the index MODEL table (INDX _ MODEL _ DIM _ TAB) shown in table 4.
TABLE 4
Figure BDA0002819009370000122
Alternatively, information such as the dimensions of the data MODEL is entered into the index MODEL dimension table, thereby forming the index MODEL dimension table (INDX _ MODEL _ TAB) in table 5.
TABLE 5
Name of Chinese character English name of field Type of field PK
Index model numbering INDX_MODEL_ID NUMBER(8)
Index dimension name INDX_DIM_NM VARchar2(100)
Index dimension attribute INDX_DIM_ATTR VARchar2(20)
Length of index dimension INDX_DIM_LEN NUMBER(4)
Index dimension coding INDX_DIM_ID NUMBER(12) Y
It should be noted that, in the foregoing embodiment, the types of NUMBER, variance 2, binary, CHAR, and the like in the field types are all field types defined in the computer programming language, and the definition of the field types is not described in detail herein.
Through the above-mentioned embodiment, the following problems in the related art are solved: 1. only an abstract model is concerned, the physical entity table in the database cannot be linked with the established data model, so that the splitting between the data modeling process and the table building process, the model and the actual requirement are not consistent, and the model cannot actually guide the table building; 2. when the attributes of the model are more, the complete attribute list of the model is insisted on being displayed, so that a certain model possibly occupies a large length on a display interface, a page has to be scrolled back and forth up and down during browsing to clearly see the association in front of the model, and all the attributes of the model need to be displayed, so that characters are displayed in a zooming mode, the recognition degree of the model is reduced, and the display effect is poor; 3. when the association relation between the models is displayed, the association display can only be accurate to the coarse granularity of the models, but the actual association of the models, namely the association display at the attribute level, can not be performed.
In the above embodiments, a platform integrating modeling and model publishing is formed, so that the data model can be practically applied; the display mode of the model is optimized, and the recognition degree and the display effect of the model when the model is displayed are improved; the display mode of the incidence relation among the models is optimized, and the display of the incidence relation of the models at the attribute level is realized; the situation that the model is separated from the actual data table due to tampering when the model is applied to the data table is avoided; the display length is fixed, and only a part of fields (namely attributes) are displayed at a time, so that the association between the models can be clearly displayed; and good connection between online modeling and model release and application is realized.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to another embodiment of the present invention, a data modeling apparatus is provided, which is used for implementing the above embodiments and preferred embodiments, and the description of the apparatus is omitted for brevity. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 6 is a block diagram of a data modeling apparatus according to an embodiment of the present invention, the apparatus including:
the creating module 62 is configured to create a target data model in response to a creating operation received in a modeling operation interface, where the target data model has N attributes, and N is a natural number greater than 1;
a generating module 64, configured to generate a target data table in a target database in response to a first selection operation on M attributes in the target data model, where the first selection operation is used to instruct to generate the target data table according to the M data, the target data table includes M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number greater than or equal to 1, and M is less than or equal to N;
an establishing module 66, configured to establish an association relationship between the target data model and the target data table, where the association relationship is used to indicate that the target data table is generated based on the target data model.
According to the method and the device, a target data model is created in response to creation operation received in a modeling operation interface, wherein the target data model has N attributes, and N is a natural number greater than 1; generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N; establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model. Because the attributes in the established data model can be directly selected to generate the data table and the incidence relation between the data model and the data table is established, the problem that the incidence relation between the established data table and the data model cannot be determined in the related technology can be solved, and the incidence relation between the established data table and the data model can be determined.
Optionally, the creating module is further configured to: under the condition that the creation operation is received in the modeling operation interface, displaying an input interface in a first display area of the modeling operation interface; creating the target data model upon receiving an input operation on a subject, an entity name, and a primary key of the target data model from the input interface, wherein the N attributes include the primary key.
Optionally, the apparatus further includes a display module, configured to display, after the target data model is created in response to the creation operation received in the modeling operation interface, the target data model in a second display area of the modeling operation interface in response to the display operation received in the modeling operation interface, where an entity name of the target data model and a preset number of attributes of the target data model are displayed in the second display area, and the preset number is smaller than N.
Optionally, the creating module is further configured to: and under the condition that a second selection operation is received from the modeling operation interface, displaying a first data model in the second display area, and displaying a target icon between a first attribute in the target data model and a second attribute in the first data model, wherein the second selection operation is used for indicating that the second attribute is set as a foreign key of the target data model, and the target icon is used for indicating that the first attribute corresponds to the second attribute.
Optionally, the creating module is further configured to: under the condition that an uploading operation is received from the modeling operation interface, extracting the content in the table uploaded through the uploading operation; creating the target data model in a case where a subject, an entity name, and a primary key of the target data model are included in the content.
Optionally, the apparatus further comprises a processing module configured to: receiving a deletion operation from the modeling operation interface, wherein the deletion operation is used for indicating to delete the second data model; determining whether a data table having an association relation with the second data model exists; deleting the second data model under the condition that no data table with the association relation with the second data model exists; and in the case that a data table which has an association relation with the second data model exists, forbidding to delete the second data model, and displaying prompt information, wherein the prompt information is used for indicating that the deletion of the second data model is forbidden.
An embodiment of the present invention further provides a storage medium including a stored program, wherein the program executes any one of the methods described above.
Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
s1, responding to the creation operation received in the modeling operation interface, creating a target data model, wherein the target data model has N attributes, and N is a natural number greater than 1;
s2, generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N;
s3, establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
An embodiment of the present invention further provides an electronic device, and fig. 7 is a schematic structural diagram of an alternative electronic device according to an embodiment of the present invention. As shown in fig. 7, the electronic device comprises a memory 1002 and a processor 1004, the memory 1002 having stored therein a computer program, the processor 1004 being arranged to execute the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device 1006 and an input/output device 1008, wherein the transmission device 1006 is connected to the processor 1004, and the input/output device 1008 is connected to the processor 1004.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 7 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The memory 1002 may be used to store software programs and modules, such as program instructions/modules corresponding to the data modeling method and apparatus in the embodiments of the present invention, and the processor 1004 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002, that is, the method for detecting a touch anomaly is implemented. The memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1002 may further include memory located remotely from the processor 1004, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. As an example, as shown in fig. 7, the creating module 62, the generating module 64 and the establishing module 66 in the data modeling apparatus may be, but are not limited to being, included in the memory 1002.
Optionally, the above-mentioned transmission device 1006 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1006 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices so as to communicate with the internet or a local area Network. In one example, the transmission device 1006 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a connection bus 1010 for connecting the respective module components in the electronic apparatus.
In other embodiments, the terminal or the server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication form. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, responding to the creation operation received in the modeling operation interface, creating a target data model, wherein the target data model has N attributes, and N is a natural number greater than 1;
s2, generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N;
s3, establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for modeling data, comprising:
creating a target data model in response to a creation operation received in a modeling operation interface, wherein the target data model has N attributes, and N is a natural number greater than 1;
generating a target data table in a target database in response to a first selection operation on M attributes in the target data model, wherein the first selection operation is used for indicating that the target data table is generated according to the M data, the target data table comprises M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number which is greater than or equal to 1, and M is smaller than or equal to N;
establishing an association relationship between the target data model and the target data table, wherein the association relationship is used for indicating that the target data table is generated based on the target data model.
2. The method of claim 1, wherein creating a target data model in response to a create operation received at a modeling operation interface comprises:
under the condition that the creation operation is received in the modeling operation interface, displaying an input interface in a first display area of the modeling operation interface;
creating the target data model upon receiving an input operation on a subject, an entity name, and a primary key of the target data model from the input interface, wherein the N attributes include the primary key.
3. The method of claim 2, wherein after the creating a target data model in response to the create operation received at the modeling operation interface, the method further comprises:
and displaying the target data model in a second display area of the modeling operation interface in response to the display operation received in the modeling operation interface, wherein the second display area displays the entity name of the target data model and the preset number of attributes of the target data model, and the preset number is smaller than N.
4. The method of claim 3, wherein creating a target data model in response to a create operation received at a modeling operation interface further comprises:
and under the condition that a second selection operation is received from the modeling operation interface, displaying a first data model in the second display area, and displaying a target icon between a first attribute in the target data model and a second attribute in the first data model, wherein the second selection operation is used for indicating that the second attribute is set as a foreign key of the target data model, and the target icon is used for indicating that the first attribute corresponds to the second attribute.
5. The method of claim 1, wherein creating a target data model in response to a create operation received at a modeling operation interface comprises:
under the condition that an uploading operation is received from the modeling operation interface, extracting the content in the table uploaded through the uploading operation;
creating the target data model in a case where a subject, an entity name, and a primary key of the target data model are included in the content.
6. The method of claim 1, further comprising:
receiving a deletion operation from the modeling operation interface, wherein the deletion operation is used for indicating to delete the second data model;
determining whether a data table having an association relation with the second data model exists;
deleting the second data model under the condition that no data table with the association relation with the second data model exists;
and in the case that a data table which has an association relation with the second data model exists, forbidding to delete the second data model, and displaying prompt information, wherein the prompt information is used for indicating that the deletion of the second data model is forbidden.
7. A data modeling apparatus, comprising:
the system comprises a creating module, a modeling operation interface and a data processing module, wherein the creating module is used for responding to creating operation received by the modeling operation interface and creating a target data model, the target data model has N attributes, and N is a natural number greater than 1;
a generating module, configured to generate a target data table in a target database in response to a first selection operation on M attributes in the target data model, where the first selection operation is used to instruct to generate the target data table according to the M data, the target data table includes M fields, the M fields are in one-to-one correspondence with the M attributes, M is a natural number greater than or equal to 1, and M is less than or equal to N;
the establishing module is used for establishing an incidence relation between the target data model and the target data table, wherein the incidence relation is used for indicating that the target data table is generated based on the target data model.
8. The apparatus of claim 7, wherein the creation module is further configured to:
under the condition that the creation operation is received in the modeling operation interface, displaying an input interface in a first display area of the modeling operation interface;
creating the target data model upon receiving an input operation on a subject, an entity name, and a primary key of the target data model from the input interface, wherein the N attributes include the primary key.
9. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 6 by means of the computer program.
CN202011407566.8A 2020-12-04 2020-12-04 Data modeling method and device, storage medium and electronic device Pending CN112597125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011407566.8A CN112597125A (en) 2020-12-04 2020-12-04 Data modeling method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011407566.8A CN112597125A (en) 2020-12-04 2020-12-04 Data modeling method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN112597125A true CN112597125A (en) 2021-04-02

Family

ID=75188303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011407566.8A Pending CN112597125A (en) 2020-12-04 2020-12-04 Data modeling method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112597125A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164514A (en) * 2013-02-25 2013-06-19 用友软件股份有限公司 Detection device and detection method for data reference relationship
CN106775729A (en) * 2016-12-21 2017-05-31 浪潮通信信息系统有限公司 A kind of mobile client business rendering method and system based on data description
CN109213754A (en) * 2018-03-29 2019-01-15 北京九章云极科技有限公司 A kind of data processing system and data processing method
CN110955662A (en) * 2019-11-29 2020-04-03 车智互联(北京)科技有限公司 Method, computing device and storage medium for maintaining data table association relation
CN111400393A (en) * 2020-06-04 2020-07-10 腾讯科技(深圳)有限公司 Data processing method and device based on multi-application platform and storage medium
CN111427971A (en) * 2020-03-25 2020-07-17 中国工商银行股份有限公司 Business modeling method, device, system and medium for computer system
CN112000643A (en) * 2020-08-07 2020-11-27 杭州数梦工场科技有限公司 Method and device for processing data model
CN112015714A (en) * 2019-05-30 2020-12-01 北京奇虎科技有限公司 Database-based data model generation method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164514A (en) * 2013-02-25 2013-06-19 用友软件股份有限公司 Detection device and detection method for data reference relationship
CN106775729A (en) * 2016-12-21 2017-05-31 浪潮通信信息系统有限公司 A kind of mobile client business rendering method and system based on data description
CN109213754A (en) * 2018-03-29 2019-01-15 北京九章云极科技有限公司 A kind of data processing system and data processing method
CN112015714A (en) * 2019-05-30 2020-12-01 北京奇虎科技有限公司 Database-based data model generation method and device
CN110955662A (en) * 2019-11-29 2020-04-03 车智互联(北京)科技有限公司 Method, computing device and storage medium for maintaining data table association relation
CN111427971A (en) * 2020-03-25 2020-07-17 中国工商银行股份有限公司 Business modeling method, device, system and medium for computer system
CN111400393A (en) * 2020-06-04 2020-07-10 腾讯科技(深圳)有限公司 Data processing method and device based on multi-application platform and storage medium
CN112000643A (en) * 2020-08-07 2020-11-27 杭州数梦工场科技有限公司 Method and device for processing data model

Similar Documents

Publication Publication Date Title
AU761923B2 (en) Database system
CN109408764B (en) Page area dividing method, device, computing equipment and medium
CN116225399A (en) Spreadsheet-based software application development
CN102364894B (en) Issuing method for configuration data file and network management equipment
US6718386B1 (en) Methods, system, and article for displaying privilege state data
CN103731483A (en) Virtual file system based on cloud computing
CN105528218B (en) Data drawing list Cascading Methods and data drawing list cascade system
EP3646133B1 (en) Systems and methods of creation and deletion of tenants within a database
CN108399072A (en) Five application page update method and device
WO2007082005A2 (en) Transferring and displaying hierarchical data between databases and electronic documents
CN110990403A (en) Business data storage method, system, computer equipment and storage medium
CN111241791A (en) Editing method and device of webpage text, computer equipment and storage medium
CN109634570A (en) Front and back end integrated development method, device, equipment and computer readable storage medium
AU2017265144A1 (en) Information retrieval
US7797621B1 (en) Method and system for altering data during navigation between data cells
CN111737227A (en) Data modification method and system
US20140101533A1 (en) Lossless application of new information architecture to existing websites, web pages, and online content
CN113553458A (en) Data export method and device in graph database
CN110007842A (en) Web page contents choosing method and device
US20210124752A1 (en) System for Data Collection, Aggregation, Storage, Verification and Analytics with User Interface
CN112861059A (en) Visual component generation method and device, computer equipment and readable storage medium
US8589426B1 (en) Simultaneous file editor
CN112597125A (en) Data modeling method and device, storage medium and electronic device
CN112988879A (en) Method, system, device, storage medium and processor for accessing database
CN111061478A (en) Page form modification method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination