CN112118142A - Message transmission method and device - Google Patents

Message transmission method and device Download PDF

Info

Publication number
CN112118142A
CN112118142A CN202011039163.2A CN202011039163A CN112118142A CN 112118142 A CN112118142 A CN 112118142A CN 202011039163 A CN202011039163 A CN 202011039163A CN 112118142 A CN112118142 A CN 112118142A
Authority
CN
China
Prior art keywords
data
message
mapping
transaction
routing
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.)
Pending
Application number
CN202011039163.2A
Other languages
Chinese (zh)
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202011039163.2A priority Critical patent/CN112118142A/en
Publication of CN112118142A publication Critical patent/CN112118142A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0226Mapping or translating multiple network management protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • H04L49/3009Header conversion, routing tables or routing tags
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a message transmission method and a device, which relate to the technical field of communication, and the method comprises the following steps: acquiring access management data, analysis data, mapping data and routing data; acquiring a message to be transmitted according to the access management data; analyzing the message to be transmitted according to the analysis data to obtain an analysis result; converting the analysis result into a target format according to the mapping data to obtain a mapping result; and sending the mapping result to the target end according to the routing data. The invention realizes the access and the transfer of the multi-channel and multi-format message by the configuration of the access management data, the analysis data, the mapping data and the routing data.

Description

Message transmission method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting a packet.
Background
The message may be transmitted through a distributed gateway. At present, the mainstream distributed gateways include springclosed zuul and springclosed gateway, and the two gateways have similar principles. The existing scheme only supports http (HyperText Transfer Protocol) request access, and forwarding also only supports http background. However, in practical applications, the application system may receive transactions with different formats from multiple transaction channels, such as xml (Extensible Markup Language)/json (JavaScript Object Notation)/fixed length message from socket channel, for example, entity message called in dubbo manner. In the micro-service era, the technical stacks of the background service modules can be various, and the background service modules have spring closed exposed restful interfaces and dubbo exposed dubbo interfaces, so that the existing gateway scheme cannot meet the diversified access and roll-out requirements.
Disclosure of Invention
The invention provides a message transmission method and a message transmission device, which can realize multi-channel and multi-format message access and transfer.
In a first aspect, an embodiment of the present invention provides a packet transmission method, where the method includes: acquiring access management data, analysis data, mapping data and routing data; acquiring a message to be transmitted according to the access management data; analyzing the message to be transmitted according to the analysis data to obtain an analysis result; converting the analysis result into a target format according to the mapping data to obtain a mapping result; and sending the mapping result to a target end according to the routing data.
In a second aspect, an embodiment of the present invention further provides a message transmission apparatus, where the apparatus includes: the acquisition module is used for acquiring access management data, analysis data, mapping data and routing data; the access message management module acquires a message to be transmitted according to the access management data; the access message analysis module is used for analyzing the message to be transmitted according to the analysis data to obtain an analysis result; the outgoing message mapping module is used for converting the analysis result into a target format according to the mapping data to obtain a mapping result; and the routing control module is used for sending the mapping result to a target end according to the routing data.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the message transmission method when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing the message transmission method is stored in the computer-readable storage medium.
The embodiment of the invention has the following beneficial effects: the embodiment of the invention provides a message transmission scheme, which comprises the steps of firstly obtaining access management data, analysis data, mapping data and routing data, then obtaining a message to be transmitted according to the access management data, then analyzing the message to be transmitted according to the analysis data to obtain an analysis result, converting the analysis result into a target format according to the mapping data to obtain a mapping result, and finally sending the mapping result to a target end according to the routing data. The embodiment of the invention realizes the access and the transfer of the multi-channel and multi-format message through the configuration of the access management data, the analysis data, the mapping data and the routing data.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a message transmission method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an implementation principle of a message transmission method according to an embodiment of the present invention;
fig. 3 is an exemplary diagram of fixed-length message analysis provided in the embodiment of the present invention;
fig. 4 is a schematic diagram illustrating an implementation step of a message transmission method according to an embodiment of the present invention;
fig. 5 is a block diagram of a message transmission apparatus according to an embodiment of the present invention;
fig. 6 is a block diagram of another structure of a message transmission apparatus according to an embodiment of the present invention;
fig. 7 is a block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Currently, existing distributed gateways have the following limitations:
1. only supporting http request access, and only supporting http background during forwarding.
2. The plug and play authority control is not supported, and if authentication is needed, the Filter (Filter) of the authority control needs to be used for expansion.
3. Many traditional inter-application communication still adopt the socket mode, and data packet format xml/json/fixed length etc. all appear, and springclosed gateway does not support docking socket access. And meanwhile, the access and forwarding of the dubbo request are not supported.
4. Transaction current limiting needs to be integrated by itself, but the current transaction request amount is used for limiting current, and dynamic adjustment cannot be carried out according to actual processing capacity of background transactions.
In the existing scheme, the transaction authority control needs integration by a developer, cannot dynamically adjust and open or close a certain transaction, and also does not support authority dynamic configuration on certain parameter values in an Application Programming Interface (API). In addition, transaction authority control also needs to integrate some common algorithms such as counters and token buckets by itself, and does not support dynamic adjustment of the current limiting rule according to the actual processing capacity of background services. In addition, for API access and transfer rules, authority control, current limiting policies, and the like, there is no unified and visual Web (World Wide Web, global Wide area network or World Wide Web) management end, and various rules and policies cannot be dynamically added without offline.
Based on this, the method and the device for transmitting the message provided by the embodiment of the invention can realize channel access management, message analysis, forwarding mapping and dynamic routing through configuration. After the gateway is on line, the transaction definition and the transaction interface change can be completed only by adjusting the configuration without relating to service starting. The method supports the message access of various channels and formats and the service transfer to the backstage spring cluster and dubbo technology stack by defining the API access rule and the transfer rule. Basic current limiting rules can be added in real time, and current limiting strategies can be adjusted in real time according to the response time of background transaction processing.
To facilitate understanding of the embodiment, a detailed description is first given to a message transmission method disclosed in the embodiment of the present invention.
The terms involved are explained first.
Multi-channel: including http, socket, and dubbo channels.
Multi-format: including xml, json, and fixed length formats.
Generalization and calling: the method is mainly used for the case that the dubbo client has no API (application programming interface) and model type elements, and all POJOs (simple Java objects) in parameters and return values are represented by Map and are generally used for framework integration.
An embodiment of the present invention provides a message transmission method, referring to a flow chart of a message transmission method shown in fig. 1, where the method includes the following steps:
step S102, access management data, analysis data, mapping data and routing data are obtained.
In the embodiment of the invention, the access management data is used for managing the accessed message data, and managing the channel and format of the accessed message data to obtain the message to be transmitted. The analysis data is used for determining analysis rules of messages in different formats in different channels, and differential analysis is achieved. The mapping data is used for determining a mapping rule for converting the analysis result into a target format, so that the output message meets the requirement of a target end, and the mapping result is obtained. The routing data is used to determine how to send the mapping result to the destination, and also used to determine information such as the forwarding address of the destination.
And step S104, obtaining the message to be transmitted according to the access management data.
In the embodiment of the invention, the accessed message is managed by using the access management data so as to realize the access in various modes of http, socket, dubbo and the like, and the access of the xml/json/fixed-length message is supported in the message format. It should be noted that, by configuring the access management data, the thread pools of different access modes can be isolated from each other, and the thread pools do not affect each other.
And S106, analyzing the message to be transmitted according to the analysis data to obtain an analysis result.
In the embodiment of the present invention, in order to identify the packet to be transmitted, the packet to be transmitted needs to be analyzed according to the analysis data. For example, for a JSON-formatted message, the message itself is in the form of a key-value key value pair, and a rule does not need to be parsed. Referring to the exemplary diagram of fixed-length message parsing shown in fig. 3, for a fixed-length message, if there is no definition of a parsing rule, the message cannot be parsed at all, and for a fixed-length message, the parsing rule needs to sequentially specify a fixed length occupied by each field, for example, in this example, the transaction code is fixed by 5, and the request sequence number is fixed by 10 bits. In the example, the fixed-length parsing rule is only a simple message, and if a complex message relates to a loop body, a flag field for defining the loop start and the loop end is added to the parsing rule. So far, according to the fixed-length parsing rule, the fixed-length message: "T1000 REQ 190000120200916103400", the analysis results may be internal intermediate results: { tranCode: "T1000", uuid: "REQ1900001", reqDate: "20200916", reqTime: "103400" }.
For another example, for an XML message:
<REQUEST>
<TRAN_CODE>T1000</TRAN_CODE>
<UUID>REQ1900001</UUID>
<REQ_DATE>20200916</REQ_DATE>
<REQ_TIME>103400</REQ_TIME>
</REQUEST>
from the parsing data, a parsing rule needs to be determined, so that it is parsed into the following similar intermediate results: { tranCode: "T1000", uuid: "REQ1900001", reqDate: "20200916", reqTime: "103400" }, then the REQUEST label is parsed into HashMap for the parsing rule. Meanwhile, the alias of the TRAN _ CODE label is defined as tranCode, and the alias of the UUID label is defined as UUID.
And step S108, converting the analysis result into a target format according to the mapping data to obtain a mapping result.
In the embodiment of the present invention, after different messages are all analyzed into an internal intermediate format to obtain an analysis result, because the message in the intermediate format cannot generally satisfy the format requirement of the message transferred out by the gateway, the analysis result needs to be converted into a target format according to a mapping rule determined by mapping data, for example: the received message is in a fixed length format: t1000REQ190000120200916103400, the outgoing message needs to be converted into XML message format:
<REQUEST>
<TRAN_CODE>T1000</TRAN_CODE>
<UUID>REQ1900001</UUID>
<REQ_DATE>20200916</REQ_DATE>
<REQ_TIME>103400</REQ_TIME>
</REQUEST>
the mapping rule is how to map the internal intermediate format message into the above XML format: { tranCode: "T1000", uuid: "REQ1900001", reqDate: "20200916", reqTime: "103400" }.
And step S110, sending the mapping result to the target end according to the routing data.
In the embodiment of the invention, the routing rule is determined according to the routing data, so that the mode of the application (the traditional application/dubbo application/springclosed application) which is finally transferred to the back end of a transaction is determined. The target end is a backend application end, and may be, for example, a traditional http backend application end, a dubbo backend application end, a springclosed backend application end, or a socket backend application end.
For example, forwarding to a traditional http application, the routing rules are similar:
the application is similar: the traditional method is that;
the back-end application access protocol: http;
whether to use client load balancing: y;
forwarding address: http:// ip1 port1/trans/xxxx, http:// ip2 port 2/trans/xxxx.
For another example, after forwarding, springclosed/dubbo applies, then the routing rule is similar:
the application is similar: springclosed/dubbo;
the back-end application access protocol: http/dubbo;
the address of the registration center: zk address/eureka address.
The embodiment of the invention provides a message transmission scheme, which comprises the steps of firstly obtaining access management data, analysis data, mapping data and routing data, then obtaining a message to be transmitted according to the access management data, then analyzing the message to be transmitted according to the analysis data to obtain an analysis result, converting the analysis result into a target format according to the mapping data to obtain a mapping result, and finally sending the mapping result to a target end according to the routing data. The embodiment of the invention realizes the access and the transfer of the multi-channel and multi-format message through the configuration of the access management data, the analysis data, the mapping data and the routing data.
Considering that the applied routing rules of different modes may be different, the routing data comprises load balancing data; sending the mapping result to the destination according to the routing data, which can be performed according to the following steps:
judging whether the target end comprises a load balancer or not; if yes, sending the mapping result to the target end according to the routing data; and if not, generating a load balancing result according to the load balancing data, and sending the mapping result to the target end according to the routing data and the load balancing result.
In the embodiment of the invention, the target end can be a traditional http back end application end, a dubbo back end application end, a springclosed back end application end or a socket back end application end. For a dubbo back-end application end and a springclosed back-end application end, the mapping result can be directly sent to a target end, for a traditional http back-end application end and a socket back-end application end, whether the target end comprises a load balancer or not needs to be judged, if the target end comprises the load balancer, the mapping result can be directly sent to the target end according to routing data, if the target end does not comprise the load balancer, a load balancing result is generated according to the load balancing data, and a load balancing strategy of the target end is started by a gateway.
In order to reduce the stress caused by the inconsistency of the processing speeds, considering that the front-end and back-end data processing speeds may have differences, the method may further perform the following steps:
recording a message to be transmitted and a mapping result sent to a target end; calculating the average response time of each transaction according to the message to be transmitted and the mapping result sent to the target end; and generating transaction current-limiting control data according to the average response time length, and sending the transaction current-limiting control data to an alarm module.
In the embodiment of the invention, the message to be transmitted is recorded so as to record the information of the access transaction, the mapping result sent to the target end is recorded so as to record the information of the transfer-out transaction, the average response time of each transaction is calculated based on the information of the access transaction and the information of the transfer-out transaction, so that the pressure condition of a back-end system is judged, and if the back-end responds too slowly, transaction current-limiting control data can be generated, so that partial current-limiting control on the transaction is realized.
In order to facilitate the maintenance of the rights to the relevant transaction, the method may further perform the steps of:
acquiring transaction authority data; generating transaction authority data according to the transaction current limiting control data; and controlling the calling frequency and the transaction state of the transaction according to the transaction authority data.
In the embodiment of the present invention, similar to the access management data, the parsing data, the mapping data, and the routing data, the transaction right data may also be configured in advance. And generating transaction authority data according to the transaction current-limiting control data so as to control the calling frequency and the transaction state of the transaction, wherein the transaction state can be used for controlling whether a certain transaction is opened or not.
In order to implement dynamic management of the channel and format of the transmitted message, the method may further perform the following steps:
reconfiguring access management data, parsing data, mapping data and routing data.
In the embodiment of the present invention, the reconfiguration includes one or more of a modification process, a deletion process, and an addition process. For example, reconfiguration is performed on access management data, and a certain access thread pool can be dynamically added or closed.
It should be noted that, when the application is started, the access management data, the analysis data, the mapping data, and the routing data need to be loaded to the memory in advance, and when the rule is changed, the reconfigured data needs to be synchronized to the memory, so as to achieve dynamic adjustment and real-time effect, and the gateway application does not need to be restarted.
It should be noted that the configurations of the access management data, the parsing data, the mapping data and the routing data are mutually influenced. For example, if the access management data is reconfigured to increase the format of the message that can be processed, the parsing data also needs to be configured to implement parsing of the new format, the mapping data is configured to implement mapping processing of the new format, and the routing data is configured to implement sending of the message to be transmitted to the target. Through dynamic access management, the access mode can be dynamically adjusted in real time; the message access mapping and the message transfer-out mapping ensure that the message can be dynamically analyzed and mapped, and the format of the access message is not necessarily the same as that of the message transferred out; and dynamic routing can be performed, and the routing can be performed to services of different technology stacks (socket/http/springclosed/dubbo) at the back end.
The implementation principle of the method is described below with a specific embodiment, referring to the schematic diagram of the implementation principle of the message transmission method shown in fig. 2,
the access message management module is a core module of which the access module is used as a gateway inlet, and simultaneously supports multiple access modes such as http, socket, dubbo and the like, and supports access of xml/json/fixed length messages in message formats. The thread pools of different access modes are isolated from each other, so that the thread pools do not influence each other, and most importantly, the portal end can dynamically add or close a certain access mode, does not stop, does not update the version, and dynamically adjusts the access mode in real time.
An access message analysis module: the message analysis module is internally provided with a plurality of message analyzers including a fixed-length message analyzer, an XML message analyzer, a JSON message analyzer, a transparent transmission message analyzer and the like. The analyzer loads the analysis rule of each interface from the memory to realize differential analysis. If a newly-added interface or an interface is modified, the new interface or the interface is maintained at the portal end in real time, and the latest analysis rule can refresh the memory in real time. The core of the access message analysis module is to realize dynamic analysis of messages with different formats by loading analysis rules in real time, and the access message analysis module is not influenced by interface change and does not stop, and does not relate to program version updating.
An outgoing message mapping module: the module converts the format of the outgoing message in real time according to the mapping rule of the outgoing message and the analysis result of the access message analysis module. For example, the interface message format is a fixed-length message, and the fixed-length message is processed by the outgoing message mapping module and then forwarded to the background, which may be a standard json or xml message. And after the mapping rules are configured at the portal end, the mapping rules are loaded into the memory in real time, and the outgoing message mapping module loads the latest rules from the memory in real time.
A routing control module: the routing module is responsible for following the routing rule and forwarding the message converted by the message mapping module to the back-end application. And four routing modes such as a common http routing, a socket routing, a springclosed routing and a dubbo routing are supported. The common http routing and the socket routing are special, whether a load balancer exists in a back-end service needs to be distinguished, if the back-end does not take charge of balancing, a client load balancing strategy needs to be configured in the routing rule, the gateway uniformly performs client load balancing, and if the back-end has load balancing, direct connection forwarding is performed. For springclosed routing and dubbo routing, the routing rule must specify the cluster address of the registration center, and it is worth noting that dubbo routing, and the selected calling mode is generalization calling.
The Portal management end module provides visual access management configuration, message analysis rule configuration, message transfer-out mapping rule configuration, routing rule configuration, authority configuration and the like.
A transaction control and analysis module: each access transaction and the transaction forwarded to the back end are issued to a transaction control and analysis module in an asynchronous message mode, the analysis module counts and analyzes the average response time of each transaction in real time so as to judge the pressure condition of the back end system, and if the back end responds too slowly, the analysis module adjusts the flow control strategy in real time to perform partial flow limiting control on the transactions.
Referring to the schematic diagram of the implementation steps of the packet transmission method shown in fig. 4, the gateway processing flow may be executed according to the following steps:
the method comprises the following steps: when the gateway is started, the maintained information of the analysis rule, the routing rule, the mapping rule, the authority control and the like is loaded into the memory.
Step two: interfaces accessed by different channels are accessed through different access connection pools, the management of the access thread pools is managed by a portal terminal in a unified way, and the portal can dynamically add or close a certain access thread pool.
Step three: the message analysis module analyzes messages with different formats (xml/json/fixed length) according to a predefined analysis rule, analyzes the messages into an internal key-value object, and supports dynamic adjustment and real-time effect at a portal end. The interface change (new addition, modification and deletion) does not relate to program change, and only parameters need to be adjusted.
Step four: and the outgoing format mapping module processes the message which is actually required to be transmitted to the back-end service according to the processing result (the internal key-value object) in the step three and the outgoing message format mapping rule. It should be noted that the outgoing message mapping rule also supports dynamic adjustment and real-time effect at the portal end. Like the parsing rule, the change is related only by adjusting parameters, and the change of the program version is not related.
Step five: and the routing module forwards the message to the back-end service module in different modes or different modes according to the message forwarding result processed in the step four and the forwarding routing rule.
Step six: and the transaction routing process information is transmitted to the analysis module in real time through the kafka and is used for carrying out real-time statistical analysis on the transaction.
Through the steps, the prior multi-channel access such as http/socket/dubbo and the like can be supported, and the access of various message formats such as fixed length/xml/json and the like can be supported. And distributing the post-support transaction to applications of different distributed technology stacks according to the configured routing rule, such as springclosed and dubbo. Meanwhile, the authority control and abnormal alarm service of various granularities are supported for the transaction. All the analysis rules, the outgoing message mapping rules and the routing rules of all the interfaces are dynamically and visually configured at the portal management terminal, and the change of the interfaces does not involve the change of gateway programs.
The invention provides a message transmission method and a device, wherein the method comprises dynamic access management, message access of different channels and different formats can be completed through configuration, and application start and stop are not involved; dynamic access analysis and dynamic transfer-out mapping, and dynamic change of the interface can be completed through configuration without influencing external services of the gateway. The method supports the access of messages with different formats and the transfer of messages with different formats, and the access formats and the transfer formats can be different. And dynamic routing can realize services from the transaction routing to different background technology stacks through configuration, including traditional http and socket applications and dubbo and springclosed applications of the distributed technology stacks, and simultaneously supports the configuration of client load balancing under the condition that the traditional http and socket applications are not provided with a service end in charge of an equalizer.
The method isolates the thread pools of different access channels to achieve the purpose that the access of different channels does not influence each other, thereby improving the fault tolerance of gateway service. The message conversion module realizes dynamic analysis of interface data by loading the access rule definition of each interface, and then the message forwarding module routes the transaction to the background service module through the transaction background forwarding rule, thereby achieving the purpose of multi-channel and multi-format message access and forwarding. Meanwhile, the gateway realizes authority control of each access API through a blacklist and interface parameter values, information such as time, state and the like returned by a sending background and a receiving background of each transaction is asynchronously transmitted to the transaction statistical analysis module through kafka, and the statistical analysis module can achieve alarms of different levels by analyzing historical execution conditions and perform necessary current-limiting control on the transactions.
The embodiment of the invention also provides a message transmission device, which is described in the following embodiment. Because the principle of the device for solving the problems is similar to the message transmission method, the implementation of the device can refer to the implementation of the message transmission method, and repeated parts are not described again. Referring to fig. 5, a block diagram of a message transmission apparatus is shown, the apparatus includes:
an obtaining module 61, configured to obtain access management data, analysis data, mapping data, and routing data; the access message management module 62 acquires a message to be transmitted according to the access management data; the access message analysis module 63 is used for analyzing the message to be transmitted according to the analysis data to obtain an analysis result; a transfer-out message mapping module 64, configured to convert the analysis result into a target format according to the mapping data to obtain a mapping result; and the routing control module 65 is configured to send the mapping result to the destination according to the routing data.
In one embodiment, the routing data includes load balancing data; the routing control module is further configured to: judging whether the target end comprises a load balancer or not; if yes, sending the mapping result to the target end according to the routing data; and if not, generating a load balancing result according to the load balancing data, and sending the mapping result to the target end according to the routing data and the load balancing result.
In one embodiment, referring to another block diagram of the message transmission apparatus shown in fig. 6, the apparatus further includes a transaction control and analysis module 66, configured to: recording a message to be transmitted and a mapping result sent to a target end; calculating the average response time of each transaction according to the message to be transmitted and the mapping result sent to the target end; and generating transaction current-limiting control data according to the average response time length, and sending the transaction current-limiting control data to an alarm module.
In one embodiment, the obtaining module is further configured to: acquiring transaction authority data; generating transaction authority data according to the transaction current limiting control data; and controlling the calling frequency and the transaction state of the transaction according to the transaction authority data.
In an embodiment, referring to another structural block diagram of a message transmission apparatus shown in fig. 6, the apparatus further includes a configuration module 67, configured to: reconfiguring access management data, parsing data, mapping data and routing data.
An embodiment of the present invention further provides a computer device, referring to the schematic block diagram of the structure of the computer device shown in fig. 7, the computer device includes a memory 71, a processor 72, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements any of the steps of the message transmission method described above.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the computer device described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing any one of the above message transmission methods is stored in the computer-readable storage medium.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method for packet transmission, comprising:
acquiring access management data, analysis data, mapping data and routing data;
acquiring a message to be transmitted according to the access management data;
analyzing the message to be transmitted according to the analysis data to obtain an analysis result;
converting the analysis result into a target format according to the mapping data to obtain a mapping result;
and sending the mapping result to a target end according to the routing data.
2. The method of claim 1, wherein the routing data comprises load balancing data;
sending the mapping result to a target end according to the routing data, including:
judging whether the target end comprises a load balancer or not;
if yes, the mapping result is sent to a target end according to the routing data;
and if not, generating a load balancing result according to the load balancing data, and sending the mapping result to a target end according to the routing data and the load balancing result.
3. The method of claim 1, further comprising:
recording the message to be transmitted and the mapping result sent to the target end;
calculating the average response duration of each transaction according to the message to be transmitted and the mapping result sent to the target end;
and generating transaction current-limiting control data according to the average response duration, and sending the transaction current-limiting control data to an alarm module.
4. The method of claim 3, further comprising:
acquiring transaction authority data; the transaction authority data is generated according to the transaction current limiting control data;
and controlling the calling frequency and the transaction state of the transaction according to the transaction authority data.
5. The method according to any one of claims 1-4, further comprising:
reconfiguring the access management data, the resolution data, the mapping data and the routing data.
6. A message transmission apparatus, comprising:
the acquisition module is used for acquiring access management data, analysis data, mapping data and routing data;
the access message management module acquires a message to be transmitted according to the access management data;
the access message analysis module is used for analyzing the message to be transmitted according to the analysis data to obtain an analysis result;
the outgoing message mapping module is used for converting the analysis result into a target format according to the mapping data to obtain a mapping result;
and the routing control module is used for sending the mapping result to a target end according to the routing data.
7. The apparatus of claim 6, wherein the routing data comprises load balancing data; the routing control module is further configured to:
judging whether the target end comprises a load balancer or not;
if yes, the mapping result is sent to a target end according to the routing data;
and if not, generating a load balancing result according to the load balancing data, and sending the mapping result to a target end according to the routing data and the load balancing result.
8. The apparatus of claim 6, further comprising a transaction control and analysis module to:
recording the message to be transmitted and the mapping result sent to the target end;
calculating the average response duration of each transaction according to the message to be transmitted and the mapping result sent to the target end;
and generating transaction current-limiting control data according to the average response duration, and sending the transaction current-limiting control data to an alarm module.
9. The apparatus of claim 8, wherein the obtaining module is further configured to:
acquiring transaction authority data; the transaction authority data is generated according to the transaction current limiting control data;
and controlling the calling frequency and the transaction state of the transaction according to the transaction authority data.
10. The apparatus according to any one of claims 6-9, further comprising a configuration module configured to:
reconfiguring the access management data, the resolution data, the mapping data and the routing data.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the message transmission method according to any one of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium storing a computer program for executing the message transmission method according to any one of claims 1 to 5.
CN202011039163.2A 2020-09-28 2020-09-28 Message transmission method and device Pending CN112118142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011039163.2A CN112118142A (en) 2020-09-28 2020-09-28 Message transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011039163.2A CN112118142A (en) 2020-09-28 2020-09-28 Message transmission method and device

Publications (1)

Publication Number Publication Date
CN112118142A true CN112118142A (en) 2020-12-22

Family

ID=73796985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011039163.2A Pending CN112118142A (en) 2020-09-28 2020-09-28 Message transmission method and device

Country Status (1)

Country Link
CN (1) CN112118142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360043A (en) * 2021-06-29 2021-09-07 中国农业银行股份有限公司 Service processing method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022431A (en) * 2007-03-09 2007-08-22 中国移动通信集团福建有限公司 Interface gateway and interface gateway data processing method
CN106027534A (en) * 2016-05-26 2016-10-12 浪潮(苏州)金融技术服务有限公司 System for implementing financial message processing based on Netty
CN108768727A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 Access method, electronic device and the readable storage medium storing program for executing of third party's service
CN109756364A (en) * 2018-12-07 2019-05-14 成都四方伟业软件股份有限公司 A kind of micro services performance optimization system and analysis method based on log analysis
CN110166463A (en) * 2019-05-27 2019-08-23 中国银联股份有限公司 A kind of message transmissions conversion method and device
CN110381163A (en) * 2019-07-30 2019-10-25 普信恒业科技发展(北京)有限公司 The method and gateway node of gateway node for transmitting service request
CN110609782A (en) * 2019-09-19 2019-12-24 四川长虹电器股份有限公司 Micro-service optimization system and method based on big data
CN110798357A (en) * 2019-11-05 2020-02-14 上海景域文化传播股份有限公司 API communication device and method based on ticket S-GDS data mapping protocol

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022431A (en) * 2007-03-09 2007-08-22 中国移动通信集团福建有限公司 Interface gateway and interface gateway data processing method
CN106027534A (en) * 2016-05-26 2016-10-12 浪潮(苏州)金融技术服务有限公司 System for implementing financial message processing based on Netty
CN108768727A (en) * 2018-05-31 2018-11-06 康键信息技术(深圳)有限公司 Access method, electronic device and the readable storage medium storing program for executing of third party's service
CN109756364A (en) * 2018-12-07 2019-05-14 成都四方伟业软件股份有限公司 A kind of micro services performance optimization system and analysis method based on log analysis
CN110166463A (en) * 2019-05-27 2019-08-23 中国银联股份有限公司 A kind of message transmissions conversion method and device
CN110381163A (en) * 2019-07-30 2019-10-25 普信恒业科技发展(北京)有限公司 The method and gateway node of gateway node for transmitting service request
CN110609782A (en) * 2019-09-19 2019-12-24 四川长虹电器股份有限公司 Micro-service optimization system and method based on big data
CN110798357A (en) * 2019-11-05 2020-02-14 上海景域文化传播股份有限公司 API communication device and method based on ticket S-GDS data mapping protocol

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360043A (en) * 2021-06-29 2021-09-07 中国农业银行股份有限公司 Service processing method and device
CN113360043B (en) * 2021-06-29 2024-04-09 中国农业银行股份有限公司 Service processing method and equipment

Similar Documents

Publication Publication Date Title
CN109639572A (en) Route management method, device and micro services system
CN105739987B (en) The system framework of rapid build JavaWeb application towards SOA
US7676516B2 (en) System and method for the optimization of database access in data base networks
US20060280207A1 (en) Distributed network monitoring system
CN104063425A (en) Method for querying data through database middleware and database middleware
CN110209719A (en) A kind of multitype database based on micro services framework uniformly accesses system and method
US20080162690A1 (en) Application Management System
US8589381B2 (en) Resource management program, resource management process, and resource management apparatus
CN112039701A (en) Interface call monitoring method, device, equipment and storage medium
CN115150274A (en) Unified configuration method, system and storage medium for time-sensitive network equipment
CN110519354A (en) A kind of distributed objects storage system and its method for processing business and storage medium
CN112118142A (en) Message transmission method and device
CN116800825A (en) Calling method, device, equipment and medium based on micro-service splitting
CN115934202A (en) Data management method, system, data service gateway and storage medium
CN102055779B (en) Method, device and system for generating HA (High Availability) group
CN111258760A (en) Platform management method, system, device and storage medium
CN110868323A (en) Bandwidth control method, device, equipment and medium
CN113626208B (en) Server communication method based on NIO asynchronous thread model
CN111625474B (en) Automatic testing method of alliance chain
CN115664832A (en) Network connection processing method, device, equipment and storage medium
CN115378645A (en) Verification method and system based on unified authentication of electric power marketing management system
CN114564530A (en) Database access method, device, equipment and storage medium
US11784762B2 (en) Methods, systems, and computer readable media for limiting network function (NF) repository function (NRF) forwarding
CN115208956B (en) Implementation method of block chain gateway
CN113630422B (en) Network security data processing method and system based on edge node

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201222