CN110365749B - Message pushing method, message pushing system and storage medium - Google Patents

Message pushing method, message pushing system and storage medium Download PDF

Info

Publication number
CN110365749B
CN110365749B CN201910553229.0A CN201910553229A CN110365749B CN 110365749 B CN110365749 B CN 110365749B CN 201910553229 A CN201910553229 A CN 201910553229A CN 110365749 B CN110365749 B CN 110365749B
Authority
CN
China
Prior art keywords
message
order
push
pushing
shop
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910553229.0A
Other languages
Chinese (zh)
Other versions
CN110365749A (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.)
Shanghai Feima Network Science & Technology Co ltd
Original Assignee
Shanghai Feima Network Science & 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 Shanghai Feima Network Science & Technology Co ltd filed Critical Shanghai Feima Network Science & Technology Co ltd
Priority to CN201910553229.0A priority Critical patent/CN110365749B/en
Publication of CN110365749A publication Critical patent/CN110365749A/en
Application granted granted Critical
Publication of CN110365749B publication Critical patent/CN110365749B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Abstract

The invention discloses a message pushing method, a message pushing system and a storage medium, wherein the message pushing method comprises the following steps: the message queue receives order messages pushed by a message source and pushes the order messages to a pushing node subscribing to pushing service; and after receiving the order message, the pushing node pushes the order details to the shop side after waiting for the shop side to connect. The invention solves the problems of resource waste and poor message real-time performance in the traditional round-robin method, and can realize instant message push; extra technical requirements on the shop network architecture are not needed, and the message instantaneity and accuracy can be guaranteed.

Description

Message pushing method, message pushing system and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a message pushing method, a message pushing system, and a storage medium.
Background
When a client data source is at a cloud end (or a user end) and it is uncertain when data is generated, for example, when a shop end acquires an internet order of each channel from the cloud end, a round-robin manner is usually adopted to actively and regularly request a Web end, and cache the data locally, and after the next request, the data cached locally is compared with new data to screen out the processed data, so as to avoid repeated processing; another way is to use push technology, but it is usually a prerequisite that the shop-internal network can be addressed directly.
However, for the round-robin mode, when the base number of the client is large, a huge amount of useless requests are generated, and the round-robin is not interrupted in the period when the service is not busy, so that unnecessary resource overhead is caused; meanwhile, in a busy period of time, the message real-time performance is influenced probably because the round-robin period is longer, namely, the shorter the round-robin period is, the better the real-time performance is, and the more resources are wasted; the longer the round-robin period, the worse the real-time performance, and the less the waste of resources. Moreover, the network quality of the traditional shop is not ideal, the traffic overhead generated by the round robin is high, and extra cost is generated for shops using 3G and 4G networks, VPN networks and monthly traffic networks. For a shop network architecture which cannot be directly addressed, no ideal real-time pushing method exists at present.
Disclosure of Invention
In view of this, embodiments of the present invention provide a message pushing method, a message pushing system, and a computer-readable storage medium, which can solve the problems of resource waste and poor message real-time performance in the conventional round-robin method, and implement instant message pushing.
A first aspect of the present invention provides a message pushing method, which includes:
the message queue receives order messages pushed by a message source and pushes the order messages to a pushing node subscribing to pushing service;
and after receiving the order message, the pushing node pushes the order message to the shop side after waiting for the shop side to connect.
In some embodiments of the message pushing method, the message queue is a message queue cluster deployed in a distributed manner.
In some embodiments of the message pushing method, each message queue in the message queue cluster is bound to a switch in a broadcast mode, and the order message is received by the switch.
In some embodiments of the message pushing method, after the pushing the order message to the store end, the pushing node further includes: receiving information of successful push returned by the shop side, and carrying out pushed marking on the order message;
and deleting the order message after other push nodes in the message queue cluster recognize the pushed mark.
In some embodiments of the message pushing method, in a process of pushing the order details to the store end, the pushing node receives the order message, then parses a target store of the store end to which the order message points, and after determining that the target store is online, pushes the order message to the target store.
In some embodiments of the message pushing method, the message source pushes the message to the message queue through a Web API.
In some embodiments of the message pushing method, the shop end establishes a regular connection with a pushing node through a front shunting facility.
A second aspect of the present invention provides a message pushing system, which includes a message queue and a pushing node; the message queue is used for receiving order messages pushed by a message source and pushing the order messages to a pushing node subscribing to pushing service; and the pushing node is used for pushing the order message to the shop side after the shop side is connected after receiving the order message.
In some embodiments of the message pushing system, the pushing node employs a virtual host to push the order message, and the virtual host is disposed in a DMZ area of a store network.
A third aspect of the present invention provides a computer-readable storage medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements the message push method.
The invention solves the problems of resource waste and poor message real-time performance in the traditional round-robin method, and can realize instant message push; extra technical requirements on the shop network architecture are not needed, and the message instantaneity and accuracy can be guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows an exemplary service message flow diagram of a message pushing method according to an embodiment of the present invention.
Fig. 2 shows an exemplary network topology diagram of a message push system according to an embodiment of the invention.
Fig. 3 shows an exemplary system framework diagram of a message push system according to an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus their repetitive description will be omitted.
The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, materials, and so forth. In some instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring the invention.
The technical contents of the present invention will be further described with reference to the accompanying drawings and examples.
The invention provides a method and a system for pushing messages in real time based on a complex store network, aiming at solving the problems of resource waste and poor message real-time performance in the traditional round-robin method, and the method and the system can realize instant message pushing, do not need additional technical requirements on a store network architecture, and ensure the message instantaneity and accuracy.
Referring to fig. 2, an exemplary network topology diagram of a message push system according to an embodiment of the present invention is shown, and as shown, the message push system mainly includes a message queue and a push node. The message queues are deployed in a distributed manner, that is, multiple machines and multiple deployments are used as the message queue cluster 11, for example, 3 service instances are respectively started on 2 machines to form a distributed cluster of 6 service instances, as shown in fig. 3, these message queue clusters can be stored in a RabbitMQ server, and the RabbitMQ is an open source message queue agent which is deployed most widely and serves as an intermediate software module to transfer messages from one software service to another software service. The message source 10 pushes the message to the message queue cluster 11 through the Web API, and the message queue cluster 11 receives the order message pushed by the message source 10 and pushes the order message to the push node 12 subscribing to the push service. The push nodes 12 subscribe to individually created and independent message queues while binding to a FANOUT mode switch (EXCHANGE) so that the same message can be copied to each push node's respective message queue. After receiving the message, the push node 12 starts a consuming process, that is, the detailed order request is successfully pulled from the Web side, the detailed order request is cached and stored, and after the store side is connected, the cached detailed order is pushed to the store side 13. The shop end 13 may be a cash register running an operating system such as Windows/Linux/Android. The store end 13 is a store cluster composed of a plurality of stores, and the store end 13 establishes a constant connection with the push node 12 through a load balancing (or configuration center) facility. The pushing node 12 analyzes the order message to a message target store, after judging that the target store is on line currently, the pushing node pushes the cached complete message to a store end machine, and after successfully receiving a return, marks the order message as successfully pushed to prevent repeated pushing, and simultaneously sends a consumption confirmation response to the message queue cluster 11; and after recognizing the pushed mark of a certain order message, other distributed pushing nodes delete the order message from the pushing node.
In the FANOUT mode switch (EXCHANGE), all message queues bound to the switch can receive messages (broadcast, all consumers can receive messages), so that the same order message can be copied in each push node's respective message queue, and the real-time performance and the uniformity of the order message in each message queue are ensured.
It should be noted that the order message is summary information of the order, and does not necessarily include details of the order, for example, after a certain customer places an order in a certain store through a network, an order is generated, and the summary information (i.e., the order message) of the order may include only information "a certain customer places an order in a certain store", that is, only include customer information and store information, and information that an "order placing event" occurs, and does not include details of a specific product, a price, and the like in the order. Therefore, the flow of the information obtained by the message queue from the Web end can be reduced, the information obtaining is accelerated, and the message pushing instantaneity is improved. Meanwhile, the push nodes are only responsible for receiving the messages pushed by the respective subscribed message queues, so that the push service has pertinence, the accuracy of message pushing is ensured, and invalid pushing is avoided. In addition, the pushing node is linked with the Web end after receiving the order message, obtains the order details, caches the order details in the local database, and pushes the buffered order details to the terminal machine of the target shop after the target shop pointed by the message order is connected, so that invalid pushing can be avoided, and network resources are saved.
Referring to fig. 3, an exemplary system framework diagram of the message pushing system according to the embodiment of the present invention is shown, as shown in the figure, the infrastructure of the message pushing system can be divided into three layers, where the first layer is a service module and is responsible for processing and pushing service messages; the second layer is a storage cache module and is built by adopting open source components RabbitMQ and Redis; the third layer is data center infrastructure, namely the basic network and equipment form of a client IDC machine room, and the like, including but not limited to a virtual host cluster; its IDC virtual host is typically in the DMZ area of the store network. DMZ is an abbreviation for the english "dematerilized zone", the chinese name being "isolation zone", also known as "demilitarized zone". The method is a buffer area between a non-safety system and a safety system, which is set for solving the problem that an access user of an external network can not access an internal network server after a firewall is installed. The buffer zone is located within a small network area between the enterprise internal network and the external network. In this small network area, some server facilities such as enterprise Web server, FTP server, forum, etc. which must be disclosed can be placed. On the other hand, with such a DMZ zone, the internal network is protected more effectively. Because of the network deployment, compared with the general firewall scheme, the network deployment has one more barrier to attackers from the external network.
As shown in fig. 3, the service module performs operations of the message queue and the push node, and may include sub-units of connection management, connection routing, connection communication, API access, distributed collaboration, message distribution, message pool, consumer, and the like. Specifically, the connection management is used for the connection condition between the shop-side equipment and the push node, and between the shop-side equipment and the push node as well as between the shop-side equipment and the Web side and between the shop-side equipment and the push node; the connection routing realizes the functions of pushing the connection routing and selecting from the message to the shop end; the connection communication is used for realizing communication connection between the shop end and the push node and between the shop end and the push node as well as between the Web end and the push node; API access is used for realizing the connection between the push node and the Web; the distributed cooperation is used for operating the distribution and cooperation of the push node and each message queue in the message queue cluster; message distribution the message is separated on each message queue by the switch; the message pool is used for collecting and storing messages; the consumer is used to manage consumer information.
The invention also provides a message pushing method, which mainly comprises the following steps: the message queue receives order messages pushed by a message source and pushes the order messages to a pushing node subscribing to pushing service; and after receiving the order message, the push node acquires and caches the order details of the order message, and pushes the order details to the shop side after the shop side is connected (if the details do not need to be acquired, the push node does not need the step of acquiring and caching the order details of the order message, and pushes the received order message to the shop side).
Specifically, referring to fig. 1, an exemplary service message flow diagram of a message pushing method according to an embodiment of the present invention is shown, as shown, the message pushing method includes the steps of:
the message source 10 pushes the message to the message queue cluster 11 through the Web API, and meanwhile, the push service (push node, corresponding to each consumer) is deployed in a distributed manner, that is, multiple machines and multiple deployments, for example, 3 service instances are respectively started on 2 machines to form a distributed cluster of 6 service instances.
The push services subscribe to individually created and independent message queues while bound to a FANOUT-mode switch (EXCHANGE), which allows the same message to make a copy of each push service's individual message queue.
After receiving the message, the push service starts a consuming process, i.e. the detailed request of the order is successfully pulled from the message source 10(Web side), and the detailed request of the order is cached and saved (cached in the Redis database) to wait for the connection of the shop side 13.
The shop end 13 establishes a regular connection with the push service through a load balancing device such as LVS, or a "configuration center" such as Apollo, ZooKeeper, etc. front-end distribution facility. The push service analyzes the message to a message target store according to the message body, judges that the target store is on line currently, pushes the cached complete message to a store end machine, marks the message as successfully pushed after successfully receiving a return, prevents repeated pushing, and simultaneously sends a consumption confirmation response to the message queue cluster; and after recognizing the pushed mark of a certain message, other distributed pushing nodes delete the message from the node.
The method solves the problems of resource waste and poor message real-time performance in the traditional round-robin method, can realize instant message push, has the average processing capacity of 200 times/second for a single node, and can transversely expand the capacity of distributed nodes; extra technical requirements on the shop network architecture are not needed, and the message instantaneity and accuracy can be guaranteed.
It is worth mentioning that the present invention further provides an embodiment of a storage medium for storing machine-readable program instructions, which when executed, perform the message pushing method according to the present invention: the message queue receives order messages pushed by a message source and pushes the order messages to a pushing node subscribing to pushing service; and after receiving the order message, the pushing node acquires and caches the order details of the order message, and pushes the order details to the shop side after the shop side is connected. The storage medium may be ROM, RAM, removable hard disk, magnetic disk, optical disk, U disk, etc.
It should be noted that the structures, ratios, sizes, and the like shown in the drawings attached to the present specification are only used for matching the disclosure of the present specification, so as to be understood and read by those skilled in the art, and are not used to limit the conditions of the present invention, so that the present invention has no technical essence, and any structural modification, ratio relationship change, or size adjustment should still fall within the scope of the present invention without affecting the efficacy and the achievable purpose of the present invention. In addition, the terms "upper", "lower", "left", "right", "middle" and "one" used in the present specification are for clarity of description, and are not intended to limit the scope of the present invention, and the relative relationship between the terms and the terms is not to be construed as a scope of the present invention.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (5)

1. A message pushing method, comprising:
the method comprises the steps that a message queue receives order messages pushed by a message source, wherein the order messages are summary information of orders and do not contain detailed requests of the orders, the order messages are pushed to push nodes subscribing to push services, and the push nodes are only responsible for receiving messages pushed by message queues subscribed by the push nodes; the message queue adopts a message queue cluster deployed in a distributed mode; each message queue in the message queue cluster is bound under an exchanger in a broadcast mode, and the exchanger receives the order message;
the pushing node is linked with the Web end after receiving the order message, obtains order details and caches the order details in a local database, and pushes the order message to the shop end after the shop end is connected; after the pushing node pushes the order message to the shop side, the method further includes: receiving information of successful push returned by the shop side, and carrying out pushed marking on the order message; and deleting the order message after other push nodes in the message queue cluster recognize the pushed mark; the shop end is a shop cluster consisting of a plurality of shops, and the shop end is in constant connection with the push node through load balancing; the pushing node adopts a virtual host to push the order message, and the virtual host is arranged in a DMZ area of the shop network.
2. The message pushing method according to claim 1, wherein in a process of pushing the order message to the store end, the push node parses a target store of the store end to which the order message points after receiving the order message, and pushes the order message to the target store after determining that the target store is online.
3. The message pushing method of claim 1, wherein the message source pushes the message to the message queue through a Web API.
4. A message push system, characterized by: the method comprises a message queue and a push node; the message queue is used for receiving order messages pushed by message sources, the order messages are summary information of orders and do not contain detailed requests of the orders, the order messages are pushed to push nodes subscribing to push services, and the push nodes are only responsible for receiving messages pushed by the message queues subscribed by the push nodes; the pushing node is used for linking with the Web end after receiving the order message, acquiring order details, caching the order details into a local database, and pushing the order message to the shop end after the shop end is connected; the message queue adopts a message queue cluster deployed in a distributed mode; each message queue in the message queue cluster is bound under an exchanger in a broadcast mode, and the exchanger receives the order message; after the push node pushes the order message to the shop side, the push node is further configured to: receiving information of successful push returned by the shop side, and carrying out pushed marking on the order message; and deleting the order message after other push nodes in the message queue cluster recognize the pushed mark; the shop end is a shop cluster consisting of a plurality of shops, and the shop end is in constant connection with the push node through load balancing; the pushing node adopts a virtual host to push the order message, and the virtual host is arranged in a DMZ area of the shop network.
5. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the message push method of any one of claims 1 to 3.
CN201910553229.0A 2019-06-25 2019-06-25 Message pushing method, message pushing system and storage medium Active CN110365749B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910553229.0A CN110365749B (en) 2019-06-25 2019-06-25 Message pushing method, message pushing system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910553229.0A CN110365749B (en) 2019-06-25 2019-06-25 Message pushing method, message pushing system and storage medium

Publications (2)

Publication Number Publication Date
CN110365749A CN110365749A (en) 2019-10-22
CN110365749B true CN110365749B (en) 2021-11-30

Family

ID=68216917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910553229.0A Active CN110365749B (en) 2019-06-25 2019-06-25 Message pushing method, message pushing system and storage medium

Country Status (1)

Country Link
CN (1) CN110365749B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111784452A (en) * 2020-06-29 2020-10-16 北京思特奇信息技术股份有限公司 Message pushing method and system for realizing order completion
CN112100460B (en) * 2020-11-06 2021-04-30 腾讯科技(深圳)有限公司 Block chain-based network page evidence storing method, device, medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104394512A (en) * 2014-12-04 2015-03-04 成都思邦力克科技有限公司 Message push system
CN104506416A (en) * 2014-12-17 2015-04-08 东软集团股份有限公司 Method, device and system for implementing stable message forwarding
CN106657311A (en) * 2016-12-13 2017-05-10 惠州Tcl移动通信有限公司 Information pushing method and system
CN109905448A (en) * 2017-12-11 2019-06-18 镇江盛烨信息技术有限公司 Network information push method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101914488B1 (en) * 2011-04-06 2018-11-05 삼성전자주식회사 Server cluster and method for push notification service
CN104469416A (en) * 2013-09-12 2015-03-25 无锡中科智能信息处理研发中心有限公司 Video advertisement distributing system and method based on message queue
CN105323205A (en) * 2014-05-30 2016-02-10 中兴通讯股份有限公司 Message pushing processing method, message pushing processing device, pushing server and application server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104394512A (en) * 2014-12-04 2015-03-04 成都思邦力克科技有限公司 Message push system
CN104506416A (en) * 2014-12-17 2015-04-08 东软集团股份有限公司 Method, device and system for implementing stable message forwarding
CN106657311A (en) * 2016-12-13 2017-05-10 惠州Tcl移动通信有限公司 Information pushing method and system
CN109905448A (en) * 2017-12-11 2019-06-18 镇江盛烨信息技术有限公司 Network information push method and system

Also Published As

Publication number Publication date
CN110365749A (en) 2019-10-22

Similar Documents

Publication Publication Date Title
US20090327079A1 (en) System and method for a delivery network architecture
US10091121B2 (en) Method and system for reduction of delay and bandwidth requirements in internet data transfer
CN107251086A (en) Delivered by the application service of application service scapegoat
GB2320112A (en) High-availability computer server system
CN110365749B (en) Message pushing method, message pushing system and storage medium
CN103338252A (en) Distributed database concurrence storage virtual request mechanism
CN107888787B (en) Method and device for processing media access request
CN108733821A (en) A kind of distribution of monitor video sectional drawing and methods of exhibiting and system
US20110307564A1 (en) Data node apparatus, peer information acquisition method and system
CN109618003B (en) Server planning method, server and storage medium
CN105656964B (en) The implementation method and device of data-pushing
CN114338769A (en) Access request processing method and device
US11606415B2 (en) Method, apparatus and system for processing an access request in a content delivery system
CN111600929B (en) Transmission line detection method, routing strategy generation method and proxy server
GB2464367A (en) Network traffic monitor for multi-tier server arrangement loops back packets from one server to another on same device
CN103227772B (en) System for the scalable processing of file in cloud
US20150063558A1 (en) Systems and methods for allocation of telephony resources on-demand
CN110191362B (en) Data transmission method and device, storage medium and electronic equipment
CN110290196A (en) A kind of content distribution method and device
CN1649326A (en) Front end system constructing method of multiple distributor of colony server
CN114328587A (en) NDC message distributed analysis system architecture integration method and device
Chen et al. Using service brokers for accessing backend servers for web applications
CN107465743B (en) Method and device for processing request
Pullen et al. Dual-mode multicast for DIS
CN110196874A (en) Data subscription method, device and server

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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Message push method, message push system, and a storage medium

Effective date of registration: 20230919

Granted publication date: 20211130

Pledgee: Industrial Bank Co.,Ltd. Shanghai Changning sub branch

Pledgor: SHANGHAI FEIMA NETWORK SCIENCE & TECHNOLOGY Co.,Ltd.

Registration number: Y2023310000566