CN111147312B - Resource allocation management method and device, resource allocation cache management method and device, and allocation management system - Google Patents

Resource allocation management method and device, resource allocation cache management method and device, and allocation management system Download PDF

Info

Publication number
CN111147312B
CN111147312B CN201911415072.1A CN201911415072A CN111147312B CN 111147312 B CN111147312 B CN 111147312B CN 201911415072 A CN201911415072 A CN 201911415072A CN 111147312 B CN111147312 B CN 111147312B
Authority
CN
China
Prior art keywords
resource
key
value pair
configuration
environment
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
CN201911415072.1A
Other languages
Chinese (zh)
Other versions
CN111147312A (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.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies 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 Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201911415072.1A priority Critical patent/CN111147312B/en
Publication of CN111147312A publication Critical patent/CN111147312A/en
Application granted granted Critical
Publication of CN111147312B publication Critical patent/CN111147312B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Abstract

The embodiment of the invention provides a management method of resource allocation, a management method and a system of resource allocation cache, wherein the management method of resource allocation comprises the following steps: configuring resource nodes containing resource private key value pairs to a loose private environment, establishing a first index relationship to index to corresponding resource nodes, and configuring a second index relationship in the resource nodes to index to the corresponding resource private key value pairs; configuring the resource sharing key value pairs to a cluster sharing environment, and establishing a third indexing relation to index the corresponding resource key value pairs; fusing the cluster sharing environment and the loose private environment into a fused environment; and configuring the shared key value pair to a cache environment in the cluster resource node so as to switch to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid. By switching the fusion environment and the resource configuration cache, the flexible management of the configuration information is realized, and the management efficiency of the configuration information is improved.

Description

Resource allocation management method and device, resource allocation cache management method and device, and allocation management system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for managing resource allocation, a method and an apparatus for managing a resource allocation cache, and a configuration management system.
Background
Computer configuration information refers to key value pairs, wherein, the change of the value can affect the behavior or result of the software and hardware system, and the management of the configuration information is a key link in the software and hardware system product, and generally, the following two different configuration management forms exist: non-cloud configuration management and cloud configuration management. In the non-cloud configuration management, the storage of configuration information is bound with nodes and is private to the nodes, and operation and maintenance personnel directly face the configuration of all the nodes, and the reading/modification/influence of the configuration information is limited within the range of the nodes, as shown in fig. 1 a; the cloud configuration management refers to a cloud computing platform or a cloud application platform, and is implemented by deploying in a cluster, managing in the cluster, managing in a high availability manner, and dynamically extending into an IT environment and a system with characteristics, all configurations are stored in a node called a cluster configuration center, all cluster nodes read/synchronize/update configuration information to the configuration center node, and operation and maintenance personnel only interact with the configuration center and do not directly interact with independent nodes in the cluster, as shown in fig. 1 b. In non-cloud configuration management, due to the loose organization state among all nodes, the configuration work is complex, the workload is large, and errors are easy to occur; in the cloud configuration management, because the configuration information of each node is uniformly managed in a cluster configuration center, the error propagation efficiency is high, the dependence of the node on the cluster is increased, the availability and stability of the whole cluster configuration are reduced, the condition of large-area configuration failure is easy to occur, meanwhile, the flexibility of the deployment of configured software is limited, the software must be operated in combination with the configuration center, and the configuration center may depend on a complex system, so that simple software and complex matched deployment are finally caused. Therefore, in the conventional computer configuration information management, the problem of inflexible configuration information management exists, so that the configuration information management is not efficient.
Disclosure of Invention
The embodiment of the invention provides a method for managing resource allocation, which can improve the flexibility of managing the allocation information and improve the management efficiency of the allocation information.
In a first aspect, an embodiment of the present invention provides a method for managing resource allocation, including:
configuring resource nodes containing resource private key value pairs to a loose private environment, establishing a first index relationship to index to corresponding resource nodes, and configuring a second index relationship in the resource nodes to index to the corresponding resource private key value pairs; and
configuring the resource sharing key value pairs to a cluster sharing environment, and establishing a third indexing relation to index the corresponding resource sharing key value pairs;
and fusing the cluster sharing environment and the loose private environment to obtain a fused environment, switching to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fused environment is invalid, and performing synchronous configuration or updating on the preset resource configuration cache according to the fused environment.
Optionally, the merging the cluster sharing environment with the loose private environment includes:
reading all resource sharing key value pairs of the cluster sharing environment, and adding the resource sharing key value pairs to a first set;
reading all resource private key value pairs of the current resource node, adding the resource private key value pairs to a second set, and judging whether the second set is empty or not;
if the second set is not empty, judging whether the first set and the second set have resource sharing key-value pairs and resource private key-value pairs with the same key name;
if the resource sharing key value pair and the resource private key value pair with the same key name exist in the first set and the second set, judging whether the resource sharing key value pair with the same key name is the same as the corresponding value of the resource private key value pair;
if the resource sharing key value pair with the same key name is different from the corresponding value of the resource private key value pair, updating the resource private key value pair with the same key name in the second set to the first set as the resource sharing key value pair;
traversing all second sets corresponding to all resource nodes to obtain a finally updated first set;
configuring or updating resource sharing key-value pairs of the cluster sharing environment based on the final updated first set.
Optionally, the switching to the preset resource configuration cache performs configuration management on the target software/hardware, including:
and synchronously configuring or updating the local resource key value pair in the preset resource configuration cache according to the resource sharing key value pair and the resource private key value pair of the fusion environment, so that the resource configuration cache configures or updates the target software/hardware according to the synchronous configuration or updating result.
Optionally, the performing synchronous configuration or update on the resource key-value pair in the preset resource configuration cache according to the resource sharing key-value pair and the resource private key-value pair of the fusion environment includes:
reading a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
acquiring a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
determining whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set;
if the first resource key value pair and the second resource key value pair with the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same;
if the corresponding values in the first resource key value pair and the second resource key value pair are different, adding the corresponding first resource key value pair with the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key value pairs cached by the preset resource configuration based on the final fifth set.
In a second aspect, an embodiment of the present invention provides a method for managing a resource configuration cache, including:
receiving resource key value pair change information of a configuration center, and synchronously configuring or updating resource key value pairs cached by resource configuration, wherein the change information comprises configuration or updating of the resource key value pairs of the configuration center;
based on the configured or updated resource configuration cache, informing a configuration/update module to configure or update the target software/hardware;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key-value pairs, the corresponding resource nodes are indexed through a first index relationship, and the resource nodes are configured with a second index relationship to index the corresponding resource private key-value pairs; and the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation.
Optionally, the receiving resource key-value pair change information of the configuration center, and synchronously configuring or updating resource key-value pairs cached in the resource configuration includes:
acquiring a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
reading a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
judging whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set;
if the first resource key value pair and the second resource key value pair of the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair of the same key name are the same;
if the corresponding values in the first resource key value pair and the second resource key value pair are different, adding the corresponding first resource key value pair with the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key-value pairs of the resource configuration cache based on the final fifth set.
Optionally, the notifying, based on the updated resource configuration cache, the configuration/update module to configure or update the target software/hardware includes:
when monitoring that the resource key value pair in the resource configuration cache is changed, informing the configuration/update module to configure or update the target software/hardware according to the changed resource key value pair, wherein the change comprises the configuration or update of the resource key value pair in the resource configuration cache.
In a third aspect, an embodiment of the present invention provides a management apparatus for resource configuration, including:
the first configuration module is used for configuring the resource nodes containing the resource private key value pairs to a loose private environment, establishing a first index relationship to index to the corresponding resource nodes, and configuring a second index relationship in the resource nodes to index to the corresponding resource private key value pairs; and
the second configuration module is used for configuring the resource sharing key value pairs to the cluster sharing environment and establishing a third indexing relation to index the corresponding resource sharing key value pairs;
and the fusion module is used for fusing the cluster sharing environment with the loose private environment to obtain a fusion environment, switching to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid, and performing synchronous configuration or updating on the preset resource configuration cache according to the fusion environment.
In a fourth aspect, an embodiment of the present invention provides a management apparatus for a resource configuration cache, including:
the first configuration or update module is used for receiving resource key value pair change information of the configuration center and synchronously configuring or updating resource key value pairs cached by resource configuration, wherein the change information comprises configuration or update of the resource key value pairs of the configuration center;
the second configuration or update module is used for notifying the configuration update module to configure or update the target software/hardware based on the configured or updated resource configuration cache;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; and the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including: the management method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the steps in the management method of the resource configuration provided by the embodiment of the invention.
In a sixth aspect, an embodiment of the present invention provides an electronic device, including: the management method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the steps in the management method of the resource configuration cache provided by the embodiment of the invention.
In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the management method for resource configuration provided in the embodiment of the present invention.
In an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the method for managing a resource configuration cache provided in the embodiment of the present invention.
In a ninth aspect, an embodiment of the present invention provides a configuration management system, including: a configuration center and a resource configuration cache;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation;
the resource allocation cache is used for receiving resource sharing key values or resource private key value pair change information of the allocation center and synchronously allocating or updating resource key value pairs of the resource allocation cache, wherein the change information comprises allocation or updating of the resource key value pairs of the allocation center; and notifying a configuration updating module to configure or update the target software/hardware based on the configured or updated resource configuration cache.
In the embodiment of the invention, resource nodes containing resource private key-value pairs are configured to a loose private environment, a first index relationship is established to index to corresponding resource nodes, and a second index relationship is configured in the resource nodes to index to the corresponding resource private key-value pairs; configuring the resource sharing key value pairs to a cluster sharing environment, and establishing a third indexing relation to index the corresponding resource sharing key value pairs; and fusing the cluster sharing environment and the loose private environment to obtain a fused environment, switching to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fused environment is invalid, and performing synchronous configuration or updating on the preset resource configuration cache according to the fused environment. The resource key value pairs are simultaneously configured in the loose private environment and the cluster sharing environment, and the loose private environment and the cluster sharing environment are fused, so that the fusion environment and the resource configuration cache can be switched to configure and manage target software/hardware, flexible management of configuration information is realized, and when the fusion environment fails, the resource configuration cache is switched to, so that the situation that the target software/hardware system cannot cope due to error propagation is avoided, and the management efficiency of the configuration information is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic structural diagram of a configuration management system according to an embodiment of the present invention;
FIG. 1a is a schematic diagram of a non-cloud configuration management system in the background art;
FIG. 1b is a schematic diagram of another cloud configuration management system in the background art;
fig. 1c is a schematic structural diagram of a configuration cache unit according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for managing resource allocation according to an embodiment of the present invention;
FIG. 3 is a flowchart of a configuration environment fusion method according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for configuring or updating a resource configuration cache according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for managing a resource allocation cache according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a resource allocation management apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another resource configuration management apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another resource allocation management apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a management apparatus for resource allocation cache according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another management apparatus for resource allocation cache according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a configuration management system according to an embodiment of the present invention, and as shown in fig. 1, the configuration management system includes: a configuration center 100 and a resource configuration cache 200.
The configuration center 100 includes a fused loose private environment 101, a cluster sharing environment 102, and a configuration center access interface 103, where, during resource configuration, the configuration center 100 and the resource configuration cache 200 may be freely switched, or default to be the priority of the configuration center 100, for example, when the cluster configuration center 100 fails, the configuration center is automatically switched to the resource configuration cache 200. The configuration center access interface 103 is used for interacting with the configuration center operation interface 300, so that a user can perform resource configuration operation on the configuration center 100 through the configuration center operation interface 300.
The resource configuration cache 200 includes a configuration synchronization unit 201, a configuration cache unit 202, and a configuration/update unit 203, and the resource configuration cache 200 interacts with the configuration cache operation interface 500 through the cache access interface 400, so that a user can directly perform a resource configuration operation on the resource configuration cache 200 through the configuration cache operation interface 500. The configuration synchronization unit 201 is connected to the cluster-shared environment 102, the loose private environment 101, and the configuration cache unit 202, respectively, to perform synchronous configuration or update on the configuration information in the cluster-shared environment 102, the loose private environment 101, and the configuration cache unit 202.
The user can perform resource configuration on the target software/hardware 600 through the configuration center 100 and the resource configuration cache 200. Specifically, a user performs a resource configuration operation on the configuration center 100 through the configuration center operation interface 300, the resource configuration cache 200 performs synchronous configuration or update on the configuration information stored in the configuration cache unit 202 according to the configuration synchronization unit 201, and the configuration/update unit 203 applies the updated configuration information to the target software/hardware 600 to configure or update the target software/hardware 600. Specifically, the configuration/update unit 203 snoops the configuration cache unit 202 in the resource configuration cache 200 to become a snooper of the configuration cache unit 202, and applies the updated configuration information in the configuration cache unit 202 to the target software/hardware 600 when monitoring that the configuration information in the configuration cache unit 202 is updated.
When the configuration center 100 fails, the user may directly perform a resource configuration operation on the resource configuration cache 200 through the configuration cache operation interface 500, configure or update the configuration information stored in the configuration cache unit 202, and the configuration/update unit 203 applies the updated configuration information to the target software/hardware 600 to configure or update the target software/hardware 600. When the user directly performs the resource configuration operation on the resource configuration cache 200 through the configuration cache operation interface 500, the configuration information updated in the configuration cache unit 202 may be synchronously updated to the configuration center 100. The configuration center 100 fails, which may be a failure of the configuration center cluster shared environment 102 or the loose private environment 101, or a failure of the network. Failure of either the cluster shared environment 102 or the loose private environment 101 may cause error propagation of resource node pairs, which may affect the operation of the target software/hardware 600.
Optionally, as shown in fig. 1c, the configuration cache unit 202 includes a configuration operation interface 2021, the configuration operation interface 2021 is connected to the configuration synchronization unit 201 and the cache access interface 400, the configuration operation interface 2021 accesses the resource key value pair to change the resource key value pair, the configuration operation interface is further connected to a monitor/notification unit 2022, the monitor/notification unit 2022 is configured to monitor whether the resource key value pair in the configuration cache unit 202 is updated, the monitor/notification unit 2022 is connected to the configuration/update unit 203, so that the configuration/update unit 203 registers as a monitor, and notifies the configuration/update unit 203 of the update information in the configuration cache unit 202.
The configuration center 100 and the resource configuration cache 200 may be connected through a wired or wireless network to communicate configuration information.
Further, the loose private environment 101 is configured with resource nodes including resource key-value pairs, and indexes corresponding resource nodes through a first index relationship, and the resource nodes are configured with a second index relationship to index corresponding resource key-value pairs; the cluster sharing environment 102 is configured with resource key-value pairs, and indexes the corresponding resource key-value pairs through a third index relationship.
In the resource allocation cache 200, the allocation information stored in the allocation cache unit 202 is a resource key value pair, and the corresponding resource key value pair is indexed by the fourth index relationship.
In an embodiment of the present invention, the first index relationship is a node ID index, and the index is performed through a mapping relationship between a node ID and a corresponding node, and the second index relationship, the third index relationship, and the fourth index relationship are key indexes, and the index is performed through a mapping relationship between a key and a key value pair.
It should be understood that the configuration management system is only an optional embodiment of the present invention, and in some possible embodiments, the configuration management system may also perform a variety of modifications based on the configuration center and the resource configuration cache, for example, the loose private environment 101 and the cluster sharing environment 102 of the configuration center are respectively configured in the first server and the second server, and the like.
The embodiment of the invention can switch the fusion environment and the resource configuration cache to carry out configuration management on the target software/hardware by simultaneously configuring the resource key value pairs in the loose private environment and the cluster sharing environment and fusing the loose private environment and the cluster sharing environment, thereby realizing flexible management on the configuration information.
The resource key value pair may be referred to as configuration information.
Referring to fig. 2, fig. 2 is a flowchart of a management method for resource allocation according to an embodiment of the present invention, and as shown in fig. 2, the configuration management system includes:
s201, configuring the resource nodes containing the resource private key value pairs to a loose private environment, and establishing a first index relation to index the corresponding resource nodes.
The resource key-value pair is a basic structure of configuration information, the resource key-value pair includes a key and a value, and one key corresponds to one value, wherein a change in the value can affect a behavior or a result of the software/hardware system. The resource node refers to a storage node for fixedly storing a specific key-value pair (resource private key-value pair), and a resource node is bound to a configured software/hardware, that is, a change in the value of the resource private key-value pair of the resource node can affect the behavior or result of the corresponding software/hardware system.
The resource private key-value pair and the resource sharing key-value pair are relative concepts, and the resource private key-value pair refers to a resource key-value pair specific to each resource node, for example, the resource node a is configured with the resource key-value pairs a, B, c, d, and e, the resource node B is configured with the resource key-value pairs a, B, c, d, f, and g, so that the resource node a and the resource node B have the resource sharing key-value pairs a, B, c, and d, the resource private key-value pair of the resource node a is e, and the resource private key-value pair of the resource node a is f and g.
The first index relationship refers to a mapping relationship between a node ID and a node, and may be established by maintaining a mapping table between the node ID and the node, so that a user may perform a configuration operation on a resource key value pair by indexing to a corresponding resource node through the node ID.
The resource node further includes a second index relationship, where the second index relationship refers to a mapping relationship between key names and resource private key-value pairs, and the second index relationship may be established through a mapping table of key names and resource private key-value pairs, so that a user may index the corresponding resource private key-value pairs through the key names to perform configuration operations.
S202, configuring the resource sharing key value pairs to a cluster sharing environment, and establishing a third indexing relation to index the corresponding resource sharing key value pairs.
The resource sharing key-value pair and the resource private key-value pair are relative concepts, and the resource sharing key-value pair refers to a resource key-value pair common to all resource nodes, for example, the resource node a is configured with the resource key-value pairs a, B, c, d, e, the resource node B is configured with the resource key-value pairs a, B, c, d, f, g, so that the resource node a and the resource node B have the resource sharing key-value pairs a, B, c, d, the resource private key-value pair of the resource node a is e, and the resource private key-value pair of the resource node a is f, g. In the cluster sharing environment, no resource node is set, each resource key value pair is stored in a distributed manner, and when resource configuration is performed, configuration operation can be directly performed on the resource key value pairs. The third indexing relationship refers to a mapping relationship between a key name and a resource sharing key value pair, and the third indexing relationship may be established through a mapping table of the key name and the resource sharing key value pair, so that a user may index the corresponding resource sharing key value pair through the key name to perform a configuration operation.
And S203, fusing the cluster sharing environment with the loose private environment to obtain a fused environment, and switching to a preset resource configuration cache to perform configuration management on the target software/hardware under the condition that the fused environment is invalid.
And the preset resource configuration cache is synchronously configured or updated according to the fusion environment so that the resource configuration cache and the fusion environment have the same resource key value pair.
In this step, the fusing the cluster sharing environment and the loose private environment may be to fuse resource key-value pairs in the two environments to obtain a fused environment, where in the fused environment, the cluster sharing environment and the loose private environment have a common resource sharing key-value pair, and the loose private environment has a unique resource private key-value pair, and may be adapted to corresponding software/hardware configuration. And switching to the resource configuration cache under the condition that the cluster sharing environment fails, wherein the resource configuration cache and the fusion environment synchronously configure or update the resource key value pair, so that the resource key value pair of the resource configuration cache and the fusion environment is the same, and the configuration of target software/hardware cannot be influenced by different key value pairs. When the converged environment is recovered, the resource configuration can be managed back to the converged environment.
The preset resource configuration cache can cache configuration information corresponding to target software/hardware, when a user performs configuration change on resource key value pairs through the fusion environment, the fusion environment can synchronize the change information of the corresponding resource key value pairs to the resource configuration cache and change the corresponding resource key value pairs in the resource configuration cache, so that the target software/hardware is configured or updated.
Referring to fig. 3 specifically, fig. 3 is a flowchart of a configuration environment fusion method according to an embodiment of the present invention, and as shown in fig. 3, the configuration environment fusion method includes:
s301, reading all resource sharing key value pairs of the cluster sharing environment, and adding the resource sharing key value pairs to the first set.
S302, reading all resource private key value pairs of the current resource node, adding the resource private key value pairs to the second set, and judging whether the second set is empty or not.
The current resource node is a resource node in a loose private environment, and the resource node comprises a resource private key-value pair. A resource node may include multiple resource private key-value pairs to enable configuration support for software/hardware. And when the second set is empty, the current resource node is not provided with a corresponding specific resource private key value pair. And when the second set is not empty, the current resource node is indicated to have a corresponding specific resource private key-value pair. If the second set is not empty, the process proceeds to step S303, and if the second set is empty, the process proceeds to step S306.
S303, whether the first set and the second set have the resource sharing key value pair and the resource private key value pair with the same key name or not.
If the first set and the second set have the resource sharing key value pair with the same key name and the resource private key value pair, it indicates that the resource private key value pair can be used for supporting the same software/hardware configuration, and can be configured into a cluster sharing environment as the resource sharing key value pair, and the step 304 is carried out; if the resource sharing key-value pair and the resource private key-value pair with the same key name do not exist in the first set and the second set, it indicates that the resource private key-value pairs in the current node are both specific key-value pairs, and the step S305 may be performed.
S304, whether the resource sharing key value pair with the same key name is the same as the corresponding value of the resource private key value pair or not is judged.
And when the values in the resource key value pairs with the same key name are the same, the values are the same resource key value pair, and the values of the key value pair are not changed and do not need to be updated, so that the next one is judged. If the resource sharing key value pair with the same key name is different from the corresponding value of the resource private key value pair, it means that the value of the resource key value pair is changed, and synchronous update is required, and step 305 is performed.
S305, updating the corresponding resource private key-value pairs with the same key name in the second set to the first set to serve as resource sharing key-value pairs.
In this step, the updating of the resource key-value pairs of the same key name may be that the resource key-value pairs of different values of the same key name are updated from the second set to the first set, such as: and if y is not equal to z, the Value of the Key resource Key Value pair in the first set is different from the Value in the second set, and the Value (z) in the first set is updated to Value (y) as the resource sharing Key Value pair. After the current node is traversed, the process proceeds to step S306.
S306, traversing all the second sets corresponding to all the resource nodes to obtain the finally updated first set.
S307, based on the finally updated first set, configuring or updating the resource sharing key value pair of the cluster sharing environment.
The above-mentioned environment fusion method is to fuse the cluster sharing environment according to the loose private environment, and certainly, the loose private environment may also be fused according to the cluster sharing environment. Specifically, the selection may be performed according to the environment where the user operates the configuration information, for example, after the fusion environment is failed, the user performs configuration management on the target software/hardware through the resource configuration cache, and when the fusion environment is recovered, the loose private environment is fused to the cluster sharing environment after the fusion environment is synchronously updated according to the resource configuration cache, so as to obtain a new fusion environment. And when the fusion environment is in a running state, the resource key value pairs in the resource configuration cache are synchronously updated.
The embodiment of the invention can switch the fusion environment and the resource configuration cache to carry out configuration management on the target software/hardware by simultaneously configuring the resource key value pairs in the loose private environment and the cluster sharing environment and fusing the loose private environment and the cluster sharing environment, thereby realizing flexible management on the configuration information.
It should be noted that the resource configuration management method provided in the embodiment of the present invention may be applied to devices that need to manage resource configuration, such as a mobile phone, a monitor, a computer, and a server.
Optionally, referring to fig. 4, fig. 4 is a flowchart of a method for configuring or updating a resource configuration cache according to an embodiment of the present invention, where the method is used to synchronously update a resource configuration in the resource configuration cache according to a change of a resource configuration of a configuration center, as shown in fig. 4, the method includes:
s401, reading the first resource key value pair of the fusion environment, and adding the first resource key value pair to the third set.
The first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair.
S402, obtaining a second resource key value pair in the resource configuration cache, and adding the second resource key value pair to a fourth set.
The second resource key-value pair in the resource configuration cache may be obtained through remote communication.
And S403, maintaining an empty fifth set.
S404, judging whether the third set is empty or not.
When the third set is empty, it indicates that the cluster shared environment and the loose private environment of the configuration center are not fused or have no corresponding configuration item, and the step S409 is performed; if the third set is not empty, it indicates that the configuration center has the corresponding configuration item and configuration information, then step S405 is performed.
S405, whether the first resource key-value pair and the second resource key-value pair with the same key name exist in the third set and the fourth set.
If the third set and the fourth set have the first resource key value pair and the second resource key value pair with the same key name, the first resource key value pair is used for supporting the same software/hardware configuration, and the step S406 is carried out; if the resource key value pair with the same key name does not exist in the third set and the fourth set, it indicates that a new software/hardware configuration may be generated, and the step S407 may be performed.
S406, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same.
When the corresponding values of the first resource key-value pair and the second resource key-value pair of the same key name are the same, it is indicated that the corresponding values of the first resource key-value pair and the second resource key-value pair are the same, and the value of the resource key-value pair is not changed in the fusion environment, and the next resource key-value pair of the same key name is judged without updating in the resource configuration cache. If the corresponding values in the first resource key value pair and the second resource key value pair with the same key name are different, it indicates that the value of the resource key value pair is changed, and needs to be updated synchronously, and the process goes to step S407.
And S407, adding the corresponding first resource key value pair with the same key name in the third set to the fifth set.
The third set is a resource key value pair set of the configuration center, and the fifth set is a set for configuring or updating the resource configuration cache. The adding operation described above includes: and adding a resource Key-Value pair in the third set to Key (y) - > Value (y) and a resource Key-Value pair with the same Key name in the fourth set to Key (y) - > Value (z), wherein y is not equal to z, which means that the Value of the resource Key-Value pair with the same Key name in the third set is different from that in the fourth set, and adding Key (y) - > Value (y) in the third set to the fifth set. After the current node is traversed, the process proceeds to step S408.
S408, traversing all the first resource key-value pairs in the third set to obtain a final fifth set.
And S409, configuring or updating the resource key value pairs cached by the resource configuration based on the final fifth set.
Through the steps, the resource key-value pairs in the resource configuration cache are synchronized to the resource key-value pairs corresponding to the configuration center. The resource key-value pairs in the resource configuration cache are applied to the specific target software/hardware. In this way, the configuration information operated by the user in the configuration center can be synchronized to the target software/hardware through the resource configuration cache so as to configure or update the target software/hardware.
Referring to fig. 5, fig. 5 is a flowchart of a method for managing a resource allocation cache according to an embodiment of the present invention, as shown in fig. 5, including:
s501, receiving resource key value pair change information of a configuration center, and synchronously configuring or updating resource key value pairs cached by resource configuration.
The change information includes configuration or update of resource key value pairs of the configuration center.
S502, based on the configured or updated resource configuration cache, notifying a configuration/update module to configure or update the target software/hardware.
The configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; and the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation.
It should be noted that, the fusion of the loose private environment and the cluster sharing environment may refer to the embodiment corresponding to fig. 3, and the resource key value pair for synchronizing configuration or updating the resource configuration cache may refer to the embodiment corresponding to fig. 4. And will not be further described herein.
Optionally, the notifying, based on the updated resource configuration cache, the configuration/update module to configure or update the target software/hardware may be: when monitoring the resource key value pair change in the resource configuration cache, notifying a configuration/update module to configure or update the target software/hardware according to the changed resource key value, wherein the change comprises the configuration or update corresponding to the resource key value in the resource configuration cache.
The embodiment of the invention can switch the fusion environment and the resource configuration cache to perform configuration management on the target software/hardware by simultaneously configuring the resource key value pairs in the loose private environment and the cluster sharing environment and fusing the loose private environment and the cluster sharing environment, thereby realizing flexible management on the configuration information, switching to the resource configuration cache when the fusion environment is invalid, avoiding that the target software/hardware system cannot respond due to error propagation, and improving the management efficiency of the configuration information.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a management apparatus for resource allocation according to an embodiment of the present invention, and as shown in fig. 6, the apparatus includes:
a first configuration module 601, configured to configure a resource node including a resource key-value pair to a loose private environment, and establish a first index relationship to index to a corresponding resource node, where a second index relationship is configured in the resource node to index to the corresponding resource key-value pair; and
a second configuration module 602, configured to configure the resource key-value pairs to a cluster sharing environment, and establish a third indexing relationship to index to the corresponding resource key-value pairs;
the merging module 603 is configured to merge the cluster sharing environment with the loose private environment to obtain a merged environment, and switch to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the merged environment is invalid, where the preset resource configuration cache performs synchronous configuration or update according to the merged environment.
Optionally, as shown in fig. 7, the fusion module 603 includes:
a first reading unit 60301, configured to read all resource sharing key-value pairs of the cluster sharing environment and add the read resource sharing key-value pairs to the first set;
a second reading unit 60302, configured to read all resource private key-value pairs of a current resource node, add the read resource private key-value pairs to a second set, and determine whether the second set is empty;
a first determining unit 60303, configured to determine whether the first set and the second set have resource sharing key-value pairs and resource private key-value pairs with the same key name if the second set is not empty;
a second determining unit 60304, configured to determine, if the resource sharing key-value pair and the resource private key-value pair having the same key name exist in the first set and the second set, whether values corresponding to the resource sharing key-value pair and the resource private key-value pair having the same key name are the same;
a first updating unit 60305, configured to update the resource private key-value pair with the same key name in the second set to the first set as the resource shared key-value pair if the resource shared key-value pair with the same key name is different from the corresponding value in the resource private key-value pair;
a first computing unit 60306, configured to traverse all the second sets corresponding to all the resource nodes to obtain a final updated first set;
a second updating unit 60307, configured to configure or update the resource sharing key-value pair of the cluster sharing environment based on the final updated first set.
Optionally, the fusion module 603 is further configured to perform synchronous configuration or update on the local resource key-value pair in the preset resource configuration cache according to the resource sharing key-value pair and the resource private key-value pair of the fusion environment, so that the resource configuration cache configures or updates the target software/hardware according to the result of the synchronous configuration or update.
Optionally, as shown in fig. 8, the fusion module 603 includes:
a third reading unit 60308, configured to read a first resource key-value pair of the fusion environment, and add the first resource key-value pair to a third set, where the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
a fourth reading unit 60309, configured to obtain a second resource key-value pair in the resource configuration cache, and add the second resource key-value pair to a fourth set;
a maintenance unit 60310 for maintaining an empty fifth set;
a third determining unit 60311 configured to determine whether the third set is empty;
a fourth determining unit 60312, configured to determine whether the first resource key-value pair and the second resource key-value pair having the same key name exist in the third set and the fourth set if the third set is not empty;
a fifth determining unit 60313, configured to determine, if the first resource key-value pair and the second resource key-value pair having the same key name exist in the third set and the fourth set, whether corresponding values in the first resource key-value pair and the second resource key-value pair having the same key name are the same;
an adding unit 60314, configured to add the corresponding first resource key-value pair with the same key name in the third set to the fifth set if the corresponding values of the first resource key-value pair with the same key name and the second resource key-value pair are different;
a second calculating unit 60315, configured to traverse all the first resource key-value pairs in the third set to obtain a final fifth set;
a third updating unit 60316, configured to configure or update the resource key value pair of the preset resource configuration cache based on the final fifth set.
It should be noted that the management apparatus for resource allocation provided in the embodiment of the present invention may be applied to devices that need to manage resource allocation, such as a mobile phone, a monitor, a computer, and a server.
The management device for resource allocation provided by the embodiment of the invention can realize each process realized by the management method for resource allocation in the method embodiment, and can achieve the same beneficial effects. To avoid repetition, further description is omitted here.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a management apparatus for resource allocation cache according to an embodiment of the present invention, and as shown in fig. 9, the apparatus includes:
a first configuring or updating module 901, configured to receive resource key-value pair change information of a configuration center, and configure or update resource key-value pairs cached in resource configuration synchronously, where the change information includes configuration or update of resource key-value pairs of the configuration center;
a second configuration or update module 902, configured to, based on the configured or updated resource configuration cache, notify the configuration update module to configure or update the target software/hardware;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; and the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation.
Optionally, as shown in fig. 10, the first configuring or updating module 901 includes:
an obtaining unit 9011, configured to obtain a first resource key-value pair of the fusion environment, and add the first resource key-value pair to a third set, where the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
a reading unit 9012, configured to read a second resource key-value pair in the resource configuration cache, and add the second resource key-value pair to a fourth set;
a maintenance unit 9013, configured to maintain an empty fifth set;
a first determining unit 9014, configured to determine whether the third set is empty;
a second determining unit 9015, configured to determine whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set if the third set is not empty;
a third determining unit 9016, configured to determine whether values corresponding to the first resource key-value pair and the second resource key-value pair of the same key name are the same if the first resource key-value pair and the second resource key-value pair of the same key name exist in the third set and the fourth set;
an adding unit 9017, configured to add, if the values corresponding to the first resource key-value pair and the second resource key-value pair are different, the first resource key-value pair with the same key name in the third set to the fifth set;
a calculating unit 9018, configured to traverse all the first resource key-value pairs in the third set to obtain a final fifth set;
an updating unit 9019, configured to configure or update the resource key-value pair cached in the preset resource configuration based on the final fifth set.
Optionally, the second configuring or updating module 902 is further configured to notify the configuring/updating module to configure or update the target software/hardware according to the changed resource key value pair when monitoring that the resource key value pair in the resource configuration cache is changed, where the change includes configuration or update of the resource key value pair in the resource configuration cache.
It should be noted that the management apparatus for resource allocation cache provided in the embodiment of the present invention may be applied to devices that need to manage resource allocation, such as a mobile phone, a monitor, a computer, and a server.
The management device for the resource allocation cache provided by the embodiment of the invention can realize each process realized by the management method for the resource allocation cache in the embodiment of the method, and can achieve the same beneficial effect. To avoid repetition, further description is omitted here.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 11, including: a memory 1102, a processor 1101, and a computer program stored on the memory 1102 and executable on the processor 1101, wherein:
the computer program stored in the memory 1102 is a method for managing resource allocation, and the processor 1101 is configured to call the computer program stored in the memory 1102 and perform the following steps:
configuring resource nodes containing resource private key value pairs to a loose private environment, establishing a first index relationship to index to corresponding resource nodes, and configuring a second index relationship in the resource nodes to index to the corresponding resource private key value pairs; and
configuring the resource sharing key value pairs to a cluster sharing environment, and establishing a third indexing relation to index the corresponding resource sharing key value pairs;
and fusing the cluster sharing environment and the loose private environment to obtain a fused environment, switching to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fused environment is invalid, and performing synchronous configuration or updating on the preset resource configuration cache according to the fused environment.
Optionally, the fusing the cluster shared environment with the loose private environment performed by the processor 1101 includes:
reading all resource sharing key value pairs of the cluster sharing environment and adding the resource sharing key value pairs to the first set;
reading all resource private key value pairs of the current resource node, adding the resource private key value pairs to a second set, and judging whether the second set is empty or not;
if the second set is not empty, judging whether the first set and the second set have resource sharing key value pairs and resource private key value pairs with the same key name;
if the first set and the second set have the resource sharing key value pair and the resource private key value pair with the same key name, judging whether the values corresponding to the resource sharing key value pair and the resource private key value pair with the same key name are the same;
if the resource sharing key value pair with the same key name is different from the corresponding value of the resource private key value pair, updating the resource private key value pair with the same key name in the second set to the first set as the resource sharing key value pair;
traversing all second sets corresponding to all resource nodes to obtain a finally updated first set;
configuring or updating resource sharing key-value pairs of the cluster sharing environment based on the final updated first set.
Optionally, the configuration management of the target software/hardware performed by the processor 1101 through a preset resource configuration cache includes:
and synchronously configuring or updating the local resource key value pair in the preset resource configuration cache according to the resource sharing key value pair and the resource private key value pair of the fusion environment, so that the resource configuration cache configures or updates the target software/hardware according to the synchronous configuration or updating result.
Optionally, the performing, by the processor 1101, the synchronous configuration or update of the resource key-value pair in the preset resource configuration cache according to the resource sharing key-value pair and the resource private key-value pair of the fusion environment includes:
reading a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
acquiring a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
determining whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set;
if the first resource key value pair and the second resource key value pair with the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same;
if the corresponding values of the first resource key value pair and the second resource key value pair of the same key name are different, adding the corresponding first resource key value pair of the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key value pairs cached by the preset resource configuration based on the final fifth set.
The electronic device may be a device that is applicable to a mobile phone, a monitor, a computer, a server, and the like that need to manage resource allocation.
The electronic device provided by the embodiment of the present invention can implement each process implemented by the resource allocation management method in the method embodiments, and can achieve the same beneficial effects, and in order to avoid repetition, details are not repeated here.
Optionally, the computer program stored in the memory 1102 is a management method for resource configuration cache, and the processor 1101 is configured to call the computer program stored in the memory 1102, and execute the following steps:
receiving resource key value pair change information of a configuration center, and synchronously configuring or updating resource key value pairs cached by resource configuration, wherein the change information comprises configuration or updating of the resource key value pairs of the configuration center;
based on the configured or updated resource configuration cache, informing a configuration/update module to configure or update the target software/hardware;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; and the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation.
Optionally, the receiving, performed by the processor 1101, the resource key-value pair change information of the configuration center, and synchronously configuring or updating the resource key-value pair of the resource configuration cache includes:
acquiring a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
reading a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
determining whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set;
if the first resource key value pair and the second resource key value pair with the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same;
if the corresponding values of the first resource key value pair and the second resource key value pair are different, adding the corresponding first resource key value pair with the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key value pairs cached by the preset resource configuration based on the final fifth set.
Optionally, the cache configured based on the updated resource executed by the processor 1101 notifies the configuration/update module to configure or update the target software/hardware, including:
when monitoring that the resource key value pair in the resource configuration cache is changed, informing the configuration/update module to configure or update the target software/hardware according to the changed resource key value pair, wherein the change comprises the configuration or update of the resource key value pair in the resource configuration cache.
The electronic device may be a device that is applicable to a mobile phone, a monitor, a computer, a server, and the like that need to manage a resource configuration cache.
The electronic device provided by the embodiment of the present invention can implement each process implemented by the management method for resource configuration caching in the foregoing method embodiments, and can achieve the same beneficial effects, and for avoiding repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the resource configuration management method or the resource configuration cache management method provided in the embodiment of the present invention, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (8)

1. A method for managing resource allocation, comprising the steps of:
configuring resource nodes containing resource private key value pairs to a loose private environment, establishing a first index relationship to index to corresponding resource nodes, and configuring a second index relationship in the resource nodes to index to the corresponding resource private key value pairs; and
configuring the resource sharing key value pairs to a cluster sharing environment, and establishing a third indexing relation to index the corresponding resource sharing key value pairs;
fusing the cluster sharing environment with the loose private environment to obtain a fused environment, switching to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fused environment is invalid, and performing synchronous configuration or updating on the preset resource configuration cache according to the fused environment;
the fusing the cluster sharing environment with the loose private environment comprises: reading all resource sharing key value pairs of the cluster sharing environment and adding the resource sharing key value pairs to the first set;
reading all resource private key value pairs of the current resource node, adding the resource private key value pairs to a second set, and judging whether the second set is empty or not;
if the second set is not empty, judging whether the first set and the second set have resource sharing key value pairs and resource private key value pairs with the same key name;
if the first set and the second set have the resource sharing key value pair and the resource private key value pair with the same key name, judging whether the values corresponding to the resource sharing key value pair and the resource private key value pair with the same key name are the same;
if the resource sharing key value pair with the same key name is different from the corresponding value of the resource private key value pair, updating the resource private key value pair with the same key name in the second set to the first set as the resource sharing key value pair;
traversing all second sets corresponding to all resource nodes to obtain a finally updated first set;
configuring or updating resource sharing key-value pairs of the cluster sharing environment based on the final updated first set.
2. The method for managing resource allocation according to claim 1, wherein the switching to the preset resource allocation cache performs configuration management on the target software/hardware, and includes:
and synchronously configuring or updating the local resource key value pair in the preset resource configuration cache according to the resource sharing key value pair and the resource private key value pair of the fusion environment, so that the resource configuration cache configures or updates the target software/hardware according to the synchronous configuration or updating result.
3. The method for managing resource allocation according to claim 2, wherein the synchronously configuring or updating the resource key-value pairs in the preset resource allocation cache according to the resource sharing key-value pair and the resource private key-value pair of the converged environment comprises:
reading a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
acquiring a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
judging whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set or not;
if the first resource key value pair and the second resource key value pair with the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same;
if the corresponding values of the first resource key value pair and the second resource key value pair of the same key name are different, adding the corresponding first resource key value pair of the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key-value pair cached in the preset resource configuration based on the final fifth set.
4. A method for managing a resource configuration cache, the method comprising:
receiving resource key value pair change information of a configuration center, and synchronously configuring or updating resource key value pairs cached by resource configuration, wherein the change information comprises configuration or updating of the resource key value pairs of the configuration center;
based on the configured or updated resource configuration cache, informing a configuration/update module to configure or update the target software/hardware;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; the cluster sharing environment is configured with resource sharing key value pairs, and indexes corresponding resource sharing key value pairs through a third index relation;
the receiving resource key-value pair change information of the configuration center, and synchronously configuring or updating the resource key-value pair cached by the resource configuration comprises:
acquiring a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
reading a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
determining whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set;
if the first resource key value pair and the second resource key value pair with the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same;
if the corresponding values in the first resource key value pair and the second resource key value pair are different, adding the corresponding first resource key value pair with the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key-value pairs of the resource configuration cache based on the final fifth set.
5. The method as claimed in claim 4, wherein said notifying the configuration/update module to configure or update the target software/hardware based on the updated resource configuration cache comprises:
when monitoring the resource key value pair change in the resource configuration cache, notifying the configuration/update module to configure or update the target software/hardware according to the changed resource key value pair, wherein the change comprises the configuration or update of the resource key value pair in the resource configuration cache.
6. An apparatus for managing resource configuration, the apparatus comprising:
the first configuration module is used for configuring the resource nodes containing the resource private key value pairs to a loose private environment, establishing a first index relationship to index to the corresponding resource nodes, and configuring a second index relationship in the resource nodes to index to the corresponding resource private key value pairs; and
the second configuration module is used for configuring the resource sharing key value pairs to the cluster sharing environment and establishing a third index relationship to index the corresponding resource sharing key value pairs;
the fusion module is used for fusing the cluster sharing environment with the loose private environment to obtain a fusion environment, switching to a preset resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid, and performing synchronous configuration or updating on the preset resource configuration cache according to the fusion environment;
wherein the merging the cluster-shared environment with the loose private environment comprises: reading all resource sharing key value pairs of the cluster sharing environment, and adding the resource sharing key value pairs to a first set;
reading all resource private key value pairs of the current resource node, adding the resource private key value pairs to a second set, and judging whether the second set is empty or not;
if the second set is not empty, judging whether the first set and the second set have resource sharing key value pairs and resource private key value pairs with the same key name;
if the first set and the second set have the resource sharing key value pair and the resource private key value pair with the same key name, judging whether the values corresponding to the resource sharing key value pair and the resource private key value pair with the same key name are the same;
if the resource sharing key value pair with the same key name is different from the corresponding value of the resource private key value pair, updating the resource private key value pair with the same key name in the second set to the first set as the resource sharing key value pair;
traversing all second sets corresponding to all resource nodes to obtain a finally updated first set;
configuring or updating resource sharing key-value pairs of the cluster sharing environment based on the final updated first set.
7. An apparatus for managing a resource configuration cache, the apparatus comprising:
the first configuration or update module is used for receiving resource key value pair change information of the configuration center and synchronously configuring or updating resource key value pairs cached by resource configuration, wherein the change information comprises configuration or update of the resource key value pairs of the configuration center;
the second configuration or update module is used for notifying the configuration update module to configure or update the target software/hardware based on the configured or updated resource configuration cache;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; the cluster sharing environment is configured with resource sharing key value pairs, and indexes corresponding resource sharing key value pairs through a third index relation;
the receiving resource key-value pair change information of the configuration center, and synchronously configuring or updating the resource key-value pair cached by the resource configuration comprises:
acquiring a first resource key-value pair of the fusion environment, and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair;
reading a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set;
maintaining an empty fifth set;
determining whether the third set is empty;
if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set;
if the first resource key value pair and the second resource key value pair of the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair of the same key name are the same;
if the corresponding values of the first resource key value pair and the second resource key value pair are different, adding the corresponding first resource key value pair with the same key name in the third set to a fifth set;
traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
and configuring or updating the resource key-value pairs of the resource configuration cache based on the final fifth set.
8. A configuration management system, comprising: a configuration center and a resource configuration cache;
the configuration center comprises a fusion environment of a loose private environment and a cluster sharing environment, and is switched to the resource configuration cache to perform configuration management on target software/hardware under the condition that the fusion environment is invalid; the loose private environment is configured with resource nodes containing resource private key value pairs, indexes the corresponding resource nodes through a first index relation, and the resource nodes are configured with a second index relation to index the corresponding resource private key value pairs; the cluster sharing environment is configured with resource sharing key value pairs, and indexes the corresponding resource sharing key value pairs through a third index relation;
the resource configuration cache is used for acquiring a first resource key-value pair of the fusion environment and adding the first resource key-value pair to a third set, wherein the first resource key-value pair is a resource sharing key-value pair or a resource private key-value pair; reading a second resource key-value pair in the resource configuration cache, and adding the second resource key-value pair to a fourth set; maintaining an empty fifth set; determining whether the third set is empty; if the third set is not empty, judging whether a first resource key-value pair and a second resource key-value pair with the same key name exist in the third set and the fourth set or not; if the first resource key value pair and the second resource key value pair with the same key name exist in the third set and the fourth set, judging whether the corresponding values of the first resource key value pair and the second resource key value pair with the same key name are the same; if the corresponding values in the first resource key value pair and the second resource key value pair are different, adding the corresponding first resource key value pair with the same key name in the third set to a fifth set; traversing all the first resource key-value pairs in the third set to obtain a final fifth set;
configuring or updating the resource key-value pairs of the resource configuration cache based on the final fifth set; and notifying a configuration updating module to configure or update the target software/hardware based on the configured or updated resource configuration cache.
CN201911415072.1A 2019-12-31 2019-12-31 Resource allocation management method and device, resource allocation cache management method and device, and allocation management system Active CN111147312B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911415072.1A CN111147312B (en) 2019-12-31 2019-12-31 Resource allocation management method and device, resource allocation cache management method and device, and allocation management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911415072.1A CN111147312B (en) 2019-12-31 2019-12-31 Resource allocation management method and device, resource allocation cache management method and device, and allocation management system

Publications (2)

Publication Number Publication Date
CN111147312A CN111147312A (en) 2020-05-12
CN111147312B true CN111147312B (en) 2022-11-22

Family

ID=70522713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911415072.1A Active CN111147312B (en) 2019-12-31 2019-12-31 Resource allocation management method and device, resource allocation cache management method and device, and allocation management system

Country Status (1)

Country Link
CN (1) CN111147312B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181523B (en) * 2020-09-29 2024-03-12 四川封面传媒有限责任公司 Project configuration information change management method and device
CN114978665A (en) * 2022-05-17 2022-08-30 中原银行股份有限公司 Data verification method and data isolation system based on Redis distributed cache platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207841A (en) * 2013-03-06 2013-07-17 青岛海信传媒网络技术有限公司 Method and device for data reading and writing on basis of key-value buffer
CN106341402A (en) * 2016-08-30 2017-01-18 中国民生银行股份有限公司 Processing method based on multi-architecture distributed caching and processing device
CN108205569A (en) * 2016-12-19 2018-06-26 中国移动通信集团山西有限公司 For updating the method and apparatus of configuration management database

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10133617B2 (en) * 2016-07-01 2018-11-20 Hewlett Packard Enterprise Development Lp Failure notifications in multi-node clusters
CN108200111B (en) * 2016-12-08 2021-01-05 中国移动通信集团山西有限公司 Resource configuration information updating method and device and resource interface equipment
CN107480237B (en) * 2017-08-08 2021-02-05 中南大学 Data fusion method and system for heterogeneous desktop cloud platform
CN109522043B (en) * 2018-10-12 2021-11-16 咪咕文化科技有限公司 Method and device for managing configuration data and storage medium
CN110471679B (en) * 2019-07-08 2024-04-02 中国平安人寿保险股份有限公司 Client resource allocation updating method and device, storage medium and server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103207841A (en) * 2013-03-06 2013-07-17 青岛海信传媒网络技术有限公司 Method and device for data reading and writing on basis of key-value buffer
CN106341402A (en) * 2016-08-30 2017-01-18 中国民生银行股份有限公司 Processing method based on multi-architecture distributed caching and processing device
CN108205569A (en) * 2016-12-19 2018-06-26 中国移动通信集团山西有限公司 For updating the method and apparatus of configuration management database

Also Published As

Publication number Publication date
CN111147312A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
US10347542B2 (en) Client-initiated leader election in distributed client-server systems
EP2923272B1 (en) Distributed caching cluster management
JP5625998B2 (en) Information processing system
CN112087312A (en) Method, device and equipment for providing edge service
CN113778623B (en) Resource processing method and device, electronic equipment and storage medium
CN112083889A (en) Data migration method, device, equipment and readable storage medium
CN111147312B (en) Resource allocation management method and device, resource allocation cache management method and device, and allocation management system
CN107172214B (en) Service node discovery method and device with load balancing function
CN111641521B (en) Method for deploying big data clusters on cloud based on Ambari
CN110932876B (en) Communication system, method and device
KR20220002136A (en) Database-based management method, platform, electronic equipment and storage medium
CN105069152A (en) Data processing method and apparatus
CN111246397A (en) Cluster system, service access method, device and server
WO2022007908A1 (en) Method for service collaboration between network element devices, and network element device
CN107302849B (en) Light path distribution method and device
CN113079098B (en) Method, device, equipment and computer readable medium for updating route
CN112087506B (en) Cluster node management method and device and computer storage medium
CN116346834A (en) Session synchronization method, device, computing equipment and computer storage medium
CN116193481A (en) 5G core network processing method, device, equipment and medium
CN106462421B (en) Telecommunication device and method for updating software in a telecommunication device
CN113904973A (en) Route updating method, medium, device and computing equipment
CN110198269B (en) Route synchronization system, method and related device for distributed cluster
CN112311904A (en) Method, device, storage medium and domain name management system for updating domain name record
CN115470303B (en) Database access method, device, system, equipment and readable storage medium
CN109510867A (en) Method, apparatus, storage medium and the electronic equipment of data request processing

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
CB02 Change of applicant information

Address after: 518000 1st floor, building 17, Shenzhen Dayun software Town, 8288 Longgang Avenue, Yuanshan street, Longgang District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Yuntian lifeI Technology Co.,Ltd.

Address before: 518000 1st floor, building 17, Shenzhen Dayun software Town, 8288 Longgang Avenue, Yuanshan street, Longgang District, Shenzhen City, Guangdong Province

Applicant before: SHENZHEN INTELLIFUSION TECHNOLOGIES Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant