A resource access method, apparatus and related device
By defining the association between API interfaces and middleware in the functional component adaptation layer, the application layer and middleware are decoupled, solving the operational difficulties when underlying resources change, and improving the efficiency of IT operation and maintenance management platform and cluster high availability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2024-11-13
- Publication Date
- 2026-06-05
Smart Images

Figure CN119583626B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network operation and maintenance technology, and in particular to a resource access method, apparatus and related equipment. Background Technology
[0002] With the ongoing research into digital transformation and the increasing complexity of enterprise IT environments, there is a need to cope with diverse devices, systems, and applications. Building an IT operations and maintenance management platform can better adapt to and manage these diverse IT resources.
[0003] In the process of building the operation and maintenance platform, more requirements are put forward for the platform's integrated architecture, cluster capabilities, high reliability, resource utilization efficiency, and user experience. Summary of the Invention
[0004] This application provides a resource access method, apparatus, and related equipment.
[0005] Firstly, this application provides a resource access method applied to an operation and maintenance platform. The operation and maintenance platform includes a functional component adaptation layer, which encapsulates middleware adapted to various underlying resources. The functional component adaptation layer also encapsulates various functional API interfaces and defines the association relationships between each middleware and its corresponding functional API interface. The method includes:
[0006] Receive resource access requests from the application layer to access target resources, where the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource;
[0007] Based on the resource access request, determine the target resource that the application layer needs to access, and determine the target API interface of the functional component adaptation layer that needs to be called to access the target resource.
[0008] Based on the association between the target resource and the middleware and corresponding functional API interfaces defined in the functional component adaptation layer, the target middleware associated with the target API is determined.
[0009] Access the target resource based on the target middleware.
[0010] Optionally, the method further includes:
[0011] When the first middleware encapsulated in the functional component adaptation layer is detected to be replaced by the second middleware, the association between the second middleware and the corresponding functional API interface is defined.
[0012] Optionally, the functional component adaptation layer encapsulates the basic operation API interfaces of each middleware, and the association between each middleware and its corresponding functional API interface is the association between the basic operation API interface of each middleware and its corresponding functional API interface.
[0013] Optionally, each middleware can run as a container.
[0014] Secondly, this application provides a resource access device applied to an operation and maintenance platform. The operation and maintenance platform includes a functional component adaptation layer, which encapsulates middleware adapted to various underlying resources. The functional component adaptation layer also encapsulates various functional API interfaces and defines the association relationships between each middleware and its corresponding functional API interface. The device includes:
[0015] The receiving unit is used to receive resource access requests from the application layer to access the target resource, wherein the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource.
[0016] The determining unit is configured to determine, based on the resource access request, the target resource that the application layer needs to access, and the target API interface of the functional component adaptation layer that needs to be called to access the target resource.
[0017] The determining unit is further configured to determine the target middleware associated with the target API based on the association relationship between the target resource and each middleware and corresponding functional API interface defined in the functional component adaptation layer.
[0018] An execution unit is used to access the target resource based on the target middleware.
[0019] Optionally, the device further includes:
[0020] The definition unit, when it detects that the first middleware encapsulated in the functional component adaptation layer is replaced by the second middleware, is used to define the association between the second middleware and the corresponding functional API interface.
[0021] Optionally, the functional component adaptation layer encapsulates the basic operation API interfaces of each middleware, and the association between each middleware and its corresponding functional API interface is the association between the basic operation API interface of each middleware and its corresponding functional API interface.
[0022] Optionally, each middleware can run as a container.
[0023] Thirdly, embodiments of this application provide a resource access device, which includes:
[0024] Memory, used to store program instructions;
[0025] A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of the first aspects above, according to the obtained program instructions.
[0026] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of the method as described in any of the first aspects above.
[0027] In summary, the resource access method provided in this application is applied to an operation and maintenance platform. The operation and maintenance platform includes a functional component adaptation layer, which encapsulates middleware adapted to various underlying resources and various functional API interfaces. The functional component adaptation layer defines the association relationships between each middleware and its corresponding functional API interface. The method includes: receiving a resource access request from an application layer to access a target resource, wherein the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource; determining the target resource to be accessed by the application layer based on the resource access request, and determining the target API interface of the functional component adaptation layer to be invoked to access the target resource; determining the target middleware associated with the target API based on the target resource and the association relationships between each middleware and its corresponding functional API interface defined by the functional component adaptation layer; and accessing the target resource based on the target middleware.
[0028] The resource access method provided in this application encapsulates the functional component adaptation layer in a black-box manner. Externally, it encapsulates corresponding API interfaces for the application layer to call, and internally, it encapsulates several middlewares that the called resources depend on. By constructing a mapping relationship between each API interface and the middleware, the association relationship between the application layer and each middleware is realized. In scenarios where a specified resource is modified or replaced, the encapsulation is decoupled, and only the association relationship between each API interface and the middleware needs to be adjusted. The application layer is unaware of this and does not need to adjust the association relationship between each application and the replaced middleware, which greatly reduces the workload of operation and maintenance, improves the efficiency of improvement, enhances the high probability capability of the cluster, and improves the efficiency of software iteration and evolution. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.
[0030] Figure 1 A detailed flowchart of a resource access method provided in an embodiment of this application;
[0031] Figure 2 This is a schematic diagram of the structure of a resource access device provided in an embodiment of this application;
[0032] Figure 3 This is a schematic diagram of the hardware architecture of a resource access device provided in an embodiment of this application. Detailed Implementation
[0033] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0034] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0035] For example, see Figure 1 The diagram shown is a detailed flowchart of a resource access method provided in an embodiment of this application. This method is applied to an operation and maintenance platform, which includes a functional component adaptation layer. The functional component adaptation layer encapsulates middleware adapted to various underlying resources and various functional API interfaces. The functional component adaptation layer defines the association relationships between each middleware and its corresponding functional API interface. The method includes the following steps:
[0036] Step 100: Receive a resource access request from the application layer to access the target resource, wherein the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource.
[0037] The application layer refers to the user-facing layer. Specific business applications can include services such as monitoring, automation, configuration management, data analysis, alarms, reports, dashboards, and AIGC. The underlying resources can include databases. Taking a database as an example, database operations include adding, deleting, querying, and modifying data. Different databases use different middleware, and the driver / client / API call formats / rules provided to the outside world are also different.
[0038] In this embodiment, a functional component adaptation layer is encapsulated. Internally, this layer encapsulates middleware corresponding to each underlying resource; externally, it encapsulates various functional API interfaces for the application layer. It should be noted that the mapping relationship between the various functional API interfaces encapsulated in the functional component adaptation layer and the applications included in the application layer remains unchanged. If application 1 needs to execute function 1, it can call the corresponding functional API interface 1 based on the preset mapping relationship. The functional component adaptation layer also defines the association relationship between each middleware and its corresponding functional API interface. That is, when it is determined that application 1 executes function 1 and thus calls functional API interface 1, the middleware to be called can be further determined based on the defined association relationship between each middleware and its corresponding functional API interface.
[0039] Step 110: Based on the resource access request, determine the target resource that the application layer needs to access, and determine the target API interface of the functional component adaptation layer that needs to be called to access the target resource.
[0040] Specifically, the resource access request is parsed to determine the target resource information that the application layer needs to access. Based on the target resource information, the API interface encapsulated by the functional component adaptation layer that needs to be called to access the resource is determined.
[0041] For example, suppose API interface 1 of the functional adaptation layer component is associated with middleware 1 for resource 1 and middleware 2 for resource 2, and API interface 2 of the functional adaptation layer component is associated with middleware 3 for resource 3. Then, if the resource access request is parsed and it is determined that the resource that the application layer needs to access is resource 1, then API interface 1 of the functional adaptation layer component will be called.
[0042] Step 120: Based on the association between the target resource and the middleware and corresponding functional API interfaces defined in the functional component adaptation layer, determine the target middleware associated with the target API.
[0043] The following explanation will continue using the example of API interface 1 of the functional adaptation layer component, which is associated with middleware 1 of resource 1 and middleware 2 of resource 2. When the application layer accesses resource 1, it calls API interface 1 of the functional adaptation layer component. Based on resource 1, middleware 1 and middleware 2 associated with API interface 1 of the functional adaptation layer component, the target middleware associated with API interface 1 of the functional adaptation layer component is determined to be middleware 1 (the middleware that accessing resource 1 depends on).
[0044] Step 130: Access the target resource based on the target middleware.
[0045] Specifically, by calling the target API interface of the functional adaptation layer component, the target middleware is indirectly called, thereby enabling access to the target resource.
[0046] In this embodiment, each middleware runs as a container.
[0047] The above method may also include the following steps:
[0048] When the first middleware encapsulated in the functional component adaptation layer is detected to be replaced by the second middleware, the association between the second middleware and the corresponding functional API interface is defined.
[0049] In other words, when the underlying resource type (vendor / model) changes, its adapted command format and calling method will also change, and the corresponding middleware will need to be replaced. For example, if a database from vendor A needs to be replaced with a database from vendor B, then the middleware A that the operation and maintenance system relies on for the database from vendor A needs to be replaced. The application layer includes several applications. In this embodiment, each application is directly associated with the API interface of the functional component adaptation layer, rather than directly associated with the middleware. When it is determined that one middleware is to be replaced with another middleware, it is only necessary to change the mapping relationship between the interface of each middleware and the API interface of the functional component adaptation layer within the functional component adaptation layer. This is imperceptible to the user and greatly reduces the modification of the system framework code.
[0050] For example, if enterprise users require software vendors to modify the system according to specified databases and middleware, the operation and maintenance platform software designed based on the above architecture can meet the requirements with extremely low R&D costs, thereby satisfying market demands and improving customer satisfaction and product competitiveness.
[0051] The resource management method provided in this application embodiment will be described in detail below with reference to specific application scenarios.
[0052] First, a container cluster is built by running Kubernetes (K8S) and Docker on the operating system (OS). The software is based on a microservice containerized architecture, which is easy to scale horizontally and vertically (scaling up and down cluster nodes, scaling up and down the number of POD replicas, setting POD limits, etc.). On the container cluster, by encapsulating the database adapter layer and the middleware adapter layer, the upper-layer business applications are shielded from the awareness of different databases and middleware operations. They do not need to care about these operations and can directly call the encapsulated APIs to perform operations.
[0053] Advantages of using the above method:
[0054] The cluster's HA (High Availability) capability has been greatly improved. Since there is no need to worry about the direct database and middleware, and the database and middleware are both built on container-based cluster services, the upper-layer business applications can be unaware of the cluster node failure.
[0055] For users who require specific middleware or databases, the adapter layer can reduce development costs and significantly improve development efficiency. Only the Platform layer needs to iterate the adapter, and the upper-layer business applications do not need to worry about it.
[0056] Based on the same inventive concept as the inventors' embodiments described above, see, for example, the following: Figure 2 The diagram shown is a structural schematic of a resource access device provided in an embodiment of this application. This device is applied to an operation and maintenance platform, which includes a functional component adaptation layer. The functional component adaptation layer encapsulates middleware adapted to various underlying resources, and encapsulates various functional API interfaces. The functional component adaptation layer defines the association relationships between each middleware and its corresponding functional API interface. The device includes:
[0057] The receiving unit 20 is used to receive a resource access request from the application layer to access the target resource, wherein the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource.
[0058] The determining unit 21 is used to determine the target resource that the application layer needs to access based on the resource access request, and to determine the target API interface of the functional component adaptation layer that needs to be called to access the target resource.
[0059] The determining unit 21 is further configured to determine the target middleware associated with the target API based on the association relationship between the target resource and each middleware and corresponding functional API interface defined in the functional component adaptation layer.
[0060] Execution unit 22 is used to access the target resource based on the target middleware.
[0061] Optionally, the device further includes:
[0062] The definition unit, when it detects that the first middleware encapsulated in the functional component adaptation layer is replaced by the second middleware, is used to define the association between the second middleware and the corresponding functional API interface.
[0063] Optionally, the functional component adaptation layer encapsulates the basic operation API interfaces of each middleware, and the association between each middleware and its corresponding functional API interface is the association between the basic operation API interface of each middleware and its corresponding functional API interface.
[0064] Optionally, each middleware can run as a container.
[0065] These units can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when one of these units is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these units can be integrated together to form a system-on-a-chip (SOC).
[0066] Furthermore, regarding the resource access device provided in this application embodiment, from a hardware perspective, the hardware architecture diagram of the resource access device can be found in [reference needed]. Figure 3 As shown, the resource access device may include: a memory 30 and a processor 31.
[0067] The memory 30 is used to store program instructions; the processor 31 calls the program instructions stored in the memory 30 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar, and will not be described again here.
[0068] Optionally, this application also provides a resource access device, including at least one processing element (or chip) for performing the above method embodiments.
[0069] Optionally, this application also provides a program product, such as a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the above-described method embodiments.
[0070] Here, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, a machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0071] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0072] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0073] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0074] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0075] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0076] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0077] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A resource access method, characterized in that, The method is applied to an operations and maintenance platform, which includes a functional component adaptation layer. This layer encapsulates middleware adapted to various underlying resources and various functional API interfaces. The layer defines the relationships between each middleware and its corresponding functional API interface. Receive resource access requests from the application layer to access target resources, where the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource; Based on the resource access request, determine the target resource that the application layer needs to access, and determine the target API interface of the functional component adaptation layer that needs to be called to access the target resource. Based on the association between the target resource and the middleware and corresponding functional API interfaces defined in the functional component adaptation layer, the target middleware associated with the target API is determined. Access the target resource based on the target middleware; When the first middleware encapsulated in the functional component adaptation layer is detected to be replaced by the second middleware, the association between the second middleware and the corresponding functional API interface is defined.
2. The method as described in claim 1, characterized in that, The functional component adaptation layer encapsulates the basic operation API interfaces of each middleware, and the association between each middleware and its corresponding functional API interface is the association between the basic operation API interface of each middleware and its corresponding functional API interface.
3. The method as described in claim 1, characterized in that, Each middleware component runs as a container.
4. A resource access device, characterized in that, The device is applied to an operations and maintenance platform, which includes a functional component adaptation layer. This layer encapsulates middleware adapted to various underlying resources and various functional API interfaces. The layer defines the relationships between each middleware and its corresponding functional API interface. The receiving unit is used to receive resource access requests from the application layer to access the target resource, wherein the application layer's access to an underlying resource depends on the middleware corresponding to that underlying resource. The determining unit is configured to determine, based on the resource access request, the target resource that the application layer needs to access, and the target API interface of the functional component adaptation layer that needs to be called to access the target resource. The determining unit is further configured to determine the target middleware associated with the target API based on the association relationship between the target resource and each middleware and corresponding functional API interface defined in the functional component adaptation layer. An execution unit is configured to access the target resource based on the target middleware; The definition unit, when it detects that the first middleware encapsulated in the functional component adaptation layer is replaced by the second middleware, is used to define the association between the second middleware and the corresponding functional API interface.
5. The apparatus as described in claim 4, characterized in that, The functional component adaptation layer encapsulates the basic operation API interfaces of each middleware, and the association between each middleware and its corresponding functional API interface is the association between the basic operation API interface of each middleware and its corresponding functional API interface.
6. The apparatus as claimed in claim 4, characterized in that, Each middleware component runs as a container.
7. A resource access device, characterized in that, The resource access device includes: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of claims 1-3 according to the obtained program instructions.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing the computer to perform the steps of the method as described in any one of claims 1-3.