Directional downlink transmission method, apparatus and device, and storage medium
By setting up global, application-level, and specific identifier-level configuration directories in the Dubbo distributed service framework's registry center, the problems of difficult management and control of customized functions and large data volume in distributed business systems are solved, enabling flexible configuration push and efficient management and control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-03-16
- Publication Date
- 2026-06-16
AI Technical Summary
In existing technologies, the customized functions of distributed business systems suffer from drawbacks in terms of management and control strategies, including difficulties in promoting the functions, insufficient flexibility in management and control, uncontrollable risk impact, and large amounts of data being pushed.
By setting up configuration directories at three levels—global, application, and specific identifier—in the registry center of the Dubbo distributed service framework, the configuration directory is determined based on the configuration call request, and the configuration is directed to the corresponding configuration object, thus achieving flexible management and control over different dimensions.
It enables flexible management and control of distributed systems, effectively controls the scope of configuration push and the amount of data pushed, improves management and control efficiency, and reduces management and control costs.
Smart Images

Figure CN116319321B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and in particular to a method, apparatus, device and storage medium for targeted configuration distribution. Background Technology
[0002] With the widespread adoption of distributed architectures, service layers are becoming increasingly numerous and service chains are becoming longer, making service governance and operation and maintenance management more challenging. To improve the overall high availability, disaster recovery switching, and canary deployment capabilities of business systems, it is often necessary to customize auxiliary functions at the service framework (or technical support platform) level, such as prioritizing calls within the same campus and routing error correction.
[0003] However, most of these features focus on optimizing and adjusting the underlying framework or common processing logic. The program logic is distributed across the servers of various business systems along with the framework's client components. In a distributed architecture, these non-functional features are often reflected in the interaction control layer between nodes. Therefore, the specific function that is enabled in which part of which business system is closely related to the business system's processing flow, making management and control very complex.
[0004] Existing technologies for controlling such functions often involve setting global switches, application-level switches, or globally visible application-level switches, as well as rolling out the function in batches across various business systems, or attaching controllable switches to the service registration information. However, such control strategies have many drawbacks, including difficulties in promoting the function, insufficient flexibility in control, uncontrollable risk impact, and large amounts of data pushed. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for configuring targeted data delivery, which overcomes the shortcomings of existing distributed business systems where customized functions developed from the service framework level have difficulties in promoting functionality, lack of flexible management, uncontrollable risk impact, and large data volume in terms of control strategies.
[0006] Firstly, this application provides a method for targeted configuration distribution, applied to the Dubbo distributed service system, the method comprising:
[0007] Get the configuration call request;
[0008] In response to the configuration call request, determine the configuration directory and call the configuration under the configuration directory. The configuration directory includes a global-level directory, an application-level directory, and a specific identifier directory.
[0009] The configuration is distributed to the configuration object corresponding to the configuration directory, so that the configuration object applies the configuration to implement the corresponding customized function.
[0010] In one possible design, if the configuration directory is the global-level directory, calling the configuration under the configuration directory includes:
[0011] Invoke all global configurations of all service nodes. The configurations under the global-level directory include all global configurations, and the configuration objects corresponding to the global-level directory include all service nodes.
[0012] In one possible design, prior to invoking all global configurations for all service nodes, the following is also included:
[0013] Subscribe to all global configurations for all service nodes.
[0014] In one possible design, if the configuration target is the application-level directory, calling the configuration under the configuration directory includes:
[0015] The target configuration of the current application or cluster is invoked. The configuration under the application-level directory includes the target configuration of the current application or cluster. The configuration object corresponding to the application-level directory includes the service nodes that subscribe to the current application or cluster.
[0016] In one possible design, before invoking the configuration of the current application or cluster, the following is also included:
[0017] The current application or cluster is identified based on the service subscription information, and the configuration of the current application or cluster is subscribed to according to the subscription scope.
[0018] In one possible design, the subscription scope includes: the configuration to which the current application or cluster belongs, and the configuration of the application or cluster to which the current application or cluster belongs.
[0019] In one possible design, if the configuration directory is the specific identifier directory, the step of calling the configuration under the configuration directory includes:
[0020] The specific configuration of the grayscale node is invoked. The configuration under the specific identifier directory includes the specific configuration of the grayscale node, and the configuration object corresponding to the specific identifier directory includes the grayscale node.
[0021] In one possible design, prior to invoking the configuration of the grayscale node, the following is also included:
[0022] The grayscale node is determined based on the node identifier set in the environment variables, and the specific configuration of the grayscale node is subscribed to.
[0023] Secondly, this application provides a configuration for a targeted data delivery device, comprising:
[0024] The acquisition module is used to obtain configuration call requests;
[0025] The calling module is used to respond to the configuration call request, determine the configuration directory, and call the configuration under the configuration directory. The configuration directory includes a global-level directory, an application-level directory, and a specific identifier directory.
[0026] The distribution module is used to distribute the configuration to the configuration object corresponding to the configuration directory, so that the configuration object can apply the configuration to implement the corresponding customized function.
[0027] In one possible design, if the configuration directory is the global-level directory, the calling module is specifically used for:
[0028] Invoke all global configurations of all service nodes. The configurations under the global-level directory include all global configurations, and the configuration objects corresponding to the global-level directory include all service nodes.
[0029] In one possible design, the configuration-targeted delivery device further includes: a subscription module; the subscription module is used for:
[0030] Subscribe to all global configurations for all service nodes.
[0031] In one possible design, if the configuration target is the application-level directory, the calling module is specifically used for:
[0032] The target configuration of the current application or cluster is invoked. The configuration under the application-level directory includes the target configuration of the current application or cluster. The configuration object corresponding to the application-level directory includes the service nodes that subscribe to the current application or cluster.
[0033] In one possible design, the subscription module is further used for:
[0034] The current application or cluster is identified based on the service subscription information, and the configuration of the current application or cluster is subscribed to according to the subscription scope.
[0035] In one possible design, the subscription scope includes: the configuration to which the current application or cluster belongs, and the configuration of the application or cluster to which the current application or cluster belongs.
[0036] In one possible design, if the configuration directory is the specific identifier directory, the calling module is specifically used for:
[0037] The specific configuration of the grayscale node is invoked. The configuration under the specific identifier directory includes the specific configuration of the grayscale node, and the configuration object corresponding to the specific identifier directory includes the grayscale node.
[0038] In one possible design, the subscription module is further used for:
[0039] The grayscale node is determined based on the node identifier set in the environment variables, and the specific configuration of the grayscale node is subscribed to.
[0040] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0041] The memory stores computer-executed instructions;
[0042] The processor executes computer execution instructions stored in the memory to implement any of the possible configuration-directed delivery methods provided in the first aspect.
[0043] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the possible configuration-directed delivery methods provided in the first aspect.
[0044] Fifthly, this application provides a computer program product including computer execution instructions, which, when executed by a processor, are used to implement any of the possible configuration-directed delivery methods provided in the first aspect.
[0045] This application provides a method, apparatus, device, and storage medium for targeted configuration distribution, applied to the Dubbo distributed service system. First, a configuration call request is obtained. Then, in response to the request, the configuration directory is determined. Next, the configurations within the specified directories are invoked. These directories include global-level directories, application-level directories, and directories with specific identifiers. Finally, the configurations are distributed to the corresponding configuration objects within these directories, enabling them to implement customized functionalities. By determining the configuration directory and then invoking the configurations within it, the configurations are distributed to the corresponding configuration objects, achieving targeted push of configurations to configuration objects in different directories. Based on three different dimensions of configuration directories—global-level, application-level, and directory with specific identifiers—targeted distribution of configurations from different directories to their corresponding configuration objects is achieved. This allows for flexible management and control of nodes in the distributed system, effectively controlling the scope and volume of configuration pushes, improving management efficiency, and reducing management costs. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0048] Figure 2 A flowchart illustrating a method for configuring targeted distribution, provided in an embodiment of this application;
[0049] Figure 3 A flowchart illustrating another configuration-oriented distribution method provided in an embodiment of this application;
[0050] Figure 4 A flowchart illustrating another configuration-oriented distribution method provided in an embodiment of this application;
[0051] Figure 5 A flowchart illustrating yet another configuration-oriented distribution method provided in this application embodiment;
[0052] Figure 6 This application provides a schematic diagram of the structure of a directional data delivery device.
[0053] Figure 7 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0054] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of methods and apparatus consistent with some aspects of this application as detailed in the appended claims.
[0055] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0056] It should be noted that the configuration targeting method, apparatus, device, and storage medium disclosed in this application can be used in the financial field. They can also be used in any field other than finance. The application fields of the configuration targeting method, apparatus, device, and storage medium disclosed in this application are not limited.
[0057] To enhance the overall high availability, disaster recovery switching, and canary deployment capabilities of business systems, it's often necessary to customize auxiliary functions at the service framework level, such as prioritizing calls within the same campus and routing error correction. These functions mostly focus on optimizing and adjusting the framework's underlying or common processing logic, with the program logic distributed across the server-side of various business systems along with the framework's client components. However, in a distributed architecture, these non-functional characteristics are often manifested at the interaction control level between nodes. Therefore, the specific function's activation within a particular business system and its corresponding part is closely related to the business system's processing flow, resulting in high complexity in management and control.
[0058] Existing technologies for controlling such functions often involve setting global switches, application-level switches, or globally visible application-level switches, as well as deploying functions in batches across different business systems, or attaching controllable switches to service registration information. However, such control strategies have many drawbacks.For example, the first type is setting a global switch, where the framework sets a master switch in the configuration center. If a problem occurs in a single local call relationship within any business system, the master switch can be turned off with one click, making that function unavailable in all systems. However, this global switch can only be turned on or off for the entire function; if a problem occurs in any part of a business system, the entire function will become unavailable, significantly impacting the overall functionality and hindering its rollout. The second type is an application-level switch, where each application sets its own switch. Specifically, the framework provides an interface for each application to set a global switch for the function within its application scope through static or dynamic configuration. Once the switch is turned off, the entire function within that application becomes unavailable. This type of application-level switch... The first approach, enabling or disabling a feature across the entire system, lacks fine-grained settings for individual applications interacting with it. Furthermore, for applications with complex interactions, a problem with any interacting party can lead to the complete shutdown of the feature, resulting in a wide-ranging impact and insufficient flexibility in control. The third approach, globally visible application-level switches, involves the framework setting a globally visible list of switches in the configuration center. Each service provider application or service provider group has its own switch, and all consumers subscribe to this list. Any provider's switch being turned off can be detected immediately. However, this strategy pushes the feature switch to the current consumer regardless of whether the current consumer has subscribed to any provider's service. This can lead to… On the one hand, it generates a large number of unnecessary push notifications. On the other hand, if the operation is incorrect when switching the switch, such as an incorrect configuration format, all consumers will be pushed with the incorrect configuration, causing the risk to spread globally. This poses problems of uncontrollable risk impact and large push data volume. The fourth approach is to deploy the feature in batches for each business system. Specifically, through engineering organization, some business systems first use the latest version of the framework's client component, enable the feature, and verify it before it is promoted to other systems. This approach makes the feature promotion plan too long and makes it difficult to avoid some systems having normal functionality when they are first launched, but encountering anomalies during subsequent modification and maintenance, thus requiring other means to disable the feature. The fifth approach is to attach the controllable switch of the feature to the service registration information. Specifically, the framework The service registration and subscription mechanism based on the Dubbo framework allows each service consumer to see the function switch settings for that service in the service's registration information when calling it. If the service provider detects an abnormality and disables a function, it will turn off the switch in the service registration information. All service registration information is pushed to each service consumer, and the service consumer then checks whether the function is disabled when calling each service. While this achieves fine-grained switch control, each adjustment requires configuration at the service level, which is prone to oversights or errors. Furthermore, updating and pushing the registration information of each service to all consumers results in a large amount of data interaction and also impacts the performance of the registry center.It is evident that the non-specific customized functions developed from the service framework level in existing distributed business systems have drawbacks such as difficulty in promoting the functions, insufficient flexibility in management, uncontrollable risk impact, and large amounts of data to be pushed.
[0059] To address the aforementioned problems in the existing technology, this application provides a configuration-oriented distribution method, apparatus, device, and storage medium. The motivation for this configuration-oriented distribution method is as follows: Since the Dubbo distributed service framework implements service self-discovery based on a registry center and stores service registration information, subscription information, and service call-related configurations in the registry center, three configuration directories with different dimensions are added to the registry center: a global-level directory, an application-level directory, and a specific identifier directory. The configurations under these directories are maintained in the registry center at the interface granularity. When a configuration call request is received, the configuration directory is first determined based on the request, then the configurations under that directory are called, and finally, the configurations under that directory are distributed to the corresponding configuration objects, enabling the configuration objects to implement corresponding customized functions. Based on the three different dimensions of configuration directories—global-level, application-level, and specific identifier directories—the distribution of configurations from different dimension configuration directories to the corresponding configuration objects is achieved. This allows for flexible management and control of nodes in the distributed system, effectively controlling the scope and amount of configuration push, improving management efficiency, and reducing management costs.
[0060] The following describes exemplary application scenarios of the embodiments of this application.
[0061] Figure 1 This is a schematic diagram of an application scenario provided in an embodiment of this application, such as... Figure 1As shown, the electronic device 100 runs the Dubbo distributed service framework, constituting a Dubbo distributed service system. The Dubbo distributed service framework is an open-source distributed service framework that uses a registry to store service registration information and manage the entire service lifecycle. The Dubbo distributed service framework uses a registry center 200 to achieve service self-discovery and stores service registration information, subscription information, and service call-related configurations in the registry center 200. The registry center 200 has three different configuration directories: a global directory, an application-level directory, and a specific identifier directory. The electronic device 100 is configured to execute the configuration-directed distribution method provided in this embodiment. After receiving a configuration call request, the electronic device 100 determines the corresponding configuration directory based on the request, then calls the configurations under that directory. Different configuration directories correspond to different configurations, and the configurations are then distributed to the configuration object 300 corresponding to the determined configuration directory. Different configuration directories correspond to different configuration objects 300. By setting configuration directories, configurations under different configuration directories can be distributed to the configuration object 300 corresponding to the specified directory, achieving targeted distribution of configurations to configuration objects 300.
[0062] Specifically, if the configuration directory is a global directory, the configuration object 300 corresponding to this configuration directory can be all service nodes that the Dubbo distributed service framework targets; if the configuration directory is an application-level directory, the configuration object 300 corresponding to this configuration directory is one or more service nodes in the Dubbo distributed service framework that have subscribed to the current application or cluster; if the configuration directory is a specific identifier directory, the configuration object 300 corresponding to this configuration directory is a grayscale node among the service nodes of the Dubbo distributed service framework. A grayscale node is a service node among all service nodes that has been specifically identified to have specific functions, such as a service node that performs grayscale deployment.
[0063] It's important to note that in business systems implemented using the Dubbo distributed service framework, each service node can act as a consumer of the business system. Therefore, for customized functions developed at the Dubbo distributed service framework level, such as priority access within the same campus or route correction, these functions, which require interaction and control between nodes in a distributed architecture, can be flexibly managed by setting configuration directories. This allows for highly complex control over the activation of specific functions at specific stages of the corresponding business system. For example, for a global-level directory, configurations can be distributed to all service nodes in the Dubbo distributed service framework, achieving global control. For an application-level directory, configurations can be distributed to one or more service nodes in the Dubbo distributed service framework that have subscribed to the current application or cluster. For instance, all consumers will subscribe to the services of the current application or cluster, thus achieving control over all consumers. For a specific identifier directory, configurations can be distributed to canary nodes within the service nodes of the Dubbo distributed service framework. Each canary node can be a consumer, enabling individual control over each consumer.
[0064] Electronic devices 100 include computers, servers, server clusters, etc. Figure 1 The electronic device 100 is illustrated using a computer as an example. The registration center 200 can be located in devices such as computers, servers, server clusters, smartphones, and smart wearable devices. Figure 1 The registration center 200 is illustrated using a computer as an example. The configuration object 300 deploys devices such as computers, servers, server clusters, smartphones, and smart wearable devices. Figure 1 The configuration object 300 is illustrated using a computer as an example.
[0065] It should be noted that the above application scenarios are merely illustrative, and the configuration-targeted distribution method and device provided in this application embodiment include, but are not limited to, the above application scenarios.
[0066] Figure 2 This is a flowchart illustrating a method for configuring targeted distribution, as provided in an embodiment of this application. Figure 2 As shown, the configuration targeted distribution method provided in this application embodiment includes:
[0067] S101: Get configuration call request.
[0068] A configuration object initiates a configuration call request, which is then received by the Dubbo distributed service system. The configuration object can be the server-side application of the Dubbo distributed service framework to implement a business system. Service nodes are deployed on the server-side. The configuration call request indicates that the server initiating the request wants to obtain the corresponding configuration from the configuration center, which is a system that provides dynamic or static configuration management.
[0069] It should be noted that the registry center can maintain the actions that occur in the configuration center, such as registering these actions. Specifically, configurations can be maintained at the interface level in the registry center. For example, in the Dubbo / interface name / configurator directory, dynamic configurations such as provider disabling, weighting, load balancing, and degradation can be maintained; in the Dubbo / interface name / consumer directory, subscription configurations for service consumers, such as IP address, service name, timestamp, and location, can be maintained; in the Dubbo / interface name / provider directory, registration configurations for service providers, such as IP address, port, service name, version number, timeout, and location, can be maintained; and in the Dubbo / interface name / routing directory, service routing configurations can be maintained.
[0070] S102: Respond to the configuration call request to determine the configuration directory and call the configuration under the configuration directory.
[0071] The configuration call request carries a directory identifier for the configuration directory. This identifier determines the specific content of the configuration directory, which can be a global-level directory, an application-level directory, or a directory with a specific identifier. Therefore, the received configuration call request can determine the specific content of the configuration directory, which could be a global-level directory (all directory), an application-level directory (app directory), or a directory with a specific identifier (tag directory).
[0072] After determining whether the configuration directory is a global directory, an application-level directory, or a directory with a specific identifier, the configuration within that directory is invoked. Specifically, the Dubbo distributed service framework subscribes to the configuration within that defined directory.
[0073] S103: Distribute the configuration to the corresponding configuration object in the configuration directory, so that the configuration object can apply the configuration to implement the corresponding customized function.
[0074] After retrieving the configuration from the designated configuration directory, the configuration is distributed to the corresponding configuration object within that directory, achieving targeted distribution of configuration to the appropriate configuration object. Furthermore, different configuration directories correspond to different configuration objects. For example, the configuration objects for a global-level directory include all service nodes, the configuration objects for an application-level directory include service nodes subscribed to the current application or cluster, and the configuration objects for a specific identifier directory include canary nodes, which are the specified service nodes.
[0075] The configuration can be the data required for implementing customized functions on the server side of a business system using the Dubbo distributed service framework. These customized functions, in a distributed architecture, are often reflected in the interaction control layer between service nodes on the server side, such as prioritizing calls within the same campus area and routing error correction. Therefore, after a configuration object is distributed, the corresponding customized function is implemented using the configuration. For example, configurations include static and dynamic configurations. Static configurations are configuration items created and modified through configuration files, environment variables, application startup parameters, etc. Modifications to these configuration items require an application restart to take effect. Dynamic configurations are configuration items created and modified through a configuration center, memory refresh tools, API calls, etc. These configuration items can be updated while the application is running.
[0076] The configuration-targeted delivery method provided in this application is applied to the Dubbo distributed service system. First, a configuration call request is obtained. Then, the configuration directory is determined in response to the request. Next, the configurations within the specified configuration directories are called. These directories include global-level directories, application-level directories, and specific identifier directories. Finally, the configurations are delivered to the corresponding configuration objects within these directories, enabling these objects to implement customized functionalities. By determining the configuration directory and then calling the configurations within it, the configurations are targeted to the corresponding configuration objects, achieving targeted push of configurations to configuration objects corresponding to different configuration directories. Based on three different dimensions of configuration directories—global-level, application-level, and specific identifier directories—targeted delivery of configurations from different configuration directories to different configuration objects corresponding to those directories is achieved. Different configuration directories subscribe to different configurations, and different configuration objects correspond to different directories. Therefore, configurations are targeted to the corresponding configuration objects through the configuration directories. Different configuration objects correspond to different service nodes in the distributed system, thus enabling flexible management of each service node in the distributed system. This allows for flexible control over which service nodes can receive which configurations, effectively controlling the scope and amount of configuration push, improving management efficiency, and reducing management costs.
[0077] Figure 3 This is a flowchart illustrating another configuration-oriented distribution method provided in an embodiment of this application. For example... Figure 3 As shown, the configuration targeted distribution method provided in this application embodiment includes:
[0078] S201: Get configuration call request.
[0079] The possible implementation methods, principles, and technical effects of step S201 are similar to those of step S101, and will not be repeated here.
[0080] S202: Responding to the configuration call request, it is determined that the configuration directory is a global directory.
[0081] The directory identifier carried in the configuration call request is identified. This directory identifier is used to represent whether the configuration directory is a global-level directory, an application-level directory, or a directory with a specific identifier. For example, in this embodiment, the directory identifier is determined to represent a global-level directory, that is, the configuration directory determined in response to the configuration call request is a global-level directory.
[0082] S203: Invoke all global configurations for all service nodes.
[0083] The configuration in the global-level directory includes all global configurations, which is the configuration of all service nodes in the business system implemented by the Dubbo distributed service framework. The service nodes subscribing to the global-level directory are all service nodes in the business system implemented by the Dubbo distributed service framework; therefore, the configuration object corresponding to the global-level directory is all service nodes in the business system implemented by the Dubbo distributed service framework.
[0084] Optionally, all global configurations are saved in key-value format, which can be uniformly distributed to all service nodes subscribed to the global directory.
[0085] Optionally, before step S203, the Dubbo distributed service framework may automatically subscribe to all global configurations of all service nodes from the configuration center, that is, automatically subscribe to the configurations under the global directory.
[0086] Understandably, when this configuration is updated, the Dubbo distributed service framework will also dynamically update to the new configuration, and the updated configuration in the global directory will be distributed to all service nodes.
[0087] Subscribing to all global configurations of all service nodes and dynamically updating to new configurations can occur when any service node starts up or when its configuration is updated.
[0088] S204: Distribute all global configurations to all service nodes, enabling all service nodes to implement corresponding customized functions through application configurations.
[0089] All global configurations are directed to all service nodes that subscribe to the global directory, enabling unified distribution of all global configurations to all service nodes. This allows for the global distribution of dynamic configurations to all service nodes, thereby achieving unified global control over all service nodes. In other words, it enables the global on / off control strategy through the global directory.
[0090] The configuration targeted distribution method provided in this application determines the configuration directory as a global directory through a configuration call request, and then calls all global configurations of all service nodes to uniformly distribute all global configurations to all service nodes, thereby realizing the global distribution of configurations to all service nodes and implementing a global switch control strategy through a global directory.
[0091] Figure 4 This is a flowchart illustrating another configuration-oriented distribution method provided in an embodiment of this application. Figure 4 As shown, the configuration targeted distribution method provided in this application embodiment includes:
[0092] S301: Get configuration call request.
[0093] The possible implementation methods, principles, and technical effects of step S301 are similar to those of step S101, and will not be repeated here.
[0094] S302: Responding to the configuration call request, determine that the configuration directory is an application-level directory.
[0095] The directory identifier carried in the configuration call request is identified. This directory identifier is used to represent whether the configuration directory is a global-level directory, an application-level directory, or a directory with a specific identifier. For example, in this embodiment, the directory identifier is determined to represent an application-level directory, that is, the configuration directory determined in response to the configuration call request is an application-level directory.
[0096] S303: Invokes the target configuration for the current application or cluster.
[0097] The configurations under the application-level configuration directory include the target configurations for the current application or cluster. These target configurations are the specific configurations involved in one or more specific applications or clusters. Subscribing to the service nodes in the application-level directory corresponds to the configuration objects within that directory; in other words, it's about subscribing to the service nodes of the current application or cluster.
[0098] Optionally, the target configuration for the current application or cluster is saved in key-value format, which has higher priority than the configuration in the global directory.
[0099] Optionally, before step S303, the process may further include: The Dubbo distributed service framework first identifies the current application or cluster based on service subscription information, for example, by scanning the current program configuration file (or program annotations) to obtain service subscription information. Based on the service subscription information, it determines the current application or cluster corresponding to the application-level directory, and then subscribes to the configuration of the current application or cluster according to the subscription scope. The subscription scope of the current application or cluster configuration may include the configuration to which the current application or cluster belongs, as well as the configuration of the application or cluster to which the current application or cluster belongs.
[0100] Understandably, when the configuration in the application-level directory is updated, the Dubbo distributed service framework will also dynamically update to the new configuration. The updated configuration in the application-level directory will also be distributed to the service nodes that subscribe to the application-level directory, that is, the service nodes that subscribe to the current application or cluster.
[0101] The subscription of configurations under the application-level directory and the dynamic updating of new configurations can occur when the service node subscribing to the current application or cluster starts up and when the configuration is updated.
[0102] In addition, when a service node subscribed to an application-level directory calls a new service, the next time the service node starts, it will automatically scan for the new application or cluster and add it to the service subscription information of the application-level directory. The Dubbo distributed service framework will then bind the configuration and service call relationships under the subscribed application-level directory.
[0103] S304: Distribute the target configuration of the current application or cluster to the service nodes that subscribe to the current application or cluster, so that the application configuration of the service nodes that subscribe to the current application or cluster can realize the corresponding customized functions.
[0104] Configurations in the application-level directory are directed to service nodes that subscribe to the directory. This means subscribing to service nodes of the current application or cluster, and pushing configurations at the application or group level. This significantly reduces the amount of data pushed compared to service-level configurations and allows for dynamic configuration distribution based on inter-application interactions. Application-level directories enable application- or cluster-level switching. For example, if a provider uses an application-level directory and all consumers subscribe to it, then a single provider can control all consumers.
[0105] The configuration targeted distribution method provided in this application determines the configuration directory as an application-level directory through a configuration call request, and then calls the target configuration of the current application or cluster to distribute the target configuration of the current application or cluster to the service nodes that subscribe to the current application or cluster. The configuration push is implemented at the application or group granularity. Not only can the amount of data pushed be significantly reduced compared to the service level, but the configuration can also be dynamically distributed based on the interaction relationship between applications. The application-level directory can be used to realize the application or cluster level switching.
[0106] Figure 5 This is a flowchart illustrating another configuration-oriented distribution method provided in an embodiment of this application. Figure 5 As shown, the configuration targeted distribution method provided in this application embodiment includes:
[0107] S401: Get configuration call request.
[0108] The possible implementation methods, principles, and technical effects of step S401 are similar to those of step S101, and will not be repeated here.
[0109] S402: Responding to a configuration call request determines that the configuration directory is a specific identifier directory.
[0110] The directory identifier carried in the configuration call request is identified. This directory identifier is used to represent whether the configuration directory is a global-level directory, an application-level directory, or a specific identifier directory. For example, in this embodiment, the directory identifier is determined to represent an application-level directory, that is, the configuration directory determined in response to the configuration call request is a specific identifier directory.
[0111] S403: Invokes the specific configuration of the grayscale node.
[0112] The configuration under a specific identifier directory includes the specific configuration of the canary nodes. The service nodes subscribing to the specific identifier directory are the configuration objects corresponding to that specific identifier directory, i.e., canary nodes. Specifically, a canary node is a specific service node identified by a convention within the business system. For example, it could be a service node for canary deployment or a pilot node. The specific configuration of a canary node is the specific configuration involved for that particular service node identified by the convention.
[0113] Optionally, the specific configuration of the grayscale node is saved in key-value format, which has higher priority than the configuration in the application-level directory.
[0114] Alternatively, specific identifier directories can use open-source products to create dynamic configurations at the application or group level, enabling control based on agreed-upon identifiers between service nodes.
[0115] Optionally, before step S403, the process may further include: the Dubbo distributed service framework determining the grayscale nodes based on the node identifiers set in the environment variables, and then subscribing to the specific configurations of the grayscale nodes. The node identifier is the identification information set in the environment variables by each service node participating in the agreement to identify the grayscale nodes.
[0116] Understandably, when the configuration under a specific identifier directory is updated, the Dubbo distributed service framework will also dynamically update to the new configuration, and the updated configuration under the specific identifier directory will also be distributed to the service nodes that subscribe to the specific identifier directory, i.e., canary nodes.
[0117] Specifically, subscribing to configurations under a specific identifier directory and dynamically updating to new configurations can occur when a grayscale node is started and when a configuration update occurs.
[0118] S404: Distribute specific configurations for grayscale nodes to the grayscale nodes, enabling the grayscale nodes to implement corresponding customized functions through the application configuration.
[0119] The specific configuration of the gray node is distributed to the gray node in a targeted manner. In other words, the corresponding configuration is distributed to the corresponding service node based on the agreement between each service node. This enables the distribution of configuration to the gray node based on the agreement. For example, each consumer can be designated as a gray node, and then each consumer can be individually managed through a specific identifier directory.
[0120] The configuration-directed distribution method provided in this application determines the configuration directory as a specific identifier directory through a configuration call request, and then calls the specific configuration of the gray node to distribute the specific configuration of the gray node to the gray node, thereby realizing the distribution of configuration to the gray node based on the agreement.
[0121] The following example, using the priority call function within the same park for customized functions, illustrates the usage of the configuration-directed delivery method provided in this application when applied to the initial launch of this customized function. This customized function is configured on the service provider's side but takes effect on the consumer's side, aiming to reduce cross-park calls.
[0122] Specifically, to control risks during the initial launch, this feature will only be enabled for service providers participating in the pilot program, and a selection of service consumers will be selected for pilot verification. Therefore, the customized feature can be configured to be off in the global directory, off for pilot service providers in the application directory, and on for service consumers participating in the pilot program in a specific identifier directory. These consumers can set the corresponding identifier in the environment variables of the grayscale node to obtain the on / off status of the specific identifier directory.
[0123] When the customized function of the pilot consumer malfunctions, the switch in the specific identifier directory is turned off; when the customized function of the pilot consumer is verified normally, the switch of the provider pilot application in the application-level directory is turned on, and the switches of all consumers provided by that application are also turned on; if the verification is still normal, the switch in the global-level directory is turned on. In addition, the switch status in the specific identifier directory and the application-level directory can be cleaned up as appropriate.
[0124] It should be noted that, in this embodiment, "on" in the switch states of each configuration directory can be understood as having subscribed to the configuration directory, and "off" can be understood as not having subscribed to the configuration directory.
[0125] As described in the above embodiments, the configuration-directed distribution method provided in this application, based on considerations of system design completeness, integrates globally distributed configurations, configurations distributed based on interaction relationships, and configurations distributed based on agreed-upon identifiers into a unified solution within the Dubbo distributed service framework. Utilizing a distributed service registry, a three-dimensional dynamic directory is established: a global-level directory, an application-level directory, and a specific identifier directory. The Dubbo distributed service framework is responsible for subscribing to the corresponding configurations within the designated directories. When configuration values change, they are dynamically distributed to the corresponding subscribers. This unified solution achieves unified management of global configuration distribution, configurations distributed based on interaction relationships, and configurations distributed based on agreements. For optimizing the global functionality of distributed systems, flexible management of service providers, consumers, and all or part of the nodes can be achieved.
[0126] Figure 6 This application provides a schematic diagram of the structure of a directional data delivery device, as shown in the embodiment of the present application. Figure 6 As shown, the configuration-oriented distribution device 500 provided in this application embodiment includes:
[0127] Module 501 is used to obtain configuration call requests;
[0128] Module 502 is invoked to respond to configuration invocation requests, determine the configuration directory, and invoke the configuration under the configuration directory. The configuration directory includes a global-level directory, an application-level directory, and a specific identifier directory.
[0129] The distribution module 503 is used to distribute configurations to the corresponding configuration objects in the configuration directory, enabling the configuration objects to apply the configurations and implement the corresponding customized functions.
[0130] In one possible design, if the configuration directory is a global directory, module 502 is called, specifically for:
[0131] It calls all global configurations of all service nodes. The configurations under the global level directory include all global configurations, and the configuration objects corresponding to the global level directory include all service nodes.
[0132] In one possible design, the targeted distribution device 500 further includes a subscription module, which is used for:
[0133] Subscribe to all global configurations for all service nodes.
[0134] In one possible design, if the configuration target is an application-level directory, module 502 is invoked, specifically for:
[0135] Invokes the target configuration of the current application or cluster. The configuration under the application-level directory includes the target configuration of the current application or cluster. The configuration object corresponding to the application-level directory includes the service nodes that subscribe to the current application or cluster.
[0136] In one possible design, the subscription module is also used for:
[0137] Identify the current application or cluster based on service subscription information, and subscribe to the configuration of the current application or cluster according to the subscription scope.
[0138] In one possible design, the subscription scope includes: the configuration to which the current application or cluster belongs, and the configuration of the application or cluster to which the current application or cluster belongs.
[0139] In one possible design, if the configuration directory is a specific identifier directory, module 502 is invoked, specifically for:
[0140] The specific configuration of the grayscale node is invoked. The configuration under the specific identifier directory includes the specific configuration of the grayscale node, and the configuration object corresponding to the specific identifier directory includes the grayscale node.
[0141] In one possible design, the subscription module is also used for:
[0142] The grayscale node is determined based on the node identifier set in the environment variables, and the specific configuration of the grayscale node is subscribed to.
[0143] Figure 7 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. For example... Figure 7 As shown, the electronic device 600 may include a processor 601 and a memory 602 communicatively connected to the processor 601.
[0144] The memory 602 is used to store programs. Specifically, the program may include program code, which includes computer-executable instructions.
[0145] The memory 602 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0146] The processor 601 is used to execute computer execution instructions stored in the memory 602 to implement the above-described configuration-directed delivery method.
[0147] The processor 601 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0148] Optionally, the memory 602 can be either standalone or integrated with the processor 601. When the memory 602 is a device independent of the processor 601, the electronic device 600 may further include:
[0149] Bus 603 is used to connect processor 601 and memory 602. The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not mean there is only one bus or one type of bus.
[0150] Optionally, in a specific implementation, if the memory 602 and the processor 601 are integrated on a single chip, the memory 602 and the processor 601 can communicate through an internal interface.
[0151] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores computer-executable instructions, which are used in the methods described in the above embodiments.
[0152] This application also provides a computer program product, including computer execution instructions that, when executed by a processor, implement the methods described above.
[0153] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0154] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for targeted configuration distribution, characterized in that, The method, applied to the Dubbo distributed service system, includes: Get the configuration call request; The configuration directory is determined in response to the configuration call request. The configuration call request carries a directory identifier of the configuration directory, which is used to identify whether the configuration directory is a global-level directory, an application-level directory, or a directory with a specific identifier; the configuration under the configuration directory is called. The configuration is distributed to the configuration object corresponding to the configuration directory, so that the configuration object applies the configuration to implement the corresponding customized function; The process of calling the configuration under the configuration directory includes: If the configuration directory is the global-level directory, all global configurations of all service nodes are called. The configurations under the global-level directory include all global configurations. The configuration objects corresponding to the global-level directory include all service nodes. If the configuration directory is the application-level directory, the target configuration of the current application or cluster is called. The configuration under the application-level directory includes the target configuration of the current application or cluster. The configuration object corresponding to the application-level directory includes the service node that subscribes to the current application or cluster. If the configuration directory is the specific identifier directory, the specific configuration of the grayscale node is called. The configuration under the specific identifier directory includes the specific configuration of the grayscale node, and the configuration object corresponding to the specific identifier directory includes the grayscale node.
2. The configuration-targeted distribution method according to claim 1, characterized in that, Before invoking all global configurations for all service nodes, the following is also included: Subscribe to all global configurations for all service nodes.
3. The configuration-oriented distribution method according to claim 1 or 2, characterized in that, Before invoking the configuration of the current application or cluster, the following is also included: The current application or cluster is identified based on the service subscription information, and the configuration of the current application or cluster is subscribed to according to the subscription scope.
4. The configuration-targeted distribution method according to claim 3, characterized in that, The subscription scope includes: the configuration to which the current application or cluster belongs, and the configuration of the application or cluster to which the current application or cluster belongs.
5. The configuration-oriented distribution method according to claim 1 or 2, characterized in that, Before the configuration of the grayscale node is invoked, the following is also included: The grayscale node is determined based on the node identifier set in the environment variables, and the specific configuration of the grayscale node is subscribed to.
6. A device for configuring directional data transmission, characterized in that, include: The acquisition module is used to obtain configuration call requests; The calling module is used to respond to the configuration call request to determine the configuration directory. The configuration call request carries a directory identifier of the configuration directory, which is used to identify whether the configuration directory is a global-level directory, an application-level directory, or a directory with a specific identifier; and calls the configuration under the configuration directory. The distribution module is used to distribute the configuration to the configuration object corresponding to the configuration directory, so that the configuration object can apply the configuration to implement the corresponding customized function; The calling module is specifically used for: If the configuration directory is the global-level directory, all global configurations of all service nodes are called. The configurations under the global-level directory include all global configurations. The configuration objects corresponding to the global-level directory include all service nodes. If the configuration directory is the application-level directory, the target configuration of the current application or cluster is called. The configuration under the application-level directory includes the target configuration of the current application or cluster. The configuration object corresponding to the application-level directory includes the service node that subscribes to the current application or cluster. If the configuration directory is the specific identifier directory, the specific configuration of the grayscale node is called. The configuration under the specific identifier directory includes the specific configuration of the grayscale node, and the configuration object corresponding to the specific identifier directory includes the grayscale node.
7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the configuration-directed delivery method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the configuration-directed delivery method as described in any one of claims 1-5.
9. A computer program product comprising computer-executable instructions, which, when executed by a processor, are used to implement the configuration-directed delivery method as described in any one of claims 1-5.