CN112804329A - Message relay and interaction method, and corresponding device, equipment and medium - Google Patents

Message relay and interaction method, and corresponding device, equipment and medium Download PDF

Info

Publication number
CN112804329A
CN112804329A CN202110043491.8A CN202110043491A CN112804329A CN 112804329 A CN112804329 A CN 112804329A CN 202110043491 A CN202110043491 A CN 202110043491A CN 112804329 A CN112804329 A CN 112804329A
Authority
CN
China
Prior art keywords
message
foreground
gateway
middle station
consumed
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.)
Pending
Application number
CN202110043491.8A
Other languages
Chinese (zh)
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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network 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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN202110043491.8A priority Critical patent/CN112804329A/en
Publication of CN112804329A publication Critical patent/CN112804329A/en
Pending legal-status Critical Current

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/55Push-based network services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • 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
    • H04L67/562Brokering proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a message relay and interaction method, and a corresponding device, equipment and medium, wherein the method comprises the following steps: acquiring a first message sent to a target foreground by a first sending interface called by a middle station from the first sending interface, and storing the first message; searching a service interface preregistered by the target foreground in the local machine, pushing the first message to the service interface, and marking that the first message is consumed after the first message is consumed by the target foreground; acquiring a second message sent to the middle station by any foreground from a second sending interface called by the foreground, and analyzing a source foreground to which a corresponding message source belongs; and pushing a second message to the middle station by associating the second message with the source foreground so as to be consumed by the middle station and mark that the second message is consumed. The gateway realizes message interaction between the foreground and the middle station and provides high-adaptability and light-weight information relay service capability for the middle station and the foreground.

Description

Message relay and interaction method, and corresponding device, equipment and medium
Technical Field
The application belongs to the technical field of internet, and particularly relates to a method for executing condition matching of an intermediate component, and a corresponding device, electronic equipment and a nonvolatile storage medium thereof.
Background
In the development process of e-commerce platforms, the design concept of large, medium and small foreground gradually becomes mainstream, in order to solve some service scenarios, such as user score change, an asynchronous notification mechanism to message middleware needs to be used, and the currently common solution is: the foreground and the middle station share one message service, then the message informing party registers the message producer, and the message informed party registers the message consumer, thereby completing the message communication. The problem that this brings is, well platform and proscenium need to maintain separately and are used for maintaining the necessary message producer and message consumer of both sides' communication, and a well platform often docks a plurality of proscenums at the same time, if well platform needs to inform the proscenium, then every proscenium message producer, well platform all need to maintain a message consumer, vice versa, the shortcoming of this kind of implementation scheme has:
first, the middleboxes and the foreground share the same message service, which requires high network conditions for the middleboxes and the foreground, and if one middlebox needs to receive foreground messages, a plurality of message consumers need to be maintained, which puts great pressure on application systems of the middleboxes.
Secondly, if each foreground needs to be in independent butt joint with the middle stage, development and maintenance cost can be gradually increased along with the number of the foreground.
Moreover, because the message middleware has no authentication module, data among all the foreground can not be isolated, and the data security of all the foreground and the middle station can not be ensured.
Aiming at various problems existing in message interaction between a foreground and a middle station in the prior art, some effective solutions need to be explored.
Disclosure of Invention
In view of the shortcomings in the prior art, a primary object of the present application is to provide a message relaying method and corresponding apparatus, electronic device, and non-volatile storage medium for a gateway system.
Another object of the present application is to provide a message interaction method for a middlebox system and corresponding apparatus, electronic device, non-volatile storage medium thereof, adapted to a primary object.
It is a further object of the present application to provide a message interaction method and corresponding apparatus, electronic device, and non-volatile storage medium for a foreground system in response to a primary objective.
In order to meet various purposes of the application, the following technical scheme is adopted in the application:
a message relaying method provided in adaptation to one of the objects of the present application, comprising the steps of:
acquiring a first message sent to a target foreground by a first sending interface called by a middle station from the first sending interface, and storing the first message;
searching a service interface preregistered by the target foreground in the local machine, pushing the first message to the service interface, and marking that the first message is consumed after the first message is consumed by the target foreground;
acquiring a second message sent to the middle station by any foreground from a second sending interface called by the foreground, and analyzing a source foreground to which a corresponding message source belongs;
and pushing a second message to the middle station by associating the second message with the source foreground so as to be consumed by the middle station and mark that the second message is consumed.
In a further embodiment, the method further comprises the following steps:
responding to the unread message query request of any foreground, and analyzing the source foreground to which the request belongs;
inquiring the first message which corresponds to the source foreground and is not consumed, and pushing the first message to the source foreground;
marking the first message pushed as consumed after the source foreground returns a notification indicating that the invocation was successful.
In a further embodiment, it comprises the following steps:
and the message consuming machine is used for processing the first message produced by the message producing machine of the middle station.
In a further embodiment, the step of obtaining the first message sent to the target foreground from the first sending interface called by the middle station and the step of pushing the second message to the middle station in association with the source foreground are both implemented by transmitting messages through the message queue server, so as to implement asynchronous transmission between the local computer and the middle station.
The message interaction method adaptive to one of the purposes of the application, the implementation party of which is a middle station system, comprises the following steps:
calling a message producer to produce a first message, and sending the first message to a first sending interface provided by a gateway so as to send the first message to a target foreground for consumption through the gateway;
calling a message consuming machine to process a second message which is related to a source foreground and is relayed by the website so as to consume the second message;
marking the second message as having been consumed after completion of consumption of the second message.
The message interaction method is suitable for one of the purposes of the application, the implementation party of the message interaction method is a foreground system, and the message interaction method comprises the following steps:
receiving a first message from a middle station from a service interface pre-registered to the gateway, consuming the first message, and returning a notification of successful calling to the gateway;
a second sending interface provided by the calling gateway sends a second message to the middle station through the gateway and receives a notification that the calling is successful from the gateway;
and periodically triggering a query event, and sending an unread message query request to the gateway so as to receive the first message which is pushed by the gateway, sent by the middling station and not consumed by the local machine.
A message relay apparatus adapted to one of the objects of the present application includes:
the system comprises a middle station message acquisition unit, a target foreground and a message processing unit, wherein the middle station message acquisition unit is used for acquiring a first message which is sent to the target foreground from a first sending interface called by a middle station and storing the first message;
the message pushing unit of the middle station is used for searching the service interface preregistered by the target foreground in the local machine, pushing the first message to the service interface and marking the first message as consumed after the first message is consumed by the target foreground;
a foreground message acquiring unit, configured to acquire a second message sent to the middle station by any foreground from a second sending interface called by the foreground, and analyze a source foreground to which a corresponding message source belongs;
and the foreground message pushing unit is used for associating the second message with the source foreground to push the second message to the middle station so as to be consumed by the middle station and mark the second message as consumed.
A message interaction apparatus adapted to one of the purposes of the present application, an implementation of which is a middlebox system, comprising:
the first message sending unit is used for calling the message producer to produce a first message, sending the first message to a first sending interface provided by the gateway, and sending the first message to a target foreground for consumption through the gateway;
a first message calling unit, for calling the message consuming machine to process the second message related to a source foreground relayed by the website, so as to consume the second message;
and a second message marking unit for marking that the second message has been consumed after the consumption of the second message is completed.
A message interaction apparatus adapted to one of the purposes of the present application, an implementation side of which is a foreground system, includes:
the first message consumption unit is used for notifying that a first message from the middle station is received from a service interface pre-registered to the gateway, consuming the first message and returning a notification of successful calling to the gateway;
the second message sending unit is used for calling a second sending interface provided by the gateway to send a second message to the middle station through the gateway and receiving a notification that the calling is successful from the gateway;
and the unread message query corresponds to the unread message query, and is used for periodically triggering a query event and sending an unread message query request to the gateway so as to receive the first message which is pushed by the gateway and is sent by the middling station and is not consumed by the local machine.
An electronic device adapted for one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used for invoking and running a computer program stored in the memory to execute the message relay method/message interaction method.
A non-volatile storage medium adapted for one of the purposes of the present application is provided, which stores in the form of computer readable instructions a computer program implemented in accordance with the message relaying method/message interaction method described, which when invoked by a computer performs the steps comprised by the method.
Compared with the prior art, the method has the following advantages:
firstly, the method constructs a high-adaptability message interaction mode of the foreground and the middle station, and provides a uniform message access for each foreground through the design of combining the gateway and the middle station; on one hand, the gateway receives a first message sent by the middle station through a first sending interface, and encapsulates and forwards the first message to a service interface of a target foreground appointed by the message, so that the target foreground receives the first message through the service interface; on the other hand, the pre-registered foreground in the gateway can send the second message to the gateway through a second sending interface provided by the gateway, so that the gateway encapsulates the second message and forwards the second message to the middlebox specified by the message, and the middlebox consumes the second message. Through the reality of the interactive mode, the safety characteristic and the routing capability of the gateway are utilized, effective guarantee is provided for information interaction between the middle station and the foreground, the middle station and the gateway only need to maintain respective sending interfaces, the message of the middle station can be pushed to the corresponding foreground through the gateway and the sending interfaces provided for the foreground, and the development and maintenance cost is lower compared with that of the traditional middle station and foreground message interactive mode.
Secondly, the method constructs a callback module of the unconsumed message, the gateway carries out persistence processing on the received first message sent by the middle station and stores the first message into a corresponding database, and the gateway can receive the request of the corresponding front station and re-push the first message to the foreground so that the foreground can consume the first message, thereby preventing the unconsumed message from being accumulated in the middle station to cause server crash and greatly improving the reliability of the whole interactive system.
In addition, the message interaction mode of the foreground and the middle station constructed by the method has higher data security guarantee, the gateway only provides a second sending interface for the registered foreground, the information received by the middle station is forwarded by the gateway, the unregistered foreground is prevented from acquiring the second sending interface to carry out network attack, and the foreground can be prevented from directly carrying out network attack on the middle station through the second sending interface.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic diagram of a typical network deployment architecture related to implementing the technical solution of the present application;
fig. 2 is a flowchart illustrating an exemplary embodiment of a message relaying method according to the present application;
FIG. 3 is a schematic flow chart illustrating a specific step of step S12 in FIG. 2;
fig. 4 is a schematic flowchart of a message relay method according to an embodiment of the present application, including parallel steps added thereto;
FIG. 5 is a flow chart illustrating an exemplary embodiment of a message interaction method performed by the central station according to the present application;
FIG. 6 is a flowchart illustrating an exemplary embodiment of a message interaction method performed by the foreground according to the present application;
FIG. 7 is a functional block diagram of an exemplary embodiment of a message relay device of the present application;
FIG. 8 is a functional block diagram of an exemplary embodiment of a message interaction device implemented in a central office according to the present application;
fig. 9 is a schematic block diagram of an exemplary embodiment of a message interaction device implemented in the foreground according to the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those within the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by those skilled in the art, "client," "terminal," and "terminal device" as used herein include both devices that are wireless signal receivers, which are devices having only wireless signal receivers without transmit capability, and devices that are receive and transmit hardware, which have receive and transmit hardware capable of two-way communication over a two-way communication link. Such a device may include: cellular or other communication devices such as personal computers, tablets, etc. having single or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "client," "terminal device" can be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. The "client", "terminal Device" used herein may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, and may also be a smart tv, a set-top box, and the like.
The hardware referred to by the names "server", "client", "service node", etc. is essentially an electronic device with the performance of a personal computer, and is a hardware device having necessary components disclosed by the von neumann principle such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, an output device, etc., a computer program is stored in the memory, and the central processing unit calls a program stored in an external memory into the internal memory to run, executes instructions in the program, and interacts with the input and output devices, thereby completing a specific function.
It should be noted that the concept of "server" as referred to in this application can be extended to the case of a server cluster. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided, and in physical space, the servers may be independent from each other but can be called through an interface, or may be integrated into one physical computer or a set of computer clusters. Those skilled in the art will appreciate this variation and should not be so limited as to restrict the implementation of the network deployment of the present application.
Referring to fig. 1, the hardware basis required for implementing the related art embodiments of the present application may be deployed according to the architecture shown in the figure. The foreground station referred to in the present application is deployed in the server 80, the server 80 establishes a data communication link with the gateway-deployed server 81, so that the server 80 sends a corresponding message to the server 81 through a sending interface provided by the server 81, thereby triggering the gateway of the server 81 to forward the message to the foreground station of the terminal device 82 or 83 to which the message is directed; the terminal devices 82 and 83 are foreground devices registered in the server 81, and the server 81 can forward the message sent by the server 80 through the sending interface to the terminal devices 82 or 83 through the service interface.
The server 81 provides a corresponding sending interface to the server 80 through the gateway implemented therein, and also provides a corresponding sending interface to the terminal device registered in the server 81, so that the terminal device sends information to the server 81 by calling the sending interface, thereby triggering the server 81 to encapsulate and forward the message to the server 80.
The central station implemented by the server 80 and the gateway implemented by the server 81 are respectively provided with a relevant message producer and a relevant message consumer, the server 80 produces a message through the message producer carried by itself and sends the message to the server 81, so that the server 81 packages and forwards the message through the message consumer carried by itself, and correspondingly, the server 81 packages and forwards the message received from the terminal device 82 or 83 through the message producer carried by itself and sends the message to the server 80, so that the server 80 consumes and processes the message through the message consumer carried by itself.
It can be understood that the central station and the gateway referred to in the present application can be deployed in the same server, and the server can implement the functions of message sending and message consuming by setting the associated message output machine and message consuming machine through the central station and the gateway, and those skilled in the art can design the hardware for the central station and the gateway deployment according to the actual service scenario, which is not repeated.
The middle station is mainly used for realizing a certain practical function, responding to an external request, providing access parameters from the external request if necessary, and correspondingly feeding back a result expected by the external request after internal processing to finish the response to the external request.
The person skilled in the art will know this: although the various methods of the present application are described based on the same concept so as to be common to each other, they may be independently performed unless otherwise specified. In the same way, for each embodiment disclosed in the present application, it is proposed based on the same inventive concept, and therefore, concepts of the same expression and concepts of which expressions are different but are appropriately changed only for convenience should be equally understood.
With the above disclosure of the deployment environment and the application environment relevant to the technical solution of the present application in mind, reference is made to the following description for further understanding of various embodiments of the present application:
referring to fig. 2, in a message relaying method of the present application, an application installed and running on a server is responsible for executing a specific implementation to construct a gateway system of the present application, which is open to external calls, in an exemplary embodiment, the method includes the following steps:
step S11, obtaining a first message sent to the target foreground from the first sending interface called by the foreground, and storing the first message:
the gateway receives the first message sent by the middle station through the first sending interface provided by the gateway, sends the first message to a foreground pointed by the first message, and stores the first message in a corresponding database.
The first sending interface is provided by the gateway, and the middle station can send the first message to the gateway by calling the first sending interface so that the gateway can encapsulate the first message and forward the first message to the corresponding foreground.
After receiving the first message, the gateway stores the first message in a corresponding database for persistent processing, so that when a foreground to which the first message is directed does not consume when receiving the message, the foreground can trigger the gateway to reacquire the first message for consumption by sending a corresponding unread message query request; for the unread message query request and the corresponding implementation, please refer to the subsequent steps, which is not repeated.
Step S12, searching for a service interface preregistered by the target foreground in the local computer, pushing the first message to the service interface, and marking that the first message has been consumed after the first message is consumed by the target foreground:
the gateway searches a target foreground pointed by the first message according to the first message, searches a service interface which is registered in advance in the local machine and belongs to the target foreground, and pushes the first message to the service interface, so that the target foreground acquires the first message through the service interface for consumption.
And the gateway monitors the first message in the service interface in real time, and marks the first message as a consumed state after the target foreground acquires the first message through the service interface and consumes the first message.
The service interface is a data communication interface which is set by the gateway for the pre-registered foreground and used for pushing the first message, and the gateway only sets the associated service interface for the pre-registered foreground so as to facilitate the gateway to manage the pushing execution of each first message and prevent the non-pre-registered foreground from reversely attacking the gateway through the service interface and influencing the network security of the gateway.
In one embodiment, the service interface is an SPI set by the gateway for a pre-registered foreground, and after receiving the first message, the gateway queries the SPI of the target foreground according to the target foreground to which the first message is directed, and pushes the first message to the target foreground by calling the SPI.
In an embodiment, referring to fig. 3, when a gateway pushes a first message to a target foreground to which the first message is directed through a service interface, and the target foreground does not consume the message in time, the target foreground may trigger the gateway to push the first message again by sending an unread message query request, where the gateway executes the embodiment specifically includes the following steps:
step S121, responding to the unread message query request of any foreground, analyzing the source foreground to which the request belongs:
and the gateway receives the unread message query request sent by the pre-registered foreground, analyzes the unread message query request and determines the source foreground to which the unread message query request belongs.
The source foreground realizes related communication service according to the SPI of the network and pre-registers the source foreground in the gateway so as to ensure the network safety of the gateway.
Step S122, querying the first message that is not consumed and corresponds to the source foreground, and pushing the first message to the source foreground:
and the gateway inquires the first message which is not consumed and belongs to the source foreground to which the unread message inquiry request points according to the unread message inquiry request, and pushes the first message to the source foreground through the service interface.
And if the gateway cannot inquire the first message which is not consumed and belongs to the source foreground to which the unread message inquiry request points according to the unread message inquiry request, sending a notification message for representing that the source foreground does not have the first message which is not consumed to the source foreground.
Step S123, after the source foreground returns a notification indicating that the call is successful, marking the pushed first message as consumed:
and when the gateway monitors that the source foreground acquires the first message which is not the consumed message through the service interface and consumes the first message, marking the first message as the consumed state.
Step S13, obtaining a second message sent to the middle station by any foreground from the second sending interface for foreground call, and analyzing the source foreground to which the corresponding message source belongs:
the gateway provides the second sending interface to the pre-registered foreground so as to obtain the second message sent to the middle station by the foreground by calling the second sending interface and analyze the foreground to which the second message belongs according to the second message.
The second sending interface is set by the gateway for the pre-registered foreground, and the foreground pushes the second message to the gateway through the second sending interface, so that the gateway packages the second message and pushes the second message to the middle station for consumption.
In one embodiment, after the gateway determines the source foreground to which the second message belongs by parsing the second message, the gateway performs authentication on the source foreground, and determines whether the source foreground is pre-registered in the gateway, if the source foreground is pre-registered, the gateway encapsulates and pushes the second message, and if the source foreground is pre-registered, the gateway deletes the second message and closes the second sending interface to which the second message belongs, so as to prevent the gateway from being attacked by the network.
Step S14, the second message is associated with the source foreground and pushed to the middle station, so that the middle station consumes the second message and marks that it has been consumed:
and the gateway encapsulates the second message acquired from the second transmitting interface and pushes the second message to the middle station so that the middle station can receive the second message for consumption.
And the gateway pushes the second message to the central station, and after the central station consumes the second message, the gateway marks the second message as consumed.
The above exemplary embodiments and variations thereof fully disclose the embodiments of the message relaying method of the present application, but many variations of the method can be deduced by transforming and augmenting some technical means, and other embodiments are summarized as follows:
in an embodiment, referring to fig. 4, the message relaying method of the present application further includes the following parallel steps:
step S15, maintaining a message producer and a message consumer, where the message producer is configured to encapsulate the second message sent to the middlebox, and the message consumer is configured to process the first message produced by the message producer of the middlebox:
and the gateway maintains the message output machine and the message consuming machine in real time, wherein the message output machine is used for packaging the second message acquired through the second sending interface, and the message consuming machine is used for packaging and processing the first message acquired through the first sending interface.
And when the gateway encapsulates the second message acquired from the second sending interface through the message producer, the gateway pushes the second message to the middle station, and the middle station carries out consumption processing on the second message by calling the information consuming machine carried by the middle station.
Correspondingly, the first message which is packaged and processed by the message consuming machine and is set by the gateway is generated by the message generating machine set by the middle station system, the middle station system generates the first message by calling the consumption generating machine carried by the middle station system, and pushes the first message to the gateway through the first sending interface provided by the gateway, so that the gateway packages and pushes the first message through the message consuming machine, inquires the service interface of the front station according to the front station pointed by the first message, and further calls the service interface to push the first message to the corresponding front station.
In another embodiment, in the step of acquiring the first message and the second message and pushing the first message and the second message by the gateway, the first message and the second message both transmit messages through a message queue server to realize asynchronous transmission between the local computer and the central station; the message queue Server can be built through an MsgQueue Server framework to build a message queue Server with a distributed function, write in and read out the first message and the second message, and provide an asynchronous transmission function for information transmission between the middlebox and the gateway.
Referring to fig. 5, a message interaction method according to the present application, executed by an application installed and running on a server, is responsible for implementing a system for constructing a middle station of the present application, and is open to external calls, and in an exemplary embodiment, the method includes the following steps:
step S21, invoking the message producer to produce a first message, sending the first message to a first sending interface provided by the gateway, so as to send the first message to the target foreground for consumption via the gateway:
the middle station calls the message output machine to produce the first message, and sends the first message through the first sending interface provided by the gateway, so that the gateway can push the first message to the target foreground pointed by the first message for consumption.
The message output machine arranged on the middle station is associated with the message consuming machine arranged on the gateway, and after the first message generated by calling the message output machine is sent to the gateway through the first sending interface, the gateway packages and forwards the first message by calling the message consuming machine and sends the first message to the target foreground through the service interface.
Step S22, invoking the message consuming machine to process a second message related to a source foreground relayed by the website, so as to consume the second message:
the middle station calls the second message which is transmitted from a certain source foreground and is forwarded by the message consumption machine consumption gateway.
The second message is packaged and forwarded by the message output machine arranged in the gateway, and the gateway pushes the second message to the middle station so that the middle station can consume the second message by calling the message consumption machine.
Step S23, marking the second message as having been consumed after completion of the consumption of the second message:
and after the middle station finishes the consumption of the second message, marking the second message as a message-processed state.
The consumption is determined by the function carried by the middle station, for example, the middle station is an equity management middle station of the e-commerce platform, the second message may be a request message for updating or adding equity generated by a manager of the e-commerce platform, the middle station performs a corresponding operation of updating or adding equity according to the message, that is, the consumption, and a specific technical person in the consumption field may be designed according to the function provided by the actual middle station, which is not repeated.
Referring to fig. 6, in a message interaction method of the present application, an application installed and running on a terminal device is responsible for executing the embodiment to construct a foreground system of the present application, which in an exemplary embodiment includes the following steps:
step S31, receiving a first message from the central station from the service interface pre-registered to the gateway, consuming the first message, and returning a notification of successful call to the gateway:
the foreground of the step is the foreground which is pre-registered to the gateway, and the gateway is provided with the service interface of the foreground, so that the gateway can conveniently send the first message sent by the middle station to the foreground through the service interface.
After receiving the first message through the service interface, the foreground may consume the first message, and send a notification for characterizing that the first message has been consumed (successfully invoked) to the gateway, so that the gateway marks the first message as having been consumed.
The behavior of the foreground consuming the first message is determined by the middle station generating the first message, for example, when the middle station is an interest management middle station of an e-commerce platform, the first message is an interest notification, and after receiving the first message, the foreground receives the interest specified by the first message, receives or uses the interest, generates the notification representing that the first message is consumed, and sends the notification to the gateway, so that the gateway marks the first message as consumed.
Step S32, the second sending interface provided by the calling gateway sends a second message to the middlebox through the gateway and receives a notification that the calling is successful that the gateway returns:
the foreground sends the second message by calling the second sending interface provided by the gateway, so that the gateway forwards the second message to the middle station to which the second message is directed, and after the middle station finishes consuming the second message, the gateway receives the notification for representing that the second message is consumed (the calling is successful) from the middle station.
In one embodiment, the second message sent by the foreground is a right application message, the corresponding middle station is a right management middle station of the e-commerce platform, the foreground sends the second message through the second sending interface, so that the middle station forwards the second message to the middle station, the middle station performs corresponding right application processing according to the second message, that is, the middle station consumes the second message, and sends a notification of a processing completion result (call success) to the gateway, so that the foreground determines whether the right designated by the second message has a right of use by receiving the notification from the gateway to forward the notification; those skilled in the art can design the consumption behavior of the second message and the middle station according to the actual service scenario, which is not repeated.
Step S33, periodically triggering a query event, sending an unread message query request to the gateway, so as to receive the first message that is pushed by the gateway, sent by the middlebox and is not consumed by the local computer:
when the foreground has the first message(s) which are not consumed, the foreground triggers the query event periodically (regularly), sends the unread message query request for querying the first message to the gateway, so that the gateway sends the corresponding first message which is not consumed to the foreground again through the service interface of the foreground by responding to the unread message query request, and the foreground consumes the first message.
Further, an information relay apparatus of the present application, which is applied to a gateway system, can be constructed by functionalizing each embodiment of the information relay method described above, and according to this idea, please refer to fig. 7, and according to this exemplary embodiment, the apparatus includes:
a middle station message obtaining unit 11, configured to obtain, from a first sending interface called by a middle station, a first message sent to a target foreground, and store the first message;
the message pushing unit 12 of the middle station is used for searching the service interface preregistered by the target foreground in the local machine, pushing the first message to the service interface, and marking that the first message is consumed after the first message is consumed by the target foreground;
a foreground message acquiring unit 13, configured to acquire, from a second sending interface called by a foreground, a second message sent by any foreground to a middle station, and analyze a source foreground to which a corresponding message source belongs;
a foreground message pushing unit 14, configured to associate the second message with the source foreground and push the second message to the middle station, so that the middle station consumes the second message and marks that it has been consumed.
Further, an information interaction apparatus of the present application can be constructed by functionalizing the various embodiments of the information relay method described above, and according to this idea, please refer to fig. 8, which shows an exemplary embodiment in which the apparatus includes:
a first message sending unit 21, configured to invoke the message producer to produce a first message, send the first message to a first sending interface provided by the gateway, and send the first message to the target foreground for consumption through the gateway;
a first message calling unit 22, configured to call a message consuming machine to process a second message, which is relayed by the website and is associated with a source foreground, so as to consume the second message;
a second message marking unit 23 for marking that the second message has been consumed after the consumption of the second message is completed.
Further, an information interaction apparatus of the present application may be constructed by functionalizing each embodiment of the information relay method described above, and according to this idea, please refer to fig. 9, where in an exemplary embodiment, the apparatus includes:
a first message consuming unit 31, configured to notify that a first message from the middlebox is received from a service interface pre-registered to the gateway, consume the first message, and return a notification of successful invocation to the gateway;
a second message sending unit 32, configured to invoke a second sending interface provided by the gateway, send a second message to the middlebox through the gateway, and receive a notification that the gateway returns a successful invocation;
the unread message query response 33 is used for periodically triggering query events and sending an unread message query request to the gateway so as to receive the first message which is pushed by the gateway and is sent by the middling station and is not consumed by the gateway.
In order to facilitate the execution of the present application, an electronic device is provided, which includes a central processing unit and a memory, wherein the central processing unit is configured to invoke and run a computer program stored in the memory to execute the steps of the message relaying method, the message interaction method (middle station execution) or the message interaction method (foreground execution) as described above.
It can be seen that the memory is suitable for a non-volatile storage medium, and by implementing the foregoing method as a computer program and installing the computer program into an electronic device such as a mobile phone, the related program code and data are stored in the non-volatile storage medium of the electronic device, and further by operating the program by a central processing unit of the electronic device, the program is called from the non-volatile storage medium into a memory for operation, so as to achieve the desired purpose of the present application. Therefore, it is understood that, in an embodiment of the present application, a non-volatile storage medium may be further provided, which stores, in the form of computer readable instructions, a computer program implemented according to various embodiments of the method for performing condition matching of middle components, and when the computer program is called by a computer, the computer program performs the steps included in the message relaying method, the message interaction method (middle-stage execution), or the message interaction method (front-stage execution).
To sum up, this application provides a platform message interactive system in lightweight foreground, through the setting of gateway, for foreground and well platform provide corresponding information transmission interface, the data interaction of unified management foreground and well platform, effective and low-cost realization single well platform and a plurality of foreground between the message interaction, also promoted whole message interactive system's stability simultaneously.
Those skilled in the art will appreciate that the present application relates to an apparatus for performing one or more of the operations, methods described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have computer programs stored in their memories that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable Programmable Read-Only memories), EEPROMs (Electrically Erasable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the aspects specified in the block or blocks of the block diagrams and/or flowchart illustrations disclosed herein.
Those of skill in the art will appreciate that the various operations, methods, steps in the processes, acts, or solutions discussed in this application can be interchanged, modified, combined, or eliminated. Further, other steps, measures, or schemes in various operations, methods, or flows that have been discussed in this application can be alternated, altered, rearranged, broken down, combined, or deleted. Further, steps, measures, schemes in the prior art having various operations, methods, procedures disclosed in the present application may also be alternated, modified, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A message relaying method, comprising the steps of:
acquiring a first message sent to a target foreground by a first sending interface called by a middle station from the first sending interface, and storing the first message;
searching a service interface preregistered by the target foreground in the local machine, pushing the first message to the service interface, and marking that the first message is consumed after the first message is consumed by the target foreground;
acquiring a second message sent to the middle station by any foreground from a second sending interface called by the foreground, and analyzing a source foreground to which a corresponding message source belongs;
and pushing a second message to the middle station by associating the second message with the source foreground so as to be consumed by the middle station and mark that the second message is consumed.
2. The method of claim 1, further comprising the steps of:
responding to the unread message query request of any foreground, and analyzing the source foreground to which the request belongs;
inquiring the first message which corresponds to the source foreground and is not consumed, and pushing the first message to the source foreground;
marking the first message pushed as consumed after the source foreground returns a notification indicating that the invocation was successful.
3. Method according to claim 1, characterized in that it comprises the following steps:
and the message consuming machine is used for processing the first message produced by the message producing machine of the middle station.
4. The method of claim 1, wherein the steps of obtaining the first message from the first sending interface for the middlebox to send to the target foreground, and associating the second message with the source foreground to push to the middlebox, are all performed by passing the message through the message queue server to implement asynchronous transmission between the local computer and the middlebox.
5. A message interaction method is characterized by comprising the following steps:
calling a message producer to produce a first message, and sending the first message to a first sending interface provided by a gateway so as to send the first message to a target foreground for consumption through the gateway;
calling a message consuming machine to process a second message which is related to a source foreground and is relayed by the website so as to consume the second message;
marking the second message as having been consumed after completion of consumption of the second message.
6. A message interaction method is characterized by comprising the following steps:
receiving a first message from a middle station from a service interface pre-registered to the gateway, consuming the first message, and returning a notification of successful calling to the gateway;
a second sending interface provided by the calling gateway sends a second message to the middle station through the gateway and receives a notification that the calling is successful from the gateway;
and periodically triggering a query event, and sending an unread message query request to the gateway so as to receive the first message which is pushed by the gateway, sent by the middling station and not consumed by the local machine.
7. An intermediate component condition matching apparatus, characterized by comprising:
the system comprises a middle station message acquisition unit, a target foreground and a message processing unit, wherein the middle station message acquisition unit is used for acquiring a first message which is sent to the target foreground from a first sending interface called by a middle station and storing the first message;
the message pushing unit of the middle station is used for searching the service interface preregistered by the target foreground in the local machine, pushing the first message to the service interface and marking the first message as consumed after the first message is consumed by the target foreground;
a foreground message acquiring unit, configured to acquire a second message sent to the middle station by any foreground from a second sending interface called by the foreground, and analyze a source foreground to which a corresponding message source belongs;
and the foreground message pushing unit is used for associating the second message with the source foreground to push the second message to the middle station so as to be consumed by the middle station and mark the second message as consumed.
8. A message interaction apparatus, comprising:
the first message sending unit is used for calling the message producer to produce a first message, sending the first message to a first sending interface provided by the gateway, and sending the first message to a target foreground for consumption through the gateway;
a first message calling unit, for calling the message consuming machine to process the second message related to a source foreground relayed by the website, so as to consume the second message;
and a second message marking unit for marking that the second message has been consumed after the consumption of the second message is completed.
9. An electronic device comprising a central processor and a memory, characterized in that the central processor is configured to invoke execution of a computer program stored in the memory to perform the steps of the method according to any one of claims 1 to 6.
10. A non-volatile storage medium, characterized in that it stores, in the form of computer-readable instructions, a computer program implemented according to the method of any one of claims 1 to 6, which, when invoked by a computer, performs the steps comprised by the method.
CN202110043491.8A 2021-01-13 2021-01-13 Message relay and interaction method, and corresponding device, equipment and medium Pending CN112804329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110043491.8A CN112804329A (en) 2021-01-13 2021-01-13 Message relay and interaction method, and corresponding device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110043491.8A CN112804329A (en) 2021-01-13 2021-01-13 Message relay and interaction method, and corresponding device, equipment and medium

Publications (1)

Publication Number Publication Date
CN112804329A true CN112804329A (en) 2021-05-14

Family

ID=75810510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110043491.8A Pending CN112804329A (en) 2021-01-13 2021-01-13 Message relay and interaction method, and corresponding device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112804329A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110855755A (en) * 2019-10-24 2020-02-28 上海东普信息科技有限公司 Message pushing method
CN110891094A (en) * 2019-12-31 2020-03-17 河南云上大别山数据服务有限责任公司 Terminal software supporting platform based on middle platform
CN111309374A (en) * 2020-01-21 2020-06-19 苏州达家迎信息技术有限公司 Micro-service system and service calling method in micro-service system
CN111414262A (en) * 2020-03-19 2020-07-14 刘奇峰 Service calling method and device
CN112073366A (en) * 2020-07-23 2020-12-11 中国铁道科学研究院集团有限公司电子计算技术研究所 Data processing method for railway financial system and data center

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110855755A (en) * 2019-10-24 2020-02-28 上海东普信息科技有限公司 Message pushing method
CN110891094A (en) * 2019-12-31 2020-03-17 河南云上大别山数据服务有限责任公司 Terminal software supporting platform based on middle platform
CN111309374A (en) * 2020-01-21 2020-06-19 苏州达家迎信息技术有限公司 Micro-service system and service calling method in micro-service system
CN111414262A (en) * 2020-03-19 2020-07-14 刘奇峰 Service calling method and device
CN112073366A (en) * 2020-07-23 2020-12-11 中国铁道科学研究院集团有限公司电子计算技术研究所 Data processing method for railway financial system and data center

Similar Documents

Publication Publication Date Title
US8296375B1 (en) Parallel management of load servers, cache servers, and feed servers
CN105656663A (en) Software update method and device
CN104468833A (en) Request information unified processing method and device
CN111443961B (en) Terminal equipment and cross-process communication method thereof
CN114615096B (en) Event-driven architecture-based telecommunication charging method, system and related equipment
CN104834534A (en) Application program function extension method, device and system
CN108494867B (en) Method, device and system for service gray processing and routing server
WO2022120806A1 (en) Multi-cloud distributed messaging method and system for high performance computing
CN112015578A (en) Wind control system and method based on pre-synchronous processing and post-asynchronous processing
US20100185679A1 (en) System for Discovering Level of Support of Optional Features in a Database
CN101571811B (en) Information transmission method and device thereof
CN110727736A (en) Data synchronization method and device, electronic equipment and storage medium
CN111813529B (en) Data processing method, device, electronic equipment and storage medium
CN113691511A (en) Service request processing method, device, equipment and medium thereof
CN101924815A (en) 3G MOA phone middleware embedded system
CN115550354A (en) Data processing method and device and computer readable storage medium
CN104184821A (en) Conversation and terminal response feedback method and device based on push notification
CN112804329A (en) Message relay and interaction method, and corresponding device, equipment and medium
CN104573489A (en) Method and device for forbidding application to establish desktop icon
CN114884880B (en) Data transmission method and system
CN116366345A (en) Picture cloud storage processing method and device, equipment and medium thereof
CN103379015A (en) Website server and IM client data transmission method, apparatus and system
CN113542409B (en) Management system and processing method for instances of RocktMQ message queues
US20220360636A1 (en) Identifying outdated cloud computing services
CN114647702A (en) Data synchronous processing method and device, equipment and medium thereof

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210514

RJ01 Rejection of invention patent application after publication