CN115866087B - Message mapping and message conversion method, device and transmission system - Google Patents

Message mapping and message conversion method, device and transmission system Download PDF

Info

Publication number
CN115866087B
CN115866087B CN202211510034.6A CN202211510034A CN115866087B CN 115866087 B CN115866087 B CN 115866087B CN 202211510034 A CN202211510034 A CN 202211510034A CN 115866087 B CN115866087 B CN 115866087B
Authority
CN
China
Prior art keywords
mapping
field
message
target
mapping rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211510034.6A
Other languages
Chinese (zh)
Other versions
CN115866087A (en
Inventor
覃潘勇
邹锦伦
成泽杰
杨英炯
朱晗鸣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Guangfa Bank Co Ltd
Original Assignee
China Guangfa Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Guangfa Bank Co Ltd filed Critical China Guangfa Bank Co Ltd
Priority to CN202211510034.6A priority Critical patent/CN115866087B/en
Publication of CN115866087A publication Critical patent/CN115866087A/en
Application granted granted Critical
Publication of CN115866087B publication Critical patent/CN115866087B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a message mapping and message conversion method, a message mapping and message conversion device and a transmission system, wherein a source message is acquired through HTTP request parameters, and the source message is analyzed by combining with a mapping rule to identify a mapping strategy; identifying a field mapping rule based on the mapping strategy, and analyzing and checking a source message field according to the field mapping rule to obtain a target field set; and converting the target field set into a target message based on the target field set. The field-level mapping rule is provided, the field-level check logic is provided through the field mapping rule analysis and the check source message field, the check granularity is fine, and the accuracy of data transmission is improved.

Description

Message mapping and message conversion method, device and transmission system
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and apparatus for mapping and converting a message, and a transmission system.
Background
The bank-enterprise direct connection is used as an intermediate platform of the enterprise connected banks, the bank-enterprise direct connection bears the butting capability of the enterprise financial system and the bank financial services by means of the Internet or private line connection, a large number of enterprises need to be butted, and each enterprise needs to be butted with various financial services of the banks and is not minority. And the data interface specifications are different from enterprise financial system to enterprise financial system. Under the bank-enterprise cooperation mode, the bank needs a flexible and efficient solution to adapt to each request party interface, maps the request sender interface message into the request receiver interface message, and realizes the quick docking of enterprises while meeting the quick expansion of the business and ensuring the stability of the outputted financial service.
The existing message conversion method has the defects that the verification logic is used for verifying the converted target message, the verification granularity is relatively large, the data transmission error rate is relatively high, the conversion rule does not support built-in functions, the built-in functions are only used for encapsulation of logic operation, expansion is not supported, and the flexibility is poor in use.
Disclosure of Invention
The invention provides a message mapping and message conversion method, a message mapping and message conversion device and a transmission system, which are used for solving the technical problems that only a target message is checked in the message conversion process, the check granularity is relatively large, and the data transmission error rate is relatively high.
In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a method for mapping a message, including:
acquiring a source message, analyzing the source message according to the request parameters and combining the mapping rules, and identifying a mapping strategy;
identifying a field mapping rule based on the mapping strategy, and analyzing and checking a source message field according to the field mapping rule to obtain a target field set;
and converting the target field set into a target message based on the target field set.
The invention provides a field-level mapping rule, and the field-level check logic is provided by analyzing and checking the source message text field through the field mapping rule, so that the check granularity is fine, and the accuracy of data transmission is improved.
Further, the identifying a field mapping rule based on the mapping policy, analyzing and checking a source message field according to the field mapping rule to obtain a target field set, specifically:
determining a field mapping rule corresponding to each field in the source message according to the mapping strategy, and screening all fields needing to execute the field mapping rule as a first field set;
according to the field mapping rule corresponding to each first field, calculating the value of the corresponding expression of each first field;
checking the values of the expressions corresponding to the first fields according to the field mapping rules corresponding to the first fields, and screening all the checked first fields as a target field set; the target field set also records the value of the expression corresponding to each target field.
The invention identifies the field mapping rule through the mapping strategy, the field mapping rule provides a flexible and efficient expression calculation mode, and the efficiency of analyzing the source message field and the calculation speed of calculating the value of the source message field are improved.
Further, according to the field mapping rule corresponding to each first field, checking the value of the expression corresponding to each first field, and screening all the first fields passing the checking as the target field set, specifically:
screening all the fields which need to be filled as a second field set according to the field mapping rule corresponding to each first field;
and screening all the fields which pass through the data type checksum length verification as a target field set according to the field mapping rule corresponding to the second field.
The invention provides the field-level check logic, confirms the value of the field, judges the data type and the length of the field, avoids the subsequent data overflow and error, reduces the check granularity and improves the accuracy of data processing and data transmission.
Further, the step of obtaining the source message, according to the request parameter, analyzing the source message in combination with the mapping rule, and before identifying the mapping strategy, further includes:
and constructing an expression parser and configuring a mapping rule into a cache, wherein the cache is provided with a first-level local cache and a second-level Redis cache.
By setting the secondary cache, the invention avoids the risk of memory overflow of the local cache and improves the execution efficiency of the mapping rule.
Further, the construction of the expression parser and the configuration of the mapping rule into the cache are specifically:
constructing an expression parser based on the JsonPath, wherein the expression parser comprises a variable expression, a function expression, a constant expression and a Path expression;
modeling the mapping rule based on an expression parser, inserting model data into a database, and configuring the mapping rule and the model data into a cache; wherein, the mapping rule comprises a mapping strategy and a field mapping rule.
The invention provides flexible expression grammar by constructing the expression analyzer, can flexibly configure the mapping rule of the field level, and can support built-in functions and custom functions because the expression analyzer embeds the function expression.
Further, the acquiring the source message specifically includes:
firstly, data is read from a first-level local cache, if no data exists in the first-level local cache, the data is read from a second-level Redis cache, and if no data exists in the second-level Redis cache, the data is read from a database.
According to the invention, the risk of memory overflow of the local cache is avoided by setting the second-level cache, when data is acquired, the data is firstly acquired from the local cache based on the LRU cache policy, and if no data exists, the data is read from the second-level Redis cache, so that the speed of acquiring the data is improved and the execution efficiency of the mapping rule is improved.
In a second aspect, an embodiment of the present invention provides a method for converting a message of an HTTP request, including:
acquiring a request source message sent by a sender, generating a target request message by the message mapping method, and forwarding the target request message to a receiver;
obtaining a response source message generated by a receiver according to a target request message; the method for mapping the message generates the target response message and forwards the target response message to the sender.
In this embodiment, the message conversion method maps the request source message to the target request message of the receiver, and maps the response source message to the target response message. And connection is established between a sender and a receiver with different data interface specifications, so that hard coding workload of interface adaptation is reduced, possible defects caused by coding are reduced, and interface joint debugging progress is quickened. The data transmission efficiency is improved, and the quick butt joint of the sender and the receiver is realized.
In a third aspect, an embodiment of the present invention provides a packet mapping apparatus, including: the system comprises a mapping strategy identification module, a field analysis verification module and a message conversion module;
the mapping strategy identification module is used for acquiring a source message, analyzing the source message according to the request parameters and combining the mapping rules, and identifying the mapping strategy;
the field analysis and verification module is used for identifying a field mapping rule according to the mapping strategy, analyzing and verifying a source message field according to the field mapping rule, and obtaining a target field set;
the message conversion module is used for converting the target field set into a target message according to the target field set.
In a fourth aspect, an embodiment of the present invention provides a message conversion device for an HTTP request, including a request message mapping module and a response message mapping module;
the request message mapping module is used for acquiring a request source message sent by a sender, generating a target request message by the message mapping method and forwarding the target request message to a receiver;
the response message mapping module is used for obtaining a response source message generated by a receiver according to the target request message; the method for mapping the message generates the target response message and forwards the target response message to the sender.
In a fifth aspect, an embodiment of the present invention provides a data transmission system, including a sender, a receiver, and a packet conversion device applying the HTTP request of the present invention, where the sender and the receiver complete data interaction through the packet conversion device.
The invention provides a field-level mapping rule, and the field-level check logic is provided by analyzing and checking the source message text field through the field mapping rule, so that the check granularity is fine, and the accuracy of data transmission is improved.
Drawings
Fig. 1 is a schematic flow chart of a message mapping method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of data reading in step 101 according to a first embodiment of the present invention;
FIG. 3 is a flowchart of step 102 according to a first embodiment of the present invention;
fig. 4 is a schematic structural diagram of a message mapping device according to a first embodiment of the present invention;
fig. 5 is a flow chart of a message conversion method of an HTTP request according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a message conversion device for HTTP requests according to a second embodiment of the present invention;
fig. 7 is a data flow chart of a data transmission system according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a message mapping system according to a third embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
Referring to fig. 1, fig. 1 is a flow chart of a message mapping method according to an embodiment of the present invention, which mainly includes steps 101 to 103, specifically as follows:
step 101: and acquiring a source message, analyzing the source message according to the request parameters and combining the mapping rules, and identifying the mapping strategy.
In this embodiment, the path parameter in the url of the HTTP request and the contract parameter in the HTTP Header are used as the screening basis, and the mapping rule is combined to screen out the corresponding mapping policy.
In this embodiment, before the source packet is obtained, the source packet is parsed according to the request parameter and the mapping rule is combined, and before the mapping policy is identified, the method further includes: and constructing an expression parser and configuring a mapping rule into a cache, wherein the cache is provided with a first-level local cache and a second-level Redis cache.
In this embodiment, by setting the second level cache, the risk of memory overflow of the local cache is avoided, and the execution efficiency of the mapping rule is improved.
In this embodiment, an expression parser is built based on json Path, which contains variable expressions, function expressions, constant expressions, and Path expressions. By constructing the expression parser, flexible expression syntax is provided, and the expression parser embeds function expressions, so that built-in functions and custom functions can be supported.
Table 1 is a specific example of the expression parser provided in the present embodiment;
TABLE 1
In this embodiment, modeling is performed on the mapping rule based on an expression parser, model data is inserted into a database, and the mapping rule and the model data are configured into a cache; wherein, the mapping rule comprises a mapping strategy and a field mapping rule.
In this embodiment, the mapping policy indicates a basic policy that the request message and the response message are to complete the message mapping. The method defines the basic elements of the initiator identification, the receiver identification, the interface name, the strategy ID and the like which can be identified. These elements all need to satisfy a unique identification.
In this embodiment, the field mapping rule indicates a rule to be executed to complete one message mapping. Because two steps of request and response are needed for completing an HTTP request, the message mapping needs to be the message mapping of the request message and the message mapping of the response message, and the field mapping rule is divided into the field mapping rule of the request message and the field mapping rule of the response message, wherein the field mapping rule of the request message and the field mapping rule of the response message are different in that the field mapping rule of the response message also comprises a response code mapping rule, and the response code mapping rule comprises a strategy ID, a source message response code, a target response code and target corresponding information.
Table 2 is a specific example of the field mapping rule provided in this embodiment, and table 3 is a specific example of the response code mapping rule provided in this embodiment;
TABLE 2
TABLE 3 Table 3
In this embodiment, when the source packet is acquired, data is first read in the first-level local cache, if no data is in the first-level local cache, the data is read from the second-level Redis cache, and if no data is in the second-level Redis cache, the data is read from the database. By setting the secondary cache, the risk of memory overflow of the local cache is avoided, when data is acquired, the data is acquired from the local cache based on the LRU cache policy, and if no data exists, the data is read from the secondary Redis cache, so that the speed of acquiring the data is improved, and the execution efficiency of the mapping rule is improved. Referring to fig. 2, fig. 2 is a flow chart of data reading in step 101 according to an embodiment of the present invention.
Step 102: and identifying a field mapping rule based on the mapping strategy, and analyzing and checking the source message field according to the field mapping rule to obtain a target field set.
In this embodiment, the mapping policy identifies the field mapping rule, which provides a flexible and efficient expression calculation manner, so as to improve the efficiency of parsing the source message field and the calculation speed of calculating the value of the source message field.
Step 103: and converting the target field set into a target message based on the target field set.
In this embodiment, a JOSN open source tool is used to convert a target field set, where the target field set is an intermediate state data Map object, and a JSON open source tool converts the intermediate state data Map object into a JSON string, so as to obtain a target message.
Referring to fig. 3, fig. 3 is a flow chart of step 102 provided in the embodiment of the invention, which mainly includes steps 301 to 303, specifically as follows:
step 301: and determining a field mapping rule corresponding to each field in the source message according to the mapping strategy, and screening all fields needing to execute the field mapping rule as a first field set.
Step 302: and respectively calculating the value of the corresponding expression of each first field according to the field mapping rule corresponding to each first field.
In this embodiment, optimization and expansion are performed based on the open source component JsonPath, the source message field expression is calculated, and the calculation result is either put into the target path, temporarily stored as an intermediate variable, or returned as a method.
Step 303: screening all the fields which need to be filled as a second field set according to the field mapping rule corresponding to each first field; and screening all the fields which pass through the data type checksum length verification as a target field set according to the field mapping rule corresponding to the second field. The target field set also records the value of the expression corresponding to each target field.
In this embodiment, the value of the calculated expression is used for type verification using the expected type field in the field mapping rule.
In this embodiment, the present invention provides a field-level check logic to confirm the value of the field and determine the data type and length thereof, thereby avoiding subsequent data overflow and error, reducing check granularity, and improving the accuracy of data processing and data transmission.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a message mapping device according to an embodiment of the present invention, which mainly includes a mapping policy identification module 401, a field parsing and checking module 402, and a message conversion module 403.
In this embodiment, the mapping policy identifying module 401 is configured to obtain a source packet, analyze the source packet according to HTTP request parameters and combine a mapping rule, and identify a mapping policy;
the field parsing and checking module 402 is configured to identify a field mapping rule according to the mapping policy, parse and check a source message field according to the field mapping rule, and obtain a target field set;
the message conversion module 403 is configured to convert the target field set into a target message according to the target field set.
In the embodiment, the invention provides the field-level mapping rule, the field-level check logic is provided by analyzing and checking the source message field through the field mapping rule, the check granularity is fine, and the accuracy of data transmission is improved.
Example two
Referring to fig. 5, fig. 5 is a flow chart of a message conversion method of an HTTP request according to an embodiment of the present invention, which mainly includes steps 501 to 502, specifically as follows:
step 501: the method comprises the steps of obtaining a request source message sent by a sender, generating a target request message through the message mapping method provided by the embodiment of the invention, and forwarding the target request message to a receiver.
Step 502: obtaining a response source message generated by a receiver according to a target request message; by the message mapping method provided by the embodiment of the invention, the target response message is generated and forwarded to the sender.
In this embodiment, the message conversion method maps the request source message into the message interface with the receiver. And connection is established between a sender and a receiver with different data interface specifications, so that hard coding workload of interface adaptation is reduced, possible defects caused by coding are reduced, and interface joint debugging progress is quickened. The data transmission efficiency is improved, and the quick butt joint of the sender and the receiver is realized.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an HTTP request message conversion apparatus according to an embodiment of the present invention, where the HTTP request message mapping module 601 and the response message mapping module 602 are mainly described;
the request message mapping module 601 is configured to obtain a request source message sent by a sender, generate a target request message according to the message mapping method provided by the present invention, and forward the target request message to a receiver.
The response message mapping module 602 is configured to obtain a response source message generated by a receiver according to a target request message; by the message mapping method provided by the invention, the target response message is generated and forwarded to the sender.
Referring to fig. 7, fig. 7 is a data flow chart of a data transmission system according to an embodiment of the present invention, which mainly includes a sender, a receiver, and the message conversion device, where the sender and the receiver complete data interaction through the message conversion device.
In this embodiment, the sending unit sends a request source message to the message conversion device, and the message conversion device maps the request source message to a target request message adapted to the interface specification of the receiving party, and forwards the target request message to the receiving party.
The receiving party responds after receiving the target request message and sends a response source message to the message conversion device, and the message conversion device maps the response source message into a target response message which is matched with the interface specification of the sending party and forwards the target response message to the sending party.
Example III
As an example of the message mapping method provided by the embodiment of the present invention, the present embodiment provides a system to which the message mapping method provided by the present invention is applied, please refer to fig. 8, fig. 8 is a schematic structural diagram of the message mapping system provided by the embodiment of the present invention, which mainly includes a mapping rule execution module 801, a mapping rule management module 802, a buffer module 803, and an expression module 804.
In this embodiment, the mapping rule execution module 801 is configured to identify a mapping policy according to a request parameter, and then screen out a corresponding field mapping rule and a corresponding response code mapping rule according to the identified mapping policy. And constructing an expression parser according to the source message, and traversing and executing the screened field mapping rule by using a mapping rule executor. For each field mapping rule, the value of the field expression of the rule source message is executed, and the value is checked.
In this embodiment, the mapping rule execution module 801 specifically includes a mapping policy identification module and a mapping rule execution module.
The mapping policy identification module is used for identifying a mapping policy according to HTTP request parameters to obtain a policy ID, wherein the request parameters comprise a requester identifier, a receiver identifier and an interface name. And reading the corresponding field mapping rule from the cache module according to the strategy ID and the request identifier or the response identifier.
And the mapping rule execution module traverses the field mapping rule. Firstly screening all fields needing to execute a field mapping rule as first field aggregate, and then respectively calculating the value of each first field corresponding expression according to the field mapping rule corresponding to each first field; screening all the characters to be filled as a second field set according to the field mapping rule corresponding to each first field; and then screening all the fields which pass through the data type checksum length verification according to the field mapping rule corresponding to the second field to be used as a target field set, judging whether the temporary variable of the field mapping rule is needed when the target field set is screened, if so, mapping the values of the fields and the variables into a context for the subsequent field mapping rule, and if not, adding the values of the fields and the fields into the target field set.
In this embodiment, the mapping rule management module 802 is configured to take charge of loading, reading and updating the mapping rule. Loaded and stored in the buffer module 803 at system start-up for reading and execution by the mapping rule execution module 801. When the mapping rule is updated, the mapping rule is updated to the database and then deleted from the cache module 803.
In this embodiment, the mapping rule management module includes a mapping rule maintenance module and a mapping rule reading module.
In this embodiment, the mapping rule maintenance module is configured to take charge of configuration, update and deletion operations of the mapping rule. The mapping rules comprise a mapping strategy, a field mapping rule and a response code mapping rule. When in configuration, the mapping strategy is firstly configured, and then the field mapping rule and the response code mapping rule are configured. When updating, the mapping rule in the database is updated first, and the mapping rule in the cache module 803 is deleted. And when deleting, deleting the mapping rules in the database and the cache module at the same time.
The mapping strategy represents a basic strategy that the request message and the response message are required to complete message mapping. The method defines the basic elements of the initiator identification, the receiver identification, the interface name, the strategy ID and the like which can be identified. These elements all need to satisfy a unique identification.
The field mapping rule indicates a rule to be executed to complete one message mapping. Because two steps of request and response are needed to complete an HTTP request, the message mapping needs to be the message mapping of the request message and the message mapping of the response message, and the field mapping rule is divided into the field mapping rule of the request message and the field mapping rule of the response message.
The field mapping rule of the response message also comprises a response code mapping rule, and the response code mapping rule configures the mapping rule of the response code in the response message.
In this embodiment, the mapping rule reading module is configured to be responsible for loading the mapping rule at system start-up, and reading the mapping rule from the cache module 803 at the time of executing the rule.
In this embodiment, the buffer module 803 is configured to provide unified data reading, writing, updating and deleting operations for the buffer module, and encapsulates two layers of buffers: a first level local cache and a second level Redis cache. The local cache mainly stores frequently used or loaded configuration during system initialization; redis cache stores database full configuration information.
In this embodiment, the primary local cache uses two JDK self-contained data structures to implement LRU-based cache policies. One is that the ConcurrentHashMap object map is used for storing keys and values thereof, and the data structure can rapidly judge whether the cache contains the designated keys or not and also has the non-repeatable characteristic of the keys. One is a LinkedList object queue that is used to manage the least recently used keys. The Redis stores the full amount of mapping rules. At system start-up, the mapping rules are loaded and added to the cache module. When the data is read, the data is preferentially read from the first-level local cache, and if no data is read from the second-level Redis cache. And finally, reading from the database if no data exists in the cache module.
As a specific example of this embodiment, the local cache maintenance of the cache module 503 specifically includes:
s1, inquiring a local cache by using a key;
s2, deleting the key appearing for the first time in the queue if the map contains the key, adding the key to the head of the queue, and ending the local cache maintenance; otherwise, executing S3;
s3, inquiring a Redis cache; if the data exists, executing S4; otherwise, executing S5;
s4, judging whether the size of the current map is larger than the size threshold value of the local cache by 1; if yes, directly returning without any operation; otherwise, the data and the key are stored in the map, the key appearing for the first time in the queue is deleted, the key is added to the head of the queue, and the local cache maintenance is finished;
s5, inquiring a database, and if no data exists, terminating a data reading operation; otherwise, executing S6;
s6, inserting the queried data into Redis, and executing S4.
In this embodiment, the expression module 504 is optimized and extended based on the open source component JsonPath. In the aspect of optimization, the problem of memory overflow of a setProperty method in JsonSmartJsonProvider is solved. In an extended aspect, variable expressions (types such as $sponsorid), constant expressions (types such as literal characters a, 123, etc.), native Path expressions (types such as $body name), function expressions (types such as $concat ("a", "-") and nested uses between function expressions and various expressions (types such as $concat ("a", $sponsoid)) are supported, respectively, for configuring mapping rules.
In this embodiment, the expression module supports JSON Path expressions, variable expressions, constant expressions, and function expressions. The expression module is used for compiling the expression character string to generate a corresponding expression object, and caching the object, so that the performance consumption of the next same JSON document requiring recompilation in the same path is reduced; and calling a getValue method of the expression object to complete the calculation of the expression, and finally returning a calculation result.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention, and are not to be construed as limiting the scope of the invention. It should be noted that any modifications, equivalent substitutions, improvements, etc. made by those skilled in the art without departing from the spirit and principles of the present invention are intended to be included in the scope of the present invention.

Claims (9)

1. A method for mapping messages, comprising:
acquiring a source message, analyzing the source message according to the request parameters and combining the mapping rules, and identifying a mapping strategy; the mapping rules comprise a mapping strategy and field mapping rules, wherein the mapping strategy comprises a plurality of unique identifiers, and the field mapping rules represent rules to be executed when one message mapping is to be completed;
identifying a field mapping rule based on the mapping strategy, and analyzing and checking a source message field according to the field mapping rule to obtain a target field set;
converting the target field set into a target message based on the target field set;
the method comprises the steps of identifying a field mapping rule based on the mapping strategy, analyzing and checking a source message field according to the field mapping rule to obtain a target field set, wherein the target field set is specifically as follows: determining a field mapping rule corresponding to each field in the source message according to the mapping strategy, and screening all fields needing to execute the field mapping rule as a first field set; according to the field mapping rule corresponding to each first field, calculating the value of the corresponding expression of each first field; checking the values of the expressions corresponding to the first fields according to the field mapping rules corresponding to the first fields, and screening all the checked first fields as a target field set; the target field set also records the value of the expression corresponding to each target field.
2. The method of claim 1, wherein the checking the values of the expressions corresponding to the first fields according to the field mapping rules corresponding to the first fields, and screening all the checked first fields as the target field set, specifically includes:
screening all the fields which need to be filled as a second field set according to field mapping rules corresponding to the first fields;
and screening all the fields which pass through the data type checksum length verification as a target field set according to the field mapping rule corresponding to the second field.
3. The message mapping method according to claim 1, wherein before the source message is obtained, the source message is parsed according to the request parameter in combination with the mapping rule, and the mapping policy is identified, the method further comprises:
and constructing an expression parser and configuring a mapping rule into a cache, wherein the cache is provided with a first-level local cache and a second-level Redis cache.
4. The message mapping method according to claim 3, wherein the constructing an expression parser and configuring the mapping rule into a cache specifically includes:
constructing an expression parser based on the JsonPath, wherein the expression parser comprises a variable expression, a function expression, a constant expression and a Path expression;
modeling the mapping rule based on an expression parser, inserting model data into a database, and configuring the mapping rule and the model data into a cache; wherein, the mapping rule comprises a mapping strategy and a field mapping rule.
5. The message mapping method as claimed in claim 4, wherein the obtaining the source message specifically includes:
firstly, data is read from a first-level local cache, if no data exists in the first-level local cache, the data is read from a second-level Redis cache, and if no data exists in the second-level Redis cache, the data is read from a database.
6. The message conversion method of the HTTP request is characterized by comprising the following steps:
obtaining a request source message sent by a sender, generating a target request message by the message mapping method according to any one of claims 1 to 5, and forwarding the target request message to a receiver;
obtaining a response source message generated by a receiver according to a target request message; a target response message is generated by a message mapping method according to any one of claims 1 to 5 and forwarded to a sender.
7. A message mapping apparatus, comprising: the system comprises a mapping strategy identification module, a field analysis verification module and a message conversion module;
the mapping strategy identification module is used for acquiring a source message, analyzing the source message according to the request parameters and combining the mapping rules, and identifying the mapping strategy; the mapping rules comprise a mapping strategy and field mapping rules, wherein the mapping strategy comprises a plurality of unique identifiers, and the field mapping rules represent rules to be executed when one message mapping is to be completed;
the field analysis and verification module is used for identifying a field mapping rule according to the mapping strategy, analyzing and verifying a source message field according to the field mapping rule, and obtaining a target field set;
the message conversion module is used for converting the target field set into a target message according to the target field set;
the method comprises the steps of identifying a field mapping rule based on the mapping strategy, analyzing and checking a source message field according to the field mapping rule to obtain a target field set, wherein the target field set is specifically as follows: determining a field mapping rule corresponding to each field in the source message according to the mapping strategy, and screening all fields needing to execute the field mapping rule as a first field set; according to the field mapping rule corresponding to each first field, calculating the value of the corresponding expression of each first field; checking the values of the expressions corresponding to the first fields according to the field mapping rules corresponding to the first fields, and screening all the checked first fields as a target field set; the target field set also records the value of the expression corresponding to each target field.
8. The message conversion device for the HTTP request is characterized by comprising a request message mapping module and a response message mapping module;
the request message mapping module is configured to obtain a request source message sent by a sender, generate a target request message by using the message mapping method according to any one of claims 1 to 5, and forward the target request message to a receiver;
the response message mapping module is used for obtaining a response source message generated by a receiver according to the target request message; a target response message is generated by a message mapping method according to any one of claims 1 to 5 and forwarded to a sender.
9. A data transmission system, comprising a sender, a receiver and a message conversion device applying the HTTP request as set forth in claim 8, wherein the sender and the receiver complete data interaction through the message conversion device.
CN202211510034.6A 2022-11-29 2022-11-29 Message mapping and message conversion method, device and transmission system Active CN115866087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211510034.6A CN115866087B (en) 2022-11-29 2022-11-29 Message mapping and message conversion method, device and transmission system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211510034.6A CN115866087B (en) 2022-11-29 2022-11-29 Message mapping and message conversion method, device and transmission system

Publications (2)

Publication Number Publication Date
CN115866087A CN115866087A (en) 2023-03-28
CN115866087B true CN115866087B (en) 2023-11-17

Family

ID=85667653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211510034.6A Active CN115866087B (en) 2022-11-29 2022-11-29 Message mapping and message conversion method, device and transmission system

Country Status (1)

Country Link
CN (1) CN115866087B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682235A (en) * 2017-01-18 2017-05-17 济南浪潮高新科技投资发展有限公司 System and method for isomerous data mapping
CN108881172A (en) * 2018-05-22 2018-11-23 阿里巴巴集团控股有限公司 The analysis method and device of message
CN110290135A (en) * 2019-06-24 2019-09-27 四川新网银行股份有限公司 The data flow of method and request to complicated message unified standardization processing side
WO2020140679A1 (en) * 2019-01-03 2020-07-09 深圳壹账通智能科技有限公司 Interface docking method and apparatus, computer device and storage medium
CN111917825A (en) * 2020-06-23 2020-11-10 中国建设银行股份有限公司 Heterogeneous system data interaction method and device
CN112115190A (en) * 2020-08-20 2020-12-22 苏宁云计算有限公司 Method, device and system for converting interface message
CN113271237A (en) * 2021-06-16 2021-08-17 山石网科通信技术股份有限公司 Industrial control protocol analysis method and device, storage medium and processor
CN113626421A (en) * 2021-08-02 2021-11-09 浪潮软件股份有限公司 Data quality control method for data verification
CN114500690A (en) * 2022-02-15 2022-05-13 平安科技(深圳)有限公司 Interface data processing method and device, electronic equipment and storage medium
CN115099196A (en) * 2022-06-28 2022-09-23 中国工商银行股份有限公司 Method and device for converting message into data entity
CN115396228A (en) * 2022-09-01 2022-11-25 建信金融科技有限责任公司 Heterogeneous message transmission method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040205562A1 (en) * 2001-12-27 2004-10-14 G.E. Information Services, Inc. System and method for transforming documents to and from an XML format

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682235A (en) * 2017-01-18 2017-05-17 济南浪潮高新科技投资发展有限公司 System and method for isomerous data mapping
CN108881172A (en) * 2018-05-22 2018-11-23 阿里巴巴集团控股有限公司 The analysis method and device of message
WO2020140679A1 (en) * 2019-01-03 2020-07-09 深圳壹账通智能科技有限公司 Interface docking method and apparatus, computer device and storage medium
CN110290135A (en) * 2019-06-24 2019-09-27 四川新网银行股份有限公司 The data flow of method and request to complicated message unified standardization processing side
CN111917825A (en) * 2020-06-23 2020-11-10 中国建设银行股份有限公司 Heterogeneous system data interaction method and device
CN112115190A (en) * 2020-08-20 2020-12-22 苏宁云计算有限公司 Method, device and system for converting interface message
CN113271237A (en) * 2021-06-16 2021-08-17 山石网科通信技术股份有限公司 Industrial control protocol analysis method and device, storage medium and processor
CN113626421A (en) * 2021-08-02 2021-11-09 浪潮软件股份有限公司 Data quality control method for data verification
CN114500690A (en) * 2022-02-15 2022-05-13 平安科技(深圳)有限公司 Interface data processing method and device, electronic equipment and storage medium
CN115099196A (en) * 2022-06-28 2022-09-23 中国工商银行股份有限公司 Method and device for converting message into data entity
CN115396228A (en) * 2022-09-01 2022-11-25 建信金融科技有限责任公司 Heterogeneous message transmission method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115866087A (en) 2023-03-28

Similar Documents

Publication Publication Date Title
CN101930400B (en) SDK (Software Development Kit) automatic test system and method
US20030055809A1 (en) Methods, systems, and articles of manufacture for efficient log record access
US7996822B2 (en) User/process runtime system trace
CN111444111A (en) Performance testing method and device based on python, computer equipment and storage medium
CN110389765B (en) Parameter verification method and parameter verification system
CN110175163A (en) More library separation methods, system and medium based on business function intelligently parsing
CN101819551B (en) Method and system for recording service interaction data of enterprise message system
CN111309751A (en) Big data processing method and device
CN113568604B (en) Method and device for updating wind control strategy and computer readable storage medium
US10656922B2 (en) Systems and methods for providing an application transformation tool
CN112395339B (en) Intersystem data admission verification method, device, computer equipment and storage medium
CN115866087B (en) Message mapping and message conversion method, device and transmission system
WO2019111109A1 (en) Error handling
CN115422225A (en) Distributed transaction processing method, transaction manager, middleware and system
Eslamichalandar et al. Service composition adaptation: An overview
CN111151008B (en) Verification method and device for game operation data, configuration background and medium
CN115022312A (en) Method and device for realizing multiple intelligent contract engines, electronic equipment and storage medium
CN113238817A (en) Interface transparent transmission method and device, electronic equipment and storage medium
CN111949259A (en) Risk decision configuration method, system, electronic equipment and storage medium
US8868424B1 (en) Interactive voice response data collection object framework, vertical benchmarking, and bootstrapping engine
KR101737575B1 (en) Method and device for verifying data based on sql sentences generated automatically
CN112051990A (en) Network management northbound interface model adaptation method and system
CN113411234B (en) Interface testing method, system and computer readable storage medium
CN113467860A (en) Method and device for executing service logic of program source code
CN115113856A (en) Automatic code generation method, system, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant