Movatterモバイル変換


[0]ホーム

URL:


CN102110110A - Method and device for data access based on SOA (Service-Oriented Architecture) - Google Patents

Method and device for data access based on SOA (Service-Oriented Architecture)
Download PDF

Info

Publication number
CN102110110A
CN102110110ACN2009102440753ACN200910244075ACN102110110ACN 102110110 ACN102110110 ACN 102110110ACN 2009102440753 ACN2009102440753 ACN 2009102440753ACN 200910244075 ACN200910244075 ACN 200910244075ACN 102110110 ACN102110110 ACN 102110110A
Authority
CN
China
Prior art keywords
sql
query
statement
configuration file
xml configuration
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
CN2009102440753A
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.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group 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 China Mobile Communications Group Co LtdfiledCriticalChina Mobile Communications Group Co Ltd
Priority to CN2009102440753ApriorityCriticalpatent/CN102110110A/en
Publication of CN102110110ApublicationCriticalpatent/CN102110110A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

Translated fromChinese

本发明公开了一种基于SOA的数据访问方法和装置。该方法包括:接收业务服务的调用指令,调用指令中包括:SQL ID和查询参数;获取SQL ID对应的XML配置文件,根据XML配置文件解析SQL原始语句;根据SQL原始语句和查询参数,构造完整SQL语句;根据完整SQL语句,在数据库中进行查询,获取查询结果。本方法可以作为SOA架构系统中的数据访问层,完成各类数据库查询操作。特别适合BPEL流程中的复杂与动态查询,弥补厂商提供的DB Adapter查询方式的不足,具有简单,方便,灵活等特点。

Figure 200910244075

The invention discloses an SOA-based data access method and device. The method includes: receiving a calling instruction of a business service, the calling instruction includes: SQL ID and query parameters; obtaining an XML configuration file corresponding to the SQL ID, parsing the original SQL statement according to the XML configuration file; constructing a complete SQL statement according to the original SQL statement and query parameters SQL statement; according to the complete SQL statement, query in the database and obtain the query result. The method can be used as a data access layer in the SOA architecture system to complete various database query operations. It is especially suitable for complex and dynamic queries in the BPEL process, making up for the lack of DB Adapter query methods provided by manufacturers, and has the characteristics of simplicity, convenience, and flexibility.

Figure 200910244075

Description

Translated fromChinese
基于SOA的数据访问方法和装置SOA-Based Data Access Method and Device

技术领域technical field

本发明涉及管理信息系统技术领域,具体涉及一种基于SOA的数据访问方法和装置。The invention relates to the technical field of management information systems, in particular to an SOA-based data access method and device.

背景技术Background technique

SOA(Service-Oriented Architecture,面向服务的体系结构)通过建立一种统一的架构,使得软件开发人员能快速开发、集成和重用应用。更为重要的是,基于这种软件框架,系统能在业务发生变化之后,动态响应新的需求,快速重新装配各种软件构件和服务。今天基于SOA的集成方法正推动着市场的发展,BEA、IBM、Microsoft、Oracle等主流厂商已转向SOA。SOA (Service-Oriented Architecture, service-oriented architecture) enables software developers to quickly develop, integrate and reuse applications by establishing a unified architecture. More importantly, based on this software framework, the system can dynamically respond to new requirements and quickly reassemble various software components and services after business changes. Today's SOA-based integration method is driving the development of the market, and mainstream vendors such as BEA, IBM, Microsoft, and Oracle have turned to SOA.

随着SOA概念的不断成熟以及各大IT巨头逐渐在SOA的具体细节上不断达成共识,于是成立了一个SOA的标准化组织OSOA(http://www.osoa.org/)专门负责制定各大SOA厂商共同遵循的SOA规范,约定SOA的具体实现的细节。OSOA规范核心概念主要是SCA(ServiceComponent Architecture,服务构建架构)和SDO(Service Data Obiect,服务数据对象)。With the continuous maturity of the SOA concept and the major IT giants gradually reaching consensus on the specific details of SOA, a SOA standardization organization OSOA (http://www.osoa.org/) was established to be responsible for formulating major SOA The SOA specification that vendors follow together, agrees on the details of the specific implementation of SOA. The core concepts of the OSOA specification are mainly SCA (Service Component Architecture, service construction architecture) and SDO (Service Data Object, service data object).

SCA规范包括了Assemble Model和Client Model两部分。前者约定了如何将异种组件(Java类,BPEL,Web Service)组装并发布成SOA服务,是SCA最大的特点和核心的概念;后者则约定了如何在异种语言环境中调用SOA服务。The SCA specification includes two parts, the Assemble Model and the Client Model. The former stipulates how to assemble and publish heterogeneous components (Java classes, BPEL, Web Service) into SOA services, which is the biggest feature and core concept of SCA; the latter stipulates how to call SOA services in heterogeneous language environments.

SDO规范则负责解决如何在异种服务间交换数据。它定义了一套中立的数据结构,目前有Java和C++的具体语言规范,Java规范解决了JavaBean和SDO的映射,C++规范解决了C++类、结构体和SDO的映射。The SDO specification is responsible for how to exchange data between heterogeneous services. It defines a set of neutral data structures. Currently, there are specific language specifications for Java and C++. The Java specification solves the mapping between JavaBean and SDO, and the C++ specification solves the mapping between C++ classes, structures and SDO.

DAS(Data Access Service,数据访问服务)提供了一个简单的针对关系数据库的SDO接口,虽然DAS不属于SDO规范,但它是SOA架构中不可或缺的一部分,如果没有DAS的支持,SDO只是一个数据传输对象模型,就不能从根本上企业级应用中的数据问题,包括数据的查询、数据的持久性处理等。DAS (Data Access Service, Data Access Service) provides a simple SDO interface for relational databases. Although DAS does not belong to the SDO specification, it is an integral part of the SOA architecture. Without the support of DAS, SDO is just a The data transmission object model cannot fundamentally solve the data problems in enterprise-level applications, including data query and data persistence processing.

各厂商SOA产品都提供访问各类异构数据库的DB Adapter组件(适配器组件),但是DB Adapter组件本身具有一定的局限性,只适合静态SQL(Structured Query Language,结构化查询语言),不能灵活应对SQL的变动,对于某些特别复杂的业务SQL语句可能需要动态构造,此种情况下使用DB Adapter往往无法满足要求。The SOA products of various manufacturers provide DB Adapter components (adapter components) for accessing various heterogeneous databases, but the DB Adapter components themselves have certain limitations, and are only suitable for static SQL (Structured Query Language, Structured Query Language), which cannot be flexibly dealt with Changes in SQL may require dynamic construction of some particularly complex business SQL statements. In this case, the use of DB Adapter often cannot meet the requirements.

在实现本发明过程中,发明人发现现有技术基于SOA的数据访问方式中存在如下问题:不能灵活应对SQL的变动,使用DB Adapter无法满足SQL语句动态构造的要求。In the process of realizing the present invention, the inventor found that the existing SOA-based data access method has the following problems: it cannot flexibly deal with changes in SQL, and the use of DB Adapter cannot meet the requirements for dynamic construction of SQL statements.

发明内容Contents of the invention

本发明的目的是解决现有技术基于SOA的数据访问方式不能灵活应对SQL的变动,使用DB Adapter无法满足SQL语句动态构造的要求的问题,提出一种基于SOA的数据访问方法和装置,以提供了一套动态查询,数据转换和传输的方案。The purpose of the present invention is to solve the problem that the SOA-based data access method in the prior art cannot flexibly cope with SQL changes, and the use of DB Adapter cannot meet the requirements of the dynamic construction of SQL statements, and proposes a SOA-based data access method and device to provide A set of solutions for dynamic query, data conversion and transmission.

为实现上述目的,根据本发明的一个方面,提供了一种基于SOA的数据访问方法,包括:接收业务服务的调用指令,调用指令中包括:SQL ID和查询参数;获取SQL ID对应的XML配置文件,根据XML配置文件解析SQL原始语句;根据SQL原始语句和查询参数,构造完整SQL语句;根据完整SQL语句,在数据库中进行查询,获取查询结果。In order to achieve the above object, according to one aspect of the present invention, a SOA-based data access method is provided, including: receiving a calling instruction of a business service, including: SQL ID and query parameters in the calling instruction; obtaining the XML configuration corresponding to the SQL ID file, parse the original SQL statement according to the XML configuration file; construct a complete SQL statement according to the original SQL statement and query parameters; perform a query in the database according to the complete SQL statement, and obtain the query result.

本技术方案中,接收业务服务的调用指令的步骤之前还包括:分配SQLID给各查询服务对应的SQL原始语句,将各原始SQL语句写为XML配置文件。In the technical solution, before the step of receiving the calling instruction of the business service, it also includes: assigning SQLIDs to the original SQL statements corresponding to each query service, and writing each original SQL statement as an XML configuration file.

本技术方案中,接收业务服务的调用指令的步骤之前还包括:对XML配置文件进行更新。In the technical solution, before the step of receiving the calling instruction of the business service, it also includes: updating the XML configuration file.

本技术方案中,根据完整SQL语句,在数据库中进行查询,获取查询结果的步骤之后还包括:将查询结果封装为Web service格式输出。In this technical solution, according to the complete SQL statement, the query is performed in the database, and after the step of obtaining the query result, it also includes: encapsulating the query result into a Web service format for output.

本技术方案中,在XML配置文件中,查询参数使用#paraml替代。In this technical solution, in the XML configuration file, the query parameter is replaced by #paraml.

本技术方案中,构造完整SQL语句的步骤中还包括:根据查询参数为空,自动添加过滤条件。In the technical solution, the step of constructing a complete SQL statement also includes: automatically adding filter conditions according to the query parameter being empty.

为实现上述目的,根据本发明的另一个方面,提供了一种基于SOA的数据访问装置,包括:接收模块,用于接收业务服务的调用指令,调用指令中包括:SQL ID和查询参数;解析模块,用于获取SQL ID对应的XML配置文件,根据XML配置文件解析SQL原始语句,拼装模块,用于根据SQL原始语句和查询参数,构造完整SQL语句;查询模块,用于根据完整SQL语句,在数据库中进行查询,获取查询结果。In order to achieve the above object, according to another aspect of the present invention, a kind of SOA-based data access device is provided, comprising: a receiving module, used to receive a calling instruction of business service, including: SQL ID and query parameter in the calling instruction; parsing The module is used to obtain the XML configuration file corresponding to the SQL ID, parse the original SQL statement according to the XML configuration file, and assemble the module to construct a complete SQL statement according to the original SQL statement and query parameters; the query module is used to construct a complete SQL statement based on the complete SQL statement. Perform a query in the database and obtain the query result.

本技术方案中,基于SOA的数据访问装置还可以包括:预处理模块,用于分配SQL ID给各查询服务对应的SQL原始语句,将各原始SQL语句写为XML配置文件。In this technical solution, the data access device based on SOA can also include: a preprocessing module, which is used to assign SQL IDs to the original SQL statements corresponding to each query service, and write each original SQL statement as an XML configuration file.

本发明各实施例的基于SOA的数据访问方法和装置,适合BPEL流程中的复杂与动态查询,弥补厂商提供的DB Adapter查询方式的不足。The SOA-based data access method and device of each embodiment of the present invention are suitable for complex and dynamic queries in the BPEL process, and make up for the deficiency of the DB Adapter query method provided by the manufacturer.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

附图说明Description of drawings

附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例共同用于解释本发明,并不构成对本发明的限制。在附图中;The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the description, and are used together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention. in the accompanying drawings;

图1为本发明实施例一基于SOA的数据访问方法的流程图;Fig. 1 is a flowchart of an SOA-based data access method according to an embodiment of the present invention;

图2为本发明实施例二基于SOA的数据访问方法系统结构的关系图;FIG. 2 is a relational diagram of the system structure of the SOA-based data access method in Embodiment 2 of the present invention;

图3为本发明实施例三基于SOA的数据访问方法的流程图;FIG. 3 is a flowchart of an SOA-based data access method according to Embodiment 3 of the present invention;

图4为本发明实施例四基于SOA的数据访问装置的示意图。结合附图在其上标记以下附图标记:FIG. 4 is a schematic diagram of an SOA-based data access device according to Embodiment 4 of the present invention. In conjunction with the accompanying drawings, the following reference numerals are marked thereon:

502-接收模块;  504-解析模块;506-拼装模块;508-查询模块;502-receiving module; 504-analysis module; 506-assembly module; 508-query module;

510-预处理模块;512-输出模块;514-更新模块。510-preprocessing module; 512-output module; 514-update module.

具体实施方式Detailed ways

以下结合附图对本发明的实施例进行说明,应当理解,此处所描述的实施例仅用于说明和解释本发明,并不用于限定本发明。Embodiments of the present invention will be described below in conjunction with the accompanying drawings. It should be understood that the embodiments described here are only used to illustrate and explain the present invention, and are not intended to limit the present invention.

实施例一Embodiment one

图1为本发明实施例一基于SOA的数据访问方法的流程图。如图1所示,本实施例包括:FIG. 1 is a flowchart of an SOA-based data access method according to an embodiment of the present invention. As shown in Figure 1, this embodiment includes:

步骤S102:接收业务服务的调用指令,调用指令中包括:SQL ID和查询参数;Step S102: Receive the calling instruction of the business service, the calling instruction includes: SQL ID and query parameters;

步骤S 104:获取SQL ID对应的XML配置文件,根据XML配置文件解析SQL原始语句;Step S 104: Obtain the XML configuration file corresponding to the SQL ID, and parse the original SQL statement according to the XML configuration file;

步骤S106:根据SQL原始语句和查询参数,构造完整SQL语句;Step S106: Construct a complete SQL statement according to the original SQL statement and query parameters;

步骤S108:根据完整SQL语句,在数据库中进行查询,获取查询结果。Step S108: Perform a query in the database according to the complete SQL statement to obtain a query result.

本实施例中,步骤S102之前还可以包括:分配SQL ID给各查询服务对应的SQL原始语句,将各原始SQL语句写为XML配置文件。SQL ID是代表SQL语句的唯一标识,系统根据SQL ID来寻找相应的SQL语句。In this embodiment, before step S102, it may also include: assigning SQL IDs to SQL original statements corresponding to each query service, and writing each original SQL statement as an XML configuration file. The SQL ID is the unique identifier representing the SQL statement, and the system searches for the corresponding SQL statement based on the SQL ID.

本实施例基于SOA的DAS数据访问服务实现方法,该方法可以作为SOA架构系统中的数据访问层,完成各类数据库查询操作。特别适合BPEL流程中的复杂与动态查询,弥补厂商提供的DB Adapter查询方式的不足,具有简单,方便,灵活等特点。This embodiment implements the SOA-based DAS data access service method, which can be used as the data access layer in the SOA architecture system to complete various database query operations. It is especially suitable for complex and dynamic queries in the BPEL process, making up for the lack of DB Adapter query methods provided by manufacturers, and has the characteristics of simplicity, convenience, and flexibility.

实施例二Embodiment two

图2为本发明实施例二基于SOA的数据访问方法系统结构的关系图。如图2所示,本实施例首先编写XML配置文件,XML配置文件保存了查询所需要的原始SQL语句信息,包括相关过滤条件信息;其次部署DAS服务,DAS服务内部程序分为四个主要部分,包括配置文件监控程序,XML文件解析程序,动态SQL语句构造程序,数据查询及绑定程序,外部请求发送过来后,DAS服务根据读取的原生SQL语句动态构造SQL语句,进行参数绑定;最后访问数据库,获取所需数据,按照Webservice标准格式进行输出。FIG. 2 is a relational diagram of the system structure of the SOA-based data access method according to Embodiment 2 of the present invention. As shown in Figure 2, this embodiment first writes the XML configuration file, the XML configuration file saves the original SQL statement information required by the query, including relevant filter condition information; secondly, deploys the DAS service, and the internal program of the DAS service is divided into four main parts , including configuration file monitoring program, XML file parsing program, dynamic SQL statement construction program, data query and binding program, after the external request is sent, the DAS service dynamically constructs the SQL statement according to the native SQL statement read, and performs parameter binding; Finally, access the database, obtain the required data, and output according to the Webservice standard format.

本实施例提供的基于SOA的数据访问方法具有如下优点:The SOA-based data access method provided in this embodiment has the following advantages:

1.基于XML的配置:DAS制定了一套XML规则,应用程序遵循此规则编写个性化的SQL配置文件,告知DAS如何从数据库中获取,解析,转换,删除,插入和更新数据。1. XML-based configuration: DAS has formulated a set of XML rules, and the application program follows this rule to write a personalized SQL configuration file to inform DAS how to obtain, parse, convert, delete, insert and update data from the database.

2.灵活的SQL语句构造:DAS规则定义下SQL文件涵盖了业界常用的不定参数的动态查询功能,并且设置了依据相关条件从DAS绑定的数据库中获取查询所需的配置信息,从而实现了动态查询的功能。2. Flexible SQL statement structure: The SQL file defined by DAS rules covers the dynamic query function of variable parameters commonly used in the industry, and sets the configuration information required for query from the database bound to DAS according to relevant conditions, thus realizing The function of dynamic query.

3.支持热部署:所有按照DAS规则编写的SQL文件,在DAS的上下文中都会被自动解析予以处理。同时,若需求发生变化,造成SQL文件变更,那么变更后的SQL配置文件不用重新部署DAS服务既可生效,DAS将自动检查修改的SQL文件语义,从而形成新的功能效应。3. Support hot deployment: All SQL files written according to DAS rules will be automatically parsed and processed in the context of DAS. At the same time, if the requirement changes and the SQL file is changed, the changed SQL configuration file will take effect without redeploying the DAS service. DAS will automatically check the semantics of the modified SQL file to form new functional effects.

4.数据动态绑定与转换:对于动态查询获得的结果集,DAS服务将按照外围系统接受调用返回的约束条件,使用XSLT技术进行动态转换,改善了Web服务输入输出固定格式的约束。4. Dynamic data binding and conversion: For the result set obtained by dynamic query, the DAS service will use XSLT technology to perform dynamic conversion according to the constraints of the peripheral system to accept the return of the call, which improves the constraints of the fixed format of the input and output of the Web service.

实施例三Embodiment Three

图3为本发明实施例三基于SOA的数据访问方法的流程图。如图3所示,本实施例包括预处理部分和响应处理部分,在实施例部分,同样给出了程序的原代码,为便于识别,用灰色背底显示。本实施例包括:FIG. 3 is a flowchart of an SOA-based data access method according to Embodiment 3 of the present invention. As shown in Figure 3, this embodiment includes a preprocessing part and a response processing part. In the embodiment part, the original code of the program is also given, which is displayed with a gray background for easy identification. This example includes:

预备部分:Preliminary part:

步骤S302:编写XML配置文件,将每个查询服务使用的SQL语句剥离,写入*.XML配置文件中,建议每个查询服务单独写一个配置文件,每一条SQL有ID唯一标志,查询参数在SQL中使用#PARAMETER1#替代;XML配置文件样例如下:Step S302: Write an XML configuration file, strip the SQL statement used by each query service, and write it into the *.XML configuration file. It is recommended to write a separate configuration file for each query service. Each SQL has a unique ID, and the query parameters are in Use #PARAMETER1# instead in SQL; the sample XML configuration file is as follows:

<SELECT ID=″SELECT_APINVOICE″>——命名SQL的唯一ID标志<SELECT ID="SELECT_APINVOICE">——name the unique ID mark of SQL

   <SQL DATACLASS=″COM.ZTE.EIP.ERP.DAS.RECORDDATA″>——以下为剥离出的<SQL DATACLASS="COM.ZTE.EIP.ERP.DAS.RECORDDATA">——The following are stripped out

SQL语句正文示例Example SQL statement body

     SELECT*SELECT*

     FROM AP_INVOICES_ALL INVFROM AP_INVOICES_ALL INV

     @END@———END为SQL拼装的关键字,对应下面的LABEL@END@———END is a keyword assembled by SQL, corresponding to the following LABEL

  </SQL></SQL>

  <APPENDSQL LABEL=″END″FRONTSQL=″WHERE″>——此处为条件语句的前缀<APPENDSQL LABEL="END" FRONTSQL="WHERE">——Here is the prefix of the conditional statement

     <IF APPENDSQL=″NOTNULLAPPENDSQL″PARAMETER=″PARAMETER1″>——<IF APPENDSQL="NOTNULLAPPENDSQL"PARAMETER="PARAMETER1">——

此处追加SQL前提条件,如果满足,则将SQL语句追加关键字位置,达到动态拼装SQL的效果Add the SQL precondition here, if it is satisfied, add the keyword position of the SQL statement to achieve the effect of dynamically assembling SQL

     INV.APIMPORT_HEADER_ATTRIBUTE2=#PARAMETER1#INV.APIMPORT_HEADER_ATTRIBUTE2=#PARAMETER1#

   </IF></IF>

  </APPENDSQL></APPENDSQL>

</SELECT></SELECT>

步骤S304:装载配置文件:后台监控进程自动监控配置文件所在目录,如果有更新自动读取XML配置文件,将配置文件内容更新到内存;Step S304: loading the configuration file: the background monitoring process automatically monitors the directory where the configuration file is located, and automatically reads the XML configuration file if there is an update, and updates the content of the configuration file to the memory;

响应处理部分:Response processing part:

步骤S306:DAS服务接收其他业务服务调用,获取查询对应得SQL语句ID和相关参数;Step S306: The DAS service receives other business service calls, and obtains the SQL statement ID and related parameters corresponding to the query;

示例代码:Sample code:

GETSQLFROMXML(″SELECT_APINVOICE″,″INV IMPORT″)GETSQLFROMXML("SELECT_APINVOICE", "INV IMPORT")

步骤S308:获取SQL ID对应的XML配置文件,根据XML配置文件解析SQL原始语句;Step S308: Obtain the XML configuration file corresponding to the SQL ID, and parse the original SQL statement according to the XML configuration file;

步骤S310:构造动态SQL:DAS服务根据输入参数和原始SQL语句,拼装出完整的SQL语句(如根据查询条件是否为空,自动添加AND过滤条件),最后将输入参数内容绑定到SQL语句,形成最终查询SQL语句;Step S310: Construct dynamic SQL: DAS service assembles a complete SQL statement according to the input parameters and the original SQL statement (such as automatically adding AND filter conditions according to whether the query condition is empty), and finally binds the input parameter content to the SQL statement, Form the final query SQL statement;

示例SQL:Example SQL:

SELECT*SELECT*

       FROM AP_INVOICES_ALL INVFROM AP_INVOICES_ALL INV

       WHERE INV.APIMPORT_HEADER_ATTRIBUTE2=‘INV IMPORT’WHERE INV.APIMPORT_HEADER_ATTRIBUTE2='INV IMPORT'

步骤S312:访问数据库:通过JDBC连接访问数据库,执行SQL语句,获取查询结果集;Step S312: Accessing the database: accessing the database through a JDBC connection, executing SQL statements, and obtaining query result sets;

步骤S314:数据绑定:从结果集中取出数据,并将数据封装成Java对象;Step S314: data binding: take out data from the result set, and encapsulate the data into Java objects;

示例对象:Example object:

Class ApInvoicesClass ApInvoices

{{

      Integer InvoiceID;Integer InvoiceID;

      String InvoiceNum;String InvoiceNum;

      Date createDate;Date createDate;

      ......

}}

步骤S316:数据输出:DAS的输出是一组不定长度的数组消息。Step S316: Data output: the output of the DAS is a group of array messages of variable length.

示例XML输出:Sample XML output:

<?xml version=″1.0″encoding=″ISO-8859-1″?><? xml version="1.0" encoding="ISO-8859-1"? >

......

   <ApInvoices><ApInvoices>

     <InvoiceID>168888</InvoiceID><InvoiceID>168888</InvoiceID>

     <InvoiceNum>LS20090101-00016</InvoiceNum><InvoiceNum>LS20090101-00016</InvoiceNum>

   <createDate>2009-01-01 10:10:10</createDate><createDate>2009-01-01 10:10:10</createDate>

</ApInvoices></ApInvoices>

<ApInvoices><ApInvoices>

    <InvoiceID>168889</InvoiceID><InvoiceID>168889</InvoiceID>

    <InvoiceNum>LS20090101-00019</InvoiceNum><InvoiceNum>LS20090101-00019</InvoiceNum>

  <createDate>2009-01-01 10:12:10</createDate><createDate>2009-01-01 10:12:10</createDate>

</ApInvoices></ApInvoices>

......

本实施例提出了一种基于SOA的数据访问方法,该方法是对OSOADAS以及SDO标准规范加以裁剪后设计实现的。该方法是一个以Java语言为基础,严格遵守JAX-RPC规范编写的Web服务,提供了一套动态查询,数据转换和传输的方案。This embodiment proposes an SOA-based data access method, which is designed and implemented after tailoring OSOADAS and SDO standard specifications. This method is a web service based on the Java language and written in strict compliance with the JAX-RPC specification, and provides a set of dynamic query, data conversion and transmission solutions.

本实施例提出的方法可以实现访问数据库的公用查询修改,输入输出采用XML格式,可以作为SOA架构系统中的数据访问层,完成各类数据库查询与修改操作。特别适合BPEL流程中的复杂与动态查询,弥补厂商提供的DB Adapter查询方式的不足。具有简单,方便,灵活,支持热部署等特点。The method proposed in this embodiment can implement public query and modification of access databases, and the input and output adopt XML format, which can be used as the data access layer in the SOA architecture system to complete various database query and modification operations. It is especially suitable for complex and dynamic queries in the BPEL process, making up for the lack of DB Adapter query methods provided by manufacturers. It is simple, convenient, flexible, and supports hot deployment.

实施例四Embodiment Four

图4为本发明实施例四基于SOA的数据访问装置的示意图。本实施例中的装置,包括:接收模块502,用于接收业务服务的调用指令,调用指令中包括:SQL ID和查询参数;解析模块504,用于获取SQL ID对应的XML配置文件,根据XML配置文件解析SQL原始语句;拼装模块506,用于根据SQL原始语句和查询参数,构造完整SQL语句;查询模块508,用于根据完整SQL语句,在数据库中进行查询,获取查询结果。FIG. 4 is a schematic diagram of an SOA-based data access device according to Embodiment 4 of the present invention. The device in this embodiment includes: a receivingmodule 502 for receiving a calling instruction of a business service, and the calling instruction includes: SQL ID and query parameters; aparsing module 504 for obtaining an XML configuration file corresponding to the SQL ID, according to XML The configuration file parses the original SQL statement; theassembly module 506 is used to construct a complete SQL statement according to the original SQL statement and query parameters; thequery module 508 is used to query the database according to the complete SQL statement and obtain the query result.

此外,本实施例还可以包括:预处理模块510,用于分配SQL ID给各查询服务对应的SQL原始语句,将各原始SQL语句写为XML配置文件;输出模块512,用于将查询结果封装为Webservice格式输出;更新模块514,用于对XML配置文件进行实时更新。In addition, the present embodiment may also include: apreprocessing module 510, configured to assign SQL IDs to the original SQL statements corresponding to each query service, and write each original SQL statement as an XML configuration file; anoutput module 512, configured to encapsulate the query results The output is in Webservice format; theupdate module 514 is used to update the XML configuration file in real time.

本实施例实现的方法可参照实施例一-四的相关说明,并具有上述实施例的全部有益效果,此处不再重述。The method implemented in this embodiment can refer to the relevant descriptions of Embodiments 1-4, and has all the beneficial effects of the above embodiments, and will not be repeated here.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟、光盘、网络节点、调度器等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned programs can be stored in a readable storage medium. The steps of the method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk, optical disk, network node, scheduler and other various media that can store program codes.

最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明,尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。Finally, it should be noted that: the above is only a preferred embodiment of the present invention, and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, it still The technical solutions recorded in the foregoing embodiments may be modified, or some technical features thereof may be equivalently replaced. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (10)

CN2009102440753A2009-12-282009-12-28Method and device for data access based on SOA (Service-Oriented Architecture)PendingCN102110110A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN2009102440753ACN102110110A (en)2009-12-282009-12-28Method and device for data access based on SOA (Service-Oriented Architecture)

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN2009102440753ACN102110110A (en)2009-12-282009-12-28Method and device for data access based on SOA (Service-Oriented Architecture)

Publications (1)

Publication NumberPublication Date
CN102110110Atrue CN102110110A (en)2011-06-29

Family

ID=44174273

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN2009102440753APendingCN102110110A (en)2009-12-282009-12-28Method and device for data access based on SOA (Service-Oriented Architecture)

Country Status (1)

CountryLink
CN (1)CN102110110A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102495885A (en)*2011-12-082012-06-13中国信息安全测评中心Method for integrating information safety data based on base-networking engine
CN102567517A (en)*2011-12-282012-07-11用友软件股份有限公司Device and method for issuing data of database
CN103117983A (en)*2011-11-162013-05-22中国移动通信集团公司Data service request response method and data service protocol stack
CN103514185A (en)*2012-06-202014-01-15北京四维图新科技股份有限公司Method and device for managing access to database files in multiple updated areas of navigation map
CN104346378A (en)*2013-07-312015-02-11腾讯科技(深圳)有限公司Method, device and system for realizing processing of complex data
CN105447009A (en)*2014-08-122016-03-30阿里巴巴集团控股有限公司Method and device for generating query strings
CN106020847A (en)*2016-06-062016-10-12北京京东尚科信息技术有限公司Method and device for configuring SQL for persistent layer development framework
CN106843984A (en)*2017-02-132017-06-13东软集团股份有限公司The update method and device of application database
CN106897343A (en)*2016-07-202017-06-27阿里巴巴集团控股有限公司The lookup method of executive plan, storage method and device
CN108932284A (en)*2018-05-222018-12-04中国银行股份有限公司Generic logic dispatching method, electronic equipment and readable storage medium storing program for executing
CN109033381A (en)*2018-07-272018-12-18郑州云海信息技术有限公司A kind of execution method, device and equipment of service request
CN110309365A (en)*2019-04-092019-10-08长飞光纤光缆股份有限公司A kind of openstack data query method and apparatus realized based on Mybatis
CN111078702A (en)*2019-12-172020-04-28南京南瑞继保工程技术有限公司SQL sentence classification management and unified query method and device
CN111339128A (en)*2018-12-182020-06-26北京嘀嘀无限科技发展有限公司Data acquisition method and device, electronic equipment and storage medium
CN111666293A (en)*2019-03-052020-09-15北京京东尚科信息技术有限公司Database access method and device
CN111966512A (en)*2020-08-212020-11-20西安寰宇卫星测控与数据应用有限公司Webservice universal method and device for accessing database, computer equipment and storage medium
CN111984666A (en)*2019-05-232020-11-24北京数聚鑫云信息技术有限公司Database access method and device, computer readable storage medium and computer equipment
CN112015752A (en)*2020-08-312020-12-01杭州小电科技股份有限公司Method and device for dynamically querying data, electronic equipment and storage medium
CN113392122A (en)*2021-06-092021-09-14北京同创永益科技发展有限公司Method for separating and operating HQL based on Mybatis framework
CN113821557A (en)*2021-09-242021-12-21四川新网银行股份有限公司Method for data interaction between Web page and back end
CN117171194A (en)*2023-08-252023-12-05浪潮软件科技有限公司SQL query engine based on JDBC

Cited By (32)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103117983A (en)*2011-11-162013-05-22中国移动通信集团公司Data service request response method and data service protocol stack
CN103117983B (en)*2011-11-162015-11-04中国移动通信集团公司 Data service request response method and design method of data service protocol stack
CN102495885B (en)*2011-12-082017-03-22中国信息安全测评中心Method for integrating information safety data based on base-networking engine
CN102495885A (en)*2011-12-082012-06-13中国信息安全测评中心Method for integrating information safety data based on base-networking engine
CN102567517A (en)*2011-12-282012-07-11用友软件股份有限公司Device and method for issuing data of database
CN103514185B (en)*2012-06-202017-09-29北京四维图新科技股份有限公司The database file access management method and device of the multiple update area of navigation map
CN103514185A (en)*2012-06-202014-01-15北京四维图新科技股份有限公司Method and device for managing access to database files in multiple updated areas of navigation map
CN104346378A (en)*2013-07-312015-02-11腾讯科技(深圳)有限公司Method, device and system for realizing processing of complex data
CN104346378B (en)*2013-07-312019-02-05腾讯科技(深圳)有限公司A kind of method, apparatus and system for realizing complex data processing
CN105447009A (en)*2014-08-122016-03-30阿里巴巴集团控股有限公司Method and device for generating query strings
CN106020847A (en)*2016-06-062016-10-12北京京东尚科信息技术有限公司Method and device for configuring SQL for persistent layer development framework
CN106897343A (en)*2016-07-202017-06-27阿里巴巴集团控股有限公司The lookup method of executive plan, storage method and device
CN106843984A (en)*2017-02-132017-06-13东软集团股份有限公司The update method and device of application database
CN108932284A (en)*2018-05-222018-12-04中国银行股份有限公司Generic logic dispatching method, electronic equipment and readable storage medium storing program for executing
CN108932284B (en)*2018-05-222020-11-24中国银行股份有限公司General logic scheduling method, electronic device and readable storage medium
CN109033381A (en)*2018-07-272018-12-18郑州云海信息技术有限公司A kind of execution method, device and equipment of service request
CN111339128A (en)*2018-12-182020-06-26北京嘀嘀无限科技发展有限公司Data acquisition method and device, electronic equipment and storage medium
CN111339128B (en)*2018-12-182023-09-26北京嘀嘀无限科技发展有限公司Data acquisition method and device, electronic equipment and storage medium
CN111666293A (en)*2019-03-052020-09-15北京京东尚科信息技术有限公司Database access method and device
CN110309365B (en)*2019-04-092023-07-25长飞光纤光缆股份有限公司Openstack data query method and device based on Mybatis
CN110309365A (en)*2019-04-092019-10-08长飞光纤光缆股份有限公司A kind of openstack data query method and apparatus realized based on Mybatis
CN111984666B (en)*2019-05-232024-03-29北京数聚鑫云信息技术有限公司Database access method, apparatus, computer readable storage medium and computer device
CN111984666A (en)*2019-05-232020-11-24北京数聚鑫云信息技术有限公司Database access method and device, computer readable storage medium and computer equipment
CN111078702A (en)*2019-12-172020-04-28南京南瑞继保工程技术有限公司SQL sentence classification management and unified query method and device
CN111078702B (en)*2019-12-172022-08-26南京南瑞继保工程技术有限公司SQL sentence classification management and unified query method and device
CN111966512A (en)*2020-08-212020-11-20西安寰宇卫星测控与数据应用有限公司Webservice universal method and device for accessing database, computer equipment and storage medium
CN112015752A (en)*2020-08-312020-12-01杭州小电科技股份有限公司Method and device for dynamically querying data, electronic equipment and storage medium
CN113392122B (en)*2021-06-092022-03-11北京同创永益科技发展有限公司Method for separating and operating HQL based on Mybatis framework
CN113392122A (en)*2021-06-092021-09-14北京同创永益科技发展有限公司Method for separating and operating HQL based on Mybatis framework
CN113821557A (en)*2021-09-242021-12-21四川新网银行股份有限公司Method for data interaction between Web page and back end
CN113821557B (en)*2021-09-242023-06-13四川新网银行股份有限公司Method for carrying out data interaction between Web page and back end
CN117171194A (en)*2023-08-252023-12-05浪潮软件科技有限公司SQL query engine based on JDBC

Similar Documents

PublicationPublication DateTitle
CN102110110A (en)Method and device for data access based on SOA (Service-Oriented Architecture)
US7343428B2 (en)Dynamic, real-time integration of software resources through services of a content framework
US9804837B2 (en)System and method for creating, managing, and reusing schema type definitions in services oriented architecture services, grouped in the form of libraries
US7266600B2 (en)Programmatic management of software resources in a content framework environment
US6836890B1 (en)Methods and systems for message translation and parsing of data structures in a distributed component architecture
CN101546260B (en)Method and device thereof for reconstructing service-oriented applications
US20030055868A1 (en)Building distributed software services as aggregations of other services
US20010039540A1 (en)Method and structure for dynamic conversion of data
US7240101B2 (en)Method and apparatus for efficiently reflecting complex systems of objects in XML documents
EP2042989A1 (en)System and method for extending a component-based application platform with custom services
US20050114394A1 (en)Mapping XML schema components to qualified Java components
JP2007508602A (en) General application network architecture
CN105049256B (en)A kind of general self defined interface message realization method and system
CN101853156B (en)Method for realizing web service call in component-based software system
CN110955674A (en)Asynchronous export method and component based on java service
CA2495396C (en)System and method for customized provisioning of application content
KR100880536B1 (en) Open framework system for heterogeneous computing and service integration
CN109298954A (en)A kind of intelligence calls the method and device of Dubbo remote service
Cavalieri et al.Towards interoperability between OPC UA and OCF
JP4099948B2 (en) System, method and program for mapping structured document to structure data in programming language
CN111611011B (en)JSON syntax extension method and analysis method and device supporting Blob data types
KR100670605B1 (en) Multimedia contents service system and method and recording medium thereof
US6898792B1 (en)Foreign object definition information repository
Oh et al.Manufacturing interoperability using a semantic mediation
CN100570553C (en) Terminal and method for providing dynamic interaction between a pair of applications

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C12Rejection of a patent application after its publication
RJ01Rejection of invention patent application after publication

Application publication date:20110629


[8]ページ先頭

©2009-2025 Movatter.jp