Movatterモバイル変換


[0]ホーム

URL:


CN107679071B - A custom packaging method for general data services for relational databases - Google Patents

A custom packaging method for general data services for relational databases
Download PDF

Info

Publication number
CN107679071B
CN107679071BCN201710724604.4ACN201710724604ACN107679071BCN 107679071 BCN107679071 BCN 107679071BCN 201710724604 ACN201710724604 ACN 201710724604ACN 107679071 BCN107679071 BCN 107679071B
Authority
CN
China
Prior art keywords
data
data service
setting
service
metadata
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.)
Active
Application number
CN201710724604.4A
Other languages
Chinese (zh)
Other versions
CN107679071A (en
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.)
Computer Network Information Center of CAS
Original Assignee
Computer Network Information Center of CAS
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 Computer Network Information Center of CASfiledCriticalComputer Network Information Center of CAS
Priority to CN201710724604.4ApriorityCriticalpatent/CN107679071B/en
Publication of CN107679071ApublicationCriticalpatent/CN107679071A/en
Application grantedgrantedCritical
Publication of CN107679071BpublicationCriticalpatent/CN107679071B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention relates to a relational database-oriented universal data service customized packaging method. The method comprises the following steps: 1) customizing a metadata entry item structure of the data service; 2) performing data source registration and connection to ensure that the data service can directly access the related data in the relational database; 3) setting a data range for providing data service based on parameter information set during data source registration; 4) setting the format type of data returned by the data service; 5) automatically generating a metadata entry interface based on the customized setting of the metadata entry item structure in the step 1), and realizing the entry of metadata; 6) and dynamically packaging and generating the data service according to the customized setting information of the data service in the steps 2) to 5). The invention can package the customized relation data into a data service form for sharing at any time according to the user requirement.

Description

Translated fromChinese
一种面向关系数据库的通用数据服务定制化封装方法A custom packaging method for general data services for relational databases

技术领域technical field

本发明涉及数据共享服务领域,尤其涉及一种面向关系数据库的通用数据服务定制化封装方法。用户可将各种类型、定制化范围内的关系数据封装成数据服务形式,实现数据的共享发现与访问服务。The invention relates to the field of data sharing services, in particular to a custom packaging method for general data services oriented to relational databases. Users can encapsulate relational data of various types and customization ranges into data service forms to realize shared discovery and access services of data.

背景技术Background technique

随着互联网技术和Web服务技术的发展,各个领域产生了大量种类各异的数据。同时伴随着开放获取,数据共享需求的发展,越来越多的数据资源要求被开放共享使用。传统面向人的在线数据查询、下载、访问服务模式已无法满足信息化应用和服务跨域集成的需求,为此需要将数据封装成服务发布到互联网上,以数据服务的形式提供给用户及应用。With the development of Internet technology and Web service technology, a large number of different types of data are generated in various fields. At the same time, with the development of open access and data sharing requirements, more and more data resources are required to be open and shared. The traditional human-oriented online data query, download, and access service model can no longer meet the needs of cross-domain integration of informatization applications and services. For this reason, it is necessary to encapsulate data into services and publish them on the Internet to provide users and applications in the form of data services. .

相比传统的将数据直接提供给用户,数据服务将数据封装为服务提供给用户有很多优点:Compared with the traditional direct provision of data to users, data services encapsulate data as services to provide users with many advantages:

1)数据服务能够对异构数据源进行整合,并且提供一种简单快捷的访问方式来访问异构数据源。1) Data services can integrate heterogeneous data sources and provide a simple and fast access method to access heterogeneous data sources.

2)数据服务分离了信息系统和数据访问接口,对异构数据源提供了统一的数据模型,实现了数据资源和整合方案的松耦合,使整个服务系统具有良好的可扩展性和服务消费者无需使用中介或代理便能直接进行集成。2) The data service separates the information system and the data access interface, provides a unified data model for heterogeneous data sources, realizes the loose coupling of data resources and integration schemes, and enables the entire service system to have good scalability and service consumers. Direct integration without the use of intermediaries or proxies.

3)数据服务有利于维持数据的完整性,并且它是可重用的,有效提高了数据服务的利用率,同时避免了多个数据源的重复更新。3) The data service is conducive to maintaining the integrity of the data, and it is reusable, which effectively improves the utilization rate of the data service and avoids repeated updates of multiple data sources.

4)数据服务具有能够对数据源进行抽象、聚合数据提供者、与逻辑数据模型保持一致、支持服务的多版本、提供单点交互以及增值特性等优点。4) Data services have the advantages of abstracting data sources, aggregating data providers, keeping consistent with logical data models, supporting multiple versions of services, providing single-point interaction and value-added features.

关系数据库作为结构化数据最常见存储方式,广泛存在于各个信息化服务领域中,在数据服务设计中很大一部数据来源于关系型数据库。As the most common storage method of structured data, relational database exists widely in various information service fields, and a large part of data in data service design comes from relational database.

然而传统的基于关系数据库的数据服务封装通常为专门化的设计封装,表现为根据特定的数据服务需求将固定范围的数据资源、与数据服务功能逻辑混杂在一起。缺乏定制化、通用化的解耦设计,降低了数据服务开发实现的效率,产生了大量重复工作,加大了研发成本。However, the traditional data service encapsulation based on relational database is usually a specialized design encapsulation, which manifests as a mixture of a fixed range of data resources and data service functional logic according to specific data service requirements. The lack of customized and generalized decoupling design reduces the efficiency of data service development and implementation, generates a lot of repetitive work, and increases R&D costs.

发明内容SUMMARY OF THE INVENTION

本发明提出了一种针对关系型数据库的通用数据服务定制化封装方法,该方法可以根据用户需要随时将定制化的关系数据封装成数据服务的形式进行共享。该方法实现了数据源、数据范围、数据参数和元数据等设置信息与数据服务功能封装的解耦合,保证了数据服务封装过程的高可定制性和高可复用性,大大提升了数据服务封装的通用性和灵活性。The invention proposes a customized encapsulation method for general data services for relational databases, which can encapsulate customized relational data into data services for sharing at any time according to user needs. The method realizes the decoupling of the data source, data range, data parameters, metadata and other setting information and the data service function encapsulation, ensures the high customizability and high reusability of the data service encapsulation process, and greatly improves the data service. Versatility and flexibility of packaging.

本发明采用的技术方案如下:The technical scheme adopted in the present invention is as follows:

一种面向关系数据库的通用数据服务定制化封装方法,包括以下步骤:A custom packaging method for general data services oriented to relational databases, comprising the following steps:

1)对数据服务的元数据录入项结构进行定制化设置;1) Customize the metadata entry structure of the data service;

2)进行数据源注册与连接,以保证数据服务能够直接访问到关系数据库中的相关数据;2) Perform data source registration and connection to ensure that the data service can directly access the relevant data in the relational database;

3)基于数据源注册时设置的参数信息,对提供数据服务的数据范围进行设定;3) Based on the parameter information set when the data source is registered, set the data range for providing data services;

4)设置数据服务返回数据的格式类型;4) Set the format type of the data returned by the data service;

5)基于步骤1)中元数据录入项结构的定制化设置,自动生成元数据录入界面,实现元数据的录入;5) Based on the customized setting of the metadata entry structure in step 1), the metadata entry interface is automatically generated to realize the entry of metadata;

6)根据步骤2)至步骤5)中数据服务的定制化设置信息,动态封装生成数据服务。6) According to the customized setting information of the data service in steps 2) to 5), dynamically encapsulate and generate a data service.

进一步地,在步骤3)之后进行数据服务的检索参数的设置,然后进行步骤4)。Further, after step 3), the setting of the retrieval parameters of the data service is performed, and then step 4) is performed.

进一步地,步骤1)所述定制化设置中的参数信息包括:元数据项唯一标识号,元数据项中文名称,元数据项英文名称,元数据项类型,是否为必填项,是否为重复项,枚举信息,备注信息。Further, the parameter information in the customized setting of step 1) includes: the unique identification number of the metadata item, the Chinese name of the metadata item, the English name of the metadata item, the type of the metadata item, whether it is a required item, whether it is a repetition Item, enumeration information, remark information.

进一步地,步骤2)通过对关系数据库的地址信息进行标识、登记和连接校验,实现数据源注册与连接;进行数据源注册时设置的参数信息包括:数据源唯一标识号,数据源名称,数据库名称,数据库类型,主机地址,端口号,用户名,密码。Further, step 2) realizes data source registration and connection by carrying out identification, registration and connection verification to the address information of the relational database; the parameter information set during data source registration includes: data source unique identification number, data source name, Database name, database type, host address, port number, username, password.

进一步地,步骤3)对数据范围进行的设定,包括数据实体的设定和数据关联化覆盖范围的设定。Further, in step 3) the setting of the data scope includes the setting of the data entity and the setting of the coverage scope of the data association.

进一步地,所述数据实体的设定包括:基于数据源的注册设置和选择,通过图形化界面列出该数据源下的所有数据表或视图,供用户选择,同时提供数据的预览和数据列标识功能。Further, the setting of the data entity includes: based on the registration setting and selection of the data source, listing all data tables or views under the data source through a graphical interface for the user to choose, and providing a preview of the data and a data column. Identification function.

进一步地,所述数据关联化覆盖范围的设定包括:基于数据源的注册和选择,通过图形化界面列出SQL语句录入界面,供用户输入,并对用户录入的SQL语句进行校验;或者利用第三方工具,通过数据表或视图的图形化设置形式,建立关联关系,设置查询列与查询条件,动态设置生成满足校验语法的SQL语句;同时提供SQL查询数据的数据列标识和数据预览功能。Further, the setting of the data association coverage includes: based on the registration and selection of the data source, listing the SQL statement entry interface through a graphical interface for user input, and verifying the SQL statement entered by the user; or Using third-party tools, through the graphical setting of data tables or views, establish associations, set query columns and query conditions, and dynamically set SQL statements that meet the validation syntax; at the same time, data column identifiers and data previews of SQL query data are provided. Function.

进一步地,步骤6)生成的数据服务包括数据服务API接口和在线数据服务界面。Further, the data service generated in step 6) includes a data service API interface and an online data service interface.

进一步地,所述数据服务API接口包括:a)元数据访问接口:用于根据数据服务唯一标识,获取数据服务的元数据信息;b)数据访问接口:用于获取数据服务的返回数据;当未设置数据服务检索参数时,根据数据服务的唯一标识号,返回数据服务定义的数据范围内的数据;当设置数据服务检索参数时,根据数据服务的唯一标识号以及用户设置数据服务检索参数,返回数据服务定义的数据范围内经参数检索后的数据。Further, the data service API interface includes: a) metadata access interface: used to obtain metadata information of the data service according to the unique identifier of the data service; b) data access interface: used to obtain the return data of the data service; when When the data service retrieval parameters are not set, the data within the data range defined by the data service is returned according to the unique identification number of the data service; when the data service retrieval parameters are set, according to the unique identification number of the data service and the data service retrieval parameters set by the user, Returns the data retrieved by parameters within the data range defined by the data service.

进一步地,步骤6)基于数据服务API接口封装及相关定制化设置,从元数据访问和数据访问获取两方面对在线数据服务功能进行二次封装。Further, in step 6), based on the data service API interface encapsulation and related customization settings, secondary encapsulation of the online data service function is carried out from two aspects of metadata access and data access acquisition.

本发明的有益效果是提出了针对关系型数据库的通用数据服务定制化封装方法,该方法实现了数据源、数据范围、数据参数和元数据等设置信息与数据服务功能封装的解耦合。即在数据服务封装代码不变的情况下,通过动态设置数据服务的封装参数,即可实现定制化数据服务接口和功能的有效封装。从而大力提升了关系型数据服务封装设计开发的效率,缩短软件的开发周期,保证了数据服务封装过程的高可定制性和高可复用性,进而提升了数据服务封装的通用性和灵活性。The beneficial effect of the present invention is to propose a general data service customization encapsulation method for relational databases, which realizes the decoupling of data source, data range, data parameters and metadata and other setting information and data service function encapsulation. That is, under the condition that the encapsulation code of the data service remains unchanged, by dynamically setting the encapsulation parameters of the data service, the effective encapsulation of the interface and function of the customized data service can be realized. This greatly improves the efficiency of the design and development of relational data service packaging, shortens the software development cycle, ensures the high customizability and high reusability of the data service packaging process, and improves the versatility and flexibility of data service packaging. .

附图说明Description of drawings

图1.本发明总体方法步骤及关系图。Figure 1. The overall method steps and relationship diagram of the present invention.

图2.数据表(视图)选择实例图。Figure 2. Data table (view) selection example diagram.

图3.数据列名称标识设置实例图。Figure 3. Example diagram of data column name identification setting.

图4.提供服务的数据内容预览实例图。Figure 4. An example diagram of a preview of data content that provides services.

图5.关联表数据范围(SQL)设置实例图。Figure 5. Example diagram of associated table data range (SQL) settings.

图6.图形定制化关联表数据范围(SQL)设置实例图。Figure 6. Example diagram of graphical customization of relational table data range (SQL) settings.

图7.数据服务检索参数信息设置实例图。Figure 7. Example diagram of data service retrieval parameter information setting.

图8.数据服务返回数据格式设置实例图。Figure 8. An example diagram of the data format returned by the data service.

图9.数据服务元数据录入设置实例图。Figure 9. Example diagram of data service metadata entry settings.

图10.元数据访问接口封装流程图。Figure 10. Metadata access interface encapsulation flow chart.

图11.数据访问接口封装流程图。Figure 11. Data access interface encapsulation flow chart.

图12.元数据服务封装界面实例图。Figure 12. Example diagram of the metadata service encapsulation interface.

图13.在线数据获取服务封装界面实例图。Figure 13. Example diagram of the online data acquisition service package interface.

图14.在线数据检索与获取服务封装界面实例图。Figure 14. An example diagram of the online data retrieval and acquisition service package interface.

具体实施方式Detailed ways

下面通过具体实施例和附图,对本发明做进一步详细说明。The present invention will be described in further detail below through specific embodiments and accompanying drawings.

本发明的总体方法步骤及关系如图1所示。整个方法共概括分为三个部分:一.初始化,二.定制化设置,三.服务封装;进一步分为七个步骤:1.元数据项构成设置、2.数据源注册与连接、3.数据范围设置、4.检索参数设置、5.返回格式设置、6.元数据录入、7.数据服务生成。其中第4步为可选步骤,对于重复使用本发明时第1步可以仅设置一次,且重复使用已注册连接的数据源时,第2步可以省略(即仅设置一次)。The overall method steps and relationships of the present invention are shown in FIG. 1 . The whole method is divided into three parts: 1. Initialization, 2. Customized settings, 3. Service encapsulation; it is further divided into seven steps: 1. Metadata item composition setting, 2. Data source registration and connection, 3. Data range setting, 4. Retrieval parameter setting, 5. Return format setting, 6. Metadata entry, 7. Data service generation. The fourth step is an optional step. When the present invention is repeatedly used, the first step can be set only once, and when the registered connected data source is repeatedly used, the second step can be omitted (that is, only set once).

其中第1步可以映射为整体初设化过程,第2至6步可以映射为整体定制化设置过程,第7步可以映射为服务封装过程。The first step can be mapped to the overall initial setting process, the second to sixth steps can be mapped to the overall customized setting process, and the seventh step can be mapped to the service encapsulation process.

就步骤关系而言,第1步元数据项构成设置决定了第6步中元数据录入项的来源(包括在线服务样式);第2步数据源注册决定了第3步数据范围设置中的数据来源;第3步数据范围设置又决定了第4步数据检索参数设置的来源范围。而第2至6步即整个定制化设置过程是第7步中数据服务生成过程中全部定制化设置参数来源。As far as the step relationship is concerned, the metadata item composition setting instep 1 determines the source (including online service style) of the metadata entry instep 6; the data source registration instep 2 determines the data in the data scope setting instep 3 Source; the data range setting instep 3 determines the source range of the data retrieval parameter setting instep 4.Steps 2 to 6, that is, the entire customized setting process, are the source of all customized setting parameters in the data service generation process instep 7.

下面对每个步骤的设计进行重点说明:The design of each step is highlighted below:

1.元数据项构成设置1. Metadata item composition settings

即对数据服务的元数据录入项结构进行定制化设置,以便规范化管理和支持后续元数据的在线录入和编辑界面与功能的实现。That is to customize the metadata entry structure of the data service, so as to standardize the management and support the realization of the online entry and editing interface and functions of the subsequent metadata.

初设化设置需定制化设置的参数信息如表1所示(除备注信息外,全部为必填项):The parameter information that needs to be customized for the initial setting is shown in Table 1 (all items are required except for the remarks):

表1数据服务元数据项设置参数表Table 1 Data service metadata item setting parameter table

Figure BDA0001385709020000041
Figure BDA0001385709020000041

设置形式:依据表1的定义,可以包括在线界面录入、Xml或Excel等格式模板导入形式。Setting form: According to the definition in Table 1, it can include online interface input, Xml or Excel and other format template import forms.

参数实例:(见面表2,含8个元数据项)Parameter example: (Meeting table 2, including 8 metadata items)

表2数据服务元数据项设置参数实例Table 2 Example of setting parameters of data service metadata item

Figure BDA0001385709020000042
Figure BDA0001385709020000042

Figure BDA0001385709020000051
Figure BDA0001385709020000051

2.数据源注册与连接2. Data source registration and connection

即对关系数据库的地址信息进行标识、登记和连接校验,以保证数据服务可以直接访问到数据库中的相关数据。通过数据源注册设置可以保证数据源与数据获取设置的解耦,保证数据源信息的复用。That is, the address information of the relational database is identified, registered and connected, so as to ensure that the data service can directly access the relevant data in the database. Data source registration settings can ensure the decoupling of data sources and data acquisition settings, and ensure the reuse of data source information.

数据源注册的参数信息如表3所示(全部为必填项):The parameter information of data source registration is shown in Table 3 (all are required):

表3数据源注册参数表Table 3 Data source registration parameter table

Figure BDA0001385709020000052
Figure BDA0001385709020000052

设置形式:依据上表的定义,可以包括在线界面录入、Xml或Excel等格式模板导入形式。Setting form: According to the definition in the above table, it can include online interface input, Xml or Excel and other format template import forms.

参数实例:(见表4,含2个数据源)Parameter example: (see Table 4, including 2 data sources)

表4数据源注册设置参数实例Table 4 Examples of data source registration settings parameters

Figure BDA0001385709020000061
Figure BDA0001385709020000061

3.数据范围设置3. Data range setting

基于第2步中的数据源注册时设置的参数信息,对提供数据服务的数据内容范围进行设定,包括数据实体(数据表或视图)的设定或数据关联化覆盖范围(SQL语句)设定两种主要形式。Based on the parameter information set during data source registration instep 2, set the scope of data content to provide data services, including the setting of data entities (data tables or views) or the setting of data association coverage (SQL statements) two main forms.

a)数据表(视图)选择:基于数据源的设置和选择,通过图形化界面列出该数据源下的所有数据表或视图,供用户选择,同时提供数据的预览和数据列标识(便于用户理解列数据的含义)功能,如图2所示。a) Data table (view) selection: Based on the setting and selection of the data source, all data tables or views under the data source are listed through a graphical interface for users to choose, and a preview of the data and data column identification are provided (for the convenience of users Understand the meaning of column data) function, as shown in Figure 2.

数据列名称标识设置见图3所示。数据内容预览见图4所示。The data column name identification settings are shown in Figure 3. A preview of the data content is shown in Figure 4.

b)关联表数据(SQL)设置:基于数据源的注册设置和选择,通过图形化界面列出SQL语句录入界面,供用户输入,并对用户录入的SQL语句进行校验,如图5所示。b) Association table data (SQL) settings: Based on the registration settings and selection of the data source, the SQL statement entry interface is listed through a graphical interface for user input, and the SQL statement entered by the user is verified, as shown in Figure 5 .

也可以通过数据表(视图)图形化设置形式,建立关联关系,设置查询列与查询条件,动态设置生成满足校验语法的SQL语句,如图6所示。You can also set the form graphically through the data table (view) to establish an association relationship, set query columns and query conditions, and dynamically set to generate an SQL statement that satisfies the verification syntax, as shown in Figure 6.

同时也提供SQL查询数据的数据列标识和数据预览功能,可分别参见图3、图4。At the same time, it also provides data column identification and data preview functions for SQL query data, as shown in Figure 3 and Figure 4, respectively.

4.检索参数设置(可选)4. Retrieve parameter settings (optional)

即设置数据服务检索参数的相关信息,便于接口实现中调用。That is to set the relevant information of the data service retrieval parameters, which is convenient for calling in the interface implementation.

需要说明是:本步骤为可选步骤。当用户不设定本步骤时,数据服务直接返回第3步中设置的数据范围内的数据内容,同时在第3步中用户可以选择多张表或视图,也可与多条关联表数据SQL范围设置组合。当用户设定本步骤时,数据服务依据参数设置形成多参数的数据检索服务,此时在第3步设置中用户仅可选择数据表或关联表设置一种模式,并且只能设置一条数据(如:选择一张表或选择一张视图或设置一条关联表数据SQL语句)。同时本步骤中设置参数范围受第三步中直接设置的表或视图,或者关联表数据SQL语句中的表或视图的限制,即参数来源于相关表或视图中列的范围。It should be noted that this step is optional. When the user does not set this step, the data service directly returns the data content within the data range set in the third step. At the same time, in the third step, the user can select multiple tables or views, and can also associate with multiple table data SQL Range setting combination. When the user sets this step, the data service forms a multi-parameter data retrieval service according to the parameter settings. At this time, in the third step of the setting, the user can only select the data table or the association table to set one mode, and can only set one data ( Such as: select a table or select a view or set an associated table data SQL statement). At the same time, the parameter range set in this step is limited by the table or view directly set in the third step, or the table or view in the related table data SQL statement, that is, the parameter comes from the range of the columns in the related table or view.

参数设置的信息如表5所示(全部为必填项)。The parameter setting information is shown in Table 5 (all items are required).

表5数据服务检索参数信息表Table 5 Data service retrieval parameter information table

Figure BDA0001385709020000062
Figure BDA0001385709020000062

Figure BDA0001385709020000071
Figure BDA0001385709020000071

录入形式及设置实例:主要可以采用在线界面设置形式,设置实例参见图7。Input form and setting example: mainly can use the online interface setting form, see Figure 7 for the setting example.

5.返回格式设置5. Return to Formatting

即设定数据服务返回数据的格式类型。That is, set the format type of the data returned by the data service.

为了便于数据的有效应用,通常采用通用标准化的输出格式类型。如:XML、JSON格式或两者的组合。In order to facilitate the effective application of the data, a common standardized output format type is usually adopted. Such as: XML, JSON format or a combination of the two.

设置形式上可以采用图形化界面录入,实例参考图8。The setting form can be entered using a graphical interface, see Figure 8 for an example.

6.元数据录入6. Metadata entry

即基于第1步中元数据项构成的定制化设置,自动生成元数据录入界面,并实现录入的元数据信息的提交保存功能,以便用户在使用该数据服务前,可以获取针对该数据服务的全面介绍与参考信息。That is, based on the customized settings composed of the metadata items in the first step, the metadata entry interface is automatically generated, and the function of submitting and saving the entered metadata information is realized, so that the user can obtain the information for the data service before using the data service. Comprehensive introduction and reference information.

元数据项通常包括但不受限于以下数据:服务唯一标识(服务编号)、服务名称、服务简介、服务领域、服务标签、支撑单位和联系人信息等。其中服务唯一标识为元数据的必需项,它通常由系统自动生成,不在录入界面中体现。Metadata items usually include but are not limited to the following data: service unique identifier (service number), service name, service introduction, service field, service label, support unit and contact information, etc. The service unique identifier is a required item of metadata, which is usually automatically generated by the system and is not reflected in the input interface.

元数据录入形式采用图形化界面录入(基于第1步中元数据项构成的定制化设置),实例参考图9。界面中*号代表必填项,+号项代表可重复录入项,点击后将自动生成重复项录入界面。同时,也可以采用Excel或Xml等格式模板进行批量导入形式设置,但必须对其中必填项及重复项格式进行必要的校验。The metadata entry form is entered using a graphical interface (based on the customized settings formed by the metadata items in step 1), and an example is shown in Figure 9. In the interface, the * sign represents the required item, and the + sign item represents the repeated entry item. After clicking, the repeated item entry interface will be automatically generated. At the same time, format templates such as Excel or Xml can also be used for batch import form settings, but the necessary and repeated formats must be checked.

元数据的数据实例如表6所示。Data examples of metadata are shown in Table 6.

表6元数据数据实例Table 6 Metadata Data Examples

Figure BDA0001385709020000072
Figure BDA0001385709020000072

Figure BDA0001385709020000081
Figure BDA0001385709020000081

7.数据服务生成7. Data service generation

即根据前述步骤2-6中数据服务的定制化设置信息,动态封装生成应用及用户可以使用的数据服务。主要包括数据服务API接口和在线数据服务界面两种。That is, according to the customized setting information of the data service in the foregoing steps 2-6, dynamically encapsulate and generate the application and the data service that the user can use. It mainly includes data service API interface and online data service interface.

1)数据服务API接口封装1) Data service API interface encapsulation

数据服务API接口语法格式说明如示例所示。The syntax format description of the data service API interface is shown in the example.

示例:http://url/service?[query]Example: http://url/service? [query]

备注:[?]号前面为数据服务单位提供的服务地址;[query]部分包括多组参数名称与参数值。Remark:[? ] is the service address provided by the data service unit; the [query] part includes multiple sets of parameter names and parameter values.

主要封装的接口包括两种,见表7。There are two main package interfaces, see Table 7.

表7元数据数据实例Table 7 Metadata Data Examples

Figure BDA0001385709020000082
Figure BDA0001385709020000082

两种接口的返回格式是读取第5步的设置统一封装后生成的,需要说明的是当第5步设置返回多种格式时(如用户设置XML+JSON选项),接口调用参数将增加一个明确返回格式类型的参数以便统一封装。The return formats of the two interfaces are generated after reading the settings instep 5 and encapsulating them uniformly. It should be noted that when the settings instep 5 return multiple formats (for example, the user sets the XML+JSON option), the interface call parameter will be increased by one Explicitly return the parameters of the format type for uniform encapsulation.

数据服务封装:数据服务实现可以采用目前广泛使用的Web Service技术,封装流程包括:Data service encapsulation: The data service implementation can adopt the widely used Web Service technology. The encapsulation process includes:

(A)元数据访问接口封装流程,如图10所示。(A) Metadata access interface encapsulation process, as shown in Figure 10.

(B)数据访问接口封装流程见图11。(B) The encapsulation process of the data access interface is shown in Figure 11.

2)数据服务功能界面封装2) Data service function interface encapsulation

基于数据服务API接口封装及相关定制化设置,可以从元数据访问和数据访问获取两方面对在线数据服务功能进行二次封装。Based on the data service API interface encapsulation and related customization settings, the online data service functions can be re-encapsulated from the two aspects of metadata access and data access acquisition.

A)元数据访问A) Metadata Access

提供数据服务相关元数据的在线展示功能,便于用户获取相关信息。如图12所示。Provides an online display function of metadata related to data services to facilitate users to obtain relevant information. As shown in Figure 12.

B)数据访问获取B) Data access acquisition

未设置数据服务检索参数时,数据的获取功能界面封装,如图13所示。When the data service retrieval parameters are not set, the data acquisition function interface is encapsulated, as shown in Figure 13.

设置数据服务检索参数时,数据的检索获取功能界面封装,如图14所示(该图仅作为示例,其中的个人信息并非真实信息)。When setting the data service retrieval parameters, the data retrieval and acquisition function interface is encapsulated, as shown in Figure 14 (this figure is only an example, and the personal information in it is not real information).

在实现方式上可以采用目前广泛使用的Web开发技术,基于B/S框架,采用MVC的设计模式。其中:模型(Model)是应用程序中用于处理应用程序数据逻辑的部分,控制器(Controller)是应用程序中处理用户交互的部分,视图(View)是应用程序中处理数据显示的部分。In terms of implementation, the widely used Web development technology can be used, based on the B/S framework and the MVC design pattern. Among them: Model (Model) is the part of the application that handles the data logic of the application, Controller (Controller) is the part of the application that handles user interaction, and View (View) is the part of the application that handles data display.

以上实施例仅用以说明本发明的技术方案而非对其进行限制,本领域的普通技术人员可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明的精神和范围,本发明的保护范围应以权利要求书所述为准。The above embodiments are only used to illustrate the technical solutions of the present invention rather than limit them. Those of ordinary skill in the art can modify or equivalently replace the technical solutions of the present invention without departing from the spirit and scope of the present invention. The scope of protection shall be subject to what is stated in the claims.

Claims (6)

Translated fromChinese
1.一种面向关系数据库的通用数据服务定制化封装方法,其特征在于,包括以下步骤:1. a general data service customization encapsulation method oriented to relational database, is characterized in that, comprises the following steps:1)对数据服务的元数据录入项结构进行定制化设置;1) Customize the metadata entry structure of the data service;2)进行数据源注册与连接,以保证数据服务能够直接访问到关系数据库中的相关数据;2) Perform data source registration and connection to ensure that the data service can directly access the relevant data in the relational database;3)基于数据源注册时设置的参数信息,对提供数据服务的数据范围进行设定;对数据范围进行的设定包括数据实体的设定和数据关联化覆盖范围的设定;3) Based on the parameter information set when the data source is registered, set the data scope for providing data services; the setting of the data scope includes the setting of the data entity and the setting of the data association coverage;所述数据实体的设定包括:基于数据源的设置和选择,通过图形化界面列出该数据源下的所有数据表或视图,供用户选择,同时提供数据的预览和数据列标识功能;The setting of the data entity includes: based on the setting and selection of the data source, listing all data tables or views under the data source through a graphical interface for the user to select, and simultaneously providing data preview and data column identification functions;所述数据关联化覆盖范围的设定包括:基于数据源的设置和选择,通过图形化界面列出SQL语句录入界面,供用户输入,并对用户录入的SQL语句进行校验;或者利用第三方工具,通过数据表或视图的图形化设置形式,建立关联关系,设置查询列与查询条件,动态设置生成满足校验语法的SQL语句;同时提供SQL查询数据的数据列标识和数据预览功能;The setting of the data association coverage includes: based on the setting and selection of the data source, listing the SQL statement entry interface through a graphical interface for user input, and verifying the SQL statement entered by the user; or using a third party The tool, through the graphical setting of data tables or views, establishes associations, sets query columns and query conditions, and dynamically generates SQL statements that meet the validation syntax; at the same time, it provides data column identification and data preview functions for SQL query data;4)设置数据服务返回数据的格式类型;4) Set the format type of the data returned by the data service;5)基于步骤1)中元数据录入项结构的定制化设置,自动生成元数据录入界面,实现元数据的录入;5) Based on the customized setting of the metadata entry structure in step 1), the metadata entry interface is automatically generated to realize the entry of metadata;6)根据步骤2)至步骤5)中数据服务的定制化设置信息,动态封装生成数据服务;生成的数据服务包括数据服务API接口和在线数据服务界面。6) According to the customized setting information of the data service in steps 2) to 5), dynamically encapsulate and generate a data service; the generated data service includes a data service API interface and an online data service interface.2.如权利要求1所述的方法,其特征在于,在步骤3)之后进行数据服务的检索参数的设置,然后进行步骤4)。2. The method according to claim 1, characterized in that, after step 3), the setting of retrieval parameters of the data service is performed, and then step 4) is performed.3.如权利要求1或2所述的方法,其特征在于,步骤1)所述定制化设置中的参数信息包括:元数据项唯一标识号,元数据项中文名称,元数据项英文名称,元数据项类型,是否为必填项,是否为重复项,枚举信息,备注信息。3. The method according to claim 1 or 2, wherein the parameter information in the customized setting of step 1) comprises: the unique identification number of the metadata item, the Chinese name of the metadata item, the English name of the metadata item, Metadata item type, whether it is a required item, whether it is a duplicate item, enumeration information, and remark information.4.如权利要求1或2所述的方法,其特征在于,步骤2)通过对关系数据库的地址信息进行标识、注册和连接校验,实现数据源注册与连接;进行数据源注册时设置的参数信息包括:数据源唯一标识号,数据源名称,数据库名称,数据库类型,主机地址,端口号,用户名,密码。4. the method as claimed in claim 1 or 2 is characterized in that, step 2) by carrying out identification, registration and connection verification to the address information of relational database, realizes data source registration and connection; The parameter information includes: data source unique identification number, data source name, database name, database type, host address, port number, user name, and password.5.如权利要求1所述的方法,其特征在于,所述数据服务API接口包括:a)元数据访问接口:用于根据数据服务唯一标识,获取数据服务的元数据信息;b)数据访问接口:用于获取数据服务的返回数据;当未设置数据服务检索参数时,根据数据服务的唯一标识号,返回数据服务定义的数据范围内的数据;当设置数据服务检索参数时,根据数据服务的唯一标识号以及用户设置数据服务检索参数,返回数据服务定义的数据范围内经参数检索后的数据。5. The method according to claim 1, wherein the data service API interface comprises: a) metadata access interface: for obtaining metadata information of the data service according to the unique identifier of the data service; b) data access Interface: used to obtain the return data of the data service; when the data service retrieval parameters are not set, the data within the data range defined by the data service is returned according to the unique identification number of the data service; when the data service retrieval parameters are set, according to the data service The unique identification number of the data service and the data service retrieval parameters set by the user are returned, and the data retrieved by the parameters within the data range defined by the data service is returned.6.如权利要求1所述的方法,其特征在于,步骤6)基于数据服务API接口封装及相关定制化设置,从元数据访问和数据访问获取两方面对在线数据服务功能进行二次封装。6. The method of claim 1, wherein in step 6), based on data service API interface encapsulation and related customization settings, secondary encapsulation of online data service functions is performed from both metadata access and data access acquisition.
CN201710724604.4A2017-08-222017-08-22 A custom packaging method for general data services for relational databasesActiveCN107679071B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710724604.4ACN107679071B (en)2017-08-222017-08-22 A custom packaging method for general data services for relational databases

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710724604.4ACN107679071B (en)2017-08-222017-08-22 A custom packaging method for general data services for relational databases

Publications (2)

Publication NumberPublication Date
CN107679071A CN107679071A (en)2018-02-09
CN107679071Btrue CN107679071B (en)2020-12-18

Family

ID=61134170

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710724604.4AActiveCN107679071B (en)2017-08-222017-08-22 A custom packaging method for general data services for relational databases

Country Status (1)

CountryLink
CN (1)CN107679071B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108427550B (en)*2018-02-132021-09-03深圳太极云软技术有限公司Web service generation method, device and equipment
CN109033871B (en)*2018-07-172021-09-14河北中科恒运软件科技股份有限公司Method for automatically encapsulating API based on data directory
CN109344306B (en)*2018-07-272021-12-10中国科学院计算机网络信息中心Method and system for customized online transaction and service of field multi-standard metadata
CN110083650B (en)*2019-04-252023-06-30中电科嘉兴新型智慧城市科技发展有限公司Metadata self-discovery-based automatic generation method for data query interface
KR102171436B1 (en)*2019-12-162020-10-29주식회사 레몬헬스케어Cloud-based API metadata management method and system for hospital data standardization
CN111274294B (en)*2020-01-092023-03-10中国科学院计算机网络信息中心Universal distributed heterogeneous data integrated logic convergence organization, release and service method and system
CN112035091B (en)*2020-07-172023-07-28四川长宁天然气开发有限责任公司Agile delivery management method and system for shale gas field
CN111930449B (en)*2020-09-282021-01-12武汉中科通达高新技术股份有限公司Data management method and server
CN115879257A (en)*2021-09-282023-03-31上海宝信软件股份有限公司Service simulation calling method and system based on microservice

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102081661A (en)*2011-01-192011-06-01吉林大学Data integration method and system of heterogeneous relational database based on XML (Extensive Makeup Language)
CN103324701A (en)*2013-06-132013-09-25深圳中兴网信科技有限公司Data searching device and method
CN104360992A (en)*2014-12-022015-02-18福建工程学院WEB report design system built based on EXCEL platform and implementation method
CN106844485A (en)*2016-12-232017-06-13航天星图科技(北京)有限公司A kind of system and method for enterprise's heterogeneous database intelligent integrated

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7469248B2 (en)*2005-05-172008-12-23International Business Machines CorporationCommon interface to access catalog information from heterogeneous databases

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102081661A (en)*2011-01-192011-06-01吉林大学Data integration method and system of heterogeneous relational database based on XML (Extensive Makeup Language)
CN103324701A (en)*2013-06-132013-09-25深圳中兴网信科技有限公司Data searching device and method
CN104360992A (en)*2014-12-022015-02-18福建工程学院WEB report design system built based on EXCEL platform and implementation method
CN106844485A (en)*2016-12-232017-06-13航天星图科技(北京)有限公司A kind of system and method for enterprise's heterogeneous database intelligent integrated

Also Published As

Publication numberPublication date
CN107679071A (en)2018-02-09

Similar Documents

PublicationPublication DateTitle
CN107679071B (en) A custom packaging method for general data services for relational databases
CN111259006B (en) A general integrated physical aggregation, organization, release and service method and system for distributed heterogeneous data
CN111274294B (en)Universal distributed heterogeneous data integrated logic convergence organization, release and service method and system
CN106874388B (en) An automatic construction method for data cascade operation of heterogeneous system based on relational database
CN111198901B (en) Unified data service opening method and system based on multiple data sources
CN106407302B (en) Support the method of invoking the specific functions of the middleware database through simple SQL
CN113760948A (en) Method and device for querying data
CN106843835A (en)A kind of application systems software constructing system of meta data customizing, system constituting method
WO2024001493A1 (en)Visual data analysis method and device
CN105930446B (en)A kind of telecom client label generating method based on Hadoop distributed computing technology
CN101256650A (en) A business entity-based enterprise data extraction method and system
Han et al.Situational data integration with data services and nested table
CN103473234B (en)A kind of method, apparatus and system from web-query system export report
CN112667598B (en)Data model rapid construction system based on business demand change
CN102622675A (en)Method and system for realizing interoperation of enterprises under cluster supply chain environment
CN102663009B (en)Web-service integration method supporting data privatization of enterprise users
CN110222110A (en)A kind of resource description framework data conversion storage integral method based on ETL tool
CN104573065A (en)Report display engine based on metadata
US7099727B2 (en)Knowledge repository system for computing devices
CN104573022A (en)Data query method and device for HBase
CN109597825B (en)Rule engine calling method, device, equipment and computer readable storage medium
CN102708203A (en) A Dynamic Database Management Method Based on XML Metadata
CN105224544A (en)A kind of data editing method of database and device
CN110990011A (en)Data request method of automation interface
CN107391658A (en)A kind of product information management system and method based on RDF data model

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp