CN110109893A - The method and apparatus of data modeling and operation - Google Patents

The method and apparatus of data modeling and operation Download PDF

Info

Publication number
CN110109893A
CN110109893A CN201810105614.4A CN201810105614A CN110109893A CN 110109893 A CN110109893 A CN 110109893A CN 201810105614 A CN201810105614 A CN 201810105614A CN 110109893 A CN110109893 A CN 110109893A
Authority
CN
China
Prior art keywords
concrete database
database
concrete
query language
data type
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
CN201810105614.4A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810105614.4A priority Critical patent/CN110109893A/en
Publication of CN110109893A publication Critical patent/CN110109893A/en
Pending legal-status Critical Current

Links

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/24Querying
    • G06F16/242Query formulation
    • G06F16/243Natural language query formulation
    • 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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention provides the method and apparatus of a kind of data modeling and operation, it is capable of providing unified data modeling process, so that data modeling flexibly configurable, it is easy to modify and safeguard, and provide unified database structure query language, achieve the purpose that data modeling and operation cross-platform, simplifies development process.This method comprises: storing template and uniform data type creation table using table;The table is mapped in concrete database;And the concrete database is operated using unified structure query language.

Description

The method and apparatus of data modeling and operation
Technical field
The present invention relates to field of computer technology more particularly to the method and apparatus of a kind of data modeling and operation.
Background technique
During report exploitation, establishing table structure on various databases according to business demand is a universal behaviour Make, user can define the storage organization of data by various data manipulation sentences.In addition, in the formal upper line process of product In, also need to increase security mechanism while establishing table structure, user's builds table statement by that could be used for just ring upon ring Database table structure necessary to creation project in the database of formula environment.Current most of relevant databases build surface low journey substantially such as This.In addition, in other databases, such as (ElasticSearch is one by non-relational database or Elasticsearch Search server based on Lucene.It provides the full-text search engine of a distributed multi-user ability, is based on RESTful Web interface.ES is the abbreviation of ElasticSearch.In the embodiment of the present invention, it can be used as a database, but not be to close It is the database of type, for storage and operation data), their data modeling process is also required to carry out Shen in corresponding system It please process.
The data modeling and operation scheme of the prior art will be executed approximately as: relevant database data modeling needs The SQL statement that operates with write out, be then placed in relevant database data manipulation application system, wait responsible person Ring upon ring;The application process of Elasticsearch modeling needs the Shen in the system except relevant database application system Please;In addition, in the data manipulation stage, structured query language after needing to extend using concrete database to concrete database into Row additions and deletions, which change, looks into operation.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
The data modeling process disunity of various specific databases;In addition, different database structure query languages It is strongly dependent upon respective normalizing database.This makes the development cost of data modeling and operation and maintenance cost relatively high.
Summary of the invention
In view of this, the embodiment of the present invention provides the method and apparatus of a kind of data modeling and operation, it is capable of providing unification Data modeling process be easy to modify and safeguard, and provide unified database structure so that data modeling flexibly configurable Change query language, achievees the purpose that data modeling and operation cross-platform, simplify development process.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of data modeling and operation are provided Method.
A kind of data modeling of the embodiment of the present invention and the method for operation include: to utilize table storage template and uniform data class Type creates table;The table is mapped in concrete database;And the specific number is operated using unified structure query language According to library.
Optionally, before using table storage template and uniform data type creation table, the method also includes: it is fixed in advance Adopted table storage template and uniform data type, wherein it includes table name information and field information that table, which stores template,.
Optionally, the table is mapped in concrete database includes: according in uniform data type and concrete database The corresponding relationship of data type, table is mapped in concrete database.
Optionally, operating the concrete database using unified structure query language includes: that will utilize unified structure The unified query sentence that query language is write is mapped as concrete database query statement;Utilize the concrete database query statement Operate the concrete database.
Optionally, before operating the concrete database using the concrete database query statement, the method is also It include: to be verified to the concrete database query statement.
Optionally, carrying out verification to the concrete database query statement includes: the query language for obtaining concrete database Morpheme;The mode of the query language morpheme is described using regular expression, generates finite-state automata;Using described limited State automata verifies the query language morpheme whether the concrete database query statement meets the concrete database, if symbol It closes, then executes the step of operating the concrete database using the concrete database query statement.
To achieve the above object, according to another aspect of an embodiment of the present invention, a kind of data modeling and operation are provided Device.
A kind of data modeling of the embodiment of the present invention and the device of operation include: creation module, for storing mould using table Plate and uniform data type create table;Mapping block, for the table to be mapped in concrete database;And operation module, For operating the concrete database using unified structure query language.
Optionally, described device further include: definition module, for being created using table storage template and uniform data type Before table, table storage template and uniform data type are pre-defined, wherein table storage template includes table name information and field letter Breath.
Optionally, the mapping block is also used to: according to pair of data type in uniform data type and concrete database It should be related to, table is mapped in concrete database.
Optionally, the operation module is also used to: the unified query sentence that will be write using unified structure query language It is mapped as concrete database query statement;The concrete database is operated using the concrete database query statement.
Optionally, the operation module is also used to: operating the specific number using the concrete database query statement Before library, the concrete database query statement is verified.
Optionally, the operation module is also used to: obtaining the query language morpheme of concrete database;Utilize regular expression The mode of the query language morpheme is described, finite-state automata is generated;Using described in finite-state automata verification The query language morpheme whether concrete database query statement meets the concrete database executes described in utilization if meeting Concrete database query statement operates the step of concrete database.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention includes: one or more processors;Storage device, for storing one Or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more of The method that processor realizes the data modeling and operation of the embodiment of the present invention.
To achieve the above object, another aspect according to an embodiment of the present invention, provides a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed The method of the data modeling and operation of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because uses the table of various databases Logical definition abstract, unified data modeling process is provided, so that data modeling flexibly configurable, is easy to modify and tie up Shield;And by providing unified database structure query language, data modeling and operation is made to achieve the purpose that cross-platform, letter Change the technical effect of development process;It, can also be in the way of visualization interface with the side of configurableization in the embodiment of the present invention Modeling logic is encapsulated by formula, increases approval process by way of workflow, and combine unified structure query language Unified operation, build table, examination & approval, language so as to quickly handle the various databases including Elasticsearch Sentence operation logic makes the rule of data modeling and operation independent of any concrete database, has cross-platform characteristic, saves Time cost facilitates the unification and standardization of report data modeling;In the embodiment of the present invention, by presetting table storage Template and uniform data type, so as to standardize, the definition table of procedure;Pass through uniform data type, and unified number According to the mapping between type and concrete database field type, so as to after table is established and completed, directly efficiently by table It is mapped in concrete database;By using unified structure query language, and based on unified structure query language and specifically Between data base query language mapping configuration, so as to operate concrete database in table when independent of respective Normalizing database, reduce operating cost.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the main flow of the method for data modeling according to an embodiment of the present invention and operation;
Fig. 2 is the structural representation for the table storage template that the method for data modeling according to an embodiment of the present invention and operation defines Figure;
Fig. 3 is the flow chart of the method progress data manipulation of data modeling according to an embodiment of the present invention and operation;
Fig. 4 is the schematic diagram of the main modular of the device of data modeling according to an embodiment of the present invention and operation;
Fig. 5 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 6 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
The embodiment of the present invention provides the method and apparatus of a kind of data modeling and operation, is capable of providing unified data modeling Process and unified database structure query language, so that data modeling flexibly configurable, is easy to modify and safeguard, and Achieve the purpose that data modeling and operation cross-platform, simplifies development process.
Fig. 1 is the schematic diagram of the main flow of the method for data modeling according to an embodiment of the present invention and operation, such as Fig. 1 institute Show, the method for a kind of data modeling and operation of the embodiment of the present invention mainly includes the following steps:
Step S101: table is created using table storage template and uniform data type.Utilizing table storage template and unified number Before creating table according to type, this method can also include: pre-defined table storage template and uniform data type, wherein table is deposited Storing up template includes table name information and field information.
Step S102: table is mapped in concrete database.It specifically can be, according to uniform data type and specific need The corresponding relationship for building data type in the database (hereinafter referred to as " concrete database ") of table, is mapped to concrete database for table In.
Step S103: concrete database is operated using unified structure query language.Language will be inquired using unified structureization Say that the unified query sentence write is mapped as concrete database query statement;Institute is operated using the concrete database query statement State concrete database.
Wherein, before operating the concrete database using the concrete database query statement, the embodiment of the present invention In, it can also include: to be verified to concrete database query statement.The detailed process of verification, which may is that, obtains specific data The query language morpheme in library;The mode of the query language morpheme is described using regular expression, generates finite-state automata; The inquiry whether the concrete database query statement meets the concrete database is verified using the finite-state automata Language morpheme executes the step of operating the concrete database using the concrete database query statement if meeting.
In order to realize the embodiment of the present invention data modeling and operation method, in the embodiment of the present invention, one can be developed Sets of data modeling and operating system, external issuing function interface, using visualization interface as the operation list of data modeling and examination & approval The production of modeling, examination & approval, operation is divided into three functional modules by member: creation table, publication examination & approval (and opened in publication examination & approval link Dynamic workflow), unified structureization inquiry.Using the functional module built in these three as basic unit, is driven and modeled with practical business With the realization of examination & approval, the exploitation that database builds table is completed.
Data modeling and operation overall logic are as follows:
Create table module
In the embodiment of the present invention, table, which is the basis of data modeling, to be abstracted to data store organisation.Substantially, this hair Table in bright embodiment is a kind of towards the definition of level of abstraction relation of plane type table, and considers the implementation rule in each active data library (save and the specification of operation table), by unified structure enquiry module provide from well-regulated table.It, can in the embodiment of the present invention To be referred to as " logical table ".The rule of logical table encapsulates disparate databases rule independent of any specific database Difference and limitation then.The quantity of one logical table physical tables several for correspondence, physical table is depended on to logic in logical table The setting of the quantity of field.For example, setting logical table divides the field number upper limit of table to be 50, when the field quantity of logical table is more than At 50, table is torn open automatically when generating physical table, the entitled logical table name of each physical table adds " _ N " suffix, " N " For the number of physical table.The physical table that same logical table splits out is associated with by GUID.
In the embodiment of the present invention, the table of creation is inquired using unified structure query statement.Because of logical table Specific storage logic will be realized in different databases, so unified structure query statement will be mapped to different databases The realization of middle realization, the operations such as specific inquiry will be described in detail in unified structure query portion.
Creating logical table, specific step is as follows:
1, the table storage template of logical table is defined
Table storage template describes the attribute information of logical table.Table storage template can be made of two parts: table name information And field information.Table name message store table title, table mark, creation time, modification time, the information such as founder;Field letter Breath storage field title, field identification, the information such as field type, structure is referring to fig. 2.
Wherein, field can be divided into designing two portions again: custom field and system field.Custom field is service fields Information is created by developer according to specific business need;System field builds the table stage by system automatically generated, these words Section can be the built-in field implicitly defined by system, builds the table stage and forces to generate.Specifically include that deletion mark (mark Whether current record is deleted), creation time (mark current record creation time), renewal time, (mark current record updated Time), founder's (mark current record founder), more new person (mark current record more new person), the field informations such as timestamp. The meaning of system field is to have standardized the format of data modeling, makes developer that can be absorbed in service fields in the modelling phase Design.
2, the uniform data type of definition modeling
The different location of data storage in data type constraints database provides on every suit database different The realization of data type.In the embodiment of the present invention, it by establishing uniform data type, may map to uniform data type not With the data type of data storage software.For example, defining uniform data type: long, this data type represent long shaping Data, it may map to the bigint type in MySQL database, also may map in oracle database Number (20) type, also may map to the long type in ES.When needing to inquire data information, uniform data type meeting According to different Database Mapping to corresponding data type.The advantages of uniform data type, is, has been abstracted different numbers According to the form of expression of data type in library, so that developer is not needed the type of concern with concrete database, has accomplished once to write, The cross-platform operating scheme run everywhere.In the embodiment of the present invention, uniform data type Control table can be using following corresponding pass System:
Uniform data type MySQL database Oracle database ES storage Data modeling data type meaning
int int number(10) integer Store integer type data
short smallint number(5) short Store short integer type data
long bigint number(20) long Store lint-long integer type data
number(s,e) Decimal(s,e) number(s,e) double Store the data of numeric type
float float real float Store the data of floating type
string varchar varchar string Store the data of character string
date datatime date date The data of storage time type
3, data modeling interface is created
The visual modeling window of building, Modeling interface can be made of three parts: navigation bar (including newly-increased logical table is pressed Button modifies logic table button, deletes logic table button, and new field button modifies field button, deletes field button, pre- to send out Cloth button, formally issues button), Field Inquiry part, field description part.
In the embodiment of the present invention, constructing visual modeling window can use Java exploitation visualization interface.Visualization Modeling window, which can be convenient, establishes logical table.Citing is introduced: being clicked newly-increased logic table button, is popped up a window, need wherein Table title is inputted, table mark, creation time, modification time, the information such as founder, then click saves, these information are just protected It is stored in database.
In Modeling interface, navigation bar push button function can be set as follows:
Newly-increased logic table button: clicking this button, and input logic table stores specifying information (including table title, the table of template Mark, creation time, modification time, the information such as founder), it is saved in database.
It is as follows that table stores the design of template table name information:
Table name information Data type Field description
ID Bigint Template table defines major key
Name Varchar Template table definition mark
Title Varchar Template table defines title
createTime Date Template table defines creation time
UpdateTime Date Template table defines modification time
Createtor Varchar Template table definition modification people
Modification logic table button: clicking this button, updates Template Information, is saved in database.
It deletes logic table button: clicking this button, delete the logical table chosen.
New field button: clicking this button, and input table stores Template Information, is saved in database.
The design of field information field is as follows:
Field name Field type Field description
ID Bigint Field definition major key
Name Varchar Field definition title
Title Varchar Field definition title
FromTable Varchar The affiliated table of field
FieldType Varchar The type of field
Default Varchar The default value of field
Modification field button: clicking this button, and update changes present field Template Information, is saved in database.
It deletes field button: clicking this button, delete present field Template Information, be saved in database.
Pre- publication button: after establishing logical table and increasing N number of field newly, pre- publication button is clicked, concrete database is inputted IP, database-name and type of database, so that it may logical table is mapped in specific database.This function is for exploit person Member calls in the process of development.
Formal publication button clicks this button after completing the exploitation and debugging of program, starts workflow, passes through responsibility Personnel pass on to different levels for approval (it is i.e. aforementioned " and publication examination & approval (and publication examination & approval link start workflow.Logical table is published to really On line in database.
Issue approval module
Publication examination & approval function in the embodiment of the present invention can be set according to formal publication environmental demand, data modeling it After need just can formally build library ring upon ring.Under normal conditions, approval object is logical table, and examination & approval main body is to confirm in advance Person liable, it is necessary to obtain them and agree to that program could be online.Examination & approval rule can be set are as follows: each approving person has agreement Next approver is jumped to if agreed to two permissions of rejection, the last one approver agrees to, then completes, if not Agree to, just returns to apply after modifying again.
Unified structure enquiry module
After creating logical table and mapping that concrete database, a kind of structured query language can be created, it is right Types of databases including various relevant databases and Elasticsearch etc. carries out unified query, this uniformly to look into Unified structure query language can be named as by asking language.In the embodiment of the present invention, unified structure query language can be based on SQL92 standard criterion, a kind of grammer of logic-oriented table of exploitation, its target are by various data popular currently on the market Different transparence existing for library provides the data storage and access mode of a kind of independent database to developer, reaches across flat The purpose of platform.In the embodiment of the present invention, SQL refers exclusively to a kind of data base querying and programming language, for access data and Query, update, and manage relational database system.
Fig. 3 is the flow chart of the method progress data manipulation of data modeling according to an embodiment of the present invention and operation.Such as Fig. 3 It is shown, in the embodiment of the present invention, is realized using mapping techniques and eliminate rule difference present in various databases, use limited shape Whether the concrete database query statement after the verification mapping of state automatic machine meets the SQL specification of current concrete database, specifically sets It counts as follows:
1, unified structure query language is mapped to using the technology of mapping by concrete database, generates concrete database and looks into Ask sentence.Unified structure query language example: select substr (' abcd', 2,2) value from dual, it will unify Each lexical unit in structured query language grammer, such as select, substr, from, where, according to semanteme and not Same concrete database establishes different corresponding relationships respectively.Such as substr and MySQL in unified structure query language The substring of lane database establishes mapping.The purpose of mapping is exactly that unified structure query language statement is translated into specifically The identifiable concrete database query statement of database is called for concrete database.
2, the mode that the query language morpheme of concrete database is described using regular expression, is then converted morpheme mode At finite-state automata, whether the concrete database query statement that automatic identification mapping is completed meets specific data query language Morpheme describe, if met, specific database execute concrete database query statement, do not meet, then prompt unification Structured query language sentence is problematic.
In the embodiment of the present invention, the SQL query language morpheme of concrete database is a character sequence in character string combinations Column, regular expression are a kind of methods that can very easily describe morpheme mode.Such as SQL character string: select sku from XX;Morpheme is: select, sku, from, XX.Regular expression is: select*from*.Here * represents any character String, as long as meaning that character string meets this mode of select*from* it may determine that it is correctly such as select Bus from X and select m from Y, No. * here can be replaced by arbitrary string, but select, from cannot It is changed.
Finite-state automata is the set of one group of state, and one character of every reading, active state will be changed.State machine Current state be a final state when, mean that and have identified a pattern string.By taking select as an example, s character is read in, under One character must be e, otherwise report an error, and if it is e, then read in character late, it is necessary to it is l, otherwise reports an error, only *, It can be any character.
In ES, Elasticsearch-sql is the tool for giving the offer SQL query service of ES.It can be used Unified structure query language is converted into the structure language of ES support by Elasticsearch-sql, and it is very convenient that family can be used The data that ES is inquired with the mode of SQL, it is not necessary to suffer from the query expression of ES complexity, while providing the function for surmounting SQL Energy.
Data modeling according to an embodiment of the present invention and the technical solution of operation can be seen that because using various data The logical definition of the table in library abstracts, and provides unified data modeling process, so that data modeling flexibly configurable, is easy to repair Change and safeguards;And by providing unified database structure query language, data modeling and operation is made to reach cross-platform Purpose simplifies the technical effect of development process;It, can also be in the way of visualization interface with configurable in the embodiment of the present invention Modeling logic is encapsulated by the mode of change, increases approval process by way of workflow, and look into conjunction with unified structure Ask language unified operation, so as to quickly handle the various databases including Elasticsearch build table, examine It criticizes, sentence operation logic, makes the rule of data modeling and operation independent of any concrete database, there is cross-platform spy Property, time cost has been saved, the unification and standardization of report data modeling are facilitated;In the embodiment of the present invention, by setting in advance Table storage template and uniform data type is determined, so as to standardize, the definition table of procedure;By uniform data type, with And the mapping between uniform data type and concrete database field type, it is directly high so as to after table is established and completed Table is mapped in concrete database by effect;Language is inquired by using unified structure query language, and based on unified structureization The mapping configuration made peace between concrete database query language, so as to be disobeyed when operating the table in concrete database The respective normalizing database of Lai Yu reduces operating cost.
Fig. 4 is the schematic diagram of the main modular of the device of data modeling according to an embodiment of the present invention and operation.
As shown in figure 4, the data modeling of the embodiment of the present invention and the device 400 of operation mainly include following module: creation Module 401, mapping block 402 and operation module 403.
Wherein, creation module 401 can be used for utilizing table storage template and uniform data type creation table;Mapping block 402 It can be used for for the table being mapped in concrete database;And operation module 403 can be used for utilizing unified structure query language Operate the concrete database.
In the embodiment of the present invention, device 400 may also include that definition module (not shown), can be used for depositing using table Before storing up template and uniform data type creation table, table storage template and uniform data type are pre-defined, wherein table stores mould Plate includes table name information and field information.
Mapping block 402 can also be used in: according to the corresponding relationship of data type in uniform data type and concrete database, Table is mapped in concrete database.
Operation module 403 can also be used in: the unified query sentence write using unified structure query language is mapped as Concrete database query statement;The concrete database is operated using the concrete database query statement.In addition, utilizing institute Before stating the concrete database query statement operation concrete database, also concrete database query statement is verified.
Specific checking procedure is as follows: obtaining the query language morpheme of concrete database;Described in being described using regular expression The mode of query language morpheme generates finite-state automata;The specific data are verified using the finite-state automata Whether library inquiry sentence meets the query language morpheme of the concrete database, if meeting, executes and utilizes the specific data Library inquiry sentence operates the step of concrete database.
From the above, it can be seen that because providing system using the logical definition of the table of various databases is abstracted One data modeling process, so that data modeling flexibly configurable, is easy to modify and safeguard;And by providing unified data Library structure query language achievees the purpose that data modeling and operation cross-platform, simplifies the technical effect of development process;This hair In bright embodiment, modeling logic can also be encapsulated in the way of configurableization in the way of visualization interface, be passed through The mode of workflow increases approval process, and combines the unified operation of unified structure query language, so as to quick Handle the various databases including Elasticsearch builds table, examination & approval, sentence operation logic, makes data modeling and behaviour Make the rule independent of any concrete database, there is cross-platform characteristic, saved time cost, facilitated report data The unification and standardization of modeling;In the embodiment of the present invention, template and uniform data type are stored by presetting table, so as to With standardization, the definition table of procedure;Pass through uniform data type and uniform data type and concrete database field type Between mapping, so as to table establish complete after, directly efficiently table is mapped in concrete database;By using Unified structure query language, and matched based on the mapping between unified structure query language and concrete database query language It sets, so as to, independent of respective normalizing database, reduce operating cost when operating the table in concrete database.
Fig. 5 is shown can be using the data modeling and operating method or data modeling and operating device of the embodiment of the present invention Exemplary system architecture 500.
As shown in figure 5, system architecture 500 may include terminal device 501,502,503, network 504 and server 505. Network 504 between terminal device 501,502,503 and server 505 to provide the medium of communication link.Network 504 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 501,502,503 and be interacted by network 504 with server 505, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 501,502,503 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 501,502,503 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 505 can be to provide the server of various services, such as utilize terminal device 501,502,503 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to reception To the data such as information query request analyze etc. processing, and by processing result (such as target push information, product letter Breath -- merely illustrative) feed back to terminal device.
It should be noted that data modeling and operating method provided by the embodiment of the present invention are generally held by server 505 Row, correspondingly, data modeling and operating device are generally positioned in server 505.
It should be understood that the number of terminal device, network and server in Fig. 5 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 6, it illustrates the computer systems 600 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 6 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and Execute various movements appropriate and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data. CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always Line 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.; And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon Computer program be mounted into storage section 608 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 609, and/or from can Medium 611 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 601, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include creation module, mapping block and operation module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, creation module is also described as " for utilizing table storage template and uniform data type creation table Module ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: that table is utilized to store template and uniform data type creation table;The table is mapped in concrete database;With And the concrete database is operated using unified structure query language.
Technical solution according to an embodiment of the present invention, because being taken out using by the logical definition of the table of various databases Come, unified data modeling process is provided, so that data modeling flexibly configurable, is easy to modify and safeguard;And pass through offer Unified database structure query language achievees the purpose that data modeling and operation cross-platform, simplifies the skill of development process Art effect;In the embodiment of the present invention, modeling logic can also be sealed in the way of configurableization in the way of visualization interface It loads, increases approval process by way of workflow, and combine the unified operation of unified structure query language, thus The various databases including Elasticsearch can quickly be handled builds table, examination & approval, sentence operation logic, makes to count According to modeling and the rule independent of any concrete database is operated, there is cross-platform characteristic, saved time cost, helped In the unification and standardization of report data modeling;In the embodiment of the present invention, template and uniform data are stored by presetting table Type, so as to standardize, the definition table of procedure;Pass through uniform data type and uniform data type and specific number According to the mapping between the field type of library, so as to which table is efficiently directly mapped to specific data after table establishes completion In library;By using unified structure query language, and it is based on unified structure query language and concrete database query language Between mapping configuration, so as to when operating the table in concrete database independent of respective normalizing database, Reduce operating cost.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (14)

1. a kind of method of data modeling and operation characterized by comprising
Template is stored using table and uniform data type creates table;
The table is mapped in concrete database;And
The concrete database is operated using unified structure query language.
2. the method according to claim 1, wherein creating table using table storage template and uniform data type Before, the method also includes pre-defined table storage template and uniform data types, wherein it includes table name that table, which stores template, Claim information and field information.
3. the method according to claim 1, wherein it includes: basis in concrete database that the table, which is mapped to, The corresponding relationship of data type, table is mapped in concrete database in uniform data type and concrete database.
4. the method according to claim 1, wherein operating the specific number using unified structure query language Include: according to library
The unified query sentence write using unified structure query language is mapped as concrete database query statement;
The concrete database is operated using the concrete database query statement.
5. according to the method described in claim 4, it is characterized in that, using described in concrete database query statement operation Before concrete database, the method also includes: the concrete database query statement is verified.
6. according to the method described in claim 5, it is characterized in that, carrying out verification packet to the concrete database query statement It includes:
Obtain the query language morpheme of concrete database;
The mode of the query language morpheme is described using regular expression, generates finite-state automata;
Verify whether the concrete database query statement meets the concrete database using the finite-state automata Query language morpheme executes the step of operating the concrete database using the concrete database query statement if meeting.
7. the device of a kind of data modeling and operation characterized by comprising
Creation module, for creating table using table storage template and uniform data type;
Mapping block, for the table to be mapped in concrete database;And
Operation module, for operating the concrete database using unified structure query language.
8. device according to claim 7, which is characterized in that described device further include: definition module, for utilizing table Before storing template and uniform data type creation table, table storage template and uniform data type are pre-defined, wherein table storage Template includes table name information and field information.
9. device according to claim 7, which is characterized in that the mapping block is also used to: according to uniform data type With the corresponding relationship of data type in concrete database, table is mapped in concrete database.
10. device according to claim 7, which is characterized in that the operation module is also used to:
The unified query sentence write using unified structure query language is mapped as concrete database query statement;
The concrete database is operated using the concrete database query statement.
11. device according to claim 10, which is characterized in that the operation module is also used to: described specific utilizing Before query sentence of database operates the concrete database, the concrete database query statement is verified.
12. device according to claim 11, which is characterized in that the operation module is also used to:
Obtain the query language morpheme of concrete database;
The mode of the query language morpheme is described using regular expression, generates finite-state automata;
Verify whether the concrete database query statement meets the concrete database using the finite-state automata Query language morpheme executes the step of operating the concrete database using the concrete database query statement if meeting.
13. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 6 is realized when row.
CN201810105614.4A 2018-02-02 2018-02-02 The method and apparatus of data modeling and operation Pending CN110109893A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810105614.4A CN110109893A (en) 2018-02-02 2018-02-02 The method and apparatus of data modeling and operation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810105614.4A CN110109893A (en) 2018-02-02 2018-02-02 The method and apparatus of data modeling and operation

Publications (1)

Publication Number Publication Date
CN110109893A true CN110109893A (en) 2019-08-09

Family

ID=67483279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810105614.4A Pending CN110109893A (en) 2018-02-02 2018-02-02 The method and apparatus of data modeling and operation

Country Status (1)

Country Link
CN (1) CN110109893A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990396A (en) * 2019-10-12 2020-04-10 贝壳技术有限公司 Data storage method, device and storage medium
CN111767299A (en) * 2019-12-18 2020-10-13 北京沃东天骏信息技术有限公司 Database operation method, device and system, storage medium and electronic equipment
CN111767266A (en) * 2020-05-15 2020-10-13 杭州传化智能制造科技有限公司 Entity contact model design method and device, computer equipment and storage medium
CN112328672A (en) * 2020-11-04 2021-02-05 成都中科大旗软件股份有限公司 Method, system, storage medium and terminal for mapping API (application program interface) interface by data service

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193947A (en) * 2010-03-18 2011-09-21 华为技术有限公司 Data access processing method and system
CN105260403A (en) * 2015-09-22 2016-01-20 广东同望科技股份有限公司 Universal cross-database access method
CN105426481A (en) * 2015-11-19 2016-03-23 北京京东尚科信息技术有限公司 Data processing method and device
CN106933837A (en) * 2015-12-29 2017-07-07 航天信息股份有限公司 A kind of database table model and creation method
US20180004782A1 (en) * 2014-07-31 2018-01-04 Quickbase, Inc. Dynamic modeling of data in relational databases

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193947A (en) * 2010-03-18 2011-09-21 华为技术有限公司 Data access processing method and system
US20180004782A1 (en) * 2014-07-31 2018-01-04 Quickbase, Inc. Dynamic modeling of data in relational databases
CN105260403A (en) * 2015-09-22 2016-01-20 广东同望科技股份有限公司 Universal cross-database access method
CN105426481A (en) * 2015-11-19 2016-03-23 北京京东尚科信息技术有限公司 Data processing method and device
CN106933837A (en) * 2015-12-29 2017-07-07 航天信息股份有限公司 A kind of database table model and creation method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
付兴宏等: ""基于自动机技术的XML复杂数据类型验证"", 《黑龙江科技学院学报》, vol. 15, no. 5, 30 September 2005 (2005-09-30), pages 317 *
秦广赞: ""基于静态分析的防SQL注入过滤模块的设计与实现"", 《中国知网 硕士电子期刊》, pages 29 - 30 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990396A (en) * 2019-10-12 2020-04-10 贝壳技术有限公司 Data storage method, device and storage medium
CN110990396B (en) * 2019-10-12 2024-02-27 贝壳技术有限公司 Data storage method, device and storage medium
CN111767299A (en) * 2019-12-18 2020-10-13 北京沃东天骏信息技术有限公司 Database operation method, device and system, storage medium and electronic equipment
CN111767266A (en) * 2020-05-15 2020-10-13 杭州传化智能制造科技有限公司 Entity contact model design method and device, computer equipment and storage medium
CN112328672A (en) * 2020-11-04 2021-02-05 成都中科大旗软件股份有限公司 Method, system, storage medium and terminal for mapping API (application program interface) interface by data service

Similar Documents

Publication Publication Date Title
CN111177231B (en) Report generation method and report generation device
US10984913B2 (en) Blockchain system for natural language processing
US8712965B2 (en) Dynamic report mapping apparatus to physical data source when creating report definitions for information technology service management reporting for peruse of report definition transparency and reuse
US11599663B2 (en) Computer-implemented methods, systems comprising computer-readable media, and electronic devices for completing queries propagated across a plurality of datasources
US8423514B2 (en) Service provisioning
CN113692582A (en) User interface for establishing data privacy pipeline and contract agreement to share data
US9251222B2 (en) Abstracted dynamic report definition generation for use within information technology infrastructure
CN110109893A (en) The method and apparatus of data modeling and operation
KR102237877B1 (en) Intelligent software auto development system with real-time collaboration support and method thereof
CN108829746B (en) Main data management system and device based on memory database
CN106886406A (en) The generation method and device of exploitation code or document
CN111125064B (en) Method and device for generating database schema definition statement
CN109002289A (en) A kind of method and apparatus constructing data model
CN102023859B (en) Digital development environment-oriented software integration method with reliability, maintainability and supportability
US20210349887A1 (en) System and method for automatically suggesting remote query parameters based for customized data integration process
CN110334545A (en) A kind of authority control method based on SQL, device and electronic equipment
US20190147088A1 (en) Reporting and data governance management
CN109960212A (en) Task sending method and device
CN103678396A (en) Data backup method and device based on data models
CN110889013A (en) Data association method, device, server and storage medium based on XML
AU2017351024B2 (en) Processing application programming interface (API) queries based on variable schemas
CN111782820A (en) Knowledge graph creating method and device, readable storage medium and electronic equipment
CN107273425A (en) A kind of Database Development Method and device based on ORM frameworks
US10318524B2 (en) Reporting and data governance management
Liu et al. Service oriented cross-platform framework for 3D part library based on diversiform knowledge implantation

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