CN116627635A - Resource use method and device and electronic equipment - Google Patents

Resource use method and device and electronic equipment Download PDF

Info

Publication number
CN116627635A
CN116627635A CN202310532542.2A CN202310532542A CN116627635A CN 116627635 A CN116627635 A CN 116627635A CN 202310532542 A CN202310532542 A CN 202310532542A CN 116627635 A CN116627635 A CN 116627635A
Authority
CN
China
Prior art keywords
resource
target
identifier
access request
application
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
CN202310532542.2A
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.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202310532542.2A priority Critical patent/CN116627635A/en
Publication of CN116627635A publication Critical patent/CN116627635A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

The application provides a resource using method, a device and electronic equipment, wherein the method comprises the following steps: establishing a resource identifier according to a preset rule for at least one resource, responding to a resource release request, assembling at least one target resource with a subordinate relation in at least one resource through the resource identifier, releasing the service instance obtained after the assembly, responding to a resource access request, analyzing the access request to obtain target characteristic information of the resource to be accessed, and matching a corresponding service instance from the released service instance based on the target characteristic information to access. The application can describe resources through specific rules and realize service assembly, service positioning and resource management by using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.

Description

Resource use method and device and electronic equipment
Technical Field
The present application relates to the field of distributed technologies, and in particular, to a method and an apparatus for using resources, and an electronic device.
Background
With the popularization of distributed systems, enterprise system platformization construction is more and more, and the requirements for management such as various technical components, application development and the like are more and more. Existing data assets or hardware are commonly stored as distributed resources in different nodes.
However, in the process of resource assembly, deployment management is performed by manpower, each resource has respective standards, is relatively distributed and independent, the management standards are not uniform, application dependence management is fixed, the application dependence management is packaged into a program in a hard coding mode, and as services develop in a distributed system, service nodes are more and more, and resource management is more and more complicated.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method, an apparatus, and an electronic device for using resources, which can describe resources through specific rules and use engine driving to implement service assembly, service positioning, and resource management, so that resource management in a distributed system is clearer and more flexible to apply.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a resource usage method, including the following steps:
establishing a resource identifier according to a preset rule for at least one resource, wherein the at least one resource is a distributed resource, and the resource identifier is used for identifying characteristic information of each resource in the at least one resource;
responding to a resource release request, assembling at least one target resource with a subordinate relation in the at least one resource through the resource identifier, and releasing a service instance obtained after the assembling;
Responding to a resource access request, analyzing the access request to obtain target characteristic information of a resource to be accessed, and accessing a corresponding service instance from the published service instances based on the target characteristic information, wherein the resource access request comprises the resource identifier corresponding to the resource to be accessed.
In one possible implementation, the resource identifier includes: the combination relational symbol, the type, the unique characteristic separator and the unique identifier are sequentially arranged;
wherein the combination relational symbol is used for representing the aggregation relation of the resources;
the type is used for representing the type of the resource;
the unique feature separator is used for separating the unique identifier;
the unique identity is a unique identity for resource location.
In one possible implementation, the types include a parent type and a subtype, and the parent type and the subtype are connected through an inheritance relationship.
In a possible implementation manner, the resource identifier further includes: the inquiry separator and the inquiry condition are sequentially connected after the unique identifier;
the query separator is used for indicating that a query condition exists;
The query condition represents at least one condition available for querying the current resource, the different conditions being connected by a connector.
In a possible implementation manner, the resource identifier further includes: the internal model locators and the internal models are sequentially connected after the query conditions;
the internal model locator is used for locating the internal model of the resource;
the internal model includes metadata representing a metadata structure of the resource, features representing internal features of the resource, and behaviors representing behavior methods of the resource.
In a possible implementation manner, the assembling at least one target resource with a subordinate relationship in the at least one resource through the resource identifier includes:
splicing the resource identifiers of at least one target resource with a subordinate relation in the at least one resource according to a preset hierarchical relation to obtain a target character string, wherein an upper layer conduction value of the internal model of the same type in the target character string replaces a lower layer conduction value, and the types with a father-son relation in the target character string are sequentially connected through the succession relation;
The publishing of the service instance obtained after assembly comprises the following steps:
performing first analysis processing on the target character strings based on the combination relational symbols to obtain a first target array, wherein the character after each combination relational symbol is an element in the first target array;
and acquiring the resources corresponding to each element in the first target array, and publishing and registering after the resources corresponding to each element are packaged.
In a possible implementation manner, the target feature information includes location information and application information, and the analyzing the access request to obtain the target feature information of the resource to be accessed includes:
performing second analysis processing on the resource identifier corresponding to the resource to be accessed based on the combination relation symbol to obtain a second target array, wherein each element in the second target array represents a resource;
acquiring the position information of the resource to be accessed based on the second target array;
the accessing of the corresponding service instance matched from the published service instances based on the target characteristic information comprises the following steps:
And responding to the access request aiming at the position information, acquiring the application information from the second target array, and accessing the application information.
In some embodiments, before the publishing the service instance obtained after the assembling, the method further includes:
verifying the assembled resource identifier in the service instance;
and when the assembled resource identifier does not accord with the preset assembly rule, canceling the assembly and returning a corresponding error reason.
In a second aspect, an embodiment of the present application further provides a resource usage apparatus, where the apparatus includes:
the resource identifier is used for identifying characteristic information of each resource in the at least one resource;
the assembly module is used for responding to a resource release request, assembling at least one target resource with a subordinate relationship in the at least one resource through the resource identifier, and releasing the service instance obtained after the assembly;
the access module is used for responding to a resource access request, analyzing the access request to obtain target characteristic information of the resource to be accessed, and accessing the corresponding service instance from the published service instances based on the target characteristic information, wherein the resource access request comprises the resource identifier corresponding to the resource to be accessed.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium storing machine-readable instructions executable by the processor, the processor in communication with the storage medium via a bus when the electronic device is running, the processor executing the machine-readable instructions to perform the resource usage method of any of the first aspects.
The embodiment of the application has the following beneficial effects:
the application and environment information is defined by a specific declarative description language, the resources are described based on this language, and a usable resource instance can be assembled by a certain rule. The application instance can be more clearly and quickly managed through the description after being formed through release, and services can be discovered and accessed through unified specifications. Service assembly, service positioning and resource management are realized through the specific language modeling and using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of steps S101-S103 provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a resource identifier grammar provided by an embodiment of the application;
FIG. 3 is an assembly schematic provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of resource publishing provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of resource access provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a resource utilization device according to an embodiment of the present application;
fig. 7 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a particular ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a particular order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein.
It should be noted that the term "comprising" will be used in embodiments of the application to indicate the presence of the features stated hereafter, but not to exclude the addition of other features.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application and is not intended to be limiting of the application.
Referring to fig. 1, fig. 1 is a schematic flow chart of steps S101 to S103 of a resource usage method according to an embodiment of the present application, and will be described with reference to steps S101 to S103 shown in fig. 1.
Step S101, establishing a resource identifier according to a preset rule for at least one resource, wherein the at least one resource is a distributed resource, and the resource identifier is used for identifying characteristic information of each resource in the at least one resource;
step S102, responding to a resource release request, assembling at least one target resource with subordinate relation in the at least one resource through the resource identifier, and releasing the service instance obtained after the assembling;
step S103, responding to a resource access request, analyzing the access request to obtain target characteristic information of a resource to be accessed, and accessing a corresponding service instance from the published service instances based on the target characteristic information, wherein the resource access request comprises the resource identifier corresponding to the resource to be accessed.
The resource using method defines application and environment information through a specific declarative description language, describes resources based on the language, and can assemble a usable resource instance through a certain rule. The application instance can be more clearly and quickly managed through the description after being formed through release, and services can be discovered and accessed through unified specifications. Service assembly, service positioning and resource management are realized through the specific language modeling and using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.
The above-described exemplary steps of the embodiments of the present application are described below, respectively.
In step S101, a resource identifier is established for at least one resource according to a preset rule, where the at least one resource is a distributed resource, and the resource identifier is used to identify feature information of each resource in the at least one resource.
The resources involved in the present application may be a series of software and services that enable traffic within an enterprise system, and may form application instances of the services by "machining" (assembling, co-working).
The resource identifier is a declarative (DSL, domain Specific Language) that identifies resource instances, a computer programming language with limited expressivity for a domain. The design purpose is to provide a flexible expression method for establishing the relation among the resources.
In some embodiments, the resource identifier comprises: the combination relational symbol, the type, the unique characteristic separator and the unique identifier are sequentially arranged;
wherein the combination relational symbol is used for representing the aggregation relation of the resources;
the type is used for representing the type of the resource;
the unique feature separator is used for separating the unique identifier;
the unique identity is a unique identity for resource location.
For example, referring to fig. 2, fig. 2 is a schematic diagram of a resource identifier according to an embodiment of the present application, and as shown in fig. 2, a combined relational symbol may be "/", which is used to represent an aggregate relationship of resources. For example: data center; name = north China/Server: VM; id=vm01, representing the VM01 virtual machine under the north-China physical data center.
In some embodiments, the types include a parent type and a subtype, the parent type and the subtype being connected by an inheritance relationship.
As shown in FIG. 2, the types may be single types, or parent and child types with inheritance relationships, the types being used for classification of resources, such as: VM; id=vm01, where VM is a resource type, representing a virtual machine, and among servers, VM is a subtype and Server is a parent type. The inheritance relationship may be ": the resource types partitioned by the separator have an aggregate relationship, such as Server: VM, representing the virtual machines under the Server.
The unique characteristic separator may be "; the separator is followed by a unique identification of the resource instance for resource instance location. For example, name=north China after the division number, id=vm01 after the division number.
In some embodiments, the unique identification may be embodied in the form of unique characteristic key-value pairs, e.g., in a Server: VM; in the key value pair of id=vm01, the Server is that the VM is the type, the id=vm01 is the value, and the id=vm01 is the unique identifier.
The unique identification can uniquely distinguish resource instances, typically represented by an ID. Because IDs are typically generated automatically in a system, there is no descriptability. It is therefore recommended to use features (combinations) that also have unique constraints instead. For example: name + type. The multi-feature combination is segmented by '&'. It should be noted that: no matter how many aggregates the resource types go through, the unique features across the hierarchy will not change. For example: server: VM; id=vm01, VM01 points to the same resource instance, whether retrieved by Server or VM.
In some embodiments, the resource identifier further comprises: the inquiry separator and the inquiry condition are sequentially connected after the unique identifier;
The query separator is used for indicating that a query condition exists;
the query condition represents at least one condition available for querying the current resource, the different conditions being connected by a connector.
By way of example, with continued reference to fig. 2, the query separator may be "? ", for indicating the presence of a query condition, e.g., a/Server: VM; ? id=01 indicates that a query condition exists, and id=01 is the query condition, and the query condition can be used to retrieve a resource instance under the current resource type. Unlike the unique identification, querying key-value pairs does not guarantee unique locating of resource instances. Is a collective query based on conditional commonalities. The resource instance may be located by "&" connecting a plurality of query conditions, which may be fuzzy queries.
In some embodiments, the resource identifier further comprises: the internal model locators and the internal models are sequentially connected after the query conditions;
the internal model locator is used for locating the internal model of the resource;
the internal model includes metadata representing a metadata structure of the resource, features representing internal features of the resource, and behaviors representing behavior methods of the resource.
By way of example, with continued reference to fig. 2, the internal model locator may be "#", for example, for the locating of an example internal model, such as an application system: application; name=core system # weight (5), where the weight (5) is an internal model, and for the internal model, the embodiment of the present application provides 3 internal models. The method comprises the following steps: metadata, features, and behavior.
Metadata: the metadata structure representing the resource instance is similar to a class of Java.
Features that represent internal features of the resource instance. The so-called internal feature corresponds to a value object in the domain driver. If there are other resource references to a resource, the representation is in a path.
Behavior-behavior method representing resource. Similar to the method in Java.
In step S102, at least one target resource having a subordinate relationship in the at least one resource is assembled through the resource identifier in response to the resource publishing request, and the service instance obtained after the assembly is published.
In some embodiments, the assembling at least one target resource having a membership in the at least one resource with the resource identifier includes:
splicing the resource identifiers of at least one target resource with a subordinate relation in the at least one resource according to a preset hierarchical relation to obtain a target character string, wherein an upper layer conduction value of the internal model of the same type in the target character string replaces a lower layer conduction value, and the types with a father-son relation in the target character string are sequentially connected through the succession relation;
For example, referring to fig. 3, fig. 3 is an assembly schematic provided by an embodiment of the present application, where resources may be regional/regional; name = beijing and/or territory; name = Shanghai, data center class/data center; name = Fengtai and/or datacenter; name = lake, virtual machine class/virtual machine; ip=10.0.0.1 and/or virtual machine; ip=10.0.0.2. For hierarchical relationships, it is region > data center > virtual machines, e.g., there are/virtual machines under Beijing's data center; ip=10.0.0.1 and/or virtual machine; if the ip=10.0.0.2 virtual machines (with subordinate relations) are required to be published, corresponding resources in the aspects of environment, data center and virtual machine can be obtained respectively, and in the process of resource assembly of application deployment, according to actual requirements, in the process of application (/ application; name=client and/application; name=payment), the corresponding environment, data center and virtual machine are selected/applied; name=customer, forming an application instance, and forming a character string/region according to a preset hierarchical relationship in the registration process; name = beijing/data center; name = Fengtai/virtual machine; ip=10.0.0.1/application; name=client, the string is used for registration publication.
In the process of resource assembly, conduction and inheritance are involved.
As an example of conduction, the application system: application; name = core system # weight (5) -conductive.
Service: a service; name=account # weight (3).
The combination is "/application; name = core system # weight (5)/service; name=account ", meaning that the account service weight of the core system is" 5". The upper layer conduction value replaces the lower layer conduction value during service resource assembly, which is also the reason that the combined weight (3) is not visible, and is the coverage of the upper layer to the lower layer.
As an example of inheritance, communication security: safety; name=mac check.
Application: application; name=account.
API interface: an API; name=query account information.
The combination is "/application; name = account/security; name = MAC check: an API; name=query account information ", meaning that the query account information interface of the account application needs to perform MAC security check. The ": "embody inheritance".
In some embodiments, before the publishing the service instance obtained after the assembling, the method further includes:
verifying the assembled resource identifier in the service instance;
And when the assembled resource identifier does not accord with the preset assembly rule, canceling the assembly and returning a corresponding error reason.
For example, the party/territory; name = Shanghai and/or data center; name=lake, but the data center of the lake is located in beijing, which is not located in the ocean, so the assembly does not meet the preset assembly rule, the assembly is canceled, and the error causes are returned: there is no starched data center in the ocean above the territory. Similarly, the assembly rule may include at least one of: there is a corresponding affiliation and the identifier is correctly entered.
The publishing of the service instance obtained after assembly comprises the following steps:
performing first analysis processing on the target character strings based on the combination relational symbols to obtain a first target array, wherein the character after each combination relational symbol is an element in the first target array;
and acquiring the resources corresponding to each element in the first target array, and publishing and registering after the resources corresponding to each element are packaged.
For example, referring to fig. 4, fig. 4 is a schematic diagram of resource publishing provided by an embodiment of the present application, where a first parsing process is required for a resource identifier (character string) to be parsed into a first target array, for example, "/region; id = beijing/data center; id = Fengtai/server: a virtual machine; ip=10.0.0.1:8080/application; name = account/security; name = MAC check: an API; name=query account information ", preferably resolved into an array by combining the relations"/":
[ "region; id = beijing ",
"data center; id = Fengtai ",
"server: a virtual machine; ip = 10.0.0.1:8080",
"/application; name = account ",
"/security; name = MAC check: an API; name=query account information "].
The "region", "data center" and "server" are location information, and serve as distribution destination guidance information. An "application" is a published resource type, and "security" is another resource that a service needs to use, and if the current program does not contain this resource instance, the resource instance is loaded from the resource center by definition.
According to the resource identifier definition provided in the implementation of the present application, the following operations are implemented: an account application instance containing API for inquiring account information is issued to a virtual machine of 10.0.0.1:8080 of the Beijing Fengtai data center and a MAC check security detection instance is loaded.
In step S103, in response to a resource access request, analyzing the access request to obtain target feature information of a resource to be accessed, and accessing a corresponding service instance from the published service instances based on the target feature information, where the resource access request includes the resource identifier corresponding to the resource to be accessed.
In some embodiments, the target feature information includes location information and application information, and the analyzing the access request to obtain the target feature information of the resource to be accessed includes:
performing second analysis processing on the resource identifier corresponding to the resource to be accessed based on the combination relation symbol to obtain a second target array, wherein each element in the second target array represents a resource;
acquiring the position information of the resource to be accessed based on the second target array;
for example, referring to fig. 5, fig. 5 is a schematic diagram of resource access, e.g., "/territory, provided by an embodiment of the present application; id = beijing/data center; id = Fengtai/server: a virtual machine; ip=10.0.0.1/application; name = account/security; name = MAC check: an API; name=query account information ", preferably resolved into an array by combining the relations"/":
[ "region; id = beijing ",
"data center; id = Fengtai ",
"server: a virtual machine; ip = 10.0.0.1",
"/application; name = account ",
"/security; name = MAC check: an API; name=query account information "].
The accessing of the corresponding service instance matched from the published service instances based on the target characteristic information comprises the following steps:
and responding to the access request aiming at the position information, acquiring the application information from the second target array, and accessing the application information.
The location of the service instance is found through the location information of the region, the data center and the server, and the application account service location is known on a virtual machine of 10.0.0.1 of the Beijing Fengtai data center according to the grammar of the resource identifier, and a request is sent to the 8080 port of the target server through the online communication module.
The application service analyzes the application service information, the grammar of the resource identifier can know the API interface "/security which needs to be accessed; name = MAC check: an API; name=query account information). Identifying ": "inheritance relationship identifier, on invocation" of API; name=query account information "need to perform before" security; name=mac check ", and" query account information "in the" API "service is called after completion.
In summary, the embodiment of the application has the following beneficial effects:
the application and environment information is defined by a specific declarative description language, the resources are described based on this language, and a usable resource instance can be assembled by a certain rule. The application instance can be more clearly and quickly managed through the description after being formed through release, and services can be discovered and accessed through unified specifications. Service assembly, service positioning and resource management are realized through the specific language modeling and using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.
Based on the same inventive concept, the embodiment of the present application further provides a resource usage device corresponding to the resource usage method in the first embodiment, and since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the resource usage method, the implementation of the device may refer to the implementation of the method, and the repetition is omitted.
As shown in fig. 6, fig. 6 is a schematic structural diagram of a resource usage device 600 according to an embodiment of the present application. The resource using apparatus 600 includes:
the establishing module 601 is configured to establish a resource identifier according to a preset rule for at least one resource, where the at least one resource is a distributed resource, and the resource identifier is used to identify feature information of each resource in the at least one resource;
an assembling module 602, configured to respond to a resource publishing request, assemble at least one target resource with a subordinate relationship in the at least one resource through the resource identifier, and publish a service instance obtained after the assembling;
the access module 603 is configured to respond to a resource access request, perform parsing processing on the access request to obtain target feature information of a resource to be accessed, and perform access by matching a corresponding service instance from the published service instances based on the target feature information, where the resource access request includes the resource identifier corresponding to the resource to be accessed.
Those skilled in the art will appreciate that the implementation functions of the units in the resource-using device 600 shown in fig. 6 can be understood with reference to the foregoing description of the resource-using method. The functions of the respective units in the resource usage device 600 shown in fig. 6 may be implemented by a program running on a processor or by a specific logic circuit.
In one possible implementation, the resource identifier includes: the combination relational symbol, the type, the unique characteristic separator and the unique identifier are sequentially arranged;
wherein the combination relational symbol is used for representing the aggregation relation of the resources;
the type is used for representing the type of the resource;
the unique feature separator is used for separating the unique identifier;
the unique identity is a unique identity for resource location.
In one possible implementation, the types include a parent type and a subtype, and the parent type and the subtype are connected through an inheritance relationship.
In a possible implementation manner, the resource identifier further includes: the inquiry separator and the inquiry condition are sequentially connected after the unique identifier;
the query separator is used for indicating that a query condition exists;
The query condition represents at least one condition available for querying the current resource, the different conditions being connected by a connector.
In a possible implementation manner, the resource identifier further includes: the internal model locators and the internal models are sequentially connected after the query conditions;
the internal model locator is used for locating the internal model of the resource;
the internal model includes metadata representing a metadata structure of the resource, features representing internal features of the resource, and behaviors representing behavior methods of the resource.
In one possible implementation, the assembling module 602 assembles at least one target resource having a relationship among the at least one resource through the resource identifier, including:
splicing the resource identifiers of at least one target resource with a subordinate relation in the at least one resource according to a preset hierarchical relation to obtain a target character string, wherein an upper layer conduction value of the internal model of the same type in the target character string replaces a lower layer conduction value, and the types with a father-son relation in the target character string are sequentially connected through the succession relation;
The publishing of the service instance obtained after assembly comprises the following steps:
performing first analysis processing on the target character strings based on the combination relational symbols to obtain a first target array, wherein the character after each combination relational symbol is an element in the first target array;
and acquiring the resources corresponding to each element in the first target array, and publishing and registering after the resources corresponding to each element are packaged.
In a possible implementation manner, the target feature information includes location information and application information, and the issuing module 603 performs parsing processing on the access request to obtain target feature information of a resource to be accessed, where the target feature information includes:
performing second analysis processing on the resource identifier corresponding to the resource to be accessed based on the combination relation symbol to obtain a second target array, wherein each element in the second target array represents a resource;
acquiring the position information of the resource to be accessed based on the second target array;
the accessing of the corresponding service instance matched from the published service instances based on the target characteristic information comprises the following steps:
And responding to the access request aiming at the position information, acquiring the application information from the second target array, and accessing the application information.
The resource using device defines application and environment information through a specific declarative description language, describes resources based on the language, and can assemble a usable resource instance through a certain rule. The application instance can be more clearly and quickly managed through the description after being formed through release, and services can be discovered and accessed through unified specifications. Service assembly, service positioning and resource management are realized through the specific language modeling and using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.
As shown in fig. 7, fig. 7 is a schematic diagram of a composition structure of an electronic device 700 according to an embodiment of the present application, where the electronic device 700 includes:
a processor 701, a storage medium 702, and a bus 703, the storage medium 702 storing machine-readable instructions executable by the processor 701, the processor 701 and the storage medium 702 communicating over the bus 703 when the electronic device 700 is running, the processor 701 executing the machine-readable instructions to perform the steps of the resource usage method according to the embodiments of the present application.
In practice, the various components in the electronic device 700 are coupled together by a bus 703. It is understood that the bus 703 is used to enable connected communications between these components. The bus 703 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration the various buses are labeled as bus 703 in fig. 7.
The electronic device defines application and environment information through a specific declarative description language, describes resources based on the language, and can assemble a usable resource instance through a certain rule. The application instance can be more clearly and quickly managed through the description after being formed through release, and services can be discovered and accessed through unified specifications. Service assembly, service positioning and resource management are realized through the specific language modeling and using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.
The embodiment of the present application further provides a computer readable storage medium, where executable instructions are stored, where the executable instructions, when executed by at least one processor 701, implement the resource usage method according to the embodiment of the present application.
In some embodiments, the storage medium may be a magnetic random Access Memory (FRAM, ferromagneticRandom Access Memory), read Only Memory (ROM), programmable Read Only Memory (PROM, programmable Read Only Memory), erasable programmable Read Only Memory (EPROM, erasableProgrammable Read Only Memory), electrically erasable programmable Read Only Memory (EEPROM, electricallyErasable Programmable Read Only Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk Read Only Memory (CD ROM, compact Disc Read Only Memory), among others; but may be a variety of devices including one or any combination of the above memories.
In some embodiments, the executable instructions may be in the form of programs, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, the executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a hypertext markup Language (HTML, hyperTextMarkup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices located at one site or, alternatively, distributed across multiple sites and interconnected by a communication network.
The computer-readable storage medium defines application and environment information in a specific declarative description language, describes resources based on the language, and can be assembled into a usable resource instance by a certain rule. The application instance can be more clearly and quickly managed through the description after being formed through release, and services can be discovered and accessed through unified specifications. Service assembly, service positioning and resource management are realized through the specific language modeling and using engine driving, so that the resource management in the distributed system is clearer and the application is more flexible.
In the several embodiments provided in the present application, it should be understood that the disclosed method and electronic device may be implemented in other manners. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily appreciate variations or alternatives within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A method of resource use, comprising the steps of:
establishing a resource identifier according to a preset rule for at least one resource, wherein the at least one resource is a distributed resource, and the resource identifier is used for identifying characteristic information of each resource in the at least one resource;
responding to a resource release request, assembling at least one target resource with a subordinate relation in the at least one resource through the resource identifier, and releasing a service instance obtained after the assembling;
responding to a resource access request, analyzing the access request to obtain target characteristic information of a resource to be accessed, and accessing a corresponding service instance from the published service instances based on the target characteristic information, wherein the resource access request comprises the resource identifier corresponding to the resource to be accessed.
2. The method of claim 1, wherein the resource identifier comprises: the combination relational symbol, the type, the unique characteristic separator and the unique identifier are sequentially arranged;
wherein the combination relational symbol is used for representing the aggregation relation of the resources;
the type is used for representing the type of the resource;
the unique feature separator is used for separating the unique identifier;
the unique identity is a unique identity for resource location.
3. The method of claim 2, wherein the types include a parent type and a subtype, the parent type and subtype being connected by an inheritance relationship.
4. A method according to claim 3, wherein the resource identifier further comprises: the inquiry separator and the inquiry condition are sequentially connected after the unique identifier;
the query separator is used for indicating that a query condition exists;
the query condition represents at least one condition available for querying the current resource, the different conditions being connected by a connector.
5. The method of claim 4, wherein the resource identifier further comprises: the internal model locators and the internal models are sequentially connected after the query conditions;
The internal model locator is used for locating the internal model of the resource;
the internal model includes metadata representing a metadata structure of the resource, features representing internal features of the resource, and behaviors representing behavior methods of the resource.
6. The method of claim 5, wherein assembling at least one target resource of the at least one resource having a affiliation with the resource identifier comprises:
splicing the resource identifiers of at least one target resource with a subordinate relation in the at least one resource according to a preset hierarchical relation to obtain a target character string, wherein an upper layer conduction value of the internal model of the same type in the target character string replaces a lower layer conduction value, and the types with a father-son relation in the target character string are sequentially connected through the succession relation;
the publishing of the service instance obtained after assembly comprises the following steps:
performing first analysis processing on the target character strings based on the combination relational symbols to obtain a first target array, wherein the character after each combination relational symbol is an element in the first target array;
And acquiring the resources corresponding to each element in the first target array, and publishing and registering after the resources corresponding to each element are packaged.
7. The method according to claim 2, wherein the target feature information includes location information and application information, and the analyzing the access request to obtain the target feature information of the resource to be accessed includes:
performing second analysis processing on the resource identifier corresponding to the resource to be accessed based on the combination relation symbol to obtain a second target array, wherein each element in the second target array represents a resource;
acquiring the position information of the resource to be accessed based on the second target array;
the accessing of the corresponding service instance matched from the published service instances based on the target characteristic information comprises the following steps:
and responding to the access request aiming at the position information, acquiring the application information from the second target array, and accessing the application information.
8. The method of claim 1, wherein prior to publishing the assembled service instance, the method further comprises:
Verifying the assembled resource identifier in the service instance;
and when the assembled resource identifier does not accord with the preset assembly rule, canceling the assembly and returning a corresponding error reason.
9. A resource-using device, the device comprising:
the resource identifier is used for identifying characteristic information of each resource in the at least one resource;
the assembly module is used for responding to a resource release request, assembling at least one target resource with a subordinate relationship in the at least one resource through the resource identifier, and releasing the service instance obtained after the assembly;
the access module is used for responding to a resource access request, analyzing the access request to obtain target characteristic information of the resource to be accessed, and accessing the corresponding service instance from the published service instances based on the target characteristic information, wherein the resource access request comprises the resource identifier corresponding to the resource to be accessed.
10. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is running, the processor executing the machine-readable instructions to perform the resource usage method of any of claims 1 to 8.
CN202310532542.2A 2023-05-11 2023-05-11 Resource use method and device and electronic equipment Pending CN116627635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310532542.2A CN116627635A (en) 2023-05-11 2023-05-11 Resource use method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310532542.2A CN116627635A (en) 2023-05-11 2023-05-11 Resource use method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN116627635A true CN116627635A (en) 2023-08-22

Family

ID=87612630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310532542.2A Pending CN116627635A (en) 2023-05-11 2023-05-11 Resource use method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116627635A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032567A (en) * 2018-07-06 2018-12-18 航天星图科技(北京)有限公司 Service development and operation method and its model in a kind of micro services environment
CN112000725A (en) * 2020-08-28 2020-11-27 哈尔滨工业大学 Ontology fusion pretreatment method for multi-source heterogeneous resources
CN112367370A (en) * 2020-10-27 2021-02-12 中国光大银行股份有限公司 Management method, device, equipment and medium for hybrid cloud resource data
CN112995163A (en) * 2021-02-10 2021-06-18 北京金山云网络技术有限公司 Resource access authentication method and device, storage medium and electronic equipment
CN114598500A (en) * 2022-01-29 2022-06-07 奇安信科技集团股份有限公司 Security service providing method, platform, electronic device, medium, and program
CN115827101A (en) * 2022-12-14 2023-03-21 苏州空天信息研究院 Cloud integration system and method for earth application model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032567A (en) * 2018-07-06 2018-12-18 航天星图科技(北京)有限公司 Service development and operation method and its model in a kind of micro services environment
CN112000725A (en) * 2020-08-28 2020-11-27 哈尔滨工业大学 Ontology fusion pretreatment method for multi-source heterogeneous resources
CN112367370A (en) * 2020-10-27 2021-02-12 中国光大银行股份有限公司 Management method, device, equipment and medium for hybrid cloud resource data
CN112995163A (en) * 2021-02-10 2021-06-18 北京金山云网络技术有限公司 Resource access authentication method and device, storage medium and electronic equipment
CN114598500A (en) * 2022-01-29 2022-06-07 奇安信科技集团股份有限公司 Security service providing method, platform, electronic device, medium, and program
CN115827101A (en) * 2022-12-14 2023-03-21 苏州空天信息研究院 Cloud integration system and method for earth application model

Similar Documents

Publication Publication Date Title
US20130304713A1 (en) System and method for metadata level validation of custom setup objects
Zhang et al. Criteria analysis and validation of the reliability of web services-oriented systems
CN103593605A (en) Android platform applications dynamic analysis system based on permission use behaviors
CN108681563B (en) Service publishing and accessing system based on one table of multiple users
CN113127199B (en) Load balancing configuration method, device, equipment and storage medium
US10891357B2 (en) Managing the display of hidden proprietary software code to authorized licensed users
CN112181804A (en) Parameter checking method, equipment and storage medium
Kost et al. Privacy analysis using ontologies
WO2018067947A1 (en) Profile based content and services
CN113360519B (en) Data processing method, device, equipment and storage medium
CN111258832B (en) Interface parameter verification method, device, equipment and medium
Bartolini et al. Data flow-based validation of web services compositions: Perspectives and examples
CN102915360B (en) Present the system of the relevant information of website
CN116627635A (en) Resource use method and device and electronic equipment
CN112015826B (en) Intelligent contract security detection method based on block chain and related equipment
CN115134367A (en) Cloud platform and service processing method
CN112230938B (en) Method and device for configuring rental products of industrial Internet
CN113849789A (en) Authority verification method, device and equipment based on AOP and storage medium
CN108512806A (en) A kind of operation behavior analysis method and server based on virtual environment
CN111859452A (en) Page information checking method, device and equipment and computer readable storage medium
CN105550022A (en) Business data processing method and apparatus
US8112370B2 (en) Classification and policy management for software components
US20230368135A1 (en) System and method of translating a tracking module to a unique identifier
CN110535701B (en) Problem positioning method and device
CN117632445B (en) Request processing method and device, task execution method and device

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