CN115208764A - Resource pool-based request response method, device and medium thereof - Google Patents

Resource pool-based request response method, device and medium thereof Download PDF

Info

Publication number
CN115208764A
CN115208764A CN202210890256.9A CN202210890256A CN115208764A CN 115208764 A CN115208764 A CN 115208764A CN 202210890256 A CN202210890256 A CN 202210890256A CN 115208764 A CN115208764 A CN 115208764A
Authority
CN
China
Prior art keywords
resource
request response
request
resources
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210890256.9A
Other languages
Chinese (zh)
Inventor
刘畅
刘帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Priority to CN202210890256.9A priority Critical patent/CN115208764A/en
Publication of CN115208764A publication Critical patent/CN115208764A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0273Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using web services for network management, e.g. simple object access protocol [SOAP]
    • H04L41/0293Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using web services for network management, e.g. simple object access protocol [SOAP] for accessing web services by means of a binding identification of the management service or element

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a request response method, a device and a medium based on a resource pool, which relate to the technical field of software development and are used for responding to a request sent by a client, and aiming at the problems that the compatibility is poor when the request is responded at present and the multi-field request cannot be well responded, the request response method based on the resource pool is provided. Therefore, the description file is defined, and the resource model is abstracted into a resource model based on the unified specification by the idea of a resource pool, so that resources in various different technical fields can be called based on the unified specification, and further, more extensive resources can be called when the request response is carried out, more diverse services are provided, more diverse requests are responded, and the universality is greatly enhanced.

Description

Resource pool-based request response method, device and medium thereof
Technical Field
The present application relates to the field of software development technologies, and in particular, to a request response method and apparatus based on a resource pool, and a medium thereof.
Background
In today's computer domain, systems or platforms for implementing different functions may implement data interaction according to different interface specifications to implement corresponding functions.
The interface specification defines data specifications and message specifications for data interaction with other systems, that is, when an external device inputs data to the system or the platform through an interface, the input data is defined by a predefined format standard, so that the system or the platform can identify and utilize the resource.
At present, because the interface specification has strong specialization, data in the technical field to which the interface specification belongs is generally only defined, and the interface specification has poor compatibility with other fields and cannot identify or utilize resources in other technical fields. Therefore, when the request information is processed by the system providing service, certain requirements are required in the field of the request information, and the requirements are required to meet the interface specification which is the basis of the current system, so that the types of the processed requests are limited, and the universality is influenced.
Therefore, a request response method based on a resource pool is urgently needed by those skilled in the art, and the problem that the compatibility is poor when the request response is performed, and the multi-domain request cannot be responded well is solved.
Disclosure of Invention
The application aims to provide a request response method, a request response device and a request response medium based on a resource pool, and solve the problems that the compatibility is poor and the multi-field request cannot be well responded when the request response is carried out at present.
In order to solve the above technical problem, the present application provides a request response method based on a resource pool, including:
receiving a request sent by a client, and calling a corresponding resource model according to the request to obtain a request response result;
the Resource model comprises Resource resources and Task resources; the Resource is formed by abstracting the minimum Resource unit capable of providing service capacity in the Resource pool, the Resource is stored in a description file form, and the concrete attributes of the description file include: type, state, whether occupied, sharable or not, and a link to an associated Task resource; the Task resource is formed by abstracting behaviors used for consuming service capacity in a resource pool, is stored in a description file form, and concrete attributes of the description file comprise: status, links to associated Resource resources, and Action operations; the Action operation is any one of start, pause, stop, reset and delete;
and sending the request response result to the client.
Preferably, the resource model further comprises a collection resource;
the collection resource is stored in the form of a description file, which includes: the number of resource models included, and a link to each resource model.
Preferably, the resource model further includes account resources, role resources and authority resources:
the account resource, the role resource and the authority resource are stored in the form of description files, and the description files respectively comprise respective attribute information.
Preferably, the description file is a schema file generated according to the CSDL language.
Preferably, the method further comprises the following steps:
when the request is time-consuming operation, the response head points to the uniform resource identifier representing the time-consuming operation, and the response head is returned to the client.
Preferably, the method further comprises the following steps:
when the request is a subscription request, creating a storage address for storing a result obtained by calling the resource model;
and returning the uniform resource identifier pointing to the storage address to the client as a subscription request response result.
Preferably, the method further comprises the following steps:
when a subscription request sent by a client is received, establishing long connection with the client based on an SSE mode;
correspondingly, the sending the request response result to the client comprises the following steps:
and sending the request response result to the client through the long connection.
In order to solve the above technical problem, the present application further provides a request response device based on a resource pool, including:
the resource calling module is used for receiving a request sent by the client and calling a corresponding resource model according to the request to obtain a request response result; wherein the Resource model comprises Resource resources and Task resources; the Resource is formed by abstracting the minimum Resource unit capable of providing service capacity in the Resource pool, the Resource is stored in a description file form, and the concrete attributes of the description file comprise: type, state, whether occupied, whether sharable, and link to associated Task resources; the Task resource is abstracted by behaviors used for consuming service capacity in the resource pool, the Task resource model is stored in a description file form, and concrete attributes of the description file comprise: status, links to associated Resource models, and Action operations; the Action operation is any one of start, pause, stop, reset and delete;
and the result returning module is used for sending the request response result to the client.
Preferably, the method further comprises the following steps:
and the asynchronous operation module is used for pointing to the uniform resource identifier representing the time-consuming operation through the response header when the request is the time-consuming operation, and returning the response header to the client.
The first subscription module is used for creating a storage address for storing a result acquired by calling the resource model when the request is a subscription request; and returning the uniform resource identifier pointing to the storage address to the client as a subscription request response result.
The second subscription module is used for establishing long connection with the client based on an SSE mode when receiving a subscription request sent by the client; correspondingly, the sending the request response result to the client comprises the following steps: and sending the request response result to the client through the long connection.
In order to solve the above technical problem, the present application further provides a request response apparatus based on a resource pool, including:
a memory for storing a computer program;
a processor for implementing the steps of the resource pool based request response method as described above when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the resource pool-based request response method as described above.
According to the request response method based on the resource pool, service resources in most technical fields can be generally divided into consumption resources used for being consumed to support service completion and execution resources used for consuming resources to realize service functions according to functions, and the two resources are one of the most basic resources used for providing services. Therefore, the description file is defined, the resource model based on the unified specification is abstracted by the idea of the resource pool, so that the resources in various different technical fields can be defined based on the unified specification, and further, the wider resources can be called when the request response is carried out, more various services are provided, more requests are responded, and the universality is greatly enhanced.
The resource pool-based request response device and the computer-readable storage medium provided by the application correspond to the method and have the same effects.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is a flowchart of a resource pool-based request response method according to the present invention;
fig. 2 is a structural diagram of a request response device based on a resource pool according to the present invention;
fig. 3 is a block diagram of another resource pool-based request response apparatus according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a request response method, a device and a medium based on a resource pool.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
Resource pooling is the abstraction of a program's services into a capability, which is then abstracted into a resource, so that the program can provide services as if it were a pool of resources. The consumption of a service by a customer is the availability of resources in the resource pool. The abstraction method is not limited to what the provided service is, what service is abstracted into what resource, and the corresponding resource is used, so that the abstraction method can be applied to different fields and has good universality.
To facilitate understanding of the application of the above-mentioned resource pooling concept in different technical fields, the following is briefly described with reference to examples:
taking a virtualization management platform or a k8s (kubernets, a container arrangement engine) container management platform as an example, the above concept of resource pooling is adopted to design an interface specification, that is, computing resources, storage resources and network resources are abstracted into different resource pools, and requests such as creating and using virtual machines or containers are abstracted into consumption of the resource pools, so as to implement resource calling and response to the requests.
For various interface specifications, the interface specification is the definition of data specification and message specification for data interaction with other systems, that is, when an external device inputs data to the system or platform through an interface, the input data is defined according to a predefined format standard, so that the system or platform can identify and utilize the resource to achieve the purpose of responding to a specific request for calling the resource. In consideration of the respective specialties of different technical fields, the used resources are different, and the situation that the resources can be intercommunicated with each other is also extremely rare. Therefore, the existing management platform and other devices are all based on the interface specification defined in the technical field, and perform data communication with the devices in the field which are also based on the same interface specification, the interface specifications between different fields cannot be universal, that is, only a system based on a specific interface specification can respond to a request in a specific technical field.
Based on the above problem, as shown in fig. 1, the present application provides a request response method based on a resource pool, including:
s11: and receiving a request sent by the client, and calling a corresponding resource model according to the request to obtain a request response result.
S12: and sending a request response result to the client.
Wherein the Resource model comprises Resource resources and Task resources; the Resource is formed by abstracting the minimum Resource unit capable of providing service capacity in the Resource pool, the Resource is stored in a description file form, and the concrete attributes of the description file include: type, state, whether occupied, whether sharable, and link to associated Task resources; the Task resource is formed by abstracting behaviors used for consuming service capacity in a resource pool, the Task resource model is stored in a description file form, and the concrete attributes of the description file comprise: status, links to associated Resource models, and Action operations; the Action operation is any one of start, pause, stop, reset, and delete.
For Resource resources, for example, the service provider abstracts the minimum Resource unit capable of providing service capability in the Resource pool into a unit of Resource, that is, the service consumer needs to consume at least one Resource to satisfy the request sent by the service consumer.
The same applies to the Task resources, where a service consumer abstracts the behavior of consuming the service capability in the Resource pool into the Task resources, and one Task Resource may need to consume one or more Resource resources, that is, one Task Resource needs to consume at least one Resource, so as to obtain the response result corresponding to the request.
The description of the Resource model may use an existing specification, for example, based on Open Data Protocol (OData), and generate a corresponding description file using Common Schema Definition Language (CSDL) Language, so as to specifically describe the abstracted Resource and Task Resource, so as to facilitate the system utilization. Or the application programming interface (OpenAPI) protocol is used for description, which is not limited in the present application, and the purpose is to implement the request response method provided in the present application by using the existing protocol specification, so as to reduce the use threshold.
However, this embodiment provides a possible implementation manner, and the description file is a schema file generated according to the CSDL language. schema files can be divided into JSON and Extensible Markup Language (XML) formats. Since the CSDL language is a strongly regular data description language, the obtained schema file itself can be used as a document, that is, the above description file, and there is no need to define the format of the description file.
schema: namely XML Schema, XSD (XML Schema Definition), is one of many XML Schema languages that specify how elements of an XML document are formally described.
JSON: javaScript Object Notation is a lightweight data exchange format.
Similarly, in the application scenario described above using the OpenAPI specification, the service document and the client code may be generated by using the existing OpenAPI tool, and since the OpenAPI tool is the prior art and how to use the OpenAPI tool is well known to those skilled in the art, details of the embodiment are not described herein.
The specific attributes of the Resource description file at least comprise the following properties: type, status, occupied or not, sharable or not, link to the associated Task resource. The specific attributes of the Task resource description file at least comprise the following attributes: status, links to associated Resource resources, and Action operations. The Action operations include: start, pause, stop, reset, delete.
The Action operation is the operation of starting, pausing, stopping and the like of task execution, and the operations cannot be expressed by CRUD semantics of HTTP, so the invention provides an Action operation mode which is completed by operating a specific Uniform Resource Locator (URL).
And (3) CURD: refers to the acronyms of adding (Create), retrieving (Retrieve), updating (Update), and deleting (Delete) several words in the computation process. CURD is used primarily to describe the basic operational functionality of a database or persistence layer in a software system.
For example, to further illustrate the method for responding to the request by the Task Resource and the Resource, the following description is provided with reference to an example:
for the monitoring platform, the most core task is to poll the monitored server at regular time, that is, the received request is the request to poll the monitored server at regular time. The whole monitoring platform is limited by physical resources (the number of threads and the scheduling frequency in the monitoring platform are limited by upper limits), and the monitoring polling capability provided by the monitoring platform is bottleneck. If we consider that monitoring a server consumes resources in 1, the capability of the whole platform can be quantized into a Resource pool with the capability of N, that is, a Resource is the capability of monitoring a server. The new server is managed to create a new monitoring Task, that is, a new Task resource is created or the original Task resource is expanded (the monitoring Task is expanded). Correspondingly, the whole request response process calls the corresponding Resource for the Task Resource to complete the monitoring of the server.
For the customer service system, the customer service personnel specially process the problem documents of the customers behind the customer service system, and if the capability of processing one problem document is a Resource, because the capability of the customer service personnel is limited and the number of the customer service personnel is limited, the total amount of the documents processed by all the customer service personnel is also limited, and the customer service capability of the whole customer service system can be quantized into a Resource pool with the Resource amount of N. Similarly, the Task resource is an abstraction for processing the issue document of the customer. One request is to process the question documents of how many customers, that is, how many Resource resources need to be called for the Task Resource to respond to the request.
According to the request response method based on the Resource pool, the capability for providing the service in the request response process is abstracted into Resource resources, and the behavior for consuming the result of providing the service by the Resource resources is abstracted into Task resources through the thought based on the Resource pooling, so that two main bodies (the consumed resources and the consumed Resource providing service) in the request response process are abstracted into a Resource model based on the uniform specification. And how to describe the Resource model based on the unified specification is realized in the form of description files, and the information types and meanings contained in the description files of the Resource resources and the Task resources are clearly specified. The description file determined based on the method and the corresponding resource model can be free from the limitation of the technical field to which the platform belongs, the definition and the specification of resources in different technical fields are realized, the response to the requests in different fields can be further realized, and the method has extremely high universality.
In practical applications, the relationship between the Resource and the Task Resource is not necessarily only one-to-one, and there are cases of one-to-many and many-to-many, and in these cases, the correspondence between the Resource and the Task Resource is complicated and is not easy to implement.
Based on this, this embodiment provides a preferred implementation, and the resource model further includes: collecting resources;
the collection resource is stored in the form of a description file, which includes: the number of resource models included, and a link to each resource model.
That is, the set resource is a set of multiple resources of the same class. For example, for N Resource resources, one aggregate Resource may be used to represent, and accordingly, the description file of the aggregate Resource should include the number of Resource resources, that is, N, and a link to each Resource.
The function of the resource assembly is that when the resource model has a one-to-many or many-to-many relationship, the resource model is converted into a one-to-one relationship so as to simplify the corresponding relationship and be more beneficial to practical implementation.
On the basis of the above embodiments, the present embodiment also provides a new resource model, where such aggregate resources are also stored and defined in the form of description files, where the number of resource models included and links to each resource model are used to describe or summarize multiple similar resource models with one aggregate resource, so as to convert the correspondence between one-to-many or many-to-many resource models into one-to-one, thereby simplifying the correspondence between resource models, and better meeting the needs of practical applications.
Similarly, in practical applications, in order to complete the design of a complete system, it is still insufficient to implement the system only by using the Resource resources, task resources, and set resources, and information such as account numbers, roles, and permissions is often necessary. Therefore, this embodiment also provides a preferred implementation, and based on the foregoing embodiment, the resource model further includes: account resources, role resources and authority resources:
the account resource, the role resource and the authority resource are stored in the form of description files, and the description files respectively comprise respective attribute information.
For account resources, the attribute information is an account name, an account password and the like; role as a kind of general description of a dynamic behavior of a class with specific semantics for a certain kind of associated classes in URL, and its attribute information should include but not limited to: associating information of both parties and the corresponding specific dynamic behavior; likewise, the same applies to the rights resource. The above concepts are common concepts in the prior art, and the corresponding attribute information is well known to those skilled in the art, so that the detailed description thereof is omitted here.
The preferred embodiment provided by this embodiment further expands the resource model, and expands account resources, role resources, and permission resources to meet all needs of a complete system in the actual application process, better fit the actual application requirements, and improve the perfection of the resource pool-based request response method provided by this application.
The abstraction of the resource model in the above embodiments is essentially a definition of a concrete resource format, and when the external device inputs the resource in the resource format defined above, the external device can be recognized and invoked by the present system. However, there is also a need for a way of interacting between the system and the external device that is compatible with the above-described embodiments.
Therefore, this embodiment provides a preferred implementation for the interaction mode of the system with the external device, and the method further includes:
when the request is time-consuming operation, the response head points to the uniform resource identifier representing the time-consuming operation, and the response head is returned to the client.
It is easy to know that, in practical applications, not only is the application scenario that a request is simply sent, and when the system processes the request, the system responds to the request and returns the result, so as to complete the request response process, but also the application scenario that the request is a time-consuming operation is included.
For example, the request is an assembly node, the request is a continuous process, that is, a time-consuming operation, and a conventional blocking hypertext Transfer Protocol (HTTP) request response mode cannot be adopted at this time. Therefore, the present embodiment proposes the above preferred solution, and provides a semantic interaction manner of asynchronous operation:
firstly, a client (namely a service consumer) initiates an HTTP request of time-consuming operation to a system (namely a service provider), specifically, a Task resource is created;
then, the system makes a service response, including a status response code and a response header, where the response header points to a Uniform Resource Identifier (URI) representing a time-consuming operation, and the client can know the progress of the time-consuming operation in real time by tracking the returned URI;
finally, after the time-consuming operation is completed, the client tracks the uniform resource identifier again, and returns a response status code and a description file of the newly created Task resource (i.e. a response result of the time-consuming operation).
In this way, the time-consuming operation can be defined as a resource, that is, the Task resource, and the time-consuming operation is constrained by the description file based on the CSDL language, so that the characteristics of strong universality and the like brought by the method can be satisfied.
It should be noted that, the above interaction mode may be stored in the system in the form of an interface document, and a computer program for implementing the above interaction mode is stored in the interface document, and one preferred mode of the interface document is that the interface document is stored separately from the description file of the resource model, and does not affect each other, and when the resource model or the interaction mode needs to be expanded separately, the other party is not affected.
In this embodiment, an interaction manner is provided for the method for defining a resource model according to a resource pool and responding to different types of requests by calling the resource model, so as to solve the problem that the conventional blocking HTTP request response manner cannot simply respond to time-consuming operations. Specifically, when the received request is a time-consuming operation, the uniform resource identifier pointing to the corresponding request for implementing the time-consuming operation is returned as a response header, so that the user can obtain the specific precision of the time-consuming operation through the uniform resource identifier at any time, and when the time-consuming operation is completed, the user accesses the uniform resource identifier again, so that a response result can be obtained, the asynchronous operation interaction is completed, and the gap of the existing interaction mode is made up. And the mode is attached to the provided resource model constraint mode, and the effect of strong universality brought by the request response method can be met.
Similarly, the above interaction mode also has a specific application scenario, and the client needs to obtain feedback of the Task resource at regular time, that is, subscribe to the request, for example, for the node assembly operation, the client wants to obtain information that the node is successfully assembled in time, but the client does not know when the node is successfully assembled; for another example, for a monitoring system, a user wants to acquire alarm information for a monitored object in real time, but the client does not know when to alarm; for customer service systems, the customer wants to be able to get a progress in the processing of the problem in real time, but the customer does not know when to progress to the next progress.
Therefore, the application scenario for responding to the subscription request cannot be realized through the traditional blocking HTTP request responding manner. Based on this, this example provides a preferred embodiment, and the method further comprises:
when the request is a subscription request, creating a storage address for storing a result obtained by calling the resource model;
and returning the uniform resource identifier pointing to the storage address to the client as a subscription request response result.
Similarly to the above embodiment, by returning the uniform resource identifier pointing to the data storage location to the client as a subscription request response result, when the user needs to obtain the subscription result, the user can find the data storage location by tracking the uniform resource identifier, and then obtain the result data, so as to obtain the real-time result of the subscription request.
The above interaction manner for a request being a subscription request is implemented for HTTP, and for other manners such as a Server-set Events (SSE), this embodiment provides another preferred scheme, including:
when a subscription request sent by a client is received, establishing long connection with the client based on an SSE mode;
correspondingly, the sending the request response result to the client comprises the following steps:
and sending the request response result to the client through the long connection.
By establishing the long connection with the client, a response result can be returned to the client in real time in the long connection maintaining stage, so that the purpose of responding to the subscription request in real time is realized.
Further, when creating a subscription, the client can specify the type of explicitly subscribed information format, such as alert type information, general notification type information, statistics type information, and the like. Meanwhile, the embodiment also supports more flexible designation of notification types, such as:
1) The type of announcement is specified by a message prefix in the registry.
The registry is understood to be a profile, but in this application it can also be defined as a resource model by the above-mentioned CSDL language based profile, and thus it also becomes a resource, which has more canonical model constraints than the common profiles.
2) The type of notification is specified by specifying the event source (specific resource type or resource ID).
Similarly to the above embodiment, the interface document corresponding to the interaction manner provided by the embodiment may also preferably be set separately for the interface document and the description file of the resource model, which do not affect each other and can be extended separately.
The embodiment provides a preferred scheme for subscribing requests aiming at requests, and simultaneously provides a scheme for realizing subscribing request responses based on two modes, when the scheme is realized based on an HTTP mode, the new address is used for storing response result data, and a uniform resource identifier pointing to the address is sent to a client, so that a user can obtain a real-time response result at any time; when the SSE-based mode is realized, the long connection with the client is established in the SSE mode, so that the response result can be sent to the client in real time through the long connection in the long connection maintaining process, and the subscription requirement of the client is met. The interaction method provided by the invention aims at the request response method based on the resource pooling idea, solves the problem that the existing request is not suitable for the subscription request, and can meet the subscription request response of the user on the premise of realizing strong universality of the method, thereby further improving the applicability and application range of the method.
In the foregoing embodiment, a request response method based on a resource pool is described in detail, and the present application also provides an embodiment corresponding to a request response device based on a resource pool. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one from the perspective of the function module and the other from the perspective of the hardware.
Based on the angle of the function module, as shown in fig. 2, this embodiment provides a request response device based on a resource pool, including:
the resource calling module 21 is configured to receive a request sent by a client, and call a corresponding resource model according to the request to obtain a request response result; the Resource model comprises Resource resources and Task resources; the Resource is formed by abstracting the minimum Resource unit capable of providing service capacity in the Resource pool, the Resource is stored in a description file form, and the concrete attributes of the description file comprise: type, state, whether occupied, whether sharable, and link to associated Task resources; the Task resource is abstracted by behaviors used for consuming service capacity in the resource pool, the Task resource model is stored in a description file form, and concrete attributes of the description file comprise: status, links to associated Resource models, and Action operations; the Action operation is any one of start, pause, stop, reset and delete;
and the result returning module 22 is used for sending the request response result to the client.
Preferably, the method further comprises the following steps:
and the asynchronous operation module is used for pointing to the uniform resource identifier representing the time-consuming operation through the response head when the request is the time-consuming operation, and returning the response head to the client.
The first subscription module is used for creating a storage address for storing a result acquired by calling the resource model when the request is a subscription request; and returning the uniform resource identifier pointing to the storage address to the client as a subscription request response result.
The second subscription module is used for establishing long connection with the client based on an SSE mode when receiving a subscription request sent by the client; correspondingly, the sending the request response result to the client comprises the following steps: and sending the request response result to the client through the long connection.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
According to the request response device based on the Resource pool provided by the embodiment, through the thought based on Resource pooling, the capability for providing services in the request response process is abstracted into Resource resources, and the behavior for consuming the result of providing the services by the Resource resources is abstracted into Task resources, so that two main bodies (consumed resources and consumed Resource providing servers) in the request response process are abstracted into a Resource model based on unified specifications. And how to describe the Resource model based on the unified specification is realized in the form of description files, and the information types and meanings contained in the description files of the Resource resources and the Task resources are clearly specified. The description file determined based on the method and the corresponding resource model can be free from the limitation of the technical field to which the platform belongs, the resources in different technical fields can be defined and standardized, the requests in different fields can be responded, and the method and the system have high universality.
Fig. 3 is a block diagram of a request response apparatus based on a resource pool according to another embodiment of the present application, and as shown in fig. 3, the request response apparatus based on the resource pool includes: a memory 30 for storing a computer program;
a processor 31, configured to execute the computer program to implement the steps of the resource pool based request response method according to the above-mentioned embodiment.
The resource pool-based request response device provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The Processor 31 may be implemented in hardware using at least one of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 31 may be integrated with a Graphics Processing Unit (GPU) which is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, processor 31 may further include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 30 may include one or more computer-readable storage media, which may be non-transitory. Memory 30 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 30 is at least used for storing the following computer program 301, wherein after being loaded and executed by the processor 31, the computer program can implement the relevant steps of a resource pool-based request response method disclosed in any of the foregoing embodiments. In addition, the resources stored by the memory 30 may also include an operating system 302, data 303, and the like, and the storage may be transient storage or permanent storage. Operating system 302 may include Windows, unix, linux, etc. Data 303 may include, but is not limited to, a resource pool based request response method, and the like.
In some embodiments, a resource pool based request responding device may further include a display screen 32, an input/output interface 33, a communication interface 34, a power source 35, and a communication bus 36.
Those skilled in the art will appreciate that the architecture shown in FIG. 3 does not constitute a limitation of a resource pool-based request responding device and may include more or fewer components than those shown.
The request response device based on the resource pool provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the following method can be realized: a request response method based on resource pool.
When the processor executes the computer program stored in the memory, the Resource pool-based request response device provided by this embodiment abstracts the capability for providing services into Resource resources during the request response process, and abstracts the behavior for consuming the result of providing services from the Resource resources into Task resources, thereby implementing abstraction of two main entities (the consumed resources and the consumed Resource provider) in the request response process into a Resource model based on a unified specification. How the Resource model is described based on the uniform specification is realized by the form of the description file, and the information types and meanings which are contained in the description files of the Resource and the Task Resource are clearly specified. The description file determined based on the method and the corresponding resource model are not limited by the technical field to which the platform belongs, the resources in different technical fields can be defined and standardized, and then the requests in different fields can be responded, so that the method and the system have high universality.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present embodiment provides a computer readable storage medium, which when a computer program stored therein is executed, can realize the abstraction of the capability for providing services in the request response process into Resource resources and the abstraction of the behavior for consuming the results of the Resource providing services into Task resources, thereby realizing the abstraction of the two main bodies (the consumed resources and the consumed Resource providing service) in the request response process into a Resource model based on a uniform specification. How the Resource model is described based on the uniform specification is realized by the form of the description file, and the information types and meanings which are contained in the description files of the Resource and the Task Resource are clearly specified. The description file determined based on the method and the corresponding resource model can be free from the limitation of the technical field to which the platform belongs, the resources in different technical fields can be defined and standardized, the requests in different fields can be responded, and the method and the system have high universality.
The foregoing details a method, an apparatus and a medium for responding to a request based on a resource pool provided by the present application. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, without departing from the principle of the present application, the present application can also make several improvements and modifications, and those improvements and modifications also fall into the protection scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A request response method based on resource pools is characterized by comprising the following steps:
receiving a request sent by a client, and calling a corresponding resource model according to the request to obtain a request response result;
wherein the Resource model comprises Resource resources and Task resources; the Resource is formed by abstracting the minimum Resource unit capable of providing service capacity in a Resource pool, the Resource is stored in a description file form, and the concrete attributes of the description file include: type, state, whether occupied, sharable or not, and a link to an associated Task resource; the Task resource is abstracted by behaviors used for consuming service capacity in a resource pool, is stored in a description file form, and concrete attributes of the description file comprise: status, links to associated Resource resources, and Action operations; the Action operation is any one of start, pause, stop, reset and delete;
and sending the request response result to the client.
2. The resource pool-based request response method of claim 1, wherein the resource model further comprises an aggregate resource;
the collection resource is stored in the form of a description file, which includes: the number of resource models involved, and a link to each of the resource models.
3. The resource pool-based request response method of claim 1, wherein the resource model further comprises account resources, role resources, and permission resources:
the account resource, the role resource and the authority resource are stored in the form of description files, and the description files respectively comprise respective attribute information.
4. The resource pool-based request response method according to any one of claims 1 to 3, wherein the description file is a schema file generated according to CSDL language.
5. The resource pool-based request response method of claim 1, further comprising:
and when the request is time-consuming operation, pointing to a uniform resource identifier representing the time-consuming operation through a response header, and returning the response header to the client.
6. The resource pool-based request response method of claim 1, further comprising:
when the request is a subscription request, creating a storage address for storing a result obtained by calling the resource model;
and returning the uniform resource identifier pointing to the storage address to the client as a subscription request response result.
7. The resource pool-based request response method of claim 1, further comprising:
when a subscription request sent by a client is received, establishing long connection with the client based on an SSE mode;
correspondingly, sending the request response result to the client includes:
and sending the request response result to the client through the long connection.
8. A resource pool-based request response apparatus, comprising:
the resource calling module is used for receiving a request sent by a client and calling a corresponding resource model according to the request to obtain a request response result; wherein the Resource model comprises Resource resources and Task resources; the Resource is formed by abstracting the minimum Resource unit capable of providing service capacity in a Resource pool, the Resource is stored in a description file form, and the concrete attributes of the description file include: type, state, whether occupied, whether sharable, and link to associated Task resources; the Task resource is abstracted by behaviors used for consuming service capacity in a resource pool, the Task resource model is stored in a description file form, and concrete attributes of the description file include: status, links to associated Resource models, and Action operations; the Action operation is any one of start, pause, stop, reset and delete;
and the result returning module is used for sending the request response result to the client.
9. A resource pool-based request response device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the resource pool based request response method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the resource pool-based request response method according to any one of claims 1 to 7.
CN202210890256.9A 2022-07-27 2022-07-27 Resource pool-based request response method, device and medium thereof Pending CN115208764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210890256.9A CN115208764A (en) 2022-07-27 2022-07-27 Resource pool-based request response method, device and medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210890256.9A CN115208764A (en) 2022-07-27 2022-07-27 Resource pool-based request response method, device and medium thereof

Publications (1)

Publication Number Publication Date
CN115208764A true CN115208764A (en) 2022-10-18

Family

ID=83584057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210890256.9A Pending CN115208764A (en) 2022-07-27 2022-07-27 Resource pool-based request response method, device and medium thereof

Country Status (1)

Country Link
CN (1) CN115208764A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075082A1 (en) * 2004-09-02 2006-04-06 Futoshi Haga Content distribution system and content distribution method
US20130297795A1 (en) * 2012-05-01 2013-11-07 Red Hat, Inc. Owner command execution in a multi-tenant cloud hosting environment
CN104461744A (en) * 2014-12-18 2015-03-25 曙光云计算技术有限公司 Resource allocation method and device
CN107450983A (en) * 2017-07-14 2017-12-08 中国石油大学(华东) It is a kind of based on the hierarchical network resource regulating method virtually clustered and system
CN107480883A (en) * 2017-08-11 2017-12-15 国电南瑞科技股份有限公司 A kind of transformer station secondary system resource allocation method and system
CN108206894A (en) * 2016-12-20 2018-06-26 ***通信有限公司研究院 A kind of transaction processing system, method and device
CN112074815A (en) * 2018-05-03 2020-12-11 微软技术许可有限责任公司 Input and output mode mapping
CN112269659A (en) * 2020-10-23 2021-01-26 苏州浪潮智能科技有限公司 Resource management method, system, electronic equipment and storage medium
CN112559138A (en) * 2021-02-18 2021-03-26 北京城建设计发展集团股份有限公司 Resource scheduling system and method
CN112637353A (en) * 2020-12-28 2021-04-09 北京交通大学 Unified computing resource pool system based on multi-terminal data fusion
CN112799854A (en) * 2021-04-15 2021-05-14 腾讯科技(深圳)有限公司 Task processing method and device, electronic equipment and readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060075082A1 (en) * 2004-09-02 2006-04-06 Futoshi Haga Content distribution system and content distribution method
US20130297795A1 (en) * 2012-05-01 2013-11-07 Red Hat, Inc. Owner command execution in a multi-tenant cloud hosting environment
CN104461744A (en) * 2014-12-18 2015-03-25 曙光云计算技术有限公司 Resource allocation method and device
CN108206894A (en) * 2016-12-20 2018-06-26 ***通信有限公司研究院 A kind of transaction processing system, method and device
CN107450983A (en) * 2017-07-14 2017-12-08 中国石油大学(华东) It is a kind of based on the hierarchical network resource regulating method virtually clustered and system
CN107480883A (en) * 2017-08-11 2017-12-15 国电南瑞科技股份有限公司 A kind of transformer station secondary system resource allocation method and system
CN112074815A (en) * 2018-05-03 2020-12-11 微软技术许可有限责任公司 Input and output mode mapping
CN112269659A (en) * 2020-10-23 2021-01-26 苏州浪潮智能科技有限公司 Resource management method, system, electronic equipment and storage medium
CN112637353A (en) * 2020-12-28 2021-04-09 北京交通大学 Unified computing resource pool system based on multi-terminal data fusion
CN112559138A (en) * 2021-02-18 2021-03-26 北京城建设计发展集团股份有限公司 Resource scheduling system and method
CN112799854A (en) * 2021-04-15 2021-05-14 腾讯科技(深圳)有限公司 Task processing method and device, electronic equipment and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MO CHENG-WEI; FAN BING-BING: "DOP: A Data Opening Framework and Application", 2018 4TH ANNUAL INTERNATIONAL CONFERENCE ON NETWORK AND INFORMATION SYSTEMS FOR COMPUTERS (ICNISC), 19 September 2019 (2019-09-19) *
王帅;蔡鸿明;: "基于柔性业务流程的RESTful信息资源池研究和实现", 微型电脑应用, no. 02, 20 February 2013 (2013-02-20) *

Similar Documents

Publication Publication Date Title
US11711420B2 (en) Automated management of resource attributes across network-based services
US10637796B2 (en) Linking instances within a cloud computing environment
US7779419B2 (en) Method and apparatus for creating templates
CN112527528A (en) Data transmission method, device and storage medium based on message queue
US10776083B2 (en) Application builder with connected components
US10397051B1 (en) Configuration and testing of network-based service platform resources using a service platform specific language
CN113377626B (en) Visual unified alarm method, device, equipment and medium based on service tree
CN103995906A (en) Abnormity processing method and device
EP3462330A1 (en) Fault tolerant adapter system to consume database as a service
CN112860343B (en) Configuration changing method, system, device, electronic equipment and storage medium
US10445157B2 (en) Concurrent services caching
CN112181678A (en) Service data processing method, device and system, storage medium and electronic device
US20230344781A1 (en) Grouping resource metadata tags
CN112650653A (en) Plug-and-play and visual operation and maintenance system and method for equipment
CN110008261B (en) External change detection
CN115208764A (en) Resource pool-based request response method, device and medium thereof
US10114864B1 (en) List element query support and processing
CN114327404A (en) File processing method and device, electronic equipment and computer readable medium
Chihani et al. Programmable context awareness framework
US20140047459A1 (en) Integrating software solution units
CN113760569B (en) Multi-account management method and system
CN108399223A (en) A kind of data capture method, device and electronic equipment
CN115865898B (en) Method, device, equipment and medium for processing data information among multiple service systems
US20240061729A1 (en) Multitenancy cross-tenant collaboration driven by event proxy
CN111723088B (en) Method and device for pushing summary layer table

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination