CN111694674B - Message distribution processing method, device, equipment and storage medium - Google Patents

Message distribution processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111694674B
CN111694674B CN201910189864.5A CN201910189864A CN111694674B CN 111694674 B CN111694674 B CN 111694674B CN 201910189864 A CN201910189864 A CN 201910189864A CN 111694674 B CN111694674 B CN 111694674B
Authority
CN
China
Prior art keywords
message
client
distribution
distributor
target
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
CN201910189864.5A
Other languages
Chinese (zh)
Other versions
CN111694674A (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910189864.5A priority Critical patent/CN111694674B/en
Priority to PCT/CN2020/070692 priority patent/WO2020181913A1/en
Publication of CN111694674A publication Critical patent/CN111694674A/en
Application granted granted Critical
Publication of CN111694674B publication Critical patent/CN111694674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • 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
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor

Abstract

The embodiment of the disclosure discloses a message distribution processing method, a device, equipment and a storage medium. The method comprises the following steps: the client receives the target message pushed by the server through the message distributor; the client analyzes the target message through a message distributor and generates a distribution message according to the message type and the message data in the target message; the client informs at least one observer object of the message distributor of the distributed message through the message distributor; and the client processes the monitored distribution message according to a set processing mode through at least one observer object. Through the technical scheme of the embodiment of the disclosure, memory resources can be saved, and the efficiency of message distribution processing is improved.

Description

Message distribution processing method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to computer technology, in particular to a message distribution processing method, a device, equipment and a storage medium.
Background
During the use process, the application software client side often receives various messages pushed by the server, so that related objects in the client side process the received messages.
In the prior art, when an application client running on an iOS receives a message pushed by a server, there is no effective message distribution processing mechanism, and each received message is respectively analyzed and processed mainly by one or more object processes (for example, an interface or a popup window) running currently in the client, so as to determine whether the message belongs to a message processed corresponding to the object process, and acquire and process information matched with the object process.
The defects of the prior art scheme are that all object processes need to analyze and process each received message, so that a large amount of memory resources are occupied, and meanwhile, the efficiency of message distribution and processing is reduced.
Disclosure of Invention
The embodiment of the disclosure provides a message distribution processing method, a device, equipment and a storage medium, so as to save memory resources and improve the efficiency of message distribution processing.
In a first aspect, an embodiment of the present disclosure provides a message distribution processing method, including:
the client receives the target message pushed by the server through the message distributor;
the client analyzes the target message through a message distributor and generates a distribution message according to the message type and the message data in the target message;
the client informs at least one observer object of the message distributor of the distributed message through the message distributor;
and the client processes the monitored distribution message according to a set processing mode through at least one observer object.
In a second aspect, an embodiment of the present disclosure further provides a message distribution processing apparatus configured in a client, where the apparatus includes:
the message receiving module is used for receiving the target message pushed by the server through the message distributor;
the message analysis module is used for analyzing the target message through the message distributor and generating a distribution message according to the message type and the message data in the target message;
a message distribution module for notifying, by a message distributor, at least one observer object of the message distributor of the distribution message;
and the message processing module is used for processing the monitored distribution message through at least one observer object according to a set processing mode.
In a third aspect, an embodiment of the present disclosure further provides a terminal device, including:
one or more processing devices;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement a message distribution processing method as described in any one of the embodiments of the present disclosure.
In a fourth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processing device, implements a message distribution processing method according to any of the embodiments of the present disclosure.
According to the embodiment of the disclosure, the message distributor is arranged in the client, the message distributor is used for receiving the target message pushed by the server, analyzing and processing the target message, generating the distributed message according to the message type and the message data in the target message, then notifying at least one observer object in the message distributor of the distributed message, processing the monitored distributed message according to the set processing mode through the at least one observer object, and uniformly completing the analysis and distribution process of the message by utilizing the independently arranged message distributor, so that the problems of large occupied memory and reduced information distribution processing efficiency caused by the fact that all objects in the client need to analyze and process each received message in the prior art are solved, memory resources are saved, and the efficiency of the information distribution processing is improved.
Drawings
Fig. 1 is a flow chart of a message distribution processing method according to a first embodiment of the present disclosure;
fig. 2 is a flow chart of a message distribution processing method according to a second embodiment of the disclosure;
fig. 3 is a schematic structural diagram of a message distribution processing apparatus according to a third embodiment of the present disclosure;
fig. 4 is a schematic hardware structure of a terminal device according to a fourth embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the present disclosure and not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present disclosure are shown in the drawings.
In the following embodiments, optional features and examples are provided in each embodiment at the same time, and the features described in the embodiments may be combined to form multiple alternatives, and each numbered embodiment should not be considered as only one technical solution.
Example 1
Fig. 1 is a flow chart of a message distribution processing method according to a first embodiment of the present disclosure. The method is applicable to the situation that the client distributes the received message, and can be executed by a mobile phone running an application program client or terminal equipment such as a tablet personal computer, and the like, and specifically comprises the following steps:
s110, the client receives the target message pushed by the server through the message distributor.
In this embodiment, the target message may be personal information such as private information and notification that the server pushes to the client. Because the existing iOS operating system has no effective message distribution processing mechanism, when the client receives the target message pushed by the server, the client can only analyze and process each received message by means of all objects (also called processes or instances and the like) in the client, so as to determine whether the object is a processor of the message, so that each object needs to repeatedly analyze each message, and when a large number of pushed messages are received at the same time, the client occupies a large amount of memory resources, so that the operation of the client becomes stuck, and meanwhile, the efficiency of message distribution processing is reduced.
In order to solve the above-mentioned problem, the present embodiment sets a message dispatcher (MessageDispatcher) in the client, which is specifically configured to parse and dispatch the received push message. Wherein the message distributor may be a processing thread written in the client program. When the server pushes the target message to the client, the client may receive the target message through the message distributor.
The client according to this embodiment may be referred to as a mobile APP (Application) or a web page, which is not limited herein.
Optionally, the client includes: an application client adapted to an iOS operating system. That is, the client according to the embodiment may be installed in the iOS operating system to make up for the deficiency that there is no effective message distribution processing mechanism in the iOS operating system, and of course, the client may also be an application client adapted to the Android operating system, which is not limited in this embodiment.
S120, the client analyzes the target message through the message distributor and generates a distributed message according to the message type and the message data in the target message.
In this embodiment, after receiving the target message pushed by the server, the client may uniformly analyze the target message by using the message distributor. Specifically, the client may split or identify the target message into message data and its corresponding message type by the message distributor.
For example, the analyzed message data and message type may be used to generate the distributed message according to a preset format, for example, the preset format may be "message type+message data", so that when the message is processed in a subsequent step, the distributed message may be directly identified according to the message type.
S130, the client informs at least one observer object of the message distributor of the distributed message through the message distributor.
In this embodiment, the observer object may be an object in the client that needs to receive the distribution message, where the object includes, but is not limited to, a certain web page, a certain popup window, and the like in the client. Illustratively, after the client generates the distribution message through the message distributor, each observer object of the message distributor may be notified of the distribution message so that the observer object processes the pushed message. Specifically, a listening thread may be set for each observer object, for listening to the distribution message generated in the message distributor.
In an alternative embodiment, the client informs the at least one observer object of the message distributor of the distributed message through the message distributor, comprising: the client informs, by the message distributor, the distribution message according to the message type to at least one observer object matching the message type.
Since the message types that can be processed by different observer objects may be different, the message distributor may notify the corresponding observer object capable of processing the message type of the distributed message according to the message type, so that the corresponding observer object directly processes the monitored distributed message. Specifically, a correspondence between the message type and the observer object may be preset, and the message distributor may determine to notify the corresponding observer object of the distributed message of the different message types through the correspondence.
In another alternative embodiment, a client notifies a message distributor of a distributed message to at least one observer object of the message distributor, comprising: the client notifies the distribution message to at least one observer object registered in advance in the message distributor through the message distributor.
When at least one object in the client needs to receive a message pushed by the server, registration may be performed in the message distributor in advance. As a practical example, if an opening operation of a user with respect to a target web page in a client is detected, the target web page may be automatically registered in a message distributor as an observer object. Similarly, if the opening operation of the user on the target popup window in the client is detected, the target popup window can be automatically registered in the message distributor and used as another observer object.
Because the objects interested in the information pushed by the server in the client are registered in the information distributor in advance, when the information distributor generates the distributed information, only the registered observer objects can receive the distributed information notice, thereby avoiding the monitoring of the information without difference of all the objects, reducing the waste of memory resources and improving the performance of the equipment where the client is located.
And S140, the client processes the monitored distribution message through at least one observer object according to a set processing mode.
Since the messages that can be processed by different objects in the client may be different, the distributed messages that are monitored by the observer object may only include the messages that can be processed by the observer object, and may also include other messages, and at this time, the distributed messages may be processed according to the set processing mode.
Illustratively, when the watcher object listens to the distributed message, it may display or respond to messages that it is capable of handling, discard messages that it is incapable of handling, and so on.
In the above step, in a first optional embodiment, the processing, by the client, the monitored distribution message according to the set processing manner through at least one observer object, includes: the client processes the monitored distribution message through at least one observer object.
In this case, since the distributed message monitored by the observer object is a message notified by the message distributor according to the message type, the distributed message monitored by the observer object only includes a message which can be processed by the observer object, and only the distributed message needs to be processed accordingly.
In the above step, in a second first alternative embodiment, the processing, by the client, the monitored distribution message according to the set processing manner through at least one observer object, includes: the client determines the processing mode of the distributed message according to the monitored message type in the distributed message through at least one observer object.
Because the distributed message monitored by the observer object is the distributed message indifferently notified by the message distributor, when the observer object monitors the distributed message generated by the message distributor through the monitoring thread, different processing modes can be adopted for the distributed message according to the type of the message included in the distributed message.
For example, when the observer object is a popup, the type of message that it can handle may be a notification type; when the observer object is a web page, the type of message that it can handle may be a private letter type or the like. Exemplary processing means for the distributed message include, but are not limited to, discard, display, response, etc., wherein the specific processing means for the distributed message may be determined according to the type of message in the distributed message.
Optionally, the client determines, through at least one observer object, a processing manner of the distributing message according to the monitored message type in the distributing message, including: the client verifies whether the monitored message type of the distributed message is a preset target monitoring type or not through at least one observer object; if yes, processing the message data in the monitored distribution message, otherwise, discarding the monitored distribution message.
In this embodiment, since the types of messages that can be processed by different objects may be different, different observer objects may set different target listening types correspondingly. In addition, the message types that can be processed by one observer object may include one or more, and correspondingly, the target listening type also includes one or more.
For example, when the observer object determines that the monitored message type of the distributed message is the target monitoring type corresponding to the monitored message type, it indicates that the observer object is a processor of the distributed message, and processes such as displaying and responding can be performed on message data in the monitored distributed message; when the observer object determines that the message type of the monitored distribution message does not belong to the target monitoring type corresponding to the observer object, the observer object is not the processor of the distribution message, and the monitored distribution message can be directly discarded.
According to the technical scheme, the message distributor is arranged in the client, the message distributor is used for receiving the target message pushed by the server, analyzing and processing is carried out on the target message, the distributed message is generated according to the message type and the message data in the target message, then the distributed message is notified to at least one observer object in the message distributor, the monitored distributed message is processed according to the set processing mode through the at least one observer object, the analysis and the distribution process of the message are uniformly completed through the independently arranged message distributor, the problems that in the prior art, a large amount of memory is occupied and the information distribution processing efficiency is reduced due to the fact that all objects in the client need to analyze and process each received message are solved, memory resources are saved, and the information distribution processing efficiency is improved.
On the basis of the embodiment, optionally, the message distributor exposes the protocol method to the outside in advance; at least one observer object completes the interception of the message notified by the message distributor by implementing a protocol method of message distributor exposure.
For example, an externally exposed protocol method can be predefined in the message distributor, and can be used as an interface for the message distributor to issue and distribute message notifications externally, and an observer object can realize the protocol method by calling and realize monitoring of the interface. The protocol method may be a global method including parameters for carrying the distribution message.
Example two
Fig. 2 is a flow chart of a message distribution processing method according to a second embodiment of the present disclosure. The embodiment is embodied based on each alternative in the foregoing embodiment, and provides an alternative message distribution processing method, specifically, before the client receives, through the message distributor, the target message pushed by the server, further including: and the client establishes long connection with the server according to the target domain name issued by the server. The client receives the target message pushed by the server through the message distributor, and specifically comprises the following steps: the client receives the target message pushed by the server through the message distributor by adopting long connection.
The message distribution processing method provided by the embodiment specifically comprises the following steps:
s210, the client establishes long connection with the server according to the target domain name issued by the server.
The long connection means that a plurality of data packets can be continuously transmitted on one connection, and both sides are required to transmit a link detection packet if no data packet is transmitted during connection maintenance. Long connections are often used for frequent, point-to-point communications, and the number of connections cannot be too high. Since each TCP connection requires three-way handshake and requires a lot of time, if each operation is a short connection, the processing speed will be greatly reduced, so that each operation is not disconnected after completion, and the data packet can be directly sent when the next processing is performed, without re-establishing the TCP connection.
In this embodiment, since the server continuously pushes the message to the client in the use process of the client, a long connection can be established between the client and the server, so as to save communication time and increase the message transmission speed. Specifically, the server may be provided with a plurality of domain names correspondingly, and when the server issues a domain name to the client, the server may select a target domain name that is most suitable for the client, so that the client establishes a long connection with the server according to the target domain name.
Compared with the mode of configuring a fixed domain name for each client to connect with a server in the prior art, the method has the advantages that the optimal data transmission path can be selected at any time according to the change of the position of the client, and the message pushing efficiency is improved.
Optionally, before the client establishes a long connection with the server according to the target domain name issued by the server, the method further includes: when the client detects a client starting instruction, the client sends a domain name request to a server; the domain name request is used for indicating the server to adopt a preset speed measurement algorithm, and a target domain name matched with the client is determined from at least two alternative domain names and sent to the client.
For example, if the server in this embodiment is a server cluster, including a plurality of server rooms, and the server rooms are distributed over different places, one server room corresponds to one domain name, and in order to increase the access speed, the server may select the most suitable server room for the client to connect. When the client is started, a client starting instruction can be detected, at this time, a domain name request can be sent to a server, after the server receives the domain name request, the server machine room with the highest access speed of the client can be selected from a plurality of server machine rooms as a server to be connected of the client according to a preset speed measurement algorithm, and a domain name corresponding to the server machine room is used as a target domain name and sent to the client, so that the client establishes connection with the server according to the target domain name.
In an optional implementation manner of this embodiment, the preset speed measurement algorithm may take domain names corresponding to several server rooms with relatively close distances to the client as alternative domain names, send speed measurement data packets to the alternative domain names through the client, and the server determines the speed of each link according to the transceiving time, so that the alternative domain name with the highest speed is selected as the target domain name and sent to the client.
Further, in another alternative embodiment, the preset speed measurement algorithm may take domain names corresponding to several server rooms with a relatively short distance from the client as alternative domain names, and send the alternative domain name with the minimum number of router nodes as the target domain name to the client by calculating the number of router nodes in the link corresponding to each alternative domain name.
S220, the client receives the target message pushed by the server through the message distributor by adopting long connection.
For example, when the client obtains the target domain name issued by the server, long connection can be established between the client and the server according to the target domain name, and the target message pushed by the server is received by adopting the long connection link, so that the message pushing efficiency is improved.
S230, the client analyzes the target message through the message distributor and generates a distribution message according to the message type and the message data in the target message.
S240, the client informs the distributed message to at least one observer object registered in the message distributor in advance through the message distributor.
S250, the client determines a processing mode of the distributed message according to the monitored message type in the distributed message through at least one observer object.
According to the technical scheme, long connection is established between the target domain name and the server, the target message pushed by the server is received by adopting the long connection, then the message distributor is used for analyzing and processing the target message, the distribution message is generated according to the message type and the message data in the target message, the distribution message is notified to at least one observer object registered in the message in advance, finally the processing mode of the distribution message is determined according to the monitored message type in the distribution message through the at least one observer object, the target domain name is dynamically sent by the server for the client, and the message pushed by the server is received by adopting the long connection mode, so that the message pushing efficiency is improved, the time of the message distribution processing is further shortened, and the efficiency of the message distribution processing is improved.
On the basis of the above embodiments, optionally, the method further includes: if the client detects an object destruction instruction matched with the target observer object, the registered target observer object is destroyed in the message distributor.
Illustratively, when the target observer object exits, e.g., when the user closes the target web page, indicating that the target observer object has not received a message pushed by the server, it may be determined that an object destruction instruction matching the target observer object is detected. In order to save memory space and release memory resources, the registered target observer object in the message distributor can be removed and destroyed when an object destruction instruction matched with the target observer object is detected.
Example III
Fig. 3 is a schematic structural diagram of a message distribution processing apparatus according to a third embodiment of the present disclosure. The message distribution processing apparatus provided in this embodiment may be configured in a client, and referring to fig. 3, the message distribution processing apparatus includes: the message receiving module 310, the message parsing module 320, the message distributing module 330, and the message processing module 340 are described in detail below.
A message receiving module 310, configured to receive, through a message distributor, a target message pushed by a server;
a message parsing module 320, configured to parse the target message through a message distributor, and generate a distribution message according to a message type and message data in the target message;
a message distribution module 330 for notifying, by a message distributor, at least one watcher object of the message distributor of the distribution message;
and the message processing module 340 is configured to process the monitored distribution message through at least one observer object according to a set processing manner.
According to the message distribution processing device, the message distributor is arranged in the client, the message distributor is used for receiving the target message pushed by the server, analyzing and processing is carried out on the target message, the distribution message is generated according to the message type and the message data in the target message, then the distribution message is notified to at least one observer object in the message distributor, the monitored distribution message is processed according to the set processing mode through the at least one observer object, the analysis and distribution processes of the message are uniformly completed through the independently arranged message distributor, the problem that in the prior art, a large amount of memory is occupied and the message distribution processing efficiency is reduced due to the fact that all objects in the client need to analyze and process each received message is solved, memory resources are saved, and the message distribution processing efficiency is improved.
Optionally, the message distribution module 330 may specifically be configured to:
notifying, by the message distributor, the distribution message to at least one watcher object matching the message type in accordance with the message type;
accordingly, the message processing module 340 may be specifically configured to:
processing the monitored distribution message through at least one observer object.
Optionally, the message distribution module 330 may specifically be configured to:
notifying, by the message distributor, the distribution message to at least one observer object registered in advance in the message distributor;
accordingly, the message processing module 340 may be specifically configured to:
and determining the processing mode of the distributed message according to the monitored message type in the distributed message through at least one observer object.
Optionally, the apparatus may further include:
the link establishment module is used for establishing long connection with the server according to the target domain name issued by the server before receiving the target message pushed by the server through the message distributor;
the message receiving module 310 may specifically be configured to:
and receiving the target message pushed by the server by the message distributor through the long connection.
Optionally, the apparatus may further include:
the request sending module is used for sending a domain name request to the server when a client starting instruction is detected before long connection is established between the target domain name issued by the server and the server;
the domain name request is used for indicating the server to adopt a preset speed measurement algorithm, and a target domain name matched with the client is determined from at least two alternative domain names and sent to the client.
Optionally, the message distributor exposes the protocol method to the outside in advance;
the at least one observer object completes interception of the message notified by the message distributor through the protocol method exposed by the message distributor.
Optionally, the mode determining module 340 may specifically be configured to:
verifying whether the monitored message type of the distribution message is a preset target monitoring type or not through at least one observer object; if yes, processing the monitored message data in the distributed message, otherwise, discarding the monitored distributed message.
Optionally, the apparatus may further include:
and the target destruction module is used for destroying the registered target observer object in the message distributor if an object destruction instruction matched with the target observer object is detected.
Optionally, the client includes: an application client adapted to an iOS operating system.
The product can execute the method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
Example IV
Referring now to fig. 4, a schematic diagram of a terminal device 400 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The terminal device shown in fig. 4 is only one example, and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the terminal apparatus 400 may include a processing device (e.g., a central processor, a graphic processor, etc.) 401, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the terminal apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
In general, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows a terminal device 400 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communications device 409, or from storage 408, or from ROM 402. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 401.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the terminal device; or may exist alone without being fitted into the terminal device.
The computer-readable medium carries one or more programs which, when executed by the terminal device, cause the terminal device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects an internet protocol address from the at least two internet protocol addresses and returns the internet protocol address; receiving an Internet protocol address returned by the node evaluation equipment; wherein the acquired internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer-readable medium carries one or more programs that, when executed by the terminal device, cause the terminal device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of a module or unit does not constitute a limitation on the module or unit itself in some cases, for example, a message receiving module may also be described as "a module for receiving a target message pushed by a server through a message distributor".
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).

Claims (9)

1. A message distribution processing method, comprising:
the client receives the target message pushed by the server through the message distributor; wherein the message dispatcher is a processing thread in the client;
the client analyzes the target message through a message distributor and generates a distribution message according to the message type and the message data in the target message;
the client informs at least one observer object of the message distributor of the distributed message through the message distributor;
the client processes the monitored distribution message through at least one observer object according to a set processing mode;
the client informs at least one observer object matched with the message type of the distributed message according to the message type through the message distributor;
the client processes the monitored distribution message through at least one observer object according to a set processing mode, and the method comprises the following steps: the client processes the monitored distribution message through at least one observer object; or alternatively, the process may be performed,
the client informs the distribution message to at least one observer object registered in the message distributor in advance through the message distributor;
the client processes the monitored distribution message through at least one observer object according to a set processing mode, and the method comprises the following steps: and the client determines the processing mode of the distributed message according to the monitored message type in the distributed message through at least one observer object.
2. The method of claim 1, wherein the client, prior to receiving the server pushed target message via the message distributor, further comprises:
the client establishes long connection with a server according to a target domain name issued by the server;
the client receives the target message pushed by the server through the message distributor, and specifically comprises the following steps:
and the client receives the target message pushed by the server through the message distributor by adopting the long connection.
3. The method of claim 2, wherein the client further comprises, prior to establishing a long connection with the server based on the target domain name issued by the server:
the client sends a domain name request to the server when detecting a client starting instruction;
the domain name request is used for indicating the server to adopt a preset speed measurement algorithm, and a target domain name matched with the client is determined from at least two alternative domain names and sent to the client.
4. A method according to any one of claims 1-3, characterized in that:
the message distributor exposes the protocol method to the outside in advance;
the at least one observer object completes interception of the message notified by the message distributor through the protocol method exposed by the message distributor.
5. The method according to claim 1, wherein the client determines, by at least one observer object, a processing manner of the distribution message according to the monitored message type in the distribution message, including:
the client verifies whether the monitored message type of the distribution message is a preset target monitoring type or not through at least one observer object; if yes, processing the monitored message data in the distributed message, otherwise, discarding the monitored distributed message.
6. A method according to any one of claims 1-3, further comprising:
and if the client detects an object destruction instruction matched with the target observer object, destroying the registered target observer object in the message distributor.
7. A message distribution processing apparatus configured in a client, comprising:
the message receiving module is used for receiving the target message pushed by the server through the message distributor; wherein the message dispatcher is a processing thread in the client;
the message analysis module is used for analyzing the target message through the message distributor and generating a distribution message according to the message type and the message data in the target message;
a message distribution module for notifying, by a message distributor, at least one observer object of the message distributor of the distribution message;
the message processing module is used for processing the monitored distribution message through at least one observer object according to a set processing mode;
the message distribution module is specifically configured to:
notifying, by the message distributor, the distribution message to at least one watcher object matching the message type in accordance with the message type;
accordingly, the message processing module may specifically be configured to:
processing the monitored distribution message through at least one observer object;
the message distribution module is specifically further configured to:
notifying, by the message distributor, the distribution message to at least one observer object registered in advance in the message distributor;
correspondingly, the message processing module is specifically further configured to:
and determining the processing mode of the distributed message according to the monitored message type in the distributed message through at least one observer object.
8. A terminal device, the device comprising:
one or more processing devices;
a storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing devices, the one or more processing devices are caused to implement the message distribution processing method of any of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by processing means, implements a message distribution processing method according to any one of claims 1-6.
CN201910189864.5A 2019-03-13 2019-03-13 Message distribution processing method, device, equipment and storage medium Active CN111694674B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910189864.5A CN111694674B (en) 2019-03-13 2019-03-13 Message distribution processing method, device, equipment and storage medium
PCT/CN2020/070692 WO2020181913A1 (en) 2019-03-13 2020-01-07 Message distribution processing method, device, equipment, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910189864.5A CN111694674B (en) 2019-03-13 2019-03-13 Message distribution processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111694674A CN111694674A (en) 2020-09-22
CN111694674B true CN111694674B (en) 2023-08-08

Family

ID=72427136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910189864.5A Active CN111694674B (en) 2019-03-13 2019-03-13 Message distribution processing method, device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN111694674B (en)
WO (1) WO2020181913A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711490B (en) * 2021-03-26 2021-07-16 统信软件技术有限公司 Message processing method, computing device and storage medium
CN113050922A (en) * 2021-03-31 2021-06-29 深圳追一科技有限公司 Customer service message processing method, system, device and readable storage medium
CN113132489A (en) * 2021-04-22 2021-07-16 中国工商银行股份有限公司 Method, device, computing equipment and medium for downloading file
CN113254839B (en) * 2021-06-18 2021-09-28 每日互动股份有限公司 Layer-by-layer message distribution method, electronic client and medium
CN113852667A (en) * 2021-08-27 2021-12-28 青岛海尔科技有限公司 Message pushing method and device, storage medium and electronic device
CN114003471B (en) * 2022-01-04 2022-04-08 深圳市明源云科技有限公司 Page loading analysis method and device and readable storage medium
CN114500535A (en) * 2022-01-21 2022-05-13 北京百度网讯科技有限公司 Message processing method and device, electronic equipment and storage medium
CN116662040B (en) * 2023-07-28 2023-09-29 百家云集团有限公司 Message distribution method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917525A (en) * 2010-09-15 2010-12-15 烽火通信科技股份有限公司 Method and device for processing notification message tasks in presence service
CN101925021A (en) * 2009-06-11 2010-12-22 中兴通讯股份有限公司 Method/system for processing messages and convergence service system
CN102591658A (en) * 2011-12-28 2012-07-18 奇智软件(北京)有限公司 Method and device for processing message
CN107659664A (en) * 2017-10-30 2018-02-02 珠海格力电器股份有限公司 A kind of method for message transmission, apparatus and system
CN108833950A (en) * 2018-06-29 2018-11-16 武汉斗鱼网络科技有限公司 A kind of barrage message issuing method, server, system and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7526480B2 (en) * 2001-06-08 2009-04-28 Cisco Technology, Inc. Method and apparatus for controlled access of requests from virtual private network devices to managed information objects using simple network management protocol and multi-topology routing
US7099947B1 (en) * 2001-06-08 2006-08-29 Cisco Technology, Inc. Method and apparatus providing controlled access of requests from virtual private network devices to managed information objects using simple network management protocol
US8630624B2 (en) * 2009-02-25 2014-01-14 Apple Inc. Managing notification messages
CN106648570A (en) * 2015-11-03 2017-05-10 深圳市中兴微电子技术有限公司 Multi-task display processing method and device for mobile terminal
CN108156205B (en) * 2016-12-06 2021-01-22 阿里巴巴(中国)有限公司 Message pushing method, client, server and programmable device
CN106933686A (en) * 2017-03-10 2017-07-07 广东欧珀移动通信有限公司 A kind of method for adjusting broadcast message queue, device and terminal
CN108023808B (en) * 2017-12-07 2020-10-16 深圳乐信软件技术有限公司 Message distribution method and device in application program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925021A (en) * 2009-06-11 2010-12-22 中兴通讯股份有限公司 Method/system for processing messages and convergence service system
CN101917525A (en) * 2010-09-15 2010-12-15 烽火通信科技股份有限公司 Method and device for processing notification message tasks in presence service
CN102591658A (en) * 2011-12-28 2012-07-18 奇智软件(北京)有限公司 Method and device for processing message
CN107659664A (en) * 2017-10-30 2018-02-02 珠海格力电器股份有限公司 A kind of method for message transmission, apparatus and system
CN108833950A (en) * 2018-06-29 2018-11-16 武汉斗鱼网络科技有限公司 A kind of barrage message issuing method, server, system and storage medium

Also Published As

Publication number Publication date
CN111694674A (en) 2020-09-22
WO2020181913A1 (en) 2020-09-17

Similar Documents

Publication Publication Date Title
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
CN109474688B (en) Method, device, equipment and medium for sending instant communication network request message
CN110750393B (en) Method, device, medium and equipment for avoiding network service double-machine hot standby brain cracking
CN110381042B (en) Graceful restart service method, device, medium and electronic equipment
JP7467644B2 (en) Message processing method, device and electronic device
CN111432001B (en) Method, apparatus, electronic device and computer readable medium for jumping scenes
US20240022661A1 (en) Suppressing indications of events in user interfaces
CN114938395A (en) Service response method, device, equipment and storage medium
CN112887420B (en) Message pushing method and device, computer readable storage medium and electronic equipment
US20210314442A1 (en) Cloud integration to desktop-based emergency service applications
CN111290861B (en) Message processing method and device and electronic equipment
CN111382058B (en) Service testing method and device, server and storage medium
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
CN110896569B (en) Bullet screen automatic reconnection method, storage medium, electronic equipment and system
CN115600964A (en) Voice approval method and device and related equipment
CN113839828B (en) Network quality detection method, device, terminal equipment and medium
CN116260747A (en) Monitoring method and device of terminal test equipment and electronic equipment
CN111290873B (en) Fault processing method and device
CN111274104B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN110221854B (en) Multi-process data updating method, device, medium and electronic equipment
CN109614137B (en) Software version control method, device, equipment and medium
CN114374635B (en) Route detection method, device, equipment and storage medium
CN113179211B (en) Method and device for routing and for setting up a communication connection
CN111382057B (en) Test case generation method, test method and device, server and storage medium
WO2023130845A1 (en) Communication method and apparatus, and computer-readable storage medium, electronic device and program product

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