CN111416846A - Communication method, system, server and storage medium - Google Patents

Communication method, system, server and storage medium Download PDF

Info

Publication number
CN111416846A
CN111416846A CN202010170950.4A CN202010170950A CN111416846A CN 111416846 A CN111416846 A CN 111416846A CN 202010170950 A CN202010170950 A CN 202010170950A CN 111416846 A CN111416846 A CN 111416846A
Authority
CN
China
Prior art keywords
subsystem
request
communication
response
request message
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.)
Granted
Application number
CN202010170950.4A
Other languages
Chinese (zh)
Other versions
CN111416846B (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 CN202010170950.4A priority Critical patent/CN111416846B/en
Publication of CN111416846A publication Critical patent/CN111416846A/en
Application granted granted Critical
Publication of CN111416846B publication Critical patent/CN111416846B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a communication method, a system, a server and a storage medium, which are applied to a micro-service architecture, wherein the micro-service architecture comprises a request subsystem, a relay subsystem and a response subsystem, the request message sent by a user based on the request subsystem is received through the relay subsystem, and first notification information is sent to the response subsystem indicated by a communication ID based on the communication ID carried by the request message; after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes corresponding operation based on the request information to obtain a response result, returns the response result to the transit subsystem, and sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request information; and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the middle rotor system. Based on the invention, the purpose of communicating each subsystem in the micro-service architecture to form a complete request chain can be realized.

Description

Communication method, system, server and storage medium
Technical Field
The invention relates to the new technical field of application and service deployment in cloud, in particular to a communication method, a communication system, a server and a storage medium.
Background
With the continuous development of new technologies for deploying applications and services in the cloud, the application of micro-service architecture developed by the new technologies for deploying applications and services in the application cloud is more and more extensive. The micro-service architecture divides the system into separate subsystems by decoupling the system, and each subsystem is responsible for a specific function.
In order to make good use of the subsystems in the microservice architecture, the subsystems in the microservice architecture may be communicated to form a complete request chain. However, there is currently no efficient way to establish communication among the subsystems in the microservice architecture to form a complete request chain.
Disclosure of Invention
In view of this, embodiments of the present invention provide a communication method and apparatus, so as to implement the purpose of communicating subsystems in a microservice architecture to form a complete request chain.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
the invention discloses a communication method in a first aspect, which is applied to a micro-service architecture, wherein the micro-service architecture comprises a request subsystem, a transfer subsystem and a response subsystem, and the method comprises the following steps:
the transit subsystem receives a request message sent by a user based on the request subsystem, wherein the request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID;
the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID;
after receiving the first notification information, the response subsystem acquires the request message from the transit subsystem, executes corresponding operation based on the request message to obtain a response result, returns the response result to the transit subsystem, and sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request message;
and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the transit subsystem.
Optionally, the request message further carries first authentication information, where the first authentication information includes an identity of the requesting subsystem and a first key, and the method further includes:
the relay subsystem acquires second identity authentication information corresponding to the identity identifier of the request subsystem in the first identity authentication information based on a preset corresponding relationship between the identity identifier of the request subsystem and the second identity authentication information, wherein the second identity authentication information comprises a second secret key;
the middle rotor system judges whether the first secret key is consistent with the second secret key;
if the first secret key is inconsistent with the second secret key, the transit subsystem intercepts the request message;
correspondingly, the middle rotor system sends first notification information to the response subsystem indicated by the communication ID based on the communication ID, and the first notification information comprises: and if the first secret key is consistent with the second secret key, the central subsystem sends first notification information to a response subsystem indicated by the communication ID based on the communication ID.
Optionally, the method further includes:
the transit subsystem determines a request subsystem corresponding to the IP address carried in the request message based on the request message;
the middle rotor system judges whether the request subsystem corresponding to the IP address is located in a preset third identity authentication information request subsystem or not;
if the request subsystem corresponding to the IP address is the request subsystem located in the third identity authentication information, the relay subsystem intercepts the request message;
correspondingly, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID, and the first notification information comprises:
and if the request subsystem corresponding to the IP address is not the request subsystem in the third identity authentication information, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID.
Optionally, the method further includes:
the transit subsystem determines a request subsystem corresponding to the IP address carried in the request message based on the request message;
the middle rotor system judges whether the request subsystem corresponding to the IP address is located in a preset third identity authentication information request subsystem or not;
if the request subsystem corresponding to the IP address is the request subsystem located in the third identity authentication information, the relay subsystem intercepts the request message;
correspondingly, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID, and the first notification information comprises:
and if the request subsystem corresponding to the IP address is not the request subsystem in the third identity authentication information, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID.
Optionally, before the requesting subsystem sends the request message to the transit subsystem, the method further includes:
and the request subsystem assembles the request sent by the user based on a preset standard protocol, generates and stores a request message in accordance with the standard protocol, wherein the request message carries a communication ID.
The second aspect of the present invention discloses a communication system, which is applied to a micro-service architecture, wherein the micro-service architecture comprises a request subsystem, a transfer subsystem and a response subsystem, and the device comprises:
the transit subsystem is used for receiving a request message sent by a user based on the request subsystem and sending first notification information to a response subsystem indicated by the communication ID based on the communication ID; the request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID;
the response subsystem is used for acquiring the request message from the transit subsystem after receiving the first notification message, executing corresponding operation based on the request message to obtain a response result, returning the response result to the transit subsystem, and sending second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request message;
and the request subsystem is used for acquiring a corresponding response result from the transit subsystem after receiving the second notification information.
Optionally, the request message further carries first authentication information, where the first authentication information includes an identity of the requesting subsystem and a first secret key, and the apparatus further includes:
the acquiring unit is used for acquiring second identity authentication information corresponding to the identity identifier of the requesting subsystem in the first identity authentication information by the middle rotor system based on a preset corresponding relation between the identity identifier of the requesting subsystem and the second identity authentication information, wherein the second identity authentication information comprises a second secret key;
the first judging unit is used for judging whether the first secret key is consistent with the second secret key or not by the middle rotor system;
correspondingly, the relay subsystem is further configured to send, by the relay subsystem, first notification information to the response subsystem indicated by the communication ID based on the communication ID if the first secret key is consistent with the second secret key.
Optionally, the system further includes:
a first determining unit, configured to determine, by the transit subsystem, a request subsystem corresponding to the IP address carried in the request message based on the request message;
the second judging unit is used for judging whether the request subsystem corresponding to the IP address is located in a preset third identity authentication information request subsystem by the middle rotor system;
the first intercepting unit is configured to intercept the request message by the transit subsystem if the request subsystem corresponding to the IP address is a request subsystem located in the third authentication information;
correspondingly, the transit subsystem is further configured to send, if the request subsystem corresponding to the IP address is not the request subsystem located in the third authentication information, the transit subsystem to the response subsystem indicated by the communication ID based on the communication ID, the first notification information.
A third aspect of the present invention discloses a server, comprising: at least one memory and at least one processor; the memory stores a program, and the processor invokes the program stored in the memory, the program being for implementing the communication method as disclosed in any one of the first aspects of the present invention.
A fourth aspect of the present invention discloses a storage medium having stored therein computer-executable instructions for performing a communication method as disclosed in any one of the first aspects of the present invention above.
The embodiment of the invention provides a communication method, a communication system, a server and a storage medium, which are applied to a micro-service architecture, wherein the micro-service architecture comprises a request subsystem, a transfer subsystem and a response subsystem, and when a rotor system receives a request message sent by a user based on the request subsystem, the rotor system sends first notification information to the response subsystem indicated by a communication ID based on the communication ID carried in the request message; after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes a corresponding operation response result based on the request information, returns the response result to the transfer subsystem, and simultaneously sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request information; so that the requesting subsystem can obtain the corresponding result from the middle rotor system after receiving the second notification message. According to the technical scheme provided by the invention, the relay subsystem is used as a communication main body, so that the coupling between the system and the system is further reduced, and the purpose of communicating each subsystem in the micro-service architecture to form a complete request chain is further realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart illustrating a communication method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another communication method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another communication method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating another communication method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a communication system according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
As shown in fig. 1, an embodiment of the present invention provides a flowchart of a communication method, where the communication method is applied to a micro service architecture, where the micro service architecture includes a request subsystem, a relay subsystem, and a response system, and the communication method includes:
s101: the middle rotor system receives a request message sent by a user based on a request subsystem, wherein the request message carries a communication ID and an IP address of the request subsystem.
In the embodiment of the application, a standard protocol is preset, when a request subsystem receives a request sent by a user, the request is assembled based on the preset standard protocol to generate a request message meeting the standard protocol, and the generated request is sent to a transit subsystem. The request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID.
The preset standard protocol may be a TCP/IP protocol, SOCKET, HTTP, or the like. The inventor can set the standard protocol according to his own needs, and the embodiment of the present application is not limited thereto.
Further, the communication ID carried by the request message may also be used to identify the request message. The request subsystem assembles the request for sending based on a preset standard protocol, generates a request message in accordance with the standard protocol, identifies the request message by using the communication ID carried in the request message, and stores the identified request message.
Because the single request of the user can involve layer-by-layer switching of a plurality of subsystems, after the request subsystem assembles the single request by using a preset standard protocol to generate a request message in accordance with the standard protocol, the request message is identified and stored by using a communication ID carried by the request message, a log chain function can be realized, and further the request messages without correlation are closely combined.
S102: the middle rotor system sends first notification information to the response subsystem indicated by the communication ID based on the communication ID.
In the embodiment of the application, after receiving a request message sent by a user based on a request subsystem, a relay subsystem sends first notification information to a response subsystem indicated by a communication ID based on the communication ID carried by the request message, so that the response subsystem obtains a corresponding request message from the relay subsystem after receiving the first notification information.
S103: and after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes corresponding operation based on the request information to obtain a response result, returns the response result to the transit subsystem, and responds to the request subsystem corresponding to the IP address based on the IP address carried in the request information to send second notification information.
In the embodiment of the application, when the response subsystem receives the first notification message, the response subsystem acquires a corresponding request message from the middle rotor system, executes a corresponding operation according to the acquired request message to obtain a response result, and returns the response result to the middle rotor system. And after the response subsystem executes corresponding operation according to the request message to obtain a response result, the response result is returned to the relay subsystem, and meanwhile, second notification information is sent to the request subsystem to notify the request subsystem that the corresponding operation is completed, and the response result is sent to the relay subsystem, so that the request subsystem can obtain the corresponding response result from the middle rotor system in time.
S104: and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the middle rotor system.
In the embodiment of the application, when the requesting subsystem receives the second notification information, it indicates that the responding subsystem has completed the corresponding operation according to the request message sent by the requesting subsystem, and returns the obtained response result to the relay subsystem, and the requesting subsystem obtains the corresponding response result from the relay subsystem.
Further, in the embodiment of the present application, the micro service architecture includes a relay subsystem and a plurality of subsystems, and interfaces of the subsystems can be registered in a communication layer of the relay subsystem to form an interface group, that is, an interface micro service.
The communication method provided by the embodiment of the invention is applied to a micro-service architecture, the micro-service architecture comprises a request subsystem, a transfer subsystem and a response subsystem, and when a central rotor system receives a request message sent by a user based on the request subsystem, a first notification message is sent to the response subsystem indicated by a communication ID based on the communication ID carried in the request message; after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes a corresponding operation response result based on the request information, returns the response result to the transfer subsystem, and simultaneously sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request information; so that the requesting subsystem can obtain the corresponding result from the middle rotor system after receiving the second notification message. According to the technical scheme provided by the invention, the relay subsystem is used as a communication main body, so that the coupling between the system and the system is further reduced, and the purpose of communicating each subsystem in the micro-service architecture to form a complete request chain is further realized.
Further, the request message also carries first authentication information, where the first authentication information includes an identity of the requesting subsystem and a first secret key, and fig. 2 shows a flow diagram of another communication method provided in the embodiment of the present invention, which specifically includes the following steps:
s201: the middle rotor system receives a request message sent by a user based on a request subsystem, wherein the request message carries a communication ID, an IP address of the request subsystem and first identity verification information.
In the embodiment of the application, a standard protocol is preset, when a request subsystem receives a request sent by a user, the request is assembled based on the preset standard protocol to generate a request message meeting the standard protocol, and the generated request is sent to a transit subsystem. The request message carries a communication ID, an IP address of a request subsystem and first authentication information, the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID, and the first authentication information comprises an identity of the request subsystem sending the request message and a first secret key.
It should be noted that the first secret key may be 12345, 345675, etc. The invention may be configured according to its own requirements, and the embodiments of the present application are not limited thereto.
S202: the relay subsystem acquires second authentication information corresponding to the identity of the requesting subsystem in the first authentication information based on a preset corresponding relationship between the identity of the requesting subsystem and the second authentication information, wherein the second authentication information comprises a second secret key.
In the embodiment of the application, the corresponding relationship between the identity of each requesting subsystem and the second authentication information is set in the transit subsystem in advance. When the central rotor system receives the request message, second identity authentication information corresponding to the identity identifier in the first identity authentication information carried by the request message is obtained according to the preset corresponding relation between the identity identifier of the request subsystem and the second identity authentication information.
S203: the middle rotor system judges whether the first secret key is consistent with the second secret key; if the first secret key and the second secret key are not consistent, go to step S204; if the first secret key and the second secret key are consistent, step S205 is performed.
In the process of specifically executing step S203, after acquiring second authentication information corresponding to the identity identifier in the first authentication information carried in the request message, the middle rotor system determines whether a second secret key in the second authentication information is consistent with a first secret key in the first authentication information carried in the request message, and if so, sends first notification information to the response subsystem indicated by the communication ID based on the communication ID; and if the request message is inconsistent with the request message, intercepting the request message.
S204: the relay subsystem intercepts the request message.
In the embodiment of the application, when the central subsystem judges that the first secret key and the second secret key in the first authentication information carried by the request message are inconsistent, the authentication failure of the request subsystem sending the request message is indicated, the request message is intercepted, and unnecessary request message forwarding is avoided.
S205: the middle rotor system sends first notification information to the response subsystem indicated by the communication ID based on the communication ID.
S206: and after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes corresponding operation based on the request information to obtain a response result, returns the response result to the transit subsystem, and responds to the request subsystem corresponding to the IP address based on the IP address carried in the request information to send second notification information.
S207: and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the middle rotor system.
In the process of specifically executing step S205 and step S207, the specific execution process and implementation principle of step S205 to step S207 are the same as the specific execution process and implementation principle of step S102 to step S104 disclosed in fig. 1, and reference may be made to corresponding parts in fig. 1, which is not described herein again.
In the embodiment of the application, the corresponding relationship between the identity of each requesting subsystem and the second authentication information is preset in the relay subsystem, and then whether the request message needs to be intercepted or not is determined by judging whether a first secret key in the first authentication information carried in the request message is consistent with a second secret key in the second authentication information corresponding to the identity in the first authentication information, so that unnecessary message forwarding interception can be realized.
Further, referring to fig. 3, another communication method provided in the embodiment of the present invention is shown, which specifically includes the following steps:
s301: the middle rotor system receives a request message sent by a user based on a request subsystem, wherein the request message carries a communication ID and an IP address of the request subsystem.
In the process of specifically executing step S301, the specific execution process and implementation principle of step S301 are the same as those of step S101 disclosed in fig. 1, and reference may be made to corresponding parts in fig. 1, which is not described herein again.
S302: and the relay subsystem determines a request subsystem corresponding to the IP address carried in the request message based on the request message.
In the process of specifically executing step S302, after the middle rotor system receives the request message sent by the user through the request subsystem, the request subsystem corresponding to the IP address is determined according to the IP address carried in the request message.
S303: the middle rotor system judges whether the request subsystem corresponding to the IP address is located in a preset third identity authentication information request subsystem or not; if the requesting subsystem corresponding to the IP address is the requesting subsystem located in the third authentication information, go to step S304; if the requesting subsystem corresponding to the IP address is not the requesting subsystem located in the third authentication information, step S305 is executed.
In this embodiment of the application, third authentication information is set in the transit subsystem in advance, where the third authentication information includes a plurality of request subsystems, and the third authentication information is used to indicate that a request message sent to a request subsystem located in the third authentication information is intercepted.
In the process of specifically executing step S303, when the central subsystem determines the request subsystem corresponding to the IP address according to the IP address carried in the request message, it is determined whether the determined request subsystem is the request subsystem located in the third authentication information; if the request subsystem corresponding to the IP address is the request subsystem located in the third identity authentication information, the middle rotor system intercepts the request message; and if the request subsystem corresponding to the IP address is not the request subsystem in the third authentication information, sending first notification information to a response subsystem indicated by the communication ID based on the communication ID.
S304: the relay subsystem intercepts the request message.
In the embodiment of the present application, if the requesting subsystem corresponding to the IP address is the requesting subsystem located in the third authentication information, it indicates that the requesting subsystem sending the request message fails in authentication, and intercepts the request message, thereby avoiding forwarding of unnecessary request messages.
S305: the middle rotor system sends first notification information to the response subsystem indicated by the communication ID based on the communication ID.
S306: and after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes corresponding operation based on the request information to obtain a response result, returns the response result to the transit subsystem, and responds to the request subsystem corresponding to the IP address based on the IP address carried in the request information to send second notification information.
S307: and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the middle rotor system.
In the process of specifically executing step S305 and step S307, the specific execution process and implementation principle of step S305 to step S307 are the same as the specific execution process and implementation principle of step S102 to step S104 disclosed in fig. 1, and reference may be made to corresponding parts in fig. 1, which is not described herein again.
In the embodiment of the application, whether the request message needs to be intercepted is determined by judging whether the request subsystem corresponding to the IP address carried in the request message is the request subsystem located in the third authentication information, so that unnecessary message forwarding can be intercepted.
Further, referring to fig. 4, a flowchart of another communication method provided in the embodiment of the present invention is shown, which specifically includes the following steps:
s401: the middle rotor system receives a request message sent by a user based on a request subsystem, wherein the request message carries a communication ID and an IP address of the request subsystem.
In the process of specifically executing step S401, the specific execution process and implementation principle of step S401 are the same as the specific execution process and implementation principle of step S101 disclosed in fig. 1, and reference may be made to corresponding parts in fig. 1, which is not described herein again.
S402: and the relay subsystem determines a response subsystem corresponding to the communication ID carried in the request message based on the request message.
In the process of specifically executing step S402, after the middle rotor system receives the request message sent by the user through the request subsystem, the response subsystem corresponding to the communication ID is determined according to the communication ID carried in the request message.
S403: the middle rotor system judges whether preset message conversion information corresponding to the response subsystem exists or not; if the preset message conversion information corresponding to the response subsystem exists, executing step S404; if there is no preset message conversion information corresponding to the responding subsystem, step S405 is executed.
In the process of specifically executing step S403, after determining the response subsystem corresponding to the communication ID according to the communication ID carried in the request message, it is determined whether there is preset message conversion information corresponding to the response subsystem, and if there is preset message conversion information corresponding to the response subsystem, a first notification message is sent to the response subsystem indicated by the message conversion cancellation; and if the preset message conversion information corresponding to the response subsystem does not exist, sending first notification information to the response subsystem indicated by the communication ID based on the communication ID.
In the embodiment of the present application, the micro service architecture includes a relay subsystem and a plurality of subsystems, and any one of the subsystems can be used as a request subsystem or a response subsystem; and, there are subsystems with the same or similar functions in these subsystems, and for each subsystem with the same or similar function, when the subsystem is taken as a response subsystem, the message conversion information related to the response subsystem may be set in advance in the relay subsystem, and the first notification information sent to the response subsystem is forwarded to the response subsystem indicated by the message conversion information related to the response subsystem set in advance, so that the response subsystem indicated by the message conversion information processes the request message.
In the embodiment of the present application, the message conversion information may be an IP address. The inventor can set the message conversion information according to his own needs, and the embodiment of the present application is not limited thereto.
It should be noted that the functions of the subsystems in the microservice architecture are defined by the standard protocols corresponding to the subsystems. For example, the subsystems with the same function may be an AD domain of windows and an ldap domain of linux, both of which conform to the ldap protocol, and both of which may implement a user authentication function.
S404: and sending the first notification information to a response subsystem indicated by the message conversion cancellation.
In the embodiment of the application, if the preset message conversion information corresponding to the response subsystem exists, the first notification information is sent to the response subsystem indicated by the message conversion cancellation, so that the response subsystem can conveniently acquire the corresponding request message from the middle rotor system and perform corresponding operation.
S405: the middle rotor system sends first notification information to the response subsystem indicated by the communication ID based on the communication ID.
S406: and after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes corresponding operation based on the request information to obtain a response result, returns the response result to the transit subsystem, and responds to the request subsystem corresponding to the IP address based on the IP address carried in the request information to send second notification information.
S407: and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the middle rotor system.
In the process of specifically executing step S405 and step 407, the specific execution process and implementation principle of step S405 to step S407 are the same as the specific execution process and implementation principle of step S102 to step S104 disclosed in fig. 1, and reference may be made to corresponding parts in fig. 1, which is not described herein again.
In the embodiment of the application, the relay subsystem determines the response subsystem corresponding to the communication ID according to the communication ID carried by the request message, and further determines whether preset message conversion information corresponding to the response subsystem exists, and if the preset message conversion information corresponding to the response subsystem exists, sends the first notification information to the response subsystem indicated by the message conversion cancellation, so as to implement the function of message forwarding.
Corresponding to the communication method provided by the above embodiment of the present invention, as shown in fig. 5, the embodiment of the present invention further provides a schematic structural diagram of a communication system. The communication system includes:
the middle rotor system 51 is used for receiving a request message sent by a user based on a request subsystem and sending first notification information to a response subsystem indicated by a communication ID based on the communication ID; the request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID;
the response subsystem 52 is configured to, after receiving the first notification information, acquire a request message from the relay subsystem, perform corresponding operation based on the request message to obtain a response result, return the response result to the relay subsystem, and send second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request message;
and the request subsystem 53 is used for acquiring a corresponding response result from the middle rotor system after receiving the second notification information.
The specific principle and the implementation process of each unit in the communication system disclosed in the above embodiment of the present invention are the same as those of the communication method disclosed in the above embodiment of the present invention, and reference may be made to corresponding parts in the communication method disclosed in the above embodiment of the present invention, which are not described herein again.
In the communication system provided in the embodiment of the present invention, when the central subsystem receives a request message sent by a user based on a request subsystem, a first notification message is sent to a response subsystem indicated by a communication ID based on the communication ID carried in the request message; after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes a corresponding operation response result based on the request information, returns the response result to the transfer subsystem, and simultaneously sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request information; so that the requesting subsystem can obtain the corresponding result from the middle rotor system after receiving the second notification message. According to the technical scheme provided by the invention, the relay subsystem is used as a communication main body, so that the coupling between the system and the system is further reduced, and the purpose of communicating each subsystem in the micro-service architecture to form a complete request chain is further realized.
Further, the request message also carries first authentication information, where the first authentication information includes an identity identifier and a first key of the requesting subsystem, and the communication system provided in this embodiment further includes:
the obtaining unit is used for the transit subsystem to obtain second identity authentication information corresponding to the identity identifier of the request subsystem in the first identity authentication information based on a preset corresponding relation between the identity identifier of the request subsystem and the second identity authentication information, wherein the second identity authentication information comprises a second secret key;
the first judging unit is used for judging whether the first secret key is consistent with the second secret key by the transfer subsystem;
correspondingly, the relay subsystem is further configured to send the first notification information to the response subsystem indicated by the communication ID based on the communication ID if the first secret key is consistent with the second secret key.
Further, the communication system provided in the embodiment of the present application further includes:
the first determining unit is used for determining the request subsystem corresponding to the IP address carried in the request message by the transit subsystem based on the request message;
the second judgment unit is used for judging whether the request subsystem corresponding to the IP address is located in the preset third identity authentication information by the middle rotor system;
the first interception unit is used for intercepting the request message by the middle rotor system if the request subsystem corresponding to the IP address is the request subsystem in the third identity authentication information;
correspondingly, the relay subsystem is further configured to send the first notification information to the response subsystem indicated by the communication ID based on the communication ID if the request subsystem corresponding to the IP address is not the request subsystem located in the third authentication information.
Further, the communication system provided in the embodiment of the present application further includes:
a second determining unit, configured to determine, by the relay subsystem, a response subsystem corresponding to the communication ID carried in the request message based on the request message;
the third judging unit is used for judging whether preset message conversion information corresponding to the response subsystem exists in the middle rotor system;
the sending unit is used for sending first notification information to a response subsystem indicated by the message conversion information if the message conversion information exists;
correspondingly, the relay subsystem is also used for sending the first notification information to the response subsystem indicated by the communication ID based on the communication ID if the message conversion information does not exist.
Further, the communication system provided in the embodiment of the present application further includes:
and the request message generating unit is used for requesting the subsystem to assemble the request sent by the user based on a preset standard protocol, generating and storing the request message which conforms to the standard protocol, wherein the request message carries the communication ID.
The following describes in detail a hardware structure of a server to which the communication method provided in the embodiment of the present application is applied, by taking the application of the communication method to the server as an example.
The communication method provided by the embodiment of the application can be applied to a server, and the server can be a service device which provides service for a user on a network side, can be a server cluster formed by a plurality of servers, and can also be a single server.
Optionally, fig. 6 shows a block diagram of a hardware structure of a server to which the communication method provided in the embodiment of the present application is applied, and referring to fig. 6, the hardware structure of the server may include: a processor 61, a memory 62, a communication interface 63 and a communication bus 64;
in the embodiment of the present invention, the number of the processor 61, the memory 62, the communication interface 63, and the communication bus 64 may be at least one, and the processor 61, the memory 62, and the communication interface 63 complete mutual communication through the communication bus 64;
the processor 61 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;
the memory 62 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory stores a program, the processor may invoke the program stored in the memory, and the program is operable to:
the middle rotor system receives a request message sent by a user based on a request subsystem, wherein the request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID;
the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID;
after receiving the first notification information, the response subsystem acquires the request information from the middle rotor system, executes corresponding operation based on the request information to obtain a response result, returns the response result to the transit subsystem, and sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request information;
and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the middle rotor system.
For the functions of the program, reference may be made to the above detailed description of a communication method provided in the embodiments of the present application, which is not described herein again.
Further, an embodiment of the present application also provides a computer-readable computer storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are used for executing the communication method.
For the details of the computer executable instructions, reference may be made to the above detailed description of a communication method provided in the embodiments of the present application, which is not repeated herein.
The above detailed description of a communication method, apparatus, server and storage medium provided by the present invention, and the specific examples applied herein have been described to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understand the method and core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include or include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A communication method applied to a micro service architecture, the micro service architecture comprising a request subsystem, a relay subsystem and a response subsystem, the method comprising:
the transit subsystem receives a request message sent by a user based on the request subsystem, wherein the request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID;
the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID;
after receiving the first notification information, the response subsystem acquires the request message from the transit subsystem, executes corresponding operation based on the request message to obtain a response result, returns the response result to the transit subsystem, and sends second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request message;
and after receiving the second notification information, the requesting subsystem acquires a corresponding response result from the transit subsystem.
2. The method of claim 1, wherein the request message further carries first authentication information, the first authentication information comprising an identity of the requesting subsystem and a first key, the method further comprising:
the relay subsystem acquires second identity authentication information corresponding to the identity identifier of the request subsystem in the first identity authentication information based on a preset corresponding relationship between the identity identifier of the request subsystem and the second identity authentication information, wherein the second identity authentication information comprises a second secret key;
the middle rotor system judges whether the first secret key is consistent with the second secret key;
if the first secret key is inconsistent with the second secret key, the transit subsystem intercepts the request message;
correspondingly, the middle rotor system sends first notification information to the response subsystem indicated by the communication ID based on the communication ID, and the first notification information comprises: and if the first secret key is consistent with the second secret key, the central subsystem sends first notification information to a response subsystem indicated by the communication ID based on the communication ID.
3. The method of claim 1, further comprising:
the transit subsystem determines a request subsystem corresponding to the IP address carried in the request message based on the request message;
the middle rotor system judges whether the request subsystem corresponding to the IP address is located in a preset third identity authentication information request subsystem or not;
if the request subsystem corresponding to the IP address is the request subsystem located in the third identity authentication information, the relay subsystem intercepts the request message;
correspondingly, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID, and the first notification information comprises:
and if the request subsystem corresponding to the IP address is not the request subsystem in the third identity authentication information, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID.
4. The method of claim 1, further comprising:
the transit subsystem determines a response subsystem corresponding to the communication ID carried in the request message based on the request message;
the middle rotor system judges whether preset message conversion information corresponding to the response subsystem exists or not;
if the message conversion information exists, first notification information is sent to a response subsystem indicated by the message conversion information;
correspondingly, the middle rotor system sends first notification information to a response subsystem indicated by the communication ID based on the communication ID, and the first notification information comprises:
and if the message conversion information does not exist, the relay subsystem sends first notification information to a response subsystem indicated by the communication ID based on the communication ID.
5. The method of claim 1, wherein before the requesting subsystem sends the request message to the transit subsystem, the method further comprises:
and the request subsystem assembles the request sent by the user based on a preset standard protocol, generates and stores a request message in accordance with the standard protocol, wherein the request message carries a communication ID.
6. A communication system, applied to a micro service architecture including a request subsystem, a relay subsystem and a response subsystem, the apparatus comprising:
the transit subsystem is used for receiving a request message sent by a user based on the request subsystem and sending first notification information to a response subsystem indicated by the communication ID based on the communication ID; the request message carries a communication ID and an IP address of the request subsystem, and the communication ID is used for indicating that the request message is sent to a response subsystem indicated by the communication ID;
the response subsystem is used for acquiring the request message from the transit subsystem after receiving the first notification message, executing corresponding operation based on the request message to obtain a response result, returning the response result to the transit subsystem, and sending second notification information to the request subsystem corresponding to the IP address based on the IP address carried in the request message;
and the request subsystem is used for acquiring a corresponding response result from the transit subsystem after receiving the second notification information.
7. The system of claim 6, wherein the request message further carries first authentication information, the first authentication information comprising an identity of the requesting subsystem and a first secret key, the apparatus further comprising:
the acquiring unit is used for acquiring second identity authentication information corresponding to the identity identifier of the requesting subsystem in the first identity authentication information by the middle rotor system based on a preset corresponding relation between the identity identifier of the requesting subsystem and the second identity authentication information, wherein the second identity authentication information comprises a second secret key;
the first judging unit is used for judging whether the first secret key is consistent with the second secret key or not by the middle rotor system;
correspondingly, the relay subsystem is further configured to send, by the relay subsystem, first notification information to the response subsystem indicated by the communication ID based on the communication ID if the first secret key is consistent with the second secret key.
8. The system of claim 6, further comprising:
a first determining unit, configured to determine, by the transit subsystem, a request subsystem corresponding to the IP address carried in the request message based on the request message;
the second judging unit is used for judging whether the request subsystem corresponding to the IP address is located in a preset third identity authentication information request subsystem by the middle rotor system;
the first intercepting unit is configured to intercept the request message by the transit subsystem if the request subsystem corresponding to the IP address is a request subsystem located in the third authentication information;
correspondingly, the transit subsystem is further configured to send, if the request subsystem corresponding to the IP address is not the request subsystem located in the third authentication information, the transit subsystem to the response subsystem indicated by the communication ID based on the communication ID, the first notification information.
9. A server, comprising: at least one memory and at least one processor; the memory stores a program that the processor calls, the processor calls the program stored in the memory, the program being for implementing the communication method according to any one of claims 1 to 5.
10. A computer-readable storage medium having computer-executable instructions stored therein for performing the communication method of any one of claims 1-5.
CN202010170950.4A 2020-03-12 2020-03-12 Communication method, system, server and storage medium Active CN111416846B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010170950.4A CN111416846B (en) 2020-03-12 2020-03-12 Communication method, system, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010170950.4A CN111416846B (en) 2020-03-12 2020-03-12 Communication method, system, server and storage medium

Publications (2)

Publication Number Publication Date
CN111416846A true CN111416846A (en) 2020-07-14
CN111416846B CN111416846B (en) 2022-12-30

Family

ID=71494370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010170950.4A Active CN111416846B (en) 2020-03-12 2020-03-12 Communication method, system, server and storage medium

Country Status (1)

Country Link
CN (1) CN111416846B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726836A (en) * 2020-11-16 2021-11-30 北京沃东天骏信息技术有限公司 Information response method, device, equipment and computer readable medium
CN116074388A (en) * 2023-03-28 2023-05-05 武汉卓鹰世纪科技有限公司 Flow forwarding method and system based on log queue

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016188290A1 (en) * 2015-05-27 2016-12-01 阿里巴巴集团控股有限公司 Safety authentication method, device and system for api calling
CN108255614A (en) * 2016-12-28 2018-07-06 中国移动通信集团公司 A kind of interface calling system and method based on micro services framework
CN110740103A (en) * 2019-09-02 2020-01-31 深圳壹账通智能科技有限公司 Service request processing method and device, computer equipment and storage medium
CN110825539A (en) * 2019-11-07 2020-02-21 中国联合网络通信集团有限公司 Service processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016188290A1 (en) * 2015-05-27 2016-12-01 阿里巴巴集团控股有限公司 Safety authentication method, device and system for api calling
CN108255614A (en) * 2016-12-28 2018-07-06 中国移动通信集团公司 A kind of interface calling system and method based on micro services framework
CN110740103A (en) * 2019-09-02 2020-01-31 深圳壹账通智能科技有限公司 Service request processing method and device, computer equipment and storage medium
CN110825539A (en) * 2019-11-07 2020-02-21 中国联合网络通信集团有限公司 Service processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726836A (en) * 2020-11-16 2021-11-30 北京沃东天骏信息技术有限公司 Information response method, device, equipment and computer readable medium
CN116074388A (en) * 2023-03-28 2023-05-05 武汉卓鹰世纪科技有限公司 Flow forwarding method and system based on log queue

Also Published As

Publication number Publication date
CN111416846B (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN109618005B (en) Method for calling server and proxy server
EP3678358B1 (en) Api hybrid multi-tenant routing method, system, and api gateway
WO2016184266A1 (en) Early warning method and device, and processing server
CN111416846B (en) Communication method, system, server and storage medium
EP3413537B1 (en) Method of transmitting information and core network access apparatus
CN107204873B (en) Method for switching target domain name resolution server and related equipment
CN111259072B (en) Data synchronization method, device, electronic equipment and computer readable storage medium
WO2015113234A1 (en) Network function virtualization method and device
AU2014410591B2 (en) Connection establishment method, device, and system
CN101848107B (en) SNMP (Simple Network Management Protocol) network element and communication method of SNMP network element and proprietary protocol network element
CN109842895B (en) Network reliability configuration method, information transmission method, device and system
CN105429839A (en) Virtualized network function VNF optimization method, device and system
CN109120614B (en) Service processing method and device based on distributed system
CN112104640B (en) Data processing method, device and equipment of gateway and readable storage medium
CN114338063B (en) Message queue system, service processing method and computer readable storage medium
CN111507714B (en) Verification method, verification device, server and storage medium
CN106970843B (en) Remote calling method and device
CN103795581A (en) Address processing method and address processing device
CN101873330A (en) Access control method and server for supporting IPv6/IPv4 dual stack access
JP6036380B2 (en) Communications system
CN113452803B (en) Verification method, verification device, server and storage medium
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN111064819B (en) Address backup method and device
CN114553967A (en) Calling method and related device between micro services
CN116414819A (en) Data interaction method and device of cloud platform system and electronic equipment

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
GR01 Patent grant
GR01 Patent grant