CN110034927B - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN110034927B
CN110034927B CN201910229515.1A CN201910229515A CN110034927B CN 110034927 B CN110034927 B CN 110034927B CN 201910229515 A CN201910229515 A CN 201910229515A CN 110034927 B CN110034927 B CN 110034927B
Authority
CN
China
Prior art keywords
application program
password
container
message
application
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
CN201910229515.1A
Other languages
Chinese (zh)
Other versions
CN110034927A (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201910229515.1A priority Critical patent/CN110034927B/en
Publication of CN110034927A publication Critical patent/CN110034927A/en
Application granted granted Critical
Publication of CN110034927B publication Critical patent/CN110034927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords

Abstract

An embodiment of the present specification provides a communication method and apparatus, where the method is applied to a first terminal, the first terminal includes a container having an agent function, the container corresponds to a plurality of applications located in a plurality of terminals, the plurality of terminals include the first terminal, and the method includes: and receiving a publishing request sent by a first application program which establishes connection with the container in the plurality of application programs through the container. The publishing request carries a message to be published and a first message topic corresponding to the message to be published, and the first application program is an application program in the first terminal or an application program in other terminals. And then, according to the subscription relationship between the application programs and the message topics pre-stored in the container, determining a second application program which subscribes to the first message topic in the plurality of application programs. And then sending a message to the terminal to which the second application program belongs through the container. By adopting the method and the device, point-to-multipoint bidirectional communication between the terminals can be realized.

Description

Communication method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for communication.
Background
Currently, in a local area network, technicians usually use socket.
Io, however, terminals can only perform point-to-point bidirectional communication, and cannot perform point-to-multipoint bidirectional communication.
Therefore, a scheme for implementing point-to-multipoint bidirectional communication between terminals is urgently needed.
Disclosure of Invention
One or more embodiments of the present specification describe a method and apparatus for communication, which enables point-to-multipoint bidirectional communication between terminals.
In a first aspect, a method for communication is provided, where the method is applied to a first terminal, the first terminal includes a container with a proxy function, the container corresponds to multiple applications located in multiple terminals, the multiple terminals include the first terminal, and the method includes:
receiving, by the container, a publication request sent by a first application program that establishes a connection with the container among the plurality of application programs, where the publication request carries a message to be published and a first message topic corresponding to the message to be published, and the first application program is an application program in the first terminal or an application program in another terminal;
determining a second application program which is subscribed to the first message topic in the plurality of application programs according to a subscription relation between the application programs and the message topics which are stored in the container in advance;
and sending the message to the terminal to which the second application program belongs through the container.
Optionally, the method further includes:
receiving a subscription request sent by a third application program in the plurality of application programs through the container, wherein the subscription request carries a second message topic;
and adding the subscription relationship between the third application program and the second message topic in the subscription relationship between the application program and the message topic pre-stored in the container.
Optionally, the method further includes establishing a connection with the first application through the container, including:
receiving a connection request sent by the first application program through the container, wherein the connection request carries an encrypted first password, and the encrypted first password is obtained by encrypting the first password by the first application program through a first private key;
decrypting the encrypted first password according to a public key corresponding to the first private key stored in the container in advance to obtain the first password;
determining a second password corresponding to the first application program according to the corresponding relation between the application program and the password stored in the container in advance;
if the first password is the same as the second password, sending a connection success response to the first application program through the container so that the first application program and the container are connected;
and if the first password is different from the second password, sending a connection failure response to the first application program through the container.
Optionally, the method further includes:
receiving a password acquisition request sent by the first application program through the container;
acquiring a third password corresponding to the first application program through a container;
encrypting the third password according to a second private key stored in the container in advance to obtain an encrypted third password;
and sending a password acquisition response to the first application program through the container, wherein the password acquisition response carries the encrypted third password.
Optionally, the obtaining a third password corresponding to the first application includes:
and determining a third password corresponding to the first application program according to the corresponding relation between the application program and the password stored in the container in advance.
Optionally, the obtaining a third password corresponding to the first application includes:
generating a third password corresponding to the first application program according to a preset password generation rule;
the method further comprises the following steps:
and storing the corresponding relation between the first application program and the third password into the container.
In a second aspect, there is provided an apparatus for communication, the apparatus being deployed in a first terminal and having a proxy function, the apparatus corresponding to a plurality of applications located in a plurality of terminals including the first terminal, the apparatus comprising:
a first receiving module, configured to receive a publication request sent by a first application program that establishes a connection with the device among the multiple application programs, where the publication request carries a message to be published and a first message topic corresponding to the message to be published, and the first application program is an application program in the first terminal or an application program in another terminal;
the first determining module is used for determining a second application program which subscribes to the first message topic in the plurality of application programs according to a pre-stored subscription relationship between the application programs and the message topics;
and the first sending module is used for sending the message to the terminal to which the second application program belongs.
Optionally, the apparatus further comprises:
a second receiving module, configured to receive a subscription request sent by a third application program of the multiple application programs, where the subscription request carries a second message topic;
and the adding module is used for adding the subscription relationship between the third application program and the second message topic in the pre-stored subscription relationship between the application program and the message topic.
Optionally, the apparatus further comprises:
a third receiving module, configured to receive a connection request sent by the first application, where the connection request carries an encrypted first password, and the encrypted first password is obtained by encrypting the first password by the first application through a first private key;
the decryption module is used for decrypting the encrypted first password according to a pre-stored public key corresponding to the first private key to obtain the first password;
the second determining module is used for determining a second password corresponding to the first application program according to the corresponding relation between the prestored application program and the password;
a second sending module, configured to send a connection success response to the first application program if the first password is the same as the second password, so that the first application program establishes a connection with the container;
and a third sending module, configured to send a connection failure response to the first application program if the first password is different from the second password.
Optionally, the apparatus further comprises:
a fourth receiving module, configured to receive a password acquisition request sent by the first application;
the acquisition module is used for acquiring a third password corresponding to the first application program;
the encryption module is used for encrypting the third password according to a prestored second private key to obtain an encrypted third password;
a fourth sending module, configured to send a password acquisition response to the first application, where the password acquisition response carries the encrypted third password.
Optionally, the obtaining module is specifically configured to:
and determining a third password corresponding to the first application program according to the corresponding relation between the application program and the password stored in the container in advance.
Optionally, the obtaining module is specifically configured to:
generating a third password corresponding to the first application program according to a preset password generation rule;
the device further comprises:
and the storage module is used for storing the corresponding relation between the first application program and the third password into the device.
In a third aspect, there is provided a terminal comprising a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method of any one of the first aspect.
In a fourth aspect, there is provided a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed in a computer, causes the computer to perform the method of any of the first aspects.
According to the communication method and device provided by the embodiment of the specification, the first terminal receives a publishing request sent by a first application program which establishes connection with the container in the plurality of application programs through the container. The publishing request carries the message to be published and the first message topic corresponding to the message to be published. Then, the first terminal determines a second application program subscribed to the first message topic in the plurality of application programs according to the subscription relationship between the application programs and the message topics stored in the container in advance, and sends the message to the terminal to which the second application program belongs through the container. In this way, after the first container receives the message published to the first message topic by the first application program in the first terminal, the message can be forwarded to the terminals to which all the second application programs subscribed to the first message topic belong, so as to realize point-to-multipoint communication between the first terminal and other terminals.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a block diagram of a system provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of a method of communication provided by an embodiment of the present specification;
fig. 3 is a schematic structural diagram of a communication device according to an embodiment of the present disclosure.
Detailed Description
The scheme provided by the specification is described below with reference to the accompanying drawings.
Fig. 1 is an architecture diagram of a system provided by an embodiment of the present disclosure, which may include a first terminal and a second terminal connected to each other, as shown in fig. 1. The first terminal and the second terminal are respectively operated with a first application and a second application. Wherein the first application and the second application may be mixed mode mobile applications (hybrid-apps), or web applications (web-apps) or native applications (native-apps). The first application may include a first application program and a first container. The second application may include a second application program and a second container. The first application program and the second application program are integrated with a subscription (Subscribers) function and a publishing (Publishers) function; the first container or the second container is integrated with a proxy (browser) function and a security function. The embodiment of the present application is described by taking an example in which the first container is integrated with an agent function and a security function, and the other cases are similar to these.
It should be noted that the subscription function and the publishing function integrated in the application program, and the proxy function and the security function integrated in the container may implement a subscription function, a publishing function, a proxy function, and a security function in a Message queue Telemetry Transport protocol (MQTT) or a WebSocket protocol, or may also be a subscription function, a publishing function, a proxy function, and a security function in other types of protocols, which is not limited in the embodiment of the present application.
The embodiment of the present specification provides a communication method, which can implement point-to-multipoint bidirectional communication between terminals, and the method is applied to a first terminal, and as shown in fig. 2, the processing procedure is as follows:
step 201, receiving, by a container, a publishing request sent by a first application program, which establishes a connection with the container, in the plurality of application programs.
The publishing request carries the message to be published and the first message topic corresponding to the message to be published.
In implementation, when the first terminal needs to communicate with other terminals, the first terminal may establish a connection with a container (i.e., a first container) having an agent function, which the first application includes, through an application (i.e., a first application) included in the first application installed in the first terminal. The first terminal may then send a publication request to the first container via the first application. The publishing request carries the message to be published and the first message topic corresponding to the message to be published. After receiving the publishing request sent by the first application program, the first container may parse the publishing request to obtain the message to be published carried in the publishing request and the first message topic corresponding to the message to be published.
The first application may be the first application in the first terminal, or may be an application in another terminal. The embodiment of the present application is described by taking a first application as an example of a first application in a first terminal, and other situations are similar to the first application.
Step 202, according to the subscription relationship between the application programs and the message topics pre-stored in the container, determining a second application program subscribing to the first message topic from the plurality of application programs.
In implementation, the first container may store a subscription relationship between the application program and the message topic in advance. The subscription relationship may be set by a technician, or may be established according to a subscription request sent by an application program. After the first container obtains the message to be published carried in the publication request sent by the first application program and the first message topic corresponding to the message to be published, a second application program which subscribes to the first message topic in the multiple application programs can be queried in the subscription relationship between the prestored application program and the message topic.
Step 203, sending a message to the terminal to which the second application program belongs through the container.
In an implementation, after the first container obtains the second application program subscribed to the first message topic, the message may be forwarded to the terminal to which the second application program belongs. In this way, after the first container receives the message that the first application program in the first terminal publishes to the first message topic, the first container can forward the message to the terminals to which all the second application programs subscribed to the first message topic belong, thereby realizing the point-to-multipoint communication between the first terminal and other terminals.
Optionally, the first terminal may further establish a subscription relationship between the application program and the message topic according to a subscription request sent by the first application program, where the detailed processing procedure is as follows:
step one, a subscription request sent by a third application program in a plurality of application programs is received through a container.
And the subscription request carries the second message topic.
In an implementation, the third application may be an application in the first terminal, or may be an application in another terminal. The embodiment of the present application is described by taking a first application program in a first terminal as an example, and other situations are similar to the first application program. When a first terminal needs to subscribe to a certain message topic, the first terminal can send a subscription request to a first container with a proxy function, which is contained in a first application installed in the first terminal, through the first application program contained in the first application. Wherein the subscription request carries a second message topic. After receiving the subscription request sent by the first application program, the first container may parse the subscription request to obtain a second message topic carried in the subscription request.
And step two, adding the subscription relationship between the third application program and the second message topic in the subscription relationship between the application program and the message topic pre-stored in the container.
In implementation, after the first container obtains the second message topic carried in the subscription request sent by the first application program, the subscription relationship between the first application program and the second message topic may be added in the pre-stored subscription relationship between the application program and the message topic. In this way, when the first container receives the message which is published to the second message topic by the terminal to which the other application program belongs, the message can be sent to the first terminal to which the first application program belongs according to the subscription relationship between the first application program and the second message topic.
Optionally, the first terminal may further establish a connection between the first application and the first container according to a connection request sent by the first application. The detailed treatment process is as follows:
step one, receiving a connection request sent by a first application program through a container.
The connection request carries an encrypted first password, and the encrypted first password is obtained by encrypting the first password by the first application program through the first private key.
In implementation, when the first terminal needs to communicate with other terminals, the first terminal needs to first establish a connection between the first application and the first container. The first terminal may transmit a connection request to a first container having a proxy function, which the first application includes, through a first application program included in a first application installed in the first terminal. The connection request carries an encrypted first password, and the encrypted first password is obtained by encrypting the first password by the first application program through the first private key. After receiving the connection request sent by the first application program, the first container may parse the connection request to obtain the encrypted first password carried in the connection request.
It should be noted that the encrypted first password may be transmitted as a parameter of a Uniform Resource Identifier (URI) in the connection request.
And step two, decrypting the encrypted first password according to a public key corresponding to a first private key stored in the container in advance to obtain the first password.
In implementation, after the first container obtains the encrypted first password carried in the connection request sent by the first application program, the first container may decrypt the encrypted first password according to a pre-stored public key corresponding to the first private key to obtain the first password.
And step three, determining a second password corresponding to the first application program according to the corresponding relation between the application program and the password stored in the container in advance.
In implementation, the first container may further store a correspondence between the application program and the password in advance. The password corresponding to the application program can be set by a technician or generated according to a preset password generation rule. After receiving the connection request sent by the first application program, the first container may query a second password corresponding to the first application program in a pre-stored correspondence between the application program and the password. After the first container obtains the first password and the second password, whether the first password and the second password are the same can be further judged. And if the first password is the same as the second password, executing the step four. And if the first password is different from the second password, executing a fifth step.
And step four, sending a connection success response to the first application program through the container so as to enable the first application program to establish connection with the container.
In an implementation, if the first password is the same as the second password, indicating that the first container is successfully authenticated to the first application, the first container may send a connection success response to the first application. In this way, the first application program can establish connection with the first container after receiving the connection success response sent by the first container.
And step five, sending a connection failure response to the first application program through the container.
In an implementation, if the first password is different from the second password, indicating that the first container failed to authenticate the first application, the first container may send a connection failure response to the first application.
Optionally, the first terminal may further obtain a password corresponding to the first application program according to a password obtaining request sent by the first application program. The detailed treatment process is as follows:
step one, a password acquisition request sent by a first application program is received through a container.
In implementation, when a first terminal needs to establish a connection between a first application and a first container, the first terminal may send a password acquisition request to the first container with an agent function, which is included in a first application installed in the first terminal, through the first application included in the first application.
And step two, acquiring a third password corresponding to the first application program through the container.
In implementation, after receiving a password obtaining request sent by a first application program, the first container may obtain a third password corresponding to the first application program. The way for the first container to obtain the third password corresponding to the first application program may be various, and the embodiment of the present application provides two possible implementation manners.
In the first embodiment, the third password corresponding to the first application program is determined according to the correspondence between the application program and the password stored in the container in advance.
In implementation, the first container may store a corresponding relationship between the application program and the password in advance, and the corresponding relationship may be set by a technician. After receiving the password acquisition request sent by the first application program, the first container may query a third password corresponding to the first application program in a pre-stored correspondence between the application program and the password.
In the second embodiment, a third password corresponding to the first application program is generated according to a preset password generation rule.
In an implementation, the first container may have a password generation rule stored therein in advance. The password generation rule may be set by a technician. After receiving the password acquisition request sent by the first application program, the first container may generate a third password corresponding to the first application program according to a preset password generation rule.
Optionally, after the first container generates the third password corresponding to the first application program according to the preset password generation rule, the first container may further store the corresponding relationship between the first application program and the third password in the container, so as to subsequently verify the first application program.
And step three, encrypting the third password according to a second private key stored in the container in advance to obtain the encrypted third password.
In implementation, after the first container obtains the third password corresponding to the first application program, the third password may be encrypted according to the pre-stored second private key to obtain the encrypted third password.
And step four, sending a password acquisition response to the first application program through the container.
And the password acquisition response carries the encrypted third password.
In implementation, after obtaining the encrypted third password, the first container may send a password obtaining response to the first application. And the password acquisition response carries the encrypted third password. Subsequently, after receiving the password acquisition response sent by the first container, the first application program may analyze the password acquisition response to obtain an encrypted third password carried in the password acquisition response. Then, the first application program may decrypt the encrypted third password according to the pre-stored public key corresponding to the second private key to obtain the third password, and send a connection request to the first container based on the third password to establish the connection.
According to the communication method provided by the embodiment of the specification, the first terminal receives a publishing request sent by a first application program which establishes a connection with the container in the plurality of application programs through the container. The publishing request carries the message to be published and the first message topic corresponding to the message to be published. Then, the first terminal determines a second application program subscribed to the first message topic in the plurality of application programs according to the subscription relationship between the application programs and the message topics stored in the container in advance, and sends the message to the terminal to which the second application program belongs through the container. In this way, after the first container receives the message published to the first message topic by the first application program in the first terminal, the message can be forwarded to the terminals to which all the second application programs subscribed to the first message topic belong, so as to realize point-to-multipoint communication between the first terminal and other terminals.
Based on the same technical concept, as shown in fig. 3, an embodiment of the present specification further provides a communication apparatus, which is deployed in a first terminal and has an agent function, and corresponds to a plurality of applications located in a plurality of terminals, where the plurality of terminals include the first terminal, and the apparatus includes:
a first receiving module 310, configured to receive a publishing request sent by a first application program that establishes a connection with the apparatus in the multiple application programs, where the publishing request carries a message to be published and a first message topic corresponding to the message to be published, and the first application program is an application program in a first terminal or an application program in another terminal;
a first determining module 320, configured to determine, according to a pre-stored subscription relationship between an application program and a message topic, a second application program that subscribes to the first message topic in the multiple application programs;
a first sending module 330, configured to send a message to a terminal to which the second application belongs.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving a subscription request sent by a third application program in the plurality of application programs, and the subscription request carries a second message theme;
and the adding module is used for adding the subscription relationship between the third application program and the second message topic in the pre-stored subscription relationship between the application program and the message topic.
Optionally, the apparatus further comprises:
the third receiving module is used for receiving a connection request sent by the first application program, wherein the connection request carries an encrypted first password, and the encrypted first password is obtained by encrypting the first password by the first application program through a first private key;
the decryption module is used for decrypting the encrypted first password according to a pre-stored public key corresponding to the first private key to obtain a first password;
the second determining module is used for determining a second password corresponding to the first application program according to the corresponding relation between the prestored application program and the password;
the second sending module is used for sending a connection success response to the first application program if the first password is the same as the second password so as to enable the first application program to establish connection with the container;
and the third sending module is used for sending a connection failure response to the first application program if the first password is different from the second password.
Optionally, the apparatus further comprises:
the fourth receiving module is used for receiving the password acquisition request sent by the first application program;
the acquisition module is used for acquiring a third password corresponding to the first application program;
the encryption module is used for encrypting the third password according to a prestored second private key to obtain an encrypted third password;
and the fourth sending module is used for sending a password acquisition response to the first application program, wherein the password acquisition response carries the encrypted third password.
Optionally, the obtaining module is specifically configured to:
and determining a third password corresponding to the first application program according to the corresponding relation between the application program and the password stored in the container in advance.
Optionally, the obtaining module is specifically configured to:
generating a third password corresponding to the first application program according to a preset password generation rule;
the device also includes:
and the storage module is used for storing the corresponding relation between the first application program and the third password into the device.
With the communication apparatus provided by the embodiments of the present specification, the first terminal receives, through the container, a publication request sent by a first application that establishes a connection with the container, from among the plurality of applications. The publishing request carries the message to be published and the first message topic corresponding to the message to be published. Then, the first terminal determines a second application program subscribed to the first message topic in the plurality of application programs according to the subscription relationship between the application programs and the message topics stored in the container in advance, and sends the message to the terminal to which the second application program belongs through the container. In this way, after the first container receives the message published to the first message topic by the first application program in the first terminal, the message can be forwarded to the terminals to which all the second application programs subscribed to the first message topic belong, so as to realize point-to-multipoint communication between the first terminal and other terminals.
Based on the same technical concept, embodiments of the present specification further provide a terminal, including a memory and a processor, where the memory stores executable codes, and when the processor executes the executable codes, the method executed by the first terminal is implemented.
Based on the same technical concept, embodiments of the present specification further provide a computer-readable storage medium having a computer program stored thereon, where the computer program is executed in a computer, and causes the computer to execute the method executed by the first terminal.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in this invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The above-mentioned embodiments, objects, technical solutions and advantages of the present invention are further described in detail, it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.

Claims (8)

1. A method of communication applied to a first terminal including a container having a proxy function, the container corresponding to a plurality of applications located in a plurality of terminals including the first terminal, the method comprising:
receiving, by the container, a publication request sent by a first application program that establishes a connection with the container among the plurality of application programs, where the publication request carries a message to be published and a first message topic corresponding to the message to be published, and the first application program is an application program in the first terminal or an application program in another terminal;
determining a second application program which is subscribed to the first message topic in the plurality of application programs according to a subscription relation between the application programs and the message topics which are stored in the container in advance;
sending the message to the terminal to which the second application program belongs through the container, wherein the process of establishing connection between the first application program and the container comprises the following steps:
receiving a password acquisition request sent by the first application program through the container;
determining a third password corresponding to the first application program through a container according to the corresponding relation between the application program and the password stored in the container in advance; or generating a third password corresponding to the first application program according to a preset password generation rule;
encrypting the third password according to a second private key stored in the container in advance to obtain an encrypted third password;
and sending a password acquisition response to the first application program through the container, wherein the password acquisition response carries the encrypted third password, so that the first application program decrypts the encrypted third password according to a public key corresponding to a prestored second private key to obtain a third password, and sends a connection request to the container based on the third password to establish connection.
2. The method of claim 1, wherein the method further comprises:
receiving a subscription request sent by a third application program in the plurality of application programs through the container, wherein the subscription request carries a second message topic;
and adding the subscription relationship between the third application program and the second message topic in the subscription relationship between the application program and the message topic pre-stored in the container.
3. The method of claim 1, wherein after generating a third password corresponding to the first application according to a preset password generation rule, the method further comprises:
and storing the corresponding relation between the first application program and the third password into the container.
4. An apparatus for communication, the apparatus being deployed in a first terminal and having a proxy function, the apparatus corresponding to a plurality of applications located in a plurality of terminals including the first terminal, the apparatus comprising:
a first receiving module, configured to receive a publishing request sent by a first application that establishes a connection with the apparatus among the multiple applications, where the publishing request carries a message to be published and a first message topic corresponding to the message to be published, and the first application is an application in the first terminal or an application in another terminal;
the first determining module is used for determining a second application program which is subscribed to the first message topic in the plurality of application programs according to a pre-stored subscription relation between the application programs and the message topics;
a first sending module, configured to send the message to a terminal to which the second application belongs;
a fourth receiving module, an obtaining module, an encrypting module and a fourth sending module, which are used for establishing the connection process between the first application program and the container,
the fourth receiving module is configured to receive a password obtaining request sent by the first application program;
the acquisition module is used for determining a third password corresponding to the first application program according to the corresponding relation between the application program and the password stored in the container in advance; or generating a third password corresponding to the first application program according to a preset password generation rule;
the encryption module is used for encrypting the third password according to a second private key stored in the container in advance to obtain an encrypted third password;
the fourth sending module is configured to send a password obtaining response to the first application program, where the password obtaining response carries the encrypted third password, so that the first application program decrypts the encrypted third password according to a pre-stored public key corresponding to the second private key to obtain the third password, and sends a connection request to the container based on the third password to establish connection.
5. The apparatus of claim 4, wherein the apparatus further comprises:
a second receiving module, configured to receive a subscription request sent by a third application program of the multiple application programs, where the subscription request carries a second message topic;
and the adding module is used for adding the subscription relationship between the third application program and the second message topic in the pre-stored subscription relationship between the application program and the message topic.
6. The apparatus of claim 4, further comprising:
and the storage module is used for storing the corresponding relation between the first application program and the third password into the device after the third password corresponding to the first application program is generated according to a preset password generation rule.
7. A terminal comprising a memory having stored therein executable code and a processor that, when executing the executable code, implements the method of any of claims 1-3.
8. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed in a computer, causes the computer to perform the method of any of claims 1-3.
CN201910229515.1A 2019-03-25 2019-03-25 Communication method and device Active CN110034927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910229515.1A CN110034927B (en) 2019-03-25 2019-03-25 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910229515.1A CN110034927B (en) 2019-03-25 2019-03-25 Communication method and device

Publications (2)

Publication Number Publication Date
CN110034927A CN110034927A (en) 2019-07-19
CN110034927B true CN110034927B (en) 2022-05-13

Family

ID=67236520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910229515.1A Active CN110034927B (en) 2019-03-25 2019-03-25 Communication method and device

Country Status (1)

Country Link
CN (1) CN110034927B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866092B (en) * 2020-06-30 2022-06-28 北京百度网讯科技有限公司 Message transmission method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9264304B2 (en) * 2012-06-20 2016-02-16 Reliance Jio Infocomm Usa, Inc. Method and procedure for dynamic services orchestration that runs within an on device software container
CN106575427A (en) * 2014-08-12 2017-04-19 艾高特有限责任公司 A zero-knowledge environment based social networking engine
CN107493191A (en) * 2017-08-08 2017-12-19 深信服科技股份有限公司 A kind of clustered node and self scheduling container group system
CN107864694A (en) * 2016-07-21 2018-03-30 百度时代网络技术(北京)有限公司 The efficient communication among calculate node for operating automatic driving vehicle
CN109151043A (en) * 2018-09-06 2019-01-04 北京赛佰特科技有限公司 Message delivery system based on cloud service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9264304B2 (en) * 2012-06-20 2016-02-16 Reliance Jio Infocomm Usa, Inc. Method and procedure for dynamic services orchestration that runs within an on device software container
CN106575427A (en) * 2014-08-12 2017-04-19 艾高特有限责任公司 A zero-knowledge environment based social networking engine
CN107864694A (en) * 2016-07-21 2018-03-30 百度时代网络技术(北京)有限公司 The efficient communication among calculate node for operating automatic driving vehicle
CN107493191A (en) * 2017-08-08 2017-12-19 深信服科技股份有限公司 A kind of clustered node and self scheduling container group system
CN109151043A (en) * 2018-09-06 2019-01-04 北京赛佰特科技有限公司 Message delivery system based on cloud service

Also Published As

Publication number Publication date
CN110034927A (en) 2019-07-19

Similar Documents

Publication Publication Date Title
CN110445614B (en) Certificate application method and device, terminal equipment, gateway equipment and server
JP4603043B2 (en) Method for transmitting sync ML synchronization data
EP2326047B1 (en) Method and system for terminal configuration and management
EP3537652B1 (en) Method for securely controlling smart home appliance and terminal device
CN109359472B (en) Data encryption and decryption processing method and device and related equipment
CN108449357B (en) Authorized login method and device, intelligent device and storage medium
CN110213247B (en) Method and system for improving safety of pushed information
CN114338844B (en) Cross-protocol communication method and device between client servers
US9648650B2 (en) Pairing of devices through separate networks
CN109995739B (en) Information transmission method, client, server and storage medium
CN113452660B (en) Communication method of mesh network and cloud server, mesh network system and node device thereof
CN104836784A (en) Information processing method, client, and server
CN111953716B (en) Message communication method, system, computer device and storage medium
CN113613227B (en) Data transmission method and device of Bluetooth equipment, storage medium and electronic device
CN111885091B (en) Secure communication method, device, equipment and storage medium
CN110034927B (en) Communication method and device
CN114499836A (en) Key management method, key management device, computer equipment and readable storage medium
CN111787514B (en) Method and device for acquiring equipment control data, storage medium and electronic device
CN108513272B (en) Short message processing method and device
CN113163399A (en) Communication method and device of terminal and server
CN114338132B (en) Secret-free login method, client application, operator server and electronic equipment
KR20170051415A (en) Local information acquisition method, apparatus and system
CN110830243B (en) Symmetric key distribution method, device, vehicle and storage medium
KR100925636B1 (en) The networking method between non-pc device and server for providing the application services
CN112087745A (en) Network distribution method and device of household appliance, electronic device and storage medium

Legal Events

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

Effective date of registration: 20200925

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200925

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant