A protocol conversion method and device

By analyzing the handshake signal to determine the protocol attributes and automatically connect the target interface, the problem of lack of protocol conversion gateway components in the existing technology is solved, and multiple protocol conversion and automatic docking of interfaces is realized, reducing development costs and improving efficiency.

CN114615346BActive Publication Date: 2024-11-12SHANGHAI FUDAN KINGSTAR COMPUTER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210219634.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2024-11-12
Estimated Expiration
2042-03-08

Smart Images

  • Figure CN114615346B_ABST
    Figure CN114615346B_ABST
Patent Text Reader

Abstract

The present invention provides a protocol conversion method and device; wherein, the method comprises: receiving a handshake signal sent by an access module, parsing the handshake signal to extract a first signal; determining the protocol attribute of the access module according to the first signal, and determining the target interface according to the protocol attribute; connecting the access module with the target interface; wherein, the handshake signal is transmitted through a universal interface supporting a universal protocol, and the target interface is associated with a conversion protocol corresponding to the protocol attribute; on the one hand, the scheme of the present invention can pre-establish multiple interfaces, and different interfaces support different conversion protocols, without the need to repeatedly develop conversion protocols, thereby greatly reducing the development cost of the transaction system; on the other hand, when adding a new interface, the scheme of the present invention can automatically interact, identify and finally realize the docking of the interface between the access module and the protocol conversion device, without the need for excessive user participation, thereby improving the efficiency of interface pairing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer and information technology, and in particular to a protocol conversion method and device. Background Art

[0002] With the rapid development of Internet technology, more and more interactive behaviors are realized through the Internet. For example, financial and securities trading systems have brought great changes to people's lives. This type of trading system is mainly built based on the cpack protocol. However, some peripheral systems built around the trading system are mostly built with Java as the main development language. In order to achieve normal communication and interaction between systems across languages ​​and protocols, it is very necessary to convert the protocol. However, there is currently no such protocol conversion gateway component in the existing technology, which means that each trading system operator must develop a protocol conversion module in a targeted manner, resulting in a particularly high development cost. Summary of the invention

[0003] In order to at least solve the technical problems existing in the above-mentioned background technology, the present invention provides a protocol conversion method, device, electronic device and storage medium.

[0004] A first aspect of the present invention provides a protocol conversion method, comprising the following steps:

[0005] Receiving a handshake signal sent by the access module, and parsing the handshake signal to extract a first signal;

[0006] Determine a protocol attribute of the access module according to the first signal, and determine a target interface according to the protocol attribute;

[0007] Connecting the access module to the target interface;

[0008] The handshake signal is transmitted through a universal interface supporting a universal protocol, and the target interface is associated with a conversion protocol corresponding to the protocol attribute.

[0009] Optionally, the first signal also includes an estimated signal transmission amount;

[0010] Then determining the target interface according to the protocol attribute includes:

[0011] The conversion difficulty is determined according to the protocol attribute, and the target interface is determined according to the conversion difficulty and the estimated signal transmission amount.

[0012] Optionally, after determining the target interface according to the protocol attributes, the method further includes:

[0013] The corresponding conversion protocol is retrieved according to the protocol attribute, and the conversion protocol is placed into the target interface.

[0014] Optionally, connecting the access module to the target interface includes:

[0015] Obtaining the interface ID of the target interface and transmitting it to the access module, and obtaining the module ID of the access module and transmitting it to the target interface;

[0016] The access module and the target interface perform interactive verification, and after the verification is passed, a communication connection between the access module and the target interface is established.

[0017] Optionally, the method is applied to a client or a server.

[0018] Optionally, when the method is applied to the server side, the target interface determines whether to perform fusing or current limiting based on real-time communication data.

[0019] Optionally, the target interface determines whether to perform fusing or current limiting according to the real-time communication data, including:

[0020] Calculate the real-time signal transmission amount according to the real-time communication data;

[0021] The difference between the real-time signal transmission amount and the estimated signal transmission amount is calculated, and if the difference is greater than a first threshold, fuse breaking or current limiting is performed.

[0022] A second aspect of the present invention provides a protocol conversion device, comprising a processing module, a storage module, and a communication module, wherein the processing module is connected to the storage module and the communication module respectively; wherein:

[0023] The storage module is used to store executable computer program code;

[0024] The communication module is used to realize the communication connection between the access module and the target interface and the processing module;

[0025] The processing module is used to execute the method as described in any of the preceding items by calling the executable computer program code in the storage module.

[0026] A third aspect of the present invention provides an electronic device, comprising:

[0027] A memory storing executable program code;

[0028] a processor coupled to the memory;

[0029] The processor calls the executable program code stored in the memory to execute the method as described in any of the preceding items.

[0030] A fourth aspect of the present invention provides a computer storage medium having a computer program stored thereon, and the computer program, when executed by a processor, executes any of the methods described above.

[0031] The solution of the present invention receives a handshake signal sent by an access module, parses the handshake signal to extract a first signal; determines the protocol attribute of the access module according to the first signal, and determines the target interface according to the protocol attribute; connects the access module with the target interface; wherein the handshake signal is transmitted through a universal interface supporting a universal protocol, and the target interface is associated with a conversion protocol corresponding to the protocol attribute. Therefore, the solution of the present invention can establish multiple interfaces in advance on the one hand, and different interfaces support different conversion protocols (i.e., converting protocols such as grpc, http, webservice to cpack protocols). Therefore, when a new interface is added or a new access module is provided, there is no need to develop a conversion protocol for the access module again, which greatly reduces the development cost of the transaction system; on the other hand, when a new interface is added, the solution of the present invention can automatically interact, identify and finally realize the docking of the interface between the access module and the protocol conversion device, and the whole process does not require excessive user participation, which greatly improves the efficiency of interface pairing. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 It is a flowchart of a protocol conversion method disclosed in an embodiment of the present invention;

[0034] Figure 2 It is a structural schematic diagram of a protocol conversion device disclosed in an embodiment of the present invention;

[0035] Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0038] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, it is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the product of the invention is usually placed when used. It is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the system or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0039] The terms "first", "second", "third", and "fourth" in the specification and claims of the present invention are used to distinguish different objects rather than to describe a specific order of the objects. For example, the first input, the second input, the third input, and the fourth input are used to distinguish different inputs rather than to describe a specific order of the inputs.

[0040] In the embodiments of the present invention, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0041] In the description of the embodiments of the present invention, unless otherwise specified, “multiple” means two or more than two. For example, multiple processing units refer to two or more processing units; multiple elements refer to two or more elements, etc.

[0042] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0043] Embodiment 1

[0044] See also Figure 1 , Figure 1 1 is a flow chart of a protocol conversion method disclosed in an embodiment of the present invention. Figure 1 As shown, a protocol conversion method according to an embodiment of the present invention comprises the following steps:

[0045] Receiving a handshake signal sent by the access module, and parsing the handshake signal to extract a first signal;

[0046] Determine a protocol attribute of the access module according to the first signal, and determine a target interface according to the protocol attribute;

[0047] Connecting the access module to the target interface;

[0048] The handshake signal is transmitted through a universal interface supporting a universal protocol, and the target interface is associated with a conversion protocol corresponding to the protocol attribute.

[0049] In the embodiment of the present invention, with the increase of various transaction system functional modules, there are more and more various access modules around the transaction system, and the protocols based on different access modules are different, especially different from the protocols of the transaction system itself. For example, the transaction system is generally built based on the cpack protocol, and the protocols of the peripheral access modules include grpc, http, webservice, etc. Therefore, protocol conversion becomes a necessary condition for the normal communication between the transaction system and each access module.

[0050] In view of this, the present invention constructs a protocol conversion device, which can be implemented between the trading system and each access module. As described in the above method, the protocol conversion device itself has a general interface and several interfaces supporting other protocols, wherein the general interface can receive the handshake signal sent by the access module. Since the handshake signal is transmitted through the general protocol, the protocol conversion device of the present invention can identify the information carried by the handshake signal, and then determine the protocol attributes supported by the corresponding access module, and then filter out the interface corresponding to the protocol attribute from the aforementioned several interfaces supporting other protocols, and associate the access module with the filtered interface, so that the normal communication connection between the trading system and the corresponding access module can be realized. The scheme of the present invention can establish multiple interfaces in advance, and different interfaces support different conversion protocols (i.e., converting protocols such as grpc, http, webservice to cpack protocols), so that when a new interface is added or a new access module is added, there is no need to develop a conversion protocol for the access module again, which greatly reduces the development cost of the trading system; and, when the scheme of the present invention adds a new interface, the access module and the protocol conversion device can automatically interact, identify and finally realize the docking of the interface, and the whole process does not require too much user participation, which greatly improves the efficiency of interface pairing.

[0051] It should be noted that the universal protocol in the present invention may be the most basic or simplest protocol, such as the UDP protocol. Accordingly, both the protocol conversion module and the access module should support the protocol.

[0052] Optionally, the first signal also includes an estimated signal transmission amount;

[0053] Then determining the target interface according to the protocol attribute includes:

[0054] The conversion difficulty is determined according to the protocol attribute, and the target interface is determined according to the conversion difficulty and the estimated signal transmission amount.

[0055] In the embodiment of the present invention, the conversion difficulty of grpc, http, webservice protocol and cpack protocol is different. The conversion difficulty is mainly reflected in the conversion computing power requirement, which can be set in advance; at the same time, the signal estimated transmission volume of the access module is also different; in addition, multiple access modules with the same protocol may access the same interface at the same time. At this time, it is necessary to consider the corresponding interface amount of the remaining conversion capacity when selecting the target interface. In view of this, the present invention selects a suitable target interface according to the conversion difficulty and the signal estimated transmission volume. For example, the conversion demand value is determined according to the corresponding conversion difficulty and the signal estimated transmission volume, and it is matched and calculated with the remaining conversion capacity value of each interface (supporting the same protocol). In this way, the best target interface can be determined, which can effectively ensure that the communication between the transaction system and each access module is smooth and reliable, and at the same time, it can reduce the use of the interface, which is conducive to the subsequent access of more access modules.

[0056] Optionally, after determining the target interface according to the protocol attributes, the method further includes:

[0057] The corresponding conversion protocol is retrieved according to the protocol attribute, and the conversion protocol is placed into the target interface.

[0058] In an embodiment of the present invention, the improvement over the aforementioned scheme is that the interfaces preset in the protocol conversion device in this embodiment are empty interfaces, that is, the corresponding conversion protocols are not pre-installed in these interfaces, and the conversion protocols are pre-placed in the conversion protocol library. Such a setting can reduce the vacancy rate of the interface and is more conducive to the efficient use of the interface. At the same time, it also saves the user from configuring the interface after creating a new interface. In actual operation, the user only needs to create a new interface according to actual needs.

[0059] Optionally, connecting the access module to the target interface includes:

[0060] Obtaining the interface ID of the target interface and transmitting it to the access module, and obtaining the module ID of the access module and transmitting it to the target interface;

[0061] The access module and the target interface perform interactive verification, and after the verification is passed, a communication connection between the access module and the target interface is established.

[0062] In an embodiment of the present invention, after determining the target interface, that is, establishing the association relationship between the target interface and the corresponding access module, the protocol conversion device can interactively transmit the interface ID of the target interface and the module ID of the access module respectively, so that both know each other's ID, and then perform interactive verification between the two. When the interactive verification is passed, a communication connection between the two can be established, and finally a communication connection between the transaction system and the access module is realized.

[0063] It should be noted that the aforementioned interactive verification can be performed in a variety of ways. For example, the target interface receives the verification information sent by the access module, and the target interface analyzes the following: 1. Based on the trusted root, the system boot program, system program, important configuration parameters and key application programs of the access module are trusted. Of course, the above interactive verification is only for illustration and is not used to limit the protection scope of the present invention. The present invention does not exclude other interactive verification methods, which will not be repeated here.

[0064] Optionally, the method is applied to a client or a server.

[0065] In the embodiment of the present invention, the implementation end of the protocol conversion method can be a client or a server, which expands the scope of application and makes the trading system more adaptable. For example, when the protocol conversion method of the present invention is applied to the client, the server of the trading system does not need to deploy the protocol conversion device required for protocol conversion, which can reduce the computing power requirements of the server, and can improve the stability, reliability and efficiency of the trading system.

[0066] Optionally, when the method is applied to the server side, the target interface determines whether to perform fusing or current limiting based on real-time communication data.

[0067] In an embodiment of the present invention, when the method of the present invention is applied to the server side, in order to avoid server slowdown or even crash due to overload, network attack, etc., the present invention further sets the target interface to communicate data in real time to determine whether to execute fuse or current limiting.

[0068] Optionally, the target interface determines whether to perform fusing or current limiting according to the real-time communication data, including:

[0069] Calculate the real-time signal transmission amount according to the real-time communication data;

[0070] The difference between the real-time signal transmission amount and the estimated signal transmission amount is calculated, and if the difference is greater than a first threshold, fuse breaking or current limiting is performed.

[0071] In an embodiment of the present invention, since the estimated signal transmission volume has been transmitted when the access module requests access, and the estimated signal transmission volume is a reasonable signal transmission volume predicted by the user or the access module based on its own actual data, when the real-time signal transmission volume monitored by the target interface is significantly higher than the estimated signal transmission volume, it can be determined that an abnormality exists. At this time, it can be decided to perform a fuse or current limiting operation based on the degree of excess to protect the normal operation of the server.

[0072] It should be noted that the fuse or current limiting operation can be achieved by adjusting the upload channel limit of the target interface through a preset program, or by adjusting the working efficiency of the conversion protocol, and the present invention does not limit this.

[0073] Embodiment 2

[0074] See also Figure 2 , Figure 2 Schematic diagram of the structure of a protocol conversion device disclosed in an embodiment of the present invention. Figure 2 As shown, a protocol conversion device 100 according to an embodiment of the present invention includes a processing module 101, a storage module 102, and a communication module 103, wherein the processing module 101 is connected to the storage module 102 and the communication module 103; wherein,

[0075] The storage module 102 is used to store executable computer program code;

[0076] The communication module 103 is used to realize the communication connection between the access module and the target interface and the processing module 101;

[0077] The processing module 101 is used to execute the method as described in the first embodiment by calling the executable computer program code in the storage module 102 .

[0078] The specific functions of a protocol conversion device in this embodiment refer to the above-mentioned embodiment 1. Since the device in this embodiment adopts all the technical solutions of the above-mentioned embodiments, it at least has all the beneficial effects brought by the technical solutions of the above-mentioned embodiments, which will not be described one by one here.

[0079] Embodiment 3

[0080] See also Figure 3 , Figure 3 An electronic device disclosed in an embodiment of the present invention includes:

[0081] A memory storing executable program code;

[0082] a processor coupled to the memory;

[0083] The processor calls the executable program code stored in the memory to execute the method described in the first embodiment.

[0084] Embodiment 4

[0085] The embodiment of the present invention further discloses a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in the first embodiment is executed.

[0086] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0087] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0088] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0089] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0090] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0091] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0092] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0093] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A protocol conversion method, characterized in that: The steps include: Receiving, through a universal interface, a handshake signal sent by the access module based on a universal protocol, and parsing the handshake signal to extract a first signal; Determine the protocol attribute of the access module according to the first signal, and determine the target interface according to the protocol attribute; wherein the target interface is one of several interfaces supporting other protocols; Connecting the access module to the target interface; The handshake signal is transmitted through a universal interface supporting a universal protocol, and the target interface is associated with a conversion protocol corresponding to the protocol attribute; The first signal also includes an estimated signal transmission amount; Then determining the target interface according to the protocol attribute includes: Determine the conversion difficulty according to the protocol attribute, and determine the target interface according to the conversion difficulty and the estimated signal transmission amount; After determining the target interface according to the protocol attributes, the method further includes: The corresponding conversion protocol is called according to the protocol attribute, and the conversion protocol is placed in the target interface. Before the conversion protocol is placed in the target interface, it is an empty interface.

2. A protocol conversion method according to claim 1, characterized in that: The step of connecting the access module to the target interface includes: Obtaining the interface ID of the target interface and transmitting it to the access module, and obtaining the module ID of the access module and transmitting it to the target interface; The access module and the target interface perform interactive verification, and after the verification is passed, a communication connection between the access module and the target interface is established.

3. A protocol conversion method according to any one of claims 1-2, characterized in that: The method is applied to the client or the server.

4. A protocol conversion method according to claim 3, characterized in that: When the method is applied to the server side, the target interface determines whether to perform fusing or current limiting according to the real-time communication data.

5. A protocol conversion method according to claim 4, characterized in that: The target interface determines whether to perform fusing or current limiting according to the real-time communication data, including: Calculate the real-time signal transmission amount according to the real-time communication data; The difference between the real-time signal transmission amount and the estimated signal transmission amount is calculated, and if the difference is greater than a first threshold, fuse breaking or current limiting is performed.

6. A protocol conversion device, comprising a processing module, a storage module, and a communication module, wherein the processing module is connected to the storage module and the communication module respectively; wherein: The storage module is used to store executable computer program code; The communication module is used to realize the communication connection between the access module and the target interface and the processing module; It is characterized in that: the processing module is used to execute the method according to any one of claims 1-5 by calling the executable computer program code in the storage module.

7. An electronic device comprising: A memory storing executable program code; a processor coupled to the memory; It is characterized in that: the processor calls the executable program code stored in the memory to execute the method according to any one of claims 1-5.

8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is executed.