Parameter configuration method and system in multi-user scenario, and electronic device and medium

By storing global parameters and proprietary parameters in the configuration center server of the multi-tenant microservice system and defining proprietary parameters using user code information, tenant-level overloading of configuration parameters is achieved, solving the problem of difficult configuration parameter management and unstable system in the existing technology, and improving the flexibility and maintainability of the system.

WO2025060406A1PCT designated stage expired Publication Date: 2025-03-27EBAOTECH CORP
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/088081
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-20
Filing Date
2024-04-16
Publication Date
2025-03-27

AI Technical Summary

Technical Problem

In multi-tenant microservice systems, it is difficult for the existing technology to effectively manage configuration parameters, especially when the number of tenants changes, developers need to write or modify code frequently, resulting in high error rates, unstable system and difficult to maintain.

Method used

By storing global parameters and proprietary parameters in the configuration center server, the name of the proprietary parameters contains user code information, realizing tenant-level overloading of configuration parameters. The user terminal, business server and configuration center server work together to automatically check and configure with corresponding proprietary parameters or global parameters.

Benefits of technology

It realizes tenant-level overloading of configuration parameters without modifying code, greatly simplifies the difficulty of configuration parameters management, improves the flexibility and maintainability of the system, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024088081_27032025_PF_FP_ABST
    Figure CN2024088081_27032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications. Disclosed are a parameter configuration method and system, and an electronic device and a medium. The method comprises: a user terminal sending a service request to a service server; on the basis of the service request, the service server acquiring target user codes and parameters to be configured, and on the basis of the target user codes and the parameters to be configured, requesting from a configuration center server the determination of target specific parameters, wherein the configuration center server stores global parameters and specific parameters, the names of the specific parameters comprising user code information; in the case that there are target specific parameters acquired from the configuration center server, sending parameter values of the target specific parameters to the service server; in the case that target specific parameters are not acquired from the configuration center server, sending to the service server parameter values of target global parameters which correspond to names of the parameters to be configured; and on the basis of the acquired parameter values, the service server configuring the parameters to be configured. Configuration parameter reloading at a tenant level can be realized without the need for modifying codes, thereby reducing the difficulty in managing configuration parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Parameter configuration method, system, electronic device and medium in multi-user scenario

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 20, 2023, with application number 2023112246961 and application name “Parameter configuration method, system, electronic device and medium in multi-user scenarios”. The entire contents of the above application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a parameter configuration method, system, electronic device, and medium in a multi-user scenario. Background Art

[0003] In a multi-tenant microservice system, configuration parameters are often used to drive system logic. Different tenants require different configuration parameter settings to drive system logic.

[0004] Taking the time zone configuration parameter as an example, microservice systems require setting the time zone configuration parameter value to control the displayed time. When two tenants are in different time zones, developers need to hard-code the time zone configuration parameter in the code to display the specific time of each tenant's time zone. A common operation currently is to record the mapping relationship between each tenant's account or name and their time zone. After the user logs in, the system will determine the user's specific time zone based on the mapping relationship and other conditions, and then load the parameter value corresponding to the time zone into the time zone configuration parameter.

[0005] However, with the above configuration parameter encoding method, once the number of tenants changes, developers need to frequently write or modify code, which increases the error rate of program writing, making the system unstable and difficult to maintain.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a parameter configuration method, system, electronic device, and storage medium in a multi-user scenario to solve the problem in the prior art of configuration parameter encoding that developers need to frequently write or modify code once the number of tenants changes.

[0008] In a first aspect, an embodiment of the present application provides a method for obtaining configuration parameters in a multi-user scenario, which is used in a system including a user terminal, a configuration center server, and a service server, wherein the configuration center server stores global parameters and proprietary parameters, and the names of the proprietary parameters include user code information; the method includes:

[0009] The user terminal sends a service request to the service server;

[0010] The business server obtains the target user code and the parameters to be configured based on the service request, and requests the configuration center server to determine the target proprietary parameters based on the target user code and the parameters to be configured;

[0011] In the case where the target specific parameter is obtained in the configuration center server based on the target user code and the parameter to be configured, the configuration center server sends the parameter value of the target specific parameter to the business server;

[0012] In the case that the target specific parameter is not obtained in the configuration center server based on the target user code and the parameter to be configured, the configuration center server sends the parameter value of the target global parameter corresponding to the name of the parameter to be configured to the business server;

[0013] The business server configures the parameters to be configured based on the parameter values ​​output by the configuration center server.

[0014] The system used in the multi-user scenario of the present application includes user terminals, a configuration center server, and a business server. Global parameters and proprietary parameters are stored in the configuration center server. The name of the proprietary parameter includes the user code information parameter configuration method. By defining the user-specific parameters in the form of simultaneously including the user code information and the parameter name, when using the configuration parameters, only based on the user and the name of the parameter to be configured, the system will automatically check whether there is an overload parameter for the current tenant (that is, a proprietary parameter whose name includes the user code information and the name of the parameter to be configured). If the overload parameter exists, the overload parameter is used. If the overload parameter does not exist, the global parameter corresponding to the name of the parameter to be configured is used. The method provided by the present application can realize tenant-level overloading of configuration parameters without modifying the code, which greatly simplifies the difficulty of configuration parameter management.

[0015] In a possible implementation of the first aspect, requesting the configuration center server to determine target specific parameters based on the target user code and the parameters to be configured includes:

[0016] The business server obtains the target user code and the configuration parameters to be executed based on the service request, and stores the target user code;

[0017] In response to executing the parameters to be configured, the business server retrieves the target user code stored therein and recombines the target user code and the parameters to be configured to construct an identifier of the target specific parameter;

[0018] The business server requests the configuration center server to determine the target specific parameters based on the identifier of the target specific parameters.

[0019] In a possible implementation of the first aspect, the service request includes a user token parameter of the logged-in user, and obtaining the target user code based on the service request includes:

[0020] Get the user token parameters based on the service request;

[0021] Parse the user token parameter to obtain the target user code.

[0022] In a possible implementation of the first aspect, the system further includes a database server storing a plurality of data resources, each data resource corresponding to a connection associated with a parameter configuration value; and the method further includes:

[0023] The business server obtains the target connection based on the configured parameters to be configured, and accesses the target data resources in the database server based on the target connection.

[0024] In a possible implementation of the first aspect above, the configuration center server includes a global configuration platform that can be accessed by all users and a user configuration platform specific to each user, wherein global parameters are defined in the global configuration platform, and specific parameters of each user are defined in the user configuration platform corresponding to the user.

[0025] In a possible implementation of the first aspect, each user configuration platform includes a user-shared configuration sub-platform and a user-specific configuration sub-platform, wherein parameters in the user-shared configuration sub-platform can be read by all services of the user;

[0026] The proprietary parameters include the parameters defined in the user-shared configuration sub-platform for configuring the time zone and login token, and the parameters defined in the user-specific configuration sub-platform for configuring the user data source connection.

[0027] In a possible implementation of the first aspect, proprietary parameters are defined in the form of a user code as a prefix of the parameter name, and global parameters are defined in the form of a parameter name.

[0028] In a second aspect, an embodiment of the present application provides a parameter configuration system, including a user terminal, a configuration center server, and a service server.

[0029] User terminal, used to send service requests to the business server;

[0030] The business server is configured to obtain the target user code and the parameters to be configured based on the service request, and to request the configuration center server to determine the target proprietary parameters based on the target user code and the parameters to be configured, and to configure the parameters to be configured based on the parameter values ​​output by the configuration center server;

[0031] The configuration center server is used to send the parameter values ​​of the target specific parameters to the business server when the target specific parameters are obtained based on the target user code and the parameters to be configured, and to send the parameter values ​​of the target global parameters corresponding to the names of the parameters to be configured to the business server when the target specific parameters are not obtained based on the target user code and the parameters to be configured.

[0032] In a possible implementation of the second aspect, the business server is further configured to obtain a target user code and the parameters to be configured to be executed based on the service request, and store the target user code; the business server is further configured to, in response to executing the parameters to be configured, retrieve the stored target user code, and reassemble the target user code and the parameters to be configured to construct an identifier of the target-specific parameter;

[0033] The business server is further configured to request the configuration center server to determine the target specific parameters based on the identifier of the target specific parameters.

[0034] In a possible implementation of the second aspect, after the user logs in, the user terminal is configured to add the user token parameter to each service request issued by the user through the terminal before issuing the request; obtaining the target user code based on the service request includes:

[0035] Get the user token parameters based on the service request;

[0036] Parse the user token parameter to obtain the target user code.

[0037] In a possible implementation of the second aspect, the system further includes a database server, wherein the database server stores a plurality of data resources, each data resource corresponding to a connection related to the parameter configuration value;

[0038] The business server is further configured to obtain a target connection based on the configured parameters to be configured, and access a target data resource in the database server based on the target connection.

[0039] In a possible implementation of the second aspect above, the configuration center server includes a global configuration platform that can be accessed by all users and a user configuration platform specific to each user. The global parameters are defined in the global configuration platform, and the specific parameters of each user are defined in the user configuration platform corresponding to the user.

[0040] In a possible implementation of the second aspect, each user configuration platform includes a user-shared configuration sub-platform and a user-specific configuration sub-platform, wherein parameters in the user-shared configuration sub-platform can be read by all services of the user;

[0041] The proprietary parameters include the parameters defined in the user-shared configuration sub-platform for configuring the time zone and login token, and the parameters defined in the user-specific configuration sub-platform for configuring the user data source connection.

[0042] In a possible implementation of the second aspect, proprietary parameters are defined in the form of a user code as a prefix of the parameter name, and global parameters are defined in the form of a parameter name.

[0043] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the one or more processors in the electronic device, for executing the parameter configuration method in a multi-user scenario in any possible implementation of the first aspect above.

[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the parameter configuration method in a multi-user scenario in any possible implementation of the first aspect mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] FIG1 shows an application scenario diagram of a parameter configuration method in a multi-user scenario according to some embodiments of the present application;

[0046] FIG2 shows a structural block diagram of a parameter configuration system in a multi-user scenario according to some embodiments of the present application;

[0047] FIG3 shows a flowchart 1 of a parameter configuration method in a multi-user scenario according to some embodiments of the present application;

[0048] FIG4 shows a second flowchart of a parameter configuration method in a multi-user scenario according to some embodiments of the present application;

[0049] FIG5 shows a specific flow chart of a parameter configuration method in an application scenario according to some embodiments of the present application;

[0050] FIG6 shows a specific flow chart of a parameter configuration method in another application scenario according to some embodiments of the present application;

[0051] FIG7 shows a schematic structural diagram of an electronic device according to some embodiments of the present application;

[0052] FIG8 shows a schematic structural diagram of a system on chip (SOC) according to some embodiments of the present application. DETAILED DESCRIPTION

[0053] The present application is further described below with reference to specific embodiments and accompanying drawings. It should be understood that the illustrative embodiments of the present disclosure include, but are not limited to, parameter configuration methods, electronic devices, and storage media in multi-user scenarios. The specific embodiments described herein are intended solely to illustrate the present application and are not intended to limit the present application. Furthermore, for ease of description, the accompanying drawings only illustrate some, but not all, structures or processes relevant to the present application.

[0054] The following specific embodiments illustrate the implementation of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Although the description of the present application will be introduced in conjunction with the preferred embodiment, this does not mean that the features of this application are limited to this implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may be extended based on the claims of the present application. In order to provide an in-depth understanding of the present application, the following description will contain many specific details. The present application can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present application, some specific details will be omitted in the description. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other unless there is a conflict.

[0055] In a multi-tenant microservice system, configuration parameters are often used to drive system logic. These parameters typically include global and tenant-specific configuration parameters. However, some technical solutions make it difficult to implement tenant-level overriding of configuration parameters.

[0056] Figure 1 shows an application scenario provided by the present application. When the system is in use, the server 10 needs to set a parameter zoneId (hereinafter referred to as the time parameter) to control the display time of the user-side electronic device. Its default value is generally the UTC zero time zone. The existing tenant a is from China and hopes that the system time zone is East 8, and its corresponding time parameter value is Asia / Shanghai. Tenant b is from Japan and hopes that the system time zone is set to East 9, and its corresponding time parameter value is Asia / Tokyo. When two tenants use the system server 10, it is difficult for the server 10 to know which time zone the tenant wants. One current method is to hard-code the tenant's proprietary configuration in the code, for example: record the mapping relationship between the tenant account or name and the time zone, and determine the tenant's specific time zone through conditional judgment. However, using this coding method, code needs to be written frequently once the number of tenants changes, which will make the program error rate high and unstable, making the system more difficult to maintain.

[0057] Based on this, the embodiment of the present application also provides a new parameter configuration method or method in a multi-user scenario to solve the problems found in the above research process. The method of this embodiment defines user-specific parameters in the form of user code information. When using the configuration parameters, the system only needs to check whether there is an overloaded parameter for the current tenant (that is, a proprietary parameter whose name contains the user code information and the name of the parameter to be configured) based on the user code and the name of the parameter to be configured. If the overloaded parameter exists, the parameter value of the overloaded parameter is used to assign a value to the parameter to be configured. If the overloaded parameter does not exist, the parameter value of the global parameter corresponding to the name of the parameter to be configured is used to configure the parameter to be configured. The method provided by this application can realize tenant-level overloading of configuration parameters without modifying the code, which greatly simplifies the difficulty of configuration parameter management.

[0058] According to the parameter configuration method in a multi-user scenario of an embodiment of the present application, it is used for a system including a user terminal, a configuration center server and a business server, wherein the configuration center server stores global parameters and proprietary parameters whose names include user code information. The parameter configuration method of this embodiment includes that the user terminal sends a service request to the business server, the business server obtains the target user code and the parameters to be configured based on the service request, and requests the configuration center server to determine the target proprietary parameters based on the target user code and the parameters to be configured. If the target proprietary parameters exist in the configuration center server, the configuration center server sends the parameter value of the target proprietary parameter to the business server, otherwise the configuration center server sends the parameter value of the target global parameter corresponding to the name of the parameter to be configured to the business server, and the business server configures the parameter to be configured based on the parameter value output by the configuration center server.

[0059] The above method can achieve tenant-level overloading of configuration parameters without modifying the code. When it is necessary to customize parameters for a tenant, you only need to add proprietary parameters containing user code information (for example, proprietary parameters can be in the form of {user code}.{parameter name}) to achieve parameter overloading, simplifying the difficulty of configuration management. At the same time, this method is applicable to any service system that needs to support multiple tenants and parameterize system logic. It can effectively achieve tenant-level overloading of configuration parameters and improve the flexibility and maintainability of the system. When there are parameter changes, you only need to maintain the global parameters and the overloaded parameters of each tenant. The service system can obtain the latest configuration without any modification, which greatly reduces maintenance costs.

[0060] In some embodiments of the present application, the step of determining the target-specific parameters includes: the business server obtains the target user code and the parameters to be configured to be executed based on the service request, and stores the target user code; the business server responds to executing the parameters to be configured, retrieves the stored target user code, and recombines the target user code and the parameters to be configured to construct an identification of the target-specific parameters; the business server requests the configuration center server to determine the target-specific parameters based on the above identification.

[0061] Specifically, the identifier of the target-specific parameter may be a definition name of the target-specific parameter, which may be expressed in the form of {target user code}.{name of the parameter to be configured}.

[0062] For the convenience of explanation, the technical solution of the present application is further described in detail below in conjunction with specific embodiments.

[0063] As shown in Figure 2, an embodiment of the present application provides a parameter configuration system including a user terminal 100, a configuration center server 200, a business server 300 and a database server 400. The configuration center server 200 stores global parameters and proprietary parameters, wherein global parameters are defined in the form of parameter names, and proprietary parameters are defined in the form of user codes as prefixes of parameter names, that is, in the form of "user code.parameter name".

[0064] In some embodiments, all parameters are centrally managed in the configuration center server 200. Global parameters are accessible to all users and are defined within the global configuration platform of the configuration center server 200. The global configuration platform includes a global shared configuration sub-platform and at least one global private configuration sub-platform. Parameters within the global shared configuration sub-platform are accessible to all services in the cluster, while parameters within a global private configuration sub-platform are accessible only to the corresponding individual service. Specifically, the global shared configuration sub-platform can be named public->platform, and the global private configuration sub-platform can be named app->platform.

[0065] Generally speaking, time zone configuration parameters for globally customized time zones, such as {zoneId}, and token parameters for globally customized login tokens, such as {token}, are stored in the global shared configuration sub-platform. Parameters used to configure global data source connection information (for example, jdbc.url and jdbc.user, which are specific to the current service) are stored in the global dedicated configuration sub-platform and can only be read by the corresponding service.

[0066] In some embodiments, proprietary parameters are parameters that are limited to each tenant, and can also be called tenant-level parameters, which are stored in the user configuration platform of the configuration center server 200. Proprietary parameters are prefixed with user codes so that they can be identified as tenant-level parameters by the program. The user configuration platform includes a user-shared configuration sub-platform and a user-specific configuration sub-platform. Proprietary parameters are stored in the user-shared configuration sub-platform and at least one user-specific configuration sub-platform respectively. Specifically, the name of the user-shared configuration sub-platform may contain user code information, which can be named public->{tenant code}, and the name of the user-specific configuration sub-platform also contains user code information, which is app->{tenant code}. That is, each user corresponds to his own set of configuration platforms and microservice clusters.

[0067] Parameters in the user-shared configuration sub-platform can be read by all of the user's services, including time zone configuration parameters for tenant-defined time zones: {tenant code}.{zoneId}, and token parameters for tenant-defined login tokens: {tenant code}.{token}. The user-specific configuration sub-platform can only be read by its corresponding service. Parameters stored in it are often used to configure tenant data source connection information, such as {tenant code}.jdbc.url and {tenant code}.jdbc.user, which are specifically used to configure parameter information for the current tenant of the current service.

[0068] In some embodiments, the user terminal 100 is used to send a service request to the business server 300, and the business server 300 is used to obtain the target user code and parameters to be configured based on the service request, and request the configuration center server 200 to determine the target proprietary parameters based on the target user code and parameters to be configured, and configure the parameters to be configured based on the parameter values ​​output by the configuration center server 200.

[0069] When target-specific parameters are acquired in the configuration center server 200 based on the target user code and the parameters to be configured, the configuration center server 200 sends the parameter values ​​of the target-specific parameters to the service server 300 so that the service server 300 configures the parameters to be configured according to the parameter values ​​of the target-specific parameters.

[0070] In the case where the target-specific parameters are not obtained in the configuration center server 200 based on the target user code and the parameters to be configured, the configuration center server 200 sends the parameter value of the target global parameter corresponding to the name of the parameter to be configured to the business server 300, so that the business server 300 configures the parameter to be configured according to the parameter value of the global parameter.

[0071] For example, tenant a sends a request to a specific service, during which the parameter file.s3client.accessKey to be configured is used. The configuration center server 200 will first take the parameter value of the parameter named a.file.s3client.accessKey and send it to the business server 300 for use. If the above parameter cannot be obtained, the configuration center server 200 will take the parameter value of the global parameter named file.s3client.accessKey and send it to the business server 300.

[0072] In some embodiments, various data resources are stored in the database server 400, and each data resource corresponds to a connection related to the parameter configuration value; when the business server 300 obtains the parameter value output by the configuration center server 200, it will obtain the corresponding target connection based on the parameter value, and access the target data resource in the database server 400 based on the target connection.

[0073] In some embodiments, the business server 300 includes a code editing layer and a data persistence layer. The code logic layer is used to implement the overall business logic. For example, after obtaining parameter value data output by the configuration center server 200, the code logic layer performs operations such as parsing and verification on this data. The data persistence layer is mainly used to solidify and store data.

[0074] In some embodiments, after the user logs in, the user terminal 100 is configured to add the user token parameter of the user to each service request sent by the user through the terminal before sending it out, wherein the user token parameter includes the user code information.

[0075] That is, after a tenant logs in to their domain name on the user terminal 100, any request sent from the user terminal 100 must carry the tenant token information. This allows the backend service cluster (i.e., the business server 300) that receives the service request to identify the specific tenant's user code by parsing the token and store it in the application context. This allows the business server 300 to retrieve the user code and request the configuration center to obtain the corresponding target-specific parameter values ​​when encountering other parameter usage during program execution. This helps save program runtime.

[0076] In some embodiments, the user terminal 100 may provide a user interaction interface to implement functions such as issuing service requests. For example, these functions may be implemented by a software installed on the user terminal 100. Exemplarily, the user terminal 100 may be a device with a display screen, including but not limited to a desktop computer, a portable computer, a PDA, a mobile phone, a tablet computer, etc.

[0077] In some embodiments, the configuration center server 200 and the business server 300 can be standalone servers or cloud servers. Standalone servers possess all the software and hardware resources of a full server and can independently allocate and implement various network function services, such as independently storing application data and configuration data for microservices. Furthermore, cloud servers can be hardware servers or embedded in a virtualized environment. For example, a cloud server can be a virtual machine executing on a hardware server that includes one or more other virtual machines.

[0078] In some embodiments, the parameter configuration system provided by the present application includes, in addition to the various devices shown in FIG2 , a code management device for storing code data for various services. Thus, the user terminal 100 can obtain the code data for each service from the code management device.

[0079] This application achieves tenant isolation by defining tenant-specific parameters using the "{tenant code}.{parameter name}" format. When configuring a parameter, simply specify the parameter name. The system automatically checks whether a specific parameter exists for the current tenant's user code. If so, it prioritizes that parameter over the global parameter. This approach allows tenant-level overriding of configuration parameters without requiring code modifications, significantly simplifying configuration parameter management.

[0080] At the same time, by adopting the principle of tenant isolation, each tenant can build their own service cluster and dedicated platform with their own set of proprietary parameter configurations. Key proprietary configuration parameters include {tenant code}.{zoneId} for customizing the tenant's time zone, {tenant code}.{token} for customizing the tenant's login token, {tenant code}.{jdbc.*} for customizing the tenant's database connection, and the tenant's own platform domain name, such as https: / / {tenant code}-gi-dev.insuremo.com / ui / admin / # / . After a tenant logs in to their domain name, any request sent from their user terminal 100 must include the tenant token. The backend service cluster parses the token to identify the specific user code and stores it in the application context. During program execution, when a parameter is used, proprietary parameters prefixed with the tenant code are prioritized. If no such parameters exist, global parameters are used. This means that by overriding tenant-specific parameters, the application can achieve domain and database isolation, enabling each tenant to securely and accurately manage their own data within the same service cluster and code.

[0081] 3 , an exemplary description is given of a parameter configuration method in a multi-user scenario provided by an embodiment of the present application and applicable to the parameter configuration system.

[0082] As shown in FIG3 , the parameter configuration method provided in the embodiment of the present application includes the following steps:

[0083] Step S101 : the user terminal 100 sends a service request to the service server 300 .

[0084] Specifically, after the user logs in, the user terminal 100 is configured to add the user token parameter of the user to each service request sent by the user through the terminal before sending it out, and the user token parameter includes the information of the user code.

[0085] That is, after the tenant logs in to his own domain name on the user terminal 100, any request sent from the user terminal 100 needs to carry the tenant token information, so that the back-end service cluster (i.e., the business server 300) that receives the service request can identify the specific tenant's user code by parsing the token and store it in the application context. This makes it convenient for the business server 300 to request the configuration center to obtain the parameter value of the target proprietary parameter corresponding to the user code by calling the user code stored in the application context when encountering other places where parameters are used during the execution of the program, thereby saving program running time.

[0086] As you can understand, the tenant token value can be used to determine the user's login status. The token is similar to a long encrypted string, which serves as a "token" for client requests. After the user successfully logs in, the server generates a unique value based on the user information. This value is the token value. Each token value corresponds to unique user information, so the token value can be used to resolve the user code.

[0087] When a user successfully logs in for the first time using their account and password, the server generates a token and returns it to the client. If the user successfully logs in, the client will use this token to request data in the future.

[0088] Step S102: the service server 300 obtains the target user code and the parameters to be configured based on the service request, and requests the configuration center server 200 to determine the target specific parameters based on the target user code and the parameters to be configured.

[0089] Referring to FIG. 4 , in some embodiments, step S102 may specifically include:

[0090] Step S1021: the service server 300 obtains the target user code and the configuration parameters to be executed based on the service request, and stores the target user code.

[0091] Since each service request issued by the user terminal 100 is added with a user token (generally speaking, the request will carry a token in its request header), after the business server 300 receives the service request sent by the user terminal 100, the business server 300 can first obtain the user token through the service request, and then parse the user token to obtain the user code of the current user corresponding to the service request (i.e., the target user code).

[0092] Step S1022: In response to executing the parameters to be configured, the business server 300 retrieves the target user code stored therein and recombines the target user code and the parameters to be configured to construct an identifier of the target-specific parameters, wherein the above identifier can be used to obtain the target-specific parameters from the configuration center server 200.

[0093] Specifically, the business server 300 parses the user token to identify the tenant's specific user code and stores it in the application context. During program execution, if the business server 300 encounters other places where parameters are used, it will first retrieve the user code stored in the program context, saving program execution time. After obtaining the user code from the program context, the business server 300 reconstructs the identifier of the target-specific parameter based on the user code and the parameters to be configured, and then obtains the target-specific parameter from the configuration center server 200.

[0094] As you can understand, program context is like a storage module that contains configuration information for program execution parameters. In other words, context can be understood as the background environment for program execution, containing all the information required by the program at a specific moment. This information can include variable values, function calls, execution locations, and so on.

[0095] In some embodiments, proprietary parameters are defined in the form of a user code as a prefix of the parameter name, and global parameters are defined in the form of a parameter name. For example, the name of the proprietary parameter is: user code.parameter name, and the global parameter is directly named with its parameter name; at this time, the identifier of the target proprietary parameter constructed based on the user code and the parameter to be configured can be expressed in the form of {target user code}.{parameter name to be configured}.

[0096] Step S1023: the service server 300 requests the configuration center server 200 to determine the target-specific parameters based on the identifier of the target-specific parameters.

[0097] Step S103: Determine whether the target-specific parameter exists in the configuration center server 200. That is, determine whether the parameter named "{target user code}.{name of parameter to be configured}" exists in the configuration center server 200.

[0098] Specifically, in the case where the target-specific parameters are obtained in the configuration center server 200 based on the target user code and the parameters to be configured (that is, the above-mentioned target-specific parameters are stored in the configuration center server 200, that is, the answer to step S103 is yes), step S104 is executed: the configuration center server 200 sends the parameter value of the target-specific parameter to the business server 300.

[0099] If the target specific parameters are not obtained in the configuration center server 200 based on the target user code and the parameters to be configured (step S103 is no), step S105 is executed: the configuration center server 200 sends the parameter value of the target global parameter corresponding to the parameter name to be configured to the business server 300.

[0100] In other words, the business server 300 will first request the configuration center server 200 to check whether the target tenant's overload parameters, that is, the proprietary parameters named {target user code}.{name of parameter to be configured}, exist in the configuration center server 200. If not, it will further obtain the global parameters named {name of parameter to be configured}.

[0101] According to the specific business logic, when using parameters, the configuration center server 200 will try to obtain the parameter value prefixed with the target tenant code according to the specific parameter name of the parameter to be configured, that is, the value of the parameter named {target user code}.{name of parameter to be configured}. If it cannot be obtained, it is considered that the tenant has not overloaded the current parameter, and the value of the parameter named {name of parameter to be configured} will be taken to continue the execution of the program.

[0102] In other words, the program first adds the prefix {target tenant code}. to the name of the parameter to be configured according to the tenant code stored in the context to construct the identifier of the target proprietary parameter, and then obtains the proprietary parameter with the identifier name from the configuration center server 200 to continue execution. If it cannot be obtained, it obtains the parameter value of the global parameter with the name of the parameter to be configured to continue execution.

[0103] For example, if tenant a sends a request to a specific service and uses the file.s3client.accessKey parameter, the program will prioritize the value of the parameter named a.file.s3client.accessKey. Otherwise, it will prioritize the value of the parameter named file.s3client.accessKey.

[0104] Step S106 : the service server 300 configures the parameters to be configured based on the parameter values ​​output by the configuration center server 200 .

[0105] The method of this embodiment adopts the principle of tenant isolation. Each tenant has its own set of overloaded configurations to build a service cluster and exclusive platform belonging to the tenant. Several key configuration parameters include {tenant code}.{zoneId}, tenant-defined time zone, {tenant code}.{token}, tenant-defined login token, {tenant code}.{jdbc.*}, tenant-defined database connection, and the tenant's own platform domain name, for example: https: / / {tenant code}-gi-dev.insuremo.com / ui / admin / # / , etc. After the tenant logs in to his own domain name, any request sent from the platform interface needs to carry the tenant token. The back-end service cluster identifies the specific tenant by parsing the token and stores it in the application context. During the execution of the program, when encountering other places where parameters are used, the parameters with the tenant code prefix will be given priority. If it does not exist, the global parameters will be used.

[0106] The core idea of ​​tenant isolation is to isolate domain names and databases by overloading tenant parameters, thereby enabling tenants to manage their own data securely and accurately within the same service cluster and code.

[0107] FIG5 is a schematic diagram showing a parameter configuration process of a specific application embodiment of the present application.

[0108] Tenant a and tenant b each send a service request to the business server through the user interface on the user terminal, requesting a connection to their data source. After receiving the service requests from tenant a and tenant b, the business server parses each service request and obtains the user code in each service request (taking tenant a's user code as a, tenant b's user code as b, and the parameter to be configured as config_center_url as an example). The microservice cluster corresponding to tenant a stores user code a in its corresponding program context, and the microservice cluster corresponding to tenant b stores user code b in its corresponding program context. During program execution, the service corresponding to tenant a has the parameter to be configured, prefixed with a, for example, the config_center_url parameter, i.e., a.config_center_url. During program execution, the service corresponding to tenant b has the parameter to be configured, prefixed with b, for example, the config_center_url parameter, i.e., b.config_center_url. The configuration center server reads the parameters named a.config_center_url and b.config_center_url, respectively, and outputs the parameter value of a.config_center_url to the microservice cluster of tenant a, and the parameter value of b.config_center_url to the microservice cluster of tenant b. After receiving the parameter value output by the configuration center, the logic code layer of tenant a's microservice cluster obtains the data connection corresponding to the parameter value in the data persistence layer and then accesses its corresponding tenant database a based on this data connection. Similarly, after receiving the parameter value output by the configuration center, the logic code layer of tenant b's microservice cluster obtains the data connection corresponding to the parameter value in the data persistence layer and then accesses its corresponding tenant database b based on this data connection.

[0109] That is, tenant-specific parameters are defined using the "{tenant code}.{parameter name}" format, achieving tenant isolation. This allows each tenant to build their own service cluster and dedicated platform based on their own set of proprietary parameter configurations. When the business server encounters parameters while executing service requests sent by tenant user terminals, it will prioritize proprietary parameters prefixed with the tenant's corresponding user code to overload the tenant's proprietary parameters, thereby isolating domain names and databases. This allows each tenant to securely and accurately manage their own data within the same service cluster and code.

[0110] FIG6 shows a schematic diagram of a parameter configuration process of another specific application embodiment of the present application.

[0111] Tenant C sends a service request for file storage to the business server through the operation interface on the user terminal. After receiving the service request from tenant C, the business server parses the service request separately and obtains the user code c in the service request (taking the parameter noun to be configured as file.s3client.accessKey as an example). The microservice group of tenant C stores the user code c in the program context corresponding to each request.

[0112] When the service encounters the parameter file.s3client.accessKey to be configured during program execution, the microservice cluster adds c as a prefix to the parameter name file.s3client.accessKey to form c.file.s3client.accessKey, and reads the parameter named c.file.s3client.accessKey from the configuration center server. The configuration center server prioritizes obtaining the parameter value of c.file.s3client.accessKey. If obtained, it outputs the parameter value of c.file.s3client.accessKey to the microservice cluster of tenant c. After the logic code layer of the microservice cluster of tenant c receives the parameter value output by the configuration center, it obtains the data connection corresponding to the parameter value in the data persistence layer, and then accesses the tenant database based on the data connection.

[0113] If the configuration center does not obtain the parameter value for c.file.s3client.accessKey, it further obtains the parameter value for file.s3client.accessKey and outputs the obtained parameter value. After receiving the parameter value output by the configuration center, the logic code layer of tenant c's microservice cluster obtains the data connection corresponding to the parameter value in the data persistence layer and then accesses the corresponding public database based on the data connection.

[0114] This approach allows tenant-specific parameters to be defined using the "{tenant code}.{parameter name}" format, allowing tenant-level overriding of configuration parameters. When using a configuration parameter, simply specify the parameter name, and the system will automatically check whether a specific parameter corresponding to the current tenant's user code exists. If so, that specific parameter is used first; otherwise, the global parameter is used. This solution allows tenant-level overriding of configuration parameters without requiring code modifications, significantly simplifying configuration parameter management. For example, when customizing parameters for a particular tenant, simply add a specific parameter prefixed with the user code to implement parameter overriding, simplifying configuration management.

[0115] This parameter configuration method is applicable to any service system that needs to support multiple tenants and parameterize system logic. It effectively implements tenant-level reloading of configuration parameters, improving system flexibility and maintainability. When parameter changes occur, only the global parameters and the reloaded parameters for each tenant need to be maintained. The service system can obtain the latest configuration without any modification, greatly reducing maintenance costs.

[0116] Referring now to FIG7 , a block diagram of an electronic device 1400 is shown, in accordance with one embodiment of the present application. FIG7 schematically illustrates an example electronic device 1400, in accordance with various embodiments. In one embodiment, the electronic device 1400 may include one or more processors 1404, system control logic 1408 coupled to at least one of the processors 1404, system memory 1412 coupled to the system control logic 1408, non-volatile memory (NVM) 1416 coupled to the system control logic 1408, and a network interface 1420 coupled to the system control logic 1408.

[0117] In some embodiments, the processor 1404 may include one or more single-core or multi-core processors. In some embodiments, the processor 1404 may include any combination of general-purpose processors and specialized processors (e.g., graphics processors, application processors, baseband processors, etc.). In embodiments where the electronic device 1400 employs an enhanced base station (eNB) 101 or a radio access network (RAN) controller 102, the processor 1404 may be configured to execute various embodiments, for example, as shown in FIG2 or 6.

[0118] In some embodiments, system control logic 1408 may include any suitable interface controller to provide any suitable interface to at least one of processors 1404 and / or any suitable device or component in communication with system control logic 1408 .

[0119] In some embodiments, the system control logic 1408 may include one or more memory controllers to provide an interface to the system memory 1412. The system memory 1412 may be used to load and store data and / or instructions. In some embodiments, the memory 1412 of the electronic device 1400 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

[0120] NVM / memory 1416 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM / memory 1416 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a hard disk drive (HDD), a compact disc (CD) drive, and a digital versatile disc (DVD) drive.

[0121] NVM / storage 1416 may include a portion of storage resources on the device on which electronic device 1400 is installed, or it may be accessible to the device but not necessarily part of the device. For example, NVM / storage 1416 may be accessed over a network via network interface 1420.

[0122] In particular, system memory 1412 and NVM / storage 1416 may include, respectively, a temporary copy and a permanent copy of instructions 1424. Instructions 1424 may include instructions that, when executed by at least one of processors 1404, cause electronic device 1400 to implement the method illustrated in FIG. 2 or 6 . In some embodiments, instructions 1424, hardware, firmware, and / or software components thereof may additionally or alternatively reside in system control logic 1408, network interface 1420, and / or processor 1404.

[0123] The network interface 1420 may include a transceiver for providing a radio interface for the electronic device 1400, thereby communicating with any other suitable devices (such as a front-end module, an antenna, etc.) via one or more networks. In some embodiments, the network interface 1420 may be integrated with other components of the electronic device 1400. For example, the network interface 1420 may be integrated with at least one of the processor 1404, the system memory 1412, the NVM / storage 1416, and a firmware device (not shown) having instructions. When at least one of the processors 1404 executes the instructions, the electronic device 1400 implements the method shown in Figures 2 or 6.

[0124] The network interface 1420 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 1420 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.

[0125] In one embodiment, at least one of the processors 1404 may be packaged together with logic for one or more controllers of the system control logic 1408 to form a system-in-package (SiP). In one embodiment, at least one of the processors 1404 may be integrated on the same die with logic for one or more controllers of the system control logic 1408 to form a system-on-chip (SoC).

[0126] Electronic device 1400 may further include an input / output (I / O) device 1432. I / O device 1432 may include a user interface that enables a user to interact with electronic device 1400; peripheral component interfaces may also be designed to enable peripheral components to interact with electronic device 1400. In some embodiments, electronic device 1400 may further include a sensor for determining at least one of environmental conditions and location information related to electronic device 1400.

[0127] In some embodiments, the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard. For example, the display may display a management and control service interface that supports viewing basic configuration parameters for each service and triggering configuration of basic configuration parameters for each service.

[0128] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.

[0129] In some embodiments, the sensors may include, but are not limited to, a gyroscope sensor, an accelerometer, a proximity sensor, an ambient light sensor, and a positioning unit. The positioning unit may also be part of or interact with the network interface 1420 to communicate with components of a positioning network (e.g., Global Positioning System (GPS) satellites).

[0130] Referring now to FIG8 , a block diagram of a system on chip (SoC) 500 according to one embodiment of the present application is shown. In FIG8 , similar components have the same reference numerals. Additionally, dashed boxes are optional features of more advanced SoCs. In FIG8 , SoC 500 includes: an interconnect unit 550 coupled to a processor 510; a system agent unit 580; a bus controller unit 590; an integrated memory controller unit 540; a set or one or more coprocessors 520, which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 530; and a direct memory access (DMA) unit 560. In one embodiment, the coprocessors 520 include specialized processors, such as, for example, network or communication processors, compression engines, general-purpose computing on graphics processing units (GPGPUs), high-throughput M-chip processors, or embedded processors.

[0131] Static random access memory (SRAM) unit 530 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. The computer-readable storage medium stores instructions, specifically, temporary and permanent copies of the instructions. The instructions may include instructions that, when executed by at least one of the processors, cause the SoC to implement the method shown in FIG. 3 or FIG. 4 . When executed on a computer, the instructions cause the computer to perform the method disclosed in the above embodiments.

[0132] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0133] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.

[0134] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0135] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.

Claims

1. A parameter configuration method in a multi-user scenario, characterized in that: A system including a user terminal, a configuration center server and a business server, wherein the configuration center server stores global parameters and proprietary parameters, and the name of the proprietary parameter includes user code information; the method includes: The user terminal sends a service request to the service server; The business server obtains a target user code and parameters to be configured based on the service request, and requests the configuration center server to determine target-specific parameters based on the target user code and the parameters to be configured; In the case where the target-specific parameter is acquired in the configuration central server based on the target user code and the parameter to be configured, the configuration central server sends the parameter value of the target-specific parameter to the business server; In the case where the target specific parameter is not obtained in the configuration central server based on the target user code and the parameter to be configured, the configuration central server sends the parameter value of the target global parameter corresponding to the name of the parameter to be configured to the business server; The business server configures the parameter to be configured based on the parameter value output by the configuration center server.

2. The method according to claim 1, characterized in that Requesting the configuration center server to determine target specific parameters based on the target user code and the parameters to be configured includes: The business server acquires the target user code and the to-be-configured parameters to be executed based on the service request, and stores the target user code; In response to executing the parameter to be configured, the service server retrieves the target user code stored therein, and recombines the target user code and the parameter to be configured to construct an identifier of the target-specific parameter; The business server requests the configuration center server to determine the target-specific parameter based on the identifier of the target-specific parameter.

3. The method according to claim 1 or 2, characterized in that The service request includes a user token parameter of the logged-in user, and obtaining a target user code based on the service request includes: Obtaining a user token parameter of the user based on the service request; Parse the user token parameters to obtain the target user code.

4. The method according to claim 1, characterized in that The system further includes a database server, wherein the database server stores a plurality of data resources, each of the data resources corresponding to a connection related to a parameter configuration value; the method further includes: The business server obtains a target connection based on the configured parameters to be configured, and accesses a target data resource in the database server based on the target connection.

5. The method according to claim 1, characterized in that The configuration center server includes a global configuration platform accessible by all users and a user configuration platform specific to each user, wherein the global parameters are defined in the global configuration platform, and the specific parameters of each user are defined in the user configuration platform corresponding to the user.

6. The method according to claim 5, characterized in that Each of the user configuration platforms includes a user shared configuration sub-platform and a user dedicated configuration sub-platform, wherein the parameters in the user shared configuration sub-platform can be read by all services of the user; The proprietary parameters include parameters defined in the user shared configuration sub-platform for configuring time zones and login tokens, and parameters defined in the user dedicated configuration sub-platform for configuring user data source connections.

7. The method according to claim 1, characterized in that The proprietary parameters are defined in the form of a user code as a prefix of the parameter name, and the global parameters are defined in the form of a parameter name.

8. A parameter configuration system in a multi-user scenario, characterized in that: Including user terminals, configuration center servers and business servers, The user terminal is used to send a service request to the service server; The business server is used to obtain a target user code and parameters to be configured based on the service request, and request the configuration center server to determine target-specific parameters based on the target user code and the parameters to be configured, and configure the parameters to be configured based on the parameter values ​​output by the configuration center server; The configuration center server is used to, in a case where the target-specific parameter is acquired based on the target user code and the parameter to be configured, send the parameter value of the target-specific parameter to the business server, and, in a case where the target-specific parameter is not acquired based on the target user code and the parameter to be configured, send the parameter value of the target global parameter corresponding to the name of the parameter to be configured to the business server.

9. An electronic device, characterized in that: include: A memory for storing instructions executed by one or more processors of the electronic device, and the processor, which is one of the one or more processors in the electronic device, is used to execute the method described in any one of claims 1-7.

10. A readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Application environment setting method, terminal, server and system

    CN102325195A

  • Method used for establishing special bearing for designated terminal

    CN106341851A

  • Vehicle personal configuration adjustment system and method

    CN106897310A

  • Page information individualization processing method, device and system

    CN108153788A

  • Method and device for data configuration

    CN109547258A