Calling parameter processing method, system, device, storage medium and product
By introducing parameter management services and configuration center services, and dynamically updating RPC call parameters, the problem of having to re-launch when modifying RPC call parameters in a microservice architecture is solved, achieving efficient and reliable parameter processing.
Patent Information
- Application Number
- CN202210257784.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-03-16
AI Technical Summary
In a microservice architecture, modifying RPC call parameters requires re-launching the application service, resulting in time-consuming exception handling and low reliability.
By introducing parameter management services and configuration center services, RPC call parameters are dynamically updated through subscription and push mechanisms, allowing application services to modify parameters without restarting.
It improves the efficiency and reliability of RPC call parameter processing, reduces system coupling interference, and ensures system availability and remote call efficiency.
Smart Images

Figure CN114610509B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a method and system for processing calling parameters, a device, a storage medium and a product. BACKGROUND
[0002] Under a service cluster based on a micro-service architecture, mutual access between different application services is very frequent, and one service instance needs to call a method provided by another service instance through a remote procedure call (RPC) and obtain corresponding data.
[0003] Before initiating an RPC access, an application service often needs to configure some calling parameters, such as a connection timeout, and for cross-region business, service multi-active in different regions is usually required, and the same application service needs to be deployed in different regions or even different machine rooms, and the RPC call between application services often needs to set some calling parameters about a large area or a machine room, such as specifying a machine room. The setting and modification of RPC calling parameters are often completed by the developers of the application service on the business layer code, and once an abnormal situation occurs, such as a decline in the processing capacity of the callee leading to a timeout of the caller, the application service developers of the caller need to modify the corresponding code block to modify the calling parameters, such as increasing the timeout time of the RPC call, and after the modification is completed, the service needs to be re-deployed to solve the problem, and the entire abnormal handling process is time-consuming and has low reliability. Therefore, the service cluster under the micro-service architecture urgently needs a processing scheme for dynamically modifying the RPC calling parameters without suspending or restarting the application service. SUMMARY
[0004] Embodiments of the present application provide a method and system for processing calling parameters, a device, a storage medium and a product, which can optimize the existing calling parameter processing scheme, and after the calling parameters are modified, the application service does not need to be re-deployed, thereby improving the calling parameter processing efficiency.
[0005] In a first aspect, embodiments of the present application provide a method for processing calling parameters, applied to a calling parameter processing system, wherein the calling parameter processing system comprises a parameter management service, a configuration center service and at least one application service, and the method comprises:
[0006] a target application service subscribes to target calling parameter configurations of the target application service in the configuration center service;
[0007] the parameter management service updates a current data set of the target calling parameter configurations according to a parameter update operation of a user, and stores a target data set obtained after the update into the configuration center service;
[0008] The configuration center service pushes the target data set to the target application service, or the target application service periodically requests the configuration center service to obtain the target data set.
[0009] The target application service performs remote invocation based on the target data set.
[0010] In a second aspect, an embodiment of the present application provides a calling parameter processing system for executing the calling parameter processing method provided by the embodiments of the present application. The calling parameter processing system comprises a parameter management service, a configuration center service and at least one application service. The target application service in the at least one application service comprises a configuration subscription module and a remote invocation module. The parameter management service comprises a data update module. The configuration center service comprises a data distribution module.
[0011] The configuration subscription module is configured to subscribe to the target calling parameter configuration of the target application service in the configuration center service.
[0012] The data update module is configured to update the current data set of the target calling parameter configuration according to a parameter update operation of a user, and store the obtained target data set after the update into the configuration center service.
[0013] The data distribution module is configured to push the target data set to the target application service, or send the target data set to the target application service in response to a periodic request of the target application service.
[0014] The remote invocation module is configured to perform remote invocation based on the target data set.
[0015] In a third aspect, an embodiment of the present application provides a calling parameter processing device comprising a memory, a processor and a computer program stored in the memory and executable on the processor. The calling parameter processing device is configured as the parameter management service, the configuration center service or the application service in the calling parameter processing method provided by the embodiments of the present application. The processor executes the computer program to implement the corresponding steps in the calling parameter processing method provided by the embodiments of the present application.
[0016] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon. The program is executed by a processor to implement the corresponding steps in the calling parameter processing method provided by the embodiments of the present application.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program. The computer program is executed by a processor to implement the corresponding steps in the calling parameter processing method provided by the embodiments of the present application.
[0018] The calling parameter processing scheme provided in the embodiments of the present application is applied to a calling parameter processing system, the calling parameter processing system comprises a parameter management service, a configuration center service and at least one application service, a target application service subscribes to target calling parameter configuration of the target application service in the configuration center service, the parameter management service updates a current data set of the target calling parameter configuration according to a parameter update operation of a user, and stores a target data set obtained after the update into the configuration center service, the configuration center service pushes the target data set to the target application service, or the target application service periodically requests the configuration center service to obtain the target data set, and the target application service performs remote calling based on the target data set. By using the above technical scheme, when a business personnel needs to modify the calling parameter of the application service, the business personnel can modify the calling parameter through the parameter management service, and the parameter management service stores the modified data set into the configuration center service. Since the application service has subscribed to the corresponding calling parameter configuration in advance, the configuration center service can push the updated data set to the application service in time, or send the updated data set to the target application service in response to the periodic request of the target application service, so that the application service can perform remote calling based on the updated parameter data. In the above process, the application service does not need to be suspended and restarted, the hot loading of the calling parameter is realized, the reliability and the efficiency of the remote calling are ensured, and the configuration management service and the application service are decoupled by using the configuration center service, so that the modification process of the configuration and the pushing process of the configuration can be separated, the interference caused by high coupling is avoided, the access pressure is relieved, and the availability of the system is ensured. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A structural schematic diagram of a calling parameter processing system provided by the embodiments of the present application is provided.
[0020] Figure 2 A flowchart of a calling parameter processing method provided by the embodiments of the present application is provided.
[0021] Figure 3 A flowchart of another calling parameter processing method provided by the embodiments of the present application is provided.
[0022] Figure 4 A principle schematic diagram of a calling parameter processing method provided by the embodiments of the present application is provided.
[0023] Figure 5 A structural block diagram of a calling parameter processing system provided by the embodiments of the present application is provided.
[0024] Figure 6 A structural block diagram of a calling parameter processing device provided by the embodiments of the present application is provided. DETAILED DESCRIPTION
[0025] The application will be described in further detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the application and not to limit the application. In addition, it should be noted that, for the sake of description, only the parts related to the application are shown in the drawings, not all the structures. In addition, the embodiments in the application and the features in the embodiments can be combined with each other without conflict.
[0026] Figure 1 A schematic diagram of a calling parameter processing system is provided for the embodiments of the application. Specifically, referring to Figure 1 , the system includes a parameter management service 101, a configuration center service 102, and at least one application service 103 (only one is shown in the figure as an illustrative description, and the specific number is not limited). Each service can be integrated in a device such as a server. The developers (users) of the application service can set or modify the calling parameter configuration of the application service through the parameter management service, and the calling parameter can be an RPC calling parameter, including but not limited to connection timeout, maximum retransmission times, access timeout, and routing disaster recovery strategy. For cross-regional business, it can also include but not limited to designated machine room, shielded machine room list, and designated large area. The data set of the calling parameter configuration is stored in the configuration center service, and the application service obtains the data set of the calling parameter configuration of itself from the configuration center service.
[0027] Figure 2 A flowchart of a calling parameter processing method is provided for the embodiments of the application. The method can be executed by a calling parameter processing system, which can be implemented by software and / or hardware. As Figure 2 shown, the method comprises:
[0028] Step 201, the target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service.
[0029] Illustratively, the target application service can be any application service in the calling parameter processing system. When there are multiple instances of the target application service, the target application service here can also be understood as any instance of the target application service. The target application service can subscribe to the target calling parameter configuration of the target application service in the configuration center service when detecting that a preset subscription event is triggered. The triggering condition of the preset subscription event can be, for example, the start of the target application service, the timing trigger, or the receipt of the trigger instruction sent by the configuration center service.
[0030] Exemplarily, the configuration center service can store the identifiers (such as names or numbers, etc.) of the calling parameter configurations corresponding to each application service. The identifiers of the calling parameter configurations can be associated with the application services, for example, named by the identifiers of the application services, or store the mapping relationship between the identifiers of the calling parameter configurations and the identifiers of the application services, so that the target application program can quickly find the corresponding target calling parameter configuration when subscribing to the calling parameter configuration. Exemplarily, after successful subscription, the configuration center service can record the address information corresponding to the target application service, so as to subsequently distribute the data set of the target calling parameter configuration.
[0031] Step 202, the parameter management service updates the current data set of the target calling parameter configuration according to the parameter update operation of the user, and stores the target data set obtained after the update into the configuration center service.
[0032] Exemplarily, the parameter management service can provide a human-computer interaction interface, which can be in the form of a Web page, etc. The developers of the application service can modify the calling parameters of each application service based on the human-computer interaction interface. The initial data set of the calling parameter configuration of the application service can be completed in the business layer code, or can be set through the parameter management service. For example, the developer can generate the initial data set (which can exist in the form of a configuration file) of the calling parameter configuration through the above-mentioned human-computer interaction interface and save it in the configuration center service.
[0033] In the related art, the setting and modification of the RPC calling parameters are both completed by the developers of the application service on the business layer code. When the calling parameters need to be modified, the application service needs to be re-launched. In the embodiment of the present application, the modification of the calling parameters is completed through the parameter management service. After being launched, the application service does not need to be modified due to the modification of the calling parameters, and therefore does not need to be re-launched.
[0034] In the embodiment of the present application, the parameter update operation can include a parameter addition operation, a parameter deletion operation, and a parameter modification operation, etc. Exemplarily, the user can input the parameter modification operation based on the human-computer interaction interface of the parameter management service, for example, modify the value of the connection timeout time parameter in the current data set from 300 milliseconds to 400 milliseconds, etc., to obtain the target data set, and store the target data set into the configuration center service. When storing the target data set obtained after the update into the configuration center service, the data that has changed can be sent to the configuration center service to save the data transmission amount, or the target data set can be sent to the configuration center service to ensure accuracy.
[0035] Step 203, the configuration center service pushes the target data set to the target application service, or the target application service periodically requests the configuration center service to obtain the target data set.
[0036] For example, after receiving the target data set, the configuration center service determines that the target call parameter configuration has changed, and thus can automatically push the target data set to the target application service that subscribes to the target call parameter configuration, so that the target application service can obtain the latest configuration data in time.
[0037] For example, the target application service can also obtain the latest data set of the target call parameter configuration from the configuration center service at a preset frequency, that is, the target application service periodically requests the configuration center service to obtain the target data set, and the configuration center service sends the latest target data set to the target application service in response to the periodic request. The advantage of this setting is that it reduces the pressure on the configuration center service and can also avoid the target application service not receiving the latest data set in time due to data set pushing exceptions, thereby ensuring the accuracy of the configuration data on the target application service side.
[0038] Step 204: The target application service performs remote calling based on the target data set.
[0039] For example, after receiving the target data set pushed by the configuration center service, the target application service can replace the locally stored data set of the target call parameter configuration with the target data set, and wait for remote calling to be performed based on the target data set.
[0040] The calling parameter processing method provided in the embodiments of the present application is applied to a calling parameter processing system, the calling parameter processing system comprises a parameter management service, a configuration center service and at least one application service, a target application service subscribes to target calling parameter configuration of the target application service in the configuration center service, the parameter management service updates a current data set of the target calling parameter configuration according to a parameter update operation of a user, and stores a target data set obtained after the update into the configuration center service, the configuration center service pushes the target data set to the target application service, or the target application service periodically requests the configuration center service to obtain the target data set, and the target application service performs remote calling based on the target data set. By using the above technical solution, when a business personnel needs to modify calling parameters of an application service, the business personnel can modify the calling parameters through the parameter management service, and the parameter management service stores a modified data set into the configuration center service. Since the application service has subscribed to corresponding calling parameter configuration in advance, the configuration center service can timely push the updated data set to the application service, or send the updated data set to the target application service in response to the periodic request of the target application service, so that the application service can perform remote calling based on the updated parameter data. In the above process, the application service does not need to be suspended and restarted, the hot loading of the calling parameters is realized, the reliability and the remote calling efficiency are ensured, and the application service and the parameter management service are decoupled by using the configuration center service, so that the modification process of the configuration, the storage of the configuration and the distribution process of the configuration can be separated. The parameter management service does not need to frequently interact with the application service, that is, the parameter management service does not need to be responsible for the registration of the application service, the saving of the configuration, the notification of the configuration and the delivery of the configuration and other logics, so that abnormal situations such as registration failure, notification failure, notification success but the application service does not pull the updated configuration data and the like are reduced, the interference caused by high coupling is avoided, and the access pressure is relieved, so that the availability of the system is ensured.
[0041] Under a service cluster based on a micro-service architecture, mutual access between different application services is very frequent, and the application services are often written based on an RPC framework or other network frameworks, so the code of an application service is mainly divided into an upper business layer and a lower framework layer, and the business layer interacts with the framework layer through an RPC interface to exchange data. The business layer is responsible for processing data and executing business logic, and the business layer code of different application services is written by corresponding developers; the framework layer is mainly responsible for routing, disaster recovery, data encoding and decoding, network transmission and the like of the RPC, and is uniformly written by framework developers and provided for different business developers. In related technologies, in order to solve the RPC call parameter hot loading problem mentioned above, some application service developers will choose to read the parameters on the configuration file in the business layer code and set them, and then initiate a call to the callee. If the static configuration is read, the RPC call parameters need to be updated by modifying the configuration and restarting the service; if the remote configuration is read, with the optimization of the framework layer code and the increase and decrease of the call parameters, the loading of the call parameters from the business layer code often leads to the problems of missing configuration and misconfiguration, and different application services maintain their own set of call parameter loading methods, which increases the development cost and operation and maintenance difficulty.
[0042] In the embodiment of the application, the steps executed by the target application service in the call parameter processing method can be implemented in the framework layer, that is, the dynamic adjustment of the parameters is adjusted in the framework closest to the application according to the nearest principle, instead of being placed in the business layer, so as to avoid the situation of missing configuration or misconfiguration when the business layer obtains the call parameter data. Illustratively, the target application service subscribes to the target call parameter configuration of the target application service in the configuration center service, including that the target application service subscribes to the target call parameter configuration of the target application service in the configuration center service through the framework layer, and the method further includes that the target application service receives the target data set pushed by the configuration center service through the framework layer, or the target application service periodically requests the configuration center service to obtain the target data set through the framework layer.
[0043] Currently, many businesses have the need for cross-regional deployment, and the embodiments of the present application can also be applied to cross-regional business scenarios. For example, the application service in the call parameter processing system is deployed in multiple regions, at least one application service room is deployed in each region, and at least one instance of each application service is configured in each application service room. Wherein, the division of regions is not limited, for example, it can be continent, country or region, etc. In each region, at least one application service room can be set, for example, it can be an Internet Data Center (IDC), which can be understood as a server hosting room that provides application services. In order to ensure the fast response and high availability of the application service, at least one instance of each application service is configured in each application service room, that is, for a target application service, multiple instances are included, any one of which is called a target instance, and the subsequent description takes the target instance as an example. Since different instances of the same application service are deployed in different rooms, there may be a need to set different call parameter data, and in related technologies, the business layer code needs to be implemented, and additional logic code is needed to judge the room where the instance is located. The required call parameter data needs to be additionally set, and the business code development is large and cannot be hot-loaded.
[0044] In the embodiments of the present application, the concept of metadata configuration can be added, and the call parameter configuration is divided into three levels, namely the application service level, the region level and the room level, which is beneficial to the fine management of the call parameter configuration. Among them, the metadata configuration includes a general configuration identifier, a region-specific configuration identifier of a preset region and a room-specific configuration identifier of a preset room, and the metadata configuration can be understood as an index of the call parameter configuration. The application service instance can use the index to find the corresponding call parameter configuration of itself and subscribe to it. Among them, the general configuration identifier can be understood as the identifier of the call parameter configuration universally applicable to all instances of the application service, which can be named by the application service identifier; the region-specific configuration identifier of the preset region can be understood as the identifier of the call parameter configuration required to be used by the application service instance deployed in a specified region, which can be named by the application service identifier and the region identifier; and the room-specific configuration identifier of the preset room can be understood as the identifier of the call parameter configuration required to be used by the application service instance deployed in a specified room in a specified region, which can be named by the application service identifier, the region identifier and the room identifier.
[0045] In some embodiments, the target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service, including: the target application service acquires the metadata configuration of the target application service from the configuration center service through a target instance, wherein the metadata configuration includes a general configuration identifier, a region-specific configuration identifier of a preset region, and a machine room-specific configuration identifier of a preset machine room; the target application service finds a matching calling parameter configuration in the metadata configuration according to a target region and a target machine room to which the target instance belongs, and determines the target calling parameter configuration according to a finding result; and the target application service subscribes to the target calling parameter configuration through the target instance. This arrangement has the advantage that the target calling parameter configuration required by the target instance is determined in the subscription stage of the calling parameter configuration, and there is no need to add related logic code such as region determination and machine room determination in the business layer code, so that when the calling parameter configuration data required by the target instance changes, the latest configuration data can be quickly acquired, and the accuracy and timeliness of remote calling are improved.
[0046] In some embodiments, the target application service finds a matching calling parameter configuration in the metadata configuration according to a target region and a target machine room to which the target instance belongs, and determines the target calling parameter configuration according to a finding result, including: the target application service finds whether there is a machine room-specific configuration identifier matching the target region and the target machine room in the metadata configuration according to the target region and the target machine room to which the target instance belongs; if there is, the target calling parameter configuration is determined according to the found machine room-specific configuration identifier; if there is not, whether the metadata configuration contains a region-specific configuration identifier matching the target region is found; if it does, the target calling parameter configuration is determined according to the found region-specific configuration identifier; and if it does not, the target calling parameter configuration is determined according to the general configuration identifier. This arrangement has the advantage that instances with special requirements can be configured differently from other instances under the same application service, while taking into account the configuration sharing between instances without special requirements, and the calling parameter configuration required by the target instance for subscription is found in order of machine room, region, and application service, taking into account the accuracy and efficiency of subscription.
[0047] In some embodiments, the method further comprises: the parameter management service updating the metadata configuration according to the user's invocation parameter set configuration update operation, and storing the changes of the data set and the updated metadata configuration into the configuration center service; the configuration center service notifying the target instance of the target application service to resubscribe the corresponding invocation parameter configuration when detecting that the update of the metadata configuration is associated with the target instance of the target application service; or the target instance of the target application service resubscribing the corresponding invocation parameter configuration when detecting that the metadata configuration in the configuration center service has changed and is associated with itself. In this way, the benefits are that dynamic and automatic modification of the metadata configuration is supported, and the related target instance of the target application service is notified by the configuration center service in a timely manner to resubscribe, or the target instance of the target application service actively detects the change of the metadata configuration and actively resubscribes, thereby ensuring that the target instance obtains the latest configuration data in a timely and accurate manner.
[0048] For example, assuming that the target instance previously subscribes to the invocation parameter configuration corresponding to the region-specific configuration identifier, when the developer adds the configuration data corresponding to the machine room-specific configuration, the parameter management service automatically modifies the metadata configuration, stores the modification of the metadata configuration and the modification of the configuration data into the configuration center service, and the configuration center service determines that the level of the invocation parameter configuration of the target instance has changed, actively notifies the target instance to resubscribe the machine room-level invocation parameter configuration, and obtains the latest configuration data. Alternatively, the target instance can periodically detect whether the part of the metadata configuration in the configuration center service associated with itself has changed, and if the change occurs, resubscribes the corresponding invocation parameter configuration and obtains the latest configuration data.
[0049] For example, when an application service based on an RPC architecture provides an access interface, at least two levels of server and method are usually provided to locate a specific RPC method, which can be understood as that an application service is a specific server, and a server usually includes one or more methods. The calling party needs to specify the server name and method name of the called party when initiating an RPC call, so as to accurately locate the target RPC method. In the embodiments of the present application, the data in the data set can be divided into two categories, taking the application service and the method in the application service as objects, and for the method category, at least two dimensions are further divided, so as to consider the configuration sharing and differentiated configuration of multiple methods in the same application service and improve flexibility.
[0050] In some embodiments, the target data set includes first type of calling parameter data and second type of calling parameter data, the first type of calling parameter data is object to application service, and the second type of calling parameter data is object to method in the application service, in the case that the second type of calling parameter data includes at least two dimensions of calling parameter data, the at least two dimensions include application service general dimension and method specific dimension, and the method specific dimension is higher than the application service general dimension.
[0051] In the first type of calling parameter data, connection timeout time and load balancing strategy can be included, and in the second type of calling parameter data, data return timeout time and maximum retransmission number can be included. Optionally, between the application service general dimension and the method specific dimension, a module dimension can be further set, and a plurality of methods can be included in the same module, so that a plurality of specified methods can realize configuration sharing.
[0052] Further, the target application service performs remote calling based on the target data set, including: the target application service performs remote calling based on the first type of calling parameter data in the target data set and the calling parameter data in the second type of calling parameter data in the target data set. When the target application service performs remote calling based on the target data set, the calling parameter data in the highest dimension is preferentially used for remote calling to realize more accurate remote calling.
[0053] For example, when determining the method calling parameter data currently required to be used, whether the parameter data of the method specific dimension exists in the second type of calling parameter data in the target data set can be checked first, if it exists, the parameter data of the method specific dimension is used for remote calling, and if it does not exist, the application service general dimension calling parameter data in the second type of calling parameter data is used for remote calling.
[0054] In some embodiments, the target application service performs remote calling based on the target data set, including: the target application service acquires an initial configuration data set and a business configuration data set pre-configured by a business layer; for each parameter in the target calling parameter configuration, a corresponding target parameter value is determined according to a preset priority order, wherein the preset priority order from high to low is the business configuration data set, the target data set and the initial configuration data set; and remote calling is performed according to the target parameter value. The advantage of such setting is that the priority of parameter data from different sources can be configured, and the parameter value of each parameter is determined in turn according to the priority, thereby improving compatibility.
[0055] Exemplarily, the subscription, acquisition, interpretation and application of the calling parameter configuration are implemented on the framework layer. In order to avoid the problem that the parameters set by the business layer are invalid after the code of the business upgrade framework layer, the priority can be followed from high to low, that is, the parameters set by the business layer (business configuration dataset), the parameters read by the configuration center (target dataset) and the default values of the parameters specified by the framework (initial configuration dataset). The business configuration dataset can be understood as the fixed configuration data written by the developer when writing the code of the business layer, and the initial configuration dataset can be understood as the default configuration data uniformly set in the code of the framework layer.
[0056] Figure 3 Another flowchart of a calling parameter processing method provided by the embodiment of the application is shown in the following figure, Figure 4 The principle diagram of a calling parameter processing method provided by the embodiment of the application is shown in the following figure, which can be combined with Figure 3 and Figure 4 to understand the embodiment of the application.
[0057] As shown in the figure, Figure 3 the method can include:
[0058] Step 301: The target application service acquires the metadata configuration of the target application service from the configuration center service through the target instance.
[0059] In the metadata configuration, the general configuration identifier, the region-specific configuration identifier of the preset region and the machine room-specific configuration identifier of the preset machine room are included.
[0060] Exemplarily, the calling parameter processing system is deployed in multiple regions, such as Asia and Europe. Multiple application service machine rooms are deployed in each region, such as Figure 4 As shown in the figure, two machine rooms are deployed in the Asia region, which are denoted as Asia_Machine Room 1 and Asia_Machine Room 2. It is assumed that there are two application services, which are denoted as application service A and application service B. An instance of each application service is configured in each application service machine room, such as Figure 4 In the figure, the application service A instance 1 and the application service B instance 1 are deployed in the Asia_Machine Room 1, and the application service A instance 2 and the application service B instance 2 are deployed in the Asia_Machine Room 2. One configuration center master service can be set in each region, and one configuration center proxy service can be set in each machine room. The configuration center master service and the configuration center proxy service keep the data synchronization.
[0061] The metadata configuration of the target application service can be named by the name of the target application service, for example, ${server_name}_meta, and the metadata configuration records the default RPC call parameter set configuration (general configuration identifier), the names of the special RPC call parameter set configurations of specific regions or specific machine rooms (region-specific configuration identifier of the preset region or machine room-specific configuration identifier of the preset machine room). The developer updates the metadata configuration after adding or deleting a specified call parameter set configuration, so as to add or delete the corresponding configuration name. Subsequently, the parameter management server generates a text according to the format specification for the parameter set configured by the developer, writes the text into the call parameter set configuration, and names the RPC call parameter set configuration as ${server_name}[_${region_name}][_${group_name}]. The metadata configuration and each call parameter set configuration are saved to the configuration center master service, and the configuration data is pulled from the configuration center master service by each configuration center agent service, so as to ensure data synchronization. The region-specific configuration identifiers of the plurality of preset regions constitute a region configuration identifier table, which is recorded as region_config_map; and the machine room-specific configuration identifiers of the plurality of preset machine rooms constitute a machine room configuration identifier table, which is recorded as group_config_map.
[0062] Exemplarily, when the application service instance deployed on each IDC is started, the framework layer code can pull the configuration by directly subscribing to the configuration center master service or by subscribing to the configuration center agent service in the initialization stage. On the premise that the application service instance has explicitly specified the region (region_name) and machine room (group_name) to which the instance belongs, the instance first obtains the metadata configuration corresponding to the application service.
[0063] Step 302, the target application service finds the matched call parameter configuration in the metadata configuration according to the target region and the target machine room to which the target instance belongs, and determines the target call parameter configuration according to the finding result.
[0064] Exemplarily, after obtaining the metadata configuration corresponding to the application service, the entry with the key of ${region_name}_${group_name} in the group_config_map can be searched first, if there is, the configuration with the name of the corresponding value is subscribed, if not, the entry with the key of ${region_name} in the region_config_map is searched, if there is, the configuration with the name of the corresponding value is subscribed, if not, the configuration with the name of the default_config corresponding to the value is directly subscribed. Each instance matches the target RPC call parameter set configuration from the metadata configuration according to the priority order of the specific machine room configuration, the specific region configuration and the default configuration, which effectively solves the problem of different IDC instance call parameter differentiation.
[0065] Step 303, the target application service subscribes to the target call parameter configuration through the target instance and obtains the current data set of the target call parameter configuration.
[0066] Exemplarily, the target instance can obtain the current data set of the target call parameter configuration while subscribing to the target call parameter configuration.
[0067] Step 304, the parameter management service updates the metadata configuration according to the user's call parameter set configuration update operation, and stores the change of the data set and the updated metadata configuration in the configuration center service.
[0068] Exemplarily, when the user updates the call parameter set configuration, it can also cause changes in the metadata configuration. For example, deleting a certain data set will automatically delete the corresponding entry of the metadata configuration; adding a configuration set will automatically add a new entry in the metadata configuration. In this case, when storing the change of the data set in the configuration center service, the changed metadata configuration is also stored in the configuration center service.
[0069] Step 305, the configuration center service detects that the update of the metadata configuration is associated with the target instance of the target application service, and notifies the target instance of the target application service to re-subscribe the corresponding call parameter configuration.
[0070] Step 306, the target application service re-subscribes the corresponding current target call parameter configuration based on the updated metadata configuration from the configuration center service through the target instance, and obtains the current data set of the target call parameter configuration.
[0071] Exemplarily, when the target call parameter configuration previously subscribed by the target instance has changed, the updated target call parameter configuration needs to be re-subscribed, and at the same time, the current data set corresponding to the updated target call parameter configuration can be obtained.
[0072] Step 307, the parameter management service updates the current dataset of the target invocation parameter configuration according to the user's parameter update operation, and stores the updated target dataset in the configuration center service.
[0073] For example, the developer can also modify the dataset content corresponding to the invocation parameter configuration without modifying the metadata configuration, and store the modified dataset in the configuration center service, so that the configuration center service timely pushes the modified dataset to the corresponding target instance.
[0074] Step 308, the configuration center service pushes the target dataset to the target instance of the target application service, or sends the target dataset to the target application service in response to the periodic request of the target application service.
[0075] Step 309, the target application service performs remote invocation based on the first type of invocation parameter data in the target parameter value and the currently highest dimension invocation parameter data in the second type of invocation parameter data in the target dataset through the target instance.
[0076] For example, this step can specifically include: the target application service acquires the initial configuration dataset and the business configuration dataset pre-configured by the business layer through the target instance, determines the corresponding target parameter value for each parameter in the target invocation parameter configuration according to a preset priority order, and performs remote invocation based on the first type of invocation parameter data in the target parameter value and the currently highest dimension invocation parameter data in the second type of invocation parameter data in the target parameter value. The preset priority order from high to low is the business configuration dataset, the target dataset and the initial configuration dataset.
[0077] For example, assume that a certain RPC call has parameters Parameter A, Parameter B, Parameter C, and Parameter D, with default values (values in the initial configuration dataset) A0, B0, C0, and D0, respectively. The application service developer sets Parameter A = A1 and Parameter C = C1 in the business layer, and other parameters that are not actively set will take the default values. Before the target dataset is obtained, the application service can use the parameter set {A1, B0, C1, D0} to make an RPC call. If the service updates the framework layer code, and the developer configures Parameter A = A2 and Parameter D = D2 in the parameter management end, and other parameters Parameter B and Parameter C are automatically completed as the framework default values B0 and C0, therefore the parameter set (target dataset) pulled from the configuration center is {A2, B0, C0, D2}. According to the preset priority order, {A1, C1} set in the business layer will be used first, Parameter D will use D2 in the parameter set configuration because the business does not set it, and Parameter B will still use the default value B0 because it is not set in the business layer code and is not configured in the parameter management end. In summary, the application service will use the parameter set {A1, B0, C1, D2} (the dataset composed of target parameter values) to make an RPC call. The embodiments of the present application follow the principle that the parameter set in the business layer has the highest priority, and the management end defaults to setting the parameters that are not actively configured to default values, which ensures that the application service that upgrades the framework layer code and does not actively configure the parameters in the parameter management service end can initiate an RPC call according to the code logic of the developer, and has strong compatibility.
[0078] Exemplarily, RPC call parameters are divided into two categories, one is server- oriented parameters (first category of call parameters, denoted as server parameters), and the other is method- oriented parameters (second category of call parameters, denoted as method parameters). An RPC call parameter set configuration contains an rpc_servers array, which contains the parameter set of the server to be called as needed, and the elements in the array are RPC call parameters of each dimension. Server parameters only appear in server- dimension parameters, and method parameters will be divided according to the dimensions of server and method, and "server_" and "method_" are added as prefixes, respectively. The framework layer will match and select method parameters according to the priority order of method- dimension method parameters higher than server- dimension method parameters when interpreting the configuration, so the server- dimension method parameters are the must- set bottom line, and the method- dimension method parameters are the supplement to the fine setting of RPC call parameters, which can be set as needed. The present application is not limited to the parameter configuration format of two levels of dimensions. For frameworks that need more levels to locate RPC methods, new dimensions can be added according to the same principle, for example, the module dimension described above.
[0079] The application embodiment provides a calling parameter processing method. The application service subscribes to a configuration center to obtain a calling parameter set in an RPC framework layer of the application service, so that the RPC calling parameter can be adjusted without restarting the application service, the remote calling logic of the calling service is changed, and the problem that the calling parameter needs to be quickly adjusted to recover the system in an abnormal or temporary situation can be solved. By introducing the configuration center service, the remote parameter management end and the application service are decoupled. The parameter management end is only responsible for parameter display and configuration for the developer and saves the calling parameter set to the configuration center. The application service only needs to subscribe to the calling parameter set configuration of the configuration center. The parameter set is obtained in the form of pushing or regularly pulling the configuration center to realize dynamic acquisition of the latest parameter. In addition, the metadata configuration recording the special configuration name of different IDCs is introduced. The instances on different IDCs are indexed to the target RPC calling parameter set configuration through the metadata configuration to solve the problem that the instances on different IDCs pull different parameters. The calling parameter set manages the parameters according to at least two hierarchical dimensions of server and method, so as to ensure fine configuration of the calling parameter. The framework layer code comprehensively develops the parameters set in the business layer and the parameters obtained from the parameter set of the configuration center. The parameters are determined according to the principle that the parameters set in the business layer are higher than the parameters read from the configuration center and higher than the default value of the parameters specified by the framework, so as to determine the parameters for initiating the RPC call, ensure the update compatibility of the application service framework layer code with the original code logic of the business layer, and improve the compatibility.
[0080] Figure 5 A structural block diagram of a calling parameter processing system provided by the application embodiment is provided. The system can be implemented by software and / or hardware, and the processing of the calling parameter can be performed by executing the calling parameter processing method. As shown in the figure, the system comprises a parameter management service 510, a configuration center service 520 and at least one application service. The target application service 530 in the at least one application service comprises a configuration subscription module 531 and a remote calling module 532. The parameter management service 510 comprises a data update module 511. The configuration center service 520 comprises a data distribution module 521. The configuration center service 520 can further comprise a data storage module. Figure 5
[0081] The configuration subscription module 531 is configured to subscribe to the target calling parameter configuration of the target application service in the configuration center service.
[0082] The data update module 511 is configured to update the current data set of the target calling parameter configuration according to the parameter update operation of the user, and store the target data set obtained after the update into the configuration center service.
[0083] The data distribution module 521 is configured to push the target data set to the target application service.
[0084] The remote calling module 532 is configured to make a remote call based on the target data set.
[0085] The data storage module is configured to store the data set of each calling parameter configuration and store the metadata configuration.
[0086] The calling parameter processing system provided in the embodiments of the present application includes a parameter management service, a configuration center service, and at least one application service. The target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service. The parameter management service updates the current data set of the target calling parameter configuration according to a parameter update operation of a user, and stores the target data set obtained after the update in the configuration center service. The configuration center service pushes the target data set to the target application service, or the target application service periodically requests the configuration center service to obtain the target data set, and the target application service makes a remote call based on the target data set. By using the above technical solution, when a business personnel needs to modify the calling parameter of the application service, the business personnel can modify the calling parameter through the parameter management service, and the parameter management service stores the modified data set in the configuration center service. Since the application service has subscribed to the corresponding calling parameter configuration in advance, the configuration center service can push the updated data set to the application service in a timely manner, or send the updated data set to the target application service in response to the periodic request of the target application service, so that the application service can make a remote call based on the updated parameter data. In the above process, the application service does not need to be suspended and restarted, the hot loading of the calling parameter is realized, the reliability and the efficiency of the remote call are ensured, and the configuration center service is used to decouple the application service and the parameter management service, so that the modification process of the configuration and the pushing process of the configuration can be separated, interference caused by high coupling is avoided, access pressure is alleviated, and the availability of the system is ensured.
[0087] The calling parameter processing device provided in the embodiments of the present application is configured as the parameter management service, the configuration center service, or the application service in the calling parameter processing method provided in the embodiments of the present application. Figure 6 A structure block diagram of a calling parameter processing device provided in the embodiments of the present application is provided. The calling parameter processing device 600 includes a memory 601, a processor 602, and a computer program stored in the memory 601 and executable on the processor 602. When the processor 602 executes the computer program, the corresponding steps in the calling parameter processing method provided in the embodiments of the present application are implemented.
[0088] The embodiments of the present application further provide a storage medium containing computer executable instructions, which are used to execute the corresponding steps in the calling parameter processing method provided in the embodiments of the present application when executed by a computer processor.
[0089] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program implements corresponding steps in the calling parameter processing method provided by the embodiment of the present application when executed by a processor.
[0090] The calling parameter processing system, device, storage medium and product provided in the above embodiments can execute corresponding steps in the calling parameter processing method provided by any of the embodiments of the present application, and have corresponding function modules and beneficial effects of the method. Technical details not described in the above embodiments can be referred to the calling parameter processing method provided by any of the embodiments of the present application.
[0091] Note that the above is only a preferred embodiment of the present application. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method of calling parameter processing, characterized by, The method is applied to a calling parameter processing system, the calling parameter processing system comprising a parameter management service, a configuration center service and at least one application service, and the method comprises the following steps: A target application service subscribes to a target calling parameter configuration of the target application service in the configuration center service; The parameter management service updates a current data set of the target calling parameter configuration according to a parameter update operation of a user, and stores a target data set obtained after the update into the configuration center service; The configuration center service pushes the target data set to the target application service, or the target application service periodically requests the configuration center service to obtain the target data set; The target application service performs remote calling based on the target data set; Wherein, the application services in the calling parameter processing system are deployed in multiple regions, at least one application service room is deployed in each region, and at least one instance of each application service is configured in each application service room; Wherein, the target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service, comprising: The target application service obtains a metadata configuration of the target application service from the configuration center service through a target instance, wherein the metadata configuration comprises a general configuration identifier, a region-specific configuration identifier of a preset region and a machine room-specific configuration identifier of a preset machine room, the region-specific configuration identifier of the preset region is an identifier of a calling parameter configuration required to be used by an application service instance deployed in a specified region, and the machine room-specific configuration identifier of the preset machine room is an identifier of a calling parameter configuration required to be used by an application service instance deployed in a specified machine room in a specified region; The target application service finds a matching calling parameter configuration in the metadata configuration according to the target region and the target machine room to which the target application service belongs, and determines a target calling parameter configuration according to the finding result through the target instance; The target application service subscribes to the target calling parameter configuration through the target instance.
2. The method of claim 1, wherein, The target application service finds a matching calling parameter configuration in the metadata configuration according to the target region and the target machine room to which the target application service belongs, and determines a target calling parameter configuration according to the finding result, comprising: The target application service finds whether there is a machine room-specific configuration identifier matching the target region and the target machine room in the metadata configuration according to the target region and the target machine room to which the target application service belongs through the target instance; If there is, the target calling parameter configuration is determined according to the found machine room-specific configuration identifier; if there is not, whether there is a region-specific configuration identifier matching the target region in the metadata configuration is found; If there is, the target calling parameter configuration is determined according to the found region-specific configuration identifier; if there is not, the target calling parameter configuration is determined according to the general configuration identifier.
3. The method of claim 1, wherein, The method further comprises: The parameter management service updates the metadata configuration according to a calling parameter set configuration update operation of a user, and stores the change of the data set and the updated metadata configuration into the configuration center service; The configuration center service notifies the target instance of the target application service to resubscribe the corresponding calling parameter configuration in a case where it is detected that the update of the metadata configuration is associated with the target instance of the target application service; or the target instance of the target application service resubscribes the corresponding calling parameter configuration in a case where it is detected that the metadata configuration in the configuration center service is changed and is associated with itself.
4. The method of claim 1, wherein, The target data set comprises first calling parameter data and second calling parameter data, the first calling parameter data is object to an application service, the second calling parameter data is object to a method in the application service, and in a case where the second calling parameter data comprises calling parameter data of at least two dimensions, the at least two dimensions comprise an application service general dimension and a method specific dimension, and the method specific dimension is higher than the application service general dimension. The target application service performs remote calling based on the target data set, comprising: The target application service performs remote calling based on the first calling parameter data in the target data set and the calling parameter data of the highest dimension in the second calling parameter data in the target data set.
5. The method of claim 1, wherein, The target application service performs remote calling based on the target data set, comprising: The target application service acquires an initial configuration data set and a business configuration data set preconfigured by a business layer; For each parameter in the target calling parameter configuration, a corresponding target parameter value is determined according to a preset priority order, wherein the preset priority order from high to low is the business configuration data set, the target data set and the initial configuration data set; Remote calling is performed according to the target parameter value.
6. The method according to any one of claims 1 to 5, characterized in that, The target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service, comprising: The target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service through the framework layer; The method further comprises: The target application service receives the target data set pushed by the configuration center service through the framework layer, or the target application service periodically requests the configuration center service to acquire the target data set through the framework layer.
7. A call parameter processing system characterized by comprising: The calling parameter processing system is used to perform the calling parameter processing method in any one of claims 1-6, and comprises a parameter management service, a configuration center service and at least one application service, wherein a target application service in the at least one application service comprises a configuration subscription module and a remote calling module, the parameter management service comprises a data update module, and the configuration center service comprises a data distribution module; The configuration subscription module is configured to subscribe to the target calling parameter configuration of the target application service in the configuration center service; The data update module is configured to update a current data set of the target calling parameter configuration according to a parameter update operation of a user, and store a target data set obtained after the update into the configuration center service; The target application service performs remote calling based on the target data set, comprising: The target application service acquires an initial configuration data set and a business configuration data set preconfigured by a business layer; For each parameter in the target calling parameter configuration, a corresponding target parameter value is determined according to a preset priority order, wherein the preset priority order from high to low is the business configuration data set, the target data set and the initial configuration data set; Remote calling is performed according to the target parameter value. The target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service, comprising: The target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service through the framework layer; The method further comprises: The target application service receives the target data set pushed by the configuration center service through the framework layer, or the target application service periodically requests the configuration center service to acquire the target data set through the framework layer. The data distribution module is configured to push the target data set to the target application service, or to send the target data set to the target application service in response to a periodic request of the target application service. The remote calling module is configured to make a remote call based on the target data set. The application services in the calling parameter processing system are deployed in multiple regions, and at least one application service room is deployed in each region, and at least one instance of each application service is configured in each application service room. The target application service subscribes to the target calling parameter configuration of the target application service in the configuration center service, including: The target application service obtains the metadata configuration of the target application service from the configuration center service through a target instance, wherein the metadata configuration includes a general configuration identifier, a region-specific configuration identifier of a preset region, and a machine room-specific configuration identifier of a preset machine room, the region-specific configuration identifier of the preset region is an identifier of a calling parameter configuration required to be used by an application service instance deployed in a specified region, and the machine room-specific configuration identifier of the preset machine room is an identifier of a calling parameter configuration required to be used by an application service instance deployed in a specified machine room in a specified region. The target application service finds a matching calling parameter configuration in the metadata configuration according to the target region and the target machine room to which it belongs, and determines the target calling parameter configuration according to the finding result. The target application service subscribes to the target calling parameter configuration through a target instance.
8. A call parameter processing apparatus comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, The calling parameter processing device is configured as the parameter management service, the configuration center service, or the application service in the calling parameter processing method according to any one of claims 1-6, and the processor executes the computer program to implement the corresponding steps in the calling parameter processing method according to any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the corresponding steps in the calling parameter processing method according to any one of claims 1-6.
10. A computer program product, characterised in that, The computer program product includes a computer program that, when executed by a processor, implements the corresponding steps in the calling parameter processing method according to any one of claims 1-6.
Citation Information
Patent Citations
Distributed application parameter distribution system
CN113641385A