Service Management in DBMS

By introducing service managers to automatically register and manage services in DBMS, the problems of complexity and high resource consumption in existing DBMSs are solved, and more flexible and efficient service management is achieved.

CN113841135BActive Publication Date: 2024-11-15INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080032396.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-05-10
Filing Date
2020-04-06
Publication Date
2024-11-15
Estimated Expiration
2040-04-06

AI Technical Summary

Technical Problem

Service management in existing database management systems (DBMSs) is complex and error-prone, especially when dealing with large amounts of services and lazy instantiation, resulting in high resource consumption and inflexibility of the system.

Method used

Introduce a service manager operablely coupled to DBMS, automatically and dynamically register and manage multiple services, automatically identify and update dependencies between services through the service manager, avoiding manual source code modification and recompilation.

Benefits of technology

Improves the flexibility and maintainability of the system, reduces resource consumption, avoids service management errors and circular dependencies, and ensures the correct order of service instantiation and the reasonable use of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113841135B_ABST
    Figure CN113841135B_ABST
Patent Text Reader

Abstract

The present invention relates to a computer-implemented method for managing a plurality of services (108-114; 208-214) in a DBMS (102, 202). The services are respectively configured to process data stored or received for storage in a database (116-122; 216-222) managed by the DBMS. The method comprises: providing (302) a service manager (106) operatively coupled to the DBMS; automatically and dynamically registering (304) a plurality of services at the service manager during the runtime of the DBMS; and automatically managing (306) dependencies between different services in the plurality of registered services by the service manager.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] The present invention relates to database management systems (DBMS), and more particularly to the management of services in the context of a DBMS.

[0002] In the context of a DBMS, it is often necessary to copy, analyze, check or otherwise process data for many different tasks. Some of these tasks can be implemented in the form of services. Some services can be provided as an integrated part of the DBMS, while other services can be added later, such as when installing a plug-in or add-on to the DBMS. Some services can be instantiated only in response to explicit queries from users, and other services can be implemented in the form of daemons running in the background. For example, IBM's IBM Db2 Analysis Accelerator (IDAA) includes infrastructure services, such as "Configurator" or "Tracer", including services that provide access to metadata in the catalog, and further includes background services such as scheduled by a "system maintenance" daemon.

[0003] Due to the heterogeneity of the types of services integrated into the DBMS, and because some services can be added after the DBMS is installed according to user-specific needs, the management of all data processing services provided by the DMBS is a complex and error-prone task. The situation is further complicated by the fact that there are often complex dependencies between different services (e.g., during the instantiation or shutdown of services). Even worse, some services are implemented based on lazy instantiation. This means that it is not possible to foresee in advance when a particular service will be instantiated.

[0004] Prior art DBMSs use a single, central piece of software code that lists all services supported by the DBMS. This central list of services included in a single source code file is difficult to maintain because the list easily becomes out-of-date when, for example, a new library including one or more additional services is loaded into the DBMS during runtime of the DBMS. Where the list is specified in the source code, the corresponding code must be recompiled each time the source code is modified. Therefore, using a central service list to coordinate the instantiation and shutdown of services supported by the DBMS is error-prone, complex, and highly time-consuming.

[0005] Another disadvantage of central lists or files that specify and coordinate the instantiation of multiple services is that those files tend to become highly complex in situations where a large number of services (e.g., hundreds or even thousands of services) must be managed. In this case, it may happen that the source code that centrally specifies the dependencies of different services includes cyclic dependencies that are difficult for programmers to identify. Such cyclic dependencies can lead to infinite loops and program failures.

[0006] Furthermore, the use of a central list to coordinate service instantiation in conjunction with lazy service instantiation is associated with the disadvantage of increased resource consumption: To avoid service instantiation errors when services are lazily instantiated at unforeseen moments, a common strategy is to instantiate all services by default when starting the DBMS that are required by a particular service that may be lazily instantiated. While this strategy can help avoid errors associated with lazy instantiation, it increases consumption of CPU and memory resources since services may be instantiated unnecessarily. For example, if a particular service is instantiated only to ensure the correct instantiation of a lazily instantiated service in response to a user query, this service may consume resources unnecessarily if a user query is never received regarding the lazily instantiated service.

[0007] Therefore, service management in current DBMS is a cumbersome, error-prone task that often results in program failures, high CPU and memory consumption, and an inflexible system that cannot integrate new services and program libraries without modifying and recompiling the source code. Summary of the invention

[0008] The present invention relates to a computer-implemented method for managing multiple services in a DBMS, a computer-readable storage medium and a corresponding computer system. The embodiments of the present invention may be freely combined with each other if they are not mutually exclusive.

[0009] In one aspect, the present invention relates to a computer-implemented method for managing multiple services in a DBMS. These services are respectively configured to process data stored or received for storage in a database managed by the DBMS. The method includes: providing a service manager operatively coupled to the DBMS; automatically and dynamically registering the multiple services at the service manager during the runtime of the DBMS; and automatically managing, by the service manager, dependencies between different services in the multiple registered services.

[0010] In another aspect, the present invention relates to a computer-readable storage medium having program instructions embodied therewith, the program instructions being executable by a processor to cause the processor to perform a method for managing a plurality of services in a DBMS. The services are respectively configured to process data stored or received for storage in a database managed by the DBMS. The method includes managing a plurality of services in the DBMS. The services are respectively configured to process data stored or received for storage in a database managed by the DBMS. The method includes: providing a service manager operatively coupled to the DBMS; automatically and dynamically registering the plurality of services at the service manager during the runtime of the DBMS; and automatically managing, by the service manager, dependencies between different services in the plurality of registered services.

[0011] In a further aspect, the present invention relates to a computer system comprising a DBMS and a service manager operatively coupled to the DBMS. The service manager is configured to automatically and dynamically register a plurality of services at the service manager at runtime of the DBMS, the services being respectively configured to process data stored or received for storage in a database managed by the DBMS. Dependencies between different services in the plurality of registered services are automatically managed. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In the following embodiments, embodiments of the present invention are explained in more detail, by way of example only, with reference to the accompanying drawings, in which:

[0013] Figure 1 A computer system including a DBMS and a service manager is depicted.

[0014] Figure 2 Another computer system including a DBMS and a service manager is depicted.

[0015] Figure 3 is a flow chart of a method for managing services in a DBMS.

[0016] Figure 4 Describes the dependencies between multiple services.

[0017] Figure 5 The integration of services and service managers within a larger system architecture is shown.

[0018] Figure 6 Depicts the various parts of the source code for a service class.

[0019] Figure 7 Portions of source code for several object and interface classes that implement a service are depicted. DETAILED DESCRIPTION

[0020] Embodiments of the present invention may have the advantage of providing a system and method for managing multiple services in a DBMS that increases the flexibility and maintainability of the system and reduces resource consumption, particularly in the context of using lazy instantiation of some services. Some or all of the technical disadvantages associated with prior art service management methods may be avoided.

[0021] Embodiments of the present invention may allow libraries respectively including one or more services to be dynamically loaded into a DBMS at runtime and new services to be instantiated in the DBMS without manually modifying central files and / or recompiling code.

[0022] Embodiments of the present invention may be advantageous because many technical disadvantages of the prior art service management methods based on a single central list of services supported by a DBMS may be avoided: any service is automatically and at runtime added to the DBMS and registers itself at the service manager. Therefore, it may not be necessary to modify and recompile any source code. Furthermore, since the service manager automatically maintains the dependencies of services, including the dependencies of dynamically added services, it is ensured that all services required by a particular service are instantiated by the service manager before the particular service is instantiated. This may allow avoiding instantiating too many services by default to avoid errors during the instantiation of services, because the dependencies are managed by a service manager adapted to automatically and at runtime register new services in the DBMS.

[0023] According to an embodiment, the method also includes: during the registration of one of the services at the service manager, the service manager automatically identifies one or more other services required by the service to be registered; and updating the dependencies between the multiple registered services, the service to be registered, and the services identified during the registration of the one service, so that the dependencies also include dependencies between the service to be registered and other required services.

[0024] For example, one or more other services required by a particular service to be registered may be specified within the particular service, e.g., in the source code of the service, and / or may be dynamically provided to the service manager by a function of the particular service. For example, the function may be a getRequiredServices function that returns a list of strings created by a service configured to convert class names of required services specified, e.g., in the source code of the service or in a class file associated with the service, into corresponding strings. These strings may be used by the service manager as arguments for registering required services and, optionally, also for dynamically instantiating required services before the particular service is instantiated.

[0025] This may be advantageous because the class names of one or more services required by a service to be registered are specified explicitly or implicitly within the service itself, rather than in a centrally managed configuration file. This can ensure that global management of dependencies for hundreds or even thousands of services in a central file can be avoided. Automatic conversion of the class name of a service to a string used as an argument for managing (registering, initializing and / or shutting down) a service by the service manager may be beneficial because it can ensure standardized and deterministic use of service names.

[0026] According to a preferred embodiment, the getRequiredServices function is configured to, when called: convert the class name of the one or more required services into corresponding strings; convert the one or more strings into compiler-checkable objects; and return the compiler-checkable objects to the service manager that called the getRequiredServices function.

[0027] Using automatic conversion of class names specified in the source code of the class to data objects of types known to the compiler can enable the compiler to check at compile time and optionally at design time whether a particular service is referenced correctly. This can help avoid typos, circular service dependencies, and / or service name duplication during programming / software development.

[0028] In the event that the dependencies of a particular service change, there is no need to update the central service repository of the DBMS or to recompile the source code of the DBMS. If a service is modified so that it additionally requires a specific analytical or mathematical service library, the source code of the service may need to be modified and recompiled anyway. However, according to an embodiment of the present invention, loading the additional service into the DBMS itself does not require any manual modification or recompilation of the central service repository. In contrast, in some prior art systems, the source code of the service and the source code of the DBMS including the central service list or at least the central service list must be updated.

[0029] According to an embodiment, the service manager is suitable for registering dynamically loaded services and instantiating one or more of the newly loaded services in an appropriate order according to a dynamically updated data structure, which includes the dependencies of all services registered at the service manager. Services can be dynamically instantiated and closed as needed without manually updating any source code or central configuration file. For example, the service manager can be configured to dynamically load a library including one or more new services into the DBMS when the DBMS is running. The library is loaded into the DBMS to ensure that specific actions can be performed, such as OLAP analysis of some data, such as specific statistical clustering analysis. The loading of the library can be triggered by a clear user action. The new service in the loaded library can have dependencies on other services, which may or may not be part of the loaded library and / or all registered services. The loading of the service library at runtime can automatically trigger the registration of the services contained in the loaded library through the service classes and interfaces of the services contained in the loaded library. In some example examples, the source code of the service includes a call to a constructor method or other methods (also referred to as "functions") that trigger the instantiation of other required services. The service manager may be configured to call the getRequiredServices method of any service to be registered during the registration process to identify the dependencies of the service to be registered. The service manager is configured to update the dependencies of all services managed by the service manager.

[0030] Embodiments of the present invention may have further advantages: when the service manager or DBMS starts, the service manager does not have to know all services. Instead, services can be added later on demand. Services dynamically loaded into the DBMS interact with the server manager during the loading and registration process so that registration is automatically performed and a callback mechanism is provided that allows an arbitrary way to instantiate services and introduce / register further dependencies. The use of a central configuration file or class in which all services must be pre-registered in the source code by hard coding can be avoided, thereby greatly improving the flexibility and maintainability of the system.

[0031] According to an embodiment, the management of dependencies includes instantiating services according to the dependencies such that all services required by a specific one of the services have been instantiated before the specific service is instantiated by the service manager.

[0032] According to an embodiment, one or more of these services are lazily instantiated services.

[0033] According to an embodiment, at least some of the plurality of services represent steps within a workflow of a product manufacturing process. At least some of the dependencies represent equipment dependencies, workflow dependencies, material dependencies, and / or supply dependencies of physical objects involved in or processed by the product manufacturing process.

[0034] For example, a DBMS may be used to manage one or more databases including data generated and used by an Enterprise Resource Planning (ERP) system. The core functions of many ERP systems are "Material Requirements Planning" and "Manufacturing Resource Planning".

[0035] Material requirements planning (MRP) includes computational tasks used to manage the manufacturing process, such as production planning, scheduling, and inventory control. MRP systems or subsystems typically perform one or more of the following functions: ensuring that materials are available for production and that products are available for delivery to customers; keeping inventory material and product levels as low as possible; and planning manufacturing activities, delivery schedules, and purchasing activities.

[0036] Manufacturing Resource Planning (MRP II) includes computational tasks involving the efficient planning of all resources of a manufacturing company. It can address operational planning, financial planning of units, and can include simulation capabilities to answer "what if" questions and extensions of closed-loop MRP. MRP II systems or subsystems typically implement one or more of the following functions: generation and updating of the Master Production Schedule (MPS), management of project master data (technical data), management of production resource data and other technical manufacturing data, material requirements planning (MRP), capacity planning or capacity requirements planning (CRP), etc.

[0037] Today, more and more manufacturing companies no longer produce products that remain unchanged and unmodified for a long time ("inventory"). Due to the frequent changes in customer needs, these companies must be able to quickly and easily adapt their production processes to follow any new directions in customer preferences. Especially when customers prefer the opportunity to "design" the products they want to buy, such as when car manufacturers allow a plethora of features to be changed during the ordering process, making the final delivered car almost unique, the planning of the manufacturing process and the management of the required resources become very complex and difficult to maintain. The different functions of an MRP or MRPII system or subsystem can be implemented as services, which are an integral part of the DBMS or are later loaded into the DBMS in the form of program libraries. The time when the library is loaded and the services contained therein are registered and / or instantiated may be unpredictable. As a result, an ERP system may include hundreds or even thousands of services, the management of which is a very complex task.

[0038] Embodiments of the present invention may also allow a huge number of services whose number and relative dependencies cannot be foreseen in advance to be arranged in a way that ensures a proper manufacturing process. Since the registration of services is performed decentralized based on automatic and dynamic registration of individual services and their respective dependencies at the service manager, the management and updating of dependencies in the planning of materials and resources for the manufacturing process will become much easier. There is no need to manually maintain a central list of registered services.

[0039] According to another embodiment, at least some of the services managed by the service manager include services for shutting down and restarting the services and processes in the workflow of the manufacturing plant. The service dependencies specified in each service automatically extracted or otherwise dynamically received by the service manager reflect the dependencies of each physical requirement and the dependencies of each process for shutting down and restarting the services and processes of the manufacturing plant. The service manager automatically coordinates the temporary shutdown and the services returned to the manufacturing plant, such as for performing maintenance or service tasks. In many factories, systems must be shut down or started in a specific order to allow upstream systems to be offline or online. For example, when maintaining beverage production, it is important to start the system that supplies water first, then start the system that converts water into high-pressure steam, and then start the system that produces clean steam. All steps involved in the planned temporary shutdown are coordinated by the service manager in an effective manner to avoid the decomposition of the workflow, avoid damage to the machines involved in the manufacturing process, and avoid degradation of the quality of the manufactured goods. Any failure along the way may have a domino effect that puts scheduling and budgets at risk. Considering the complexity and scale of such manufacturing plants, it is not a simple activity to coordinate all dependencies between equipment, consumables, products, parts, and processes. Embodiments of the present invention may allow physical objects (e.g., equipment, goods, intermediate products, or machines) to be represented as services loaded into a DBMS. Each new device, each dynamically generated product or intermediate product, and each required other physical object (machine, part, other intermediate product, or consumable) can be specified in the corresponding service in the form of a service requirement. Therefore, when the services loaded into the DBMS are automatically registered at the service manager, highly dynamic adaptation of workflows and instantiation of individual services and workflow tasks can be performed. The flexibility required by modern, highly dynamic manufacturing processes cannot be achieved based on a manually managed central service list. Preferably, all or at least many services are implemented as singletons.

[0040] According to an embodiment, management of dependencies includes shutting down one or more of the services according to the dependencies, so that before shutting down any one of the one or more services, shutting down of the one service is delayed until all services dependent on the one service are shut down.

[0041] This can ensure that the shutdown of a service does not negatively impact other services that may depend on the service being shut down. For example, in a complex manufacturing process, there is a risk that the shutdown of a particular process will disrupt another process, but the operator may not be aware of this dependency. Embodiments of the present invention can ensure that an unexpected shutdown or failure of a complex manufacturing process, for example caused by an erroneous shutdown command by an operator, is prevented because the shutdown of a service is delayed until no other service needs the service.

[0042] According to an embodiment, each of the services is implemented according to a singleton design pattern. For example, each service may be implemented as a singleton.

[0043] This may reflect the fact that the machines, consumables, products and intermediate products involved in the manufacturing process are also considered to be “physical single instance objects”.

[0044] According to an embodiment, the dependency relationships of services are represented in the form of one or more directed acyclic graphs (DAGs).

[0045] This may have the benefit that the graph (eg, tree) may be traversed quickly and circular dependencies may be easily detected.

[0046] According to various embodiments, the dependency of services is represented in a single data structure, which is managed and continuously updated by the service manager at the runtime of the DBMS. In particular, when a service is newly registered at the service manager, the update of the dependency is performed.

[0047] According to some embodiments, one or more or all of the multiple services include "getServicelnstance" (get service instance). This method is accessible by the service manager and enables the service manager to check whether private members (cached singleton service instances) have been initialized. If it has been initialized, the existing service instance is returned directly to the service manager. If it has not been initialized, a new service instance is created, placed in a member variable, and returned to the caller (e.g., service manager) in a timely manner for its first use.

[0048] According to an embodiment, the method includes adding an additional service to the DBMS. The adding includes registering the additional service at the service manager when the DBMS is running, and automatically updating the dependency of the service so that the dependency indicates the existing dependency with the additional service.

[0049] For example, the registration of additional services may be part of a library that may include other services. The library is loaded into the DBMS when the DBMS is running so that other services can utilize services contained in the library and / or so that services in the library can utilize services that have been instantiated by the service manager or at least registered at the service manager.

[0050] According to an embodiment, registration of services at the service manager is implemented in the form of a decentralized registration process. Using a decentralized registration process means that neither the DBMS nor any other system functionally coupled to the DBMS includes or uses a manually created and maintained list of registered services.

[0051] According to various embodiments, the dependencies of a service are specified within the service (e.g., within the source code of the service) and are communicated to the service manager when the service registers the service at the service manager. For example, the source code of a class file that implements a service may include a list of class names of one or more other services required by the service. The service manager is configured to parse the list when registering the at least one service and update the dependencies based on the parsed list.

[0052] In addition or alternatively, each of the plurality of services includes a function for registering the service at the service manager. For example, a service class that implements the service or an interface class implemented by the service may include the function. The function for service registration may be, for example, a "registerService" function.

[0053] According to an embodiment, each of the multiple services includes an "instantiateService" function and a "shutdownService" function. The instantiateService function and the shutdownService function are accessible to the service manager (i.e., they can be called by the service manager). For example, these functions can be public functions. The method further includes: the instantiateService function and the shutdownService function of multiple services are used by the service manager to dynamically coordinate the instantiation and shutdown of multiple services according to dependencies. Preferably, the instantiateService function and the shutdownService of multiple services managed by the DBMS are the same, i.e., have the same function name and the same list of independent variables, and the specific implementation method can vary from service to service. This makes the maintenance and management of a large number of services easy, because the service manager can automatically control the instantiation and shutdown of a large number of services with a small number of commands.

[0054] According to an embodiment, each of the multiple services includes a getRequiredServices function. The getRequiredServices function can be accessed by a service manager. The getRequiredServices function is configured to return the names of one or more required services. Each required service is a service that needs to be instantiated before the service containing the getRequiredServices function is instantiated. Registration of each of the multiple services includes calling the getRequiredServices function of the service to be registered by the service manager; automatically checking whether the name of the required service returned by the getRequiredService function identifies a registered service; and the service manager automatically registers any service returned by the getRequiredService function that has not yet been registered.

[0055] For example, the service manager may search a local or remote service repository for the name of a desired but not yet registered service.

[0056] According to an embodiment, executing the getRequiredServices function includes: converting the class names of one or more required services into corresponding strings; converting the one or more strings into compiler-checkable objects; and returning the compiler-checkable objects to the service manager that called the getRequiredServices function.

[0057] In fact, the getRequiredServices function converts the identified class name in a standardized ("canonical") way, which can even allow the compiler to perform automatic object type checking.

[0058] According to some embodiments, the service manager is configured to call the getRequiredServices function of any one of the multiple services before the instantiation of the service. The service manager is configured to check whether the name of the required service returned by the getRequiredService function identifies an already instantiated service; the service manager automatically calls the instantiateService function of the required service that has not yet been instantiated and is returned by the identified getRequiredService function. However, in other embodiments, the service manager does not call the getRequiredService function when preparing to instantiate the service, because all dependencies of the services managed by the service manager have been identified during the registration process and have been stored in a separate data structure (e.g., a directed acyclic graph, a tree, or a set of trees). The service manager is configured to analyze the dependency data structure before a particular service is instantiated, and automatically instantiate all services required by the service of interest to be instantiated before the service of interest is instantiated. This can have the following advantages: each service only needs to specify a limited set of required services, and does not need to care about the second and third level dependencies, that is, it is not necessary to also specify the services required by the "required service", because these second and third level requirements are automatically considered and integrated into the global dependency data structure by the service manager when the required service is registered.

[0059] According to an embodiment, the service manager is configured to update dependencies at least when registering a service. Updating the dependencies includes updating dependencies between multiple registered services, services to be registered, and "required" services identified during the registration of the one service, so that the dependencies also include dependencies of the services to be registered and dependencies of other required services.

[0060] The dependency relationship may be stored in one or more data structures managed by the service manager. The data structure may be, for example, a directed acyclic graph or a set of directed acyclic graphs. In other exemplary embodiments, the data structure representing the dependency relationship may also be a list or a set of lists or any other type of data structure suitable for encoding the dependency relationship of multiple services.

[0061] According to an embodiment, at least one of the plurality of services specifies one or more other services that are required by the at least one service. These services are also referred to as "required services". The specification of the one or more other services may be in the form of a list of class names that are checked by the compiler during compile time. If a service class includes the name of a required service and the compiler cannot identify a class whose name matches the name of the required service, an error is raised when the service class is compiled.

[0062] Prior art service management systems (e.g., "Code Project") can be managed through https: / / www.codeproject.com / Articles / 5794 / Registry-of-Singletons Online) does not handle automatic registration of services and is not concerned with managing dependencies between services. In addition, these systems identify services by strings, that is, expressions in the source code or another file, which are specified in a syntax that cannot be checked by the compiler configured to compile the service. A problem associated with using strings to uniquely register services is that each string representing a service must be globally unique. In addition, any typographical errors may result in errors that cannot be identified until the service source code is compiled and tested. Therefore, the use of untyped strings to specify the name of a required service in the source code of a service is error-prone and may result in errors (if any) being discovered very late.

[0063] In contrast, the above-described embodiments of the present invention use the class names of other services directly and convert them into compiler-checkable objects that can indicate one or more required services. This means that the source code of a particular service includes a list of the class names of one or more other services required by the particular service. The class names are included in the source code of the particular service in a syntax that forces the compiler to check whether the class name is the same as the class name of one of all registered services. By specifying the required services in the source code of the service using exactly the same identifiers used by the compiler itself, the following advantages can be achieved: the compiler may have already checked references to invalid services at compile time, and optionally at design time. If the currently compiled or modified code of the service class contains an unknown service class name, the compiler will throw an error at compile time or create an underlined or other form of text highlighting effect at design time.

[0064] According to an embodiment, the design time environment for programming services is adapted to identify service source code segments that mention service class names that do not match existing service classes known to the compiler during the design time of the service with a compiler. In this case, the design time environment is configured to automatically highlight the service class name in the source code of the service class during design time.

[0065] This can be advantageous because typos and other errors that result in a mismatch between the name of a required service specified in the service's source code and the actual name of the representation and / or class that implements the required service are already automatically detected at design time. This can significantly speed up the service development process because errors are automatically identified at the earliest possible stage.

[0066] According to an embodiment, the service manager is a component of an application implemented as an extension application (add-on or plug-in) of the DBMS, or is an integrated component of the DBMS.

[0067] For example, an integrated component of a DBMS may be a program component or function that is part of the core functionality of the DBMS and is provided as part of the DBMS originally provided by the DBMS developer or vendor. Providing a service manager as an integrated part of a DBMS may be beneficial because the DBMS already provides support for automatic and dynamic registration and dependency checking of new services to be loaded into the DBMS.

[0068] Providing a service manager as a plug-in or add-on to a DBM may be beneficial as this allows to supplement an existing DBMS with the ability to automatically and dynamically load new services into the DBMS so that their dependencies with other services are automatically considered and integrated into the dependencies of existing services.

[0069] According to an embodiment, the method further comprises:

[0070] a) The DBMS receives a service request for a specific service;

[0071] b) identifying, by the service manager, the requested service within the plurality of services;

[0072] c) identifying, by the service manager, one or more other services in the registered services required for the requested service;

[0073] For each of the identified one or more other services:

[0074] i. Check whether the other service has been instantiated;

[0075] ii. If the other service has been instantiated, go to the next service identified in step c;

[0076] iii. If the other service has not been instantiated, instantiate the other service and move on to the next service identified in step c.

[0077] This may be beneficial because the service manager is adapted to ensure that any services that may be lazily instantiated in response to user requests submitted to the DBMS can be instantiated so that there are no program failures caused by other services that are not instantiated but are needed.

[0078] According to some embodiments, the service manager is configured to store dependencies in a data structure having a logical sorting order as defined by the dependencies. The logical sorting order of the services in the data structure representing the service dependencies can be used to coordinate the instantiation and shutdown of multiple services managed by the service manager. For example, the topological sorting order can be explicitly determined using a well-known algorithm, or implicitly determined by performing a depth-first search specified in the pseudocode described in the previous two paragraphs.

[0079] The term "lazy initialization" as used herein is a strategy of delaying the creation of an object (in this case a service) until it is first needed. This is a type of lazy evaluation, which specifically refers to the instantiation of an object or other resource. Providing lazy instantiation of services can increase the startup speed of the DBMS because the impact of object instantiation is spread out over time rather than concentrated in the startup phase of the system, and therefore the median response time can be greatly improved.

[0080] The term "service" as used herein refers to a software function or a set of software functions, the purpose of which is that different clients or different program routines acting as clients can be reused for different purposes. Preferably, a "service" is a software function for processing data currently stored in a database managed by a DBMS and / or to be stored in a database managed by a DBMS. For example, a service may be a clustering algorithm suitable for clustering digital pathology images. Another service may be a principal component analysis service, which is configured to identify a subset of parameters in a data set that are highly predictive of a particular feature of interest. Another example of a service may be a report in a specific form, for example, a report indicating the number of consumables used in the production process of a particular item, the amount of energy and water consumed in a particular manufacturing step, etc. The report may be specific to a particular user or user group and / or may depend on other factors. Reports may be dynamically generated by analyzing data stored in a database (e.g., manufacturing-related data). According to an embodiment, a service may include an interface that allows a user or another software function to call the service.

[0081] As used herein, a "registered service" is a service whose name (or other identifier) ​​and dependencies from other services (if any) have been communicated to the service manager. Thus, the service manager has integrated the registered services and their required services (if any) in a data structure representing the dependencies of all registered services.

[0082] As used herein, a "service manager" is a piece of software configured to manage multiple services. The piece of software may be an independent application, a program module, a program routine, a program function, a software class, or a combination of two or more of the above.

[0083] As used herein, a "compiler-checkable object" is a data object that has an assigned type (e.g., a particular object class) and optionally additional features that enable the compiler to perform one or more consistency checks at compile time and optionally also at design time. A consistency check may include, for example, checking whether the type assigned to the data object is contained in a list of object types known to the compiler.

[0084] As used herein, a "database" is a collection of electronic information ("data") organized in a memory or on a non-volatile storage volume in the form of a specific defined data structure that supports or is optimized for data retrieval by a specific type of database query. The data is typically logically organized in database tables. In particular, a database may be a relational database, such as a column-oriented database or a row-oriented database.

[0085] As used herein, a "database management system (DBMS)" is a software application designed to allow the definition, creation, query, update, and management of a database. Examples of DBMS are IBM Db2 for z / OS, MySQL, PostgreSQL, IBM Db2 Analytics Accelerator (IDAA), and the like.

[0086] As used herein, a "database query" or "query" is a command to retrieve, update, store and / or analyze data stored in a database managed by a DBMS, the command being specified in the syntax of the DBMS's interface. For example, the syntax may be SQL.

[0087] A "table" as used herein is a database table managed by a DBMS.

[0088] As used herein, a "module" is hardware, firmware, software, or a combination thereof that is configured to perform a specific function within an information technology (IT) framework. For example, a module can be a stand-alone software application, or a submodule or subroutine of a software application that includes one or more other modules.

[0089] As used herein, the "singleton pattern" is a software design pattern that restricts instantiation of a class to a "single" instance and provides global access to that instance. Thus, a "singleton" is a software object that is implemented so as to ensure that only one instance of a particular type of software object (e.g., a particular type of service represented and implemented by the software object) can be instantiated at a time.

[0090] Figure 1A computer system 100 is depicted that includes one or more processors 104 and a DBMS 102. For example, the computer system can be a standard computer system (e.g., a desktop computer system or a server computer system) or a distributed computer system (e.g., a cloud computer system). The DBMS can be any type of DBMS. For example, the DBMS 102 can be a relational DBMS. The DBMS can be a column storage DBMS, a row storage DBMS, a hierarchical DBMS, etc. For example, the DBMS can be one of the following DBMSs: IBM Db2, MySQL, Oracle, PostgreSQL, IBM's Db2Analytical Accelerator for Db2 (IDAA), etc. The computer system includes a service manager 106 operatively coupled to the DBMS 102.

[0091] Computer system 100 also includes a service manager 106 operatively coupled to the DBMS.

[0092] The expression "service manager operatively coupled to the DBMS" as used herein may mean, for example, that the service manager is functionally an integral part of the DBMS, since it is configured for managing services using the DBMS as a corresponding runtime environment.

[0093] The service manager is configured to execute in Figure 3 is shown in and hereinafter referred to by reference Figure 1 and Figure 3 Elements of both are used to describe the method.

[0094] In step 302, the service manager 106 may be provided by installing and instantiating the DBMS, for example as an integrated component of the DBMS. Alternatively, the service manager may be provided in step 302 after the DBMS has been instantiated. For example, the service manager may be included in a plug-in or add-on to the DBMS and provide the functionality of the service manager when the plug-in or add-on is installed and instantiated on the computer system 100.

[0095] The service manager 106 is configured to automatically and dynamically register a plurality of services 108-114, 208-214 at runtime of the DBMS at the service manager in step 304. For example, when a new program library including one or more services is loaded into the DBMS, the services contained in the library are automatically registered at the service manager. Additionally or alternatively, when the DBMS is instantiated, services that are part of the DBMS are automatically registered at the service manager 106. Each of these services is a piece of program logic ("software") configured to process data stored in or received for storage in one of the one or more databases 116-122 managed by the DBMS 102.

[0096] In step 306, the service manager 106 is configured to automatically manage dependencies 107 between different services in a plurality of registered services. For example, during registration of a new service, the service manager identifies one or more other services required by the service to be registered, and updates the dependencies so that the updated dependencies also reflect the service dependencies of the currently registered services. Similarly, if a service is not registered, the dependencies are also updated. The dependencies 107 can be, for example, a data structure managed by the service manager and accessible only by the service manager. For example, the dependencies 107 can be a tree or a collection of trees in which nodes represent services, and in which edges connecting parent nodes to child nodes represent dependencies between the services represented by the parent nodes and the required services represented by the child nodes. The service manager can be configured to ensure that services represented by all direct and indirect child nodes of a particular node are instantiated before the services represented by the particular node are instantiated.

[0097] The services 108-114 may include one or more daemons and one or more services that may be explicitly called by a user or a function of the DBMS. Each of the services may be implemented as a singleton, however, any other software pattern that ensures that only one instance of a service may be instantiated at a time may also be used, and therefore, the singleton design pattern is not the only possible implementation option.

[0098] For example, the services may include a catalog manager service that is configured to track and query the settings of different configuration parameters in IBM's IDAA. The services may further include a tracker service and a configurator service used by the catalog manager service to provide the above-mentioned functions "tracking" and "configuration". The tracker service depends on the configurator service. This means that in order to start and use the catalog manager service, the tracker service must have been instantiated. However, since the tracker service depends on the configuration service, it is necessary to instantiate the configuration service first, then the tracker service, and finally the catalog manager service. The often complex dependencies between different services make it important to instantiate the services in the proper order.

[0099] According to the prior art approach, the proper order of service instantiation is ensured as follows: a central class "Initializier" is provided, in which a hard-coded line appears in the source code of each service of the DBMS:

[0100] registerService <configurator>();

[0101] registerService <tracer>();

[0102] registerService <catalogmanager>();

[0103] However, using a central class to globally instantiate services in an appropriate order according to the above-mentioned prior art methods does not ensure the correct instantiation order. For example, lazy instantiation of some services that depend on user requests may be received in an unpredictable time order. In the case of adding services to the system in real time, for example by loading a library into the DBMS, it is necessary to update the source code of the central class and recompile the class and potentially recompile the entire DBMS. Some services that perform background operations (so-called "daemons") require explicit external triggers to be instantiated. In addition, if the number of services exceeds a certain threshold, the central class or other source code segments that explicitly specify the order of service instantiation events will become too complex to maintain. For example, circular dependencies between multiple services may appear and may cause difficult-to-identify errors at runtime. Maintaining such a central registry is a burden, and developers often take measures to avoid it. For example, an instantiation chain is built by instantiating one or more services as part of the instantiation of other services. This will lead to a (partially) manually coded dependency graph between all services, resulting in more complex and difficult to maintain code.

[0104] On the contrary, according to an embodiment of the present invention, a service dynamically registers itself at the service manager when the DBMS is running. The service manager processes and coordinates the instantiation and closure of all services of the DBMS 102 in a thread-safe manner, for example, the service manager and each service can be run in a separate single thread respectively. During the instantiation and closure of each of the services 108-114, the service manager 106 ensures that the dependencies between the services are observed. The automatic registration of services at the service manager and the automatic update of dependencies ensure that the DBMS can support a large number of services. Another technical benefit of automatic registration and dependency update is that all codes accessing any registered service can always rely on available services. There is no performance overhead incurred for checking and lazy instantiation services.

[0105] Preferably, each service is implemented as a singleton, which means that a single software object is created and made available for subsequent use by other services or functions of the DBMS.

[0106] Figure 2 An alternative embodiment of a computer system 200 including a service manager 106 and a DBMS 202 is shown. The system 200 includes one or more processors 204, an OLTP DBMS 203 (e.g., IBM's Db2) and an OLAP DBMS (e.g., IBM's IDAA 202). The two DBMSs 203, 202 can be hosted on the same computer system 200 or hosted on different computer systems. The OLTP DBMS 203 includes a query optimizer optimized for executing write queries, while the OLAP DBMS 202 includes a query optimizer optimized for executing analytical read queries. The OLTP DBMS 203 can be, for example, Db2 for z-OS, an Oracle database, a PostgreSQL or a MySQL DBMS, etc. The OLAP DBMS 202 can be, for example, IDAA. The computer system 200 can include a replication engine 232, which is configured to replicate data already stored in databases 228, 230 of the OLTP DBMS to databases 216-222 of the OLAP DBMS. The computer system may further include a query dispatcher module, which is configured to analyze any database query accessing the OLTP DBMS 203 and forward some queries (especially complex analytical queries) to the OLAP DBMS. The query dispatcher attempts to predict whether the execution of the query on the OLAP DBMS can be faster or take up less computing resources than on the OLTP DBMS. In this case, the query dispatcher forwards the database query to the OLAP DBMS for execution. The client that submitted the query is usually not notified whether the query is executed on the OLTP DBMS or on the OLAP DBMS. The OLAP DBMS may include multiple services 208-214, which are respectively configured to execute analytical queries, such as statistical evaluation, clustering and classification tasks, image segmentation, complex reports for different users, purposes and data subsets, etc.

[0107] OLAP DBMS 202 may include hundreds or even thousands of services 208-214. Some of these services may be integral to DBMS 202 from the outset. Other services may be loaded into the DBMS later, for example when the owner of DBMS 202 decides to perform a certain type of data analysis task that is not covered by the already integrated services. Service manager 106 is adapted to fully automatically manage and maintain a large number of services and their respective interdependencies 107, thereby ensuring that DBMS 202 and its services run stably and also ensuring that errors associated with manual specification of dependencies and / or temporal order of service instantiations can be avoided.

[0108] Figure 3 Describes the already Figure 1 For example, step 302 may be performed by installing a DBMS that already includes a service manager 106 or by installing a plug-in that includes a service manager that uses an already installed DBMS 202 as a runtime environment.

[0109] In one embodiment, the DBMS 102, 202 is started. Starting the DBMS includes loading one or more service libraries into the DBMS and starting the service manager 106. Next, the service manager registers the services contained in the libraries loaded when the DBMS 102, 202 was started. The registration process includes identifying the dependencies of each service to be registered and storing all identified dependencies in a central dependency data structure 107 maintained by the service manager. Thus, the service manager checks that no circular dependencies occur in the data structure 107. In addition, further initialization steps during DBMS startup can be performed.

[0110] After DBMS102, 202 has been started, service manager 106 is suitable for instantiating each service on demand. For example, service manager may include a user interface that allows users to submit queries to service manager to directly execute specific services. In other embodiments, service manager includes an interface to DBMS102, 202, and indirectly receives user requests for specific services via DBMS102, 202. In this case, DBMS102, 202 includes corresponding user interfaces 124, 224. Typically, user interface 124, 224 is a non-SQL interface that enables users to request specific services, such as specific clustering algorithms, specific reports, etc. Not all services maintained by service manager can be accessed or requested by users. For example, some services may be background daemons that may be needed by higher-level services that users are actually interested in.

[0111] When the DBMS is instantiated, some of the services may also be automatically instantiated. Automated instantiation is managed by the service manager. For example, the service manager or the main() method of another class that calls the service manager may include a list of services that should be automatically instantiated when the DBMS is instantiated. The service manager evaluates the dependency data structure 107 to determine whether one of these "early instantiation" services requires some additional services, and if necessary, automatically instantiates these required additional services before instantiating the "early instantiation" service. If one of the additional required services has not yet been registered at the service manager, the service manager is configured to search for the name of the additional required service in a predefined local or remote repository (for example, in a local or remote directory including a set of service libraries). The services found in the search are then automatically loaded into the DBMS and automatically registered at the service manager. The dependencies of these newly and dynamically registered services are also automatically analyzed as described above, and can trigger automatic search and loading of additional libraries from predefined repositories until all services required for the "early instantiation" service are automatically loaded into the DBMS by the service manager and instantiated in the DBMS.

[0112] After the instantiation of DBMS, DBMS can be used to process database query and data analysis tasks, as known in the art. Then, the service manager can receive a request for a specific service from a user or from DBMS or from any other client software. The requested service may not be one of the "early instantiated" services, so it may not be instantiated at the moment of receiving the query. The service manager evaluates the dependency 107 between the requested service and other services 108-114, 208-214 to identify one or more required services that need to be instantiated before the requested service can start and operate correctly. If the requested service requires a service that has not yet been registered at the service manager, the service manager starts searching for the required service in a local or remote library repository, and automatically loads and registers the required service found in the search. If a new service is registered, the dependency 107 is updated to include the dependency of the newly registered service. Then, the service manager automatically instantiates any one of the required services, and then instantiates the requested service. The instantiated service is used to process the data stored in the database managed by the DBMS, and returns the data processing result in response to the service request.

[0113] The service manager can also automatically trigger the shutdown of specific services. For example, service S1 can represent manufacturing steps MS1 involving the production of a first item G1 using a specific machine M. Service S2 can represent manufacturing steps MS2 involving the production of a second item G2 using the same specific machine M. Because machine M cannot be used to produce both the first item G1 and the second item G2 at the same time, services S1 and S2 are mutually exclusive. If service S2 is requested, service S1 needs to be shut down before S2 is instantiated. The service manager can, for example, delay the instantiation of S2 until S1 has completed, and actively shut down S1 once item G1 has been produced.

[0114] Identification of dependencies in the dependency data structure 107 and / or updating of the dependency data structure 107 may be performed using a depth-first search of a dependency tree representing all dependencies of all services registered with the service manager.

[0115] Figure 4 The dependency relationship of multiple services according to an embodiment of the present invention is shown. Figure 4 In the embodiment depicted in , each service is implemented as a singleton class 404 including a getInstance() method, which returns a reference to a single instance object (singleton object) of the corresponding service. More specifically, the getInstance() method returns a reference to an interface 406, while the actual implementation 408 of the service is hidden. Figure 4 The collection of classes and interfaces depicted in does not force the use of interfaces in calling code, but the architecture separates the interface 406 of a specific service because it is actually treated as a singleton. Figure 4 As shown, the separation between the singleton class 404, the interface 406, and the actual service implementation 408 is optional. Figure 4 The software architecture depicted in has the benefit of a cleaner design, but the combination of singleton 404, interface 406, and / or implementation 408 in a single class is possible. For example, singleton 404 and interface 406 can be combined, or interface 406 and implementation 408 can be combined, or all three can be combined. The separation of singleton, interface, and implementation allows different implementations to be used for interface 406 handled by a singleton. This facilitates software testing. For example, when using test objects ("mock objects") instead of real implementations, Figure 4 The class design depicted in allows providing different single instances of singleton 404 during the testing phase and in "real" use cases.

[0116] Figure 5 Services and service managers (whose classes and interfaces can be, for example, Figure 4 408) can be integrated into the overall system architecture. The "singleton instance" 504, 406 understands the interface 508, 406 and the actual service implementation 514, 408. The singleton instance 504, 406 is responsible for registering itself with the service manager 502 (which can also be called a "singleton manager").

[0117] The service manager 502 must "know" each service in order to control the instantiation and shutdown of services as required by other services. Since the service manager 502 is responsible for the instantiation of each singleton 506 representing a service, the service manager must know which implementation class should be instantiated to create a single object for each service interface 508. In addition, each service singleton 506 registers itself with the service manager 502, for example, when it is loaded into the DBMS or after the DBMS is started.

[0118] The service manager 502 actually performs the instantiation of the service singleton 506, and the resulting single instantiated service object is then stored in the singleton class 506 to complete the instantiation so that the service can be subsequently accessed and used. For services (corresponding to singleton instances), for example, for services 512 that are used or implemented as background jobs and for services 510 that are not used or implemented as background jobs, there may be different refinements.

[0119] According to an embodiment, this is achieved by creating a single global variable in the source code of a service class or another class that is functionally associated with the service. For example, a single global variable can be created immediately after the code of the implementation 514 (in the .cpp file of the implementation) of the service is defined. A single global variable can also be created in the code of the service to be registered (in the .cpp file of the service). A single global variable represents a specific service to be registered at the service manager and managed by the service manager. When the variable is created during the startup of the DBMS or DBMS plug-in or add-on (or when loading a library), the type of the variable or the constructor of the class is executed. The constructor is responsible for the registration of the service represented by the variable at the service manager. Therefore, the service manager knows the service object, and since the service-specific variable is a global variable, its existence is always guaranteed. Therefore, the service manager can access a specific service and its implementation to perform actions such as the instantiation, closure and current state query of the service using a specific implementation type.

[0120] According to a preferred embodiment, each service knows which other services it needs. For example, the implementation class 514 of a service knows which other services it accesses in its code because the class names of these other services are mentioned in the source code of the implementation class 514. These other services are also referred to as the "required services" of this service.

[0121] When a service is automatically registered at the service manager, the service manager calls the "getRequiredServices()" function of the service to be registered in order to derive the dependencies of the unregistered service during registration. In C++ code, the getRequiredServices() function may have, for example, the following form:

[0122]

[0123]

[0124] "ServicePrerequisites" is a list of required services whose names can be checked by the compiler at compile time and optionally at design time as well. In addition to the "getRequiredServices" function, the service class may include methods that enable the service manager to initialize and shut down the services represented and / or implemented by the service class. The service class acts as the central entry point for a particular service, although some of the service's functions may actually be implemented in other classes.

[0125] According to an embodiment, the service dependencies automatically obtained by the service manager in response to the getRequiredServices() function call are used to automatically update a data structure including all dependencies of all registered services.

[0126] According to an embodiment, different service implementations are registered at the service manager, and in addition, the service manager is automatically notified of any changes to the service implementation currently in use at runtime of the DBMS. Alternatively, if the new implementation does not have any dependencies at all (such as may be the case for a mock object), a new single instance may be created for the service using a method such as void setInstance(...) and stored in a singleton class 506. This method may be implemented by the Singleton service instance interface 504. This may be advantageous because no additional steps are required to ensure that dependencies are all up to date.

[0127] According to some embodiments, during the instantiation phase, the service manager may determine that a particular service that is required has already been instantiated (e.g., because of an explicit request by a user, or because another explicitly requested service depends on it). In this case, the service manager will return a reference or pointer to the existing service instance, and will not create further instances of that service. In addition, when an already instantiated service object is handed off to a calling process, the service manager does not check the dependencies of the requested service, because the fact that the service has already been instantiated means that all of its dependencies must have been satisfied.

[0128] According to an embodiment, when a global variable of a singleton service instance of a new service is created during process startup—or when a corresponding library loaded for each service is instantiated, registration of a new service at a service manager is automatically performed. During registration of a new service, the service manager adds a representation of the new service to a data structure 107 representing the dependency relationship between the new service and the registered service. For example, the dependency relationship of a service can be represented in the form of a data structure including one or more directed acyclic graphs (e.g., a tree or a set of trees). The new service is represented as an additional node in the graph, wherein the position of the new node in the graph represents the dependency relationship between the new service and the existing service.

[0129] According to a preferred embodiment, the service manager automatically analyzes the dependencies during the registration of the new service in order to determine whether the dependencies of the new service will introduce circular dependencies. For example, different tree traversal algorithms can be used to check whether the graph is free of cycles. In the case of identifying a circular dependency, the registration of the new service is terminated and an error event and / or a warning message is generated. The new service is registered and optionally also instantiated only if the result of the analysis is that the new service and its dependencies do not generate a circular dependency.

[0130] Since the service manager is not aware of the order in which the different services are registered, a registration may identify a required service that has not yet been registered at the service manager. In this case, the dependency check is deferred until the required service is also registered, and the registration of the required service is automatically triggered by the service manager. Deferring the dependency check for any circular dependencies is not a problem, as the dependencies are automatically checked later when the required service is registered.

[0131] Additionally or alternatively, analysis of service dependencies is performed during the instantiation phase of the service. If dependency checking is performed at service instantiation time rather than at service registration time, loading many different service libraries into the DBMS can be facilitated because the service libraries can be loaded in an arbitrary order and will not trigger the generation of error events or warning messages if the service libraries are loaded in a temporal order that does not match their logical dependencies. Since dependencies are only checked at service instantiation time, the process of loading many different service libraries into the DBMS in an arbitrary order is facilitated because the operator of the DBMS does not have to consider logical dependencies during the loading process.

[0132] Figure 6 Depicts a portion of source code of a service class specifying a service implemented as a singleton, wherein the code includes a definition of the service, the definition including static methods initialize(), shutdown() and getPrerequises(), whereby the latter represents a getRequiredServices function. A disadvantage of this implementation is that the required services are returned as strings and must be specified in the source code as (untyped) strings that are not checked by the compiler. Figure 7 A better implementation option is depicted in .

[0133] Figure 7 A portion of source code depicting a more preferred representation of a service. Figure 7 A shows the abstract interface implemented by the service implementation class, the source code of which is in Figure 7 B. The service is implemented as a singleton, whose implementation must define a getRequiredServices method that is configured to return a compiler-checkable object of the required services. In this example, this compiler-checkable object is called "SingletonPrerequisites". The service manager is accessed through Figure 7 A method of the abstract interface partially depicted in part to initialize and shut down the service. These methods can be static methods such as initialize(), shutdown() inherited by the service class. Methods that return compiler-checkable objects rather than strings provide a technical benefit of increasing robustness against typos, name duplications, and class name mismatches that may occur when a programmer specifies a required service class in the source code of the service.

[0134] Figure 7 C shows that the abstract interface may also include a function "registerMySingleton{}" configured to return a registration object "RegisterSingleton". The registration object must be a global variable defined, for example, in a .cpp file. This ensures that the service can be registered before it is instantiated. The registration object makes itself known to the service manager. The registration object binds the service implementation to the interface, but ensures complete encapsulation and hiding of the implementation.

[0135] The present invention may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions thereon, the computer-readable program instructions being used to cause a processor to perform various aspects of the present invention. A computer-readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer-readable storage media includes the following: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punch card or a raised structure in a groove having instructions recorded thereon, and any suitable combination of the above. As used herein, computer-readable storage media should not be interpreted as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (e.g., light pulses passing through fiber-optic cables), or electrical signals transmitted by wires. Computer-readable program instructions as described herein can be downloaded from computer-readable storage media to corresponding computing / processing devices, or downloaded to external computers or external storage devices via networks (e.g., the Internet, local area networks, wide area networks, and / or wireless networks). Networks can include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives computer-readable program instructions from the network, and forwards computer-readable program instructions to be stored in computer-readable storage media in the corresponding computing / processing device. The computer-readable program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages, such as "C" programming language or similar programming languages. The computer-readable program instructions may be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or completely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).In some embodiments, an electronic circuit (including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA)) can execute computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit so as to perform various aspects of the present invention. Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each block of the flowchart and / or block diagram and the combination of blocks in the flowchart and / or block diagram can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, which is executed by a processor of a computer or other programmable data processing device to create a device for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that can instruct a computer, a programmable data processing device, and / or other devices that function in a specific manner, so that a computer-readable storage medium having instructions stored therein includes an article of manufacture, which includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram. Computer-readable program instructions may also be loaded onto a computer, other programmable data processing device, or other device that performs a series of operation steps on a computer, other programmable device or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable device or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram. The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to different embodiments of the present invention. To this end, each box in the flowchart or block diagram may represent a part of a module, segment or instruction, which includes one or more executable instructions for implementing the specified logical functions. In some alternative implementations, the functions marked in the box may not occur in the order marked in the figure. For example, depending on the functions involved, two boxes shown in succession may actually be executed substantially simultaneously, or the boxes may sometimes be executed in reverse order. It will also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system that performs a specified function or action or performs a combination of dedicated hardware and computer instructions.

[0136] Possible combinations of the above features may be any single aspect or any combination of the aspects described below:

[0137] In a first aspect, a computer-implemented method for managing a plurality of services in a DBMS, the services being respectively configured to process data stored or received for storage in a database managed by the DBMS, the method comprising:

[0138] - providing a service manager operatively coupled to said DBMS;

[0139] - automatically and dynamically registering the plurality of services at the service manager while the DBMS is running;

[0140] - The service manager automatically manages dependencies between different services in the plurality of registered services.

[0141] In a second aspect, in combination with the first aspect, the management of the dependency relationships includes instantiating the services according to the dependency relationships, so that when the service manager instantiates a specific one of the services, all services required by the specific service have been instantiated.

[0142] In a third aspect, in combination with any of the first and second aspects, at least some of the services represent steps within a workflow of a product manufacturing process, and at least some of the dependencies represent equipment dependencies, workflow dependencies, material dependencies and / or supply dependencies of physical objects involved in or processed by the product manufacturing process.

[0143] In a fourth aspect, in combination with any one of the first to third aspects, the management of the dependency includes shutting down one or more of the services based on the dependency, wherein, before any one of the one or more services is shut down, the shut down of this one service is delayed until all services that depend on the one service are shut down.

[0144] In a fifth aspect, in combination with any one of the first to fourth aspects, each of the services is implemented according to a singleton design pattern.

[0145] In a sixth aspect, in combination with any one of the first to fifth aspects, the dependency relationships of the services are represented in the form of one or more directed acyclic graphs (DAGs).

[0146] In a seventh aspect, in combination with any one of the first to sixth aspects, the method further comprises adding an additional service to the DBMS, the adding comprising:

[0147] - registering the additional service at the runtime of the DBMS at the service manager;

[0148] - Automatically updating the dependency relationship of the service so that the dependency relationship represents the dependency relationship between the existing service and the additional service.

[0149] In an eighth aspect, in combination with any one of the first to seventh aspects, registration of the service at the service manager is implemented in the form of a decentralized registration process.

[0150] In a ninth aspect, in combination with any one of the first to eighth aspects, each of the plurality of services implements an interface including a method for registering the service at the service manager.

[0151] In a tenth aspect, in combination with any one of the first to ninth aspects, each of the plurality of services comprises an instantiateService function and a shutdownService function, the instantiateService function and the shutdownService function being accessible by the service manager mapper, the method further comprising:

[0152] - The service manager uses instantiateService functions and shutdownService functions of the multiple services to dynamically coordinate instantiation and shutdown of the multiple services according to the dependency relationships.

[0153] In an eleventh aspect, in combination with any one of the first to tenth aspects, each of the plurality of services comprises a getRequiredServices function, the getRequiredServices function being accessible by the service manager, the getRequiredServices function being configured to return names of one or more required services, each required service being a service that needs to be instantiated before instantiating the service comprising the getRequiredServices function, and the registration of each of the plurality of services comprises:

[0154] -The service manager calls the getRequiredServices function of the service to be registered;

[0155] - automatically checks whether the name of the required service returned by the getRequiredService function identifies a registered service; and

[0156] -The service manager automatically registers any unregistered service returned by the getRequiredService function.

[0157] In a twelfth aspect, in combination with the eleventh aspect, the getRequiredServices function, when called, is configured to:

[0158] - converting the class name of the one or more required services into a corresponding string,

[0159] - converting the one or more strings into a compiler-checkable object; and

[0160] -Returns the compiler-checkable object to the service manager that called the getRequiredServices function.

[0161] In the thirteenth aspect, in combination with any one of the first to eleventh aspects, at least one of the multiple services specifies one or more other services required by the at least one service, and the specification of the one or more other services is in the form of a list of class names checked by the compiler during compile time, wherein, if the service class includes the name of the required service and the compiler cannot identify a class whose name matches the name of the required service, an error is raised when compiling the service class.

[0162] In the fourteenth aspect, in combination with the thirteenth aspect, when the service class includes the name of the required service and the compiler cannot identify a class whose name matches the name of the required service, the name of the required service is highlighted in the service class program code at design time.

[0163] In a fifteenth aspect, in combination with any one of the first to fourteenth aspects, the method further comprises:

[0164] - during registration of one of the services at the service manager, automatically identifying by the service manager one or more other services required by the one service to be registered;

[0165] - Updating the dependency relationships between the plurality of registered services, the service to be registered and the services identified during registration of the one service, so that the dependency relationships also include the dependency relationships between the service to be registered and other required services.

[0166] In a sixteenth aspect, in combination with any one of the first to fifteenth aspects, the service manager is a component of an application implemented as an extended application (plug-in or add-on) of the DBMS, or is an integrated component of the DBMS.

[0167] In a seventeenth aspect, in combination with any one of the first to sixteenth aspects, the method further comprises:

[0168] a) The DBMS receives a service request for a specific service;

[0169] b) identifying, by the service manager, a requested service within the plurality of services;

[0170] c) identifying, by the service manager, one or more other services in the registered services required for the requested service;

[0171] For each of the identified one or more other services:

[0172] i. Check whether the other services have been instantiated;

[0173] ii. If the other service has been instantiated, go to the next service identified in step c;

[0174] iii. If the other service has not been instantiated, instantiate the other service and go to the next service identified in step c.

[0175] In an eighteenth aspect, in combination with any one of the first to seventeenth aspects, a computer-readable storage medium having program instructions embodied therein, the program instructions being executable by a processor to cause the processor to perform a method for managing a plurality of services in a DBMS, the services being respectively configured to process data stored or received for storage in a database managed by the DBMS, the method comprising:

[0176] - providing a service manager operatively coupled to said DBMS;

[0177] - automatically and dynamically registering the plurality of services at the service manager while the DBMS is running;

[0178] - The service manager automatically manages dependencies between different services in the plurality of registered services.

[0179] In a nineteenth aspect, in combination with any one of the first to eighteenth aspects, a computer system comprising:

[0180] -DBMS;

[0181] - a service manager operatively coupled to said DBMS;

[0182] The service manager is configured to:

[0183] automatically and dynamically registering at the service manager, at runtime of the DBMS, a plurality of services, the services being respectively configured to process data stored or received for storage in a database managed by the DBMS; and

[0184] Automatically manage dependencies between different services in the plurality of registry services.< / catalogmanager> < / tracer> < / configurator>

Claims

1. A computer-implemented method for managing a plurality of DBMS services in a database management system DBMS, the method comprising: providing a service manager operatively coupled to the DBMS; The plurality of DBMS services are automatically and dynamically registered at the service manager while the DBMS is running, wherein: Each of the plurality of DBMS services processes data stored in a database managed by the DBMS, respectively; and Each of the plurality of DBMS services is implemented as a singleton, wherein a singleton is a software object implemented such that it is ensured that only one instance of a software object of a particular type can be instantiated at a time; The service manager manages the dependencies between multiple registered DBMS services, wherein: managing the dependency based on source code of the DBMS service specifying the dependency services required by the DBMS service; identifying and updating the dependencies at runtime of the DBMS based on performing a depth-first search of a dependency tree representing dependencies of DBMS services registered at the service manager; Managing the dependencies also includes: In response to creating a global variable in the source code, executing a constructor of a type associated with the global variable; and Detecting a circular dependency based on the dependency of the DBMS service represented in the form of a directed acyclic graph (DAG); and The global variable corresponds to a specific DBMS service to be registered at and managed by the service manager.

2. The computer-implemented method of claim 1, wherein: The management of the dependency relationships includes instantiating the DBMS services according to the dependency relationships, so that when the service manager instantiates a specific DBMS service among the DBMS services, all DBMS services required by the specific DBMS service have been instantiated.

3. A computer-implemented method as described in any of the preceding claims, wherein at least some of the DBMS services represent steps within a workflow of a product manufacturing process, and wherein at least some of the dependencies represent equipment dependencies, workflow dependencies, material dependencies, and supply dependencies of physical objects involved in the product manufacturing process.

4. The computer-implemented method of claim 1 or 2, the managing of the dependencies comprising shutting down one or more of the DBMS services according to the dependencies, wherein: Before any of the one or more DBMS services are shut down, shutting down of a first DBMS service is delayed until all DBMS services dependent on the first DBMS service are shut down.

5. The computer-implemented method of claim 1 or 2, wherein: Each of the DBMS services is implemented according to the singleton design pattern.

6. The computer-implemented method of claim 1 or 2, further comprising adding additional DBMS services to the DBMS, the adding comprising: - registering the additional DBMS service at the runtime of the DBMS at the service manager; - Automatically updating the dependency relationship of the DBMS service so that the dependency relationship represents the dependency relationship between the existing DBMS service and the additional DBMS service.

7. The computer-implemented method of claim 1 or 2, wherein: The registration of the DBMS service at the service manager is implemented in the form of a decentralized registration process.

8. The computer-implemented method of claim 1 or 2, wherein: Each of the plurality of DBMS services implements an interface including a method for registering the DBMS service at the service manager.

9. The computer-implemented method of claim 1 or 2, wherein: Each of the plurality of DBMS services includes an instantiateService function and a shutdownService function, and the instantiateService function and the shutdownService function are accessible by the service manager, and the method further includes: - The service manager uses instantiateService functions and shutdownService functions of the multiple DBMS services to dynamically coordinate instantiation and shutdown of the multiple DBMS services according to the dependency relationships.

10. The computer-implemented method of claim 1 or 2, wherein: Each of the plurality of DBMS services includes a getRequiredServices function, which is accessible by the service manager and configured to return the names of one or more required DBMS services, each required DBMS service being a DBMS service that needs to be instantiated before instantiating the DBMS service including the getRequiredServices function, and the registration of each of the plurality of DBMS services includes: -The service manager calls the getRequiredServices function of the DBMS service to be registered; - automatically checking whether the name of the required DBMS service returned by the getRequiredService function identifies a registered DBMS service; and - The service manager automatically registers any DBMS service that is not registered and returned by the getRequiredService function.

11. The computer-implemented method of claim 10, wherein the getRequiredServices function, when called, is configured to: - converting the class name of the one or more required DBMS services into a corresponding string, - converting said string into a compiler-checkable object; and -Returns the compiler-checkable object to the service manager that called the getRequiredServices function.

12. The computer-implemented method of claim 1 or 2, wherein at least one of the plurality of DBMS services specifies one or more other DBMS services required by the at least one DBMS service, the specification of the one or more other DBMS services being in the form of a list of class names that are checked by a compiler during compile time, wherein In the event that a DBMS service class includes the name of a required DBMS service and the compiler cannot identify a class whose name matches the name of the required DBMS service, an error is raised when compiling the DBMS service class.

13. The computer-implemented method of claim 12, wherein: In response to the DBMS service class including the name of the required DBMS service and the compiler being unable to identify a class whose name matches the name of the required DBMS service, highlighting the name of the required DBMS service in the DBMS service class program code at design time.

14. The computer-implemented method of claim 1 or 2, further comprising: - during registration of one of the DBMS services at the service manager, automatically identifying by the service manager one or more other DBMS services required by the DBMS service to be registered; - Updating the dependency relationship between the plurality of registered DBMS services, the DBMS service to be registered and the DBMS service identified during the registration of the one DBMS service, so that the dependency relationship also includes the dependency relationship between the DBMS service to be registered and other required DBMS services.

15. The computer implemented method of claim 1 or 2, the service manager being a component implemented as an application selected from the group consisting of: an extension application of the DBMS, and an integrated component of the DBMS.

16. The computer-implemented method of claim 1 or 2, further comprising: The DBMS receives a DBMS service request for a specific DBMS service; identifying, by the service manager, a requested DBMS service within the plurality of DBMS services; identifying, by the service manager, one or more other DBMS services among the registered DBMS services required by the requested DBMS service; as well as For each of the identified one or more other DBMS services: In response to the other DBMS service not being instantiated, the other DBMS service is instantiated.

17. A computer-readable storage medium having program instructions embodied therein, the program instructions being executable by a processor to cause the processor to perform a method for managing a plurality of DBMS services in a database management system DBMS, the method comprising: providing a service manager operatively coupled to the DBMS; The plurality of DBMS services are automatically and dynamically registered at the service manager while the DBMS is running, wherein: Each of the plurality of DBMS services processes data stored in a database managed by the DBMS, respectively; and Each of the plurality of DBMS services is implemented as a singleton, wherein a singleton is a software object implemented such that it is ensured that only one instance of a software object of a particular type can be instantiated at a time; The service manager manages the dependencies between multiple registered DBMS services, wherein: managing the dependency based on source code of the DBMS service specifying the dependency services required by the DBMS service; identifying and updating the dependencies at runtime of the DBMS based on performing a depth-first search of a dependency tree representing dependencies of DBMS services registered at the service manager; Managing the dependencies also includes: In response to creating a global variable in the source code, executing a constructor of a type associated with the global variable; and Detecting a circular dependency based on the dependency of the DBMS service represented in the form of a directed acyclic graph (DAG); and The global variable corresponds to a specific DBMS service to be registered at and managed by the service manager.

18. A computer system comprising: Database Management System DBMS; a service manager operatively coupled to the DBMS; and The service manager is configured to: A plurality of DBMS services are automatically and dynamically registered at the service manager at runtime of the DBMS, wherein: Each of the plurality of DBMS services processes data stored in a database managed by the DBMS, respectively; and Each of the plurality of DBMS services is implemented as a singleton, wherein a singleton is a software object implemented such that it is ensured that only one instance of a software object of a particular type can be instantiated at a time; and Manages dependencies between multiple registered DBMS services, including: managing the dependency based on source code of the DBMS service specifying the dependency services required by the DBMS service; identifying and updating the dependencies at runtime of the DBMS based on performing a depth-first search of a dependency tree representing dependencies of DBMS services registered at the service manager; Managing the dependencies also includes: In response to creating a global variable in the source code, executing a constructor of a type associated with the global variable; and Detecting a circular dependency based on the dependency of the DBMS service represented in the form of a directed acyclic graph (DAG); and The global variable corresponds to a specific DBMS service to be registered at and managed by the service manager.