Parameter conversion method, device, apparatus, computer storage medium and program product

By receiving configuration modification instructions for the target conversion code and adjusting the conversion type and/or conversion parameters in the conversion configuration rules, the problem of inflexible parameter conversion methods in the existing technology is solved, achieving efficient and flexible parameter conversion and improving overall conversion efficiency and business processing performance.

CN119271300BActive Publication Date: 2025-12-26CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411373982.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-12-26
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

The existing parameter conversion method requires code modification when conversion conditions change, resulting in a large workload, low efficiency, and inflexibility.

Method used

By receiving configuration modification instructions for the target conversion code, the conversion type and/or conversion parameters in the conversion configuration rules can be adjusted, enabling flexible configuration modification of the parameter conversion method and avoiding code modification and deployment testing.

Benefits of technology

It enables efficient and flexible configuration and modification of parameter conversion methods, improving overall parameter conversion efficiency and business processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271300B_ABST
    Figure CN119271300B_ABST
Patent Text Reader

Abstract

The application discloses a parameter conversion method and device, equipment, computer storage medium and program product, and relates to the technical field of big data. The method comprises the following steps: receiving a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, a target service type of the first target parameter and the target conversion code having a mapping relationship, and the configuration modification instruction being used for indicating that a parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode; in response to the configuration modification instruction, adjusting a conversion type and / or a conversion parameter set by a first conversion configuration rule in N conversion configuration rules to obtain a second conversion configuration rule; and converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules which have not been subjected to configuration modification to obtain a second target parameter. According to the embodiment of the application, the configuration modification of the parameter conversion mode and the parameter conversion can be efficiently realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of big data, and particularly relates to a parameter conversion method and device, equipment, computer storage medium and program product. BACKGROUND

[0002] Currently, parameter conversion is often required in various business docking scenarios. The parameter conversion realizes the function of converting parameters from one expression form to another expression form. However, the existing parameter conversion method has the following defects: when the conversion condition changes, for example, if the request parameter name is modified, or the conversion method needs to be adjusted, the code processing needs to be modified according to the new conversion condition, which requires a large amount of manpower and is low in parameter maintenance efficiency. Therefore, there are problems such as inflexible parameter conversion implementation, large workload and long time consumption.

[0003] Therefore, the industry still urgently needs a new parameter conversion scheme to achieve efficient and flexible configuration modification of the parameter conversion method and parameter conversion. SUMMARY

[0004] The embodiments of the present application provide a parameter conversion method, device, equipment, computer storage medium and program product, which can more efficiently and flexibly realize configuration modification of the parameter conversion method and parameter conversion, thereby effectively improving the overall parameter conversion efficiency under different business requirements and improving the business processing efficiency.

[0005] In a first aspect, the embodiments of the present application provide a parameter conversion method, which comprises:

[0006] receiving a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, there being a mapping relationship between a target business type of the first target parameter and the target conversion code, and the configuration modification instruction being used to indicate that a parameter conversion method defined by the target conversion code is modified from an initial conversion method to a target conversion method;

[0007] adjusting a conversion type and / or a conversion parameter set by at least one first conversion configuration rule of N conversion configuration rules corresponding to the target conversion code in response to the configuration modification instruction, to obtain a second conversion configuration rule after configuration modification; wherein each conversion configuration rule of the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer;

[0008] converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, to obtain a second target parameter conforming to the target conversion method.

[0009] In some possible implementation manners, before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the parameter conversion method further includes:

[0010] receiving a plurality of preset conversion codes and a mapping relationship between the plurality of preset conversion codes and a plurality of service categories, the plurality of preset conversion codes including the target conversion code, and the plurality of preset conversion codes respectively defining different parameter conversion manners;

[0011] In some possible implementation manners, before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the parameter conversion method further includes:

[0012] receiving a parameter conversion request of the first target parameter, the parameter conversion request including the first target parameter and a target field, the target field being used to indicate that a service category of the first target parameter is a target service type;

[0013] determining, based on the mapping relationship between the plurality of preset conversion codes and the plurality of service categories, the target conversion code that has a mapping relationship with the target service type.

[0014] In some possible implementation manners, before converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules that have not been subjected to configuration modification, to obtain the second target parameter conforming to the target conversion manner, the parameter conversion method further includes:

[0015] obtaining M global conversion configuration rules corresponding to the first target parameter, M being a positive integer;

[0016] converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules that have not been subjected to configuration modification, to obtain the second target parameter conforming to the target conversion manner, including:

[0017] converting the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules that have not been subjected to configuration modification, to obtain the second target parameter.

[0018] In some possible implementation manners, converting the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules that have not been subjected to configuration modification, to obtain the second target parameter, includes:

[0019] sorting the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules that have not been subjected to configuration modification, to obtain a configuration execution order of the conversion configuration rules;

[0020] According to the configuration execution sequence, the loop configuration of the fields in the first target parameter is started according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, and the second target parameter is obtained.

[0021] In some possible implementation manners, before the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified to obtain the second target parameter conforming to the target conversion mode, the parameter conversion method further includes:

[0022] The basic data type of the first target parameter is converted from the first data type to the second data type, the first data type is an initial data type when the first target parameter is an input parameter, and the second data type is a data type easy for machine parsing;

[0023] After the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified to obtain the second target parameter conforming to the target conversion mode, the parameter conversion method further includes:

[0024] The basic data type of the second target parameter is converted from the second data type to the first data type, and the second target parameter of the second data type is output.

[0025] In some possible implementation manners, the conversion type includes at least one of an enumeration conversion type, a regular conversion type, a copy conversion type, a constant conversion type, a Bean conversion type, and a Spring Expression Language (Spel) conversion type.

[0026] In a case where the conversion type is the enumeration conversion type, a value of the corresponding conversion parameter is configured as a value of the target dictionary;

[0027] In a case where the conversion type is the regular conversion type, one of the corresponding conversion parameters is configured as a regular expression, and a value of the other corresponding conversion parameter is configured as a replaced value;

[0028] In a case where the conversion type is the copy conversion type, a value of the corresponding conversion parameter is configured as a copy path of the parameter;

[0029] In a case where the conversion type is the constant conversion type, a value of the corresponding conversion parameter is a target constant;

[0030] In a case where the conversion type is the Bean conversion type, a value of the corresponding conversion parameter is a name of a Bean;

[0031] In a case where the conversion type is the Spel conversion type, a value of the corresponding conversion parameter is a Spel expression.

[0032] In some possible implementation manners, in response to the configuration modification instruction, the conversion type and / or the conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code are adjusted to obtain a second conversion configuration rule after the configuration modification.

[0033] The conversion type and / or the conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code are adjusted by calling an interface of at least one of the conversion parameter conversion class, the conversion type conversion class of the whether native conversion class, to obtain a second conversion configuration rule after the configuration modification.

[0034] In some possible implementation manners, the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules that are not subjected to the configuration modification, to obtain a second target parameter that conforms to the target conversion mode.

[0035] The second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules that are not subjected to the configuration modification are obtained from the Nacos service management platform.

[0036] The first target parameter is converted based on the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules that are not subjected to the configuration modification, to obtain the second target parameter.

[0037] Based on the same inventive concept, in a second aspect, embodiments of the present application provide a parameter conversion device, which comprises:

[0038] The first receiving module is configured to receive a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, a target service type of the first target parameter and the target conversion code having a mapping relationship, and the configuration modification instruction being used to instruct to modify a parameter conversion mode defined by the target conversion code from an initial conversion mode to a target conversion mode.

[0039] The first adjusting module is configured to, in response to the configuration modification instruction, adjust the conversion type and / or the conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after the configuration modification; wherein each conversion configuration rule of the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer.

[0040] The first conversion module is configured to convert the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules that are not subjected to the configuration modification, to obtain a second target parameter that conforms to the target conversion mode.

[0041] In a third aspect, an embodiment of the present application provides a parameter conversion device, the parameter conversion device comprising:

[0042] a processor and a memory storing computer program instructions;

[0043] The processor implements the parameter conversion method provided in any one of the embodiments of the present application when executing the computer program instructions.

[0044] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores computer program instructions. The computer program instructions are executed by a processor to implement the parameter conversion method provided in any one of the embodiments of the present application.

[0045] In a fifth aspect, an embodiment of the present application provides a computer program product, and instructions in the computer program product are executed by a processor of an electronic device to enable the electronic device to perform the parameter conversion method provided in any one of the embodiments of the present application.

[0046] The parameter conversion method, device, equipment, computer storage medium and program product provided in the embodiments of the present application, by receiving a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, there is a mapping relationship between the target service type of the first target parameter and the target conversion code, and the configuration modification instruction is used to indicate that the parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode. Then, in response to the configuration modification instruction, the conversion type and / or conversion parameter set by a first conversion configuration rule in N conversion configuration rules corresponding to the target conversion code are adjusted to obtain a second conversion configuration rule after configuration modification. In this way, the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules which are not configured to be modified, to obtain a second target parameter conforming to the target conversion mode.

[0047] As described above, the parameter conversion method, apparatus, device, computer storage medium, and program product of this application embodiment receive a configuration modification instruction corresponding to a target conversion code. This adjustment is achieved by modifying the conversion type and / or conversion parameters set in the conversion configuration rules under the target conversion code, thereby adjusting the parameter conversion method defined by the target conversion code. Finally, based on the various conversion configuration rules under the adjusted target conversion code, the first target parameter is converted, and the resulting second target parameter conforms to the required target conversion method. This application embodiment separates the modification points of the conversion parameters from the code to the conversion type and / or conversion parameters in the conversion configuration rules. Therefore, by simply modifying the conversion type and / or conversion parameters in the configuration rules, the parameter conversion method configuration modification takes effect in real time, achieving the requirement to modify the parameter conversion method without modifying the code or deploying tests. By adopting the parameter conversion method, apparatus, device, computer storage medium, and program product provided by this application embodiment, the configuration modification and parameter conversion of the parameter conversion method can be implemented more efficiently and flexibly, thereby effectively improving the overall parameter conversion efficiency under different business needs and enhancing business processing efficiency. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a schematic flowchart of a parameter conversion method provided in an embodiment of this application;

[0050] Figure 2 This is a flowchart illustrating a parameter conversion method provided in another embodiment of this application;

[0051] Figure 3 This is a schematic diagram of a scenario flow of a parameter conversion method provided in an embodiment of this application;

[0052] Figure 4 This is a schematic diagram of the structure of a parameter conversion device provided in an embodiment of this application;

[0053] Figure 5 This is a schematic diagram of the structure of a parameter conversion device provided in an embodiment of this application. Detailed Implementation

[0054] The features and exemplary embodiments of the various aspects of the present application will be described in detail below with reference to the drawings. The following detailed description is merely exemplary in nature and is not intended to limit the present application or the application and uses of the present application. Furthermore, there is no intention to be bound by any expressed or implied theory presented in the preceding technical field, background, brief summary or the following detailed description.

[0055] It should be noted that the relational terms herein, such as first and second, and the like, are used solely to distinguish one from another entity or action without necessarily requiring or implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0056] It should be noted that the acquisition, storage, use, processing, etc. of data in the technical solutions of the present application comply with relevant provisions of national laws and regulations.

[0057] It should be noted that in the embodiments of the present application, some existing industry solutions, such as software, components, models, etc. may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0058] As described in the background section, the existing parameter conversion method has the following defects: when the conversion condition changes, for example, if the request parameter name is modified, or the conversion method needs to be adjusted, the code processing needs to be modified according to the new conversion condition, which requires a large amount of manpower and low parameter maintenance efficiency, and thus there are problems such as inflexible parameter conversion implementation, large workload, and time-consuming.

[0059] In combination with a specific business processing scenario, a current common Java Web system development adopts an MVC mode, including a Controller (controller), a Service (service) and a Mapper (mapper) three-layer processing business logic. The Controller part is used to receive a request message, analyze the request message, convert the request message, check the request parameters, and then convert the response parameters according to the return result of the Service, and deserialize the response parameters. The Controller serializes the request message into a POJO, and if the request message needs to be converted, such as unified dictionary value, numerical value formatting, value replacement, etc. The general method is to use a tool class one by one in the method processing of the Controller. However, if the request parameter name is modified or the conversion is adjusted, the code needs to be modified.

[0060] The current technical implementation is completed by a hard coding mode. If the demand changes, the code needs to be modified, and then packaged and deployed to the environment, so as to enter the test stage. If it is a single service, multiple node deployment, more time is needed, and therefore the above parameter conversion mode has problems of inflexible implementation, large workload and long time consumption.

[0061] In view of the above, in order to solve the problems of the prior art, the embodiments of the present application provide a parameter conversion method, device, equipment, computer storage medium and program product. It should be noted that the embodiments provided by the present application are not used to limit the scope of the present application.

[0062] Firstly, the parameter conversion method provided by the embodiments of the present application is introduced.

[0063] Figure 1 A flowchart of a parameter conversion method provided by an embodiment of the present application is shown. The parameter conversion method is applied to an electronic device, which can include a server or a user terminal, etc. As shown in Figure 1 The parameter conversion method includes the following steps:

[0064] S110, receiving a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, there being a mapping relationship between a target business type of the first target parameter and the target conversion code, and the configuration modification instruction being used to indicate that the parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode;

[0065] S120, in response to the configuration modification instruction, adjusting the conversion type and / or the conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after the configuration modification; wherein each conversion configuration rule of the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer;

[0066] S130, converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules without the configuration modification of the N conversion configuration rules, to obtain a second target parameter conforming to the target conversion mode.

[0067] The parameter conversion method provided by the embodiment of the present application receives the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, wherein the configuration modification instruction is used to indicate that the parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode. In response to the configuration modification instruction, the conversion type and / or the conversion parameter set by the first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code is adjusted, to obtain a second conversion configuration rule after the configuration modification. Then, the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules without the configuration modification of the N conversion configuration rules, to obtain a second target parameter conforming to the target conversion mode.

[0068] As described above, the parameter conversion method provided by the embodiment of the present application receives the configuration modification instruction corresponding to the target conversion code, and adjusts the conversion type and / or the conversion parameter set in the conversion configuration rule under the target conversion code, to realize the adjustment of the parameter conversion mode defined by the target conversion code. Finally, the first target parameter is converted based on each conversion configuration rule under the adjusted target conversion code, and the second target parameter obtained by the conversion conforms to the required target conversion mode.

[0069] The embodiment of the present application separates the change point of the conversion parameter from the code to the conversion type and / or the conversion parameter of the conversion configuration rule, so that the real-time effect of the configuration modification of the parameter conversion mode is realized by simply modifying the conversion type and / or the conversion parameter in the configuration rule, and the modification requirement of the parameter conversion mode is realized without modifying the code and deploying the test. By using the parameter conversion method provided by the embodiment of the present application, the configuration modification of the parameter conversion mode and the parameter conversion can be more efficiently and flexibly realized, so that the overall parameter conversion efficiency under different business requirements and the business processing work efficiency can be effectively improved.

[0070] The specific implementation of the above steps 110 to 130 is described in detail below.

[0071] In S110, when implemented, a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code are received. There is a mapping relationship between the target service type of the first target parameter and the target conversion code. The configuration modification instruction is used to indicate that the parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode.

[0072] It should be noted that the receiving time of the first target parameter and the configuration modification instruction corresponding to the target conversion code can be different or the same, which is not strictly limited herein. The receiving channel of the first target parameter can be sent by a business platform mechanism, for example. The configuration modification instruction corresponding to the target conversion code can be input by a relevant configuration management personnel, and the present application does not make strict limitations thereon.

[0073] According to some embodiments of the present application, optionally, in order to more reasonably realize the acquisition of the first target parameter and more accurately determine the mapping relationship between the target conversion code and the target service type, before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the parameter conversion method can further include:

[0074] Receiving a plurality of preset conversion codes and a mapping relationship between the plurality of preset conversion codes and a plurality of service classifications, the plurality of preset conversion codes can include the target conversion code, and the plurality of preset conversion codes respectively define different parameter conversion modes;

[0075] Before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the parameter conversion method can further include:

[0076] Receiving a parameter conversion request of the first target parameter, the parameter conversion request can include the first target parameter and a target field, and the target field is used to indicate that the service classification of the first target parameter is the target service type;

[0077] Based on the mapping relationship between the plurality of preset conversion codes and the plurality of service classifications, the target conversion code having a mapping relationship with the target service type is determined.

[0078] In this embodiment, a plurality of preset conversion codes and a mapping relationship between the plurality of preset conversion codes and a plurality of service classifications can be preset according to actual business processing experience, and the plurality of mapping relationships are stored, and the mapping relationship between the target conversion code and the target service type is included in the plurality of mapping relationships.

[0079] The target conversion code is for example "BDC203", and the target service type is for example a service type of a request URL (Uniform Resource Locator). The target conversion code can be for example a URL. Alternatively, the target conversion code can be for example a parameter value such as a transaction code, and the target service type to which the target conversion code is mapped is for example a specific transaction type (for example, a transfer transaction, etc.), without being strictly limited.

[0080] According to some embodiments of the present application, in the case of the parameter conversion method in the actual parameter conversion scenario, in order to more fully realize the design of the conversion configuration rule, so as to efficiently and flexibly realize the modification of the parameter conversion method by adjusting at least one of the conversion type and the conversion parameter, the conversion type can include at least one of an enumeration conversion type, a regular conversion type, a copy conversion type, a constant conversion type, a Bean conversion type, and a Spring Expression Language (Spel) conversion type.

[0081] In the case of the enumeration conversion type, the value of the corresponding conversion parameter is configured as a value of a target dictionary.

[0082] In the case of the regular conversion type, one of the corresponding conversion parameters is configured as a regular expression, and the value of the other corresponding conversion parameter is configured as a replaced value.

[0083] In the case of the copy conversion type, the value of the corresponding conversion parameter is configured as a copy path of the parameter.

[0084] In the case of the constant conversion type, the value of the corresponding conversion parameter is a target constant.

[0085] In the case of the Bean conversion type, the value of the corresponding conversion parameter is a name of a Bean.

[0086] In the case of the Spel conversion type, the value of the corresponding conversion parameter is a Spel expression.

[0087] In the present embodiment, the conversion rule includes the conversion type and the corresponding conversion parameter which can be flexibly modified as described above, and the number of the conversion parameters is at least one.

[0088] Exemplarily, in a configuration conversion rule, the configurable conversion type transType includes: 1, enumeration, 2 regular, 3 copy, 4 constant, 5 Bean, 6 SPEL. The value of the conversion type (transType) of the configuration conversion rule is configured as 6. The conversion parameters in the configuration conversion rule include conversion parameter 1 (varContent1) and conversion parameter 2 (varContent2). The value of the conversion parameter is configured according to the conversion type, and the value of the conversion parameter 2 can be empty.

[0089] In addition, in some more specific embodiments, the configuration conversion parameter can further include a specific conversion name (fieldName), such as "SendSeqNo return". Alternatively, the configuration conversion parameter can further include a field name (varName), which can be the domain name corresponding to the POJO, such as "OutRsp.SendSeqNo".

[0090] In S120, when implemented, in response to the configuration modification instruction, the conversion type and / or the conversion parameter set in at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code are adjusted to obtain a second conversion configuration rule after the configuration modification; wherein each conversion configuration rule in the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer.

[0091] Exemplarily, in a configuration conversion rule, the configurable conversion type transType includes: 1, enumeration, 2 regular, 3 copy, 4 constant, 5 Bean, 6 SPEL. The value of the conversion type (transType) of the configuration conversion rule is configured as 6. The conversion parameters in the configuration conversion rule include conversion parameter 1 (varContent1) and conversion parameter 2 (varContent2). The value of the conversion parameter is configured according to the conversion type, and the value of the conversion parameter 2 can be empty.

[0092] It should be noted that the first configuration conversion rule that needs to be configured and modified can not be limited to one, and can be adjusted according to actual parameter conversion mode requirements, which is not strictly limited here.

[0093] In S130, when implemented, the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules that have not been configured and modified to obtain a second target parameter that conforms to the target conversion mode.

[0094] According to some embodiments of the present application, optionally, considering that in the business docking scene, the request parameter often needs to be globally configured with parameter conversion operation, based on this, before the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which are not modified by configuration, to obtain the second target parameter conforming to the target conversion mode, the parameter conversion method can further include:

[0095] M global conversion configuration rules corresponding to the first target parameter are obtained, M is a positive integer;

[0096] The first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which are not modified by configuration, to obtain the second target parameter conforming to the target conversion mode, which can include:

[0097] The first target parameter is converted according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which are not modified by configuration, to obtain the second target parameter.

[0098] In the embodiment, the conversion configuration rule under the target conversion code can be regarded as a local configuration conversion rule which is only effective for the first target parameter.

[0099] In specific implementation, considering that there are some globally effective parameter conversion configuration situations, by obtaining M global conversion configuration rules corresponding to the first target parameter, and then combining the global conversion configuration rule and the local configuration conversion rule updated under the target conversion code to comprehensively convert the first target parameter, a second target parameter more conforming to the parameter conversion requirement can be obtained.

[0100] The global conversion configuration rule can be pre-stored in a database for calling.

[0101] According to some embodiments of the present application, optionally, in order to more reasonably convert the fields in the first target parameter, the conversion of the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which are not modified by configuration, to obtain the second target parameter, can include:

[0102] The M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which are not modified by configuration are sorted to obtain the configuration execution order of the conversion configuration rule;

[0103] According to the configuration execution order, the loop configuration of the fields in the first target parameter is started according to the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules which have not been configured to be modified, and the second target parameter is obtained.

[0104] In this embodiment, the configuration execution order of the conversion configuration rules is obtained by sorting the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules which have not been configured to be modified. Then, the loop configuration of the fields in the first target parameter is started according to the configuration execution order, so that the second target parameter can be more efficiently and reasonably obtained.

[0105] It should be noted that the conversion configuration rule in this embodiment can also include a serial number (sortNo) which can be used to represent the order of configuration execution.

[0106] Please refer to the following Figure 2 , Figure 2 is a flowchart of a parameter conversion method provided by another embodiment of the present application. As shown in Figure 2 , the parameter conversion method comprises the following steps:

[0107] S110-S120;

[0108] S210, obtaining M global conversion configuration rules corresponding to the first target parameter, M being a positive integer;

[0109] S220, sorting the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules which have not been configured to be modified, to obtain a configuration execution order of the conversion configuration rules;

[0110] According to the configuration execution order, the loop configuration of the fields in the first target parameter is started according to the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules in the N conversion configuration rules which have not been configured to be modified, and the second target parameter is obtained.

[0111] The specific implementation of S110-S120 can be referred to the foregoing embodiments.

[0112] In actual application, global configuration is usually used for settings that do not change frequently, while local configuration is used for settings that may vary due to requests, users or environment.

[0113] Therefore, when S210 is specifically executed, the M global conversion configuration rules corresponding to the first target parameter are obtained first, and the multiple global conversion configuration rules can be pre-stored in, for example, Nacos for calling.

[0114] The global conversion configuration rule can set a global unified date format for different parameter files, for example, or convert a string parameter into a User object, and so on, so that the conversion is automatically completed by global configuration, and only the conversion configuration for specific cases is configured locally.

[0115] In the specific implementation of S220, each of the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules in the N conversion configuration rules that are not modified is sorted to obtain the configuration execution order of the conversion configuration rules.

[0116] For example, the M global configuration rules include global rule A0 and global rule B0. If the conversion configuration rules included in the N conversion configuration rules before modification include conversion configuration rule A1, conversion configuration rule B1, and conversion configuration rule C1, the conversion configuration rule A1 and the conversion configuration rule B1 are configured and modified as the first conversion configuration rules that need to be adjusted in terms of conversion type and / or conversion parameter, to obtain the corresponding second conversion configuration rule A2 and the second conversion configuration rule B2. In this case, the remaining conversion configuration rule that is not modified in the N conversion configuration rules is the conversion configuration rule C1.

[0117] In this case, the global rule A0, the global rule B0, the second conversion configuration rule A2, the second conversion configuration rule B2, and the conversion configuration rule C1 that is not modified can be sequentially configured according to a preset rule.

[0118] For example, considering that the global rule includes operations such as unified adjustment of parameter format or parameter cleaning and deduplication to facilitate more efficient and accurate parameter conversion, the execution order of the global rule A0 and the global rule B0 can be set in front, and the second conversion configuration rule A2, the second conversion configuration rule B2, and the conversion configuration rule C1 that is not modified can be set in back, to facilitate efficient operation of actual configuration.

[0119] The execution order of the global rule A0 and the global rule B0 can be random. The specific execution order of the second conversion configuration rule A2, the second conversion configuration rule B2, and the conversion configuration rule C1 that is not modified can be set according to whether there is a logical association between the content of the specific conversion configuration rule, whether it can be executed independently, and how to maximize execution efficiency.

[0120] In the specific implementation of S230, the loop configuration for the fields in the first target parameter is started according to the configuration execution order determined in the step 220, so that the second target parameter can be more efficiently and reasonably obtained.

[0121] It should be noted that after determining the configuration execution order corresponding to each of the above conversion configuration rules, the corresponding execution order of different global or local conversion configuration rules can be recorded by identifying the sequence number information, so as to realize the sequential execution of the configuration by reading the sequence number information during specific loop execution.

[0122] According to some embodiments of the present application, optionally, in order to effectively improve the configuration conversion efficiency of the parameter, before converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules without configuration modification in the N conversion configuration rules to obtain the second target parameter conforming to the target conversion mode, the parameter conversion method can further include:

[0123] Converting the basic data type of the first target parameter from the first data type to the second data type, the first data type being the initial data type of the first target parameter when the parameter is input, and the second data type being a data type easy for machine parsing;

[0124] After converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules without configuration modification in the N conversion configuration rules to obtain the second target parameter conforming to the target conversion mode, the parameter conversion method can further include:

[0125] Converting the basic data type of the second target parameter from the second data type to the first data type, and outputting the second target parameter of the second data type.

[0126] In this embodiment, before the configuration conversion of the first target parameter needs to be performed, the basic data type of the first target parameter is converted to the second data type easy for machine parsing, so as to realize more efficient parameter parsing processing by the back end.

[0127] For example, JSONObject can be used as a conversion parameter object to convert the basic data type of the first target parameter from the first data type to the second data type. Wherein, JSONObject can use attribute path to obtain value, which is convenient for subsequent conversion parameter to obtain the value of specified attribute.

[0128] In addition, after obtaining the second target parameter conforming to the target conversion mode, in order to make the second target parameter meet the visual requirements of actual business, etc., the basic data type of the second target parameter is converted from the second data type to the first data type, and the second target parameter of the second data type is output. For example, after the conversion configuration is completely processed, the second target parameter is converted from JSONObject to an object of Class type of input parameter, which is not strictly limited in this embodiment.

[0129] According to some embodiments of the present application, optionally, in order to reliably adjust the conversion type and / or conversion parameter set by the conversion configuration rule in a fully reasonable manner, the adjusting, in response to the configuration modification instruction, of the conversion type and / or conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after the configuration modification, can include:

[0130] The conversion type and / or conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code is adjusted by calling an interface of at least one of the conversion parameter conversion class, the conversion type conversion class of the whether native conversion class, to obtain a second conversion configuration rule after the configuration modification.

[0131] In a specific implementation, the present embodiment provides common built-in conversion classes in advance, and designs the interface of the conversion class. Taking the MVC design pattern as an example, the CoreConvert interface in MVC includes the interfaces of three conversion classes, and the three conversion classes are the conversion parameter conversion class, the whether native conversion class, and the conversion type conversion class.

[0132] The default implementation of CoreConvert has six, including: ConstantConverter: set the parameter to the configured constant value; CopyConverter: set the parameter to the value of another parameter configured; RegexConverter: modify the parameter value using a regular expression; EnumConverter: modify the parameter value using dictionary replacement, where the dictionary can be obtained from nacos configuration or from a custom table; BeanConverter: call another Bean configured to modify the parameter value. This implementation class is to call a custom conversion class; SpelConverter: modify the parameter value using a Spel expression.

[0133] It should be noted that in BeanConverter, the value of the conversion configuration parameter 1 is obtained, which is beanId. The class corresponding to beanId is found in the Spring container. This class also implements CoreConvter.

[0134] According to some embodiments of the present application, optionally, the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, to obtain a second target parameter conforming to the target conversion mode, which can include:

[0135] The second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified are obtained from the Nacos service management platform.

[0136] Based on the second conversion configuration rule and the remaining unconfigured modified conversion configuration rules in the N conversion configuration rules, the first target parameter is converted to obtain the second target parameter.

[0137] In the embodiment, the Nacos service management platform is used to realize the configuration management and service management of the conversion configuration rule, so that the configuration efficiency of the conversion mode is effectively improved and the reliability of the configuration related code is guaranteed.

[0138] It should be noted that the above conversion configuration rule can be stored in the Nacos, a database or a configuration file, and the like, and the embodiment does not strictly limit it.

[0139] In order to facilitate understanding of the parameter conversion method provided in the above embodiment, the above method is described in a specific scene embodiment. Figure 2 The scene embodiment flowchart of the parameter conversion method provided in the embodiment.

[0140] In the scene embodiment, the adjustment of the conversion configuration conversion rule is completed in advance, and the following process is mainly developed for the parameter conversion process. The scene embodiment can specifically include the following steps:

[0141] Step 1. The code calls the conversion entry method to start the parameter conversion process. The parameter conversion request can include the first target parameter and the target field, and the target field is used to indicate that the business classification of the first target parameter is the target business type.

[0142] Step 2. First, determine whether the method argument is empty, that is, whether the first target parameter is empty, and if it is empty, the process is ended.

[0143] Step 3. Get the global configuration from nacos, which can be regarded as the global conversion configuration rule in the foregoing embodiment. The global configuration is effective for all requests.

[0144] Step 4. Get the local configuration specific to the request from nacos, and the conversion code (target conversion code) can be a URL or a transaction code. Specifically, according to the target business classification of the first target parameter indicated by the target field, the target conversion code which has a mapping relationship with the target business type is determined, and the local configuration under the target conversion code, that is, the plurality of conversion configuration rules under the target conversion code in the foregoing embodiment, is obtained.

[0145] Step 5. Merge the global configuration and the local configuration.

[0146] Step 6. Determine whether the configurations in the global configuration and the local configuration are empty, and if they are empty, the process is ended.

[0147] Step 7. The multiple configurations after merging the global configuration and the local configuration are sorted. The configurations are arranged in descending order, and the configurations with the sequence number null are arranged in the front. The specific sorting can be set according to the actual parameter conversion requirement.

[0148] Step 8. The conversion parameter object is converted into a JSONObject, that is, the aforementioned embodiment: the JSONObject is used as the conversion parameter object to convert the basic data type of the first target parameter from the first data type to the second data type.

[0149] Here, the JSONObject can be, for example, an object in the hutool dependency library. The JSONObject can use the attribute path to obtain the value, which facilitates the subsequent conversion parameter to obtain the value of the specified attribute.

[0150] Step 9. According to the aforementioned sorting of the multiple configurations, the loop execution of the configurations is started. Since there are multiple conversion configurations, the multiple conversion configurations can be regarded as an array for array loop.

[0151] Step 10. The conversion configuration is parsed, and the fields in the first target parameter are processed, so as to obtain the second target parameter.

[0152] Step 11. After the conversion configuration is completely processed, the second target parameter is converted from the JSONObject to the object of the Class type of the input parameter.

[0153] In the scene embodiment, by separating the change point of the conversion parameter from the code to the conversion type and / or the conversion parameter of the conversion configuration rule, the real-time effect of the modification of the parameter conversion mode configuration is realized by simply modifying the conversion type and / or the conversion parameter in the configuration rule, and the modification requirement of the parameter conversion mode is realized without modifying the code and deploying the test.

[0154] In summary, by using the parameter conversion device provided in the embodiments of the present application, the configuration modification and the parameter conversion of the parameter conversion mode can be more efficient and flexible, so as to effectively improve the overall parameter conversion efficiency under different business requirements and improve the business processing efficiency.

[0155] Based on the parameter conversion method provided in the above embodiments, based on the same inventive concept, the present application also provides a parameter conversion device corresponding to the above parameter conversion method. The parameter conversion device will be described in detail below. Figure 3 The parameter conversion device will be described in detail below.

[0156] Figure 3 The structure schematic diagram of the parameter conversion device provided in an embodiment of the present application is shown. Figure 3 The parameter conversion device 300 shown includes:

[0157] The first receiving module 310 is configured to receive a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, the target service type of the first target parameter and the target conversion code having a mapping relationship, and the configuration modification instruction being used to indicate that the parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode.

[0158] The first adjusting module 320 is configured to, in response to the configuration modification instruction, adjust a conversion type and / or a conversion parameter set by at least one first conversion configuration rule of N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after the configuration modification; each of the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer.

[0159] The first conversion module 330 is configured to convert the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without the configuration modification, to obtain a second target parameter conforming to the target conversion mode.

[0160] The parameter conversion device provided by the embodiment of the present application receives the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code by setting corresponding function modules, the configuration modification instruction is used to modify the parameter conversion mode defined by the target conversion code from the initial conversion mode to the target conversion mode. In response to the configuration modification instruction, the conversion type and / or the conversion parameter set by the first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code are adjusted, to obtain the second conversion configuration rule after the configuration modification. Then, the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without the configuration modification, to obtain the second target parameter conforming to the target conversion mode.

[0161] As described above, the parameter conversion device provided by the embodiment of the present application receives the configuration modification instruction corresponding to the target conversion code, adjusts the conversion type and / or the conversion parameter set in the conversion configuration rule under the target conversion code, to realize the adjustment of the parameter conversion mode defined by the target conversion code, and finally converts the first target parameter based on each conversion configuration rule under the adjusted target conversion code, so that the second target parameter obtained by the conversion conforms to the required target conversion mode.

[0162] The embodiment of the application separates the change point of the conversion parameter from the code to the conversion type and / or the conversion parameter of the conversion configuration rule, so that the real-time effect of the parameter conversion mode configuration modification is realized by simply modifying the conversion type and / or the conversion parameter in the configuration rule, and the modification requirement of the parameter conversion mode is realized without modifying the code and deploying the test. By using the parameter conversion device provided by the embodiment of the application, the configuration modification and the parameter conversion of the parameter conversion mode can be more efficient and flexible, so that the overall parameter conversion efficiency under different business requirements and the business processing work efficiency can be effectively improved.

[0163] According to some embodiments of the application, before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the parameter conversion device can further include:

[0164] The second receiving module can be used to receive a plurality of preset conversion codes and a mapping relationship between the plurality of preset conversion codes and a plurality of business classifications, the plurality of preset conversion codes can include the target conversion code, and the plurality of preset conversion codes respectively define different parameter conversion modes.

[0165] Before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the parameter conversion device can further include:

[0166] The third receiving module can be used to receive a parameter conversion request of the first target parameter, and the parameter conversion request can include the first target parameter and a target field, the target field being used to indicate that the business classification of the first target parameter is the target business type.

[0167] The first determining module can be used to determine the target conversion code having a mapping relationship with the target business type based on the mapping relationship between the plurality of preset conversion codes and the plurality of business classifications.

[0168] According to some embodiments of the application, before converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured and modified, to obtain the second target parameter conforming to the target conversion mode, the parameter conversion device can further include:

[0169] The first obtaining module can be used to obtain M global conversion configuration rules corresponding to the first target parameter, M being a positive integer.

[0170] The first conversion module 330 can convert the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured and modified, to obtain the second target parameter conforming to the target conversion mode, which can include:

[0171] The first target parameter is converted according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, to obtain the second target parameter.

[0172] According to some embodiments of the present application, optionally, the conversion of the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified can include:

[0173] The first sorting sub-module can be configured to sort the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, to obtain the configuration execution order of the conversion configuration rules.

[0174] The first configuration sub-module can be configured to start the loop configuration of the fields in the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, in the configuration execution order, to obtain the second target parameter.

[0175] According to some embodiments of the present application, optionally, before the conversion of the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified to obtain the second target parameter conforming to the target conversion mode, the parameter conversion device can further include:

[0176] The second conversion module can be configured to convert the basic data type of the first target parameter from the first data type to the second data type, the first data type being the initial data type of the first target parameter when the parameter is input, and the second data type being a data type easy for machine parsing.

[0177] After the conversion of the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified to obtain the second target parameter conforming to the target conversion mode, the parameter conversion device can further include:

[0178] The third conversion module can be configured to convert the basic data type of the second target parameter from the second data type to the first data type, and output the second target parameter of the second data type.

[0179] According to some embodiments of the present application, optionally, the conversion type can include at least one of an enumeration conversion type, a regular conversion type, a copy conversion type, a constant conversion type, a Bean conversion type, and a Spring Expression Language (Spel) conversion type.

[0180] In the case of the conversion type being an enumeration conversion type, the value of the corresponding conversion parameter is configured as the value of the target dictionary;

[0181] In the case of the conversion type being a regular conversion type, one of the corresponding conversion parameters is configured as a regular expression, and the value of the second corresponding conversion parameter is configured as a replaced value;

[0182] In the case of the conversion type being a copy conversion type, the value of the corresponding conversion parameter is configured as a copy path of the parameter;

[0183] In the case of the conversion type being a constant conversion type, the value of the corresponding conversion parameter is a target constant;

[0184] In the case of the conversion type being a Bean conversion type, the value of the corresponding conversion parameter is the name of a Bean;

[0185] In the case of the conversion type being a Spel conversion type, the value of the corresponding conversion parameter is a Spel expression.

[0186] According to some embodiments of the present application, the first adjustment module 320, in response to the configuration modification instruction, adjusts the conversion type and / or the conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after configuration modification, can include:

[0187] By calling the interface of at least one of the conversion parameter conversion class and the conversion type conversion class of the native conversion class, the conversion type and / or the conversion parameter set by at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code are adjusted, to obtain a second conversion configuration rule after configuration modification.

[0188] According to some embodiments of the present application, the first conversion module 330, according to the second conversion configuration rule and the remaining conversion configuration rule without configuration modification in the N conversion configuration rules, converts the first target parameter to obtain the second target parameter conforming to the target conversion mode, can include:

[0189] Obtain the second conversion configuration rule and the remaining conversion configuration rule without configuration modification in the N conversion configuration rules from the Nacos service management platform;

[0190] Based on the second conversion configuration rule and the remaining conversion configuration rule without configuration modification in the N conversion configuration rules, the first target parameter is converted to obtain the second target parameter.

[0191] Based on the parameter conversion method provided in the above embodiments, for the same inventive concept, the present application also provides a parameter conversion device corresponding to the above parameter conversion method. The following describes the parameter conversion device in detail. Figure 4 The parameter conversion device is described in detail.

[0192] The following describes the parameter conversion device in detail. Figure 4 , Figure 4 is a structural schematic diagram of the parameter conversion device provided in an embodiment of the present application.

[0193] The parameter conversion device can include a processor 401 and a memory 402 storing computer program instructions.

[0194] Specifically, the processor 401 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits implementing the embodiments of the present application.

[0195] The memory 402 can include a mass storage for data or instructions. By way of example and not limitation, the memory 402 can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 can include removable or non-removable (or fixed) media. Where appropriate, the memory 402 can be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, the memory 402 is non-volatile solid-state memory.

[0196] The memory can include read-only memory (ROM), random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions that, when executed (e.g., by one or more processors), are operable to perform the operations described with reference to the methods according to an aspect of the present disclosure.

[0197] The processor 401 implements any one of the parameter conversion methods in the above embodiments by reading and executing the computer program instructions stored in the memory 402.

[0198] In one example, the data parameter conversion device can also include a communication interface 403 and a bus 410. Wherein, as Figure 4As shown, the processor 401, the memory 402, and the communication interface 403 are connected by the bus 410 and accomplish communication with each other.

[0199] The communication interface 403 is mainly used to realize communication between modules, devices, units and / or equipment in the embodiments of the present application.

[0200] The bus 410 includes hardware, software or both to couple components of the parameter conversion device to each other. By way of example, and not limitation, the bus can include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (ISA) bus, an InfiniBand (IB) interconnect, a low pin count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus, or another suitable bus or combination of two or more of these. Where suitable, the bus 410 can include one or more buses. Although particular buses are described and shown in the embodiments of the present application, the present application contemplates any suitable bus or interconnect.

[0201] The parameter conversion device executes the parameter conversion method in the embodiments of the present application, thereby realizing the parameter conversion method described in the embodiments of the present application.

[0202] In addition, in combination with the parameter conversion method in the above embodiments, the embodiments of the present application can provide a computer storage medium to realize. The computer storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to realize any one of the parameter conversion methods in the above embodiments.

[0203] Based on the parameter conversion method in the above embodiments, the embodiments of the present application provide a computer program product, instructions in the computer program product are executed by a processor of an electronic device, so that the electronic device executes the parameter conversion method provided by any one of the above embodiments of the present application.

[0204] It needs to be clear that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of well-known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the present application.

[0205] The functions noted in the description of the structural block diagrams above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium, or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transport information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.

[0206] It is also important to note that the examples mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the steps mentioned above, that is, the steps can be performed in the order mentioned in the examples, or in an order different from the examples, or several steps can be performed simultaneously.

[0207] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing device to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks. The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing device to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks.

[0208] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.

Claims

1. A parameter conversion method characterized by, The method comprises: receiving a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, there being a mapping relationship between a target service type of the first target parameter and the target conversion code, the configuration modification instruction being used to indicate that a parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode; in response to the configuration modification instruction, adjusting a conversion type and / or a conversion parameter set by at least one first conversion configuration rule of N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after configuration modification; wherein each conversion configuration rule of the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer; converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain a second target parameter conforming to the target conversion mode; before the converting of the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain a second target parameter conforming to the target conversion mode, the method further comprises: obtaining M global conversion configuration rules corresponding to the first target parameter, M being a positive integer; the converting of the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain a second target parameter conforming to the target conversion mode, comprises: converting the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain the second target parameter; the converting of the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain the second target parameter, comprises: sorting the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain a configuration execution order of the conversion configuration rules; according to the configuration execution order, starting a loop configuration of a field in the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been subjected to configuration modification, to obtain the second target parameter.

2. The method of claim 1, wherein, before the receiving of the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the method further comprises: receiving a plurality of preset conversion codes and a mapping relationship between the plurality of preset conversion codes and a plurality of service classifications, the plurality of preset conversion codes including the target conversion code, the plurality of preset conversion codes respectively defining different parameter conversion modes; Before receiving the first target parameter to be converted and the configuration modification instruction corresponding to the target conversion code, the method further comprises: receiving a parameter conversion request of the first target parameter, the parameter conversion request comprising the first target parameter and a target field, the target field being used to indicate that the service classification of the first target parameter is the target service type; determining the target conversion code having a mapping relationship with the target service type based on a mapping relationship between the plurality of preset conversion codes and a plurality of service classifications.

3. The method of claim 1, wherein, Before converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, the method further comprises: converting the basic data type of the first target parameter from a first data type to a second data type, the first data type being an initial data type when the first target parameter is a parameter, and the second data type being a data type easy for machine parsing; After converting the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules which have not been configured to be modified, the method further comprises: converting the basic data type of the second target parameter from the second data type to the first data type, and outputting the second target parameter of the second data type.

4. The method of claim 1, wherein, The conversion type comprises at least one of an enumeration conversion type, a regular conversion type, a copy conversion type, a constant conversion type, a Bean conversion type and a Spring Expression Language (Spel) conversion type; In a case where the conversion type is the enumeration conversion type, a value of the corresponding conversion parameter is configured as a value of a target dictionary; In a case where the conversion type is the regular conversion type, one of the corresponding conversion parameters is configured as a regular expression, and a value of the second conversion parameter is configured as a replaced value; In a case where the conversion type is the copy conversion type, a value of the corresponding conversion parameter is configured as a copy path of a parameter; In a case where the conversion type is the constant conversion type, a value of the corresponding conversion parameter is a target constant; In a case where the conversion type is the Bean conversion type, a value of the corresponding conversion parameter is a name of a Bean; In a case where the conversion type is the Spel conversion type, a value of the corresponding conversion parameter is a Spel expression.

5. The method according to any one of claims 1 to 4, characterized in that, The adjusting of the conversion type and / or the conversion parameter of at least one first conversion configuration rule of the N conversion configuration rules corresponding to the target conversion code in response to the configuration modification instruction to obtain a second conversion configuration rule after the configuration modification comprises: The conversion type and / or the conversion parameter set by at least one first conversion configuration rule of N conversion configuration rules corresponding to the target conversion code are adjusted by calling an interface of at least one conversion class of a conversion parameter conversion class and a conversion type conversion class whether the conversion class is native, to obtain a second conversion configuration rule after configuration modification.

6. The method according to any one of claims 1 to 4, characterized in that, The first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification, to obtain a second target parameter conforming to the target conversion mode, including: The second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification are obtained from a Nacos service management platform. The first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification, to obtain the second target parameter.

7. A parameter conversion apparatus characterized by comprising: The device includes: The first receiving module is configured to receive a first target parameter to be converted and a configuration modification instruction corresponding to a target conversion code, a target service type of the first target parameter and the target conversion code having a mapping relationship, and the configuration modification instruction being used to indicate that a parameter conversion mode defined by the target conversion code is modified from an initial conversion mode to a target conversion mode. The first adjustment module is configured to, in response to the configuration modification instruction, adjust a conversion type and / or a conversion parameter set by at least one first conversion configuration rule of N conversion configuration rules corresponding to the target conversion code, to obtain a second conversion configuration rule after configuration modification, wherein each conversion configuration rule of the N conversion configuration rules is provided with a corresponding conversion type and conversion parameter, and N is a positive integer. The first conversion module is configured to convert the first target parameter according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification, to obtain a second target parameter conforming to the target conversion mode. Before the first target parameter is converted according to the second conversion configuration rule and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification, to obtain a second target parameter conforming to the target conversion mode, the device further includes: The first obtaining module is configured to obtain M global conversion configuration rules corresponding to the first target parameter, and M is a positive integer. The first conversion module is configured to convert the first target parameter according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification, to obtain the second target parameter. The first target parameter is converted according to the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules without configuration modification, to obtain the second target parameter, including: The first sorting submodule is configured to sort the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules that have not been modified, to obtain a configuration execution order of the conversion configuration rules. The first configuration submodule is configured to perform a loop configuration on fields in the first target parameter according to the configuration execution order, the M global conversion configuration rules, the second conversion configuration rule, and the remaining conversion configuration rules of the N conversion configuration rules that have not been modified, to obtain the second target parameter.

8. A parameter conversion device characterized by comprising: The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the parameter conversion method of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer program instructions are stored on the computer readable storage medium, and the computer program instructions are executed by the processor to implement the parameter conversion method of any one of claims 1-6.

10. A computer program product, characterised in that, The instructions in the computer program product are executed by the processor of the electronic device, and the electronic device executes the parameter conversion method of any one of claims 1-6.

Citation Information

Patent Citations

  • Service execution method and device

    CN114648303A

  • Parameter type conversion method and device, storage medium and electronic equipment

    CN116483432A