CN100587693C - Method and system for obtaining data from multiple data sources - Google Patents

Method and system for obtaining data from multiple data sources Download PDF

Info

Publication number
CN100587693C
CN100587693C CN200710166035A CN200710166035A CN100587693C CN 100587693 C CN100587693 C CN 100587693C CN 200710166035 A CN200710166035 A CN 200710166035A CN 200710166035 A CN200710166035 A CN 200710166035A CN 100587693 C CN100587693 C CN 100587693C
Authority
CN
China
Prior art keywords
entity
attribute
structure tree
attributes
data
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
CN200710166035A
Other languages
Chinese (zh)
Other versions
CN101145163A (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.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China 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 Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN200710166035A priority Critical patent/CN100587693C/en
Publication of CN101145163A publication Critical patent/CN101145163A/en
Application granted granted Critical
Publication of CN100587693C publication Critical patent/CN100587693C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种从多个数据源获取数据的方法及系统,解决目前采用固定代码获取数据的方式存在灵活性差的问题。所述方法包括:获取实体文件;从实体文件获取实体的所有属性,其中所述实体属性称为数据源;解析实体属性,构建出实体结构树,并显示;查询所述实体结构树,从选中的数据源获取实体属性值。通过本发明,用户可以根据需求灵活定义实体属性与业务参数的对应关系,在运行所述业务参数时根据定义的对应关系,通过一种“拉”的主动方式从实体中抽取对应的属性值,组成业务参数,从而无需通过固定编码就实现了业务控制的可变性。

The invention discloses a method and system for obtaining data from multiple data sources, which solves the problem of poor flexibility in the current method of obtaining data by using fixed codes. The method includes: obtaining an entity file; obtaining all attributes of the entity from the entity file, wherein the entity attribute is called a data source; parsing the entity attribute, constructing an entity structure tree, and displaying it; querying the entity structure tree, and selecting The data source to get entity property values. Through the present invention, users can flexibly define the corresponding relationship between entity attributes and business parameters according to requirements, and extract corresponding attribute values from entities in an active way of "pull" according to the defined corresponding relationship when running the business parameters. Composition of business parameters, so as to realize the variability of business control without fixed coding.

Description

从多个数据源获取数据的方法及系统 Method and system for obtaining data from multiple data sources

技术领域 technical field

本发明涉及计算机数据处理技术,特别是涉及一种从多个数据源获取数据的方法及系统。The invention relates to computer data processing technology, in particular to a method and system for acquiring data from multiple data sources.

背景技术 Background technique

在业务应用系统的数据处理过程中,常常需要从多个数据源获取数据来进行处理。例如在财务应用方面,很多业务单据都需要进行预算控制,预算控制系统就是通过处理单据的预算数据来实现预算控制功能。预算控制系统中根据业务情况定义了预算控制时需要的预算控制参数,分别对应业务单据的一些属性信息,当执行预算处理时,需要从业务单据中获取对应预算控制参数的属性信息,组成预算控制参数,进行预算控制处理。In the data processing process of the business application system, it is often necessary to obtain data from multiple data sources for processing. For example, in financial applications, many business documents require budget control, and the budget control system realizes the budget control function by processing the budget data of documents. In the budget control system, budget control parameters required for budget control are defined according to business conditions, which correspond to some attribute information of business documents. When performing budget processing, attribute information corresponding to budget control parameters needs to be obtained from business documents to form budget control Parameters for budget control processing.

例如所述预算控制参数包括预算组织、预算项目、预算要素、预算期间、币别,分别对应单据所属的组织、业务项目、预算的种类、业务发生日期、币种信息。当对该单据进行预算控制时,预算控制系统根据这种映射关系查找单据中对应的预算数据,再根据一定的规则来控制该单据的特定操作(比如付款)是否满足发生的条件,从而做出相应的决策,比如预算充足则扣减预算,单据进入下一个业务处理环节,如果预算不足则返回进行人工决策等。For example, the budget control parameters include budget organization, budget item, budget element, budget period, and currency, which respectively correspond to the organization, business item, budget type, business occurrence date, and currency information of the document. When performing budget control on the document, the budget control system searches for the corresponding budget data in the document according to the mapping relationship, and then controls whether the specific operation of the document (such as payment) meets the occurrence conditions according to certain rules, and then makes a decision. Corresponding decision-making, such as deducting the budget if the budget is sufficient, the document enters the next business processing link, and returning to manual decision-making if the budget is insufficient.

在上述预算控制的示例中,业务单据作为数据源用于向预算控制系统提供预算数据,其中,单据的各种属性信息都可作为预算控制参数的数据源。如果单据需要参与预算控制,现有的实现方式是采用代码方式实现,通过在单据所在的业务系统中加入查找预算数据的功能实现,即由各个业务单据开发团队各自完成业务单据查找预算的全过程。这种在程序中通过固定代码获取单据上的属性来组成预算控制参数的方式,是一种被动的“推”的方式,存在以下几个缺点:In the above example of budget control, the business document is used as a data source to provide budget data to the budget control system, wherein various attribute information of the document can be used as a data source of budget control parameters. If the document needs to participate in budget control, the existing implementation method is implemented by code, by adding the function of finding budget data in the business system where the document is located, that is, each business document development team completes the whole process of business document search budget . This method of obtaining attributes on documents through fixed codes to form budget control parameters in the program is a passive "push" method, which has the following disadvantages:

其一,预算控制的可变性很差,无法适应需求的变化,因为控制逻辑固定在代码里。例如在凭证单据中,组成预算项目的来源可能有:科目、科目+物料、科目+组织等等很多不同形式,如果通过代码来完成这些组合将非常困难,因为代码中不能一一进行穷举,组合相对固定,一旦用户需要的组合不在代码编写的组合之中,就得重新修改代码,维护代价很大;First, budgetary control has poor variability and cannot adapt to changing requirements because the control logic is fixed in code. For example, in a voucher document, the source of the budget item may have many different forms: account, account + material, account + organization, etc. It will be very difficult to complete these combinations through code, because the code cannot exhaustively enumerate one by one. The combination is relatively fixed. Once the combination that the user needs is not in the combination written by the code, the code has to be re-modified, and the maintenance cost is very high;

其二,开发工作量大,即所有启用预算控制的模块都要各自编写和预算控制相关代码;Second, the development workload is heavy, that is, all modules that enable budget control must write codes related to budget control;

其三,对各个业务系统的开发人员的预算业务知识要求很高,他们必须清楚了解很多预算模块的细节,否则开发无法进行;Third, the budget business knowledge requirements of developers of various business systems are very high. They must clearly understand the details of many budget modules, otherwise the development cannot be carried out;

其四,各个业务系统和预算控制系统的代码耦合性很强,导致预算系统进行重构非常困难。Fourth, the codes of various business systems and budget control systems are highly coupled, making it very difficult to reconstruct the budget system.

发明内容 Contents of the invention

本发明所要解决的技术问题是提供从多个数据源获取数据的方法及系统,以解决目前采用固定代码获取数据的方式所存在的问题。The technical problem to be solved by the present invention is to provide a method and a system for obtaining data from multiple data sources, so as to solve the problems existing in the current method of obtaining data by using fixed codes.

为解决上述技术问题,根据本发明提供的具体实施例,本发明公开了以下技术方案:In order to solve the above technical problems, according to the specific embodiments provided by the invention, the invention discloses the following technical solutions:

从多个数据源获取数据的方法,包括:Methods for obtaining data from multiple data sources, including:

获取实体文件;Get the entity file;

从实体文件获取实体的所有属性,其中所述实体属性称为数据源;Get all the properties of the entity from the entity file, where said entity properties are called data sources;

解析实体属性,构建出实体结构树,并显示;具体包括:预定义访问实体的规则;根据所述规则分析实体属性性质;根据所述属性性质构建实体结构树;并根据所述规则保存解析好的实体信息;Analyzing entity attributes, building an entity structure tree, and displaying it; specifically including: predefining rules for accessing entities; analyzing entity attribute properties according to the rules; constructing entity structure trees according to the attribute properties; and saving the parsed file according to the rules entity information;

查询所述实体结构树,从选中的数据源获取实体属性值。The entity structure tree is queried to obtain entity attribute values from the selected data source.

其中,按照以下步骤从选中的数据源获取实体属性值:选择实体属性建立与业务参数的映射关系;当执行所述业务参数时,根据所述映射关系获取对应的实体属性值。Wherein, the entity attribute value is obtained from the selected data source according to the following steps: select the entity attribute to establish a mapping relationship with the business parameter; when executing the business parameter, obtain the corresponding entity attribute value according to the mapping relationship.

从多个数据源获取数据的系统,包括:A system that acquires data from multiple sources, including:

通用接口,用于预定义访问实体的规则;实体解析单元,用于获取实体文件;从实体文件获取实体的所有属性,其中所述实体属性称为数据源;解析实体属性,构建出实体结构树,具体包括:根据通用接口定义的规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存;The general interface is used to predefine the rules for accessing entities; the entity parsing unit is used to obtain entity files; obtain all attributes of entities from entity files, wherein the entity attributes are called data sources; parse entity attributes to build entity structure trees , specifically includes: analyzing entity attribute properties according to the rules defined by the general interface, constructing an entity structure tree according to the attribute properties, and saving the parsed entity information according to the rules;

交互单元,用于显示所述实体结构树,并提供查询实体结构树的功能;An interactive unit, configured to display the entity structure tree and provide a function of querying the entity structure tree;

数据获取单元,用于从选中的数据源获取实体属性值。The data acquisition unit is used to acquire entity attribute values from the selected data source.

其中,所述通用接口可扩展。Wherein, the general interface can be extended.

其中,所述交互单元在提供查询功能时,建立选中的实体属性与业务参数的映射关系;当执行该业务参数时,数据获取单元根据所述映射关系从相应数据源获取实体属性值。Wherein, the interaction unit establishes the mapping relationship between the selected entity attribute and the business parameter when providing the query function; when executing the business parameter, the data acquisition unit acquires the entity attribute value from the corresponding data source according to the mapping relationship.

从多个数据源获取数据的系统,包括:客户端和服务器,所述客户端用于向服务器发起数据获取请求,所述服务器用于从多个数据源获取数据并返回;其中所述服务器端包括实体解析引擎,用于获取实体文件并从中获取实体的所有属性,解析实体属性,构建出实体结构树,其中所述实体属性称为数据源;所述客户端通过用户界面将所述实体结构树显示;还包括解析器,用于根据客户端请求调用服务器端的实体解析引擎解析实体,并根据用户在实体结构树中选择的实体属性从服务器端获取相应的属性值;A system for obtaining data from multiple data sources, including: a client and a server, the client is used to initiate a data acquisition request to the server, and the server is used to obtain data from multiple data sources and return; wherein the server It includes an entity resolution engine, which is used to obtain entity files and obtain all attributes of entities therefrom, resolve entity attributes, and build entity structure trees, wherein the entity attributes are called data sources; the client uses the user interface to convert the entity structure Tree display; also includes a parser, which is used to call the entity resolution engine on the server side to resolve entities according to the client request, and obtain the corresponding attribute value from the server side according to the entity attribute selected by the user in the entity structure tree;

其中,所述实体解析引擎解析实体属性,构建出实体结构树,具体包括:根据预定义的访问实体的规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存。Wherein, the entity parsing engine parses entity attributes and constructs an entity structure tree, which specifically includes: analyzing entity attribute properties according to predefined rules for accessing entities, constructing an entity structure tree according to attribute properties, and constructing an entity structure tree according to the rules. Entity information is saved.

从多个数据源获取数据的系统,包括:客户端和服务器,所述客户端用于向服务器发起数据获取请求,所述服务器通过组件从多个数据源获取数据并返回给客户端;A system for acquiring data from multiple data sources, including: a client and a server, the client is used to initiate a data acquisition request to the server, and the server acquires data from multiple data sources through components and returns them to the client;

其中,所述组件包括实体解析引擎,用于获取实体文件并从中获取实体的所有属性,解析实体属性,构建出实体结构树,其中所述实体属性称为数据源;客户端界面,负责与用户交互,并将所述实体结构树显示给用户;解析器,用于根据客户端请求调用所述实体解析引擎解析实体,并根据用户在实体结构树中选择的实体属性从服务器端获取相应的属性值;Wherein, the component includes an entity parsing engine, which is used to obtain entity files and obtain all attributes of entities therefrom, parse entity attributes, and build entity structure trees, wherein the entity attributes are called data sources; client interface is responsible for communicating with users interact, and display the entity structure tree to the user; the resolver is used to call the entity resolution engine to resolve the entity according to the client request, and obtain the corresponding attribute from the server according to the entity attribute selected by the user in the entity structure tree value;

其中,所述实体解析引擎解析实体属性,构建出实体结构树,具体包括:根据预定义的访问实体的规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存。Wherein, the entity parsing engine parses entity attributes and constructs an entity structure tree, which specifically includes: analyzing entity attribute properties according to predefined rules for accessing entities, constructing an entity structure tree according to attribute properties, and constructing an entity structure tree according to the rules. Entity information is saved.

根据本发明提供的具体实施例,本发明公开了以下技术效果:According to the specific embodiments provided by the invention, the invention discloses the following technical effects:

首先,获取实体文件并取得实体的所有属性,其中所述实体属性称为数据源,然后解析所述实体属性构建出实体结构树并显示给用户,用户可以根据需求灵活定义实体属性(如单据属性)与业务参数(如预算控制参数)的对应关系;在运行所述业务参数时根据定义的对应关系,通过一种“拉”的主动方式从实体(如单据)中抽取对应的属性值,组成业务参数(预算控制参数),从而无需通过固定编码就实现了预算控制的可变性。First, obtain the entity file and obtain all the attributes of the entity, wherein the entity attribute is called a data source, and then parse the entity attribute to construct an entity structure tree and display it to the user. The user can flexibly define the entity attribute according to the requirement (such as the document attribute ) and business parameters (such as budget control parameters); according to the defined correspondence when running the business parameters, the corresponding attribute values are extracted from entities (such as documents) through a "pull" active way to form Business parameters (budget control parameters), thereby realizing the variability of budget control without fixed coding.

其次,大大减少了代码量,代码维护小。Secondly, the amount of code is greatly reduced, and the code maintenance is small.

再次,由于为用户提供了灵活设定单据属性与预算控制参数的界面,所以预算控制系统从单据获取数据的功能从原来的各个业务系统分离出来,提供了统一的平台,开发人员无需再了解相关的预算业务知识,因此降低了对开发人员的要求。Thirdly, since the user is provided with an interface for flexibly setting document attributes and budget control parameters, the function of obtaining data from documents in the budget control system is separated from the original business systems, providing a unified platform, and developers do not need to understand related budgetary business knowledge, thus reducing the requirements for developers.

最后,由于提供了一个统一的数据获取平台,所以极大地降低了各个业务系统与预算控制系统的代码耦合性,提供了预算控制系统的重构性。Finally, since a unified data acquisition platform is provided, the code coupling between each business system and the budget control system is greatly reduced, and the reconfiguration of the budget control system is provided.

附图说明 Description of drawings

图1是本发明实施例所述从多个数据源获取数据的方法流程图;FIG. 1 is a flowchart of a method for acquiring data from multiple data sources according to an embodiment of the present invention;

图2是本发明实施例中预算控制系统的配置界面示意图;Fig. 2 is a schematic diagram of a configuration interface of the budget control system in an embodiment of the present invention;

图3是本发明实施例中凭证单据的实体结构树示意图;Fig. 3 is a schematic diagram of the entity structure tree of the voucher document in the embodiment of the present invention;

图4是本发明实施例所述从多个数据源获取数据的系统结构框图。Fig. 4 is a structural block diagram of a system for acquiring data from multiple data sources according to an embodiment of the present invention.

具体实施方式 Detailed ways

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more comprehensible, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

本发明实施例提供了一种从多个数据源获取数据的方法,通过MDA模型驱动,定义了实体属性(即数据源)与业务参数的对应关系,在执行所述业务参数时动态根据定义的对应关系,通过一种“拉”的方式主动从实体中抽取对应的属性值,组成业务参数并进行后续处理,从而无需通过固定编码就实现了预算控制的可变性,从根本上改变了预算控制可变性,大大减少了代码量。The embodiment of the present invention provides a method for obtaining data from multiple data sources. Driven by the MDA model, the corresponding relationship between entity attributes (that is, data sources) and business parameters is defined, and the business parameters are dynamically executed according to the defined The corresponding relationship actively extracts the corresponding attribute values from the entity through a "pull" method, composes business parameters and performs subsequent processing, thereby realizing the variability of budget control without fixed coding, and fundamentally changing budget control Variability, greatly reducing the amount of code.

其中,上述MDA(Model Driven Architecture)是模型驱动架构,它是由OMG(Object Management Group,对象管理组织)定义的一个软件开发框架,把系统操作的规范从系统利用底层平台能力的方式细节中分离出来的思想,MDA提供了一种途径(通过相关的工具)来规范化一个平台独立的系统、规范化平台、为系统选择一个特定的实现平台,并且把系统规范转换到特定的实现平台。MDA的三个主要目标是:通过架构性的分离来实现轻便性、互操作性和可重用性。本发明实施例所述方法即以模型驱动的思想为基础,下面将仍以预算控制为例进行说明。Among them, the above-mentioned MDA (Model Driven Architecture) is a model-driven architecture, which is a software development framework defined by OMG (Object Management Group, Object Management Organization), which separates the specification of system operation from the details of how the system utilizes the capabilities of the underlying platform Out of the idea, MDA provides a way (through related tools) to standardize a platform-independent system, standardize the platform, select a specific implementation platform for the system, and convert the system specification to the specific implementation platform. The three main goals of MDA are: portability, interoperability, and reusability through architectural separation. The method described in the embodiment of the present invention is based on the idea of model-driven, and the following will still use budget control as an example for illustration.

为便于理解本发明的技术方案,首先介绍预算控制的处理方式。在进行预算控制时,如果单据要参与预算,则通过MDA模型驱动,用户需要在系统提供的定义界面里选出进行预算控制的是哪个系统的哪种单据,然后选出预算控制参数--预算组织、预算项目、币别、时间、业务申请值等分别对应单据的哪些字段。预算控制系统会根据用户的配置从相应单据中抽取信息,组装成预算控制参数,进行预算控制。在这个过程中,本发明与现有技术的根本区别在于设置预算控制参数与单据属性对应关系的方式不同,现有技术是通过固定编码方式实现,而本发明是将这项配置功能在客户端前台实现,用户可以根据需要灵活进行配置。In order to facilitate the understanding of the technical solution of the present invention, the processing method of budget control is firstly introduced. When performing budget control, if the document is to participate in the budget, it is driven by the MDA model. The user needs to select in the definition interface provided by the system which system and which document is subject to budget control, and then select the budget control parameter -- budget Which fields of the document correspond to organization, budget item, currency, time, business application value, etc. The budget control system will extract information from corresponding documents according to the user's configuration, and assemble them into budget control parameters for budget control. In this process, the fundamental difference between the present invention and the prior art lies in the way of setting the corresponding relationship between budget control parameters and document attributes. The prior art implements this through fixed coding, but the present invention implements this configuration function on the client The foreground is implemented, and users can flexibly configure it according to their needs.

下面将详细说明如何将配置功能面向用户实现。参照图1,是所述从多个数据源获取数据的方法流程图。本发明实施例中,预算控制系统的应用环境包括客户端和服务器端,在客户端提供了预算控制参数的配置界面,当用户需要选择单据参与预算控制时,进入配置界面通过客户端向服务器发起请求,服务器端将执行以下步骤:The following will describe in detail how to implement the configuration function for users. Referring to FIG. 1 , it is a flow chart of the method for acquiring data from multiple data sources. In the embodiment of the present invention, the application environment of the budget control system includes a client and a server. The client provides a configuration interface for budget control parameters. When a user needs to select a document to participate in budget control, the user enters the configuration interface and initiates a transaction to the server through the client. request, the server will perform the following steps:

步骤101,根据请求获取实体文件。Step 101, obtain the entity file according to the request.

在基于MDA模型驱动的系统中,单据即为实体数据,实体数据以文件形式存储,一般以“.entity”为扩展名称,对应一个业务单据实体。用户会在配置界面首先设置需要从哪个系统的哪个单据进行预算控制,服务器端根据用户设置从相应的业务系统获取相应的实体文件。In the system driven by the MDA model, the document is the entity data, and the entity data is stored in the form of a file, generally with ".entity" as the extension name, corresponding to a business document entity. The user will first set which document of which system needs to be used for budget control on the configuration interface, and the server side will obtain the corresponding entity file from the corresponding business system according to the user's settings.

配置界面可参照图2所示,用户进入界面选择的业务系统为“管理会计”,业务单据为“差旅费用报销单”,这两个选项在预算控制系统中对应的控制参数为预算组织。The configuration interface can be shown in Figure 2. The business system selected by the user in the interface is "management accounting", and the business document is "travel expense reimbursement form". The corresponding control parameters of these two options in the budget control system are budget organization.

步骤102,从实体文件中获取实体的所有属性。例如在单据实体中,包含多个属性信息,如科目、物料等,这些属性信息构成预算控制参数的数据源。根据预算控制需求,预算控制系统需要从多个数据源,即多个实体属性中抽取数据来组成控制参数。Step 102, obtain all attributes of the entity from the entity file. For example, the document entity contains multiple attribute information, such as account, material, etc., and these attribute information constitute the data source of budget control parameters. According to the needs of budget control, the budget control system needs to extract data from multiple data sources, that is, multiple entity attributes to form control parameters.

步骤103,解析得到的实体属性,构建出实体结构树,并在客户端显示。Step 103, parse the obtained entity attributes, construct an entity structure tree, and display it on the client.

所述实体结构树按照实体在业务系统中的结构,以可视化的窗口展现给用户。参照图3所示,是一个凭证单据的实体结构树示意图,该凭证单据包括“过账”、“出纳”、“分录”等子属性,而每个子属性又包含若干个属性,以层级目录的方式显示。The entity structure tree is displayed to the user in a visual window according to the structure of the entity in the business system. Referring to Figure 3, it is a schematic diagram of the entity structure tree of a voucher document. The voucher document includes sub-attributes such as "posting", "cashier", and "entry", and each sub-attribute contains several attributes. way to display.

本实施例提供了一种根据实体属性构建实体结构树的方法,预先定义访问实体的通用规则,该规则定义了如何获取实体属性中的字段名称、字段类型、判断是否具有字段别名、是否含有叶结点等方法,然后根据所述规则解析实体属性,从而构建出实体结构树。具体步骤包括:首先构建根结点,然后根据步骤102解析实体文件取得的所有属性,分析属性性质,如果当前属性无孩子,则加入实体对象内;如果当前属性有孩子,则说明该孩子是这个属性的一个关联属性(如图3中“分录”属性即为“凭证”实体的一个关联属性),首先在实体对象内加入一个虚结点,然后根据关联关系取得孩子实体继续分析,如此递归下去,构建出一棵实体结构树。其中,所述实体对象用于按照上述规则存放解析好的实体信息(如字段名称等信息)。当然,也可以采用其他方法解析实体并构建实体结构树。This embodiment provides a method for constructing an entity structure tree according to entity attributes, and predefines general rules for accessing entities. The rules define how to obtain field names and field types in entity attributes, determine whether they have field aliases, and Node and other methods, and then analyze the entity attributes according to the rules, so as to construct the entity structure tree. The specific steps include: first build the root node, then analyze all the attributes obtained by the entity file according to step 102, and analyze the attribute properties. If the current attribute has no children, then add it to the entity object; if the current attribute has children, it means that the child is this An associated attribute of an attribute (the "entry" attribute in Figure 3 is an associated attribute of the "voucher" entity), first add a virtual node in the entity object, and then obtain the child entity according to the association relationship to continue the analysis, so recursively Go down and build an entity structure tree. Wherein, the entity object is used to store parsed entity information (such as field name and other information) according to the above rules. Of course, other methods can also be used to parse entities and build entity structure trees.

步骤104,查询所述实体结构树,从选中的数据源获取实体属性值。Step 104, query the entity structure tree, and obtain entity attribute values from the selected data source.

参照图3所示的实体结构树,用户可以在弹出的“源单据属性选择”窗口中选择凭证单据的各个属性来对应预算控制系统的预算项目、币别、时间等控制参数。例如,选择其中的“分录”属性对应预算项目,或者选择“出纳+过账”属性对应预算项目,这样用户的设置就非常灵活。当用户配置好单据属性与预算控制参数的对应关系后,服务器端会根据所述对应关系到实体对象内抽取真实数据。Referring to the entity structure tree shown in Figure 3, the user can select each attribute of the voucher document in the pop-up "source document attribute selection" window to correspond to the control parameters such as budget item, currency, and time of the budget control system. For example, select the "Entry" attribute to correspond to the budget item, or select the "Cashier + Posting" attribute to correspond to the budget item, so that the user's settings are very flexible. After the user configures the corresponding relationship between document attributes and budget control parameters, the server will extract real data from the entity object according to the corresponding relationship.

参照图3举例说明整个过程,在控制策略内,选择“责任中心来源”,系统会弹出属性来源窗口,选择单据属性,系统弹出解析好的实体结构树,该树为凭证实体的真实结构,用户可以选择凭证实体上面的“公司”属性,该属性在凭证实体的关键字为company.id,该关键字被存入数据库。当凭证审批的时候,预算控制系统会到凭证抽取company.id的真实数值,然后使用该id去查找预算组织,然后在该组织按照一定规则查找预算数据(究竟会找到哪个预算这依赖于控制信息的来源)。Refer to Figure 3 to illustrate the whole process. In the control strategy, select "responsibility center source", the system will pop up the attribute source window, select the document attribute, and the system will pop up the parsed entity structure tree, which is the real structure of the credential entity. You can select the "company" attribute on the credential entity, the key of this attribute in the credential entity is company.id, and this key is stored in the database. When the voucher is approved, the budget control system will go to the voucher to extract the real value of company.id, then use the id to find the budget organization, and then search the budget data in the organization according to certain rules (which budget will be found depends on the control information origin of).

通过上述方法,用户可以灵活进行预算控制配置,其他业务系统人员也不必编写与预算控制系统相关的代码,大大降低了工作量。Through the above method, the user can flexibly configure the budget control, and other business system personnel do not need to write codes related to the budget control system, which greatly reduces the workload.

本发明实施例还提供了从多个数据源获取数据的系统,作为预算控制系统的一部分,可从数据源所在的业务系统中抽取出预算数据进行预算控制。参照图4,是所述系统的结构框图。所述系统主要包括实体解析单元401、交互单元402和数据获取单元403。The embodiment of the present invention also provides a system for acquiring data from multiple data sources. As a part of the budget control system, budget data can be extracted from the business system where the data source is located for budget control. Referring to Fig. 4, it is a structural block diagram of the system. The system mainly includes an entity resolution unit 401 , an interaction unit 402 and a data acquisition unit 403 .

所述实体解析单元401用于获取实体文件,从实体文件获取实体的所有属性,并解析实体属性,构建出实体结构树;所述交互单元402负责与用户交互,用于提供配置界面,显示所述实体结构树,并提供查询实体结构树的功能,用户可设置实体属性与预算控制参数的对应关系;所述数据获取单元403用于从选中的数据源获取实体属性值。其中,实体解析单元401在解析实体时,根据通用接口404定义的实体访问规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存到实体对象中。所述通用接口404用于预定义访问实体的规则,并提供了扩展功能,用户可根据接口定义的通用访问规则进一步扩展。The entity parsing unit 401 is used to obtain the entity file, obtain all attributes of the entity from the entity file, and analyze the entity attributes to build an entity structure tree; the interaction unit 402 is responsible for interacting with the user, and is used to provide a configuration interface and display the entity structure tree. The entity structure tree is described above, and the function of querying the entity structure tree is provided, and the user can set the corresponding relationship between entity attributes and budget control parameters; the data acquisition unit 403 is used to acquire entity attribute values from the selected data source. Wherein, when resolving entities, the entity parsing unit 401 analyzes entity attribute properties according to entity access rules defined by the general interface 404, constructs an entity structure tree according to attribute properties, and saves the resolved entity information into entity objects according to the rules. The general interface 404 is used to predefine rules for accessing entities, and provides extended functions, and users can further expand according to the general access rules defined by the interface.

根据实际应用,本发明还提供了另一系统实施例,该系统包括客户端和服务器,所述客户端用于向服务器发起数据获取请求,所述服务器用于从多个数据源所在的业务系统获取数据并返回;其中所述服务器端包括实体解析引擎,用于获取实体文件并从中获取实体的所有属性,解析实体属性,构建出实体结构树;所述客户端通过客户端UI(User Interface,用户界面)将所述实体结构树显示;还包括解析器,用于根据客户端请求调用服务器端的实体解析引擎解析实体,并根据用户在实体结构树中选择的实体属性从服务器端获取相应的属性值。According to the actual application, the present invention also provides another system embodiment. The system includes a client and a server. The client is used to initiate a data acquisition request to the server. Obtain data and return; wherein the server end includes an entity resolution engine for obtaining entity files and obtaining all attributes of the entity therefrom, resolving entity attributes, and building an entity structure tree; the client through the client UI (User Interface, The user interface) displays the entity structure tree; it also includes a parser, which is used to call the entity resolution engine on the server side to resolve entities according to the client request, and obtain corresponding attributes from the server side according to the entity attributes selected by the user in the entity structure tree value.

优选的,在应用组件的系统环境中,可以通过创建组件来实现,服务器通过组件从多个数据源获取数据并返回给客户端。该组件包括实体解析引擎,用于获取实体文件并从中获取实体的所有属性,解析实体属性,构建出实体结构树;客户端UI,负责与用户交互,并调用服务器端功能将所述实体结构树显示给用户;解析器,用于根据客户端请求调用所述实体解析引擎解析实体,并根据用户在实体结构树中选择的实体属性从服务器端获取相应的属性值;实体对象,用于存储解析好的实体信息,如字段名称等信息。Preferably, in the system environment of the application component, it can be realized by creating a component, and the server obtains data from multiple data sources through the component and returns it to the client. This component includes an entity resolution engine, which is used to obtain entity files and obtain all attributes of the entity, parse entity attributes, and construct an entity structure tree; the client UI is responsible for interacting with users, and calls the server-side function to convert the entity structure tree Displayed to the user; the resolver is used to call the entity resolution engine to resolve the entity according to the client request, and obtain the corresponding attribute value from the server according to the entity attribute selected by the user in the entity structure tree; the entity object is used to store the resolution Good entity information, such as field names and other information.

需要说明的是,在本发明中,“组件”的概念指应用于计算机的相关实体,如硬件、硬件和软件的组合、软件或执行中的软件等。详细地说,例如,组件可以、但不限于是运行于处理器的过程、处理器、对象、可执行组件、执行线程、程序和/或计算机。还有,运行于服务器上的应用程序或脚本程序、服务器都可以是组件。一个或多个组件可在执行的过程和/或线程中,并且组件可以在一台计算机上本地化和/或分布在两台或多台计算机之间,并可以由各种计算机可读介质运行。组件还可以根据具有一个或多个数据包的信号,例如,来自一个与本地系统、分布式系统中另一组件交互的,和/或在因特网的网络通过信号与其它系统交互的数据的信号通过本地和/或远程过程来进行通信。It should be noted that, in the present invention, the concept of "component" refers to a related entity applied to a computer, such as hardware, a combination of hardware and software, software or software in execution, and the like. In detail, for example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable component, a thread of execution, a program and/or a computer. Also, the application program or script program running on the server, and the server can both be components. One or more components can be in a process and/or thread of execution, and a component can be localized on one computer and/or distributed between two or more computers and run from various computer-readable media . Components can also be based on a signal having one or more data packets, for example, from a signal that interacts with another component in a local system, a distributed system, and/or interacts with other systems over a network of the Internet via a signal. local and/or remote procedures to communicate.

图4所示系统中未详述的部分可以参见图1所示方法的相关部分,为了篇幅考虑,在此不再详述。For the parts not described in detail in the system shown in FIG. 4 , reference may be made to the relevant parts of the method shown in FIG. 1 , which are not described in detail here for the sake of space.

以上对本发明所提供的从多个数据源获取数据的方法及系统,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。The method and system for obtaining data from multiple data sources provided by the present invention have been introduced in detail above. In this paper, specific examples have been used to illustrate the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help Understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims (7)

1、从多个数据源获取数据的方法,其特征在于,包括:1. A method for obtaining data from multiple data sources, comprising: 获取实体文件;Get the entity file; 从实体文件获取实体的所有属性,其中所述实体属性称为数据源;Get all the properties of the entity from the entity file, where said entity properties are called data sources; 解析实体属性,构建出实体结构树,并显示;具体包括:预定义访问实体的规则;根据所述规则分析实体属性性质;根据所述属性性质构建实体结构树;并根据所述规则保存解析好的实体信息;Analyzing entity attributes, building an entity structure tree, and displaying it; specifically including: predefining rules for accessing entities; analyzing entity attribute properties according to the rules; constructing entity structure trees according to the attribute properties; and saving the parsed file according to the rules entity information; 查询所述实体结构树,从选中的数据源获取实体属性值。The entity structure tree is queried to obtain entity attribute values from the selected data source. 2、根据权利要求1所述的方法,其特征在于,按照以下步骤从选中的数据源获取实体属性值:2. The method according to claim 1, wherein the entity attribute value is obtained from the selected data source according to the following steps: 选择实体属性建立与业务参数的映射关系;Select entity attributes to establish a mapping relationship with business parameters; 当执行所述业务参数时,根据所述映射关系获取对应的实体属性值。When executing the business parameter, the corresponding entity attribute value is obtained according to the mapping relationship. 3、从多个数据源获取数据的系统,其特征在于,包括:3. A system for obtaining data from multiple data sources, characterized in that it includes: 通用接口,用于预定义访问实体的规则;Common interface for pre-defining rules for accessing entities; 实体解析单元,用于获取实体文件;从实体文件获取实体的所有属性,其中所述实体属性称为数据源;解析实体属性,构建出实体结构树,具体包括:根据通用接口定义的规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存;The entity parsing unit is used to obtain the entity file; obtain all the attributes of the entity from the entity file, wherein the entity attribute is called a data source; parse the entity attribute and construct an entity structure tree, specifically including: analyzing the entity according to the rules defined by the general interface Attribute properties, constructing an entity structure tree according to the attribute properties, and saving the parsed entity information according to the rules; 交互单元,用于显示所述实体结构树,并提供查询实体结构树的功能;An interactive unit, configured to display the entity structure tree and provide a function of querying the entity structure tree; 数据获取单元,用于从选中的数据源获取实体属性值。The data acquisition unit is used to acquire entity attribute values from the selected data source. 4、根据权利要求3述的系统,其特征在于:所述通用接口可扩展。4. The system according to claim 3, characterized in that the general interface is expandable. 5、根据权利要求3述的系统,其特征在于:所述交互单元在提供查询功能时,建立选中的实体属性与业务参数的映射关系;当执行该业务参数时,数据获取单元根据所述映射关系从相应数据源获取实体属性值。5. The system according to claim 3, characterized in that: when providing the query function, the interaction unit establishes the mapping relationship between the selected entity attribute and the business parameter; when executing the business parameter, the data acquisition unit according to the mapping Relationships get entity property values from the corresponding data sources. 6、从多个数据源获取数据的系统,其特征在于,包括:客户端和服务器,所述客户端用于向服务器发起数据获取请求,所述服务器用于从多个数据源获取数据并返回;其中所述服务器端包括实体解析引擎,用于获取实体文件并从中获取实体的所有属性,解析实体属性,构建出实体结构树,其中所述实体属性称为数据源;所述客户端通过用户界面将所述实体结构树显示;还包括解析器,用于根据客户端请求调用服务器端的实体解析引擎解析实体,并根据用户在实体结构树中选择的实体属性从服务器端获取相应的属性值;6. A system for obtaining data from multiple data sources, characterized in that it includes: a client and a server, the client is used to initiate a data acquisition request to the server, and the server is used to obtain data from multiple data sources and return ; Wherein the server end includes an entity resolution engine, which is used to obtain entity files and obtain all attributes of entities therefrom, resolve entity attributes, and build entity structure trees, wherein the entity attributes are called data sources; The interface displays the entity structure tree; it also includes a resolver for invoking the entity resolution engine on the server side to resolve the entity according to the client request, and obtains the corresponding attribute value from the server side according to the entity attribute selected by the user in the entity structure tree; 其中,所述实体解析引擎解析实体属性,构建出实体结构树,具体包括:根据预定义的访问实体的规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存。Wherein, the entity parsing engine parses entity attributes and constructs an entity structure tree, which specifically includes: analyzing entity attribute properties according to predefined rules for accessing entities, constructing an entity structure tree according to attribute properties, and constructing an entity structure tree according to the rules. Entity information is saved. 7、从多个数据源获取数据的系统,其特征在于,包括:客户端和服务器,所述客户端用于向服务器发起数据获取请求,所述服务器通过组件从多个数据源获取数据并返回给客户端;7. A system for acquiring data from multiple data sources, characterized in that it includes: a client and a server, the client is used to initiate a data acquisition request to the server, and the server acquires data from multiple data sources through components and returns to the client; 其中,所述组件包括实体解析引擎,用于获取实体文件并从中获取实体的所有属性,解析实体属性,构建出实体结构树,其中所述实体属性称为数据源;客户端界面,负责与用户交互,并将所述实体结构树显示给用户;解析器,用于根据客户端请求调用所述实体解析引擎解析实体,并根据用户在实体结构树中选择的实体属性从服务器端获取相应的属性值;Wherein, the component includes an entity parsing engine, which is used to obtain entity files and obtain all attributes of entities therefrom, parse entity attributes, and build entity structure trees, wherein the entity attributes are called data sources; client interface is responsible for communicating with users interact, and display the entity structure tree to the user; the resolver is used to call the entity resolution engine to resolve the entity according to the client request, and obtain the corresponding attribute from the server according to the entity attribute selected by the user in the entity structure tree value; 其中,所述实体解析引擎解析实体属性,构建出实体结构树,具体包括:根据预定义的访问实体的规则分析实体属性性质,根据属性性质构建实体结构树,并根据所述规则将解析好的实体信息保存。Wherein, the entity parsing engine parses entity attributes and constructs an entity structure tree, which specifically includes: analyzing entity attribute properties according to predefined rules for accessing entities, constructing an entity structure tree according to attribute properties, and constructing an entity structure tree according to the rules. Entity information is saved.
CN200710166035A 2007-10-30 2007-10-30 Method and system for obtaining data from multiple data sources Active CN100587693C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710166035A CN100587693C (en) 2007-10-30 2007-10-30 Method and system for obtaining data from multiple data sources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710166035A CN100587693C (en) 2007-10-30 2007-10-30 Method and system for obtaining data from multiple data sources

Publications (2)

Publication Number Publication Date
CN101145163A CN101145163A (en) 2008-03-19
CN100587693C true CN100587693C (en) 2010-02-03

Family

ID=39207689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710166035A Active CN100587693C (en) 2007-10-30 2007-10-30 Method and system for obtaining data from multiple data sources

Country Status (1)

Country Link
CN (1) CN100587693C (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101944127B (en) * 2010-09-26 2011-12-07 用友软件股份有限公司 Method and device for controlling data permission
CN102999610A (en) * 2012-11-22 2013-03-27 用友软件股份有限公司 Data access system and data access method
CN104281632B (en) * 2013-07-11 2018-05-25 深圳市金正方科技股份有限公司 Coding-decoding method and system based on Object Protocol mapping
KR101991086B1 (en) * 2014-09-03 2019-06-20 더 던 앤드 브래드스트리트 코포레이션 System and process for analyzing, qualifying and ingesting sources of unstructured data via empirical attribution
CN104281667A (en) * 2014-09-28 2015-01-14 用友优普信息技术有限公司 Expansible budget control device and method
CN105117220A (en) * 2015-08-14 2015-12-02 浪潮通用软件有限公司 Business entity operation management and automatic execution method based on metadata description
CN106021528A (en) * 2016-05-25 2016-10-12 北京京东尚科信息技术有限公司 Data processing method and device
CN107515866B (en) * 2016-06-15 2021-01-29 阿里巴巴集团控股有限公司 Data operation method, device and system
CN107220274B (en) * 2017-04-13 2020-10-09 中科曙光南京研究院有限公司 Visual data interface market realization method
CN108984567B (en) * 2017-06-02 2021-04-09 华为技术有限公司 A business data management system and method
CN108132969A (en) * 2017-12-01 2018-06-08 广东电网有限责任公司佛山供电局 Quality of data big data administers implementation method, electronic equipment and storage medium
CN109101595B (en) * 2018-07-27 2022-07-08 郑州云海信息技术有限公司 Information query method, device, equipment and computer readable storage medium
CN110895548B (en) * 2018-08-24 2022-08-09 百度在线网络技术(北京)有限公司 Method and apparatus for processing information
CN109144501A (en) * 2018-08-30 2019-01-04 杭州数澜科技有限公司 A kind of method and system generating API by label
CN109408646A (en) * 2018-10-12 2019-03-01 中国科学技术信息研究所 Rich Media's ontologies construction method, device and electronic equipment
CN110134461B (en) * 2019-04-09 2021-08-06 苏宁易购集团股份有限公司 Universal processing method and device for data interaction

Also Published As

Publication number Publication date
CN101145163A (en) 2008-03-19

Similar Documents

Publication Publication Date Title
CN100587693C (en) Method and system for obtaining data from multiple data sources
US8924415B2 (en) Schema mapping and data transformation on the basis of a conceptual model
CA2875309C (en) Defining and mapping application interface semantics
JP6067356B2 (en) Information validation
US9047346B2 (en) Reporting language filtering and mapping to dimensional concepts
US9547480B2 (en) Generating application model build artifacts
Merle et al. A precise metamodel for open cloud computing interface
US10419568B2 (en) Manipulation of browser DOM on server
US20130179229A1 (en) Analyzing business data for planning applications
Hewitt Java SOA Cookbook: SOA Implementation Recipes, Tips, and Techniques
CA2838452A1 (en) Automated user interface object transformation and code generation
CN104699742A (en) Extreme visualization enabling extension for large data sets
Minadakis et al. X3ML Framework: An Effective Suite for Supporting Data Mappings.
CN106201459A (en) A kind of rapid build special topic lands the method and system of page
Stünkel et al. GraphQL Federation: A Model-Based Approach.
US20060212461A1 (en) System for organizing a plurality of data sources into a plurality of taxonomies
US20160191431A1 (en) Streamlining end-to-end flow of business-to-business integration processes
Orlovskyi et al. Enterprise architecture modeling support based on data extraction from business process models.
Barzdins et al. Domain specific languages for business process management: a case study
US10192202B2 (en) Mapping for collaborative contribution
US10157360B1 (en) Smart bricks information system
Vieira Designing Hexagonal Architecture with Java: An architect's guide to building maintainable and change-tolerant applications with Java and Quarkus
Zdravković et al. Model-based, client-side integration of heterogeneous data from REST services
Lalis Searching for Architectural Design Decisions in Open-Source Software Mailing Lists
Koutsomitropoulos et al. Semantic interoperability of dublin core metadata in digital repositories

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant