CN109474608B - Multi-platform communication method and system - Google Patents

Multi-platform communication method and system Download PDF

Info

Publication number
CN109474608B
CN109474608B CN201811490087.XA CN201811490087A CN109474608B CN 109474608 B CN109474608 B CN 109474608B CN 201811490087 A CN201811490087 A CN 201811490087A CN 109474608 B CN109474608 B CN 109474608B
Authority
CN
China
Prior art keywords
client
connection authentication
intermediate server
processing module
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811490087.XA
Other languages
Chinese (zh)
Other versions
CN109474608A (en
Inventor
李欣
张松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201811490087.XA priority Critical patent/CN109474608B/en
Publication of CN109474608A publication Critical patent/CN109474608A/en
Application granted granted Critical
Publication of CN109474608B publication Critical patent/CN109474608B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos

Abstract

The invention provides a multi-platform communication method and a multi-platform communication system, which both comprise the following steps: configuring a corresponding number of timers in the intermediate server in advance; starting each timer, when the interaction triggering time of the corresponding master client and the corresponding slave client is reached, the intermediate server correspondingly sends corresponding first connection authentication requests to the corresponding slave clients one by one, and after the corresponding slave clients respectively receive the first connection authentication requests and pass the verification, token tokens are respectively returned to the intermediate server; the intermediate server receives the token tokens returned by the corresponding slave clients, sends a connection authentication request to the corresponding master client, and returns the token tokens to the intermediate server after the corresponding master client passes the verification; and the intermediate server completes the data interaction of the corresponding master client and the corresponding slave client based on the token returned by the corresponding master client and the corresponding slave client. The invention is used for realizing the reusability of the interactive function modules between the platforms and improving the interactive efficiency between the platforms.

Description

Multi-platform communication method and system
Technical Field
The invention relates to the field of server communication, in particular to a multi-platform communication method and a multi-platform communication system, which are used for realizing multi-platform communication.
Background
The secure communication between different platforms is especially important in the modern era of data informatization and sharing.
In the prior art, in order to implement data transmission between different platforms, developers of systems of two parties often coordinate communication mechanisms, data formats and system time of communication services to achieve agreement, then communication modules are developed in respective systems, and then communication between the platforms is completed by mutual calling of the two communication modules. But the coordination of programmers of both parties and the development process of the communication service module are often too cumbersome. In addition, the communication service module can not be reused, so that when communication interaction is needed among different platforms, the development of the communication service module needs to be repeated, the working efficiency is low, and the realization of safe communication among the platforms is not timely and efficient enough.
Therefore, the invention provides a multi-platform communication method and a multi-platform communication system, which are used for solving the technical problems.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a multi-platform communication method and system for improving the efficiency of realizing data interaction among multiple platforms.
In order to solve the technical problems, the invention provides a multi-platform communication method, which is based on an intermediate server, a corresponding number of main clients and a corresponding number of slave clients corresponding to each main client and having interactive service requirements with the main clients, wherein the main clients are clients actively initiating interactive services, and the slave clients are clients passively receiving interactive services; the multi-platform communication method comprises the following steps:
configuring a corresponding number of timers in an intermediate server in advance according to the number of the main clients, wherein the timers and the main clients are mapped one by one, and each timer is used for determining an interaction period between the corresponding main client and each slave client having an interaction service requirement with the corresponding main client;
starting all timers configured in the intermediate server;
based on the timers configured in the started intermediate server, for each master client and each corresponding slave client having an interactive service requirement, the method comprises the following communication steps:
s1, each time when the interaction triggering time between the main client and each corresponding slave client with the interaction service requirement is reached, the intermediate server correspondingly sends corresponding first connection authentication requests to each slave client corresponding to the main client one by one, wherein each first connection authentication request comprises the ip address of the corresponding slave client and the key preset in the intermediate server of the corresponding slave client;
s2, each slave client, when the intermediate server sends the corresponding first connection authentication request to it, correspondingly receiving each corresponding first connection authentication request sent by the intermediate server, respectively verifying the accuracy of the key in the received corresponding first connection authentication request, and after the verification is passed, respectively returning the token allowing data interaction to the intermediate server;
s3, after receiving token tokens returned by each slave client with interactive service requirement corresponding to the master client, the intermediate server correspondingly sends a corresponding second connection authentication request to the master client, wherein the second connection authentication request comprises an ip address of the master client preset in the intermediate server and a key of the master client preset in the intermediate server;
s4, the main client receives the corresponding second connection authentication request sent by the intermediate server, verifies the accuracy of the key in the received second connection authentication request, and returns the token allowing data interaction to the intermediate server after the verification is passed;
s5, the intermediate server receives the token returned by the main client, and after receiving the token returned by the main client, the intermediate server sends the token returned by the main client and the token returned by each slave client corresponding to the main client, which are received before, to the main client together;
s6, the main client receives and performs data interaction with each corresponding slave client with interaction service requirement through the intermediate server based on the token returned by the main client and the token allowing data interaction returned by each corresponding slave client sent by the main client from the intermediate server;
the data interaction between each main client and each corresponding slave client corresponding to the main client is carried out based on the same preset data transmission format.
The token allowing data interaction returned from each slave client to the intermediate server comprises format requirements for data to be interacted by the corresponding master client; the format requirements for the data to be interacted with by the corresponding host client comprise: and encrypting the data to be interacted, and compressing the ciphertext obtained after encryption.
Further, the encryption algorithm for encrypting the data to be interacted is an AES encryption algorithm, and the compression format for compressing the ciphertext obtained after encryption is a zip compression format.
Further, the second connection authentication request and each of the first connection authentication requests both adopt http requests.
Furthermore, data interaction between each master client and each corresponding slave client is performed based on the Json format.
In addition, the invention also provides a multi-platform communication system, which comprises an intermediate server, a main client program unit which is applied to the main client and can be used in a copying way, and a secondary client program unit which is applied to the secondary client and can be used in a copying way; the master client is a client which actively initiates interactive service requirements, and the slave client is a client which passively receives the interactive service requirements;
the main client program unit comprises a second connection authentication interface module, a second connection authentication information processing module, a second data transmission interface module and a second data processing module, wherein the second connection authentication interface module is connected with the second connection authentication information processing module, and the second data transmission interface module is connected with the second data processing module;
the slave client program unit comprises a first connection authentication interface module, a first connection authentication information processing module, a first data receiving interface module and a first data processing module, wherein the first connection authentication interface module is connected with the first connection authentication information processing module, and the first data transmission interface module is connected with the first data processing module;
the intermediate server is internally pre-provided with timers which are equal to and correspond to the number of the main clients to participate in communication one by one, and each timer is used for determining the interaction period between the corresponding main client and the corresponding number of the slave clients with the interaction service requirements corresponding to the corresponding main client;
the intermediate server is used for starting each timer in the intermediate server and sending corresponding first connection authentication requests to the first connection authentication interface modules of the slave client program units in the slave clients corresponding to the corresponding master client one by one when the triggering time of data interaction of the corresponding master client and the corresponding slave clients is reached; each first connection authentication request comprises an ip address of a corresponding slave client and a key of the corresponding slave client, wherein the key is preset in the intermediate server;
the first connection authentication interface module is used for correspondingly receiving a corresponding first connection authentication request sent by the intermediate server and correspondingly sending the received corresponding first connection authentication request sent by the intermediate server to the connected first connection authentication information processing module;
the first connection authentication information processing module is used for receiving a first connection authentication request sent by a first connection authentication interface module connected with the first connection authentication information processing module, verifying the accuracy of a key in the first connection authentication request currently received by the first connection authentication information processing module, and returning a token corresponding to the permission of data interaction from the client to the intermediate server through the first connection authentication interface module connected with the first connection authentication information processing module after the verification is passed;
the intermediate server is further configured to correspondingly send a corresponding second connection authentication request to the second connection authentication interface module of the master client program unit after receiving token tokens returned by the first connection authentication information processing modules of the slave client program units in the slave clients corresponding to the master client program unit; the second connection authentication requests comprise preset ip addresses of the main clients corresponding to the program units of the main clients and preset key keys of the corresponding main clients;
the second connection authentication interface module is used for correspondingly receiving a corresponding second connection authentication request sent by the intermediate server and sending the received corresponding second connection authentication request sent by the intermediate server to the second connection authentication information processing module connected with the second connection authentication interface module;
the second connection authentication information processing module is used for receiving a corresponding second connection authentication request sent by the second connection authentication interface module connected with the second connection authentication information processing module, verifying the accuracy of the key in the currently received second connection authentication request, and returning a token allowing data interaction to the corresponding main client side to the intermediate server through the second connection authentication interface module connected with the second connection authentication information processing module after the verification is passed;
the intermediate server is further configured to receive a corresponding token returned by the second connection authentication information processing module, and to send the token returned by the currently received corresponding second connection authentication information processing module and the token allowing data interaction returned by each first connection authentication information processing module corresponding to the primary client corresponding to the corresponding second connection authentication information processing module currently receiving the token returned by the currently received token to the second data transmission interface module of the primary client program unit in the primary client corresponding to the corresponding second connection authentication information processing module currently receiving the token returned by the currently received token after receiving the token returned by the corresponding second connection authentication information processing module each time;
the second data transmission interface module is used for receiving and sending the received token returned by the corresponding second connection authentication information processing module sent by the intermediate server and the token allowing data interaction returned by each first connection authentication information processing module corresponding to the host client corresponding to the corresponding second connection authentication information processing module to the second data processing module connected with the second data transmission interface module;
the second data processing module is used for receiving and performing data interaction with the first data processing modules of the slave client program units corresponding to the corresponding master client program units through the intermediate server based on token tokens returned by the corresponding second connection authentication information processing modules and returned by the corresponding first connection authentication information processing modules corresponding to the corresponding second connection authentication information processing modules, wherein the token tokens are transmitted by the second data transmission interface module connected with the second data processing module and are currently received;
and the data interaction between the second data processing module and each corresponding first data processing module is carried out based on the preset same data transmission format.
The token allowing data interaction returned from each client program unit to the intermediate server comprises the format requirement of data required to be interacted by the corresponding main client program unit; the format requirement of the data required to be interacted by the corresponding main client program unit comprises the following steps: and encrypting the data to be interacted, and compressing the ciphertext obtained after encryption.
The encryption algorithm for encrypting the data to be interacted is an AES encryption algorithm, and the compression format for compressing the ciphertext obtained after encryption is a zip compression format.
And the second connection authentication request and the first connection authentication request both adopt http requests.
And the data interaction between each main client program unit and each corresponding slave client program unit is carried out based on the Json format.
Compared with the prior art, the invention has the advantages that:
the multi-platform communication method and the system provide a universal middleware communication service suitable for communication among a plurality of different clients, realize the interaction among the clients through the intermediate server, facilitate the realization of the reusability of interactive function modules among the platforms, save development manpower resources and improve the efficiency of developers for realizing the data interaction among different platforms (namely different clients).
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Detailed Description
In order to make the technical solutions and advantages of the present invention clearer, the following is a clear and complete description of the technical solutions of the present invention.
The multi-platform communication method is based on an intermediate server, a corresponding number of main clients and a corresponding number of slave clients which are respectively corresponding to each main client and have interactive service requirements with the main clients, wherein the main clients are clients which actively initiate interactive services, and the slave clients are clients which passively receive the interactive services. The multi-platform communication method comprises the following steps p1-p 3.
And p1, configuring a corresponding number of timers in the intermediate server in advance according to the number of the main clients, wherein the timers are mapped with the main clients one by one, and each timer is used for determining an interaction period between the corresponding main client and each slave client having an interaction service requirement with the corresponding main client. Step p2 is then performed.
Step p2, start each timer configured in the intermediate server.
Step p3, based on the timers configured in the intermediate server started in the step p2, for each master client and its corresponding slave clients with interactive service requirements, the following communication steps s1-s6 are included:
and step s1, each time when the interaction triggering time between the master client and each corresponding slave client with the interaction service requirement is reached, the intermediate server correspondingly sends corresponding first connection authentication requests to each slave client corresponding to the master client one by one, wherein each first connection authentication request comprises the ip address of the corresponding slave client and the key preset in the intermediate server of the corresponding slave client. Step s2 is then performed.
And step s2, each slave client correspondingly receives each corresponding first connection authentication request sent by the intermediate server when the intermediate server sends the corresponding first connection authentication request to the slave client, respectively verifies the accuracy of the key in the received corresponding first connection authentication request, and respectively returns the token allowing data interaction to the intermediate server after the verification is passed. Step s3 is then performed.
And step s3, after receiving token tokens returned by the slave clients with interactive service requirements corresponding to the master client, the intermediate server correspondingly sends a corresponding second connection authentication request to the master client, wherein the second connection authentication request comprises an ip address of the master client preset in the intermediate server and a key of the master client preset in the intermediate server. Step s4 is then performed.
And step s4, the main client receives the corresponding second connection authentication request sent by the intermediate server, verifies the accuracy of the key in the received second connection authentication request, and returns the token allowing data interaction to the intermediate server after the verification is passed. Step s5 is then performed.
And step s5, the intermediate server receives the token returned by the main client, and after receiving the token returned by the main client, the intermediate server sends the token returned by the main client and the token allowing data interaction returned by each slave client corresponding to the main client, which are received before, to the main client. Step s6 is then performed.
And step s6, the main client receives and performs data interaction with each corresponding slave client having interaction service requirements through the intermediate server based on the token returned by the main client sent by the intermediate server and the token allowing data interaction returned by each corresponding slave client.
In this embodiment, the second connection authentication request and each of the first connection authentication requests both use http requests; and the data interaction between each main client and each corresponding slave client corresponding to the main client is carried out on the basis of the preset same data transmission format.
To illustrate the present invention more clearly, the following description of the multi-platform communication method of the present invention is made by taking a master client (hereinafter referred to as "master client 1") and a slave client (hereinafter referred to as "slave client 1") as examples:
configuring a timer 1 in the intermediate server in advance, wherein the timer 1 is used for determining an interaction period between the master client 1 and the slave client 1;
starting the configured timer 1;
based on the started timer 1, each time when the interaction triggering time between the master client 1 and the slave client 1 is reached, the intermediate server sends a first connection authentication request to the slave client 1, wherein the first connection authentication request comprises an ip address of the slave client 1 and a preset key of the slave client 1;
receiving a first connection authentication request sent by an intermediate server from a client 1, verifying the accuracy of a key in the first connection authentication request received by the client, and returning a token allowing data interaction to the intermediate server after the verification is passed;
after receiving a token returned from the client 1, the intermediate server sends a second connection authentication request to the host client 1, wherein the second connection authentication request comprises an ip address of the host client 1 preset in the intermediate server and a key of the host client 1 preset in the intermediate server;
the main client 1 correspondingly receives a second connection authentication request sent by the intermediate server, verifies the accuracy of a key in the received second connection authentication request, and returns a token allowing data interaction to the intermediate server after the verification is passed;
the intermediate server receives the token returned by the main client 1, and after receiving the token returned by the main client 1, the intermediate server sends both the token allowing data interaction returned from the client 1 and the token returned by the main client 1 to the main client 1;
the main client 1 receives the token allowing data interaction returned from the client 1 and the token returned by itself from the intermediate server, and performs corresponding data interaction (such as data upload) with the slave client 1 through the intermediate server based on the received token allowing data interaction and the token returned by itself from the client 1 and the received token returned by the intermediate server.
In addition, for further clarity of the present invention, the following description of the multi-platform communication method of the present invention is made by taking a master client (hereinafter referred to as "master client 2") and two slave clients (hereinafter referred to as "slave client 3" and "slave client 2") as examples:
a timer 2 is configured in the intermediate server in advance, and the timer 2 is used for determining the interaction period of the master client 2, the slave client 3 and the slave client 2;
starting the configured timer 2;
based on the started timer 2, each time when the interaction trigger time of the master client 2 with the slave client 3 and the slave client 2 is reached, the intermediate server first sends a corresponding first connection authentication request to the slave client 3 (or the slave client 2), wherein the corresponding first connection authentication request comprises the ip address of the slave client 3 and a preset key of the slave client 3;
receiving a corresponding first connection authentication request sent by the intermediate server from the client 3, verifying the accuracy of the key in the received corresponding first connection authentication request, and returning a token allowing data interaction to the intermediate server after the verification is passed;
after receiving the token returned from the client 3, the intermediate server sends a corresponding first connection authentication request to the slave client 2 (or the slave client 3), wherein the corresponding first connection authentication request comprises an ip address of the slave client 2 and a preset key of the slave client 2;
receiving a corresponding first connection authentication request sent by the intermediate server from the client 2, verifying the accuracy of a key in the received corresponding first connection authentication request, and returning a token allowing data interaction to the intermediate server after the verification is passed;
after receiving a token returned from the client 2, the intermediate server sends a second connection authentication request to the host client 2, where the second connection authentication request includes an ip address of the host client 2 preset in the intermediate server and a key of the host client 2 preset in the intermediate server;
the main client 2 receives the second connection authentication request sent by the intermediate server, verifies the accuracy of the key in the received second connection authentication request, and returns a token allowing data interaction to the intermediate server after the verification is passed;
the intermediate server receives the token returned by the main client 2, and after receiving the token returned by the main client 2, the token returned by the client 3, the token returned by the client 2 and the token returned by the main client 2, which allow data interaction, are all sent to the main client 2;
the main client 2 receives the token allowing data interaction returned from the client 3, the token allowing data interaction returned from the client 2 and the token returned by itself from the intermediate server, and performs corresponding data interaction (such as data upload) with the slave client 3 through the intermediate server based on the received token allowing data interaction returned from the client 3, the token allowing data interaction returned from the client 2 and the token returned by itself from the intermediate server.
In addition, for further clarity of the present invention, the following takes two master clients (hereinafter referred to as "master client 1" and "master client 2") and three slave clients (hereinafter referred to as "slave client 1", "slave client 2" and "slave client 3") as an example to illustrate the multi-platform communication method of the present invention:
configuring a timer 3 and a timer 4 in an intermediate server in advance, wherein the timer 3 is used for determining an interaction period of a master client 1 and a slave client 1, and the timer 4 is used for determining an interaction period of a master client 2, the slave client 3 and a slave client 2;
starting the timer 3 and the timer 4 configured above;
based on the started timer 3, each time when the interaction triggering time of the master client 1 and the slave client 1 is reached, the corresponding steps in the explanation of the multi-platform communication method provided by the invention, which is performed by taking one master client and one slave client as examples, are executed;
based on the above started timer 4, every time the interaction period between the master client 2 and the slave client 3 and the slave client 2 is reached, the corresponding steps in the explanation of the multi-platform communication method of the present invention, which is performed by taking one master client and two slave clients as examples, are performed.
In the embodiment, each slave client verifies the accuracy of the key in the received first connection authentication request and returns a release rejection request to the intermediate server when the verification result is that the key in the received first connection authentication request is wrong; and each host client verifies the accuracy of the key in the received second connection authentication request and returns a release rejection request to the intermediate server when the verification result is that the key in the received second connection authentication request is wrong.
In the present embodiment, data interaction between each master client and each corresponding slave client is performed based on the Json format.
In the present embodiment, the timers are all spring timers, such as:
Figure BDA0001895477870000101
Figure BDA0001895477870000111
in addition, in the present embodiment, each of the first connection authentication requests received from the client via the intermediate server may be implemented by a common authentication interface. For example, at each slave client, the following generic interface program code is used for receiving a corresponding first connection authentication request sent by the intermediate server:
Figure BDA0001895477870000112
specifically, in this embodiment, after receiving the corresponding first connection authentication request sent by the intermediate server, each slave client verifies the accuracy of the key in the received corresponding first connection authentication request based on the following codes, and returns the token allowing data interaction after the verification is passed:
Figure BDA0001895477870000121
in the embodiment, token tokens allowing data interaction returned from each client to the intermediate server all include format requirements for data to be interacted by the corresponding host client; the format requirements for the data to be interacted with by the corresponding host client comprise: and encrypting the data to be interacted, and compressing the ciphertext obtained after encryption. Further, the encryption algorithm for encrypting the data to be interacted is an AES encryption algorithm, and the compression format for compressing the ciphertext obtained after encryption is a zip compression format.
Correspondingly, in the present embodiment, each host client is preset with a corresponding algorithm for encrypting data and compressing data. Correspondingly, each slave client is preset with a data decryption algorithm and a data decompression algorithm which are matched with the algorithm for encrypting data and the algorithm for compressing data in the corresponding master client. The specific implementation method is as follows:
(1) the main client side encrypts and compresses the data to be uploaded
String dataEncryption. encryption (data, Key, Iv); v/Hex code after encryption of secret key and vector
byte [ ] zipData ═ aesincryption. V/the compression of the compressed air in the compressor,
string zip base64 ═ aesecryption. Base64 transcoding of compressed data
Put ("data", zipBase 64); the// json format returns encrypted compressed data
(2) The slave client side carries out data decryption and decompression on the information transmitted from the master client side
byte [ ] unBase64 ═ aesencyption. decodebase64 (data); // decoding base64 data
byte [ ] unbpData ═ AESEncryp.unbip (byte [ ] unBase 64); v/the compression/decompression of the compressed data,
byte [ ] noncordeadata ═ AESEncryption Decrypt (byte [ ] nonsipdata, String key, String iV); v/decryption
Put ("data", noncoedata); the// json format returns decrypted, decompressed data
In summary, the multi-platform communication method of the present invention provides a general middleware communication service suitable for communication between a plurality of different clients, which implements interaction between clients through an intermediate server, facilitates the implementation of reusability of interactive function modules between platforms, saves development manpower resources, and improves the efficiency of developers in implementing data interaction between different platforms (i.e. different clients). Is relatively practical.
In addition, the invention also provides a multi-platform communication system, which corresponds to the multi-platform communication method.
In this embodiment, the multi-platform communication system includes an intermediate server, a main client program unit applicable to a main client and capable of being copied and used, and a sub client program unit applicable to a sub client and capable of being copied and used; the master client is a client which actively initiates interactive service requirements, and the slave client is a client which passively receives the interactive service requirements;
the main client program unit comprises a second connection authentication interface module, a second connection authentication information processing module, a second data transmission interface module and a second data processing module, wherein the second connection authentication interface module is connected with the second connection authentication information processing module, and the second data transmission interface module is connected with the second data processing module;
the slave client program unit comprises a first connection authentication interface module, a first connection authentication information processing module, a first data receiving interface module and a first data processing module, wherein the first connection authentication interface module is connected with the first connection authentication information processing module, and the first data transmission interface module is connected with the first data processing module;
the intermediate server is internally pre-provided with timers which are equal to and correspond to the number of the main clients to participate in communication one by one, and each timer is used for determining the interaction period between the corresponding main client and the corresponding number of the slave clients with the interaction service requirements corresponding to the corresponding main client;
the intermediate server is used for starting each timer in the intermediate server and sending corresponding first connection authentication requests to the first connection authentication interface modules of the slave client program units in the slave clients corresponding to the corresponding master client one by one when the triggering time of data interaction of the corresponding master client and the corresponding slave clients is reached; each first connection authentication request comprises an ip address of a corresponding slave client and a key of the corresponding slave client, wherein the key is preset in the intermediate server;
the first connection authentication interface module is used for correspondingly receiving a corresponding first connection authentication request sent by the intermediate server and correspondingly sending the received corresponding first connection authentication request sent by the intermediate server to the connected first connection authentication information processing module;
the first connection authentication information processing module is used for receiving a first connection authentication request sent by a first connection authentication interface module connected with the first connection authentication information processing module, verifying the accuracy of a key in the first connection authentication request currently received by the first connection authentication information processing module, and returning a token corresponding to the permission of data interaction from the client to the intermediate server through the first connection authentication interface module connected with the first connection authentication information processing module after the verification is passed;
the intermediate server is further configured to correspondingly send a corresponding second connection authentication request to the second connection authentication interface module of the master client program unit after receiving token tokens returned by the first connection authentication information processing modules of the slave client program units in the slave clients corresponding to the master client program unit; the second connection authentication requests comprise preset ip addresses of the main clients corresponding to the program units of the main clients and preset key keys of the corresponding main clients;
the second connection authentication interface module is used for correspondingly receiving a corresponding second connection authentication request sent by the intermediate server and sending the received corresponding second connection authentication request sent by the intermediate server to the second connection authentication information processing module connected with the second connection authentication interface module;
the second connection authentication information processing module is used for receiving a corresponding second connection authentication request sent by the second connection authentication interface module connected with the second connection authentication information processing module, verifying the accuracy of the key in the currently received second connection authentication request, and returning a token allowing data interaction to the corresponding main client side to the intermediate server through the second connection authentication interface module connected with the second connection authentication information processing module after the verification is passed;
the intermediate server is further configured to receive a corresponding token returned by the second connection authentication information processing module, and to send the token returned by the currently received corresponding second connection authentication information processing module and the token allowing data interaction returned by each first connection authentication information processing module corresponding to the primary client corresponding to the corresponding second connection authentication information processing module currently receiving the token returned by the currently received token to the second data transmission interface module of the primary client program unit in the primary client corresponding to the corresponding second connection authentication information processing module currently receiving the token returned by the currently received token after receiving the token returned by the corresponding second connection authentication information processing module each time;
the second data transmission interface module is used for receiving and sending the received token returned by the corresponding second connection authentication information processing module sent by the intermediate server and the token allowing data interaction returned by each first connection authentication information processing module corresponding to the host client corresponding to the corresponding second connection authentication information processing module to the second data processing module connected with the second data transmission interface module;
the second data processing module is used for receiving and performing data interaction with the first data processing modules of the slave client program units corresponding to the master client program units through the intermediate server based on the token returned by the corresponding second connection authentication information processing module transmitted by the second data transmission interface module connected with the second data processing module and the token allowing data interaction returned by the first connection authentication information processing modules corresponding to the master client corresponding to the corresponding second connection authentication information processing module.
In this embodiment, the http request is adopted for both the second connection authentication request and the first connection authentication request; and the data interaction between the second data processing module and each corresponding first data processing module is carried out based on the preset same data transmission format.
Before the method is used, based on business requirements, a main client program unit copies corresponding copies and correspondingly installs in each main client to participate in interaction, a slave client program unit copies corresponding copies and correspondingly installs in each slave client to participate in interaction, and corresponding number of timers are configured in an intermediate server according to the number of the main clients to participate in interaction, so that each main client to participate in interaction corresponds to one timer. When the system is used, a master client program unit in each master client, a slave client program unit in each slave client and each timer configured in the intermediate server are started, and for each timer in the intermediate server, when the triggering time of data interaction between the corresponding master client (hereinafter referred to as a target master client) and each slave client (hereinafter referred to as a target slave client) corresponding to the target master client is reached each time: the intermediate server sends corresponding first connection authentication requests to first connection authentication interface modules of slave client program units in the target slave clients one by one; the first connection authentication interface module of the slave client program unit in each target slave client correspondingly receives each corresponding first connection authentication request sent by the intermediate server and respectively correspondingly sends each corresponding first connection authentication request sent by the intermediate server correspondingly to the first connection authentication information processing module of the corresponding slave client program unit; the first connection authentication information processing module of the slave client program unit in each target slave client respectively verifies the accuracy of the key in the corresponding first connection authentication request received by the first connection authentication information processing module, and respectively returns token tokens allowing data interaction to the intermediate server after the verification is passed; after receiving token tokens returned by the slave client program units in the target slave clients, the intermediate server sends a second connection authentication request to a second connection authentication interface module of the master client program unit in the target master client; a second connection authentication interface module of a main client program unit in the target main client receives and sends a received second connection authentication request sent by the intermediate server to a second connection authentication information processing module of the corresponding main client program unit; the second connection authentication information processing module of the main client program unit in the target main client verifies the accuracy of the key in the second connection authentication request received by the second connection authentication information processing module, and after the verification is passed, the token allowing data interaction is returned to the intermediate server through the second connection authentication interface module connected with the second connection authentication information processing module; the intermediate server receives a token returned by the second connection authentication information processing module of the main client program unit in the target main client, and after receiving the token returned by the second connection authentication information processing module of the main client program unit in the target main client, the intermediate server sends the received token returned by the second connection authentication information processing module of the main client program unit in the target main client and the token returned by the slave client program units in each target slave client to a second data transmission interface module of the main client program unit in the target main client; the second data transmission interface module of the main client program unit in the target main client receives and sends the token returned by the second connection authentication information processing module of the main client program unit in the target main client and the token returned by the slave client program unit in each target slave client which are sent by the intermediate server to the second data processing module of the main client program unit in the target main client; and the second data processing module of the master client program unit in the target master client performs corresponding data interaction (such as data uploading) with the slave client program units in the target slave clients through the intermediate server respectively based on the token returned by the second connection authentication information processing module of the master client program unit in the target master client and the token returned by the slave client program unit in the target slave clients, which are sent by the intermediate server.
The second data processing module of the main client program unit in the target main client performs data interaction with each target slave client under the communication action of the intermediate server through the second data transmission interface module of the main client program unit in the target main client; and the first data processing module of the slave client program unit in each target slave client performs data interaction with the target master client through the first data receiving interface module corresponding to the slave client program unit under the communication action of the intermediate server.
The second connection authentication request and each first connection authentication request adopt http requests; and the data interaction between the main client program unit and each slave client program unit is carried out based on the preset same data transmission format.
In this embodiment, the token allowing data interaction returned from each client program unit to the intermediate server includes the format requirement of the data required to interact by the corresponding host client program unit; the format requirement of the data required to be interacted by the corresponding main client program unit comprises the following steps: and encrypting the data to be interacted, and compressing the ciphertext obtained after encryption.
In this embodiment, the encryption algorithm for encrypting the data to be interacted is an AES encryption algorithm (pre-agreed), and the compression format for compressing the ciphertext obtained by encrypting is a zip compression format.
Furthermore, each slave client program unit verifies the accuracy of the key in the received first connection authentication request and returns a release rejection request to the intermediate server terminal when the verification result is that the key in the received first connection authentication request is wrong; and each main client program unit verifies the accuracy of the key in the received second connection authentication request and returns a release rejection request to the intermediate server when the verification result is that the key in the received second connection authentication request is wrong.
In this embodiment, data interaction between each master client program unit and each corresponding slave client program unit is performed based on the Json format.
In view of the fact that the multi-platform communication system in the present embodiment corresponds to the specific implementation of the multi-platform communication method, the components of the multi-platform communication system in the present embodiment have been correspondingly described in the implementation of the multi-platform communication method, and are not further described herein.
In summary, the multi-platform communication system of the present invention provides a general middleware communication service suitable for communication between a plurality of different clients, realizes interaction between the clients through an intermediate server, realizes reusability of interactive function modules between different clients, saves development manpower resources, and improves the working efficiency of developers for realizing data interaction between different platforms (i.e., different clients).
The above embodiments are only for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may be modified or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A multi-platform communication method is characterized in that the multi-platform communication method is based on an intermediate server, a corresponding number of main clients and a corresponding number of slave clients which are respectively corresponding to each main client and have interactive service requirements with the main clients, wherein the main clients are clients which actively initiate interactive services, and the slave clients are clients which passively receive the interactive services; the multi-platform communication method comprises the following steps:
configuring a corresponding number of timers in an intermediate server in advance according to the number of the main clients, wherein the timers and the main clients are mapped one by one, and each timer is used for determining an interaction period between the corresponding main client and each slave client having an interaction service requirement with the corresponding main client;
starting all timers configured in the intermediate server;
based on the timers configured in the started intermediate server, for each master client and each corresponding slave client having an interactive service requirement, the method comprises the following communication steps:
s1, each time when the interaction triggering time between the main client and each corresponding slave client with the interaction service requirement is reached, the intermediate server correspondingly sends corresponding first connection authentication requests to each slave client corresponding to the main client one by one, wherein each first connection authentication request comprises the ip address of the corresponding slave client and the key preset in the intermediate server of the corresponding slave client;
s2, each slave client, when the intermediate server sends the corresponding first connection authentication request to it, correspondingly receiving each corresponding first connection authentication request sent by the intermediate server, respectively verifying the accuracy of the key in the received corresponding first connection authentication request, and after the verification is passed, respectively returning the token allowing data interaction to the intermediate server;
s3, after receiving token tokens returned by each slave client with interactive service requirement corresponding to the master client, the intermediate server correspondingly sends a corresponding second connection authentication request to the master client, wherein the second connection authentication request comprises an ip address of the master client preset in the intermediate server and a key of the master client preset in the intermediate server;
s4, the main client receives the corresponding second connection authentication request sent by the intermediate server, verifies the accuracy of the key in the received second connection authentication request, and returns the token allowing data interaction to the intermediate server after the verification is passed;
s5, the intermediate server receives the token returned by the main client, and after receiving the token returned by the main client, the intermediate server sends the token returned by the main client and the token returned by each slave client corresponding to the main client, which are received before, to the main client together;
s6, the main client receives and performs data interaction with each corresponding slave client with interaction service requirement through the intermediate server based on the token returned by the main client and the token allowing data interaction returned by each corresponding slave client sent by the main client from the intermediate server;
the data interaction between each main client and each corresponding slave client corresponding to the main client is carried out based on the same preset data transmission format.
2. The multi-platform communication method according to claim 1, wherein each token allowing data interaction returned from the client to the intermediate server includes a format requirement for data to be interacted with by the corresponding host client; the format requirements for the data to be interacted with by the corresponding host client comprise: and encrypting the data to be interacted, and compressing the ciphertext obtained after encryption.
3. The multi-platform communication method according to claim 2, wherein the encryption algorithm for encrypting the data to be interacted is an AES encryption algorithm, and the compression format for compressing the ciphertext obtained by encrypting is a zip compression format.
4. The multi-platform communication method according to claim 1, 2 or 3, wherein the second connection authentication request and each of the first connection authentication requests are http requests.
5. The multi-platform communication method according to claim 1, 2 or 3, wherein data interaction between each master client and each corresponding slave client is performed based on the Json format.
6. A multi-platform communication system is characterized by comprising an intermediate server, a main client program unit which is applied to a main client and can be used in a copying way, and a secondary client program unit which is applied to a secondary client and can be used in a copying way; the master client is a client which actively initiates interactive service requirements, and the slave client is a client which passively receives the interactive service requirements;
the main client program unit comprises a second connection authentication interface module, a second connection authentication information processing module, a second data transmission interface module and a second data processing module, wherein the second connection authentication interface module is connected with the second connection authentication information processing module, and the second data transmission interface module is connected with the second data processing module;
the slave client program unit comprises a first connection authentication interface module, a first connection authentication information processing module, a first data receiving interface module and a first data processing module, wherein the first connection authentication interface module is connected with the first connection authentication information processing module, and the first data receiving interface module is connected with the first data processing module;
the intermediate server is internally pre-provided with timers which are equal to and correspond to the number of the main clients to participate in communication one by one, and each timer is used for determining the interaction period between the corresponding main client and the corresponding number of the slave clients with the interaction service requirements corresponding to the corresponding main client;
the intermediate server is used for starting each timer in the intermediate server and sending corresponding first connection authentication requests to the first connection authentication interface modules of the slave client program units in the slave clients corresponding to the corresponding master client one by one when the triggering time of data interaction of the corresponding master client and the corresponding slave clients is reached; each first connection authentication request comprises an ip address of a corresponding slave client and a key of the corresponding slave client, wherein the key is preset in the intermediate server;
the first connection authentication interface module is used for correspondingly receiving a corresponding first connection authentication request sent by the intermediate server and correspondingly sending the received corresponding first connection authentication request sent by the intermediate server to the connected first connection authentication information processing module;
the first connection authentication information processing module is used for receiving a first connection authentication request sent by a first connection authentication interface module connected with the first connection authentication information processing module, verifying the accuracy of a key in the first connection authentication request currently received by the first connection authentication information processing module, and returning a token corresponding to the permission of data interaction from the client to the intermediate server through the first connection authentication interface module connected with the first connection authentication information processing module after the verification is passed;
the intermediate server is further configured to correspondingly send a corresponding second connection authentication request to the second connection authentication interface module of the master client program unit after receiving token tokens returned by the first connection authentication information processing modules of the slave client program units in the slave clients corresponding to the master client program unit; the second connection authentication requests comprise preset ip addresses of the main clients corresponding to the program units of the main clients and preset key keys of the corresponding main clients;
the second connection authentication interface module is used for correspondingly receiving a corresponding second connection authentication request sent by the intermediate server and sending the received corresponding second connection authentication request sent by the intermediate server to the second connection authentication information processing module connected with the second connection authentication interface module;
the second connection authentication information processing module is used for receiving a corresponding second connection authentication request sent by the second connection authentication interface module connected with the second connection authentication information processing module, verifying the accuracy of the key in the currently received second connection authentication request, and returning a token allowing data interaction to the corresponding main client side to the intermediate server through the second connection authentication interface module connected with the second connection authentication information processing module after the verification is passed;
the intermediate server is further configured to receive a corresponding token returned by the second connection authentication information processing module, and to send the token returned by the currently received corresponding second connection authentication information processing module and the token allowing data interaction returned by each first connection authentication information processing module corresponding to the primary client corresponding to the corresponding second connection authentication information processing module currently receiving the token returned by the currently received token to the second data transmission interface module of the primary client program unit in the primary client corresponding to the corresponding second connection authentication information processing module currently receiving the token returned by the currently received token after receiving the token returned by the corresponding second connection authentication information processing module each time;
the second data transmission interface module is used for receiving and sending the received token returned by the corresponding second connection authentication information processing module sent by the intermediate server and the token allowing data interaction returned by each first connection authentication information processing module corresponding to the host client corresponding to the corresponding second connection authentication information processing module to the second data processing module connected with the second data transmission interface module;
the second data processing module is used for receiving and performing data interaction with the first data processing modules of the slave client program units corresponding to the corresponding master client program units through the intermediate server based on token tokens returned by the corresponding second connection authentication information processing modules and returned by the corresponding first connection authentication information processing modules corresponding to the corresponding second connection authentication information processing modules, wherein the token tokens are transmitted by the second data transmission interface module connected with the second data processing module and are currently received;
and the data interaction between the second data processing module and each corresponding first data processing module is carried out based on the preset same data transmission format.
7. The multi-platform communication system according to claim 6, wherein each token allowing data interaction returned from the client program unit to the intermediate server includes a format requirement for data required to be interacted with by the corresponding host client program unit; the format requirement of the data required to be interacted by the corresponding main client program unit comprises the following steps: and encrypting the data to be interacted, and compressing the ciphertext obtained after encryption.
8. The multi-platform communication system according to claim 7, wherein the encryption algorithm for encrypting the data to be interacted is an AES encryption algorithm, and the compression format for compressing the ciphertext obtained by encrypting is a zip compression format.
9. The multi-platform communication system according to claim 6, 7 or 8, wherein the second connection authentication request and the first connection authentication request both use http requests.
10. The system of claim 6, 7 or 8, further characterized in that the data interaction between each master client program unit and its corresponding slave client program unit is based on the Json format.
CN201811490087.XA 2018-12-06 2018-12-06 Multi-platform communication method and system Active CN109474608B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811490087.XA CN109474608B (en) 2018-12-06 2018-12-06 Multi-platform communication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811490087.XA CN109474608B (en) 2018-12-06 2018-12-06 Multi-platform communication method and system

Publications (2)

Publication Number Publication Date
CN109474608A CN109474608A (en) 2019-03-15
CN109474608B true CN109474608B (en) 2021-01-15

Family

ID=65675859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811490087.XA Active CN109474608B (en) 2018-12-06 2018-12-06 Multi-platform communication method and system

Country Status (1)

Country Link
CN (1) CN109474608B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889439B (en) * 2019-03-25 2021-09-14 阔地教育科技有限公司 Cross-platform multi-scene instant messaging method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051628A (en) * 2012-12-21 2013-04-17 微梦创科网络科技(中国)有限公司 Method and system for obtaining authentication token based on servers
CN103475666A (en) * 2013-09-23 2013-12-25 中国科学院声学研究所 Internet of things resource digital signature authentication method
CN105379177A (en) * 2013-05-23 2016-03-02 英特托拉斯技术公司 Secure authorization systems and methods
US10129228B1 (en) * 2016-03-30 2018-11-13 Amazon Technologies, Inc. Authenticated communication between devices
CN108933926A (en) * 2018-07-02 2018-12-04 福建星网锐捷通讯股份有限公司 A kind of method and system based on SIP access Haikang fluorite video

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103051628A (en) * 2012-12-21 2013-04-17 微梦创科网络科技(中国)有限公司 Method and system for obtaining authentication token based on servers
CN105379177A (en) * 2013-05-23 2016-03-02 英特托拉斯技术公司 Secure authorization systems and methods
CN103475666A (en) * 2013-09-23 2013-12-25 中国科学院声学研究所 Internet of things resource digital signature authentication method
US10129228B1 (en) * 2016-03-30 2018-11-13 Amazon Technologies, Inc. Authenticated communication between devices
CN108933926A (en) * 2018-07-02 2018-12-04 福建星网锐捷通讯股份有限公司 A kind of method and system based on SIP access Haikang fluorite video

Also Published As

Publication number Publication date
CN109474608A (en) 2019-03-15

Similar Documents

Publication Publication Date Title
US10341302B2 (en) Optimized transport layer security
US7600122B2 (en) Methods and apparatus for accelerating secure session processing
CN111447276B (en) Encryption continuous transmission method with key agreement function
CN113239403A (en) Data sharing method and device
US10419212B2 (en) Methods, systems, apparatuses, and devices for securing network communications using multiple security protocols
CN110601825A (en) Ciphertext processing method and device, storage medium and electronic device
CN105354505A (en) Image adaption method and electronic device
CN110635912A (en) Data processing method and device
CN115378660A (en) Data transmission method, device, equipment and medium
WO2016065787A1 (en) Rdp data collection apparatus and method
CN109474608B (en) Multi-platform communication method and system
CN112261002B (en) Data interface docking method and device
WO2016000473A1 (en) Business access method, system and device
CN110768928B (en) Communication method and communication device, computer equipment and readable storage medium
CN111884988A (en) Method for secure transmission of data
CN102624741A (en) TLV (Threshold Limit Value) based data transmission method and system thereof
US20160191493A1 (en) System and method of authenticating a live video stream
EP2713576B1 (en) Method and device for processing streaming media content
CN114158046B (en) Method and device for realizing one-key login service
CN111901335B (en) Block chain data transmission management method and system based on middle station
CN112235320B (en) Cipher-based video networking multicast communication method and device
WO2012146000A1 (en) Data transmission method and system
CN109787997A (en) TCP method of servicing and server based on PHP
CN112995210B (en) Data transmission method and device and electronic equipment
CN105490816A (en) Method and device of multiple authentications on the basis of AllJoyn

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201201

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450000 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant