Heterogeneous protocol data transmission method, system, electronic device and storage medium
The method and system facilitate data transmission between systems with different protocols by establishing an adaptation service with data adaptation modules, ensuring seamless integration and reducing coupling, thus overcoming protocol inconsistencies.
Patent Information
- Application Number
- CN202211295372.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-10-21
AI Technical Summary
The inconsistency in communication protocols between internal and external enterprise systems leads to data transmission failures when attempting to transmit data between them.
A data transmission method and system that establishes an adaptation service with data adaptation modules for each receiving module, allowing data transmission between systems with different protocols by matching the target adaptation module based on a transmission target identifier.
Enables data transmission across different communication protocols by reducing coupling between data transceivers and avoiding modifications to mature systems, facilitating seamless integration and data exchange.
Smart Images

Figure CN115665274B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a data transmission method, system, electronic device and storage medium of heterogeneous protocols. Background Art
[0002] At present, due to the differences in service deployment environments between different enterprise systems, the communication protocols they use are not exactly the same. For example, internal enterprise systems only support HTTP (Hyper Text Transfer Protocol) protocol to the outside world, while the communication protocols provided by external enterprise systems include HTTP protocol and WebSocket (full-duplex communication protocol based on TCP) protocol.
[0003] Due to the different affiliations and needs of different enterprises, it is impossible to make unified regulations on the communication protocols of different enterprises. Therefore, if an internal enterprise needs to transmit data to the services of an external enterprise through the WebSocket protocol, the communication protocols of the internal and external services will be inconsistent, resulting in data transmission failure. Summary of the invention
[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0005] In view of the above-mentioned shortcomings of the prior art, the present invention discloses a data transmission method, system, electronic device and storage medium of heterogeneous protocols to realize data transmission between different communication protocols.
[0006] The present invention discloses a data transmission method of heterogeneous protocols, comprising: obtaining a data sending end and a data receiving end, wherein the data sending end and the data receiving end adopt different communication protocols, and the data receiving end includes at least one data receiving module; establishing an adaptation service between the data sending end and the data receiving end, and connecting the data sending end and the data receiving end to the adaptation service respectively according to the corresponding communication protocol, wherein the adaptation service is provided with a data adaptation module corresponding to each of the data receiving modules; using the data sending end to generate a data transmission request according to a preset request format, and sending the data transmission request to the adaptation service, wherein the preset request format includes a transmission target identifier and data to be transmitted; using the adaptation service to determine a target adaptation module from the data adaptation module based on a matching relationship between the transmission target identifier and the data receiving module, and sending the data to be transmitted from the target adaptation module to the corresponding data receiving module.
[0007] Optionally, the method also includes at least one of the following: if the data sending end includes an external system, the data receiving end includes an internal system, the data receiving module includes a main system, and the data adaptation module includes a data adaptation address corresponding to the main system; if the data sending end includes an internal system, the data receiving end includes an external system, the data receiving module includes an external service interface, and the data adaptation module includes a data adaptation processor corresponding to the external service interface.
[0008] Optionally, if the data sending end includes an external system, the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, including: the data adaptation address includes a system field for characterizing the main system; the data to be transmitted is sent from the data adaptation address to the internal system, so that the internal system matches the target system from the main system according to the system field of the data adaptation address, and queries the routing address corresponding to the target system, and pushes the data to be transmitted to the routing address based on a preset load balancing strategy.
[0009] Optionally, if the data sending end includes an external system, before using the external system to send the data transmission request to the adaptation service, the method also includes: the internal system also includes a permission module, wherein the permission module stores user registration information; using the external system to receive user login information input by the user; sending the user login information to the permission module, so that the permission module performs user identity authentication on the user login information according to the user registration information, and if the user identity authentication is successful, generates an access token corresponding to the external system; receiving the access token sent by the permission module, and adding the received access token to the data transmission request.
[0010] Optionally, if the data sending end includes an external system, before the internal system matches the target system from the main system according to the system field of the data adaptation address, the method also includes: using the internal system to receive the access token sent by the adaptation service; performing token verification on the received access token through the permission module to obtain a token verification result; if the token verification result includes a token verification success, matching the target system from the main system according to the system field of the data adaptation address; if the token verification result includes a token verification failure, feeding back the token verification result to the external system.
[0011] Optionally, if the data sending end includes an external system, after sending the data to be transmitted from the target adaptation module to the corresponding data receiving module, the method also includes: using the adaptation service to receive the data transmission result fed back by the internal system; if the data transmission result includes successful data transmission, sending the data transmission result to the external system; if the data transmission result includes failed data transmission, resending the data to be transmitted from the target adaptation module to the corresponding data receiving module, and counting the number of retries; if the number of retries is greater than a preset number threshold, storing the data to be transmitted in a preset database, and notifying the user that the data transmission to be transmitted has failed; in response to an error viewing instruction input by the user, extracting at least a portion of the data to be transmitted from the preset database, and displaying the extracted data to be stored.
[0012] Optionally, the internal system also includes: a gateway module, used to establish a connection with the external system and / or the adaptation service; a message forwarding service, used to forward the data to be transmitted received by the gateway module to a message queue; the message queue, used to send the received data to be transmitted to the corresponding main system; an internal data center, used to generate internal system data and push the internal system data to the message queue; a subsystem, used to record the system log of the internal system, and / or generate a business report based on at least a part of the data to be transmitted and the internal system data.
[0013] The present invention discloses a data transmission system of heterogeneous protocols, comprising: an acquisition module, used for acquiring a data sending end and a data receiving end, wherein the data sending end and the data receiving end adopt different communication protocols, and the data receiving end includes at least one data receiving module; an establishment module, used for establishing an adaptation service between the data sending end and the data receiving end, and connecting the data sending end and the data receiving end to the adaptation service respectively according to the corresponding communication protocol, wherein the adaptation service is provided with a data adaptation module corresponding to each of the data receiving modules; a first transmission module, used for generating a data transmission request according to a preset request format using the data sending end, and sending the data transmission request to the adaptation service, wherein the preset request format includes a transmission target identifier and data to be transmitted; a second transmission module, used for determining a target adaptation module from the data adaptation module based on a matching relationship between the transmission target identifier and the data receiving module using the adaptation service, and sending the data to be transmitted from the target adaptation module to the corresponding data receiving module.
[0014] The present invention discloses an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.
[0015] The present invention discloses a computer-readable storage medium, on which a computer program is stored: when the computer program is executed by a processor, the above method is implemented.
[0016] Beneficial effects of the present invention:
[0017] By establishing an adaptation service between the data sending end and the data receiving end, establishing a data adaptation module corresponding to each data receiving module in the data receiving end, and making the data sending end and the data receiving end connect to the adaptation service according to the corresponding communication protocol, if a data transmission request from the data sending end is received, the target adaptation module is matched from the data adaptation module according to the transmission target identifier in the data transmission request, and the data to be transmitted in the data transmission request is sent from the target adaptation module to the corresponding data receiving module. In this way, the enterprise system using different transmission protocols is connected through the adaptation service, the target adaptation module and the corresponding data receiving module are confirmed by the transmission target identifier carried by the data to be transmitted, and the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, thereby realizing data transmission between different communication protocols.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 It is a flowchart of a data transmission method of a heterogeneous protocol in an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of the structure of an internal system in an embodiment of the present invention;
[0022] Figure 3 It is a flowchart of another heterogeneous protocol data transmission method in an embodiment of the present invention;
[0023] Figure 4 It is a schematic diagram of the structure of a data transmission system of a heterogeneous protocol in an embodiment of the present invention;
[0024] Figure 5 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0027] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0028] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0029] Unless otherwise stated, the term "plurality" means two or more.
[0030] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0031] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0032] Combination Figure 1 As shown, the embodiment of the present disclosure provides a data transmission method of a heterogeneous protocol, including:
[0033] Step S101, obtaining a data sending end and a data receiving end;
[0034] Wherein, the data transmitting end and the data receiving end adopt different communication protocols, and the data receiving end includes at least one data receiving module;
[0035] Step S102, establishing an adaptation service between the data sending end and the data receiving end, and connecting the data sending end and the data receiving end to the adaptation service according to corresponding communication protocols;
[0036] Among them, the adaptation service is provided with a data adaptation module corresponding to each data receiving module;
[0037] Step S103, using the data sending end to generate a data transmission request according to a preset request format, and sending the data transmission request to the adaptation service;
[0038] The preset request format includes a transmission target identifier and data to be transmitted;
[0039] Step S104, using the adaptation service to determine the target adaptation module from the data adaptation modules based on the matching relationship between the transmission target identifier and the data receiving module, and sending the data to be transmitted from the target adaptation module to the corresponding data receiving module.
[0040] The data transmission method of the heterogeneous protocol provided by the embodiment of the present disclosure is adopted, by establishing an adaptation service between the data sending end and the data receiving end, establishing a data adaptation module corresponding to each data receiving module in the data receiving end, and making the data sending end and the data receiving end connect to the adaptation service according to the corresponding communication protocol respectively, if a data transmission request of the data sending end is received, the target adaptation module is matched from the data adaptation module according to the transmission target identifier in the data transmission request, and the data to be transmitted in the data transmission request is sent from the target adaptation module to the corresponding data receiving module. In this way, the enterprise system using different transmission protocols is connected through the adaptation service, the target adaptation module and the corresponding data receiving module are confirmed by the transmission target identifier carried by the data to be transmitted, and the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, thereby realizing data transmission between different communication protocols. At the same time, compared with providing different communication protocols for data transmission by modifying the code, the coupling degree between different data transceivers is reduced by the adaptation service, avoiding the modification of the mature data transceiver, and facilitating the opening and closing of the adaptation service.
[0041] Optionally, the method also includes at least one of the following: if the data sending end includes an external system, the data receiving end includes an internal system, the data receiving module includes a main system, and the data adaptation module includes a data adaptation address corresponding to the main system; if the data sending end includes an internal system, the data receiving end includes an external system, the data receiving module includes an external service interface, and the data adaptation module includes a data adaptation processor corresponding to the external service interface.
[0042] In some embodiments, the transmission protocol of the external system includes a Websocket protocol, the transmission protocol of the internal system includes an HTTP protocol, and the data adaptation processor includes a Websocket processor.
[0043] Optionally, the internal system also includes: a gateway module, used to establish a connection with an external system and / or an adaptation service; a message forwarding service, used to forward the data to be transmitted received by the gateway module to a message queue; a message queue, used to send the received data to be transmitted to a corresponding main system; an internal data center, used to generate internal system data and push the internal system data to the message queue; a subsystem, used to record the system log of the internal system, and / or generate business reports based on at least a part of the data to be transmitted and the internal system data.
[0044] Combination Figure 2 As shown, the embodiment of the present disclosure provides an internal system, including a gateway module 201, an authority module 202, a main system 203, a message queue 204, an internal data center 205, a message forwarding service 206, an internal CRM system 207, a subsystem 208, and an internal cloud service 209; wherein the gateway module is used to establish a connection with an external system and / or an adaptation service; the authority module is used to store user registration information and also to generate a temporary access token; the main system is used to process internal order data, pull internal CRM customer data, process external system order data, and push messages using the message push capability in the subsystem; the message queue is used to send the received data to be transmitted to the corresponding main system, provide interactive decoupling to the internal environment in the internal system, the internal order center sends messages to the message queue, and the main system subscribes to pull data for logical processing; the internal data center is used to provide order data flow and push data to the message queue; the message forwarding service is used to forward the data to be transmitted received by the gateway module to the message queue; the internal CRM (Customer Relationship Management System) Management, customer relationship management) system, used to provide order data and customer data, actively push order data, and the main system pulls customer data; subsystem, used for capability systems, such as one or more of the message push system, log system, and report system; internal cloud service, used to provide middleware service capabilities, such as one or more of Redis (Remote Dictionary Server, remote dictionary service), MySQL (relational database management system), Nacos (service registration center), etc.
[0045] Optionally, if the data sending end includes an external system, before using the external system to send the data transmission request to the adaptation service, the method also includes: the internal system also includes a permission module, wherein the permission module stores user registration information; using the external system to receive user login information input by the user; sending the user login information to the permission module, so that the permission module performs user identity authentication on the user login information based on the user registration information, and if the user identity authentication is successful, an access token corresponding to the external system is generated; receiving the access token sent by the permission module, and adding the received access token to the data transmission request.
[0046] In some embodiments, the external system obtains the access token of the internal system through the HTTP protocol.
[0047] In some embodiments, if the data sending end includes an external system, the external system pre-acquires the user login information assigned by the internal system; calls the permission module through the gateway module of the internal system to obtain a temporary token; the external system initiates a Webcocket connection to the adaptation service; after the connection is established, the external system transmits the data to be transmitted to the adaptation service while carrying the temporary token, so that the adaptation service constructs an HTTP request through the data to be transmitted, and puts the temporary token into the Header of the HTTP request.
[0048] Optionally, if the data sending end includes an external system, before the internal system matches the target system from the main system according to the system field of the data adaptation address, the method also includes: using the internal system to receive the access token sent by the adaptation service; performing token verification on the received access token through the permission module to obtain a token verification result; if the token verification result includes a token verification success, matching the target system from the main system according to the system field of the data adaptation address; if the token verification result includes a token verification failure, feeding back the token verification result to the external system.
[0049] Optionally, if the data sending end includes an external system, the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, including: the data adaptation address includes a system field for characterizing the main system; the data to be transmitted is sent from the data adaptation address to the internal system, so that the internal system matches the target system from the main system according to the system field of the data adaptation address, and queries the routing address corresponding to the target system, and pushes the data to be transmitted to the routing address based on the preset load balancing strategy.
[0050] In some embodiments, if the data sending end includes an external system, a map data structure between the main system and the data adaptation address is established in the internal cache of the adaptation service, for example, {"systemname-apiname":"http url"}, wherein systemname is the main system name, apiname is the service interface name in the main system, and http url is the corresponding data adaptation address; the external system sends a data transmission request in a preset request format to the adaptation service, and the preset request format includes a transmission target identifier and data to be transmitted, for example, {"system":"system field","api":"system interface field","data field":{data to be transmitted}}, wherein the system field is used to carry the main system name, the system interface field is used to carry the service interface name in the main system, and the data field may be an object or an array object, depending on the specific business; the adaptation service extracts the main system name and the service interface name from the data transmission request, splices them into the systemname-apiname format according to the main system name and the service interface name, matches the corresponding http url from the internal cache, and sends the content of the data transmission request through the http The url is sent to the internal system; the adaptation service initiates an HTTP request to the gateway module of the internal system. After the gateway layer processes the request for blacklist, whitelist, current limiting, authentication, etc., the request is forwarded to different services according to the routing rules. The format of the http url is <domain name> / <system name> / <api uri> The gateway layer obtains the <system name> by parsing the http url, and then finds the routing address corresponding to the main system. According to the default load balancing component, it selects one of the services to construct an http request and sends it out.
[0051] In some embodiments, if the data sending end includes an internal system, the adaptation service maintains a Websocket long connection with the external system, and registers the connection of each external service interface in the external system to the internal cache of the adaptation service, wherein the internal cache adopts a map data structure, for example, the external service interface order and the Websocket processor A, the external service interface log and the Websocket processor B, etc.; the internal system sends an HTTP message to the adaptation service, and the HTTP Request Body message includes a system field, an API field, a Date field, and data to be transmitted, for example, {"system":"system name field","api":"api field","data field":{data to be transmitted}}, wherein the data field may be an object or an array object, depending on the specific business; the adaptation service reads the system field and / or API field in the HTTP Request Body message, finds the corresponding Websocket processor from the internal buffer, and forwards the HTTP Request Body message to the corresponding external service interface through the Websocket processor intact.
[0052] Optionally, if the data sending end includes an external system, after sending the data to be transmitted from the target adaptation module to the corresponding data receiving module, the method also includes: using the adaptation service to receive the data transmission result fed back by the internal system; if the data transmission result includes successful data transmission, sending the data transmission result to the external system; if the data transmission result includes failed data transmission, resending the data to be transmitted from the target adaptation module to the corresponding data receiving module, and counting the number of retries; if the number of retries is greater than a preset threshold, storing the data to be transmitted in a preset database, and notifying the user that the data transmission to be transmitted has failed; in response to an error viewing instruction input by the user, extracting at least a portion of the data to be transmitted from the preset database, and displaying the extracted data to be stored.
[0053] In some embodiments, if the data sending end includes an external system, after the main system receives the HTTP request, it parses and obtains the data to be transmitted; after storing the data to be transmitted in the database, the main system feeds back the data transmission result to the adaptation service; if the data transmission result received by the adaptation service includes successful data transmission, the websocket processor is called to push an "order sent successfully" message to the external system; if the data transmission result received by the adaptation service includes failed data transmission, the HTTP request is re-pushed according to a preset number of times by default. If failure occurs three times in a row, the data is recorded in the database and an email is sent to notify the relevant person in charge.
[0054] In some embodiments, the adaptation service provides a background management interface that allows for easy viewing of abnormal data in the data to be transmitted.
[0055] Combination Figure 3 As shown, the embodiment of the present disclosure provides a data transmission method of a heterogeneous protocol, including:
[0056] Step S301, the external system sends user login information to the gateway module of the internal system;
[0057] Step S302, the permission module of the internal system generates an access token after the user passes the verification;
[0058] Step S303, the gateway module sends an access token to the external system;
[0059] Step S304, the external system establishes a Websocket connection to the adaptation service;
[0060] Step S305, the external system sends a data transmission request to the adaptation service;
[0061] The preset request format of the data transmission request includes a transmission target identifier, data to be transmitted, and an access token;
[0062] Step S306: Adaptation service matches the transmission target identifier http url ;
[0063] Step S307, the adaptation service sends an HTTP request to the gateway module via the http url;
[0064] Among them, the HTTP request Header carries the access token;
[0065] Step S308, the permission module performs token verification on the access token;
[0066] Step S309, if the token verification is successful, the gateway module matches the corresponding routing address through the http url;
[0067] Step S310, the gateway module sends the data to be transmitted to the main system via the routing address;
[0068] Step S311, the main system sends data transmission success information to the gateway module;
[0069] Step S312, the gateway module sends data transmission success information to the adaptation service;
[0070] Step S313: The adaptation service records a log according to the data transmission success information.
[0071] The data transmission method of the heterogeneous protocol provided by the embodiment of the present disclosure is adopted, by establishing an adaptation service between the data sending end and the data receiving end, establishing a data adaptation module corresponding to each data receiving module in the data receiving end, and making the data sending end and the data receiving end connect to the adaptation service according to the corresponding communication protocol respectively, if a data transmission request from the data sending end is received, then the target adaptation module is matched from the data adaptation module according to the transmission target identifier in the data transmission request, and the data to be transmitted in the data transmission request is sent from the target adaptation module to the corresponding data receiving module, which has the following advantages:
[0072] First, the enterprise systems using different transmission protocols are connected through the adaptation service, the target adaptation module and the corresponding data receiving module are confirmed through the transmission target identifier carried by the data to be transmitted, and the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, thereby realizing data transmission between different communication protocols;
[0073] Second, compared with providing different communication protocols for data transmission by modifying the code, the adaptation service reduces the coupling between different data transceivers, avoids modifying mature data transceivers, and facilitates the opening and closing of the adaptation service.
[0074] Combination Figure 4 As shown, the embodiment of the present disclosure provides a data transmission system of heterogeneous protocols, including an acquisition module 401, an establishment module 402, a first transmission module 403 and a second transmission module 404. The acquisition module 401 is used to acquire a data sending end and a data receiving end, wherein the data sending end and the data receiving end adopt different communication protocols, and the data receiving end includes at least one data receiving module; the establishment module 402 is used to establish an adaptation service between the data sending end and the data receiving end, and connect the data sending end and the data receiving end to the adaptation service according to the corresponding communication protocol, wherein the adaptation service is provided with a data adaptation module corresponding to each data receiving module; the first transmission module 403 is used to generate a data transmission request according to a preset request format using the data sending end, and send the data transmission request to the adaptation service, wherein the preset request format includes a transmission target identifier and data to be transmitted; the second transmission module 404 is used to determine a target adaptation module from the data adaptation module based on the matching relationship between the transmission target identifier and the data receiving module using the adaptation service, and send the data to be transmitted from the target adaptation module to the corresponding data receiving module.
[0075] The data transmission method of the heterogeneous protocol provided by the embodiment of the present disclosure is adopted, by establishing an adaptation service between the data sending end and the data receiving end, establishing a data adaptation module corresponding to each data receiving module in the data receiving end, and making the data sending end and the data receiving end connect to the adaptation service according to the corresponding communication protocol respectively, if a data transmission request of the data sending end is received, the target adaptation module is matched from the data adaptation module according to the transmission target identifier in the data transmission request, and the data to be transmitted in the data transmission request is sent from the target adaptation module to the corresponding data receiving module. In this way, the enterprise system using different transmission protocols is connected through the adaptation service, the target adaptation module and the corresponding data receiving module are confirmed by the transmission target identifier carried by the data to be transmitted, and the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, thereby realizing data transmission between different communication protocols. At the same time, compared with providing different communication protocols for data transmission by modifying the code, the coupling degree between different data transceivers is reduced by the adaptation service, avoiding the modification of the mature data transceiver, and facilitating the opening and closing of the adaptation service.
[0076] Figure 5 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0077] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, the ROM 502 and the RAM 503 are connected to each other through the bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0078] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0079] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.
[0080] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0081] The embodiments of the present disclosure further provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any one of the methods in the embodiments is implemented.
[0082] The computer-readable storage medium in the embodiments of the present disclosure can be understood by ordinary technicians in the field: all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the execution includes the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0083] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run the computer program so that the electronic device executes each step of the above method.
[0084] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0085] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0086] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0087] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0088] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0089] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A data transmission method for heterogeneous protocols, It is characterized in that include: Acquire a data sending end and a data receiving end, wherein the data sending end and the data receiving end use different communication protocols, and the data receiving end includes at least one data receiving module; Establishing an adaptation service between the data sending end and the data receiving end, and connecting the data sending end and the data receiving end to the adaptation service according to corresponding communication protocols, wherein the adaptation service is provided with data adaptation modules corresponding to each of the data receiving modules; Using the data sending end to generate a data transmission request according to a preset request format, and sending the data transmission request to the adaptation service, wherein the preset request format includes a transmission target identifier and data to be transmitted; Determine a target adapter module from the data adapter modules based on the matching relationship between the transmission target identifier and the data receiving module by using the adaptation service, and send the data to be transmitted from the target adapter module to the corresponding data receiving module; If the data transmitting end includes an external system, the data receiving end includes an internal system, the data receiving module includes a main system, and the data adapting module includes a data adapting address corresponding to the main system; If the data sending end includes an external system, the data to be transmitted is sent from the target adaptation module to the corresponding data receiving module, including that the data adaptation address includes a system field for characterizing the main system; the data to be transmitted is sent from the data adaptation address to the internal system, so that the internal system matches the target system from the main system according to the system field of the data adaptation address, and queries the routing address corresponding to the target system, and pushes the data to be transmitted to the routing address based on a preset load balancing strategy.
2. The method according to claim 1, It is characterized in that The method further comprises: If the data sending end includes an internal system, the data receiving end includes an external system, the data receiving module includes an external service interface, and the data adaptation module includes a data adaptation processor corresponding to the external service interface.
3. The method according to claim 2, It is characterized in that If the data sending end includes an external system, before sending the data transmission request to the adaptation service using the external system, the method further includes: The internal system further includes a permission module, wherein the permission module stores user registration information; Utilizing the external system to receive user login information input by the user; Sending the user login information to the permission module, so that the permission module performs user identity authentication on the user login information according to the user registration information, and if the user identity authentication is successful, generating an access token corresponding to the external system; Receive the access token sent by the permission module, and add the received access token to the data transmission request.
4. The method according to claim 3, It is characterized in that If the data sending end includes an external system, before the internal system matches the target system from the main system according to the system field of the data adaptation address, the method further includes: Receiving, using the internal system, an access token sent by the adaptation service; Performing token verification on the received access token through the permission module to obtain a token verification result; If the token verification result includes a token verification success, matching a target system from the main system according to the system field of the data adaptation address; If the token verification result includes a token verification failure, the token verification result is fed back to the external system.
5. The method according to any one of claims 2 to 4, It is characterized in that If the data sending end includes an external system, after sending the data to be transmitted from the target adaptation module to the corresponding data receiving module, the method further includes: Using the adaptation service to receive the data transmission result fed back by the internal system; If the data transmission result includes successful data transmission, sending the data transmission result to the external system; If the data transmission result includes data transmission failure, the data to be transmitted is resent from the target adaptation module to the corresponding data receiving module, and the number of retries is counted; If the number of retries is greater than a preset number threshold, the data to be transmitted is stored in a preset database, and the user is notified that the data to be transmitted has failed to be transmitted; In response to the error viewing instruction input by the user, at least a portion of the data to be transmitted is extracted from the preset database, and the extracted data to be stored is displayed.
6. The method according to any one of claims 2 to 4, It is characterized in that The internal system also includes: A gateway module, used to establish a connection with the external system and / or the adaptation service; A message forwarding service, used to forward the data to be transmitted received by the gateway module to a message queue; The message queue is used to send the received data to be transmitted to the corresponding main system; An internal data center, used to generate internal system data and push the internal system data to the message queue; The subsystem is used to record the system log of the internal system and / or generate a business report based on at least a part of the data to be transmitted and the internal system data.
7. A data transmission system for heterogeneous protocols, It is characterized in that include: An acquisition module, used to acquire a data sending end and a data receiving end, wherein the data sending end and the data receiving end use different communication protocols, and the data receiving end includes at least one data receiving module; An establishment module, used to establish an adaptation service between the data sending end and the data receiving end, and connect the data sending end and the data receiving end to the adaptation service according to corresponding communication protocols, wherein the adaptation service is provided with data adaptation modules corresponding to each of the data receiving modules; A first transmission module, configured to generate a data transmission request according to a preset request format using the data sending end, and send the data transmission request to the adaptation service, wherein the preset request format includes a transmission target identifier and data to be transmitted; A second transmission module, configured to determine a target adaptation module from the data adaptation module based on a matching relationship between the transmission target identifier and the data receiving module by using the adaptation service, and to send the data to be transmitted from the target adaptation module to the corresponding data receiving module; If the data transmitting end includes an external system, the data receiving end includes an internal system, the data receiving module includes a main system, and the data adapting module includes a data adapting address corresponding to the main system; The second transmission module is also used to, if the data sending end includes an external system, send the data to be transmitted from the target adaptation module to the corresponding data receiving module, including that the data adaptation address includes a system field for characterizing the main system; send the data to be transmitted from the data adaptation address to the internal system, so that the internal system matches the target system from the main system according to the system field of the data adaptation address, and queries the routing address corresponding to the target system, and pushes the data to be transmitted to the routing address based on a preset load balancing strategy.
8. An electronic device, It is characterized in that include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, Features: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
