WO2023011274A1 - 一种通讯协议转换方法、设备、系统及网关设备 - Google Patents
一种通讯协议转换方法、设备、系统及网关设备 Download PDFInfo
- Publication number
- WO2023011274A1 WO2023011274A1 PCT/CN2022/108151 CN2022108151W WO2023011274A1 WO 2023011274 A1 WO2023011274 A1 WO 2023011274A1 CN 2022108151 W CN2022108151 W CN 2022108151W WO 2023011274 A1 WO2023011274 A1 WO 2023011274A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- request message
- configuration
- party system
- configuration rule
- network request
- Prior art date
Links
- 238000004891 communication Methods 0.000 title claims abstract description 369
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 287
- 238000000034 method Methods 0.000 title claims abstract description 214
- 230000008569 process Effects 0.000 claims description 112
- 230000004044 response Effects 0.000 claims description 79
- 230000008859 change Effects 0.000 claims description 23
- 238000011161 development Methods 0.000 claims description 15
- 230000001960 triggered effect Effects 0.000 claims description 13
- 238000012544 monitoring process Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 10
- 230000000737 periodic effect Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 42
- 238000012986 modification Methods 0.000 description 21
- 230000004048 modification Effects 0.000 description 21
- 230000006870 function Effects 0.000 description 18
- 238000007792 addition Methods 0.000 description 13
- 230000006978 adaptation Effects 0.000 description 10
- 238000012423 maintenance Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 230000003993 interaction Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000012790 confirmation Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 235000014510 cooky Nutrition 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 206010033799 Paralysis Diseases 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0807—Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0884—Network architectures or network communication protocols for network security for authentication of entities by delegation of authentication, e.g. a proxy authenticates an entity to be authenticated on behalf of this entity vis-à-vis an authentication entity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/102—Entity profiles
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
- H04L63/126—Applying verification of the received information the source of the received data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/10—Architectures or entities
- H04L65/102—Gateways
- H04L65/1033—Signalling gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/1066—Session management
- H04L65/1069—Session establishment or de-establishment
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/70—Services for machine-to-machine communication [M2M] or machine type communication [MTC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
Definitions
- the present disclosure relates to the technical field of cloud services, and in particular to a communication protocol conversion method, device, system and gateway device.
- the traditional solution is to separately develop an adapter service for protocol conversion for each third-party system, that is, it is necessary to write different codes for all third-party systems, which is inefficient.
- the present disclosure provides a communication protocol conversion method, device, system and gateway device, which are used to provide a general communication protocol conversion method and solve the problem of low efficiency caused by traditional customized development adapter services.
- an embodiment of the present disclosure provides a communication protocol conversion method, the method includes:
- the network request message representing a message for establishing a communication connection with a third-party system
- configuration rule set includes configuration rules of communication protocols of different third-party systems
- the communication protocol conversion method provided by the embodiment of the present disclosure is a general and dynamically configurable communication protocol conversion system, and can be deployed on a gateway device.
- the communication protocol conversion method and the functions of the gateway itself do not affect each other.
- the implementation principle of this method is to use a predetermined configuration rule set to select a configuration rule corresponding to the received network request message from the configuration rule set, perform corresponding communication protocol conversion on the network request message, and convert the converted network request message to The message is forwarded to the third-party system, so as to realize the communication between the communication device and the third-party system.
- This method solves the problem of inefficiency caused by the traditional custom-developed adapter service. And because the change of the configuration rule does not involve the modification of the code, even if the configuration rule is changed, the gateway device does not need to be restarted, and the communication connection between the communication device and the third-party system will not be interrupted.
- it also includes:
- the network request message is directly sent to the non-third-party system.
- This embodiment can also perform common forwarding functions to meet the requirements of various systems.
- it also includes:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the method provided in this embodiment can determine whether the network request message is from a third-party system or a non-third-party system, so that the network request message of the third-party system is converted to the third-party system after protocol conversion, and the network request message of the non-third-party system is sent to the third-party system.
- the network request message is directly sent to non-third-party systems to achieve versatility and improve integration.
- the determining the configuration rule corresponding to the network request message from the configuration rule set includes:
- the configuration rule corresponding to the routing information is determined from the configuration rule set.
- the configuration rules corresponding to the routing information in the network request message can be determined through the routing information obtained after decoding the network request message, and the corresponding relationship between the routing information and the configuration rules in the configuration rule set. Since each The routes of the three-party systems are different, so the configuration rules of the third-party system can be determined through the routing information, which is simpler and more efficient.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the routing information and configuration rules in this embodiment can be a one-to-one relationship, or a many-to-one relationship, which can be determined according to actual needs. Under the many-to-one relationship, since multiple third-party systems are allocated Different port numbers, so as to ensure that each third-party system can achieve load balancing when a large number of terminals access each third-party system at the same time.
- the determining the configuration rule corresponding to the routing information from the configuration rule set according to the routing information carried in the network request message includes:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the third-party system can be determined according to the routing information, especially when there are a large number of third-party systems, the gateway device can obtain the third-party system more easily through the routing information, and then determine the configuration rules of the third-party system.
- Configuration rules can be determined conveniently and simply without professional knowledge, improving user experience and improving operation and maintenance efficiency.
- the performing communication protocol conversion on the network request message according to the configuration rule includes:
- the protocol conversion rules in the configuration rules are instantiated to obtain the process of performing protocol conversion
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the instantiation of the protocol conversion rule in the configuration rule includes:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the network request message performs communication protocol conversion through the protocol conversion process, including:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- This embodiment can also load external sdk files.
- the method in this embodiment can still be used to encrypt and sign network request messages by loading external sdk files. .
- the sending the network request message after the communication protocol conversion to a corresponding third-party system includes:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the network request message after the communication protocol conversion to the corresponding third-party system after sending the network request message after the communication protocol conversion to the corresponding third-party system, it further includes:
- the performing communication protocol conversion on the network response message according to the configuration rule includes:
- the communication protocol conversion is performed on the network response message.
- the sending the network response message after the communication protocol conversion to the communication device includes:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the method further includes:
- connection request message used to maintain the session connection is periodically sent to the third-party system, and the access token returned by the third-party system can be received periodically, so that the session connection is maintained through the received access token, and the gateway device and the third-party system are connected.
- the session between the three-party systems is permanently maintained without interruption.
- the period after the period sends the connection request message for maintaining the session connection to the third-party system, it further includes:
- the method for determining the validity of the access token provided in this embodiment can improve user experience, intuitively and quickly display the token validity result to the user, and facilitate the user to quickly respond to the situation when the token becomes invalid.
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- This embodiment can also periodically determine the validity of the access token, and if it is determined that the access token is invalid, the user can also be prompted through a display interface to improve the efficiency of user operation and maintenance.
- the access token is invalid, reacquire a valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- a valid access token of the third-party system can be acquired again, so as to keep the session permanently uninterrupted.
- the re-obtaining the valid access token of the third-party system includes:
- it also includes:
- At least one instruction of deleting, modifying, and adding configuration rules from the user is received through the display interface.
- This embodiment can also provide a display interface to facilitate the user to operate the configuration rules and improve the user's operation and maintenance experience.
- it also includes:
- the set of configuration rules is updated at a preset period.
- the configuration rules can also be updated to ensure that the current configuration rules stored in the gateway device are all the latest configuration rules.
- Make the update mechanism of the configuration rule set, reduce the labor cost, and the update cycle can be adjusted, and can be adjusted according to the external situation to meet the needs of users. For example, effective and appropriate adjustments can be made for high-concurrency situations (such as Double Eleven and other situations where there are large-scale external communication requests).
- the updating the configuration rule set includes:
- the update process is notified to update the configuration rule set;
- the updating the configuration rule set includes:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- a communication protocol conversion system provided by an embodiment of the present disclosure includes: a communication device, a gateway device, and multiple third-party systems, wherein:
- the communication device is configured to send a network request message for establishing a communication connection with the third-party system
- the gateway device is configured to receive the network request message, determine a configuration rule corresponding to the network request message from the configuration rule set, perform communication protocol conversion on the network request message according to the configuration rule, and convert the communication
- the protocol-converted network request message is sent to a corresponding third-party system, wherein the set of configuration rules includes configuration rules of communication protocols of different third-party systems.
- a gateway device provided by an embodiment of the present disclosure includes a processor and a memory, the memory is used to store a program executable by the processor, and the processor is used to read the program in the memory and Perform the following steps:
- configuration rule set includes configuration rules of communication protocols of different third-party systems
- the processor is further configured to execute:
- the network request message is directly sent to the non-third-party system.
- the processor is further configured to execute:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the processor is configured to execute:
- the routing information carried in the network request message determine the configuration rule corresponding to the routing information from the configuration rule set.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the processor is configured to execute:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the processor is configured to execute:
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the processor is configured to execute:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the processor is configured to execute:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- the processor is configured to execute:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the processor is further configured to execute:
- the processor is configured to execute:
- the communication protocol conversion is performed on the network response message.
- the processor is configured to execute:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the processor is further configured to:
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- the processor is further configured to:
- the access token is invalid, reacquire a valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- the processor is configured to execute:
- the processor is further configured to execute:
- At least one instruction of deleting, modifying, and adding configuration rules from the user is received through the display interface.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the set of configuration rules is updated at a preset period.
- the processor is configured to execute:
- the update process is notified to update the configuration rule set;
- the processor is configured to execute:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- an embodiment of the present disclosure further provides a communication protocol conversion device, the device includes a processor and a memory, the memory is used to store a program executable by the processor, and the processor is used to read the memory program in and perform the following steps:
- configuration rule set includes configuration rules of communication protocols of different third-party systems
- the processor is further configured to execute:
- the network request message is directly sent to the non-third-party system.
- the processor is further configured to execute:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the processor is configured to execute:
- the configuration rule corresponding to the routing information is determined from the configuration rule set.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the processor is configured to execute:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the processor is configured to execute:
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the processor is configured to execute:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the processor is configured to execute:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- the processor is further configured to execute:
- the loaded sdk file is stored in the configuration rule set, wherein the sdk file is in one-to-one correspondence with the third-party system.
- the processor is configured to execute:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the processor is further configured to execute:
- the processor is configured to execute:
- the communication protocol conversion is performed on the network response message.
- the processor is configured to execute:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the processor is further configured to:
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- the processor is further configured to:
- the access token is invalid, reacquire the valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- the processor is configured to execute:
- the processor is further configured to execute:
- At least one instruction of deleting, modifying, and adding configuration rules from the user is received through the display interface.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the set of configuration rules is updated at a preset period.
- the processor is configured to execute:
- the update process is notified to update the configuration rule set;
- the processor is configured to execute:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- the embodiment of the present disclosure also provides a general-purpose communication protocol conversion device, including:
- a receiving message unit configured to receive at least one network request message sent by the communication device for establishing a communication connection with a third-party system
- a determining rule unit configured to determine a configuration rule corresponding to the network request message from a configuration rule set, wherein the configuration rule set includes configuration rules of communication protocols of different third-party systems;
- a protocol converting unit configured to convert the communication protocol of the network request message according to the configuration rule
- a message sending unit configured to send the network request message converted from the communication protocol to a corresponding third-party system.
- the receiving message unit is also used for:
- the network request message is directly sent to the non-third-party system.
- the receiving message unit is also used for:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the determining rule unit is specifically configured to:
- the configuration rule corresponding to the routing information is determined from the configuration rule set.
- the determining rule unit is specifically configured to:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the protocol conversion unit is specifically configured to:
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the protocol conversion unit is specifically further configured to:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the protocol conversion unit is specifically further configured to:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- the loading unit is also specifically used for:
- the loaded sdk file is stored in the configuration rule set, wherein the sdk file is in one-to-one correspondence with the third-party system.
- the message sending unit is specifically configured to:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the message sending unit is further configured to:
- the message sending unit is specifically further configured to:
- the communication protocol conversion is performed on the network response message.
- the message sending unit is specifically further configured to:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the session connection unit after receiving the network request message sent by the communication device for establishing a communication connection with the third-party system, the session connection unit is also specifically configured to:
- the session connection unit is specifically further configured to:
- the display unit further includes:
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- the session connection unit is further configured to:
- the access token is invalid, reacquire a valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- the session connection unit is specifically configured to:
- the receiving instruction unit is also specifically configured to:
- At least one instruction of deleting, modifying, and adding configuration rules from the user is received through the display interface.
- the receiving instruction unit is specifically further configured to:
- the update unit is also specifically configured to:
- the set of configuration rules is updated at a preset period.
- the updating unit is specifically configured to:
- the update process is notified to update the configuration rule set;
- the updating unit is specifically configured to:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- the embodiments of the present disclosure further provide a computer storage medium, on which a computer program is stored, and the program is used to implement the steps of the method described in the first aspect when executed by a processor.
- FIG. 1 is a schematic diagram of a network structure for implementing protocol conversion through an adapter service provided by an embodiment of the present disclosure
- FIG. 2A is a schematic diagram of the network architecture of the first communication protocol conversion provided by the embodiment of the present disclosure
- FIG. 2B is a schematic diagram of the network architecture of the second communication protocol conversion provided by the embodiment of the present disclosure.
- FIG. 2C is a schematic diagram of the network architecture of the third communication protocol conversion provided by the embodiment of the present disclosure.
- FIG. 2D is a schematic structural diagram of a gateway device provided by an embodiment of the present disclosure.
- FIG. 2E is a schematic diagram of the internal structure of a gateway device provided by an embodiment of the present disclosure.
- FIG. 3A is an implementation flow chart of a communication protocol conversion method provided by an embodiment of the present disclosure
- FIG. 3B is a schematic diagram of specific fields contained in routing information provided by an embodiment of the present disclosure.
- FIG. 3C is an interface diagram provided by an embodiment of the present disclosure.
- FIG. 3D is an interface diagram of a pull-down menu provided by an embodiment of the present disclosure.
- FIG. 3E is an interface diagram for configuring adaptation rules provided by an embodiment of the present disclosure.
- FIG. 4A is a schematic diagram of a data packet structure of a network request message provided by an embodiment of the present disclosure
- FIG. 4B is a schematic diagram of a protocol structure of a network request message provided by an embodiment of the present disclosure.
- FIG. 5 is a schematic diagram of a display interface of routing information and corresponding configuration rules provided by an embodiment of the present disclosure
- FIG. 6 is an implementation flowchart of a communication protocol conversion method provided by an embodiment of the present disclosure.
- FIG. 7 is a detailed implementation flowchart of a communication protocol conversion method provided by an embodiment of the present disclosure.
- FIG. 8 is a schematic diagram of a structural relationship between a memory and a class loader provided by an embodiment of the present disclosure
- FIG. 9 is an implementation flowchart of using an externally loaded sdk file provided by an embodiment of the present disclosure.
- FIG. 10A is a schematic diagram of the internal implementation structure of a gateway device for multi-system communication protocol conversion provided by an embodiment of the present disclosure
- FIG. 10B is a schematic diagram of a first configuration rule update provided by an embodiment of the present disclosure.
- FIG. 10C is a schematic diagram of a second configuration rule update provided by an embodiment of the present disclosure.
- FIG. 11A is a schematic diagram of a route editing interface provided by an embodiment of the present disclosure.
- FIG. 11B is a schematic diagram of an overall editing interface of a token provided by an embodiment of the present disclosure.
- FIG. 11C is a schematic diagram of a Token-editing interface provided by an embodiment of the present disclosure.
- FIG. 12 is an implementation flowchart for implementing a session hold function provided by an embodiment of the present disclosure
- FIG. 13A is a comparative relationship diagram before and after the first protocol conversion provided by the embodiment of the present disclosure.
- FIG. 13B is a comparison diagram before and after the second protocol conversion provided by the embodiment of the present disclosure.
- FIG. 14 is a schematic diagram of a communication protocol conversion system provided by an embodiment of the present disclosure.
- FIG. 15 is a schematic diagram of an interaction process of communication protocol conversion provided by an embodiment of the present disclosure.
- FIG. 16 is a schematic diagram of a specific internal structure of a gateway device provided by an embodiment of the present disclosure.
- FIG. 17 is a schematic diagram of an example of a communication protocol conversion system provided by an embodiment of the present disclosure.
- FIG. 18 is a schematic diagram of a gateway device provided by an embodiment of the present disclosure.
- FIG. 19 is a schematic diagram of a communication protocol conversion device provided by an embodiment of the present disclosure.
- FIG. 20 is a schematic diagram of a communication protocol conversion device provided by an embodiment of the present disclosure.
- JVM Java Virtual Machine
- the term "Java Virtual Machine (JVM)" in the embodiments of the present disclosure refers to a specification of a computer device, which is an abstract computer, and realizes corresponding functions by simulating various computer functions on a real computer. Function.
- JVM Java Virtual Machine
- the Java language uses the Java virtual machine to shield the information related to the specific platform, so that the Java language compiler only needs to be generated to run on the Java virtual machine.
- the object code (bytecode) can run without modification on a variety of platforms.
- software development kit in the embodiments of the present disclosure refers to a collection of development tools for building application software, such as specific software packages, software frameworks, hardware platforms, and operating systems;
- digital signature in the embodiments of the present disclosure refers to an unforgeable digital string generated by the information sender.
- the digital string is also an effective proof of the authenticity of the information sent by the information sender. It is a digital signature in the field of public key encryption. technology to identify methods of digital information.
- Session in the embodiments of the present disclosure is called “session control" in computers.
- the Session object stores attributes and configuration information required for a specific user session. When the user jumps between the Web pages of the application, the variables stored in the Session object will not be lost, but exist in the user's entire session.
- Remote Dictionary Server in the embodiments of the present disclosure refers to an open-source log-type and Key-Value database that is written in ANSI C language, supports the network, and can be memory-based or persistent, and provides Application Programming Interface (API) in multiple languages.
- API Application Programming Interface
- dynamic class loading in the embodiments of the present disclosure refers to reading a class file of a class (a file after compiling java code) into the memory and creating an object for it, and the loading of the class is completed through a class loader.
- the protocol conversion is realized through a separately developed protocol conversion adapter service.
- the adaptation service is between the gateway and multiple third-party systems. Since all protocol conversion codes are Running in the same adaptation service, if new code is added to the adaptation service when a third-party system is newly connected, it is necessary to repackage, compile and redeploy the adapter module, which will inevitably lead to multiple users and the first Communication between three-party systems is interrupted.
- the embodiment of the present disclosure provides a general, dynamically configurable communication protocol conversion method, through the configuration rules for different third-party systems, configure corresponding communication protocols for different third-party systems, if a new In the case of a three-party system, it is only necessary to add a new configuration rule to the configuration rule set.
- the configuration rule When the configuration rule is implemented, no new code is added, but a new process is added to run the newly added configuration rule, thus There is no need to repackage, compile and deploy, which solves the problem of inefficiency caused by traditional custom-developed adapter services.
- the core idea of the disclosed design is to use the configuration rules of the communication protocols of different third-party systems contained in the configuration rule set to select the configuration rule corresponding to the received network request message, convert the network request message to the communication protocol, and then send it to A third-party system, to establish a communication connection between the terminal and the third-party system. Since the configuration rules of different third-party systems are pre-stored in this embodiment, the corresponding configuration rules can be used to perform communication protocol conversion for different network request messages received, and a general protocol conversion method is provided. If the third-party system corresponds to If the configuration rules are added, deleted or modified, since the code is not added, deleted or modified, there is no need to recompile and deploy, which solves the problem of inefficiency caused by traditional custom development adapter services.
- a communication protocol conversion method provided in this embodiment can be applied to a gateway device or other server devices. If applied to a gateway device, the network architecture of the communication protocol conversion provided in this embodiment is shown in FIG. 2A. Including at least one terminal 200a, gateway device 201a, and multiple third-party systems 202a, or, the network architecture for communication protocol conversion provided by this embodiment is shown in Figure 2B, including at least one server 200b, gateway device 201b, and multiple third-party systems System 202b.
- the communication protocol conversion method mentioned in this embodiment is deployed on the gateway device and integrated with the functions of the gateway device itself.
- the configuration rules can be added to the configuration rule set stored in the gateway device, that is, adding
- the configuration rule of the newly added third-party system after instantiating the configuration rule, uses the process obtained by instantiating the configuration rule to perform communication protocol conversion on the network request message sent by the user terminal, which can ensure that the new third-party system is added
- the third-party system will not affect the normal operation of the original third-party system.
- the principle of deleting or modifying the configuration rules is the same as that of adding configuration rules, which will not be repeated here. In actual implementation, you can also combine your own business system with a third-party system.
- the network architecture is shown in Figure 2C, where the communication device is used as the terminal as an example, and the communication protocol conversion method provided in this embodiment is deployed on the gateway device. , enabling multiple terminals to communicate with their own business systems and third-party systems.
- the gateway device in this embodiment includes a routing component 200 and a configuration policy component 201, wherein the routing component 200 is configured as an original function of the gateway device itself, and is used to realize its own business system ( That is, non-third-party systems) provide communication services such as forwarding, or work in cooperation with the configuration policy component 201 to provide services for third-party systems.
- the configuration policy component 201 is configured to perform protocol conversion on the network request message sent to the third-party system according to the stored configuration rules.
- the routing component 200 and the configuration policy component 201 in this embodiment do not interfere with each other when serving non-third-party systems, and the configuration policy component 201 needs to use the codec module 200a in the routing component 200 to perform protocol conversion.
- the received network request message is decoded, the transmitted network request message is encoded, and the protocol-converted network request message is forwarded to a corresponding third-party system through the routing module 200b in the routing component 200 .
- the gateway in this embodiment can be used for unified deployment for third-party systems and non-third-party systems, and the gateway receives the information sent by the communication device.
- this judging mode can conveniently and concisely coordinate the routing component and the configuration policy component to make them operate efficiently, effectively connect communication devices to different objects (third-party or non-third-party), and reduce labor costs.
- the gateway device in this embodiment may further include a confirmation module configured to perform processing of judging whether to configure the policy component after the routing component judges the network request message. For example, after the communication device configures the configuration rules through the interactive interface for the first time, and subsequently establishes a communication connection with the third-party system through the gateway device, the routing component does not need to judge the received network request message again, but through the confirmation module Directly judge whether it is necessary to process the configuration policy component, reduce the amount of data processed by the routing component in the gateway device, save the resources of the routing component in the gateway device, and ensure the efficient operation of the gateway device, especially in the case of high concurrency.
- a confirmation module configured to perform processing of judging whether to configure the policy component after the routing component judges the network request message. For example, after the communication device configures the configuration rules through the interactive interface for the first time, and subsequently establishes a communication connection with the third-party system through the gateway device, the routing component does not need to judge the received network request message again, but through the confirmation module Directly judge whether
- the configuration policy component 201 determines the configuration rule corresponding to the network request message from the configuration rule set; according to the configuration rule Perform communication protocol conversion on the network request message, and then use the routing component 200 to send the network request message after the communication protocol conversion to the corresponding third-party system; if the network request message is used to establish a communication connection with a non-third-party system network request message, the routing component 200 is used to directly send the network request message to the non-third-party system.
- the routing component 200 of the gateway device in this embodiment includes a codec module 200e and a routing module 200f
- the configuration policy component 201 of the gateway device includes a session maintenance module 201e and a protocol conversion module 201f.
- the codec module 200e is used for decoding all received network request messages and encoding sent network request messages.
- the routing module 200f is configured to forward different network request messages according to corresponding configuration rules, and to determine whether the routing information carried in the current network request message contains configuration rules, and if so, to confirm that the network request message needs to be configured. After protocol conversion, send it to a third-party system, otherwise send the network request message directly to a non-third-party system (your own business system).
- the session maintaining module 201e is configured to maintain the session with the third-party system.
- the protocol conversion module 201f is configured to convert the received network request message into a network request message meeting the requirements of the third-party system according to the corresponding configuration rules.
- the internal storage module 201g is used for storing configuration rules, sdk files of third-party systems and other data.
- the implementation process of the communication protocol conversion method provided by this embodiment is as follows:
- Step 300 receiving at least one network request message for establishing a communication connection with a third-party system sent by the communication device;
- the communication device in this embodiment includes but not limited to a terminal and a server.
- the third-party system in this embodiment includes but is not limited to terminals and servers.
- the terminal establishes communication connections with multiple third-party systems, or the server establishes communication connections with multiple third-party systems (servers).
- the communication connection between the purchased servers may be specifically determined according to actual requirements, which is not limited in this embodiment.
- the server of enterprise A is configured as a gateway device according to the communication protocol conversion method provided in this embodiment, and the protocol conversion is performed on the communication messages between the communication device and the third-party system.
- a network request message sent by the communication device is received, and the network request message carries a message for establishing a communication connection with the third-party system; or, multiple network request messages sent by the communication device are received, and each network request message contains Carries the message of establishing a communication connection with a third-party system, in which the network request message is in one-to-one correspondence with the third-party system, that is, the communication device sends a communication connection establishment message to a different third-party system according to sending different network request messages. ask.
- the network request message in this embodiment is actually a data packet, and the schematic diagram of the data packet structure is shown in Figure 4A.
- the essence of the communication protocol conversion in this embodiment is through the Application layer protocol, which converts the application layer protocol used by the application layer data of the data packet sent by the communication device to the third-party system, and forwards the application layer data after the protocol conversion to the third-party system, so as to realize the communication between the communication device and the third-party system communication between.
- the third-party system has its own specific application layer protocol, which is different from the ordinary application layer protocol, it is necessary to convert the application layer protocol corresponding to the application layer data in the data packet of the communication device into the one that needs to establish communication The application layer protocol of the connected third-party system.
- the protocol structure used by the network request message is as shown in Figure 4B, wherein the application layer protocol corresponds to the application layer data in the data packet, the TCP/IP protocol corresponds to the TCP header and the IP header in the data packet, and the link layer Corresponds to the Ethernet header in the packet.
- the data packet and the corresponding protocol structure in this embodiment are only examples, and this embodiment does not limit too much to the specific structure of the network request message.
- the network request message in this embodiment includes: at least one of routing information, source address information, and message content.
- Step 301 Determine configuration rules corresponding to the network request message from a configuration rule set, wherein the configuration rule set includes configuration rules of communication protocols of different third-party systems;
- the configuration rule set in this embodiment is determined in advance according to the corresponding configuration rules of multiple third-party systems, and after the configuration rules of all third-party systems are generated into a configuration rule set, the configuration rule set is processed. storage.
- the configuration rule set is stored in the internal storage module of the gateway, including but not limited to memory or hard disk storage.
- the hard disk storage stores the configuration rule set, including multiple configuration rules, and the memory is responsible for implementing each Configuration rules are instantiated, and "routing information" and "gateway logs" can also be stored in the internal storage module.
- the hard disk storage adopts the PostgreSQL database to realize the storage function, and the memory adopts the redis database to realize the storage function.
- instantiation processing is performed using the stored configuration rule set, thereby realizing communication protocol conversion.
- the configuration rules in this embodiment include routing rules; encoding and decoding rules; at least one of protocol conversion rules; routing rules, encoding and decoding rules, protocol conversion rules in the configuration rules, and third-party systems. corresponding.
- the mapping relationship among the identification of the third-party system, routing rules, coding and decoding rules, and protocol conversion rules can be established.
- routing rules are used to represent at least one of routing format rules and name rules, for example, different routing rules indicate different routing formats or different gateway domain names.
- the encoding and decoding rules are used to represent the way of encoding and decoding messages, and different encoding and decoding rules can encode and decode different messages.
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- the token configuration rule is used to characterize the rules of the token used by the third-party system, such as the address of the token, the domain name of the token, the key of the token, the format of the token, and the addition or modification of the request header of the token, so that Add or modify the request body of the card, the regular expression of the token, the expiration time of the token and other rules.
- the token configuration rules can be used to characterize the rules of the token used by the third-party system, such as the address of the token, the domain name of the token, the key of the token, the format of the token, and the addition or modification of the request header of the token, so that Add or modify the request body of the card, the regular expression of the token, the expiration time of the token and other rules.
- Digital signature configuration rules are used to characterize the digital signature rules used by third-party systems. Since most of the third-party systems currently have their own digital signature rules, the digital signature rules between the third-party systems cannot be used universally, and this embodiment can add/modify the network request message with each other by configuring the digital signature configuration rules. Digital signature rules corresponding to third-party systems to achieve universality.
- Message configuration rules are used to represent configuration rules corresponding to request messages and response messages, such as addition or modification of request headers, addition or modification of request bodies, addition or modification of request parameters, addition or modification of response headers, addition or modification of response bodies Modification, addition or modification of response parameters.
- the message Format and access tokens are configured for universality.
- the configuration rule for using the software development kit sdk file means that if the third-party system does not disclose its own data encryption or digital signature algorithm and requires external access users to use the provided sdk for data encryption and digital signature, then in the configuration rule
- the sdk file of the third-party system can be saved, and the sdk file can be used to encrypt and digitally sign the message.
- the sdk file is a part of the configuration rules, which can be directly loaded and used, but the specific data encryption and digital signature algorithms cannot be viewed.
- this embodiment can use the configuration rule to directly add the sdk file to the configuration rule set to realize Load the function used.
- the configuration rule set provided in this embodiment is used to sort out different rules effectively, so that the system improves user experience, and enables users without deep professional knowledge to perform configuration in a concise and friendly manner. Furthermore, when determining the dimensions of the configuration rules, selecting corresponding options from different rules (1-4) can effectively save time and further improve user experience.
- the configuration rule corresponding to the network request message is determined in the following manner:
- the routing information carried in the network request message determine the configuration rule corresponding to the routing information from the configuration rule set.
- routing information is analyzed, and the routing rules corresponding to the routing information are determined, that is, the complete address in the routing (including http address information) is analyzed according to the routing rules, and the third-party system corresponding to the routing information is obtained.
- the third-party system corresponding to the routing information is obtained. It is easy to understand that in the actual process of building multiple third-party systems, different third-party systems usually set different routing rules, and different routing rules correspond to different routing information, so that terminals can be simultaneously established with different configuration systems.
- the communication connection ensures that the established communication links are independent of each other.
- the correspondence between routing information and configuration rules includes but is not limited to any of the following methods:
- the configuration rules correspond to the routing information one by one
- the specific fields contained in the routing information include but are not limited to: route name, route description, path, complete address, service ID, home application ID, configuration rule ID, and whether to retry.
- the matching configuration rules are filtered out from each configuration rule through the "configuration rule ID" field contained in multiple routing information.
- routing information 1 and routing information 2 both contain the same configuration rule ID1, which means that routing information 1 and routing information 2 both correspond to the same configuration rule.
- this embodiment also provides an interface diagram for displaying each field in the routing information, and the user can intuitively view each configuration rule in different routing information, and perform configuration rules Edit, delete, or more operations; among them, more operations can be displayed through a drop-down menu, as shown in Figure 3D, when the user clicks on more operations, the drop-down menu displays "configure adaptation rules", As shown in Figure 3E, after the user clicks "Configure Adaptation Rules" in the drop-down menu, a pop-up window will pop up on the display interface. In the pop-up window, the user can select the adaptation rules.
- the configuration rules in the example.
- the interface provided by this embodiment can enable the user to confirm configuration rules conveniently and quickly, and realize the policy selection required by the user.
- the setting of the drop-down box is an optional one, which is consistent with "the same routing information can only correspond to one configuration rule", which can effectively avoid the user's mistaken selection and improve the user's experience.
- the configuration adaptation rules will be stored, for example, in the confirmation module of the gateway device.
- the routing component There is no need to judge the received network request message again, but by confirming the configuration adaptation rules stored in the module, it is directly judged whether it is necessary to process the configuration policy component, which reduces the amount of data processed by the routing component in the gateway device and saves time in the gateway device.
- the resources of routing components ensure the efficient operation of gateway devices.
- the same routing information can only correspond to one configuration rule, and the same configuration rule can correspond to one or more routing information. If multiple routing information corresponds to the same configuration rule, the configuration rules of multiple third-party systems corresponding to the multiple routing information are the same, then the interaction data between multiple third-party systems and terminals can be reused, through Configure different port numbers for different third-party systems, so as to solve the problem of system crashes caused by a large number of terminals interacting with multiple third-party systems at the same time, so that multiple third-party systems can achieve load balancing in this scenario.
- the two configuration rules provided in this embodiment correspond to the routing information, which can be selected according to actual needs, and this embodiment does not make too many limitations on this.
- the corresponding relationship between routing information and configuration rules may be stored in the configuration rule set, or the corresponding relationship between routing information, third-party system identifiers, and configuration rules may be used to determine from the configuration rule set through the following steps Configuration rules corresponding to the routing information:
- Step 301a according to the routing information carried in the network request message, determine the third-party system corresponding to the routing information;
- the routing information can be parsed according to the routing rules in the configuration rule set, for example, according to the path in the routing information, an adapted routing rule can be determined and analyzed. If the parsing is successful, it means that the routing information matches the routing rule , otherwise it does not match, then use the route information obtained through parsing to determine the third-party system corresponding to the route information.
- the third-party system can be determined according to the routing information, especially when there are a large number of third-party systems, the gateway device can obtain the third-party system more easily through the routing information, and then determine the configuration rules of the third-party system. For users, Configuration rules can be determined conveniently and simply without professional knowledge, improving user experience.
- the rule configuration interface can also be displayed, as shown in Figure 5, the routing information of each third-party system and the corresponding configuration rules are displayed through the display interface, where
- the displayed routing information includes, but is not limited to: at least one of routing name, routing description, path, complete address, service ID, and home application.
- the displayed configuration rules include but are not limited to: at least one of configuration rules, ignore prefixes, whether to retry, and operations (including editing, deleting, and more operations).
- Step 301b Determine the configuration rule corresponding to the third-party system from the configuration rule set.
- the corresponding third-party system is determined according to the routing information, and after the corresponding configuration rules are determined according to the third-party system, the network request sent by the terminal is The message is decoded again, and the communication protocol conversion is performed on the decoded network request message again.
- Step 302 performing communication protocol conversion on the network request message according to the configuration rule
- the method before performing communication protocol conversion on the network request message according to the configuration rule, the method further includes: determining that the configuration rule takes effect.
- the configuration rules of the third-party system after adding the configuration rules of the third-party system to the configuration rule set, it is also possible to determine whether the configuration rules are in effect by receiving an effective instruction indicated by the user, so as to use the effective configuration rules to communicate the network request message Protocol conversion. That is, if the configuration rule takes effect, the communication protocol conversion is performed on the network request message according to the configuration rule; otherwise, the communication protocol conversion is not performed.
- communication protocol conversion is performed through the following steps:
- Step 302a instantiate the protocol conversion rules in the configuration rules to obtain the process of performing protocol conversion
- the instantiation process is used to represent the process of creating one or more executable processes according to specified codes. Since the code needs to be instantiated before it can be executed, in this embodiment, after the protocol conversion rule is instantiated, a process of executing the protocol conversion by using the protocol conversion rule can be obtained.
- step 302b the network request message undergoes communication protocol conversion through the protocol conversion process.
- the network request message undergoes communication protocol conversion for the network request message through one or more processes of protocol conversion.
- the configuration rule includes a software development kit sdk file of a third-party system
- a class loader is used to load the software development kit file of the third-party system, and the execution of the software development kit file is obtained.
- the network request message is digitally signed and encrypted through the process of executing the software development kit file; wherein the software development kit file is in one-to-one correspondence with the third-party system.
- the sdk file is composed of a series of class files.
- Loading means that the class files compiled from the sdk file are read into the memory of the gateway device, and an object is created for it.
- the class loading is completed by the class loader.
- the loader can be provided by the JVM or create its own class loader by inheriting the ClassLoader base class. By using different class loaders, the binary data of the class can be loaded from different sources.
- the configuration rules of all third-party systems are pre-determined, including the sdk files required by the third-party systems, and a set of configuration rules is generated from all configuration rules and sdk files and stored in the internal storage module.
- All the configuration rules and sdk files in the configuration rule set can be instantiated first.
- the gateway device After the gateway device receives the request message, it can determine the corresponding configuration rule according to the routing information in the request message, and use the corresponding configuration rule After instantiation, the process of performing protocol conversion is obtained to perform communication protocol conversion.
- protocol conversion rules in this embodiment include any one or more of the following:
- the address for obtaining the token the domain name for obtaining the token
- the http method for obtaining the token the addition or modification of the request body for obtaining the token
- the addition or modification of the request header for obtaining the token and the obtaining command
- the regular expression of the token, token expiration time, token key, token format, token validity check uri, token expiration string can be added after the url and in the request header.
- digital signature algorithm digital signature range (body or body&headers can be selected), digital signature key, and data encryption algorithm.
- request header addition or modification request header removal, request body addition or modification, request parameter addition or modification, adding session, removing session, response header addition or modification, response header removal, Add or modify response body, remove response body, redirect address, forward address, modify response code.
- Message header configuration rules specifically including at least one of adding a request header, modifying a request header, removing a specified request header, removing a specified response header, and modifying a response header.
- Hypertext Transfer Protocol HTTP status code configuration rules specifically include at least one of modifying HTTP request method, modifying HTTP status code, circuit breaker (can be understood as blacklist, interception function), ignoring prefix, and removing session.
- Step 303 sending the network request message after the communication protocol conversion to the corresponding third-party system.
- the network request message after the communication protocol conversion is encoded, and the encoded The network request message is sent to the third-party system.
- the network request message after the communication protocol conversion is sent to a third-party system corresponding to the routing information.
- this embodiment realizes that for different third-party systems, when the terminal needs to establish connections with multiple different third-party systems, the above steps in this embodiment can be used to quickly take effect, which solves the problem of a large number of Internet of Things cloud platforms The problem of low efficiency in integrating multiple third-party systems.
- this embodiment may also receive at least one network request message sent by the communication device for establishing a communication connection with a non-third-party system.
- the connected network request message in the specific implementation, after receiving the network request message sent by the communication device, it is first judged whether the network request message is sent to a third-party system or a non-third-party system. Specifically, it can be based on the route in the network request message It is determined whether the configuration rules are included in the information.
- the gateway device can judge whether protocol conversion needs to be performed according to the routing information, thereby achieving universality.
- this embodiment also provides a method for performing protocol conversion on receiving a network response message sent by a third-party system, as shown in FIG. 6 , and the specific implementation steps of the method are as follows:
- Step 600 Receive the network response message sent by the third-party system, and determine the configuration rules of the third-party system from the configuration rule set;
- the third-party system can be determined according to the received network response message, and the configuration rules of the third-party system need only be determined from the configuration rule set.
- Step 601 performing communication protocol conversion on the network response message according to the configuration rules
- communication protocol conversion is performed through the following steps:
- Step 601a instantiate the protocol conversion rules in the configuration rules to obtain the process of executing the protocol conversion
- the instantiation process is used to represent the process of creating one or more executable processes according to the specified code. Since the code needs to be instantiated before it can be executed, in this embodiment, after the protocol conversion rule is instantiated, a process of executing the protocol conversion by using the protocol conversion rule can be obtained.
- Step 601b Perform communication protocol conversion on the network response message through the protocol conversion process. Wherein, the network response message undergoes communication protocol conversion for the network response message through one or more processes of protocol conversion.
- Step 602 Send the network response message converted from the communication protocol to the communication device.
- the network response message is sent to the communication device by:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the network request message sent by the terminal to the third-party system may be forwarded to the third-party system after communication protocol conversion, and the network response message sent by the third-party system to the terminal may be forwarded to the terminal after communication protocol conversion.
- the embodiment of the present disclosure also provides a detailed communication protocol conversion method, and the specific implementation process of the method is as follows:
- Step 700 receiving at least one network request message sent by the terminal for establishing a communication connection with a third-party system
- Step 701 According to the routing information carried in the network request message, determine the third-party system corresponding to the routing information, and determine the configuration rule corresponding to the third-party system from the configuration rule set;
- Step 702 instantiate the protocol conversion rules in the configuration rules of the third-party system to obtain the process of executing the protocol conversion; the network request message is converted into the communication protocol through the protocol conversion process;
- Step 703. According to the routing information carried in the network request message, send the network request message converted from the communication protocol to a third-party system corresponding to the routing information;
- Step 704 Receive the network response message sent by the third-party system, and determine the configuration rules of the third-party system from the configuration rule set;
- Step 705 Perform protocol conversion on the network response message according to the protocol conversion process obtained by instantiation of the protocol conversion rules in the configuration rules of the third-party system;
- Step 706 Send the network response message after the communication protocol conversion to the terminal at the source address according to the source address of the network request message.
- the embodiments of the present disclosure also provide the function of supporting uploading sdk, which ensures that the third-party system that uses its own data encryption and signature algorithm can still configure rules for the third-party system, and can directly use the uploaded
- the external sdk file encrypts and signs the network request message, which is applicable to various third-party systems and has stronger versatility.
- this embodiment provides a schematic diagram of a structural relationship between memory and a class loader.
- Loading refers to reading the class file of the class (the file after the java code is compiled) into the memory (the memory of the gateway device in this embodiment), that is, reading the class file compiled from the sdk file into the memory, and creating a Objects and classes are loaded by class loaders.
- Class loaders can be provided by the JVM or create their own class loaders by inheriting the ClassLoader base class. By using different class loaders, the binary data of classes can be loaded from different sources.
- the class file compiled from the sdk file is read into the memory, and an object is created for it.
- the sdk file is in one-to-one correspondence with the third-party system.
- it will first judge whether there is an sdk file in the configuration rule corresponding to the network request message sent by the terminal, and if it exists, use the sdk file to digitally sign and encrypt the network request message.
- Step 900 obtaining the sdk file of the uploaded java type
- Step 901 use the class loader to load the sdk file and store it in the configuration rule set;
- Step 902 receiving the network request message sent by the terminal, and determining the configuration rule corresponding to the network request message from the configuration rule set;
- Step 903 determine that the sdk file is included in the configuration rule
- Step 904 use the signature algorithm in the sdk to digitally sign the data specified in the network request message, and add the digitally signed data to the specified request header of the network request message;
- Step 905 using the data encryption algorithm in the sdk to encrypt the data in the network request message;
- Step 906 Send the encrypted network request message to the third-party system.
- this embodiment provides a schematic diagram of the internal implementation structure of a gateway device for system communication protocol conversion.
- the gateway device is used to establish communication connections between multiple terminals and multiple third-party systems.
- the internal storage module in the gateway device stores a configuration rule set, and each configuration rule in the configuration rule set is instantiated to obtain a corresponding protocol conversion process, and each process is in one-to-one correspondence with the third-party system
- process A corresponds to third-party system A
- process B corresponds to third-party system B
- process C corresponds to third-party system C
- process D corresponds to third-party system D. If a new third-party system is added, only a new configuration rule needs to be added to the configuration rule set, and a new process for protocol conversion is generated, and the gateway device does not need to be restarted.
- At least one instruction of deleting, modifying, and adding configuration rules from the user may also be received through the display interface.
- the user can click buttons such as "delete”, “edit” and “add” on the display interface to delete, edit, and add configuration rules on the display interface.
- the token address the address for obtaining the token
- obtain the token http method Get the http method of the token
- get the token regularity get the regular expression of the token format
- token expiration time token expiration time
- token key key
- receiving at least one instruction of the user performing a touch operation or a voice control operation on the configuration rule on the display interface triggers the execution of the operation corresponding to the instruction on the configuration rule; or, receiving the user’s instruction on the display interface Performing at least one instruction among touch operation and voice control operation on the configuration rule in the pop-up window of the configuration rule triggers the execution of the operation corresponding to the instruction on the configuration rule.
- the configuration rule set may also be updated in any of the following ways:
- This embodiment provides at least two ways to update, one is to update the configuration rule set after receiving the user's instruction, and the other is to update the configuration rule set at regular intervals, wherein the user triggers the configuration rule set through the display interface
- the database synchronization command can be triggered by clicking save after editing by the user, can also be triggered by a single button, or can be triggered by clicking confirm after deleting a configuration rule, which is not limited too much in this embodiment.
- "database synchronization time” can be set on the display interface, so as to automatically update the database according to the preset database synchronization time, so as to update the gateway system in time, maintain the communication between the terminal and the third-party system, and avoid emergencies such as downtime A problem occurs that causes communication to be interrupted.
- the method of updating the configuration rule set according to the preset cycle in this embodiment can make the update mechanism of the configuration rule set, reduce labor costs, and the update cycle can be adjusted, and targeted adjustments can be made according to external conditions to meet user needs .
- effective and appropriate adjustments can be made for high-concurrency situations (such as Double Eleven and other situations where there are large-scale external communication requests).
- this embodiment provides any of the following methods for updating configuration rules:
- Method 1 If the change of the configuration rules in the configuration rule set is monitored by the monitoring process, then the update process is notified to update the configuration rule set;
- the update process of this method is shown in Figure 10B.
- the protocol conversion module monitors the change of the configuration rules in the configuration rule set stored in the internal storage module of the gateway device through polling, and updates the Configure the rule set to update.
- Method 2 Store the configuration rule set in a message queue and monitor the content of the message queue. If a change in configuration rules in the configuration rule set is detected, update the content of the message queue accordingly.
- the update process of this method is shown in Figure 10C.
- the change of the configuration rules in the configuration rule set stored in the message queue is monitored, and the configuration rules in the message queue are updated accordingly, and the protocol is notified.
- the conversion module updates the configuration rules stored in the internal storage module.
- the above modes 1)-2) and methods 1)-2) can be implemented in combination, and there is no excessive limitation on this.
- the above update method can dynamically realize human-computer interaction, which is more conducive to fast, efficient and interface-friendly monitoring.
- For the system there is no need for downtime, thus maintaining the efficient operation of the system; for the executor In other words, there is no need for in-depth configuration knowledge and no need to go to the background to execute complex codes, thus improving the user experience.
- this embodiment also provides a method for updating configuration rules, which specifically includes any one or more of the following:
- the newly added configuration rules are added to the configuration rule set, wherein the newly added configuration rules correspond to the third-party systems one by one.
- the configuration rules that need to be deleted in the configuration rule set are deleted.
- the modified configuration rules are in one-to-one correspondence with the third-party systems.
- the gateway since the gateway does not need to be restarted, it can ensure that the communication connection with multiple third-party systems is not interrupted, and solves the inefficiency and online
- the environment restarts the gap period of the service, and integrates with the gateway, which effectively saves server resources.
- this embodiment can also periodically send connection requests in the following manner, specifically as follows:
- the probing interface is provided by a third-party system, and the token (access token) is called as a parameter in the probing interface.
- the method for determining the validity of the access token provided in this embodiment can improve user experience, intuitively and quickly display the token validity result to the user, and facilitate the user to quickly respond to the situation when the token becomes invalid.
- the user after determining the validity of the access token, if the access token is invalid, the user is prompted through a display interface that the access token of the third-party system is invalid, and the way of prompting the user includes but is not limited to: At least one of information and prompt information.
- This embodiment can also periodically determine the validity of the access token, and if it is determined that the access token is invalid, the user can also be prompted through a display interface to improve the efficiency of user operation and maintenance.
- This embodiment also provides a function of maintaining a connection with a third-party system and checking the validity of the access token token, as shown in FIG. 12 , and the specific implementation method is as follows:
- Step 1200 after receiving the network request message sent by the terminal, determine the access token information in the configuration rule corresponding to the network request message;
- the access token information in this embodiment includes but is not limited to: at least one of the request address of the access token and the request parameters of the access token.
- Step 1201. Periodically send a connection request message for maintaining a session connection to the third-party system according to the access token information
- connection request message is used to obtain the access token of the third-party system.
- Step 1202 Receive the access token sent by the third-party system, access the probing interface of the third-party system according to a preset period, and determine the validity of the access token;
- this embodiment can also store information such as sessions and cookies of the third-party system, and update them before invalidation, so as to maintain the session connection with the third-party system.
- Step 1203 If the access token is invalid, reacquire the valid access token of the third-party system, and use the valid access token to perform renew.
- a valid access token is retrieved by:
- the access token information in the configuration rule corresponding to the network request message resend the connection request message for maintaining the session connection to the third-party system; receive the valid access token sent by the third-party system.
- this embodiment provides the first comparison diagram before and after protocol conversion, where the two items systemtype and token have not been added to the Request Header before the protocol conversion, and the configuration The specific rule is to add the systemtype and token required by the third-party system to the Request Header.
- the gateway device determines the corresponding configuration rules according to the routing information 1624415503178, and adds the following content to the Request Header of the original request message:
- the second comparison diagram provided by this embodiment before and after protocol conversion uses the sdk file provided by the third-party system to encrypt data.
- the gateway device determines the corresponding configuration rules according to the routing information 1624415503178, obtains the sdk from the configuration rules, calls the sdk to encrypt the data of the Request Body, and forwards it to the third-party system, that is, to 10.251.186.44:8070.
- this embodiment also provides a specific conversion content of communication protocol conversion, as follows:
- the communication protocol conversion method provided in this embodiment can be applied to gateway devices, thereby reducing the number of servers and deployment workload, and improving the utilization rate of gateway devices; based on the configuration rule set, the communication connection to different third-party systems is realized, and if there is To add a third-party system, the configuration rules of the new third-party system need to be added to the configuration rule set, and there is no need to restart the gateway device, thereby improving development efficiency, reducing the difficulty of operation and maintenance, and solving the problem of service paralysis during restarting the gateway device; And the communication protocol conversion method improved in this embodiment can also support the import of external sdk files to digitally sign and encrypt the request message sent by the terminal, thus solving the current problem of only introducing external sdk files through code in advance, especially for The construction of large-scale third-party systems can effectively improve development efficiency.
- this embodiment also provides a communication protocol conversion system for establishing communication connections between a communication device and multiple third-party systems.
- the system includes at least one communication device 1400, a gateway device 1401. A plurality of third-party systems 1402, wherein:
- the communication device 1400 is configured to send a network request message for establishing a communication connection with the third-party system 1402;
- the gateway device 1401 is configured to receive the network request message, determine a configuration rule corresponding to the network request message from the configuration rule set, perform communication protocol conversion on the network request message according to the configuration rule, and convert the The network request message converted from the communication protocol is sent to the corresponding third-party system 1402, wherein the set of configuration rules includes configuration rules of communication protocols of different third-party systems.
- the interaction process of the communication protocol conversion in the embodiment of the present disclosure is as follows:
- Step 1500 the terminal sends a network request message to the gateway device
- Step 1501 the gateway device determines the configuration rule corresponding to the network request message from the configuration rule set;
- the configuration rule set includes configuration rules of communication protocols of different third-party systems.
- the gateway device determines the third-party system corresponding to the routing information according to the routing information carried in the network request message, and determines the configuration rule corresponding to the third-party system from the configuration rule set.
- Step 1502 the gateway device performs communication protocol conversion on the network request message according to the configuration rule
- the gateway device instantiates the protocol conversion rules in the configuration rules to obtain a protocol conversion process; the network request message undergoes communication protocol conversion through the protocol conversion process.
- Step 1503 the gateway device sends the network request message after the communication protocol conversion to the corresponding third-party system.
- the gateway device sends the network request message after the communication protocol conversion to the third-party system corresponding to the routing information according to the routing information carried in the network request message.
- Step 1504 the gateway device receives the network response message sent by the third-party system
- Step 1505 the gateway device determines the configuration rules of the third-party system from the configuration rule set, and performs communication protocol conversion on the network response message according to the configuration rules;
- the gateway device instantiates the protocol conversion rule in the configuration rules to obtain a protocol conversion process; through the protocol conversion process, the communication protocol conversion is performed on the network response message.
- the configuration rule includes a software development kit file of a third-party system
- a class loader is used to load the software development kit file of the third-party system to obtain a process for executing the software development kit file
- the network request message is digitally signed and encrypted by a process executing said SDK file.
- the software development kit file is in one-to-one correspondence with the third-party system.
- Step 1506 the gateway device sends the network response message after the communication protocol conversion to the terminal.
- the gateway device sends the network response message converted from the communication protocol to the terminal located at the source address according to the source address of the network request message.
- the gateway device after receiving the network request message sent by the terminal for establishing a communication connection with the third-party system, the gateway device is also used to determine the access token information in the configuration rule corresponding to the network request message; according to the The access token information is used to periodically send a connection request message for maintaining the session connection to the third-party system.
- the gateway device after periodically sending the connection request message to the third-party system to maintain the session connection, the gateway device is also used to receive the access token sent by the third-party system, and access the third-party system in a preset period.
- the system's probing interface determines the validity of the access token.
- the gateway device if it is determined that the access token is invalid, the gateway device prompts the user through a display interface that the access token of the third-party system is invalid.
- the gateway device determines the validity of the access token, it is also used to update the access token: specifically, if the access token is invalid, reacquire the valid access token of the third-party system card, using the effective access token to update the access token of the third-party system in the configuration rule.
- the gateway device resends the connection request message for maintaining the session connection to the third-party system according to the access token information in the configuration rule corresponding to the network request message; receives the connection request message sent by the third-party system; A valid access token for .
- the gateway device is further configured to use a class loader to load the software development kit sdk file of the third-party system; store the loaded sdk file into the configuration rule set, wherein the sdk file There is a one-to-one correspondence with the third-party system.
- the gateway device uses the sdk file to digitally sign and encrypt the network request message.
- the gateway device may also receive at least one instruction from the user to delete, modify, and add configuration rules through a display interface.
- the gateway device may also receive a database synchronization instruction triggered by the user through the display interface, and update the configuration rule set; or, update the configuration rule set at a preset period.
- the gateway device may also update the configuration rule set in the following manner:
- the update process is notified to update the configuration rule set;
- the gateway device may also update the set of configuration rules, including:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- the specific internal structure diagram of the gateway device includes a codec module 1600, a routing module 1601, a protocol conversion module 1602, an internal storage module 1603, and a session maintenance module 1604; where:
- the codec module 1600 is used for decoding all received network request messages and encoding sent network request messages. Wherein, the principles of encoding and decoding processing of the network response message and the network request message are the same.
- the codec processing logic of the codec module and the general codec principle can be the same, and the message can be codec again according to the codec algorithm required by the third-party system, that is, if the gateway device receives After the request message arrives at the terminal, it firstly performs general decoding on the request message to obtain routing information, and then decodes the request message again according to the codec rules required by the third-party system in the configuration rules corresponding to the routing information, and performs the corresponding protocol After conversion, firstly encode the request message according to the codec rules required by the third-party system, and then encode the request message again according to the general codec principle and forward it to the third-party system.
- the routing module 1601 is configured to forward different network request messages according to corresponding configuration rules. Wherein, the forwarding principles of the network response message and the network request message are the same.
- the protocol conversion module 1602 is configured to convert the received network request message into a network request message meeting the requirements of the third-party system according to the corresponding configuration rules. Wherein, the principle of the protocol conversion mode of the network response message and the network request message is the same.
- the protocol conversion module is used to receive at least one network request message sent by the communication device, and the network request message represents a message for establishing a communication connection with a third-party system;
- the configuration rules corresponding to the message wherein the configuration rule set includes configuration rules of communication protocols of different third-party systems; perform communication protocol conversion on the network request message according to the configuration rules; convert the network after the communication protocol conversion The request message is sent to the corresponding third-party system.
- the internal storage module 1603 is used to store configuration rules, sdk files of third-party systems and other data.
- the session keeping module 1604 is used to maintain the session with the third-party system, store token, session, cookies and other information of the third-party system, and update it before it becomes invalid.
- an example of a communication protocol conversion system includes a terminal 1700 , a gateway device 1701 , and a third-party system 1702 .
- the network request message sent by the terminal 1700 is first encoded and decoded by the encoding and decoding module in the gateway device 1701 to obtain routing information.
- the routing information passes through the routing module and determines the corresponding configuration rules from the internal storage module. Based on the configuration rules, the protocol The conversion module converts the protocol of the network request message, and during the entire protocol conversion process, the session connection between the gateway device and multiple third-party systems is always maintained through the session maintenance module.
- the communication connection between each terminal and the third-party system needs to be converted through the gateway device.
- the core of the communication protocol conversion is to use the different third-party systems included in the configuration rule set
- the protocol conversion is performed on the configuration rules, thus achieving universality, and since the protocol conversion only needs to be performed through the configuration rule set, even if there are new, modified or deleted configuration rules, only the configuration rule set needs to be updated without restarting the gateway equipment to avoid the outage of various third-party systems.
- this embodiment can also support uploading a custom sdk file, which can solve the scenario where a third-party system does not disclose data encryption or digital signature algorithms. Due to its small size, the methods in the embodiments of the present disclosure can be deployed on gateway devices, saving hardware resources, and will not affect the performance of the gateway device itself.
- an embodiment of the present disclosure also provides a gateway device. Since the device is the device in the method in the embodiment of the present disclosure, and the problem-solving principle of the device is similar to the method, the device’s For the implementation, please refer to the implementation of the method, and repeated descriptions will not be repeated.
- the device includes a processor 1800 and a memory 1801, the memory 1801 is used to store a program executable by the processor 1800, and the processor 1800 is used to read the program in the memory 1801 and Perform the following steps:
- configuration rule set includes configuration rules of communication protocols of different third-party systems
- the processor is further configured to execute:
- the network request message is directly sent to the non-third-party system.
- the processor is further configured to execute:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the processor is configured to execute:
- the configuration rule corresponding to the routing information is determined from the configuration rule set.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the processor is configured to execute:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the processor is configured to execute:
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the processor is configured to execute:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the processor is configured to execute:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- the processor is further configured to execute:
- the loaded sdk file is stored in the configuration rule set, wherein the sdk file is in one-to-one correspondence with the third-party system.
- the processor is configured to execute:
- the sdk file is included in the configuration rule, digitally sign and encrypt the network request message by using the sdk file.
- the processor is configured to execute:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the processor is further configured to execute:
- the processor is configured to execute:
- the communication protocol conversion is performed on the network response message.
- the processor is configured to execute:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the processor is further configured to:
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- the processor is further configured to:
- the access token is invalid, reacquire a valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- the processor is configured to execute:
- the processor is further configured to execute:
- At least one instruction of deleting, modifying, and adding configuration rules from the user is received through the display interface.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the set of configuration rules is updated at a preset period.
- the processor is configured to execute:
- the update process is notified to update the configuration rule set;
- the processor is configured to execute:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- the embodiment of the present disclosure also provides a communication protocol conversion device, since the device is the device in the method in the embodiment of the present disclosure, and the principle of solving the problem of the device is similar to the method, so the For the implementation of the equipment, refer to the implementation of the method, and repeated descriptions will not be repeated.
- the device includes a processor 1900 and a memory 1901, the memory 1901 is used to store a program executable by the processor 1900, and the processor 1900 is used to read the program in the memory 1901 and Perform the following steps:
- configuration rule set includes configuration rules of communication protocols of different third-party systems
- the processor is further configured to execute:
- the network request message is directly sent to the non-third-party system.
- the processor is further configured to execute:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the processor is configured to execute:
- the configuration rule corresponding to the routing information is determined from the configuration rule set.
- the processor is configured to execute:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the processor is configured to execute:
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the processor is configured to execute:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the processor is configured to execute:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- the processor is further configured to execute:
- the loaded sdk file is stored in the configuration rule set, wherein the sdk file is in one-to-one correspondence with the third-party system.
- the processor is configured to execute:
- the sdk file is included in the configuration rule, digitally sign and encrypt the network request message by using the sdk file.
- the processor is configured to execute:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the processor is further configured to execute:
- the processor is configured to execute:
- the communication protocol conversion is performed on the network response message.
- the processor is configured to execute:
- the network response message converted from the communication protocol is sent to the communication device located at the source address.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the processor is further configured to:
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- the processor is further configured to:
- the access token is invalid, reacquire a valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- the processor is configured to execute:
- the processor is further configured to execute:
- At least one instruction of deleting, modifying, and adding configuration rules from the user is received through the display interface.
- the processor is further configured to execute:
- the processor is further configured to execute:
- the set of configuration rules is updated at a preset period.
- the processor is configured to execute:
- the update process is notified to update the configuration rule set;
- the processor is further configured to execute:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- the embodiment of the present disclosure also provides a communication protocol conversion device. Since the device is the device in the method in the embodiment of the present disclosure, and the problem-solving principle of the device is similar to the method, so the For the implementation of the device, reference may be made to the implementation of the method, and repeated descriptions will not be repeated.
- the device includes:
- a message receiving unit 2000 configured to receive at least one network request message sent by the communication device for establishing a communication connection with a third-party system
- a determination rule unit 2001 configured to determine a configuration rule corresponding to the network request message from a configuration rule set, wherein the configuration rule set includes configuration rules of communication protocols of different third-party systems;
- a protocol conversion unit 2002 configured to convert the communication protocol of the network request message according to the configuration rule
- the message sending unit 2003 is configured to send the network request message after the communication protocol conversion to a corresponding third-party system.
- the receiving message unit 2000 is also configured to:
- the network request message is directly sent to the non-third-party system.
- the receiving message unit 2000 is also configured to:
- Receiving a network request message sent by the communication device determining that the network request message is a network request message for establishing a communication connection with a third-party system, or determining that the network request message is a network request message for establishing a communication connection with a non-third-party system Network request message.
- the configuration rule is in one-to-one correspondence with the routing information; or, the multiple pieces of routing information correspond to the same configuration rule.
- the determining rule unit is specifically configured to:
- the configuration rule corresponding to the routing information is determined from the configuration rule set.
- the determining rule unit is specifically configured to:
- a configuration rule corresponding to the third-party system is determined from the configuration rule set.
- the protocol conversion unit is specifically configured to:
- the network request message undergoes communication protocol conversion through the protocol conversion process.
- the protocol conversion unit is specifically further configured to:
- the configuration rule includes the software development kit file of the third-party system
- use the class loader to load the software development kit file of the third-party system to obtain the process of executing the software development kit file, wherein the software There is a one-to-one correspondence between the development kit file and the third-party system.
- the protocol conversion unit is specifically further configured to:
- the network request message is digitally signed and encrypted by a process executing the software development kit file.
- the loading unit is also specifically used for:
- the loaded sdk file is stored in the configuration rule set, wherein the sdk file is in one-to-one correspondence with the third-party system.
- the protocol conversion unit is specifically configured to:
- the sdk file is included in the configuration rule, digitally sign and encrypt the network request message by using the sdk file.
- the message sending unit is specifically configured to:
- the network request message converted from the communication protocol is sent to a third-party system corresponding to the routing information.
- the message sending unit is further configured to:
- the message sending unit is specifically further configured to:
- the communication protocol conversion is performed on the network response message.
- the message sending unit is specifically further configured to:
- the network response message converted from the communication protocol is sent to the terminal located at the source address.
- the session connection unit is further included:
- the session connection unit is specifically further configured to:
- the display unit further includes:
- the user is prompted through a display interface that the access token of the third-party system is invalid.
- the session connection unit is further configured to:
- the access token is invalid, reacquire a valid access token of the third-party system, and use the valid access token to update the access token of the third-party system in the configuration rule.
- the session connection unit is specifically configured to:
- the receiving instruction unit is also specifically configured to:
- At least one instruction of deleting, modifying and adding configuration rules from the user is received through the display interface.
- the receiving instruction unit is specifically further configured to:
- the update unit is also specifically configured to:
- the set of configuration rules is updated at a preset period.
- the updating unit is specifically configured to:
- the update process is notified to update the configuration rule set;
- the updating unit is specifically configured to:
- the configuration rule set is updated according to the modified configuration rules.
- the configuration rules include at least one of routing rules; encoding and decoding rules; protocol conversion rules;
- the protocol conversion rules include: at least one of token configuration rules, digital signature configuration rules, message configuration rules, and configuration rules using software development kit files.
- an embodiment of the present disclosure also provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented:
- the network request message representing a message for establishing a communication connection with a third-party system
- configuration rule set includes configuration rules of communication protocols of different third-party systems
- the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Accordingly, the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
- the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Multimedia (AREA)
- Business, Economics & Management (AREA)
- General Business, Economics & Management (AREA)
- Computer And Data Communications (AREA)
- Telephonic Communication Services (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Communication Control (AREA)
Abstract
Description
Claims (28)
- 一种通讯协议转换方法,其中,该方法包括:接收通信设备发送的至少一个用于与第三方系统建立通信连接的网络请求消息;从配置规则集合中确定与所述网络请求消息对应的配置规则,其中所述配置规则集合包括不同的第三方系统的通信协议的配置规则;根据所述配置规则对所述网络请求消息进行通信协议转换;将所述通信协议转换后的网络请求消息发送给对应的第三方系统。
- 根据权利要求1所述的方法,其中,还包括:接收通信设备发送的至少一个用于与非第三方系统建立通信连接的网络请求消息;将所述网络请求消息直接发送给所述非第三方系统。
- 根据权利要求1或2所述的方法,其中,还包括:接收通信设备发送的网络请求消息,确定所述网络请求消息为用于与第三方系统建立通信连接的网络请求消息,或者,确定所述网络请求消息为用于与非第三方系统建立通信连接的网络请求消息。
- 根据权利要求1所述的方法,其中,所述从配置规则集合中确定与所述网络请求消息对应的配置规则,包括:根据所述网络请求消息中携带的路由信息,从所述配置规则集合中确定与所述路由信息对应的配置规则。
- 根据权利要求4所述的方法,其中,所述配置规则与所述路由信息一一对应;或,所述多个路由信息对应相同的配置规则。
- 根据权利要求5所述的方法,其中,所述根据所述网络请求消息中携带的路由信息,从所述配置规则集合中确定与所述路由信息对应的配置规则,包括:根据所述网络请求消息中携带的路由信息,确定与所述路由信息对应的 第三方系统;从所述配置规则集合中确定与所述第三方系统对应的配置规则。
- 根据权利要求1所述的方法,其中,所述根据所述配置规则对所述网络请求消息进行通信协议转换,包括:将所述配置规则中的协议转换规则,进行实例化处理,得到执行协议转换的进程;所述网络请求消息通过所述协议转换的进程进行通信协议转换。
- 根据权利要求7所述的方法,其中,所述将所述配置规则中的协议转换规则,进行实例化处理,包括:若所述配置规则包括第三方系统的软件开发工具包文件,则利用类加载器加载所述第三方系统的软件开发工具包文件,得到执行所述软件开发工具包文件的进程,其中所述软件开发工具包文件与所述第三方系统是一一对应的。
- 根据权利要求8所述的方法,其中,所述网络请求消息通过所述协议转换的进程进行通信协议转换,包括:所述网络请求消息通过执行所述软件开发工具包文件的进程进行数字签名和加密。
- 根据权利要求1所述的方法,其中,所述将所述通信协议转换后的网络请求消息发送给对应的第三方系统,包括:根据所述网络请求消息中携带的路由信息,将所述通信协议转换后的网络请求消息发送给与所述路由信息对应的第三方系统。
- 根据权利要求1所述的方法,其中,所述将所述通信协议转换后的网络请求消息发送给对应的第三方系统之后,还包括:接收所述第三方系统发送的网络响应消息,从所述配置规则集合中确定所述第三方系统的配置规则;根据所述配置规则对所述网络响应消息进行通信协议转换;将所述通信协议转换后的网络响应消息发送给所述通信设备。
- 根据权利要求11所述的方法,其中,所述根据所述配置规则对所述网络响应消息进行通信协议转换,包括:将所述配置规则中的协议转换规则,进行实例化处理,得到执行协议转换的进程;通过所述协议转换的进程,对所述网络响应消息进行通信协议转换。
- 根据权利要求11所述的方法,其中,所述将所述通信协议转换后的网络响应消息发送给所述通信设备,包括:根据所述网络请求消息的源地址,将所述通信协议转换后的网络响应消息发送给位于所述源地址的通信设备。
- 根据权利要求1所述的方法,其中,接收终端发送的用于与第三方系统建立通信连接的网络请求消息之后,还包括:确定与所述网络请求消息对应的配置规则中的访问令牌信息;根据所述访问令牌信息,周期向所述第三方系统发送用于保持会话连接的连接请求消息。
- 根据权利要求14所述的方法,其中,所述周期向所述第三方系统发送用于保持会话连接的连接请求消息之后,还包括:接收所述第三方系统发送的访问令牌,按预设周期访问所述第三方系统的探活接口,确定所述访问令牌的有效性。
- 根据权利要求15所述的方法,其中,所述确定所述访问令牌的有效性之后,还包括:若确定所述访问令牌失效,则通过显示界面提示用户所述第三方系统的访问令牌无效。
- 根据权利要求15所述的方法,其中,所述确定所述访问令牌的有效性之后,还包括:若所述访问令牌失效,则重新获取所述第三方系统的有效的访问令牌,利用所述有效的访问令牌对所述配置规则中所述第三方系统的访问令牌进行更新。
- 根据权利要求17所述的方法,其中,所述重新获取所述第三方系统的有效的访问令牌,包括:根据与所述网络请求消息对应的配置规则中的访问令牌信息,重新向所述第三方系统发送用于保持会话连接的连接请求消息;接收所述第三方系统发送的有效的访问令牌。
- 根据权利要求1所述的方法,其中,还包括:通过显示界面接收用户对配置规则进行删除、修改、添加中的至少一种指令。
- 根据权利要求19所述的方法,其中,还包括:接收用户在显示界面对配置规则进行触控操作、语音控制操作中的至少一种指令,触发对所述配置规则执行与所述指令对应的操作;或,接收用户在显示界面的弹窗中对配置规则进行触控操作、语音控制操作中的至少一种指令,触发对所述配置规则执行与所述指令对应的操作。
- 根据权利要求19所述的方法,其中,所述通过显示界面接收用户对配置规则进行删除、修改、添加中的至少一种指令之后,还包括:接收用户通过所述显示界面触发的数据库同步指令,对所述配置规则集合进行更新;或,按预设周期对所述配置规则集合进行更新。
- 根据权利要求21所述的方法,其中,所述对所述配置规则集合进行更新,包括:若通过监听进程监听到所述配置规则集合中配置规则的改变,则通知更新进程对所述配置规则集合进行更新;或,将所述配置规则集合存放到消息队列中并监听所述消息队列的内容,若监听到所述配置规则集合中配置规则的改变,则对所述消息队列的内容进行对应的更新。
- 根据权利要求20所述的方法,其中,所述对所述配置规则集合进行更新,包括:若确定存在新增的配置规则,则根据所述新增的配置规则对所述配置规则集合进行更新;或,若确定对所述配置规则集合中的配置规则进行删除,则根据所述删除的配置规则对所述配置规则集合进行更新;或,若确定对所述配置规则集合中的配置规则进行修改,则根据所述修改的配置规则对所述配置规则集合进行更新。
- 根据权利要求1~2、4~23任一所述的方法,其中,所述配置规则包括路由规则;编码解码规则;协议转换规则中的至少一种;其中所述协议转换规则包括:令牌配置规则、数字签名配置规则、消息配置规则、使用软件开发工具包文件的配置规则中的至少一种。
- 一种通信协议转换系统,其中,包括至少一个通信设备、网关设备、多个第三方系统,其中:所述通信设备用于发送与所述第三方系统建立通信连接的网络请求消息;所述网关设备用于接收所述网络请求消息,从配置规则集合中确定与所述网络请求消息对应的配置规则,根据所述配置规则对所述网络请求消息进行通信协议转换,将所述通信协议转换后的网络请求消息发送给对应的第三方系统,其中所述配置规则集合包括不同的第三方系统的通信协议的配置规则。
- 一种网关设备,其中,该网关设备包括处理器和存储器,所述存储器用于存储所述处理器可执行的程序,所述处理器用于读取所述存储器中的程序并执行权利要求1~24任一所述方法的步骤。
- 一种通信协议转换设备,其中,该设备包括处理器和存储器,所述存储器用于存储所述处理器可执行的程序,所述处理器用于读取所述存储器中的程序并执行权利要求1~24任一所述方法的步骤。
- 一种计算机存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1~24任一所述方法的步骤。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP22851988.0A EP4340333A4 (en) | 2021-08-04 | 2022-07-27 | COMMUNICATION PROTOCOL CONVERSION METHOD AND APPARATUS, SYSTEM AND GATEWAY DEVICE |
US18/576,634 US20240214472A1 (en) | 2021-08-04 | 2022-07-27 | Communication protocol conversion method, and device, system, and gateway device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110893155.2A CN113556359B (zh) | 2021-08-04 | 2021-08-04 | 一种通讯协议转换方法、设备、系统及网关设备 |
CN202110893155.2 | 2021-08-04 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023011274A1 true WO2023011274A1 (zh) | 2023-02-09 |
Family
ID=78134126
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/108151 WO2023011274A1 (zh) | 2021-08-04 | 2022-07-27 | 一种通讯协议转换方法、设备、系统及网关设备 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20240214472A1 (zh) |
EP (1) | EP4340333A4 (zh) |
CN (1) | CN113556359B (zh) |
WO (1) | WO2023011274A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115834726A (zh) * | 2023-02-20 | 2023-03-21 | 广州汇通国信科技有限公司 | 协议转换方法、数据传输方法、装置、网关及存储介质 |
CN116860353A (zh) * | 2023-06-30 | 2023-10-10 | 北京百度网讯科技有限公司 | 数据处理方法、装置、电子设备以及存储介质 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114172929B (zh) * | 2021-10-28 | 2024-06-04 | 深圳市信锐网科技术有限公司 | 通信方法、装置以及网关 |
CN115442913A (zh) * | 2022-08-15 | 2022-12-06 | 浙江猫精人工智能科技有限公司 | 协议接入方法、通信方法、开发设备、网关及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105141601A (zh) * | 2015-08-17 | 2015-12-09 | 北京佰才邦技术有限公司 | 物联网协议转换功能的配置方法和装置 |
CN105516185A (zh) * | 2015-12-30 | 2016-04-20 | 广东顺德中山大学卡内基梅隆大学国际联合研究院 | 一种多协议网关设备 |
CN106899461A (zh) * | 2015-12-18 | 2017-06-27 | 美的集团股份有限公司 | 家庭网关和用于其的数据通信方法、智能家居系统 |
US20210021695A1 (en) * | 2019-07-19 | 2021-01-21 | Virtual Peaker, Inc. | System and method for remote execution of real time control (rtc) hardware |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10264089B2 (en) * | 2014-12-31 | 2019-04-16 | Verizon Patent And Licensing Inc. | Rule configuration framework for communication protocols |
CN111193695B (zh) * | 2019-07-26 | 2021-07-06 | 腾讯科技(深圳)有限公司 | 一种第三方账号登录的加密方法、装置及存储介质 |
CN110971614A (zh) * | 2019-12-17 | 2020-04-07 | 软通动力信息技术(集团)有限公司 | 物联网适配方法、系统、计算机设备及存储介质 |
CN112511416A (zh) * | 2020-11-23 | 2021-03-16 | 四川长虹电器股份有限公司 | 基于规则式的数据通信协议转换系统、解码及编码方法 |
CN113206836A (zh) * | 2021-04-12 | 2021-08-03 | 河海大学 | 一种工业互联网中api网关实现协议转换的方法 |
-
2021
- 2021-08-04 CN CN202110893155.2A patent/CN113556359B/zh active Active
-
2022
- 2022-07-27 EP EP22851988.0A patent/EP4340333A4/en active Pending
- 2022-07-27 WO PCT/CN2022/108151 patent/WO2023011274A1/zh active Application Filing
- 2022-07-27 US US18/576,634 patent/US20240214472A1/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105141601A (zh) * | 2015-08-17 | 2015-12-09 | 北京佰才邦技术有限公司 | 物联网协议转换功能的配置方法和装置 |
CN106899461A (zh) * | 2015-12-18 | 2017-06-27 | 美的集团股份有限公司 | 家庭网关和用于其的数据通信方法、智能家居系统 |
CN105516185A (zh) * | 2015-12-30 | 2016-04-20 | 广东顺德中山大学卡内基梅隆大学国际联合研究院 | 一种多协议网关设备 |
US20210021695A1 (en) * | 2019-07-19 | 2021-01-21 | Virtual Peaker, Inc. | System and method for remote execution of real time control (rtc) hardware |
Non-Patent Citations (1)
Title |
---|
See also references of EP4340333A4 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115834726A (zh) * | 2023-02-20 | 2023-03-21 | 广州汇通国信科技有限公司 | 协议转换方法、数据传输方法、装置、网关及存储介质 |
CN115834726B (zh) * | 2023-02-20 | 2023-07-21 | 广州汇通国信科技有限公司 | 协议转换方法、数据传输方法、装置、网关及存储介质 |
CN116860353A (zh) * | 2023-06-30 | 2023-10-10 | 北京百度网讯科技有限公司 | 数据处理方法、装置、电子设备以及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
EP4340333A1 (en) | 2024-03-20 |
CN113556359A (zh) | 2021-10-26 |
CN113556359B (zh) | 2023-06-23 |
EP4340333A4 (en) | 2024-05-01 |
US20240214472A1 (en) | 2024-06-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023011274A1 (zh) | 一种通讯协议转换方法、设备、系统及网关设备 | |
US10623476B2 (en) | Endpoint management system providing an application programming interface proxy service | |
US11936724B2 (en) | Configuring service mesh networking resources for dynamically discovered peers or network functions | |
US10693952B2 (en) | Technologies for low latency messaging | |
CN110311983B (zh) | 服务请求的处理方法、装置、系统、电子设备及存储介质 | |
CN111290865A (zh) | 一种服务调用方法、装置、电子设备和存储介质 | |
WO2021073202A1 (zh) | 智能合约处理方法、计算机设备及存储介质 | |
CN111309374A (zh) | 一种微服务系统和微服务系统中的服务调用方法 | |
US11323546B2 (en) | Executing remote commands | |
CN111045833B (zh) | 接口调用的方法和装置 | |
CN108376078A (zh) | 设备的升级方法、装置以及家电设备 | |
CN111984561B (zh) | 一种bmc的ipmi命令处理方法、系统、设备以及介质 | |
CN110795741B (zh) | 对数据进行安全性处理的方法和装置 | |
CN111064626A (zh) | 配置更新方法、装置、服务器及可读存储介质 | |
CN111782254A (zh) | 用于升级对象的方法、装置、设备以及存储介质 | |
CN113254050A (zh) | 一种微前端系统 | |
CN100505711C (zh) | 管理组件应用程序的通信的系统和方法 | |
CN113595927A (zh) | 一种旁路模式下镜像流量的处理方法和装置 | |
CN114338682B (zh) | 流量身份标识传递方法、装置、电子设备及存储介质 | |
WO2024103943A1 (zh) | 一种业务处理方法、装置、存储介质及设备 | |
CN112953719B (zh) | 一种令牌认证方法和装置 | |
JP2005228183A (ja) | プログラム実行方法、および、プログラム実行のための計算機システム | |
CN115080274A (zh) | 业务处理方法、装置和系统、以及接口映射系统 | |
CN114363408A (zh) | 信息推送方法、装置、计算机可读介质及计算机设备 | |
CN113742617A (zh) | 一种缓存更新的方法和装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22851988 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2022851988 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 2022851988 Country of ref document: EP Effective date: 20231215 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 18576634 Country of ref document: US |
|
NENP | Non-entry into the national phase |
Ref country code: DE |