Packet mapping multi-condition branch processing method and device, storage medium and electronic equipment

By designing a message mapping configuration model, the adaptability problem of message conversion in complex calculation and multi-target interface scenarios in existing technologies is solved, and flexible configuration and efficient conversion are achieved.

CN122248090APending Publication Date: 2026-06-19CHINA CITIC BANK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA CITIC BANK CO LTD
Filing Date
2026-04-29
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing message conversion technologies cannot meet the needs of complex calculations and encryption conversions, and cannot support multi-condition branches in multi-target interface scenarios, resulting in poor adaptability.

Method used

The design includes a message mapping configuration model, encompassing global domain configuration, conditional judgment, multi-backend service configuration, request-response domain configuration, and field function conversion configuration. This model enables dynamic parsing and conversion of messages, supports custom function conversion methods, and allows for flexible configuration and reuse.

Benefits of technology

It improves the efficiency and adaptability of message conversion, enabling flexible configuration and rapid response in multi-target interface scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122248090A_ABST
    Figure CN122248090A_ABST
Patent Text Reader

Abstract

This application discloses a message mapping multi-condition branch processing method, apparatus, storage medium, and electronic device, relating to the field of financial technology. The message mapping configuration model designed in this application is loaded into memory as the configuration of an application to support dynamic parsing and transformation of messages. The message mapping configuration model includes global domain configuration, conditional judgment, multi-backend service configuration, request-response domain configuration, field function conversion configuration, etc. The message mapping configuration model facilitates the configuration of different conditional branches, horizontally expands interface addresses, and supports message conversion capabilities such as custom function conversion methods, achieving universality in message mapping configuration. Furthermore, combined with message mapping rules with custom values, it facilitates the reuse, flexible configuration, and adaptability of the message mapping configuration model, thereby improving the efficiency and adaptability of message conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a message mapping multi-condition branch processing method, apparatus, storage medium, and electronic device. Background Technology

[0002] Message conversion refers to the process of transforming a source message into an intermediate data object, using simple conversion rules to obtain a target data object, and then assembling the target message. It also includes logic for converting between fields, structures, and circular lists. Message conversion supports mutual conversion between various message formats such as FIX, XML, and JSON.

[0003] Existing message conversion technologies are primarily designed for source and target messages with relatively neat field structures. Their field conversion rules only support simple constant assignment, regular expression replacement, and string truncation. For message conversions requiring complex calculations or external encryption, existing technologies cannot handle such operations. Furthermore, for transactions with multiple target interfaces, current implementations redundantly store all target interface message fields in the same configuration, failing to support scenarios with multiple conditional branches in message conversion, resulting in poor adaptability.

[0004] Therefore, how to improve the adaptability of message conversion is a problem that this application urgently needs to solve. Summary of the Invention

[0005] In view of this, this application discloses a message mapping multi-condition branch processing method, apparatus, storage medium and electronic device, aiming to improve the efficiency and adaptability of message conversion.

[0006] To achieve the above objectives, the disclosed technical solution is as follows:

[0007] The first aspect of this application discloses a message mapping multi-condition branch processing method, the method comprising:

[0008] In scenarios where the same transaction corresponds to multiple interfaces, obtain the transaction code identifier of the source request message from the requester;

[0009] The message mapping configuration list corresponding to the transaction code identifier is obtained through the message mapping configuration model, and the message mapping configuration that conforms to the conditional expression of the global domain is obtained from the message mapping configuration list.

[0010] The target request message is determined based on the request message domain-target mapping rules and the message mapping configuration;

[0011] The source response message is obtained by using the target request message and the obtained target request address;

[0012] Calculate the default response condition expression based on the source response message;

[0013] Determine whether the default response condition expression meets the default response condition, obtain the determination result, and obtain the corresponding target response message based on the determination result.

[0014] Optionally, the step of obtaining the message mapping configuration list corresponding to the transaction code identifier through the message mapping configuration model, and obtaining the message mapping configuration that conforms to the conditional expression of the global domain from the message mapping configuration list, includes:

[0015] The message mapping configuration list corresponding to the transaction code identifier is obtained from the message mapping configuration through the message mapping configuration model;

[0016] Iterate through the packet mapping configuration list until you find a packet mapping configuration in the list that satisfies the conditional expression for the global domain being true.

[0017] Optionally, determining the target request message based on the request message domain-target mapping rule and the message mapping configuration includes:

[0018] The message mapping configuration that conforms to the conditional expression of the global domain is used for message conversion to obtain the source request message;

[0019] The source request message is parsed into a mapping data structure;

[0020] The mapping data structure is internally transformed, and the transformed mapping data structure is assigned to the target request message field corresponding to the source request message to obtain the target request message.

[0021] Optionally, obtaining the source response message using the target request message and the obtained target request address includes:

[0022] Obtain the backend address information through the backend service identifier;

[0023] If the backend address information belongs to HTTP interface information, the first target request message corresponding to the HTTP interface request is sent to the downstream system through the WebClient class;

[0024] If the first target request message does not time out or has no abnormality, receive the source response message corresponding to the first target request message returned by the downstream system;

[0025] If the backend address information belongs to TCP interface information, the second target request message corresponding to the TCP request is sent to the TCP request address through an asynchronous event-driven network application framework.

[0026] Send the second target request message to the downstream system. If the second target request message does not time out or has no abnormality, receive the source response message corresponding to the second target request message returned by the downstream system.

[0027] Optionally, determining whether the default response condition expression conforms to the default response condition, obtaining a determination result, and acquiring the corresponding target response message based on the determination result includes:

[0028] If the result of the default response condition expression is true, it is determined that the default response condition expression conforms to the default response condition.

[0029] If the default response condition expression meets the default response condition, the source response message is converted according to the response message field-default configuration to obtain the target response message;

[0030] If the result of the default response condition expression is false, it is determined that the default response condition expression does not meet the default response condition.

[0031] If the default response condition expression does not meet the default response condition, the target response message is obtained through the response message field-target configuration.

[0032] A second aspect of this application discloses a message mapping multi-condition branch processing apparatus, the method comprising:

[0033] The first acquisition unit is used to acquire the transaction code identifier of the source request message of the requester in the scenario of multiple interfaces corresponding to the same transaction.

[0034] The second acquisition unit is used to acquire the message mapping configuration list corresponding to the transaction code identifier through the message mapping configuration model, and to acquire the message mapping configuration that conforms to the conditional expression of the global domain from the message mapping configuration list;

[0035] The determining unit is configured to determine the target request message based on the request message domain-target mapping rules and the message mapping configuration;

[0036] The third acquisition unit is used to obtain the source response message through the target request message and the acquired target request address;

[0037] The calculation unit is used to calculate the default response condition expression based on the source response message;

[0038] The judgment and acquisition unit is used to judge whether the default response condition expression meets the default response condition, obtain the judgment result, and obtain the corresponding target response message based on the judgment result.

[0039] Optionally, the second acquisition unit includes:

[0040] The first acquisition module is used to acquire a list of message mapping configurations corresponding to the transaction code identifier from the message mapping configuration;

[0041] The traversal module is used to traverse the packet mapping configuration list until a packet mapping configuration in the packet mapping configuration list that meets the condition expression of the global domain is true is obtained.

[0042] Optionally, the determining unit includes:

[0043] The message conversion module is used to convert the message mapping configuration that conforms to the conditional expression of the global domain into a source request message;

[0044] The parsing module is used to parse the source request message into a mapping data structure;

[0045] The conversion and assignment module is used to internally convert the mapping data structure and assign the converted mapping data structure to the target request message field corresponding to the source request message to obtain the target request message.

[0046] A third aspect of this application discloses a storage medium comprising stored instructions, wherein, when the instructions are executed, the device in which the storage medium resides executes the message mapping multi-condition branching processing method as described in any one of the first aspects.

[0047] The fourth aspect of this application discloses an electronic device, including a memory and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors using the message mapping multi-condition branching processing method as described in any one of the first aspects.

[0048] As can be seen from the above technical solution, this application discloses a message mapping multi-condition branch processing method, apparatus, storage medium, and electronic device. In scenarios where multiple interfaces correspond to the same transaction, the transaction code identifier of the requester's source request message is obtained. A message mapping configuration list corresponding to the transaction code identifier is obtained through a message mapping configuration model. Message mapping configurations that conform to the conditional expressions of the global domain are obtained from the message mapping configuration list. The target request message is determined based on the request message domain-target mapping rules and the message mapping configuration. The source response message is obtained using the target request message and the obtained target request address. A default response conditional expression is calculated based on the source response message. It is determined whether the default response conditional expression conforms to the default response conditions, and a judgment result is obtained. The corresponding target response message is then obtained based on the judgment result. This solution designs the message mapping configuration model as an application configuration loaded into memory to support dynamic parsing and transformation of messages. The message mapping configuration model includes global domain configuration, conditional judgment, multi-backend service configuration, request-response domain configuration, field function conversion configuration, etc. The message mapping configuration model facilitates the configuration of different conditional branches and horizontal expansion of interface addresses. At the same time, the message mapping rules support message conversion capabilities such as custom function conversion methods, realizing the universality of message mapping configuration. Furthermore, in conjunction with message mapping rules with custom values, it facilitates the reuse, flexible configuration, and adaptability of the message mapping configuration model, thereby improving the efficiency and adaptability of message conversion. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0050] Figure 1 This is a flowchart illustrating a message mapping multi-condition branching processing method disclosed in an embodiment of this application;

[0051] Figure 2 This is a schematic diagram illustrating the configuration of the message mapping configuration model disclosed in the embodiments of this application;

[0052] Figure 3 This is a flowchart illustrating another message mapping multi-condition branch processing method disclosed in an embodiment of this application;

[0053] Figure 4 This is a schematic diagram of the structure of a message mapping multi-condition branch processing device disclosed in an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of the structure of the electronic device disclosed in the embodiments of this application. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] In this application, the terms "comprising," "including," 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 includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0057] As the background technology indicates, existing message conversion technologies are primarily designed for source and target messages with relatively neat field structures. Their field conversion rules only support simple constant assignment, regular expression replacement, and string truncation. For message conversions requiring complex calculations or external encryption, existing technologies cannot meet the demands of encryption-to-encryption conversions. Furthermore, when a transaction corresponds to multiple target interfaces, existing message conversion implementations require redundant storage of all target interface message fields in the same configuration file, failing to support scenarios with multiple conditional branches in message conversion, resulting in poor adaptability.

[0058] To address the aforementioned issues, this application discloses a message mapping multi-condition branch processing method, apparatus, storage medium, and electronic device. This solution designs a message mapping configuration model as the application's configuration, loaded into memory to support dynamic parsing and message conversion. The message mapping configuration model includes global domain configuration, conditional judgment, multi-backend service configuration, request-response domain configuration, and field function conversion configuration. The message mapping configuration model facilitates the configuration of different conditional branches, horizontally expanding interface addresses. Simultaneously, the message mapping rules support message conversion capabilities such as custom function conversion methods, achieving universality in message mapping configuration. Furthermore, combined with message mapping rules featuring custom values, it facilitates the reuse, flexible configuration, and adaptability of the message mapping configuration model, thereby improving the efficiency and adaptability of message conversion. Specific implementation methods are described in detail through the following embodiments.

[0059] It should be noted that the message mapping multi-condition branch processing method, apparatus, storage medium and electronic device provided in this application are related to the technical fields of financial technology, message processing and other fields. The above is only an example and does not limit the application field of the message mapping multi-condition branch processing method, apparatus, storage medium and electronic device provided in this application.

[0060] refer to Figure 1 The image shows a message mapping multi-condition branching processing method disclosed in an embodiment of this application. This message mapping multi-condition branching processing method mainly includes the following steps:

[0061] S101: In scenarios where multiple interfaces correspond to the same transaction, obtain the transaction code identifier of the source request message from the requester.

[0062] Among them, the same transaction corresponds to multiple interface scenarios, including the interface scenario of XML message format on the head office side, the interface scenario of JSON message format on the new core, the interface scenario of fixed-length message format with different message header lengths (such as 321, 250, 215, etc.) of other peripheral systems, and the interface scenario where the message mapping configuration is required when calling the core between systems. For example, in the scenario where the head office side calls the new core, the XML message requested by the head office side needs to be converted into a JSON message of the new core.

[0063] S102: Obtain the message mapping configuration list corresponding to the transaction code identifier through the message mapping configuration model, and obtain the message mapping configuration that conforms to the conditional expression of the global domain from the message mapping configuration list.

[0064] In S102, the message mapping configuration list corresponding to the transaction code identifier is obtained from the message mapping configuration through the message mapping configuration model. The message mapping configuration list is traversed until a message mapping configuration in the message mapping configuration list that meets the condition expression of the global domain is true is obtained.

[0065] This application designs a general message mapping configuration model, flexibly configuring field content conversion rules to implement a method and configuration for multi-condition branching in message conversion. The general message mapping model can support conversion between any message formats in any domain, such as FIX, XML, and JSON.

[0066] To facilitate understanding of the use of the message mapping configuration model, an example is provided below:

[0067] For example, the message mapping configuration model file is loaded into memory during application initialization. The message mapping processor scans all message mapping configuration model files with the .xls extension in the specified directory path and stores all the mapping configurations corresponding to the transaction using the "transaction code identifier" configured in the global domain of the message mapping configuration model as the key. For example, transaction code identifier -> [message mapping configuration 1, message mapping configuration 2...], where the conditional expressions of the message mapping configurations in the list are different for each one.

[0068] This solution's message mapping configuration model uses a predefined Excel format to define message mapping relationships, which are then loaded into memory as the application's configuration to support dynamic message parsing and transformation. This message mapping model includes global domain configuration, conditional checks and multi-backend service configuration, request-response domain configuration, and field function conversion configuration, etc. Specific configurations are as follows: Figure 2 As shown.

[0069] Figure 2 In the global domain, the transaction code description, source transaction code identifier, backend service identifier, target transaction code identifier, target transaction request type, conditional SpEL expression, and default response conditional SpEL expression are included.

[0070] 1) The transaction code description is used to briefly describe the definition of the transaction interface;

[0071] 2) The source transaction code identifier is a unique identifier for the transaction interface;

[0072] 3) Backend service identifier, used to represent the backend domain name or calling IP address plus port;

[0073] 4) The target transaction code identifier is the target interface context URL, and the request variable can be obtained using the {var} method;

[0074] 5) The target transaction request type includes TCP request method, in which case fill in FIX or XML to define the target request message format as FIX or XML; and HTTP request method type, in which case fill in GET / POST / PUT / DELETE, etc.

[0075] 6) Conditional SpEL expressions: When the result of a conditional SpEL expression is true, the current configuration takes effect.

[0076] 7) Default response condition SpEL expression: When the result of the default response condition SpEL expression is true, it means that the response message adopts the message conversion rules in the "Response Message Field - Default" field. In the case of transaction business exceptions, only the response code and response description fields need to be converted, without the need to convert other business fields, thereby improving the message conversion efficiency.

[0077] Figure 2 In this framework, conditional checks and multiple backend service configurations within the global domain, combined with conditional SpEL expressions, can handle multiple target interface configurations for the same transaction. The corresponding configuration is used for message conversion only when the dynamic calculation result of the conditional SpEL expression is true. If the conditional SpEL expression is empty, the current configuration will take effect under any circumstances. The system iteratively checks mapping configurations with the same "transaction code identifier" until the conditional SpEL expression evaluates to true; subsequent mapping configurations for the same transaction are then ignored. Multiple backend service configurations are used to resolve inconsistencies in backend domain names, Internet Protocol (IP) addresses, or port numbers across different environments. While mapping configuration files can address the same issues, they can also handle the same transaction and send requests to different backend services based on the "conditional SpEL expression." When the target transaction request type is a Hypertext Transfer Protocol (HTTP) request, the backend service identifier and the target transaction code identifier together form the HTTP request Uniform Resource Identifier (URI). Otherwise, the address information corresponding to the backend service identifier is the IP address and port information for a Transmission Control Protocol (TCP) request.

[0078] To better understand the process of iteratively checking for identical "transaction code identifiers" until the conditional SpEL expression evaluates to true, an example is provided here:

[0079] For example, in a credit card information query scenario, the response message will vary depending on the different request parameters of different systems. The query conditions may be based on ID card number, credit card number, or user's mobile phone number, each corresponding to a different interface address in the new core. In this case, the credit card information query transaction will correspond to multiple condition expressions. For example, query category = 1 represents calling the interface for querying credit card information by ID card number, query category = other represents calling the interface for querying credit card information by mobile phone number, etc. In the program, these conditions are traversed in the configuration order. If a condition is satisfied, the downstream interface is called according to the configuration message conversion.

[0080] Figure 2 In the request-response field configuration, there are request message fields such as Request Message Field - Source, Request Message Field - Target, Response Message Field - Source, Response Message Field - Target, and Response Message Field - Default. Each message field contains the following: field name, field description, field length, field type, whether it is a parent field (used when it is a structure or loop body), loop count SpEL expression (if the field belongs to a parent field and a loop count expression is filled in, it means that the following field is the content of the loop body; otherwise, fill in -1), and SpEL expression (used for the actual value expression assigned to the message field - target field conversion).

[0081] SpEL expressions, introduced by the Spring family of Java expressions, are used for dynamic computation. Similar to code blocks, they are used for message conversion to perform field value transformations. This allows for more convenient definition of message field conversion rules. Commonly used definitions include: constant numbers, constant strings, arithmetic operators, URL encoding, URL decoding, date format conversion, string concatenation, string truncation, etc. Furthermore, custom functions can be defined, such as padding amounts with zeros on the left and right, removing zeros from the left and right, converting external encryption to encryption, nationality conversion, and currency conversion. Field function configurations are defined as #{function_name}(param1, param2...). For example, the custom function method public static String hsmTranBin(String PINBlock, String ZPK1, String ZPK2, String cardNo) is represented in the configuration as #hsmTranBin(['PINBlock'], ['ZPK1'], ['ZPK2'], ['cardNo']).

[0082] The dictionary field configuration is used to configure the mapping rules between return codes and return description fields. For example, if the return code in the source response message is 3B120010, and its corresponding value of 0301004 is configured in the dictionary field, the dictionary field will replace the return code 3B120010 in the source response message with 0301004 before returning the target response message.

[0083] S103: Determine the target request message based on the request message domain-target mapping rules and message mapping configuration.

[0084] The specific process of determining the target request message based on the request message domain-target mapping rules and message mapping configuration is shown in A1-A3.

[0085] A1: Configure message mapping to convert messages that match the conditional expression of the global domain to obtain the source request message.

[0086] In A1, the message mapping configuration that evaluates to true for the conditional SpEL expression is used to perform message conversion to obtain the source request message.

[0087] A2: Parse the source request message into a mapping data structure.

[0088] A3: Perform internal transformation on the mapping data structure, and assign the transformed mapping data structure to the target request message field corresponding to the source request message to obtain the target request message.

[0089] To facilitate understanding of the internal transformation of the mapping data structure, and the subsequent assignment of the transformed mapping data structure to the target request message field corresponding to the source request message, the process of obtaining the target request message is illustrated here with an example:

[0090] For example, normally, if the backend interface call has already transmitted according to the agreed fields, the source request message is parsed into a Map format, and then the parsed source request message is mapped one by one to the fields of the target request message. The program performs pass-through processing. However, there may be differences in field definitions between systems, which requires internal conversion before being assigned to the target request field. For example, for document type, the upstream system uses a 1-digit number or letter to represent the document type, but the downstream system uses a 3-digit code for the document type field. The program will then perform this logical conversion, converting the 1-digit document type code in the upstream system's request message into the 3-digit document type code required by the downstream system. For the amount field in the XML message, when converting to a fixed-length message, if the number of digits is insufficient, zeros need to be added before the amount, etc.

[0091] S104: Obtain the source response message using the target request message and the obtained target request address.

[0092] The specific process of obtaining the source response message is shown in B1-B5.

[0093] B1: Obtain backend address information through the backend service identifier.

[0094] In B1, the type of backend address information is determined. This type of backend address information includes either HTTP interface information or TCP interface information.

[0095] B2: If the backend address information belongs to the HTTP interface information, send the first target request message corresponding to the HTTP interface request to the downstream system through the WebClient class.

[0096] B3: If the first target request message does not time out or has no abnormality, receive the source response message corresponding to the first target request message returned by the downstream system.

[0097] B4: If the backend address information belongs to TCP interface information, send the second target request packet corresponding to the TCP request address to the TCP request address through the asynchronous event-driven network application framework (Netty).

[0098] B5: Send a second target request message to the downstream system. If the second target request message does not time out or has no abnormality, receive the source response message corresponding to the second target request message returned by the downstream system.

[0099] If the second target request message times out or becomes abnormal, an alert response message is generated based on the captured timeout or abnormality. This alert response message is used to remind the upstream system that the second target request has timed out or become abnormal.

[0100] S105: Calculate the default response condition expression based on the source response message.

[0101] The default response condition expression typically uses the response code field in the response message as a condition for judgment. For example, if the response code field in the response message is 000000, it is a normal response, and the response message will contain multiple response fields required by the upstream system. When the response code field is 999999, the upstream system only needs to know the reason for the error. In this case, the message conversion logic does not need to convert all field contents as defined in the original normal message; it only needs to convert the response code and response message information.

[0102] S106: Determine whether the default response condition expression meets the default response condition, obtain the determination result, and obtain the corresponding target response message based on the determination result.

[0103] The evaluation result includes either a result where the default response condition expression evaluates to true or a result where the default response condition expression evaluates to false.

[0104] Specifically, the process of determining whether the default response condition expression meets the default response condition, obtaining the judgment result, and obtaining the corresponding target response message based on the judgment result is shown in C1-C4.

[0105] C1: If the result of the default response condition expression is true, then the default response condition expression is determined to meet the default response condition.

[0106] C2: If the default response condition expression matches the default response condition, the source response message is converted according to the response message field - default configuration to obtain the target response message.

[0107] C3: If the result of the default response condition expression is false, it is determined that the default response condition expression does not meet the default response condition.

[0108] C4: If the default response condition expression does not meet the default response condition, obtain the target response message through the response message field - target configuration, and return the target response message to the requester.

[0109] To facilitate understanding the process of message mapping multi-condition branching, combined with Figure 3 Please provide an explanation.

[0110] Figure 3 In the process, when a transaction begins, the receiving party sends the source request message.

[0111] Obtain the transaction code identifier from the source request message;

[0112] Find the list of message mapping configurations corresponding to the transaction code identifier from the message mapping configuration of the message mapping configuration model;

[0113] Iterate through the message mapping configuration list until you find a message mapping configuration in which the SpEL expression condition is true;

[0114] The message is transformed according to the request message field-target configuration to obtain the target request message;

[0115] The target request address information is composed of the backend service identifier and the target transaction code identifier;

[0116] Forward the target request message to the target request address and obtain the source response message;

[0117] Calculate the default response condition expression based on the response message;

[0118] When the default response condition expression evaluates to true, the message is converted according to the response message field - default configuration to obtain the target response message; otherwise, the message is converted according to the response message field - target configuration to obtain the target response message, and the target response message is returned to the requester.

[0119] This solution provides a way to quickly implement multi-condition branching message conversion in scenarios where a transaction has multiple interfaces corresponding to the same transaction. To achieve this, it is necessary to make the message mapping configuration universal, and combine it with custom value mapping rules to facilitate reuse, flexible configuration, and thus improve efficiency.

[0120] Upgrading a new core system involves numerous scenarios, each requiring separate handling of message mapping configurations. For multi-condition branch interfaces within the same transaction, downstream system interfaces must aggregate the data before conditional forwarding. Each new branch necessitates modifications to the aggregation interface, increasing development costs. This solution integrates multi-condition branch control into the gateway, facilitating the configuration of different conditional branches through a universal message mapping configuration model. It horizontally expands interface addresses and supports custom function conversion methods, enhancing versatility and addressing a wide range of message conversion rules.

[0121] In this application, a message mapping configuration model is designed and loaded into memory as the application's configuration to support dynamic parsing and transformation of messages. The message mapping configuration model includes global domain configuration, conditional judgment, multi-backend service configuration, request-response domain configuration, and field function conversion configuration. This model facilitates the configuration of different conditional branches and horizontal expansion of interface addresses. Furthermore, the message mapping rules support custom function conversion methods and other message transformation capabilities, achieving universality in message mapping configuration. Combined with message mapping rules featuring custom values, this facilitates the reuse, flexible configuration, and adaptability of the message mapping configuration model, thereby improving the efficiency and adaptability of message transformation.

[0122] Based on the above embodiments Figure 1 The present application discloses a message mapping multi-condition branching processing method and a corresponding message mapping multi-condition branching processing apparatus, such as... Figure 4 As shown, the message mapping multi-condition branch processing device includes:

[0123] The first acquisition unit 401 is used to acquire the transaction code identifier of the source request message of the requester in the scenario of multiple interfaces corresponding to the same transaction.

[0124] The second acquisition unit 402 is used to acquire the message mapping configuration list corresponding to the transaction code identifier through the message mapping configuration model, and to acquire the message mapping configuration that conforms to the conditional expression of the global domain from the message mapping configuration list;

[0125] The determining unit 403 is used to determine the target request message based on the request message domain-target mapping rules and message mapping configuration;

[0126] The third acquisition unit 404 is used to obtain the source response message through the target request message and the acquired target request address;

[0127] Calculation unit 405 is used to calculate the default response condition expression based on the source response message;

[0128] The judgment and acquisition unit 406 is used to judge whether the default response condition expression meets the default response condition, obtain the judgment result, and obtain the corresponding target response message based on the judgment result.

[0129] Furthermore, the second acquisition unit 402 includes:

[0130] The first acquisition module is used to obtain the list of message mapping configurations corresponding to the transaction code identifier from the message mapping configuration through the message mapping configuration model;

[0131] The traversal module is used to traverse the packet mapping configuration list until a packet mapping configuration in the list that matches the conditional expression for the global domain and is true is obtained.

[0132] Furthermore, the defining unit 403 includes:

[0133] The message conversion module is used to convert message mapping configurations that conform to the conditional expressions of the global domain into source request messages;

[0134] The parsing module is used to parse the source request message into a mapping data structure;

[0135] The conversion and assignment module is used to internally convert the mapping data structure and assign the converted mapping data structure to the target request message field corresponding to the source request message to obtain the target request message.

[0136] Furthermore, the third acquisition unit 404 includes:

[0137] The second acquisition module is used to obtain backend address information through the backend service identifier;

[0138] The first sending module is used to send the first target request message corresponding to the HTTP interface request to the downstream system through the webclient class if the backend address information belongs to the HTTP interface information.

[0139] The first receiving module is used to receive the source response message corresponding to the first target request message returned by the downstream system if the first target request message has not timed out or has no abnormality.

[0140] The second sending module is used to send the second target request message corresponding to the TCP request to the TCP request address through an asynchronous event-driven network application framework if the backend address information belongs to TCP interface information.

[0141] The second receiving module is used to send a second target request message to the downstream system. If the second target request message does not time out or has no abnormality, it receives the source response message corresponding to the second target request message returned by the downstream system.

[0142] Furthermore, the determination and acquisition unit 406 includes:

[0143] The first determination module is used to determine whether the default response condition expression conforms to the default response condition if the result of the default response condition expression is true.

[0144] The message conversion module is used to convert the source response message into the target response message according to the response message field-default configuration, provided that the default response condition expression meets the default response conditions.

[0145] The second determination module is used to determine that the default response condition expression does not meet the default response condition if the result of the default response condition expression is false.

[0146] The third acquisition module is used to acquire the target response message through the response message field-target configuration when the default response condition expression does not meet the default response condition.

[0147] In this embodiment, a message mapping configuration model is designed and loaded into memory as the application's configuration to support dynamic parsing and transformation of messages. The message mapping configuration model includes global domain configuration, conditional judgment, multi-backend service configuration, request-response domain configuration, and field function conversion configuration. This model facilitates the configuration of different conditional branches and horizontal expansion of interface addresses. Furthermore, the message mapping rules support custom function conversion methods and other message conversion capabilities, achieving universality in message mapping configuration. Combined with message mapping rules featuring custom values, this facilitates the reuse, flexible configuration, and adaptability of the message mapping configuration model, thereby improving the efficiency and adaptability of message conversion.

[0148] This application embodiment also provides a storage medium, the storage medium including stored instructions, wherein, when the instructions are executed, the device where the storage medium is located is controlled to execute the message mapping multi-condition branch processing method as described above.

[0149] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 5As shown, it specifically includes a memory 501 and one or more instructions 502, wherein one or more instructions 502 are stored in the memory 501 and are configured to be executed by one or more processors 503 to perform the above-mentioned message mapping multi-condition branch processing method.

[0150] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0151] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0152] The steps in the methods of the various embodiments of this application can be adjusted, combined, or deleted according to actual needs.

[0153] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0154] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0155] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A message mapping multi-condition branching processing method, characterized in that, The method includes: In scenarios where the same transaction corresponds to multiple interfaces, obtain the transaction code identifier of the source request message from the requester; The message mapping configuration list corresponding to the transaction code identifier is obtained through the message mapping configuration model, and the message mapping configuration that conforms to the conditional expression of the global domain is obtained from the message mapping configuration list. The target request message is determined based on the request message domain-target mapping rules and the message mapping configuration; The source response message is obtained by using the target request message and the obtained target request address; Calculate the default response condition expression based on the source response message; Determine whether the default response condition expression meets the default response condition, obtain the determination result, and obtain the corresponding target response message based on the determination result.

2. The method according to claim 1, characterized in that, The step of obtaining the message mapping configuration list corresponding to the transaction code identifier through the message mapping configuration model, and obtaining the message mapping configuration that conforms to the conditional expression of the global domain from the message mapping configuration list, includes: The message mapping configuration list corresponding to the transaction code identifier is obtained from the message mapping configuration through the message mapping configuration model; Iterate through the packet mapping configuration list until you find a packet mapping configuration in the list that satisfies the conditional expression for the global domain being true.

3. The method according to claim 1, characterized in that, The step of determining the target request message based on the request message domain-target mapping rule and the message mapping configuration includes: The message mapping configuration that conforms to the conditional expression of the global domain is used for message conversion to obtain the source request message; The source request message is parsed into a mapping data structure; The mapping data structure is internally transformed, and the transformed mapping data structure is assigned to the target request message field corresponding to the source request message to obtain the target request message.

4. The method according to claim 1, characterized in that, The step of obtaining the source response message through the target request message and the obtained target request address includes: Obtain the backend address information through the backend service identifier; If the backend address information belongs to HTTP interface information, the first target request message corresponding to the HTTP interface request is sent to the downstream system through the WebClient class; If the first target request message does not time out or has no abnormality, receive the source response message corresponding to the first target request message returned by the downstream system; If the backend address information belongs to TCP interface information, the second target request message corresponding to the TCP request is sent to the TCP request address through an asynchronous event-driven network application framework. Send the second target request message to the downstream system. If the second target request message does not time out or has no abnormality, receive the source response message corresponding to the second target request message returned by the downstream system.

5. The method according to claim 1, characterized in that, The step of determining whether the default response condition expression meets the default response condition, obtaining the determination result, and obtaining the corresponding target response message based on the determination result includes: If the result of the default response condition expression is true, it is determined that the default response condition expression conforms to the default response condition. If the default response condition expression meets the default response condition, the source response message is converted according to the response message field-default configuration to obtain the target response message; If the result of the default response condition expression is false, it is determined that the default response condition expression does not meet the default response condition. If the default response condition expression does not meet the default response condition, the target response message is obtained through the response message field-target configuration.

6. A message mapping multi-condition branch processing device, characterized in that, The method includes: The first acquisition unit is used to acquire the transaction code identifier of the source request message of the requester in the scenario of multiple interfaces corresponding to the same transaction. The second acquisition unit is used to acquire the message mapping configuration list corresponding to the transaction code identifier through the message mapping configuration model, and to acquire the message mapping configuration that conforms to the conditional expression of the global domain from the message mapping configuration list; The determining unit is configured to determine the target request message based on the request message domain-target mapping rules and the message mapping configuration; The third acquisition unit is used to obtain the source response message through the target request message and the acquired target request address; The calculation unit is used to calculate the default response condition expression based on the source response message; The judgment and acquisition unit is used to judge whether the default response condition expression meets the default response condition, obtain the judgment result, and obtain the corresponding target response message based on the judgment result.

7. The apparatus according to claim 6, characterized in that, The second acquisition unit includes: The first acquisition module is used to acquire a list of message mapping configurations corresponding to the transaction code identifier from the message mapping configuration; The traversal module is used to traverse the packet mapping configuration list until a packet mapping configuration in the packet mapping configuration list that meets the condition expression of the global domain is true is obtained.

8. The apparatus according to claim 6, characterized in that, The determining unit includes: The message conversion module is used to convert the message mapping configuration that conforms to the conditional expression of the global domain into a source request message; The parsing module is used to parse the source request message into a mapping data structure; The conversion and assignment module is used to internally convert the mapping data structure and assign the converted mapping data structure to the target request message field corresponding to the source request message to obtain the target request message.

9. A storage medium, characterized in that, The storage medium includes stored instructions, wherein, when the instructions are executed, the device where the storage medium is located is controlled to perform the message mapping multi-condition branching processing method as described in any one of claims 1 to 5.

10. An electronic device, characterized in that, It includes a memory, and one or more instructions, wherein one or more instructions are stored in the memory and configured to be executed by one or more processors as described in any one of claims 1 to 5.