[go: up one dir, main page]

CN100401259C - A service provision method for a distributed service system - Google Patents

A service provision method for a distributed service system Download PDF

Info

Publication number
CN100401259C
CN100401259C CNB2005100907490A CN200510090749A CN100401259C CN 100401259 C CN100401259 C CN 100401259C CN B2005100907490 A CNB2005100907490 A CN B2005100907490A CN 200510090749 A CN200510090749 A CN 200510090749A CN 100401259 C CN100401259 C CN 100401259C
Authority
CN
China
Prior art keywords
service
implementation
policy
services
name
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.)
Expired - Fee Related
Application number
CNB2005100907490A
Other languages
Chinese (zh)
Other versions
CN1916856A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB2005100907490A priority Critical patent/CN100401259C/en
Priority to PCT/CN2005/001976 priority patent/WO2007019745A1/en
Publication of CN1916856A publication Critical patent/CN1916856A/en
Application granted granted Critical
Publication of CN100401259C publication Critical patent/CN100401259C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

本发明提供一种分布式服务系统的服务提供方法,首先确定要使用的扩展接口、公共管理服务以及要提供的具体服务;然后由所述具体服务实现所述扩展接口,并确定各服务的名称与服务主实现;再根据所述各服务的名称与服务主实现,分别生成描述各服务的配置文件;系统通过读取并解析所述配置文件,分别加载各服务的主实现;发布所述公共管理服务,并将要提供的具体服务在公共管理服务上进行注册发布。本发明克服现有技术中存在的访问不一致,难于扩展,以及由于服务的添加或者更改造成的巨大连锁反应等问题。

Figure 200510090749

The present invention provides a service provision method of a distributed service system. Firstly, the extended interface to be used, the public management service and the specific service to be provided are determined; then the specific service implements the extended interface, and the name of each service is determined and the service main implementation; then according to the names of the services and the service main implementation, respectively generate configuration files describing each service; the system loads the main implementation of each service respectively by reading and parsing the configuration files; publishes the public Manage services, and register and publish the specific services to be provided on the public management service. The invention overcomes the problems of inconsistency in access, difficulty in expansion, and huge chain reaction caused by adding or changing services in the prior art.

Figure 200510090749

Description

一种分布式服务系统的服务提供方法 A service provision method for a distributed service system

技术领域 technical field

本发明涉及一种计算机数据服务提供方法,尤其涉及一种用于分布式服务系统的服务提供方法。The invention relates to a computer data service providing method, in particular to a service providing method for a distributed service system.

背景技术 Background technique

分布式服务系统就是将服务系统的功能拆分,将各个功能放在几个独立的组件上,通过这几个组件之间的相互协作,来完成整个系统的功能。在这里,几个独立的组件可以是指几个独立的CPU,但更通常的是指网络上的几台计算机。The distributed service system is to split the functions of the service system, put each function on several independent components, and complete the functions of the whole system through the mutual cooperation between these components. Here, several independent components can refer to several independent CPUs, but more usually refers to several computers on a network.

采用分布式系统,最大的优点表现在系统的处理速度上。系统的各个功能放在几个独立的组件上,各部分的组件完成自己的功能块,以并行的方式协同工作。分布式服务系统另外的优点还在于个功能模块分开,便于管理、维护和更新,服务器的管理维护在大型的服务系统中也是相当重要的。Using a distributed system, the biggest advantage lies in the processing speed of the system. Each function of the system is placed on several independent components, and the components of each part complete their own function blocks and work together in a parallel manner. Another advantage of the distributed service system is that each functional module is separated, which is convenient for management, maintenance and update. Server management and maintenance are also very important in large-scale service systems.

一个典型的分布式服务系统大致包括以下几部分:A typical distributed service system roughly includes the following parts:

表示层,主要负责业务层与用户之间的交流接口和数据传递工作,是唯一一个直接与用户打交道的部分;The presentation layer is mainly responsible for the communication interface and data transmission between the business layer and users, and is the only part that directly deals with users;

业务层,是分布式服务系统的心脏,最主要的数据处理工作和服务就由这一部分完成和提供;The business layer is the heart of the distributed service system, and the most important data processing work and services are completed and provided by this part;

数据源,主要用于存储数据。Data source, mainly used to store data.

然而,和运行在一台机器中的服务提供者和使用者相比,分布式系统在服务提供方面具有大得多的复杂性。造成这种复杂性的原因主要有以下几个方面:However, a distributed system has far greater complexity in service provision than a service provider and consumer running on a single machine. The main reasons for this complexity are as follows:

1、由于系统分布,服务器程序和客户程序很可能不是由同一个开发团队开发,这就造成服务提供者和客户之间的接口不规范,导致互操作困难,当涉及多个服务提供者和客户时,情况就会变得更加糟糕。1. Due to the distribution of the system, the server program and the client program may not be developed by the same development team, which causes the interface between the service provider and the client to be non-standard, resulting in difficulties in interoperability. When multiple service providers and clients are involved , the situation becomes even worse.

2、正是由于上面所述的不规范性,造成服务的扩展困难。当由于需求的变化需要增加新的服务或者对现有服务进行更改时,就会造成严重的连锁反应:那些和改动无关的客户(或者服务器)也不得不进行重新的构建和部署。当系统涉及隶属于多个不同公司的开发团队时,这种连锁反应会造成巨大的不必要的浪费。2. It is precisely because of the irregularity mentioned above that it is difficult to expand the service. When new services need to be added or existing services need to be changed due to changes in requirements, a serious chain reaction will be caused: those clients (or servers) that have nothing to do with the changes will also have to be rebuilt and deployed. When the system involves development teams belonging to several different companies, this knock-on effect can cause huge unnecessary waste.

3、部署是分布式服务中的一项重要工作,这项工作的难度直接影响到分布式服务发布和升级的工作量。遗憾的是,现在有很多服务提供者在需要升级或者提供新的服务时,都不得不重新构建并重启整个系统,这不仅严重影响了服务的可用性,并且也给升级工作带来了很大的工作量。3. Deployment is an important work in distributed services, and the difficulty of this work directly affects the workload of distributed service releases and upgrades. Unfortunately, many service providers now have to rebuild and restart the entire system when they need to upgrade or provide new services. workload.

正是由于上面的这些原因,使得当前很多分布式系统在服务提供方面非常的不一致、难以扩展和部署。而开发这些系统的公司和团体也不得不耗费大量的不必要的资金和精力。It is precisely because of the above reasons that many current distributed systems are very inconsistent in terms of service provision and difficult to expand and deploy. And the companies and groups that develop these systems have to spend a lot of unnecessary money and energy.

发明内容 Contents of the invention

本发明所要解决的技术问题在于提供一种分布式服务系统的服务提供方法,克服现有技术中存在的访问不一致,难于扩展,以及由于服务的添加或者更改造成的巨大连锁反应等问题。The technical problem to be solved by the present invention is to provide a service providing method of a distributed service system, which overcomes problems in the prior art such as inconsistency in access, difficulty in expansion, and huge chain reaction caused by adding or changing services.

本发明提供一种分布式服务系统的服务提供方法,包括如下步骤:The present invention provides a service providing method of a distributed service system, comprising the following steps:

确定要使用的扩展接口、公共管理服务以及要提供的具体服务;Determine the extended interface to be used, common management services, and specific services to be provided;

由所述具体服务实现所述扩展接口,并确定各服务的名称与服务主实现;Realize the extension interface by the specific service, and determine the name of each service and the main implementation of the service;

根据所述各服务的名称与服务主实现,分别生成描述各服务的配置文件;Generate configuration files describing each service according to the name of each service and the main implementation of the service;

系统通过读取并解析所述配置文件,分别加载各服务的主实现;The system loads the main implementation of each service respectively by reading and parsing the configuration file;

发布所述公共管理服务,并将要提供的具体服务在公共管理服务上进行注册发布。Publish the public management service, and register and release the specific service to be provided on the public management service.

优选的,本发明进一步包括如下步骤:Preferably, the present invention further comprises the steps of:

公共管理服务根据用户指示确定用户需要获取的具体服务名称;The public management service determines the specific service name that the user needs to obtain according to the user's instruction;

公共管理服务根据具体服务名称获取该具体服务实体提供给用户使用。The public management service obtains the specific service entity according to the specific service name and provides it to the user.

其中,所述通过扩展接口实现服务,并确定服务名称与服务主实现步骤,进一步包括确定该服务的实现策略的步骤,包括如下步骤:Wherein, the step of implementing the service through the extended interface, and determining the service name and the service master further includes the step of determining the implementation strategy of the service, including the following steps:

判断并确定该服务需要分解为不同的实现策略;Judging and determining that the service needs to be decomposed into different implementation strategies;

分解问题领域,解析出需要实现的策略组件;Decompose the problem domain and analyze the strategy components that need to be implemented;

确定策略与服务之间的协作方式;Determine how policies and services will collaborate;

实现出与服务相协作的策略组件。Implement policy components that work with services.

其中,所述生成描述各服务的配置文件步骤,所述配置文件进一步包括信息:组成服务的策略名称、策略实现组件,以及策略在服务实现中的组合方式。Wherein, in the step of generating a configuration file describing each service, the configuration file further includes information: the name of the strategy constituting the service, the component implementing the strategy, and the way the strategy is combined in the implementation of the service.

其中,所述加载步骤,进一步包括如下步骤:Wherein, the loading step further includes the following steps:

判断并确定所述配置文件中含有策略配置信息;Judging and determining that the configuration file contains policy configuration information;

解析出配置文件中的策略实现及其组合方式,并对其进行加载;Parse out the policy implementation and its combination in the configuration file, and load it;

根据策略的组合方式,将策略实现组合如服务主实现中。According to the combination method of the policy, the policy implementation is combined as in the service master implementation.

采用本发明所述方法,与现有技术相比,提供了一种高效,便捷,一致,并且易于扩展的分布式服务提供方法,采用配置文件的方式方便对服务的组织,服务的配置发布不再采用硬编码的方式,而是采用动态加载和控制反转(Inversion of Control)技术使得服务的表示和实现分离,从而可以很方便地实现服务的多样性。运用这种方法,可以极大地节省服务开发的时间,可以帮助分布式服务系统构建底层服务管理框架。由于控制反转的引入,应用对框架不存在直接依赖,提高了服务组件的可测试性,本发明提供的配置文件组织方式和服务访问方式还可以根据实际需要去进行扩展,应用范围更广,实现了服务的可扩展性,访问的一致性,服务实现的多样性,不同类型服务的易配置和易添加性以及动态加载性。本发明可以提供高度模块化且可动态、增量扩展的服务,特别适合于电信设备管理中EMS(网元管理系统)和NMS(网络管理系统)之间的服务提供方式。Compared with the prior art, the method of the present invention provides an efficient, convenient, consistent, and easy-to-expand method for providing distributed services. The method of configuration files is used to facilitate the organization of services, and the configuration and release of services is easy Instead of hard-coding, dynamic loading and Inversion of Control (Inversion of Control) technologies are used to separate service representation and implementation, so that service diversity can be easily realized. Using this method can greatly save time for service development, and can help distributed service systems build an underlying service management framework. Due to the introduction of inversion of control, the application has no direct dependence on the framework, which improves the testability of the service components. The configuration file organization method and service access method provided by the present invention can also be expanded according to actual needs, and the application range is wider. It realizes the scalability of services, the consistency of access, the diversity of service implementations, the easy configuration and addition of different types of services, and the dynamic loading. The present invention can provide highly modularized, dynamically and incrementally expandable services, and is especially suitable for the service provision mode between EMS (network element management system) and NMS (network management system) in telecommunication equipment management.

附图说明 Description of drawings

图1为本发明所述的分布式服务系统的服务提供方法流程示意图;FIG. 1 is a schematic flow chart of a service providing method of a distributed service system according to the present invention;

图2为本发明所述的服务实现及配置文件生成过程示意图;Fig. 2 is a schematic diagram of the process of service realization and configuration file generation according to the present invention;

图3为本发明所述的服务加载与发布流程示意图;Fig. 3 is a schematic diagram of the service loading and publishing process described in the present invention;

图4为为本发明所述的用户使用服务时的流程示意图。Fig. 4 is a schematic flow chart of the user using the service according to the present invention.

具体实施方式 Detailed ways

如图1所示,为本发明所述的分布式服务提供方法流程示意图。首先,确定要使用的扩展接口、公共管理服务以及要提供的具体服务(步骤101);由所述具体服务实现所述扩展接口,并确定各服务的名称与服务主实现(步骤102);根据所述各服务的名称与服务主实现,分别生成描述各服务的配置文件(步骤103);系统通过读取并解析所述配置文件,分别加载各服务的主实现(步骤104);发布所述公共管理服务,并将要提供的具体服务在公共管理服务上进行注册发布(步骤105)。As shown in FIG. 1 , it is a schematic flowchart of the method for providing distributed services in the present invention. First, determine the extended interface to be used, the public management service, and the specific service to be provided (step 101); implement the extended interface by the specific service, and determine the name and service master implementation of each service (step 102); The name of each service described and the main implementation of the service generate configuration files describing each service respectively (step 103); the system loads the main implementation of each service respectively by reading and parsing the configuration file (step 104); publishes the public management service, and register and release the specific service to be provided on the public management service (step 105).

此外,如果具体服务还需要不同的实现策略,那么,本发明还可以进而将不同的策略及其组合方式进一步的描述入配置文件,并在服务加载时,通过读取和解析配置文件,动态的将不同策略组合入服务主实现中。In addition, if specific services require different implementation strategies, the present invention can further describe different strategies and their combinations into configuration files, and dynamically implement Combine the different strategies into the service master implementation.

本发明所使用的扩展接口,是一种运用在框架中的常用技术。该技术可以使得接口的功能变得可扩展而不会影响到已有的使用者。为了达到这个目的,扩展接口技术提供了一个高层的、一致的抽象服务接口,该接口中定义了用于服务扩展所需要的方法,比如:服务查询等,由具体的服务实现该接口。The extended interface used in the present invention is a common technology used in the framework. This technology can make the functions of the interface scalable without affecting existing users. In order to achieve this goal, the extended interface technology provides a high-level, consistent abstract service interface, which defines the methods needed for service extension, such as: service query, etc., and the interface is implemented by specific services.

本发明所述的具体服务,其在实现时必须要继承上述确定好的扩展接口。其中,公共管理服务为系统的一项基本服务,在启动时加载和发布,所有其他服务都通过向公共管理服务注册的方式进行发布。The specific service described in the present invention must inherit the above-mentioned defined extension interface when it is implemented. Among them, the public management service is a basic service of the system, which is loaded and released at startup, and all other services are published by registering with the public management service.

本发明所述的描述服务的配置文件采用XML格式,其中的信息可以具体涉及服务名称,服务实现主实现组件,组成服务的策略名称和策略实现组件,以及策略在服务实现中的组合方式。使用服务描述的配置文件,系统可以在运行时动态地加载并根据策略名称、组合方式等灵活地组装服务,从而可以在对系统其他部分没有任何影响的情况下,扩展和改变服务的内容。The configuration file describing the service in the present invention adopts the XML format, and the information therein can specifically relate to the service name, the main implementation component of the service, the policy name and the policy implementation component of the service, and the combination mode of the policy in the service implementation. Using the configuration file described by the service, the system can dynamically load at runtime and flexibly assemble the service according to the policy name, combination method, etc., so that the content of the service can be expanded and changed without any impact on other parts of the system.

所述配置文件的描述格式举例如下:An example of the description format of the configuration file is as follows:

<servicereg><servicereg>

    <service name=”sample”imp=”sampleServiceImp”><service name="sample" imp="sampleServiceImp">

              <strategy name=”strategy1”imp=”strategy 1 Imp”<strategy name="strategy1" imp="strategy 1 Imp"

                            means=”setStrategy 1”/>means=”setStrategy 1”/>

              <strategy name=”strategy2”imp=”strategy 2 Imp”<strategy name="strategy2" imp="strategy 2 Imp"

                            means=”setStrategy2”/>means="setStrategy2"/>

         </service></service>

</servicereg></servicereg>

优选的,在生成配置文件后,可以把具体的服务、策略实现以及对应的配置文件,复制到系统指定的目录下,为服务的加载和启动做准备。Preferably, after the configuration file is generated, the specific service, policy implementation and corresponding configuration file can be copied to the directory specified by the system to prepare for loading and starting of the service.

系统加载、启动并发布服务时,系统在配置目录读取服务配置文件,采用动态加载和控制反转(Inversion Of Control)技术来完成服务的加载、组装,并通过把服务注册到公共管理服务的方式发布服务。控制反转是这样一种技术,它可以在运行时动态、灵活地建立起组件之间的依赖关系,而组件本身却无需知晓和其建立起关系的其他组件的细节。这样就可以使得组件的开发者集中精力于组件本身。When the system loads, starts and publishes the service, the system reads the service configuration file in the configuration directory, uses dynamic loading and inversion of control (Inversion Of Control) technology to complete the loading and assembly of the service, and registers the service to the public management service way to publish services. Inversion of control is a technology that can dynamically and flexibly establish dependencies between components at runtime, and the components themselves do not need to know the details of other components with which they have established relationships. This allows the developer of the component to concentrate on the component itself.

当客户使用服务,客户可以使用一个统一的访问点去获取公共的管理服务。通过该服务,客户可以通过服务名称查询自己感兴趣的具体服务,如果服务存在,就可以获取并使用该服务了。When customers use the service, the customer can use a unified access point to obtain common management services. Through this service, customers can query the specific service they are interested in through the service name. If the service exists, they can obtain and use the service.

如图2所示,为本发明所述的服务实现及配置文件生成过程示意图。首先,由具体的服务实现去扩展事先定义的扩展接口,也就是实现服务实现,并确定出服务名称(步骤201);然后,判断服务是否需要分解为不同的实现策略(步骤202),若步骤202的判断为假,跳至步骤206;若步骤202的判断为真,则描述服务实现策略(步骤203),就是分解问题领域,解析出需要实现的策略组件;描述服务策略组合方式(步骤204),就是确定策略和服务之间的协作方式;实现服务实现策略(步骤205),就是实现出与服务协作的策略组件;生成用于服务描述的配置文件(步骤206),就是将上面分析的服务名称,服务实现组件,组成服务的策略名称和策略实现组件,以及策略在服务实现中的组合方式描述在在配置文件中。As shown in FIG. 2 , it is a schematic diagram of the process of service realization and configuration file generation in the present invention. Firstly, the specific service implementation extends the pre-defined extension interface, that is, implements the service implementation, and determines the service name (step 201); then, judges whether the service needs to be decomposed into different implementation strategies (step 202), if step If the judgment of step 202 is false, skip to step 206; if the judgment of step 202 is true, then describe the service implementation strategy (step 203), which is to decompose the problem domain and analyze the strategy components that need to be implemented; describe the service strategy combination method (step 204 ), is to determine the collaboration mode between the strategy and the service; to implement the service implementation strategy (step 205), is to realize the strategy component that cooperates with the service; to generate a configuration file for service description (step 206), that is, to analyze the above The service name, service implementation components, policy names and policy implementation components that make up the service, and the combination of policies in the service implementation are described in the configuration file.

如图3所示,为本发明所述的服务加载与发布流程示意图。首先,触发服务加载动作(步骤301);然后,读取并解析服务配置文件(步骤302);加载服务主实现,对从文件中解析出的服务主实现组件,动态加载(步骤303);判断服务配置文件中是否有策略配置,就是看服务配置文件中是否有对服务主实现的策略组件配置(步骤304);如果步骤304判断为假,则转步骤307;如果步骤304判断为真,则分析并加载策略实现(步骤305),就是解析出配置文件中的策略组合方式并动态加载策略实现组件;再把策略实现组合进服务实现主体(步骤306),根据步骤305解析出的策略组合方式,把策略实现组合进服务实现主体;最后把服务实现注册到公共管理服务中(步骤307),公共管理服务在系统启动时发布,所有的其他服务通过在公共管理服务上注册的方式发布。As shown in FIG. 3 , it is a schematic diagram of the service loading and publishing process described in the present invention. First, trigger the service loading action (step 301); then, read and parse the service configuration file (step 302); load the service master implementation, and dynamically load the service master implementation component parsed from the file (step 303); judge Whether there is a policy configuration in the service configuration file is to see whether there is a policy component configuration (step 304) implemented by the service master in the service configuration file; if step 304 is judged as false, then go to step 307; if step 304 is judged as true, then Analyzing and loading the policy implementation (step 305) is to parse out the policy combination mode in the configuration file and dynamically load the policy implementation components; Combining the policy implementation into the service implementation subject; finally registering the service implementation into the public management service (step 307), the public management service is released when the system starts, and all other services are released by registering on the public management service.

如图4所示,为本发明所述的用户使用服务时的流程示意图。首先,客户获取公共管理服务(步骤401);然后,客户告知公共管理服务自己想获取的具体服务名称(步骤402);然后,客户使用公共管理服务获取具体服务实体(步骤403);最后,客户使用具体服务(步骤404)。As shown in FIG. 4 , it is a schematic flow chart of the user using the service according to the present invention. First, the client obtains the public management service (step 401); then, the client informs the public management service of the specific service name he wants to obtain (step 402); then, the client uses the public management service to obtain a specific service entity (step 403); finally, the client Concrete services are used (step 404).

下面用JAVA语言实现的一个例子来说明本发明,该例子中采用CORBA作为分布式对象的基础平台。首先确定一个扩展接口,在本例中,这个扩展接口是一个退化接口:An example implemented by JAVA language is used to illustrate the present invention below, and CORBA is adopted as the basic platform of distributed objects in this example. First determine an extension interface, in this example, the extension interface is a degenerate interface:

interface CommService{interface CommService{

};};

然后我们再确定一个公共管理服务对象:Then we determine a public management service object:

interface ServiceMng{interface ServiceMng{

    CommService getService(in string servname);CommService getService(in string servname);

};};

然后再确定一个要实现的服务,例子采用最简单的HelloWorld样例Then determine a service to be implemented, the example uses the simplest HelloWorld sample

interface HelloworldService::CommService{interface HelloworldService::CommService {

      void sayHello();void sayHello();

};};

上述过程可以采用IDL语言进行描述,IDL是用于CORBA协议的接口定义语言,与此相似的,如果采用其他的协议,可是使用其他的定义语言来完成定义。The above process can be described by using IDL language, which is an interface definition language used in the CORBA protocol. Similarly, if other protocols are used, other definition languages can be used to complete the definition.

进一步,分析该服务实现中是否需要不同的实现策略,例如在本例的服务中,可以采用不同的语言策略。对中文来说,要说:“世界,你好!”,对英文来说,要说:“Hello World!”,所以,需要两种不同的语言策略。Further, analyze whether different implementation strategies are required in the service implementation. For example, in the service of this example, different language strategies can be adopted. For Chinese, it is necessary to say: "Hello, world!" For English, it is necessary to say: "Hello World!" Therefore, two different language strategies are required.

下面是这两种策略的具体实现。The following is the specific implementation of these two strategies.

public interface HelloWorld{public interface HelloWorld{

    public String getHello();public String getHello();

}}

Public class EnglishHelloworld implements HelloWorld{Public class EnglishHelloworld implements HelloWorld{

public String getHello(){public String getHello(){

    return“Hello World!”;return "Hello World!";

}}

}}

public class ChineseHello World implements Hello World{public class ChineseHello World implements Hello World{

     public String getHello(){public String getHello(){

     return“世界,你好!”;return "Hello, world!";

}}

}}

接着,实现服务,在该服务实现中,确定了策略的组合方式。Next, the service is implemented, in which the policy combination is determined.

public class HelloworldServiceImpl extends HelloworldService POA{public class HelloworldServiceImpl extends HelloworldService POA{

    private ORB orb=null;private ORB orb=null;

    private Hello World hello;private Hello World hello;

    public void setORBEnv(ORB orb){public void setORBEnv(ORB orb){

         this.orb=orb;this.orb=orb;

    }}

    public void sayHello(){public void sayHello(){

        System.out.println(hello.getHello());System.out.println(hello.getHello());

}}

Public void setHello(Hello World helloworld){Public void setHello(Hello World helloworld){

    this.hello=helloworld;this.hello = helloworld;

}}

}}

接下来,生成描述该服务的配置文件,对于英文来说如下:Next, generate a configuration file describing the service, which for English is as follows:

<servicereg><servicereg>

    <service name=”Hello World”imp=”HelloworldServiceImpl”><service name="Hello World" imp="HelloworldServiceImpl">

              <strategy name=”language”imp=”EnglishHelloworld”<strategy name="language" imp="EnglishHelloworld"

                           means=”setHello”/>means="setHello"/>

          </service></service>

</servicereg></servicereg>

对于中文来说如下:For Chinese it is as follows:

<servicereg><servicereg>

     <service name=”Hello World”imp=”HelloworldServiceImpl”><service name="Hello World" imp="HelloworldServiceImpl">

               <strategy name=”language”imp=”ChineseHello World”<strategy name="language" imp="ChineseHello World"

                             means=”setHello”/>means="setHello"/>

          </service></service>

</servicereg></servicereg>

对于本例来说,公共管理服务的实现如下:For this example, the common management service is implemented as follows:

public class ServiceMngImpl extends ServiceMngPOA{public class ServiceMngImpl extends ServiceMngPOA{

      public CommService getService(String servname){public CommService getService(String servname){

          return services.getservname);return services.getservname);

      }}

      public void registerService(String name,CommService srv){public void registerService(String name, CommService srv){

           services_.put(name,srv);services_.put(name, srv);

      }}

      private Hashtable services_=new Hashtable();private Hashtable services_=new Hashtable();

}}

系统在加载Hello World服务时,会读取并分析Hello World服务的配置文件。首先动态加载该服务的主实现HelloworldServiceImpl,然后分析并加载相应的策略,并根据所配置的组合手段把策略组合进服务实现中,并通过调用公共管理服务ServiceMngImpl的registerService方法把自己发布出去。When the system loads the Hello World service, it will read and analyze the configuration file of the Hello World service. Firstly, the main implementation of the service, HelloworldServiceImpl, is dynamically loaded, and then the corresponding strategy is analyzed and loaded, and the strategy is combined into the service implementation according to the configured combination means, and released by calling the registerService method of the public management service ServiceMngImpl.

客户要访问Hello World服务时,首先获得CORBA的命名服务,然后获得公共管理服务ServiceMngImpl,调用ServiceMngImpl的getService(“Hello World”)方法获得Hello World服务。When a client wants to access the Hello World service, he first obtains the CORBA naming service, then obtains the public management service ServiceMngImpl, and calls the getService("Hello World") method of ServiceMngImpl to obtain the Hello World service.

Claims (8)

1.一种分布式服务系统的服务提供方法,其特征在于,包括如下步骤:1. A method for providing a distributed service system, comprising the steps of: 确定要使用的扩展接口、公共管理服务以及要提供的具体服务;Determine the extended interface to be used, common management services, and specific services to be provided; 由所述具体服务实现所述扩展接口,并确定各服务的名称与服务主实现;Realize the extension interface by the specific service, and determine the name of each service and the main implementation of the service; 根据所述各服务的名称与服务主实现,分别生成描述各服务的配置文件;Generate configuration files describing each service according to the name of each service and the main implementation of the service; 系统通过读取并解析所述配置文件,使用控制反转技术建立起组件之间的依赖关系,分别加载各服务的主实现;By reading and parsing the configuration file, the system uses control inversion technology to establish dependencies between components, and loads the main implementation of each service respectively; 发布所述公共管理服务,并将要提供的具体服务在公共管理服务上进行注册发布。Publish the public management service, and register and release the specific service to be provided on the public management service. 2.如权利要求1所述的方法,其特征在于,进一步包括如下步骤:2. The method according to claim 1, further comprising the steps of: 公共管理服务根据用户指示确定用户需要获取的具体服务名称;The public management service determines the specific service name that the user needs to obtain according to the user's instruction; 公共管理服务根据具体服务名称获取该具体服务实体提供给用户使用。The public management service obtains the specific service entity according to the specific service name and provides it to the user. 3.如权利要求1所述的方法,其特征在于,所述通过扩展接口实现服务,并确定服务名称与服务主实现步骤,进一步包括确定该服务的实现策略的步骤,包括:3. The method according to claim 1, wherein the step of realizing the service through the extension interface and determining the service name and the service master further includes the step of determining the realization strategy of the service, including: 判断并确定该服务需要分解为不同的实现策略;Judging and determining that the service needs to be decomposed into different implementation strategies; 分解问题领域,解析出需要实现的策略组件;Decompose the problem domain and analyze the strategy components that need to be implemented; 确定策略与服务之间的协作方式;Determine how policies and services will collaborate; 实现出与服务相协作的策略组件。Implement policy components that work with services. 4.如权利要求3所述的方法,其特征在于,所述生成描述各服务的配置文件步骤,所述配置文件进一步包括信息:组成服务的策略名称、策略实现组件,以及策略在服务实现中的组合方式。4. The method according to claim 3, characterized in that, in the step of generating a configuration file describing each service, the configuration file further includes information: the policy name of the service, the policy implementation component, and the policy in the service implementation combination. 5.如权利要求1所述的方法,其特征在于,所述生成描述各服务的配置文件步骤后,进一步包括步骤:5. The method according to claim 1, characterized in that, after the step of generating configuration files describing each service, further comprising the steps of: 将具体的服务实现以及对应的配置文件复制到系统指定的目录下,为加载做准备。Copy the specific service implementation and corresponding configuration files to the directory specified by the system to prepare for loading. 6.如权利要求4所述的方法,其特征在于,所述生成描述各服务的配置文件步骤后,进一步包括步骤:6. The method according to claim 4, further comprising the step of: 将具体的服务、策略实现以及对应的配置文件复制到系统指定的目录下。Copy specific services, policy implementations, and corresponding configuration files to the directory specified by the system. 7.如权利要求4所述的方法,其特征在于,所述加载步骤,进一步包括如下步骤:7. The method according to claim 4, wherein the loading step further comprises the steps of: 判断并确定所述配置文件中含有策略配置信息;Judging and determining that the configuration file contains policy configuration information; 解析出配置文件中的策略实现及其组合方式,并对其进行加载;Parse out the policy implementation and its combination in the configuration file, and load it; 根据策略的组合方式,将策略实现组合如服务主实现中。According to the combination method of the policy, the policy implementation is combined as in the service master implementation. 8.如权利要求1或4所述的方法,其特征在于,所述的配置文件采用XML格式文件描述。8. The method according to claim 1 or 4, wherein the configuration file is described in XML format.
CNB2005100907490A 2005-08-15 2005-08-15 A service provision method for a distributed service system Expired - Fee Related CN100401259C (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CNB2005100907490A CN100401259C (en) 2005-08-15 2005-08-15 A service provision method for a distributed service system
PCT/CN2005/001976 WO2007019745A1 (en) 2005-08-15 2005-11-23 A service providing method of distributed service system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100907490A CN100401259C (en) 2005-08-15 2005-08-15 A service provision method for a distributed service system

Publications (2)

Publication Number Publication Date
CN1916856A CN1916856A (en) 2007-02-21
CN100401259C true CN100401259C (en) 2008-07-09

Family

ID=37737857

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100907490A Expired - Fee Related CN100401259C (en) 2005-08-15 2005-08-15 A service provision method for a distributed service system

Country Status (2)

Country Link
CN (1) CN100401259C (en)
WO (1) WO2007019745A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882073A (en) * 2009-05-04 2010-11-10 谭家辉 Service-oriented application system, communication method thereof, creator and creation method
CN101826987B (en) * 2010-04-27 2012-05-02 北京邮电大学 A hybrid service support system and method based on a converged open network
CN105338025B (en) * 2014-07-21 2019-04-09 阿里巴巴集团控股有限公司 Invocation component method, system, client and concentration assembly method and server
CN105635303B (en) * 2016-01-19 2019-06-21 锐达互动科技股份有限公司 A kind of method and system improving concurrent amount of access with distributed deployment service interface
CN108052374B (en) * 2017-12-29 2021-08-31 郑州云海信息技术有限公司 A method and apparatus for deploying container microservices

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6484214B1 (en) * 1998-03-05 2002-11-19 Mcdonnell Douglas Helicopter Company Method for distributed object communications based on dynamically acquired and assembled software components
CN1608248A (en) * 2002-01-15 2005-04-20 国际商业机器公司 Provisioning aggregated services in a distributed computing environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ATE418240T1 (en) * 2001-11-19 2009-01-15 Nokia Corp PROVIDING POSITIONING INFORMATION
US20030191762A1 (en) * 2002-04-08 2003-10-09 Juha Kalliokulju Group management

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6484214B1 (en) * 1998-03-05 2002-11-19 Mcdonnell Douglas Helicopter Company Method for distributed object communications based on dynamically acquired and assembled software components
CN1608248A (en) * 2002-01-15 2005-04-20 国际商业机器公司 Provisioning aggregated services in a distributed computing environment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
反转的控制-组件、容器和IoC. 透明.程序员. 2003
反转的控制-组件、容器和IoC. 透明.程序员. 2003 *
基于MFC创建COM组件. 方霞,郭国强.常德师范学院学报(自然科学版),第15卷第1期. 2003
基于MFC创建COM组件. 方霞,郭国强.常德师范学院学报(自然科学版),第15卷第1期. 2003 *

Also Published As

Publication number Publication date
CN1916856A (en) 2007-02-21
WO2007019745A1 (en) 2007-02-22

Similar Documents

Publication Publication Date Title
Sheng et al. Self-serv: A platform for rapid composition of web services in a peer-to-peer environment
US8918454B2 (en) Managing rule sets as web services
CN107291523B (en) Web front-end message bus system
EP1960899B1 (en) Conforming web services to an updated contract
US7673283B2 (en) Method and system for improved modeling language profile
US20090249374A1 (en) Dynamic template instantiation
Papajorgji et al. An architecture for developing service-oriented and component-based environmental models
Fang et al. A version-aware approach for web service directory
Barrett et al. Model driven distribution pattern design for dynamic web service compositions
Al Belushi et al. An approach to wrap legacy applications into web services
CN100401259C (en) A service provision method for a distributed service system
Hackmann et al. Extending BPEL for interoperable pervasive computing
Zaremba et al. Towards dynamic execution semantics in semantic web services
Fang et al. A version-aware approach for web service client application
Lau et al. Deployment contracts for software components
Condie Distributed Computing, Tomorrow's Panacea—an Introduction to Current Technology
Stäber et al. Interoperability challenges and solutions in automotive collaborative product development
Bouillet et al. Mario: middleware for assembly and deployment of multi-platform flow-based applications
Pietschmann et al. Adaptive rich user interfaces for human interaction in business processes
Thoelen et al. Supporting reconfiguration and re-use through self-describing component interfaces
Zhang et al. Research on Multi-tier Distributed Systems Based on AOP and Web Services
Cârstea et al. Towards a grid enabled symbolic computation architecture
Domaschka et al. Towards generic and middleware-independent support for replicated, distributed objects
e Sá et al. André Filipe de Sousa Borges Microservices Development and Deployment
Klimenko E-commerce Platform Integration Development. Case: Liana Technologies Oy

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080709

Termination date: 20170815

CF01 Termination of patent right due to non-payment of annual fee