CN111614757A - Message interaction method, device, equipment and medium for client and server - Google Patents

Message interaction method, device, equipment and medium for client and server Download PDF

Info

Publication number
CN111614757A
CN111614757A CN202010431697.3A CN202010431697A CN111614757A CN 111614757 A CN111614757 A CN 111614757A CN 202010431697 A CN202010431697 A CN 202010431697A CN 111614757 A CN111614757 A CN 111614757A
Authority
CN
China
Prior art keywords
format
message
client
server
response
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
CN202010431697.3A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech 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 Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010431697.3A priority Critical patent/CN111614757A/en
Publication of CN111614757A publication Critical patent/CN111614757A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a message interaction method, a device, equipment and a medium of a client and a server, wherein the method is executed by a message conversion end and comprises the following steps: converting a first format request message sent by a client into a second format request message, and sending the second format request message to a server; receiving a second format response message fed back by the server based on the second format request message, and converting the second format response message into a first format response message; and feeding back the first format response message to the client. The scheme of the embodiment of the invention uses the external message conversion end as the message interaction bridge between the client and the server to convert the messages in different formats, well solves the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different, and provides a new idea for the message interaction between the client and the server.

Description

Message interaction method, device, equipment and medium for client and server
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a message interaction method, device, equipment and medium for a client and a server.
Background
Currently, when a user operates a client to trigger a certain request, the client receives the request of the user and needs to generate a request message to be responded by a back-end server, and the back-end server feeds back a response message to the client after responding. However, in general, the message formats used by the client and the server are different, which affects the message interaction between the client and the server, and improvement is needed.
Disclosure of Invention
The embodiment of the invention provides a message interaction method, a message interaction device, message interaction equipment and a message interaction medium for a client and a server, which well solve the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different, and provide a new idea for the message interaction between the client and the server.
In a first aspect, an embodiment of the present invention provides a method for packet interaction between a client and a server, where the method is executed by a packet converter, and the method includes:
converting a first format request message sent by a client into a second format request message, and sending the second format request message to a server;
receiving a second format response message fed back by the server based on the second format request message, and converting the second format response message into a first format response message;
and feeding back the first format response message to the client.
In a second aspect, an embodiment of the present invention further provides a packet interaction device between a client and a server, where the packet interaction device is configured at a packet conversion end, and the device includes:
the first conversion module is used for converting a first format request message sent by a client into a second format request message;
the first transmission module is used for sending the second format request message to a server;
the first transmission module is further used for receiving a second format response message fed back by the server based on the second format request message;
the second conversion module is used for converting the second format response message into a first format response message;
and the second transmission module is used for feeding back the first format response message to the client.
In a third aspect, an embodiment of the present invention further provides a message converting end device, where the message converting end device includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the message interaction method between the client and the server according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a message interaction method between a client and a server according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, the client generates a first format request message and then sends the first format request message to the message conversion end, the message conversion end converts the first format request message into a second format request message and then sends the second format request message to the server, the server responds to the second format request message, generates a second format response message and then feeds the second format response message back to the message conversion end, and the message conversion end converts the second format response message into a first format response message and feeds the first format response message back to the client. The scheme of the embodiment of the invention uses the external message conversion end as a message interaction bridge between the client and the server to convert messages in different formats, thereby well solving the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different. In addition, the message conversion end of the embodiment of the invention is externally arranged outside the client and the server, when the message conversion program is updated, only the program updating is needed to be carried out on the externally arranged message conversion end, so that the method is more convenient and efficient, the maintenance cost is greatly reduced, and a new idea is provided for the message interaction between the client and the server.
Drawings
Fig. 1A is a flowchart of a message interaction method between a client and a server according to an embodiment of the present invention;
fig. 1B is a schematic diagram of a system framework of a message interaction process between a client and a server according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for message interaction between a client and a server according to a second embodiment of the present invention;
fig. 3 is a flowchart of another method for message interaction between a client and a server according to a third embodiment of the present invention;
fig. 4A is a signaling diagram of another message interaction method between a client and a server according to a fourth embodiment of the present invention;
fig. 4B is a schematic diagram of a system framework of another message interaction process between a client and a server according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of a message interaction apparatus between a client and a server according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a message conversion end device according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1A is a flowchart of a message interaction method between a client and a server according to an embodiment of the present invention; fig. 1B is a schematic diagram of a system framework of a client-server message interaction process according to an embodiment of the present invention. The embodiment is applicable to the situation that the client and the server perform message interaction, and is particularly applicable to the situation that the client and the server perform message interaction when the message formats generated by the client and the server are different. The method can be executed by a message conversion end, specifically, by a message interaction device configured between a client of the message conversion end and a server, and the device can be implemented in a software and/or hardware manner. Optionally, as shown in fig. 1A-1B, the method specifically includes the following steps:
s101, converting the first format request message sent by the client into a second format request message, and sending the second format request message to the server.
In the embodiment of the present invention, the client may be a client of an application installed in the user terminal device; such as WeChat, Taobao, or microblog. But also an applet in an application, such as an applet in a WeChat application. The embodiment of the present invention is not limited thereto. The server may be a back-end server of the client, and the server is configured to respond to the request message sent by the client. It should be noted that, in the embodiment of the present invention, the message formats used by the client and the server are different. If the first format is a message format used by the client, the second format is a message format used by the server.
Specifically, a request message and a processable response message generated by a client are both messages in a first format; the request message which can be processed by the server and the generated response message are messages in the second format. The specific types of the first format and the second format are not limited in the embodiments of the present invention. For example, the first format may be a json format; the second format may be an xml format. The JSON (JavaScript object notation) format is a lightweight data exchange format. It is a subset of JavaScript based. The data format is simple, easy to read and write, occupies small bandwidth, and is commonly used for communication between the client and the server. The XML (Extensible Markup Language) format is designed to transmit and carry data information, has wide use and strong universality, and can be used for communication between service terminals and communication between the service terminals and the client. The request message in the embodiment of the application may be a message generated to represent the relevant content of the current request when the request needs to be initiated.
Optionally, the message conversion end in the embodiment of the present invention is not a message conversion end embedded in the client or the server, but is an external electronic device independent of the client and the server. For example, as shown in fig. 1B, the client, the server, and the message conversion end are three independent electronic devices. In the embodiment of the invention, when a user operates a client to trigger a certain request, the client generates a first format request message corresponding to the request based on the triggering operation of the user, then sends the generated first format request message to an external message conversion end, the message conversion end converts the received first format request message into a second format request message which can be responded by a server, and then sends the converted second format request message to the server.
Optionally, in the embodiment of the present invention, when the message conversion end converts the first format request message into the second format request message, the message format that can be processed by the server may be determined as the second format according to the type of the server that needs to be sent in the first format, then the data of each field in the first format request message is converted from the first format into the second format according to a preset conversion rule from the first format to the second format, and all the converted data in the second format are integrated to obtain the second format request message. The specific conversion process will be described in detail in the following embodiments.
S102, receiving a second format response message fed back by the server based on the second format request message, and converting the second format response message into a first format response message.
In the embodiment of the present invention, the response message may be a content related to a result representing the current request feedback, which is generated after the server responds to the request message. For example, if the request message is "inquire about the current weather in city a", the response message may be "sunny, 18 ° -27 °".
Optionally, as shown in fig. 1B, after the message conversion end sends the converted second format request message to the server, the server may respond to the received second format request message to generate a second format response message corresponding to the second format request message, and then feed back the second format response message to the message conversion end, and after receiving the second format response message fed back by the server, the message conversion end converts the second format response message into the first format response message.
Optionally, in the embodiment of the present invention, when the message conversion end converts the second format response message into the first format response message, the message conversion end may convert the data of each field in the second format response message from the second format to the first format according to a preset conversion rule from the second format to the first format, and integrate all the converted data in the first format to obtain the first format response message. The specific conversion process will be described in detail in the following embodiments.
S103, feeding back the first format response message to the client.
Optionally, the message conversion end has converted the second format response message into the first format response message through S102, at this time, the response message conforms to the processing format of the client, the first format response message may be fed back to the client, and after receiving the first format response message, the client processes the first format response message and then displays the processing result, that is, the feedback result of the user initiated request, to the user.
In the message interaction method between the client and the server, the client generates a first format request message and then sends the first format request message to the message conversion end, the message conversion end converts the first format request message into a second format request message and then sends the second format request message to the server, the server responds to the second format request message, generates a second format response message and then feeds the second format response message back to the message conversion end, and the message conversion end converts the second format response message into the first format response message and feeds the first format response message back to the client. The scheme of the embodiment of the invention uses the external message conversion end as a message interaction bridge between the client and the server to convert messages in different formats, thereby well solving the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different. In addition, the message conversion end of the embodiment of the invention is externally arranged outside the client and the server, when the message conversion program is updated, only the program updating is needed to be carried out on the externally arranged message conversion end, so that the method is more convenient and efficient, the maintenance cost is greatly reduced, and a new idea is provided for the message interaction between the client and the server.
Example two
Fig. 2 is a flowchart of another message interaction method between a client and a server according to a second embodiment of the present invention, which is further optimized based on the foregoing embodiments to describe a specific case of how to convert a first format request message sent by the client into a second format request message. Specifically, as shown in fig. 2, the method for message interaction between a client and a server according to the embodiment of the present invention specifically includes:
s201, splitting a first format request message sent by a client into a general part and a detailed part.
In the embodiment of the present invention, the general part of the request message may be a part representing fixed data of the request message, and the detailed part of the request message may be a part representing specific data of the request message. Optionally, taking the first format as a json format as an example, the first format request message includes header data (head) and body data (body), where the body data (body) includes common data (common) and Entity data (Entity), and the header data (head) and the common data (common) may be used as general parts of the json format request message; entity data (Entity) is used as a detailed part of the json format request message.
Optionally, in the embodiment of the present invention, after receiving the first format request packet sent by the client, the packet converter uses, according to the data corresponding to each field in the first format request packet, the relatively fixed data in the first format request packet as a general part, and uses the specific data in the first format request packet as a detailed part. For example, if the first format is a json format, the head data (head) field of the json format request message may be searched, and the head data (head) therein is extracted as a general part; searching a body data (body) field of the json format request message, extracting common data (common) in the common data (common) field from the body data (body) field as a general part, and extracting Entity data (Entity) in the Entity data (Entity) field from the body data (common) field as a detailed part.
S202, the common part is converted into the first sub-part of the second format based on the first common conversion template of the first format and the second format.
Optionally, in the embodiment of the present invention, a message format that can be responded by the server is determined as the second format according to the type of the server that needs to be sent by the first format request message, and then a first general conversion template of the first format and the second format is obtained, where some general data in the first format request message may be recorded in the first general conversion template, and corresponding data after conversion to the second format is performed. In this case, each first format data of the common part may be respectively searched in the first common conversion template for corresponding second format data in the second format, as the first sub-part of the second format. For example, if the first format is json, the header data (head) and the common data (common) corresponding to the second format may be searched in the first generic conversion template as the first sub-portion of the second format.
S203, converting the detailed part into a second sub-part in a second format based on the first dynamic adaptation rule.
Wherein the first dynamic adaptation rule may be a rule that dynamically encodes the rule portion from the first format to the second format based on a difference in content of the rule portion.
Optionally, the detailed part of the request message is usually in the form of a key-value (value), for example, the detailed part may be a HashMap. Therefore, in this step, when converting the detailed part into the second sub-part in the second format, the data of the key part and the data of the value part may be converted separately, and the following steps may be performed: dynamically adapting the keywords in the detailed part to tag values corresponding to the keywords; dynamically adapting the numerical value in the detailed part to be a numerical value corresponding character string; wherein the tag value and the string are a second portion of the second format. Specifically, for the keyword of the detailed part, the characteristic is a tag value, and at this time, according to the dynamic adaptation rule of the keyword, the keyword of the detailed part is converted into the tag value of the second format; for the numerical values of the detailed part, the specific content corresponding to the label value is represented, and at the moment, the numerical values of the detailed part can be converted into character strings in a second format according to a numerical value dynamic adaptation rule; and finally, taking the converted label value and character string in the second format as a second sub-part of the second format.
S204, generating a second format request message according to the first sub-part and the second sub-part of the second format.
Optionally, the first sub-part in the second format obtained by converting in S202 and the second sub-part in the second format obtained by converting in S203 are combined to obtain the second format request packet. Specifically, the precedence order of each sub-portion may be searched according to a preset template, and the first sub-portion and the second sub-portion are sequentially combined according to the order to obtain the second format request message.
And S205, sending the second format request message to a server.
S206, receiving a second format response message fed back by the server based on the second format request message, and converting the second format response message into a first format response message.
And S207, feeding back the first format response message to the client.
In the message interaction method between the client and the server, the client generates a first format request message and then sends the first format request message to the message conversion end, the message conversion end firstly splits the first format request message into a general part and a detailed part, and for the general part, the general part is converted into a first part in a second format based on a first general conversion template in the first format and a first general conversion template in the second format; and for the detailed part, based on the first dynamic adaptation rule, converting the detailed part into a second part in a second format, further combining the first part and the second part in the second format to obtain a second format request message, sending the second format request message to the server, responding to the second format request message by the server, generating a second format response message, then feeding the second format response message back to the message conversion end, and converting the second format response message into a first format response message by the message conversion end and then feeding the first format response message back to the client. The scheme of the embodiment of the invention carries out message conversion between different formats by the external message conversion end, thereby well solving the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different. In addition, because the embodiment of the invention carries out the conversion of the detailed part based on the dynamic adaptation rule when the first format request message and the second format request message are converted, the invention can ensure that the new change is automatically adapted when the messages of the client and the back-end server change, and the accuracy of the format conversion of the request message is improved.
EXAMPLE III
Fig. 3 is a flowchart of another message interaction method between a client and a server according to a third embodiment of the present invention, which is further optimized based on the foregoing embodiments, and a specific description is given of how to convert the second format response message into the first format response message. Specifically, as shown in fig. 3, the method for message interaction between a client and a server according to the embodiment of the present invention specifically includes:
s301, the first format request message sent by the client is converted into a second format request message, and the second format request message is sent to the server.
S302, receiving a second format response message fed back by the server based on the second format request message.
S303, converting the second format response message into a response object; wherein the response object includes at least: response status and response information.
The response object may be a content object contained in the response message, and at least includes: response status and response information. The response status may be a status of whether the response request message is successful; when the response state is successful, the response information is a request result fed back based on the request message; and when the response state is failure, the response information is the reason of response failure. Optionally, in the embodiment of the present invention, the data characterizing the response state and the data characterizing the response information may be found according to corresponding fields of each data in the second format response message, and then the two types of data are converted into the response object, that is, the data characterizing the response state is used as the response state in the response object, and the data characterizing the response information is used as the response information in the response object.
S304, the response state is converted into the first sub-part of the first format based on the first format and the second general conversion template of the second format.
The embodiment of the present invention may determine, according to the type of the client that needs to send the second format response packet, a packet format that can be processed by the client as the first format, and then obtain the second common conversion template of the first format and the second format. The second general conversion template is similar to the first general conversion template in the above embodiment, and records corresponding data after different response states in the second format response message are converted into the first format. In this case, in this step, for the response status in the response object after the conversion in S303, the data corresponding to the response status in the first format is searched in the second general conversion template as the first part of the first format. For example, assuming that the response status in the response object after the conversion in S303 is successful, the corresponding data in the first format that is successfully searched in the second general conversion template is 00, and at this time 00 may be taken as the first part of the first format.
S305, converting the response information into a second part of the first format based on a second dynamic adaptation rule.
Optionally, the second dynamic adaptation rule of the present application further includes a rule for encoding the response information from the second format to the first format. For example, the response message may be encoded into a key-value form according to a second dynamic adaptation rule, and then the key-value form data is used as a second part of the first format.
S306, generating a first format response message according to the first sub-part and the second sub-part of the first format.
Optionally, the first sub-part in the first format obtained by converting in S304 and the second sub-part in the first format obtained by converting in S305 are combined to obtain the first format response packet. Specifically, the precedence order of each sub-portion may be searched according to a preset template, and the first sub-portion and the second sub-portion are sequentially combined according to the order to obtain the first format response packet.
S307, the first format response message is fed back to the client.
The message interaction method of the client and the server comprises the steps that the client generates a first format request message and then sends the first format request message to a message conversion end, the message conversion end converts the first format request message into a second format request message and then sends the second format request message to the server, the server responds to the second format request message and generates a second format response message and then feeds the second format response message back to the message conversion end, the message conversion end converts the second format response message into a response state and a response message, then the response state is converted into a first part of a first format based on a second universal conversion template of the first format and a second format, the response message is converted into a second part of the first format based on a second dynamic adaptation rule, and the first part and the second part are combined into a first format response message and then fed back to the client. The scheme of the embodiment of the invention carries out message conversion between different formats by the external message conversion end, thereby well solving the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different. In addition, because the embodiment of the invention carries out the conversion of the response information based on the dynamic adaptation rule when the first format response message and the second format response message are converted, the invention can ensure that the new change is automatically adapted when the messages of the client and the back-end server change, and the accuracy of requesting the message format conversion is improved.
Example four
Fig. 4A is a signaling diagram of another message interaction method between a client and a server according to a fourth embodiment of the present invention; fig. 4B is a schematic diagram of a system framework of another message interaction process between a client and a server according to a fourth embodiment of the present invention. On the basis of the above embodiments, the present embodiment further optimizes, and gives another preferred example of the message interaction method between the client and the server. Optionally, in this embodiment, the message interaction between the client and the server is implemented based on at least one of the front-end processor and the gateway, and the message conversion end is used as an interaction bridge between the client and the server. Specifically, the first format request packet received by the packet converter is sent by the client to the packet converter through the front-end processor and/or the gateway. Correspondingly, after converting the second format response message into the first format response message, the message conversion end feeds back the first format response message to the client through the front-end processor and/or the gateway.
The front-end processor and the gateway can be intermediate equipment when a client and a server interact, and can ensure load balance, interaction safety, access flow limitation control and the like when messages between the client and the server interact. Alternatively, the front-end processor may be a sparse zone (DMZ). Specifically, as shown in fig. 4A-4B, the method for implementing message interaction between a client and a server according to the embodiment of the present invention, based on a front-end processor and/or a gateway, performs data interaction between the client and a message forwarding end, specifically includes:
s401, the client generates a first format request message and sends the first format request message to the front-end processor.
S402, the front-end processor sends the first format request message to the gateway.
S403, the gateway sends the first format request message to the message conversion end.
S404, the message conversion end converts the first format request message into a second format request message and sends the second format request message to the server.
S405, the server responds to the second format request message to generate a second format response message, and feeds back the second format response message to the message conversion end.
S406, the message converting end converts the second format response message into the first format response message.
S407, the message conversion end feeds back the first format response message to the gateway.
S408, the gateway feeds the first format response message back to the front-end processor.
And S409, the front-end processor feeds the first format response message back to the client.
It should be noted that, in this embodiment, a process of implementing message interaction between the client and the server is described based on the front-end processor, the gateway, and the message conversion end serving as an interaction bridge between the client and the server, and optionally, the embodiment of the present invention may also be implemented by using the front-end processor and the message conversion end as an interaction bridge between the client and the server, for example, the front-end processor directly sends the first format request message to the message conversion end S402, and the message conversion end S407 directly feeds back the first format response message to the front-end processor, and simultaneously deletes the operations of S403 and S408, so as to implement a process of message interaction between the client and the server; the gateway and the message conversion end may also be used as an interaction bridge between the client and the server, for example, the client directly sends the first format request message to the gateway in S401, and the gateway directly feeds back the first format response message to the client in S408, and simultaneously deletes the operations in S402 and S407 to implement the message interaction process between the client and the server. The embodiment of the present invention is not limited thereto.
The message interaction method of the client and the server comprises the steps that the client generates a first format request message and then sends the first format request message to a front-end processor, the front-end processor sends the first format request message to a gateway, the gateway sends the first format request message to a message conversion end to convert a second format request message and then sends the second format request message to the server, a second format response message of the server is sent to the message conversion end and converted into a first format response message, the first format response message is fed back to the gateway, the first format response message is fed back to the front-end processor by the gateway, and finally the front-end processor feeds back the first format response message to the client. The scheme of the embodiment introduces the front-end processor and the gateway to ensure load balance, interaction safety, access flow limitation control and the like during message interaction between the client and the server, and improves the safety and stability of message interaction between the client and the server.
EXAMPLE five
Fig. 5 is a block diagram of a message interaction device between a client and a server according to a fifth embodiment of the present invention, where the device may be configured at a message conversion end. The device can execute the message interaction method between the client and the server provided by any embodiment of the invention, and is suitable for the situation that the client and the server perform message interaction, in particular to the situation that the client and the server perform message interaction when the message formats generated by the client and the server are different. The corresponding functional modules and the beneficial effects of the specific execution method. As shown in fig. 5, the apparatus includes:
a first conversion module 501, configured to convert a first format request packet sent by a client into a second format request packet;
a first transmission module 502, configured to send the second format request packet to a server;
the first transmission module 502 is further configured to receive a second format response packet fed back by the server based on the second format request packet;
a second conversion module 503, configured to convert the second format response packet into a first format response packet;
a second transmission module 504, configured to feed back the first format response packet to the client.
In the message interaction device between the client and the server, the client generates a first format request message and then sends the first format request message to the message conversion end, the message conversion end converts the first format request message into a second format request message and then sends the second format request message to the server, the server responds to the second format request message, generates a second format response message and then feeds the second format response message back to the message conversion end, and the message conversion end converts the second format response message into the first format response message and feeds the first format response message back to the client. The scheme of the embodiment of the invention uses the external message conversion end as a message interaction bridge between the client and the server to convert messages in different formats, thereby well solving the problem that the message interaction between the client and the server is influenced because the message formats used by the client and the server are different. In addition, the message conversion end of the embodiment of the invention is externally arranged outside the client and the server, when the message conversion program is updated, only the program updating is needed to be carried out on the externally arranged message conversion end, so that the method is more convenient and efficient, the maintenance cost is greatly reduced, and a new idea is provided for the message interaction between the client and the server.
Further, the first format request message is sent to the message conversion end by the client through the front-end processor and/or the gateway;
correspondingly, the second transmission module 504 is specifically configured to: and feeding back the first format response message to the client through the front-end processor and/or the gateway.
Further, the first conversion module 501 includes:
the splitting unit is used for splitting a first format request message sent by a client into a general part and a detailed part;
a first conversion unit for converting the common portion into a first sub-portion of a second format based on a first common conversion template of the first format and the second format;
a second conversion unit, configured to convert the rule portion into a second sub-portion in a second format based on a dynamic adaptation rule;
and the merging unit is used for generating a second format request message according to the first sub-part and the second sub-part of the second format.
Further, the second conversion unit is specifically configured to:
dynamically adapting the keywords in the detailed part to be label values corresponding to the keywords;
dynamically adapting the numerical value in the detailed part to be a character string corresponding to the numerical value;
wherein the tag value and the string are a second portion of the second format.
Further, the second conversion module 503 is specifically configured to:
converting the second format response message into a response object; wherein the response object includes at least: response status and response information;
converting the response status to a first sub-portion of the first format based on a second common conversion template of the first format and the second format;
converting the response information into a second part of the first format based on a dynamic adaptation rule;
and generating a first format response message according to the first sub-part and the second sub-part of the first format.
Further, the first format is a json format; the second format is an xml format.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a message conversion end device according to a sixth embodiment of the present invention, and fig. 6 shows a block diagram of an exemplary message conversion end device suitable for implementing an embodiment of the present invention. The message conversion end device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the application scope of the embodiment of the present invention. The message conversion terminal can be a smart phone, a tablet computer, a notebook computer, a vehicle-mounted terminal, a wearable device and the like. Optionally, the message conversion end device may be an external electronic device independent of the client and the server.
As shown in fig. 6, the message conversion side device 600 is represented in the form of a general purpose computing device. The components of the text-to-message device 600 may include, but are not limited to: one or more processing units or processors 616, a memory 628, and a bus 618 that couples various system components including the memory 628 and the processors 616.
Bus 618 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The message-translating end device 600 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed by the messaging client device 600 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 628 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)630 and/or cache memory 632. The messaging side device 600 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 634 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be connected to bus 618 by one or more data media interfaces. Memory 628 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 640 having a set (at least one) of program modules 642 may be stored, for example, in memory 628, such program modules 642 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 642 generally perform the functions and/or methods of the described embodiments of the invention.
The transcoder device 600 may also communicate with one or more external devices 614 (e.g., keyboard, pointing device, display 624, etc.), with one or more devices that enable a user to interact with the transcoder device 600, and/or with any device (e.g., network card, modem, etc.) that enables the transcoder device 600 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 622. Also, the text-to-message device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 620. As shown in fig. 6, the network adapter 620 communicates with the other modules of the text-to-message device 600 via the bus 618. It should be appreciated that although not shown in fig. 6, other hardware and/or software modules may be used in conjunction with the text-to-message device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 616 executes programs stored in the memory 528 to execute various functional applications and data processing, for example, implementing the message interaction method between the client and the server provided by any embodiment of the present invention.
EXAMPLE six
A sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program (or referred to as computer-executable instructions) is stored, where the computer program, when executed by a processor, can be used to execute the message interaction method between a client and a server provided in any of the above embodiments of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A message interaction method between a client and a server is characterized by being executed by a message conversion end, and the method comprises the following steps:
converting a first format request message sent by a client into a second format request message, and sending the second format request message to a server;
receiving a second format response message fed back by the server based on the second format request message, and converting the second format response message into a first format response message;
and feeding back the first format response message to the client.
2. The method according to claim 1, wherein the first format request packet is sent by a client to the packet converter via a front-end processor and/or a gateway;
correspondingly, feeding back the first format response packet to the client includes:
and feeding back the first format response message to the client through the front-end processor and/or the gateway.
3. The method of claim 1, wherein converting a first format request message sent by a client into a second format request message comprises:
splitting a first format request message sent by a client into a general part and a detailed part;
converting the common portion to a first sub-portion of a second format based on a first common conversion template of the first format and the second format;
converting the rule portion to a second sub-portion in a second format based on a first dynamic adaptation rule;
and generating a second format request message according to the first sub-part and the second sub-part of the second format.
4. The method of claim 3, wherein converting the rule portion to a second sub-portion in a second format based on a first dynamic adaptation rule comprises:
dynamically adapting the keywords in the detailed part to be label values corresponding to the keywords;
dynamically adapting the numerical value in the detailed part to be a character string corresponding to the numerical value;
wherein the tag value and the string are a second portion of the second format.
5. The method of claim 1, wherein converting the second format response packet to the first format response packet comprises:
converting the second format response message into a response object; wherein the response object includes at least: response status and response information;
converting the response status to a first sub-portion of the first format based on a second common conversion template of the first format and the second format;
converting the response information into a second part of the first format based on a second dynamic adaptation rule;
and generating a first format response message according to the first sub-part and the second sub-part of the first format.
6. The method of any one of claims 1-5, wherein the first format is a json format; the second format is an xml format.
7. A message interaction device between a client and a server, configured at a message conversion end, the device comprising:
the first conversion module is used for converting a first format request message sent by a client into a second format request message;
the first transmission module is used for sending the second format request message to a server;
the first transmission module is further used for receiving a second format response message fed back by the server based on the second format request message;
the second conversion module is used for converting the second format response message into a first format response message;
and the second transmission module is used for feeding back the first format response message to the client.
8. The apparatus according to claim 7, wherein the first format request packet is sent by a client to the packet converter via a front-end processor and/or a gateway;
correspondingly, the second transmission module is specifically configured to: and feeding back the first format response message to the client through the front-end processor and/or the gateway.
9. A message converting end device, characterized in that the message converting end device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the client-server message interaction method of any one of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a client-server message interaction method according to any one of claims 1 to 6.
CN202010431697.3A 2020-05-20 2020-05-20 Message interaction method, device, equipment and medium for client and server Pending CN111614757A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010431697.3A CN111614757A (en) 2020-05-20 2020-05-20 Message interaction method, device, equipment and medium for client and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010431697.3A CN111614757A (en) 2020-05-20 2020-05-20 Message interaction method, device, equipment and medium for client and server

Publications (1)

Publication Number Publication Date
CN111614757A true CN111614757A (en) 2020-09-01

Family

ID=72198502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010431697.3A Pending CN111614757A (en) 2020-05-20 2020-05-20 Message interaction method, device, equipment and medium for client and server

Country Status (1)

Country Link
CN (1) CN111614757A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112258298A (en) * 2020-11-19 2021-01-22 中国民航信息网络股份有限公司 Data processing method and device and electronic equipment
CN112565337A (en) * 2020-11-06 2021-03-26 北京奇艺世纪科技有限公司 Request transmission method, server, client, system and electronic equipment
CN113037727A (en) * 2021-02-26 2021-06-25 北京北信源信息安全技术有限公司 Message information processing method and device, electronic equipment and storage medium
CN113132394A (en) * 2021-04-22 2021-07-16 中国建设银行股份有限公司 Request processing system, method and device, storage medium and electronic equipment
CN113691584A (en) * 2021-07-15 2021-11-23 广州三七互娱科技有限公司 Data transmission method, device and network bridge
CN115643314A (en) * 2022-10-21 2023-01-24 中电金信软件有限公司 System alternation information confirmation method and system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5911776A (en) * 1996-12-18 1999-06-15 Unisys Corporation Automatic format conversion system and publishing methodology for multi-user network
US20110116610A1 (en) * 2009-11-19 2011-05-19 At&T Mobility Ii Llc User Profile Based Speech To Text Conversion For Visual Voice Mail
CN102185901A (en) * 2011-04-19 2011-09-14 北京神州数码思特奇信息技术股份有限公司 Client message conversion method
US20140059572A1 (en) * 2012-01-06 2014-02-27 Tymphany Hong Kong Limited Consolidated data services apparatus and method
CN105144111A (en) * 2013-03-14 2015-12-09 微软技术许可有限责任公司 Relay service for different WEB service architectures
CN107463356A (en) * 2017-08-17 2017-12-12 北京云纵信息技术有限公司 The execution method and apparatus of flow of task
CN107483592A (en) * 2017-08-22 2017-12-15 中国银行股份有限公司 A kind of transaction processing method based on General Front End Processor and a kind of General Front End Processor
CN109586979A (en) * 2018-12-29 2019-04-05 中国银行股份有限公司 A kind of message transmitting method and device
CN110022289A (en) * 2018-01-10 2019-07-16 北龙中网(北京)科技有限责任公司 Data transmission method, apparatus and system
CN110445860A (en) * 2019-08-06 2019-11-12 深圳市金证科技股份有限公司 A kind of file transmitting method, device, terminal device and storage medium
CN110933146A (en) * 2019-11-14 2020-03-27 厦门网宿有限公司 Data conversion method and device and server

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5911776A (en) * 1996-12-18 1999-06-15 Unisys Corporation Automatic format conversion system and publishing methodology for multi-user network
US20110116610A1 (en) * 2009-11-19 2011-05-19 At&T Mobility Ii Llc User Profile Based Speech To Text Conversion For Visual Voice Mail
CN102185901A (en) * 2011-04-19 2011-09-14 北京神州数码思特奇信息技术股份有限公司 Client message conversion method
US20140059572A1 (en) * 2012-01-06 2014-02-27 Tymphany Hong Kong Limited Consolidated data services apparatus and method
CN105144111A (en) * 2013-03-14 2015-12-09 微软技术许可有限责任公司 Relay service for different WEB service architectures
CN107463356A (en) * 2017-08-17 2017-12-12 北京云纵信息技术有限公司 The execution method and apparatus of flow of task
CN107483592A (en) * 2017-08-22 2017-12-15 中国银行股份有限公司 A kind of transaction processing method based on General Front End Processor and a kind of General Front End Processor
CN110022289A (en) * 2018-01-10 2019-07-16 北龙中网(北京)科技有限责任公司 Data transmission method, apparatus and system
CN109586979A (en) * 2018-12-29 2019-04-05 中国银行股份有限公司 A kind of message transmitting method and device
CN110445860A (en) * 2019-08-06 2019-11-12 深圳市金证科技股份有限公司 A kind of file transmitting method, device, terminal device and storage medium
CN110933146A (en) * 2019-11-14 2020-03-27 厦门网宿有限公司 Data conversion method and device and server

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565337A (en) * 2020-11-06 2021-03-26 北京奇艺世纪科技有限公司 Request transmission method, server, client, system and electronic equipment
CN112258298A (en) * 2020-11-19 2021-01-22 中国民航信息网络股份有限公司 Data processing method and device and electronic equipment
CN113037727A (en) * 2021-02-26 2021-06-25 北京北信源信息安全技术有限公司 Message information processing method and device, electronic equipment and storage medium
CN113132394A (en) * 2021-04-22 2021-07-16 中国建设银行股份有限公司 Request processing system, method and device, storage medium and electronic equipment
CN113691584A (en) * 2021-07-15 2021-11-23 广州三七互娱科技有限公司 Data transmission method, device and network bridge
CN113691584B (en) * 2021-07-15 2024-03-15 广州三七互娱科技有限公司 Data transmission method, device and network bridge
CN115643314A (en) * 2022-10-21 2023-01-24 中电金信软件有限公司 System alternation information confirmation method and system
CN115643314B (en) * 2022-10-21 2024-02-23 中电金信软件有限公司 System alternating information confirmation method and system

Similar Documents

Publication Publication Date Title
CN111614757A (en) Message interaction method, device, equipment and medium for client and server
CN110263277B (en) Page data display method, page data updating device, page data equipment and storage medium
CN112860798B (en) Data processing method and device, electronic equipment and storage medium
US20200076881A1 (en) Method, device and vehicle for message deduplication
CN114528044B (en) Interface calling method, device, equipment and medium
CN111432000A (en) Control method, device, equipment and storage medium of Internet of things equipment
CN109101664B (en) Data transmission method, device, equipment and medium for lightweight node
CN109669787B (en) Data transmission method and device, storage medium and electronic equipment
CN111026931A (en) Data query method, device, equipment and medium
CN112417016B (en) Data exchange method, system, equipment and storage medium
CN111694866A (en) Data searching and storing method, data searching system, data searching device, data searching equipment and data searching medium
CN111913922B (en) Binary structured log generation method, device, equipment and storage medium
CN114281876A (en) Data processing method, device, equipment and storage medium
CN113849449A (en) Communication system and information interaction method, device and medium
CN113656193A (en) Application communication method, system, electronic equipment and storage medium
US8776098B2 (en) Exchanging data using data transformation
CN107992457B (en) Information conversion method, device, terminal equipment and storage medium
CN111510499A (en) Communication method, device, equipment and storage medium
CN112948138A (en) Method and device for processing message
CN113608889B (en) Message data processing method, device, equipment and storage medium
CN115599571A (en) Data processing method and device, electronic equipment and storage medium
US20240193249A1 (en) Method of processing cross-domain authorization and method of processing cross-domain call
US20230214577A1 (en) Character string transmission method and device, computer, and readable storage medium
CN113393288A (en) Order processing information generation method, device, equipment and computer readable medium
CN115686229A (en) Expression input method, expression input device and computer program storage 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
TA01 Transfer of patent application right

Effective date of registration: 20220919

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20200901

RJ01 Rejection of invention patent application after publication