Nothing Special   »   [go: up one dir, main page]

CN115208764B - Request response method, device and medium based on resource pool - Google Patents

Request response method, device and medium based on resource pool Download PDF

Info

Publication number
CN115208764B
CN115208764B CN202210890256.9A CN202210890256A CN115208764B CN 115208764 B CN115208764 B CN 115208764B CN 202210890256 A CN202210890256 A CN 202210890256A CN 115208764 B CN115208764 B CN 115208764B
Authority
CN
China
Prior art keywords
resource
request response
resources
client
resource pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210890256.9A
Other languages
Chinese (zh)
Other versions
CN115208764A (en
Inventor
刘畅
刘帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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/CN115208764B/en
Publication of CN115208764A publication Critical patent/CN115208764A/en
Application granted granted Critical
Publication of CN115208764B publication Critical patent/CN115208764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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)
  • Stored Programmes (AREA)

Abstract

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

Description

Request response method, device and medium based on resource pool
Technical Field
The present application relates to the field of software development technologies, and in particular, to a resource pool-based request response method, apparatus, and medium thereof.
Background
In today's computer arts, systems or platforms for implementing different functions may implement data interactions in accordance with different interface specifications to implement the corresponding functions.
The interface specification defines a data specification and a 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 by a predefined format standard, so that the system or platform can identify and utilize the resource.
At present, the interface specification is defined only by data in the technical field of the interface specification due to strong professional property, has poor compatibility to 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 to the field of the request information, and the requirements are required to meet the interface specifications according to the current system, so that the types of the requests which can be processed are limited, and the universality is affected.
Therefore, a request response method based on a resource pool is needed by those skilled in the art, so as to solve the problems that the compatibility is poor and the request in multiple fields cannot be responded well.
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, which solve the problems that the compatibility is poor and the requests in multiple fields cannot be responded well when the request response is carried out at present.
In order to solve the above technical problems, 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 abstracted by the minimum Resource unit capable of providing service capability in the Resource pool, and is stored in the form of a description file, wherein the specific attributes of the description file comprise: type, status, whether occupied, sharable, and links to associated Task resources; the Task resource is abstracted by a behavior for consuming service capacity in a resource pool, and is stored in the form of a description file, wherein the specific attribute of the description file comprises: status, links to associated Resource resources, and Action operations; the Action operation is any one of starting, pausing, stopping, resetting and deleting;
And sending the request response result to the client.
Preferably, the resource model further comprises aggregate resources;
The collection resource is stored in the form of a description file, and the description file comprises: the number of resource models involved, and links to each resource model.
Preferably, the resource model further includes account resources, role resources, and rights resources:
The account number 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 CSDL language.
Preferably, the method further comprises:
When the request is a time consuming operation, the uniform resource identifier representing the time consuming operation is pointed to by the response header, and the response header is returned to the client.
Preferably, the method further comprises:
When the request is a subscription request, a storage address is created and used 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:
When receiving a subscription request sent by a client, establishing long connection with the client based on an SSE mode;
correspondingly, sending the request response result to the client comprises:
and sending the request response result to the client through the long connection.
In order to solve the 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 so as to obtain a request response result; the Resource model comprises Resource resources and Task resources; the Resource is abstracted by the minimum Resource unit capable of providing service capability in the Resource pool, and is stored in the form of a description file, wherein the specific attributes of the description file comprise: type, status, whether occupied, sharable, and links to associated Task resources; the Task resource is abstracted by a behavior for consuming service capacity in a resource pool, and a Task resource model is stored in the form of a description file, wherein specific attributes of the description file comprise: state, links to associated Resource models, and Action operations; the Action operation is any one of starting, pausing, stopping, resetting and deleting;
and the result return module is used for sending the request response result to the client.
Preferably, the method further comprises:
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 when the request is a subscription request and 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.
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, sending the request response result to the client comprises: and sending the request response result to the client through the long connection.
In order to solve the technical problem, the present application further provides a request response device 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 described above when executing a computer program.
To solve the above technical problem, the present application further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the resource pool based request response method described above.
The service resources in most technical fields can be generally divided into consumption type resources for being consumed to support service completion and execution type resources for consuming resources to realize service functions according to functions, and the two types of resources are one of the most basic resources for providing services. Therefore, the method is defined by the description file, the method is abstracted into a resource model based on unified specification by using the thought of a resource pool, so that resources in various different technical fields can be defined based on unified specification, further, wider resources can be called when request response is carried out, more diversified services are provided, and the universality is greatly enhanced by responding to more various requests.
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
For a clearer description of embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a flow chart of a request response method based on a resource pool provided by the invention;
FIG. 2 is a block diagram of a request response device based on a resource pool provided by the invention;
fig. 3 is a block diagram of another request response device based on a resource pool according to the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present application.
The core of the application is to provide a request response method, a request response device and a request response medium based on a resource pool.
In order to better understand the aspects of the present application, the present application will be described in further detail with reference to the accompanying drawings and detailed description.
The resource pooling is to abstract the service provided by the program into a capability and abstract the capability into a resource, so that the service provided by the program is better than a resource pool. The customer's consumption of the service is the access to the resources in the resource pool. The abstract method is not limited to what the provided service concrete is, what service is abstracted into what resources, and the corresponding resources can be taken in use, so that the abstract method can be applied to different fields and has good universality.
To facilitate understanding of the application of the above-described resource pooling concept in different technical fields, the following is briefly described with reference to examples:
Taking a virtualized management platform or a k8s (a container orchestration engine) container management platform as an example, the above-mentioned resource pooling concept is adopted to perform interface specification design, namely, abstract computing resources, storage resources and network resources into different resource pools, abstract requests such as creating and using virtual machines or containers as consumption of the resource pools, and thus realize resource calling and response to the requests.
For various existing interface specifications, the interface specifications are defined as data specifications and message specifications 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 realize the purpose of responding to a specific request for calling the resource. Considering the respective professionals of different technical fields, the resources used by the method are different, and the situation that the resources can be mutually communicated is extremely rare. Therefore, the existing management platform and other devices are all based on the interface specifications defined by the technical field, and the devices in the field based on the same interface specifications are used for data communication, so that the interface specifications between different fields cannot be used commonly, namely, only a system based on the specific interface specifications can respond to the request of the specific technical field.
Based on the above problems, 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 the request response result to the client.
The Resource model comprises Resource resources and Task resources; the Resource is abstracted by the minimum Resource unit capable of providing service capability in the Resource pool, and is stored in the form of a description file, wherein the specific attributes of the description file comprise: type, status, whether occupied, sharable, and links to associated Task resources; the Task resource is abstracted by a behavior for consuming service capacity in a resource pool, and a Task resource model is stored in the form of a description file, wherein specific attributes of the description file comprise: state, links to associated Resource models, and Action operations; the Action operation is any one of start, pause, stop, reset, and delete.
The Resource model is pre-abstracted for the corresponding service side, for example, for Resource resources, 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 meet the request sent by the service consumer.
The same applies to Task resources, and the service consumer abstracts the behavior of consuming service capability in the Resource pool into 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 that a response result corresponding to the request can be obtained.
The description of the Resource model may utilize existing specifications, for example, based on an open data protocol (Open Data Protocol, OData), and a generic format definition language (Common Schema Definition Language, CSDL) language is used to generate a corresponding description file for describing the abstract Resource and Task Resource specifically, so as to facilitate the system to use. Or using an application programming interface (OpenAPI) protocol, the present application is not limited thereto, and the purpose of the present application is to implement the request response method provided by the present application by using the existing protocol specification, so as to reduce the use threshold.
The present embodiment provides a possible implementation, where the description file is a schema file generated according to CSDL language. The schema file can be divided into JSON and extensible markup language (Extensible Markup Language, XML) formats. Since CSDL is a data description language with strong rules, the schema file obtained by the method can be used as a document, namely the description file, and the format of the description file and the like are not required to be defined additionally.
Scheme a: namely XML Schema, XSD (XML Schema Definition) as a standard, which indicates how to describe the elements of an XML document in a formal manner, is one of many XML Schema languages.
JSON: javaScript Object Notation JavaScript object numbered musical notation is a lightweight data exchange format.
Similarly, in the application scenario described above in which the resource model is described by using the OpenAPI specification, the service document and the client code may be generated by using an existing OpenAPI tool.
The specific attributes of the Resource description file at least comprise: type, status, whether occupied, sharable, and links to associated Task resources. The specific attributes of the Task resource description file at least comprise: status, links to associated Resource resources, and Action operations. The Action operation comprises the following steps: start, pause, stop, reset, delete.
The Action operation is the operation of starting, suspending, stopping and the like on the task execution, and the operation cannot be expressed by CRUD semantic terms of HTTP, so the invention provides a mode of the Action operation, which is completed by operating a specific uniform resource location system (Uniform Resource Locator, URL).
CURD: refer to the initial shorthand of several words of add (Create), retrieve (Retrieve), update (Update) and Delete (Delete) when doing the calculation process. CURD is used primarily to describe the basic operational functions of a database or persistence layer in a software system.
Illustratively, to further describe the methods of Task resources and Resource resources for implementing request responses, the following description is made with reference to examples:
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 inside the monitoring platform are limited), and the monitoring polling capability provided by the monitoring platform is bottleneck. If we consider that the monitoring of one server consumes resources with unit of 1, then the capability of the whole platform can be quantized into a Resource pool with capability of N, that is, a Resource is the capability of monitoring one server. The new server of the nano-tube creates a new monitoring Task, namely creates a new Task resource or expands the original Task resource (the monitoring Task is expanded). Correspondingly, the whole request response process is to call the corresponding Resource for the Task Resource to complete the monitoring of the server.
Behind the customer service system is a customer service person which processes the problem documents of the customer, and the capability of processing one problem document is assumed to be a Resource, because the capability of the customer service person is limited, and the number of customer service staff is limited, so that the total amount of documents which can be processed by all the customer service staff is limited, and the customer service capacity of the whole customer service system can be quantized into a Resource pool with N Resource amount. And similarly, the Task resource is the abstraction for processing the problem document of the customer. A request is used for processing problem receipts of how many clients, namely how many Resource resources need to be called by Task resources to respond to the request.
The Resource pool-based request response method provided by the application abstracts the capability for providing service into Resource resources and abstracts the behavior for consuming the Resource to provide service results into Task resources in the request response process based on the idea of Resource pool, thereby realizing the abstraction of two main bodies (consumed resources and consumed Resource providing servers) in the request response process into a Resource model based on unified specifications. How the Resource model is described based on the unified specification is realized by the method and the device, and the types and meanings of information contained in the Resource and Task Resource description files are specified clearly. The description file determined based on the method and the corresponding resource model can be free from the limitation of the technical field of the platform, so that the definition and specification of resources in different technical fields can be realized, and further, the requests in different fields can be responded, and the method has extremely high universality.
Considering that in practical application, the relationship between the Resource and the Task Resource is not necessarily one-to-one, and there are one-to-many and many-to-many situations, in which the corresponding relationship between the Resource and the Task Resource is complex and is not easy to implement.
Based on this, the present example provides a preferred embodiment, where the resource model further includes: collecting resources;
The collection resource is stored in the form of a description file, and the description file comprises: the number of resource models involved, and links to each resource model.
That is, the aggregate resource is a set of multiple same class resources. For example, for N Resource resources, it may be represented by a set Resource, and the description file of the set Resource should include the number of Resource resources, i.e., N, and a link to each Resource.
The function of the aggregate resource is that when the resource model has one-to-many or many-to-many relationship, the resource model is converted into one-to-one relationship, so that the corresponding relationship is simplified, and the actual implementation is facilitated.
The embodiment also provides a new resource model based on the above embodiment, where the aggregate resources are also stored and defined in the form of description files, including the number of the included resource models and links to each resource model, and are used to describe or summarize multiple similar resource models by using one aggregate resource, so as to convert the corresponding relationship between one-to-many or many-to-many resource models into one-to-one, simplify the corresponding relationship between resource models, and more meet the needs of practical applications.
Similarly, in practical applications, to complete a complete system design, implementation by only using the Resource, task Resource, and aggregate Resource described above is still insufficient, and information such as account number, role, and authority is often necessary. The present example therefore also provides a preferred implementation, and the resource model further includes, on the basis of the above example: account number resources, role resources, and rights resources:
The account number 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 of the account resources is account names, account passwords and the like; roles as a generalized description of the dynamic behavior of a class with specific semantics for a certain class of associations in URLs, its attribute information should include, but is not limited to: associating information of both parties and corresponding specific dynamic behaviors; likewise, the same applies to rights resources. The above concepts are all conventional common concepts, and the corresponding attribute information is well known to those skilled in the art, so the description of the present embodiment is omitted herein.
The preferred implementation scheme provided by the embodiment further expands the resource model, expands account resources, role resources and authority resources, meets all the requirements of a complete system in the actual application process, better meets the actual application requirements, and improves the perfection degree of the request response method based on the resource pool.
The abstraction of the resource model in the above embodiment is essentially a definition of a specific resource format, and when an external device inputs a resource in the above defined resource format, the external device can be identified and invoked by the system. However, for the interaction between the system and the external device, a manner compatible with the above embodiment is also required.
Accordingly, the present embodiment provides a preferred embodiment for a system interaction with an external device, where the method further includes:
When the request is a time consuming operation, the uniform resource identifier representing the time consuming operation is pointed to by the response header, and the response header is returned to the client.
It is easy to know that in practical application, not only is a request simply sent, but also an application scenario in which the request is a time-consuming operation can be completed by responding to the request and returning a result when the system processes the request.
For example, the request is an assembly node, and the request is a continuous process, i.e. a time-consuming operation, where a conventional blocking hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) request response mode cannot be adopted. Therefore, the present embodiment proposes the above preferred solution, and provides a semantic interaction manner of asynchronous operation:
Firstly, a client (i.e. a service consumer) initiates an HTTP request of time-consuming operation to a system (i.e. a service provider), and specifically, a Task resource is created;
Then, the system makes a service response, including a status response code and a response header, wherein the response header points to a uniform resource identifier (Uniform Resource Identifier, URI) representing the time-consuming operation, and the client can know the progress of the time-consuming operation in real time by tracking the returned uniform resource identifier;
Finally, when 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 (namely, a response result of the time-consuming operation).
In this way, the time-consuming operation can be defined as a resource, namely 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 generality and the like brought by the method can be met.
The interaction mode may be stored in the system in the form of an interface document, in which a computer program for implementing the interaction mode is stored, and one preferred mode of the interface document is that the interface document and a description file of the resource model are stored independently, and do not affect each other, and when the resource model or the interaction mode needs to be expanded independently, the other party is not affected.
The embodiment provides an interactive mode aiming at the definition of the resource model according to the resource pool and the method for responding to different types of requests by calling the resource model, and solves the problem that the prior time-consuming operation cannot simply respond by the traditional blocking type HTTP request response mode. Specifically, when the received request is a time-consuming operation, the uniform resource identifier corresponding to the time-consuming request is returned as a response header, so that a user can acquire 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, a response result can be obtained, the interaction of the asynchronous operation is completed, and the gap of the existing interaction mode is made up. And the method is attached to the resource model constraint mode, so that the effect of strong universality brought by the request response method can be met.
Similarly, the above interaction manner also has a specific application scenario, where the client needs to acquire feedback of the Task resource at regular time, that is, a subscription request, for example, for the node assembly operation, the client wants to acquire information of successful node assembly in time, but the client does not know when the node assembly is successful; 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, customers want to be able to get the progress of the problem's process in real time, but the customer does not know when to progress to the next progress.
Therefore, the application scenario of responding to the subscription request cannot be realized through the traditional blocking type HTTP request response mode. Based on this, the present example provides a preferred embodiment, the above method further comprising:
When the request is a subscription request, a storage address is created and used 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.
And the same as the embodiment, the uniform resource identifier pointing to the data storage position is returned to the client as a subscription request response result, and when the user needs to acquire the subscription result, the data storage position can be found by tracking the uniform resource identifier, so that the result data is acquired, and the real-time subscription request result is obtained.
The above-mentioned interaction manner for subscribing to a request is implemented for HTTP, and for other manners, such as a Server push event (Server-SENT EVENTS, SSE), another preferred scheme is provided in this embodiment, including:
When receiving a subscription request sent by a client, establishing long connection with the client based on an SSE mode;
correspondingly, sending the request response result to the client comprises:
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 a long connection maintaining stage, so that the purpose of real-time response to the subscription request is realized.
Further, when creating a subscription, the client can specify a type to explicitly subscribe to information formats, such as alert class information, general notification class information, statistics class information, and the like. Meanwhile, the present embodiment also supports more flexible specifying notification types, such as:
1) The type of notification is specified by a message prefix in the registry.
By registry, it is understood that a configuration file is just one of the resources that can be defined as a model of the resource in the present application by the CSDL language-based description file described above, and therefore it is also one of the resources that has more canonical model constraints than a common configuration file.
2) The type of notification is specified by specifying the event source (specific resource type or resource ID).
The interface document corresponding to the interaction mode provided in this embodiment may be preferably set independently of the description file of the resource model, and may be expanded independently without mutual influence.
The embodiment provides a preferred scheme for subscribing requests, and simultaneously provides a scheme for realizing subscribing request response based on two modes, wherein when the scheme is realized based on HTTP, the response result data is stored by newly establishing an address, and a uniform resource identifier pointing to the address is sent to a client, so that a user can acquire a real-time response result at any time; when the SSE-based mode is realized, the long connection with the client is established through the SSE mode, so that the response result can be sent to the client through the long connection in real time in the long connection maintaining process, and the subscription requirement of the client is met. The interaction method solves the problem that the prior request is inapplicable when being a subscription request aiming at the request response method based on the resource pooling idea, and can meet the subscription request response of a user and further improve the applicability and application range of the method on the premise of realizing strong universality brought by the method.
In the above embodiments, a detailed description is given of a request response method based on a resource pool, and the present application further provides an embodiment corresponding to a request response device based on a resource pool. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
Based on the angle of the functional modules, as shown in fig. 2, this embodiment provides a request response device based on a resource pool, including:
A resource calling module 21, configured to receive a request sent by a client, and call a corresponding resource model according to the request, so as to obtain a request response result; the Resource model comprises Resource resources and Task resources; the Resource is abstracted by the minimum Resource unit capable of providing service capability in the Resource pool, and is stored in the form of a description file, wherein the specific attributes of the description file comprise: type, status, whether occupied, sharable, and links to associated Task resources; the Task resource is abstracted by a behavior for consuming service capacity in a resource pool, and a Task resource model is stored in the form of a description file, wherein specific attributes of the description file comprise: state, links to associated Resource models, and Action operations; the Action operation is any one of starting, pausing, stopping, resetting and deleting;
The result returning module 22 is configured to send the request response result to the client.
Preferably, the method further comprises:
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 when the request is a subscription request and 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.
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, sending the request response result to the client comprises: and sending the request response result to the client through the long connection.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
According to the Resource pool-based request response device, the Resource pool-based idea is used for abstracting the capability for providing services into Resource resources and abstracting the behavior for consuming the Resource to provide service results into Task resources in the request response process, so that two main bodies (consumed resources and consumed Resource providing servers) in the request response process are abstracted into a unified specification-based Resource model. How the Resource model is described based on the unified specification is implemented in the form of a description file, and the types and meanings of information contained in the description files of Resource resources and Task resources are specified clearly. The description file and the corresponding resource model determined based on the method can be free from the limitation of the technical field of the platform, so that the definition and specification of resources in different technical fields can be realized, and further, the requests in different fields can be responded, and the method has extremely high universality.
Fig. 3 is a block diagram of a request response device based on a resource pool according to another embodiment of the present application, and as shown in fig. 3, a request response device based on a resource pool includes: a memory 30 for storing a computer program;
A processor 31 for implementing the steps of a resource pool based request response method according to the above embodiment when executing a computer program.
The request response device based on the resource pool provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The Processor 31 may be implemented in at least one hardware form of a digital signal Processor (DIGITAL SIGNAL Processor, DSP), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 31 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a central processor (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 an image processor (Graphics Processing Unit, GPU) for rendering and rendering of content to be displayed by the display screen. In some embodiments, the processor 31 may also include an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) processor for processing computing 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 a computer program 301, where the computer program, when loaded and executed by the processor 31, is capable of implementing the relevant steps of a resource pool based request response method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may further include an operating system 302, data 303, and the like, where the storage manner may be transient storage or permanent storage. Operating system 302 may include Windows, unix, linux, among other things. The 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 response device may further include a display screen 32, an input-output interface 33, a communication interface 34, a power supply 35, and a communication bus 36.
Those skilled in the art will appreciate that the architecture shown in fig. 3 is not limiting of a resource pool based request response device and may include more or fewer components than shown.
The request response device based on the resource pool provided by the embodiment of the application comprises a memory and a processor, wherein the processor can realize the following method when executing a program stored in the memory: a request response method based on a resource pool.
The Resource pool-based request response device provided in this embodiment, when executing a computer program stored in a memory by a processor, implements abstraction of capability for providing services into Resource resources in a request response process, and abstraction of behavior for consuming the Resource to provide service results into Task resources, so as to implement abstraction of two main bodies (consumed resources and consumed Resource providing servers) in the request response process into a unified specification-based Resource model. How the Resource model is described based on the unified specification is implemented in the form of a description file, and the types and meanings of information contained in the description files of Resource resources and Task resources are specified clearly. The description file and the corresponding resource model determined based on the method can be free from the limitation of the technical field of the platform, so that the definition and specification of resources in different technical fields can be realized, and further, the requests in different fields can be responded, and the method has extremely 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 executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The computer readable storage medium provided in this embodiment, when executed, implements abstraction of the capability for providing services in the request response process into Resource resources, and abstraction of the behavior for consuming the Resource to provide service results into Task resources, so as to implement abstraction of two main bodies (consumed resources and consumed Resource providing servers) in the request response process into a Resource model based on a unified specification. How the Resource model is described based on the unified specification is implemented in the form of a description file, and the types and meanings of information contained in the description files of Resource resources and Task resources are specified clearly. The description file and the corresponding resource model determined based on the method can be free from the limitation of the technical field of the platform, so that the definition and specification of resources in different technical fields can be realized, and further, the requests in different fields can be responded, and the method has extremely high universality.
The request response method, the device and the medium based on the resource pool provided by the application are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.
It should also be noted that in this 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. Moreover, 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 phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A resource pool based request response method, comprising:
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 abstracted by a minimum Resource unit capable of providing service capability in a Resource pool, and is stored in the form of a description file, wherein the specific attribute of the description file comprises: type, status, whether occupied, sharable, and links to associated Task resources; the Task resource is abstracted by a behavior for consuming service capacity in a resource pool, and is stored in the form of a description file, wherein the specific attribute of the description file comprises: status, links to associated Resource resources, and Action operations; the Action operation is any one of starting, pausing, stopping, resetting and deleting;
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 aggregate resources;
The collection resource is stored in the form of a description file, and the description file comprises: the number of resource models involved, and links 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 rights resources:
And the account number resource, the role resource and the authority resource are stored in the form of description files, and the description files respectively comprise the attribute information of each account number resource, the role resource and the authority resource.
4. A 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:
When the request is a 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, a storage address is created and used 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 receiving a subscription request sent by a client, establishing long connection with the client based on an SSE mode;
Correspondingly, sending the request response result to the client comprises:
And sending the request response result to the client through the long connection.
8. A resource pool based request response device, comprising:
The resource calling module is used for receiving a request sent by the client and calling a corresponding resource model according to the request so as to obtain a request response result; the Resource model comprises Resource resources and Task resources; the Resource is abstracted by a minimum Resource unit capable of providing service capability in a Resource pool, and is stored in the form of a description file, wherein the specific attribute of the description file comprises: type, status, whether occupied, sharable, and links to associated Task resources; the Task resource is abstracted by a behavior for consuming service capacity in a resource pool, the Task resource model is stored in the form of a description file, and specific attributes of the description file comprise: state, links to associated Resource models, and Action operations; the Action operation is any one of starting, pausing, stopping, resetting and deleting;
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 of any of claims 1 to 7 when executing said computer program.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the resource pool based request response method of any of claims 1 to 7.
CN202210890256.9A 2022-07-27 2022-07-27 Request response method, device and medium based on resource pool Active CN115208764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210890256.9A CN115208764B (en) 2022-07-27 2022-07-27 Request response method, device and medium based on resource pool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210890256.9A CN115208764B (en) 2022-07-27 2022-07-27 Request response method, device and medium based on resource pool

Publications (2)

Publication Number Publication Date
CN115208764A CN115208764A (en) 2022-10-18
CN115208764B true CN115208764B (en) 2024-08-16

Family

ID=83584057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210890256.9A Active CN115208764B (en) 2022-07-27 2022-07-27 Request response method, device and medium based on resource pool

Country Status (1)

Country Link
CN (1) CN115208764B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006072715A (en) * 2004-09-02 2006-03-16 Hitachi Ltd Content delivery system and content delivery method
US9245111B2 (en) * 2012-05-01 2016-01-26 Red Hat, Inc. Owner command execution in a multi-tenant cloud hosting environment
CN108206894B (en) * 2016-12-20 2020-05-12 中国移动通信有限公司研究院 Service processing system, method and device
CN107480883B (en) * 2017-08-11 2020-11-10 国电南瑞科技股份有限公司 Transformer substation secondary system resource configuration method and system
CN108574599B (en) * 2017-12-14 2021-10-08 成都卫士通信息产业股份有限公司 Password resource pool, password resource pool management method, management platform and management system
US10681164B2 (en) * 2018-05-03 2020-06-09 Microsoft Technology Licensing, Llc Input and output schema mappings
CN108984294B (en) * 2018-05-25 2022-03-29 中国科学院计算机网络信息中心 Resource scheduling method, device and storage medium
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
CN112559138B (en) * 2021-02-18 2021-10-12 北京城建设计发展集团股份有限公司 Resource scheduling system and method
CN112799854B (en) * 2021-04-15 2021-07-13 腾讯科技(深圳)有限公司 Task processing method and device, electronic equipment and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN115208764A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN110310034B (en) Service arrangement and business flow processing method and device applied to SaaS
JP7043780B2 (en) Microservices-based data processing equipment, methods and programs
US7673029B2 (en) Grid automation bus to integrate management frameworks for dynamic grid management
CN112527528A (en) Data transmission method, device and storage medium based on message queue
US11194572B2 (en) Managing external feeds in an event-based computing system
US10182104B1 (en) Automatic propagation of resource attributes in a provider network according to propagation criteria
US8020051B2 (en) Message handling in a service-oriented architecture
US10445157B2 (en) Concurrent services caching
US8285779B2 (en) Programmable presence virtualization
CN112417016B (en) Data exchange method, system, equipment and storage medium
CN113377626A (en) Visual unified alarm method, device, equipment and medium based on service tree
US8775555B2 (en) Rest interface interaction with expectation management
CN113672671B (en) Method and device for realizing data processing
US20180121441A1 (en) Accessing application services from forms
CN112650653A (en) Plug-and-play and visual operation and maintenance system and method for equipment
CN115208764B (en) Request response method, device and medium based on resource pool
CN110008261B (en) External change detection
US10313433B2 (en) Method and system for registering software systems and data-sharing sessions
US8990836B2 (en) Integrating software solution units
US10114864B1 (en) List element query support and processing
Li Design and implementation of distributed asynchronous data aided computer information interaction system
Michlmayr et al. End-to-end support for QoS-aware service selection, invocation and mediation in VRESCo
US20230281214A1 (en) Actor-based information system
CN114844957B (en) Link message conversion method, device, equipment, storage medium and program product
US20240061729A1 (en) Multitenancy cross-tenant collaboration driven by event proxy

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
GR01 Patent grant
GR01 Patent grant