[go: up one dir, main page]

CN103186417B - A kind of method of Service Management - Google Patents

A kind of method of Service Management Download PDF

Info

Publication number
CN103186417B
CN103186417B CN201110454481.XA CN201110454481A CN103186417B CN 103186417 B CN103186417 B CN 103186417B CN 201110454481 A CN201110454481 A CN 201110454481A CN 103186417 B CN103186417 B CN 103186417B
Authority
CN
China
Prior art keywords
service
creator
business domain
business
provider
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
CN201110454481.XA
Other languages
Chinese (zh)
Other versions
CN103186417A (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.)
Dingjie Shuzhi Co ltd
Original Assignee
Digiwin Software 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 Digiwin Software Co Ltd filed Critical Digiwin Software Co Ltd
Priority to CN201110454481.XA priority Critical patent/CN103186417B/en
Priority to TW101122425A priority patent/TWI579782B/en
Publication of CN103186417A publication Critical patent/CN103186417A/en
Application granted granted Critical
Publication of CN103186417B publication Critical patent/CN103186417B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

本发明是一种服务管理的方法应用于一软件系统中,包括:通过业务领域细分一服务,每一业务领域具有一业务领域标识;根据细分结果将服务在业务领域上的一投影添加至至少一服务提供者中,投影包括业务领域标识、一服务类型以及一服务创建器;在请求服务时,根据业务领域标识和服务类型,取得投影的服务创建器,由服务创建器返回一服务实例。本发明不仅通过业务领域细分服务,使服务的请求者仅需关心业务领域和服务接口类型,而且使用服务提供者及服务创建器储存及管理服务,根据服务的应用范围将服务投影添加到服务提供者中。同时本发明提供向上寻址的服务提供者链路,保证了服务可被正确定位及储存。此外,本发明还提供不同的服务生命周期类型。

The present invention is a method of service management applied to a software system, including: subdividing a service through a business domain, each business domain having a business domain identifier; adding a projection of the service on the business domain according to the subdivision result To at least one service provider, the projection includes a business domain identifier, a service type, and a service creator; when requesting a service, obtain the projected service creator according to the business domain identifier and service type, and the service creator returns a service instance. The present invention not only subdivides the service through the business field, so that the service requester only needs to care about the business field and the service interface type, but also uses the service provider and the service creator to store and manage the service, and adds the service projection to the service according to the application scope of the service. provider. At the same time, the present invention provides an upward addressing service provider link, which ensures that the service can be correctly located and stored. In addition, the present invention also provides different service life cycle types.

Description

一种服务管理的方法A method of service management

技术领域 technical field

本发明涉及企业资源规划系统领域,尤其涉及一种服务管理的方法。 The invention relates to the field of enterprise resource planning systems, in particular to a service management method.

背景技术 Background technique

面向服务是一种架构软件系统的方法。面向服务的架构中功能由服务承载,通过接口对外提供功能。 Service orientation is an approach to architecting software systems. In the service-oriented architecture, the functions are carried by services, and the functions are provided externally through the interface.

面向服务架构使得公用基础功能可以在服务中进行定义,使得功能的实现更易于管理、维护和扩展,使得软件系统可以快速响应变化的需求与应对不同的应用环境。 Service-oriented architecture enables common basic functions to be defined in services, making the realization of functions easier to manage, maintain and expand, and enabling software systems to quickly respond to changing requirements and respond to different application environments.

将服务分级为服务层次是非常重要的,反映了服务的复合或者不规则的本性,如果划分方式不佳,将会导致越来越多的小粒度的服务被定义、设计和部署,却缺乏控制,导致了主要的性能、可伸缩性和管理问题。 Classification of services into service layers is very important, reflecting the composite or irregular nature of services, which, if poorly partitioned, will result in more and more fine-grained services being defined, designed, and deployed with little control , leading to major performance, scalability, and management issues.

在传统方式中,获取一服务一般是通过服务接口。接口是对服务功能实现的约定,服务实现通过接口对外公开一些方法以提供功能。获取服务是通过指定服务接口类型从而获得服务接口对应的服务实现。服务的定义过程与业务无直接关联,例如保存服务,在订单中以一种方式实现,在售货单中以另一种方式实现,在入货单中又以其他方式实现。因此为了实现业务逻辑不同的同一功能,需要建立不同的服务接口,使得服务接口数量庞大难以管理。例如,(参见图1所示),保存服务的功能需有一保存服务实现。在传统方式中可能需要定义三个不同接口(依次是服务接口M、服务接口N、服务接口O)进而在服务实现M和服务实现O中实现服务,才能在调用服务时指定不同接口以获取对应的服务实现。 In a traditional way, obtaining a service is generally through a service interface. The interface is a contract for the implementation of service functions, and the service implementation exposes some methods through the interface to provide functions. To obtain a service is to obtain the service implementation corresponding to the service interface by specifying the service interface type. The service definition process is not directly related to the business. For example, the storage service is implemented in one way in the order, another way in the sales order, and another way in the receipt. Therefore, in order to realize the same function with different business logics, different service interfaces need to be established, which makes it difficult to manage the large number of service interfaces. For example, (see Figure 1), the functionality of a storage service needs to be implemented by a storage service. In the traditional way, it may be necessary to define three different interfaces (service interface M, service interface N, and service interface O) and then implement services in service implementation M and service implementation O, so that different interfaces can be specified when calling services to obtain corresponding service realization.

发明内容 Contents of the invention

本发明的目的在于解决上述问题,提供一种服务管理的方法,该方法不仅通过业务领域细分服务,使得服务的请求者仅需关心业务领域和服务接口类型即可,而且通过服务提供者及服务创建器储存及管理服务,根据服务的应用范围将服务添加到服务提供者中。同时该方法提供向上寻址的服务提供者链路,保证了服务可以被正确定位及储存。此外,该方法还提供不同的服务生命周期类型。 The purpose of the present invention is to solve the above problems and provide a method of service management. This method not only subdivides services through business domains, so that service requesters only need to care about business domains and service interface types, but also through service providers and The service creator stores and manages the service, and adds the service to the service provider according to the application scope of the service. At the same time, the method provides an upward addressing service provider link, ensuring that the service can be correctly located and stored. Additionally, this method provides different service lifecycle types.

为实现上述的目的,本发明采用下述技术方案: To achieve above-mentioned purpose, the present invention adopts following technical scheme:

一种服务管理的方法,所述服务管理的方法应用于一软件系统中,包括以下步骤: A method for service management, where the method for service management is applied to a software system, comprising the following steps:

(a)通过业务领域细分一服务,每一业务领域具有一业务领域标识; (a) Subdividing a service by business domain, each business domain has a business domain identifier;

(b)根据细分结果将所述服务在所述业务领域上的一投影添加至至少一服务提供者中,所述投影包括所述业务领域标识、一服务类型以及一服务创建器; (b) adding a projection of the service on the business domain to at least one service provider according to the segmentation result, the projection including the business domain identifier, a service type, and a service creator;

(c)在请求所述服务时,根据所述业务领域标识和所述服务类型,取得所述投影的服务创建器,由所述的服务创建器返回一服务实例。 (c) When requesting the service, obtain the projected service creator according to the business domain identifier and the service type, and return a service instance from the service creator.

进一步,所述至少一服务提供者为多个相链的服务提供者。 Further, the at least one service provider is a plurality of chained service providers.

进一步,所述的步骤(b)中,依据所述投影的应用范围将所述投影添加至多个所述服务提供者中。 Further, in the step (b), the projection is added to multiple service providers according to the scope of application of the projection.

进一步,所述的步骤(c)中,进一步包括以下步骤: Further, in the described step (c), further include the following steps:

在请求所述服务时,通过所述至少一服务提供者提供的GetService方法请求服务,从所述至少一服务提供者开始逐一检索至其它服务提供者,查找所述投影的服务创建器;以及 When requesting the service, request the service through the GetService method provided by the at least one service provider, search from the at least one service provider to other service providers one by one, and search for the projected service creator; and

当检索到所述投影的服务创建器时,由所述服务创建器返回所述服务实例。 When the projected service creator is retrieved, the service instance is returned by the service creator.

进一步,在返回所述服务实例的步骤中,当检索不到所述投影时,引发异常。 Further, in the step of returning the service instance, when the projection cannot be retrieved, an exception is thrown.

进一步,在检索所述投影的服务创建器的步骤中,进一步包括当发现所述服务类型具有中断标记时,则停止检索。 Further, in the step of retrieving the projected service creator, it further includes stopping the retrieval when it is found that the service type has an interrupt flag.

进一步,在通过业务领域细分所述服务的步骤之后,进一步包括: Further, after the step of subdividing the service by business domain, it further includes:

按照业务领域标识,分为不同的文件目录,将所述服务配置于所述所有文件目录中。 According to the identification of the business field, it is divided into different file directories, and the service is configured in all the file directories.

进一步,所述的软件系统是一企业资源规划系统。 Further, the said software system is an enterprise resource planning system.

此外,本发明还提供一种服务管理的方法,应用于一软件系统中,包括如下步骤: In addition, the present invention also provides a service management method, which is applied to a software system, and includes the following steps:

在软件系统中识别通用功能并定义服务接口; Identify common functions and define service interfaces in software systems;

根据服务接口,为每个业务领域提供服务接口对应的具体的服务实现; According to the service interface, provide specific service implementation corresponding to the service interface for each business domain;

为每一服务设置生命周期类型,根据生命周期类型指定服务创建器; Set the life cycle type for each service, and specify the service creator according to the life cycle type;

按照服务应用范围,将所述服务接口类型、所述业务领域标识以及所述服务创建器一起作为服务投影放入服务提供者中; According to the scope of service application, put the service interface type, the business domain identifier and the service creator together into the service provider as a service projection;

当接收服务请求,通过业务领域标识和服务类型,从多层服务提供者的其中一服务提供者开始检索对应的服务创建器; When receiving a service request, retrieve the corresponding service creator from one of the multi-tier service providers through the business domain identifier and service type;

通过所述多层服务提供者的服务链路逐层向上检索对应的服务创建器;以及 Retrieving the corresponding service creator layer by layer through the service link of the multi-layer service provider; and

当检索到所述对应的服务创建器时,服务创建器依据所述服务的生命周期类型返回所述服务实例。 When the corresponding service creator is retrieved, the service creator returns the service instance according to the lifecycle type of the service.

本发明的优点在于: The advantages of the present invention are:

(1)通过业务领域细分服务,服务的请求者仅需关心业务领域和服务接口类型即可,保持服务实现的多样性的同时,更易于开发; (1) By subdividing services by business domains, service requesters only need to care about business domains and service interface types, which is easier to develop while maintaining the diversity of service implementations;

(2)将彼此紧密相关的服务与服务提供者组织在一起,服务提供者对外提供统一的服务调用方法(GetService),更易于系统的开发和设计; (2) Organize services and service providers that are closely related to each other, and service providers provide a unified service call method (GetService) externally, which is easier for system development and design;

(3)提供向上寻址的服务提供者链路,保证了服务可以被正确定位及储存,完美支持系统对客户机-服务器模式的复杂应用和需求;以及 (3) Provide an upwardly addressable service provider link to ensure that services can be correctly located and stored, and perfectly support the system's complex applications and requirements for the client-server model; and

(4)提供不同的服务生命周期类型,满足软件系统中复杂的业务需求。 (4) Provide different service life cycle types to meet complex business requirements in software systems.

附图说明 Description of drawings

图1是传统方式利用不同接口完成服务实现的示意图; Figure 1 is a schematic diagram of the traditional way of using different interfaces to complete service realization;

图2是本发明所述服务管理方法的步骤流程框图; Fig. 2 is a flow chart of the steps of the service management method of the present invention;

图3是本发明所述业务领域细分服务的示意图; Fig. 3 is a schematic diagram of the subdivided service of the business field described in the present invention;

图4是本发明所述服务投影和服务提供者关系的示意图; Fig. 4 is a schematic diagram of the relationship between service projection and service provider in the present invention;

图5是本发明所述服务提供者逐层向上检索所述投影的服务创建器过程的示意图; Fig. 5 is a schematic diagram of the service creator process for the service provider to retrieve the projection layer by layer according to the present invention;

图6是本发明一实施例所述服务管理方法的具体实施步骤示意图。 Fig. 6 is a schematic diagram of specific implementation steps of the service management method according to an embodiment of the present invention.

具体实施方式 detailed description

下面结合附图对本发明服务管理的方法的具体实施方式做详细说明。 The specific implementation of the service management method of the present invention will be described in detail below in conjunction with the accompanying drawings.

参见图2是一种依据本发明的服务管理方法的步骤流程框图,所述服务管理方法应用于一软件系统中,包括以下步骤: Referring to FIG. 2 , it is a block diagram of the steps of a service management method according to the present invention. The service management method is applied to a software system and includes the following steps:

S101:通过业务领域细分一服务,每一业务领域具有一业务领域标识(如图3中M12表示所述业务领域细分服务)。服务在软件系统中为一功能点的类别,所述的功能点用于完成一需求的功能。本发明是依照业务领域划分服务,通过一稳定的通用接口约定服务实现,并通过业务领域标识(TypeKey)将具体服务实现与业务领域进行关联,其中TypeKey是一种业务标识,通过通用接口加上业务领域标识(TypeKey),在业务领域内获取正确的服务实现。以下给出一个例子用于说明按照业务领域细分服务,参见图3:服务实现A(M122)和服务实现C(M124)是保存服务通用接口ISaveService在业务领域标识TypekeyA和业务领域标识TypekeyC的两个投影。在获取服务时,若在业务领域A,则可找到业务领域A对应的具体服务实现A,若在业务领域C时,则可找到业务领域C对应的具体服务实现C。因此,不需要告知服务提供者需要哪一业务领域对应的服务接口,也不需要额外接口就能使服务被访问。 S101: Subdivide a service by business fields, each business field has a business field identifier (M12 in FIG. 3 represents the business field subdivision service). A service is a category of function points in a software system, and the function points are used to complete a required function. The present invention divides services according to the business field, agrees on the realization of the service through a stable general interface, and associates the specific service realization with the business field through the business field identifier (TypeKey), wherein the TypeKey is a kind of business identifier, and is added through the general interface. Business domain identifier (TypeKey), to obtain the correct service implementation in the business domain. An example is given below to illustrate subdividing services according to business domains, see Figure 3: service implementation A (M122) and service implementation C (M124) are two components of the business domain identifier TypekeyA and business domain identifier TypekeyC of the general service interface ISaveService. a projection. When acquiring services, if you are in business domain A, you can find the specific service implementation A corresponding to business domain A, and if you are in business domain C, you can find the specific service implementation C corresponding to business domain C. Therefore, there is no need to inform the service provider which service interface corresponding to the business domain is required, and the service can be accessed without additional interfaces.

S102:根据每一业务领域中的业务需求,为每一业务领域的每一服务接口通过编写代码提供服务实现,对同一功能业务需求相同的不同业务领域可以复用同一服务实现。 S102: According to the business requirements in each business domain, provide service implementation by writing codes for each service interface of each business domain, and reuse the same service implementation for different business domains with the same functional business requirements.

S103:按照业务领域标识,分为不同的文件目录,将所述服务配置于所述文件目录中。 S103: Divide the service into different file directories according to the business field identification, and configure the service in the file directory.

在此,根据业务领域标识区分不同的文件目录,是因为系统在根据配置加载服务时,是按照配置文件所处的文件夹确定该服务应该应用于哪个应用领域。每个文件目录对应一个业务领域标识(TypeKey),也即对应于一个业务领域。特别地,并不是所有服务都需要配置在业务领域标识的文件目录中,还有不需要指定TypeKey的公用服务,可以配置在根目录下或者在代码中直接注册服务。 Here, different file directories are distinguished according to the business domain identifier, because when the system loads the service according to the configuration, it determines which application domain the service should be applied to according to the folder where the configuration file is located. Each file directory corresponds to a business domain identifier (TypeKey), that is, corresponds to a business domain. In particular, not all services need to be configured in the file directory identified by the business domain, and there are public services that do not need to specify a TypeKey, which can be configured in the root directory or directly registered in the code.

S104:根据细分结果将所述服务在所述业务领域上的一投影(project)添加至多层相链的服务提供者中,所述投影包括所述的业务领域标识(TypeKey)、一服务接口类型(ISaveService)和一服务创建器。所述投影是指在不同业务领域中对于业务接口有不同的业务实现。当所述多层相链的服务提供者的其中一服务提供者接收到服务请求时,参见图4的服务提供者M11内部置有一字典M111,所述的字典M111包括多个键值对如键M112和值M113,所述键值对即为上述投影的内容,所述的键M112(key)为业务领域标识和服务接口类型,所述的值M113(value)为一个内部的服务创建器。所述的键M112和值M113是一一对应的关系。以下再给出一个例子用于说明服务投影和服务提供者关系,在图4中,服务接口ISaveService在不同的业务领域A、B、C具有不同的投影,即服务实现A(M122)、服务实现B(M123)和服务实现C(M124),此处三个键分别设置为ISaveService+A,ISaveService+B,ISaveService+C。由于服务类型已提供,服务实现已写入代码中,对于服务提供者而言,当软件系统执行时,所述的服务会生成相应的服务实例,所述服务实例是通过服务创建器来完成。服务创建器用于依照服务的生命周期的不同类型以创建服务实例。服务有不同的生命周期类型,所述的生命周期类型包括SingleGet、Singleton、Callback和WeakReference。其中SingleGet为当每次被调用时产生新的一服务实例;Singleton为复用同一个实例,即服务被第一调用时会生成一服务实例,之后所述服务被调用时使用同一服务实例以完成功能;Callback为服务实例创建的过程,允许传入创建逻辑以决定如何创建一服务实例,WeakReference为返回指向服务实例的弱引用。此外,SingleGet、Singleton和WeakReference为固定的创建逻辑,而Callback可自定义创建逻辑,增加了灵活度。Singleton和WeakReference均会检查是否已创建一服务实例,若有则不创建,若无则创建一新服务实例,但Singleton的服务实例不允许销毁,WeakReference的服务实例在不使用时会被释放,被释放后需重新创建。 S104: Add a projection (project) of the service on the business domain to multi-layer chained service providers according to the subdivision result, the projection includes the business domain identifier (TypeKey), a service interface type (ISaveService) and a service creator. The projection refers to different service implementations for service interfaces in different service fields. When one of the service providers in the multi-layer chain receives a service request, a dictionary M111 is built in the service provider M11 of FIG. 4 , and the dictionary M111 includes a plurality of key-value pairs such as key M112 and value M113, the key-value pair is the content of the above projection, the key M112 (key) is the business domain identifier and service interface type, and the value M113 (value) is an internal service creator. The key M112 and the value M113 are in one-to-one correspondence. Another example is given below to illustrate the relationship between service projection and service provider. In Figure 4, the service interface ISaveService has different projections in different business fields A, B, and C, that is, service realization A (M122), service realization B (M123) and service implementation C (M124), where the three keys are set to ISaveService+A, ISaveService+B, ISaveService+C respectively. Since the service type has been provided and the service implementation has been written into the code, for the service provider, when the software system is executed, the service will generate a corresponding service instance, and the service instance is completed through the service creator. Service creators are used to create service instances according to different types of service life cycles. Services have different lifecycle types, including SingleGet, Singleton, Callback, and WeakReference. Among them, SingleGet is to generate a new service instance each time it is called; Singleton is to reuse the same instance, that is, a service instance will be generated when the service is first called, and then the same service instance will be used to complete the service when it is called Function; Callback is the process of creating a service instance, allowing the input of creation logic to determine how to create a service instance, and WeakReference returns a weak reference pointing to the service instance. In addition, SingleGet, Singleton, and WeakReference have fixed creation logic, while Callback can customize the creation logic, which increases flexibility. Both Singleton and WeakReference will check whether a service instance has been created. If there is, it will not be created. If not, a new service instance will be created. However, the service instance of Singleton is not allowed to be destroyed, and the service instance of WeakReference will be released when it is not in use. It needs to be recreated after release.

S105:在所述多层相链的服务提供者的其中一服务提供者被请求该服务时,根据指定所述业务领域标识和所述服务接口类型,从所述的其中一服务提供者开始检索该投影的服务创建器。服务提供者又称服务容器,在服务提供者中使用键值对,所述键值对存放服务创建器。任一服务提供者在接收到服务请求的时候,将返回所需的服务实例,服务实例由服务创建器提供。将一个服务与服务环境进行动态挂接,有2种方式。一种方式是直接与服务提供者有关联。在运行时,通过设置服务对象关联的服务提供者,可将服务对象动态连接到服务环境中,或从一服务环境中断开。另一方式是与另一服务进行挂接,不直接与服务提供者关联,通过该另一服务获取服务提供者。例如,服务A与另一服务B进行挂接,服务B是处于客户端服务环境中,那么,服务A也能共享到客户端服务环境中的服务。 S105: When one of the service providers in the multi-layer chain is requested for the service, start searching from one of the service providers according to the specified business domain identifier and the service interface type The service creator for this projection. The service provider is also called the service container, and the key-value pair is used in the service provider, and the key-value pair is stored in the service creator. When any service provider receives a service request, it will return the required service instance, which is provided by the service creator. There are two ways to dynamically attach a service to the service environment. One way is to be directly associated with the service provider. At runtime, by setting the service provider associated with the service object, the service object can be dynamically connected to or disconnected from a service environment. Another way is to hook up with another service, not directly associated with the service provider, and obtain the service provider through the other service. For example, service A is hooked to another service B, and service B is in the client service environment, then service A can also share services in the client service environment.

S106:若未找到所述投影的服务创建器,从被请求的服务提供者逐层向上检索至其它的服务提供者。如在图5中,底层首先调用服务,用户控件(UserControl)(例如打开服务表单)打开窗口即包含一服务容器(服务提供者M11),其中包含一些与此控件相关的控制服务。例如格式控制、某一字段显示颜色的服务,这些服务都注册在用户控件的服务提供者内,直接获取即可。又如,点击保存工具栏按钮,调用客户端合法性检查,由于合法性检查服务是直接注册在此窗体之内,因此可以直接在窗体的服务提供者获取。例如若要执行保存服务,而保存服务是注册在服务端,于是,通过所述多层相链的服务提供者的服务链路逐层向上检索。首先在用户控件的服务提供者中,即在服务提供者M11的内部字典中进行查找,若没有找到,则此请求转发至上一层的服务提供者M20,若在所述的上一层的服务提供者M20中也没有找到,则再一次转发至客户端服务提供者M30,在客户端服务提供者M30内部查找有无该键,若有则返回服务实例,若无则继续向上查找(即在服务端服务提供者M40的内部字典中查找)。若在服务端(在服务器或appdomain机器上)查找,需要跨越网络边界。 S106: If the projected service creator is not found, search upward layer by layer from the requested service provider to other service providers. As shown in Figure 5, the bottom layer first calls the service, and the user control (UserControl) (for example, opening the service form) opens the window and contains a service container (service provider M11), which contains some control services related to this control. For example, the format control, the service of displaying the color of a certain field, these services are all registered in the service provider of the user control, and can be obtained directly. For another example, click the save toolbar button to call the client legitimacy check. Since the legitimacy check service is directly registered in this form, it can be obtained directly from the service provider of the form. For example, if the storage service is to be executed, and the storage service is registered at the server end, then the service link of the multi-layer chained service provider is searched upward layer by layer. First, search in the service provider of the user control, that is, in the internal dictionary of the service provider M11, if not found, the request is forwarded to the service provider M20 of the upper layer, if the above-mentioned service provider If it is not found in the provider M20, it will be forwarded to the client service provider M30 again, and whether the key is found inside the client service provider M30, if there is, the service instance will be returned, and if not, then continue to search upwards (that is, in the client service provider M30). in the internal dictionary of the server service provider M40). If you look it up on the server side (on a server or appdomain machine), you need to cross network boundaries.

S107:当检索到所述投影的服务创建器时,返回所述服务实例。服务端服务提供者M40接收到保存服务的调用后,在字典中检索并找到所述键,从对应的值中获取业务领域中的保存服务对应的服务创建器,根据生命周期类型的设置,创建一保存服务实例,并予以返回。在每一服务提供者中设置有一标记(字段),用于标识当前等级的服务提供者的上级服务提供者。在逐层向上检索所述投影步骤中,当需要跨越网络边界时,若发现所述服务类型具有中断标记,则停止逐层向上检索该投影的服务创建器。也就是说,只在本地的服务提供者的字典中进行查找,不进行跨越网络。如果在整个检索过程中检索不到所述投影的服务创建器(检索过程结束包括检索完最上层的服务提供者以及在跨越网络边界时中断检索)时,会引发异常,即服务找不到。 S107: When the projected service creator is retrieved, return the service instance. After receiving the save service call, the server service provider M40 retrieves and finds the key in the dictionary, obtains the service creator corresponding to the save service in the business domain from the corresponding value, and creates - Save the service instance and return it. A flag (field) is set in each service provider, which is used to identify the upper-level service provider of the service provider of the current level. In the step of retrieving the projection layer by layer, when it is necessary to cross the network boundary, if it is found that the service type has an interrupt flag, then stop searching the projected service creator layer by layer. That is to say, only search in the dictionary of the local service provider, and do not cross the network. If the projected service creator cannot be retrieved during the entire retrieval process (the retrieval process ends including searching the top-level service provider and interrupting the retrieval when crossing the network boundary), an exception will be thrown, that is, the service cannot be found.

参见图6,以下给出本发明一具体实施例的方法,其具体步骤如下: Referring to Fig. 6, the method of a specific embodiment of the present invention is provided below, and its specific steps are as follows:

步骤S601:首先在软件系统中定义一些通用功能和通用接口,例如ISaveService,IApproveService,IDeleteService等通用接口。然后在一业务领域,比如为了实现订单的业务逻辑,订单业务逻辑中需运用一保存的服务实现。若发现没有所述保存订单的服务实现,需为订单服务创建所述保存的服务实现,即实现ISaveService接口。 Step S601: First define some common functions and common interfaces in the software system, such as ISaveService, IApproveService, IDeleteService and other common interfaces. Then in a business field, for example, in order to realize the business logic of an order, a saved service implementation needs to be used in the order business logic. If it is found that there is no service implementation for saving an order, it is necessary to create a service implementation for saving the order service, that is, implement the ISaveService interface.

步骤S602:在定义服务时,设置一功能点类别标记(服务类型)。当功能包应用时所述服务功能点被实现。 Step S602: When defining a service, set a function point category flag (service type). The service function point is realized when the function package is applied.

步骤S603:在定义服务(实现服务)时,根据服务接口中的方法约定及业务领域中的业务需求来进行实现。在服务接口ISaveService中声明了Save方法,在实现保存服务时,实现ISaveService接口,需提供Save方法的具体实现。 Step S603: When defining the service (implementing the service), implement it according to the method agreement in the service interface and the business requirements in the business domain. The Save method is declared in the service interface ISaveService. When implementing the save service, the implementation of the ISaveService interface needs to provide the specific implementation of the Save method.

步骤S604:服务的功能点和服务的功能点解释器预先设定。功能点解释器在接收功能点集合之后,依据功能点类别标记,将所述功能点对应的服务投影置于相应的服务提供者的服务容器中,功能点的应用方法也存放于解释器中。 Step S604: The function point of the service and the interpreter of the function point of the service are preset. After receiving the function point set, the function point interpreter places the service projection corresponding to the function point in the service container of the corresponding service provider according to the function point category mark, and the application method of the function point is also stored in the interpreter.

步骤S605:所述保存服务,在保存服务的功能点上标注为服务类型。在软件系统加载的时候,将保存服务置于服务提供者容器中。同时需要对保存服务的生命周期类型进行定义设置(例如,所述保存服务生命周期类型为Singleton)。至此,保存服务定义完毕。 Step S605: The storage service is marked as a service type on the function point of the storage service. When the software system is loaded, the storage service is placed in the service provider container. At the same time, it is necessary to define and set the life cycle type of the storage service (for example, the life cycle type of the storage service is Singleton). At this point, the save service definition is complete.

步骤S606:将所述的保存服务配置于一功能包中,例如将所述保存服务置于订单的功能包中。订单的业务领域标识为A,在订单加载过程中,系统将保存服务注册至服务端服务提供者,在服务端服务提供者的内部字典中,键为ISaveService+A,值为保存服务对应的服务创建器。至此,完成系统对订单中保存服务的加载过程。 Step S606: Configure the storage service in a function package, for example, place the storage service in the function package of the order. The business field of the order is identified as A. During the order loading process, the system registers the save service to the server service provider. In the internal dictionary of the server service provider, the key is ISaveService+A, and the value is the service corresponding to the save service creator. So far, the system has completed the process of loading the service stored in the order.

步骤S607:在软件系统执行时,客户端前端界面对业务领域A的单据进行保存操作,后端即向当前控件的服务提供者请求保存服务,采用通用的方法入口GetService,以ISaveService作为服务接口类型,以A为业务领域标识。当前用户控件的服务提供者接收到保存服务的调用后,在用户控件的服务提供者的字典中检索(ISaveService+A)的键。 Step S607: When the software system is executed, the client front-end interface saves the documents of business domain A, and the back-end requests the saving service from the service provider of the current control, adopts the general method entry GetService, and uses ISaveService as the service interface type , with A as the business domain identifier. After receiving the save service call, the service provider of the current user control retrieves the key of (ISaveService+A) in the dictionary of the service provider of the user control.

步骤S608:当用户控件的服务提供者发现在字典中没有找到,根据服务链路,找到上层窗体服务提供者。当窗体服务提供者接收到保存服务的调用后,在窗体服务提供者的字典中检索(ISaveService+A)的键。当窗体服务提供者发现在字典中没有找到,根据服务链路,找到客户端服务提供者。当客户端服务提供者接收到保存服务的调用后,在客户端服务提供者的字典中检索(ISaveService+A)的键。如果客户端服提供者务发现在字典中没有找到,根据服务链路,跨越网络边界至服务端服务提供者。 Step S608: When the service provider of the user control is not found in the dictionary, find the upper-level window service provider according to the service link. When the form service provider receives the save service call, it retrieves the key of (ISaveService+A) in the form service provider's dictionary. When the form service provider finds that it is not found in the dictionary, find the client service provider according to the service link. When the client service provider receives the save service call, it retrieves the key of (ISaveService+A) in the dictionary of the client service provider. If the client service provider service discovery is not found in the dictionary, according to the service link, across the network boundary to the server service provider.

步骤S609:当服务端服务提供者接收到保存服务的调用后,在服务端服务提供者的字典中检索(ISaveService+A)的键。如果服务端服务提供者找到该键,从对应的值中获取业务领域A中的保存服务对应的服务创建器,由于所述保存服务的生命周期类型为Singleton,所以进行判断是否已有的SaveService服务实例,若有则不创建,若无则所述服务创建器创建一个新的保存服务(SaveService)实例。 Step S609: After the server service provider receives the save service call, it searches for the key (ISaveService+A) in the dictionary of the server service provider. If the server-side service provider finds the key, it obtains the service creator corresponding to the save service in business domain A from the corresponding value, and since the life cycle type of the save service is Singleton, it is judged whether there is an existing SaveService service If there is an instance, it will not be created, if not, the service creator will create a new save service (SaveService) instance.

步骤S610:调用所述保存服务的服务实例业务实现方法,执行单据A的保存逻辑。 Step S610: call the service instance business implementation method of the saving service, and execute the saving logic of document A.

本发明有益效果在于,通过业务领域细分服务,使得服务请求者可以利用业务领域和服务接口类型组合方式,以及向上寻址的服务提供者链路,正确定位及存储服务,完成开发需求。 The beneficial effect of the present invention is that, by subdividing services in the business field, the service requester can use the combination of the business field and the service interface type, as well as the upwardly addressed service provider link, to correctly locate and store the service, and fulfill the development requirement.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。 The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications should also be considered Be the protection scope of the present invention.

Claims (6)

1.一种服务管理的方法,所述服务管理的方法应用于一软件系统中,其特征在于,包括以下步骤:1. A method for service management, the method for service management is applied in a software system, characterized in that it comprises the following steps: (a)通过业务领域细分一服务,每一业务领域具有一业务领域标识;(a) Subdividing a service by business domain, each business domain has a business domain identifier; (b)根据细分结果将所述服务在所述业务领域上的一投影(project)添加至至少一服务提供者中,所述投影包括所述业务领域标识、一服务类型以及一服务创建器;(b) adding a projection (project) of the service on the business domain to at least one service provider according to the segmentation result, the projection including the business domain identifier, a service type, and a service creator ; (c)在请求所述服务时,根据所述业务领域标识和所述服务类型,取得所述投影的服务创建器,由所述的服务创建器返回一服务实例;(c) when requesting the service, obtain the projected service creator according to the business domain identifier and the service type, and return a service instance from the service creator; 其中,所述至少一服务提供者为多个相链的服务提供者;Wherein, the at least one service provider is a plurality of chained service providers; 在所述的步骤(b)中,依据所述投影的应用范围添加至所述多个服务提供者中;In the step (b), add to the plurality of service providers according to the application scope of the projection; 在所述的步骤(c)中,进一步包括以下步骤:In described step (c), further comprise the following steps: 在请求所述服务时,通过所述至少一服务提供者提供的GetService方法请求服务,从所述至少一服务提供者开始逐一检索至其它服务提供者,查找所述投影的服务创建器;以及When requesting the service, request the service through the GetService method provided by the at least one service provider, search from the at least one service provider to other service providers one by one, and search for the projected service creator; and 当检索到所述投影的服务创建器时,由所述服务创建器返回所述服务实例。When the projected service creator is retrieved, the service instance is returned by the service creator. 2.如权利要求1所述的服务管理的方法,其特征在于,在返回所述服务实例的步骤中,当检索不到所述投影时,引发异常。2. The service management method according to claim 1, wherein in the step of returning the service instance, when the projection cannot be retrieved, an exception is thrown. 3.如权利要求1所述的服务管理的方法,其特征在于,在检索所述投影的服务创建器的步骤中,进一步包括当发现所述服务类型具有中断标记时,则停止检索。3. The service management method according to claim 1, characterized in that, in the step of retrieving the projected service creator, further comprising stopping the retrieval when it is found that the service type has an interrupt flag. 4.如权利要求1所述的服务管理的方法,其特征在于,所述的步骤(a)后,还包括:4. The service management method according to claim 1, characterized in that, after the step (a), further comprising: 按照业务领域标识,分为不同的文件目录,将所述服务定义于所述所有文件目录中。According to the identification of the business field, it is divided into different file directories, and the service is defined in all the file directories. 5.如权利要求1所述的服务管理的方法,其特征在于,所述的软件系统是一企业资源规划系统。5. The service management method according to claim 1, wherein said software system is an enterprise resource planning system. 6.一种服务管理的方法,其特征在于,包括以下步骤:6. A method for service management, comprising the following steps: 在软件系统中识别通用功能并定义服务接口;Identify common functions and define service interfaces in software systems; 根据服务接口,为每个业务领域提供服务接口对应的具体的服务实现;According to the service interface, provide specific service implementation corresponding to the service interface for each business domain; 为每一服务设置生命周期类型,根据生命周期类型指定服务创建器;Set the life cycle type for each service, and specify the service creator according to the life cycle type; 按照服务应用范围,将所述服务接口类型、所述业务领域标识以及所述服务创建器一起作为服务投影放入服务提供者中;Put the service interface type, the business domain identifier and the service creator together into the service provider as a service projection according to the service application scope; 当接收服务请求,通过业务领域标识和服务类型,从多层服务提供者的其中一服务提供者开始检索对应的服务创建器;When receiving a service request, retrieve the corresponding service creator from one of the multi-tier service providers through the business domain identifier and service type; 通过所述多层服务提供者的服务链路逐层向上检索对应的服务创建器;以及Retrieving the corresponding service creator layer by layer through the service link of the multi-layer service provider; and 当检索到所述对应的服务创建器时,服务创建器依据所述服务的生命周期类型返回所述服务实例。When the corresponding service creator is retrieved, the service creator returns the service instance according to the life cycle type of the service.
CN201110454481.XA 2011-12-30 2011-12-30 A kind of method of Service Management Active CN103186417B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110454481.XA CN103186417B (en) 2011-12-30 2011-12-30 A kind of method of Service Management
TW101122425A TWI579782B (en) 2011-12-30 2012-06-22 Service management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110454481.XA CN103186417B (en) 2011-12-30 2011-12-30 A kind of method of Service Management

Publications (2)

Publication Number Publication Date
CN103186417A CN103186417A (en) 2013-07-03
CN103186417B true CN103186417B (en) 2016-04-06

Family

ID=48677595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110454481.XA Active CN103186417B (en) 2011-12-30 2011-12-30 A kind of method of Service Management

Country Status (2)

Country Link
CN (1) CN103186417B (en)
TW (1) TWI579782B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656536B (en) * 2015-11-03 2020-02-18 阿里巴巴集团控股有限公司 Method and equipment for processing service calling information
CN105357316B (en) * 2015-12-04 2018-07-03 航天科工智慧产业发展有限公司 A kind of method and system of quick realization service broker
CN111988400B (en) * 2020-08-20 2023-08-22 广州探途网络技术有限公司 Access processing method, application server and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655795A (en) * 2009-09-25 2010-02-24 金蝶软件(中国)有限公司 Method for creating service embodiment and enterprise resource planning system
CN101702216A (en) * 2009-11-23 2010-05-05 浪潮集团山东通用软件有限公司 Method for supporting configuration of various stock services

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI369616B (en) * 2004-02-27 2012-08-01 Eplus Capital Inc System and method for user creation and direction of a rich-content life-cycle
KR20090124514A (en) * 2008-05-30 2009-12-03 포항공과대학교 산학협력단 Product life cycle information management system using ubiquitous technology
US8788513B2 (en) * 2009-10-30 2014-07-22 Dassault Systemes Americas Corp. Computer method and system providing access to data of a target system
CN101719933B (en) * 2009-11-25 2012-06-27 北京航空航天大学 Combination method of manufacturing grid resource services orienting whole life cycle and supporting semantemes

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655795A (en) * 2009-09-25 2010-02-24 金蝶软件(中国)有限公司 Method for creating service embodiment and enterprise resource planning system
CN101702216A (en) * 2009-11-23 2010-05-05 浪潮集团山东通用软件有限公司 Method for supporting configuration of various stock services

Also Published As

Publication number Publication date
TWI579782B (en) 2017-04-21
TW201327437A (en) 2013-07-01
CN103186417A (en) 2013-07-03

Similar Documents

Publication Publication Date Title
US10356161B2 (en) System and method for classloading in a multitenant application server environment
KR102313476B1 (en) System and method for providing an end-to-end lifecycle in a multitenant application server environment
US9146955B2 (en) In-memory, columnar database multidimensional analytical view integration
US9930129B2 (en) System and method for java EE and java SE proxy data sources in a multitenant application server environment
CN106126540B (en) Data base access system and its access method
CN113326264B (en) Data processing method, server and storage medium
WO2016123921A1 (en) Http protocol-based multiple data resource data processing method and system
EP2779582B1 (en) Automatic mobile application discovery and integration in a mobile telecommunication device
EP3198435A1 (en) System and method for use of a global runtime in a multitenant application server environment
US8954461B2 (en) Systems and methods for object to relational mapping extensions
CN116126365A (en) Model deployment method, system, storage medium and electronic equipment
US9053134B2 (en) View variants in database schema mapping
WO2020001162A1 (en) Container management method, apparatus, and device
US8719768B2 (en) Accretion of inter-namespace instances in multi-tenant CIMOM environment
US9122559B2 (en) Extensible dependency management framework and method
CN105843867A (en) Metadata model-based search method and search device based on metadata model
CN102215264B (en) Method and device for supporting multi-tenancy data and service customized running
CN103186417B (en) A kind of method of Service Management
CN101046746B (en) Code Management in Distributed Software Development Environment
US8812678B2 (en) Integration of an application server and data grid
CN114245890A (en) Method and apparatus for providing function as a service platform
CN107408239A (en) Architecture for massive data management in communication applications through multiple mailboxes
US20190005255A1 (en) Protecting restricted information when importing and exporting resources
US20090216801A1 (en) Service Registry Document Loader
KR101063577B1 (en) Schema and stored procedure real-time management system and method of large database

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 200040 Shanghai City Jing'an District Jiangchang Road 1377 Lane 7 Building 20th Floor

Patentee after: Dingjie Shuzhi Co.,Ltd.

Country or region after: China

Address before: 200443, No. 4666, 1 Lane, Gonghe Road, Shanghai, Zhabei District, No. 8

Patentee before: DIGIWIN SOFTWARE Co.,Ltd.

Country or region before: China

OL01 Intention to license declared
OL01 Intention to license declared