Message interaction method and device
By simulating the client to send requests to the bank's internal system and using the business parameters in the XML tags for message processing, combined with the Socket synchronization short connection method, the problem of low development and testing efficiency when external enterprises and bank systems are connected is solved, and the problem is achieved. Efficient message interaction and system joint debugging ensure the stability and security of the banking system.
Patent Information
- Application Number
- CN202411100828.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-11
AI Technical Summary
The existing technology cannot effectively separate module development and interface testing when external enterprises and bank internal systems are connected, resulting in increased time costs. Moreover, due to different message interaction specifications of different business modules, it is impossible to implement a unified system device for message interaction testing. , resulting in slow problem location.
Propose a message interaction method and device. By simulating the external system client to send requests to the bank's internal system, the business parameters in the XML tag are used for message processing and display, and the Socket synchronous short connection method of the TCP/IP protocol is used. Message interaction separates message parsing and format adaptation processes, reducing manual calculation of message header length.
It achieves rapid response to external special business needs, improves the efficiency of joint debugging of internal and external systems of the bank, reduces testing costs, and ensures the security and stability of the banking system.
Smart Images

Figure CN118764393A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bank system docking, and in particular to a message interaction method and device. Background Art
[0002] Due to the rapid development of the financial technology field, more and more localized businesses are gradually connected to the bank's back-end system. The bank's back-end provides standard interfaces to group customers, financial centers, individual companies and other enterprises, providing stable and reliable financial services for all walks of life in my country. Due to the development of new business scenarios, the volume of business demand has increased sharply, making the number of special businesses connected to the bank's back-end gradually increase at this stage. In order to ensure the safety and reliability of the online financial services used by customers, the bank needs to do a good job of interface testing in the early stage of external enterprises accessing the bank's back-end. In the current financial technology field, the core business systems of the back-end of major banks basically use interface calls to interact with the outside world. Doing a good job of interface connection testing between the bank's internal system and external enterprises is a necessary and sufficient condition before going online. Therefore, a message interaction method, system and device are needed to ensure the process of connecting the external enterprise with the bank's internal interface in the early stage, and to quickly respond to various external special business needs while ensuring high-quality online financial services.
[0003] In the existing technical solutions, when external enterprises and banks conduct system docking, they usually develop the external system framework and the functions of each module first, and then send a request to the bank's backend interface through their own business logic. If the call is abnormal in this docking mode, it is necessary to debug the module program step by step, and the module development and interface docking test work cannot be separated normally, the time cost increases, and the business needs cannot be met efficiently. Secondly, due to the different message interaction specifications of different business modules, each module needs to be debugged in a different way, and it is impossible to implement message interaction testing on a unified system device. Finally, the test cost of combining modules for joint debugging is too high. Finally, due to the interaction between internal and external systems, it is usually necessary to check the message information returned by the counterparty system to determine whether the business transaction processing is normal. However, due to the isolation of the internal system from the Internet, and the sensitivity of bank information cannot be directly provided to the outside, the communication cost in the docking process increases, and the problem location speed is slow. Therefore, there is a lack of a message interaction device that uniformly manages and displays the interaction between internal and external systems. Summary of the invention
[0004] Based on the above technical problems, the present invention proposes a message interaction method and device, and the specific technical solution is as follows.
[0005] In a first aspect, a message interaction method comprises the following steps: Step S1: Simulate the external system client to send a request to the internal system server, and transmit the request message to the bank's internal system; Step S2: After receiving the message from the external system, the internal system sends the message to the bank backend for processing; Step S3: The bank backend feedbacks whether the message is received, obtains the corresponding business parameters in the XML tag of the transmission message, queries the business information required by the corresponding message according to the business parameter content, and displays it; Step S4: The bank backend generates a response message, and the internal system returns the processed response message to the external system client.
[0006] Specifically, the internal system server is a bank-enterprise direct connection system, which simulates the behavior of the client sending a request and transmits the message to the bank.
[0007] Specifically, the corresponding business parameters in the XML tag include customer account number, multi-level account book, currency code and serial number.
[0008] Specifically, the message has a format and is centrally stored in a Socket synchronous short connection mode of the TCP / IP protocol in accordance with the message interaction specification of the bank-enterprise direct connection core system.
[0009] Specifically, the Socket synchronous short connection mode is a point-to-point Socket packet sending mode, which is actively closed after the connection is established and the interaction is completed; the message structure is a combination of a packet header and a data packet, the packet header is fixed to be seven bytes long, the first byte is an encryption flag, and the next six bytes are the length of the data packet. The message length is directly converted into a string for storage, and if the length is less than six digits, the right side is padded with spaces.
[0010] Specifically, the first byte is a flag indicating whether to encrypt or not: 0 indicates not to encrypt, and 1 indicates to encrypt.
[0011] Specifically, the data packet content includes exchange counterparty information, corporate customer number and transaction operator code.
[0012] On the other hand, a message interaction device, used to implement the message interaction method, includes: Receiving module: receiving external system messages and internal system response messages; Processing module: configures the corresponding business parameters in the message XML tag; Sending module: sends messages to the internal system and returns response messages to the external system; Display module: displays the business information required for the corresponding message queried based on the business parameter content.
[0013] Beneficial effects of the present invention: The present invention proposes a message interaction method and device, which has the following technical advantages: (1) There is no need to store other redundant codes, and the message parsing and format adaptation processes are separated, which is conducive to modifying or adding message processing logic.
[0014] (2) There is no need to manually calculate the message header length, which reduces the interface call exceptions caused by incorrect message length calculation. Testers only need to focus on the business test data in the interface specification to improve the message reuse rate.
[0015] (3) Directly simulate the client's request method. The other party's system does not need to implement the core framework and functions of its special business in advance. It only needs to perform message interaction testing according to the interface specifications. That is, development and business function testing can be carried out in parallel, improving the efficiency of the bank's internal and external system coordination.
[0016] (4) It is a point-to-point socket packet sending method. After the connection is established and the interaction is completed, it will be automatically closed. There will be no zombie processes, and there will be no long-term port dialing tests on the bank system. The security and stability of the bank's internal system are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a message interaction method according to the present invention. DETAILED DESCRIPTION
[0018] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.
[0019] The present invention proposes a message interaction method and device, the message interaction method architecture is as follows Figure 1 As shown, the following steps are included: Step S1: Simulate the external system client to send a request to the internal system server, and transmit the request message to the bank's internal system; Step S2: After receiving the message from the external system, the internal system sends the message to the bank backend for processing; Step S3: The bank backend feedbacks whether the message is received, obtains the corresponding business parameters in the XML tag of the transmission message, queries the business information required by the corresponding message according to the business parameter content, and displays it; Step S4: The bank backend generates a response message, and the internal system returns the processed response message to the external system client.
[0020] In this embodiment, the internal system server is a bank-enterprise direct connection system, which simulates the behavior of the client sending a request and transmits the message to the bank.
[0021] In this embodiment, the corresponding business parameters in the XML tag include customer account number, multi-level account book, currency code and serial number.
[0022] In this embodiment, the message has a format and is centrally stored in the Socket synchronous short connection mode of the TCP / IP protocol in accordance with the message interaction specifications of the bank's bank-enterprise direct connection core system. The Socket synchronous short connection mode is a point-to-point Socket packet sending mode, which is actively closed after the connection is established and the interaction is completed; wherein the message structure is a combination of a packet header and a data packet, wherein the packet header is fixed to be seven bytes long, the first byte is an encryption flag, and the next six bytes are the length of the data packet. The message length is directly converted into a string for storage, and if the length is less than six digits, the right side is padded with spaces. The first byte is an encryption flag, specifically: 0 for unencrypted, 1 for encrypted. The content of the data packet includes the exchange counterparty information, the corporate customer number, and the transaction operator code.
[0023] The present invention also accordingly proposes a message interaction device for implementing a message interaction method, comprising: Receiving module: receiving external system messages and internal system response messages; Processing module: configures the corresponding business parameters in the message XML tag; Sending module: sends messages to the internal system and returns response messages to the external system; Display module: displays the business information required for the corresponding message queried based on the business parameter content.
[0024] In one embodiment, in order to solve the problem of low system docking efficiency due to the isolation of internal and external networks when the external system is docked with the internal system of the bank, the present invention adopts an efficient message interaction method. The external system does not need to complete the development of the business function module in advance. By simulating the client sending a request to the server, the client is the external system, and the server is the bank-enterprise direct connection system. The behavior of the client sending a request is simulated, and the message is transmitted to the bank. After the bank parses and processes the service request, the return message is presented to the client. That is, the joint debugging test of the internal and external systems is not subject to the development of the function module. Both parties can carry out development and interface testing work synchronously, thereby improving the efficiency of the internal and external system docking.
[0025] In order to solve the problem that in the process of internal and external system docking, it is necessary to calculate the byte length of the message to be transmitted first, splice the message header according to the interface specification and then make a request, which leads to a complicated business test process and a low message reuse rate, the present invention adopts the device to configure message transmission, reducing the cumbersome message configuration process, and only needs to pay attention to the actual corresponding business parameters in the XML tag, including customer account, multi-level account book, currency code and serial number, etc. For different types of accounts, or serial numbers of different lengths, testers do not need to recalculate the number of bytes of the message length due to changes in business functions and updates of business parameters in XML tags, resulting in changes in the byte length of the message to be tested.
[0026] In addition, the core systems of most banks are less mature than the cutting-edge products in the current environment, and many old technical architectures cannot be quickly replaced. However, due to the rapid development of the financial technology field today, the back-ends of major banks need to meet more and more online specialty businesses as much as possible to maintain their own share in the industry. Therefore, such a stable, efficient, and decoupled message interaction method and device can well isolate the internal system of the bank from the external system, which not only ensures the stability and security of the internal system of the bank, but also can quickly deliver the business needs developed in various digital financial fields.
[0027] In one embodiment, the formatted messages are stored centrally, and according to the message interaction specification of the bank-enterprise direct connection core system, the TCP / IP protocol Socket synchronous short connection method is adopted. The Socket message structure is "header + data packet", the header is fixed to 7 bytes long, the first byte is the encryption flag (0-unencrypted, 1-encrypted), and the last 6 bytes are the length of the data packet, that is, the message length is directly converted into a string for storage, and if the length is less than 6 bits, the right side is supplemented with spaces, that is, "1234". For example, if the external system sends a 1234-byte exchange transaction data packet to the bank-enterprise direct connection system, its header is "01234" with a total of seven bits, and the data packet content includes the exchange counterparty information, corporate customer number and transaction operator code, etc. After the bank receives the request data packet, it will perform subsequent financial transaction processing. There is no need to store other redundant codes, and the message parsing and format adaptation processes are separated, which is conducive to modifying or adding message processing logic.
[0028] The present invention has shown and described the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A message interaction method, It is characterized in that The following steps are involved: Step S1: Simulate the external system client to send a request to the internal system server, and transmit the request message to the bank's internal system; Step S2: After receiving the message from the external system, the internal system sends the message to the bank backend for processing; Step S3: The bank backend feedbacks whether the message is received, obtains the corresponding business parameters in the XML tag of the transmission message, queries the business information required by the corresponding message according to the business parameter content, and displays it; Step S4: The bank backend generates a response message, and the internal system returns the processed response message to the external system client.
2. A message interaction method according to claim 1, It is characterized in that The internal system server is a bank-enterprise direct connection system, which simulates the behavior of the client sending a request and transmits the message to the bank.
3. A message interaction method according to claim 1, It is characterized in that The corresponding business parameters in the XML tag include customer account number, multi-level account book, currency code and serial number.
4. A message interaction method according to claim 1, It is characterized in that The message has a format and is centrally stored in the Socket synchronous short connection mode of the TCP / IP protocol in accordance with the message interaction specification of the bank's bank-enterprise direct connection core system.
5. A message interaction method according to claim 4, It is characterized in that The Socket synchronous short connection mode is a point-to-point Socket packet sending mode, which is actively closed after the connection is established and the interaction is completed; the message structure is a combination of a packet header and a data packet, the packet header is fixed to be seven bytes long, the first byte is an encryption flag, and the next six bytes are the length of the data packet. The message length is directly converted into a string for storage, and if the length is less than six digits, the right side is padded with spaces.
6. A message interaction method according to claim 5, It is characterized in that The first byte is a flag indicating whether to encrypt or not: 0 indicates not to encrypt, and 1 indicates to encrypt.
7. A message interaction method according to claim 5, It is characterized in that The data packet content includes exchange counterparty information, corporate customer number and transaction operator code.
8. A message interaction device, used to implement a message interaction method according to any one of claims 1 to 7, It is characterized in that include: Receiving module: receiving external system messages and internal system response messages; Processing module: configures the corresponding business parameters in the message XML tag; Sending module: sends messages to the internal system and returns response messages to the external system; Display module: displays the business information required for the corresponding message queried based on the business parameter content.
