CN111694674A - 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
CN111694674A
CN111694674A CN201910189864.5A CN201910189864A CN111694674A CN 111694674 A CN111694674 A CN 111694674A CN 201910189864 A CN201910189864 A CN 201910189864A CN 111694674 A CN111694674 A CN 111694674A
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.)
Granted
Application number
CN201910189864.5A
Other languages
Chinese (zh)
Other versions
CN111694674B (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure discloses a message distribution processing method, a message distribution processing device, a message distribution processing equipment and a storage medium. The method comprises the following steps: the client receives a 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 notifying at least one observer object of a message distributor of the distribution message through the message distributor; and the client processes the monitored distribution message through at least one observer object according to a set processing mode. By the technical scheme of the embodiment of the disclosure, memory resources can be saved, and the efficiency of message distribution processing can be improved.

Description

Message distribution processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for distributing and processing a message.
Background
During the use process, the application software client often receives various messages pushed by the server, so that the relevant objects in the client process the received messages.
In the prior art, when an application client running on an iOS operating system receives a message pushed by a server, there is no effective message distribution processing mechanism, and each received message is analyzed and processed mainly by one or more currently running object processes (for example, an interface or a popup window) in the client, so as to determine whether the message belongs to a message processed by the object process, and acquire information matched with the object process for processing.
The prior art has the defects that all object processes need to analyze and process each received message, so that a large amount of memory resources are occupied, and the message distribution processing efficiency is reduced.
Disclosure of Invention
The embodiment of the disclosure provides a method, a device, equipment and a storage medium for message distribution processing, 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 a 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 notifying at least one observer object of a message distributor of the distribution message through the message distributor;
and the client processes the monitored distribution message through at least one observer object according to a set processing mode.
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 a message distributor and generating a distribution message according to the message type and the message data in the target message;
a message distribution module to notify, by a message distributor, the distribution message to at least one observer object of the message distributor;
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, where the terminal device includes:
one or more processing devices;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses are caused to implement the message distribution processing method according to any one of the embodiments of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processing device, implements the message distribution processing method as described in any of the disclosed embodiments.
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, 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 of the message distributor, the monitored distribution message is processed by the at least one observer object according to the set processing mode, and the message analyzing and distributing processes are completed uniformly by the independently arranged message distributor, so that the problems that in the prior art, because all objects in the client need to analyze and process each received message, a large amount of memory is occupied, and the message distribution processing efficiency is reduced are solved, the memory resource is saved, and the message distribution processing efficiency is improved.
Drawings
Fig. 1 is a schematic flowchart of a message distribution processing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a message distribution processing method provided in the second embodiment of the present 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 diagram of a 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 accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not limiting of the disclosure. It should be further noted that, for the convenience of description, only some of the structures relevant to the present disclosure are shown in the drawings, not all of them.
In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution.
Example one
Fig. 1 is a schematic flowchart of a message distribution processing method according to an embodiment of the present disclosure. The method is applicable to the condition that the client distributes and processes the received message, can be executed by terminal equipment such as a mobile phone or a tablet personal computer and the like running an application program client, 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 a private letter and a notification pushed by the server to the client. Because there is no effective message distribution processing mechanism in the existing iOS operating system, when a client receives a target message pushed by a server, each received message can only be analyzed and processed by all objects (also referred to as processes or instances) in the client, so as to determine whether the object is a message handler, so that each object needs to perform a repeated analysis process on each message, when a large number of pushed messages are received at the same time, the client occupies a large amount of memory resources, the operation of the client becomes stuck, and the efficiency of message distribution processing is also reduced.
In order to solve the above problem, in this embodiment, a message dispatcher (MessageDispatcher) is provided in the client, and 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 can receive the target message through the message distributor.
The client according to this embodiment may refer to a mobile APP (Application), or may refer to a web page, which is not limited herein.
Optionally, the client includes: an application client adapted to the iOS operating system. That is, the client related to this embodiment may be installed in the iOS operating system to make up for the defect 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, and the like, which is not limited in this embodiment.
And S120, 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.
In this embodiment, after receiving the target message pushed by the server, the client may uniformly parse the target message by using the message distributor. Specifically, the client may split or identify the target message into the message data and the message type corresponding to the message data through the message distributor.
For example, the distribution message may be generated according to a preset format by using the message data and the message type obtained through parsing, where the preset format may be "message type + message data", so that when the message is processed in the subsequent step, the distribution message may be directly identified according to the message type.
S130, the client notifies the distribution message to at least one observer object of the message distributor through the message distributor.
In this embodiment, the observer object may be an object that needs to receive the distribution message in the client, and the object includes, but is not limited to, a certain web page, a certain pop-up window, and the like in the client. For example, after the client generates the distribution message through the message distributor, the client may notify each watcher object of the message distributor of the distribution message, so that the watcher object can process the pushed message. Specifically, a listening thread may be provided for each observer object for listening to the distribution message generated in the message distributor.
In an alternative embodiment, the client notifying at least one watcher object of the message distributor of the distribution message by the message distributor, comprises: and the client informs the distribution message to at least one observer object matched with the message type according to the message type through the message distributor.
Since different observer objects may process different message types, the message distributor may notify the corresponding observer object capable of processing the message type of the distribution message according to the message type, so that the corresponding observer object directly processes the monitored distribution 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 distribution message of the different message types through the correspondence.
In another alternative embodiment, the client notifying at least one watcher object of the message distributor of the distribution message by the message distributor, comprises: the client notifies the distribution message to at least one watcher object pre-registered in the message distributor through the message distributor.
When at least one object in the client needs to receive the message pushed by the server, the object can be registered in the message distributor in advance. As an actual example, if an opening operation of a user for a target web page in a client is detected, the target web page may be automatically registered in a message distributor as a viewer object. Similarly, if the user opening operation for the target popup window in the client is detected, the target popup window can be automatically registered in the message distributor as another observer object.
Because the objects which are interested in the message pushed by the server in the client are registered in the message distributor in advance, when the message distributor generates the distribution message, only the registered observer object can receive the notification of the distribution message, thereby avoiding the indiscriminate monitoring of the message by 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 according to a set processing mode through at least one observer object.
Since the messages that can be processed by different objects in the client may be different, and the distribution message that is monitored by the observer object may only include the message that can be processed by the observer object itself, or may also include other messages, the distribution message may be processed according to the set processing method.
For example, when the observer object listens to the distribution message, the observer object may display or respond to messages that can be processed by the observer object, discard messages that cannot be processed, and the like.
In the foregoing step, in a first optional implementation manner, 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 distribution message monitored by the observer object is a message notified by the message distributor according to the message type, the distribution message monitored by the observer object only includes a message that can be processed, and only the distribution message needs to be processed accordingly.
In the foregoing step, in a second optional implementation manner, the processing, by the client, the distribution message monitored by the at least one observer object according to the set processing manner includes: and the client determines a processing mode of the distribution message according to the monitored message type in the distribution message through at least one observer object.
Since the distribution message monitored by the observer object is a distribution message which is notified indiscriminately by the message distributor, when the observer object monitors the distribution message generated by the message distributor through the monitoring thread, different processing modes can be adopted for the distribution message according to the message type included in the distribution message.
For example, when the watcher object is a popup, the type of message it can handle may be a notification type; when the watcher object is a web page, the type of message that it can handle may be a type of private letter, or the like. For example, the processing manner of the distribution message includes, but is not limited to, discarding, displaying, responding, and the like, and the specific processing manner of the distribution message may be determined according to the message type in the distribution message.
Optionally, the determining, by the client, a processing manner of the distribution message according to the monitored message type in the distribution message by the at least one observer object includes: the client verifies whether the monitored message type of the distribution message is a preset target monitoring type through at least one observer object; if so, processing the message data in the monitored distribution message, otherwise, discarding the monitored distribution message.
In this embodiment, because the message types 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 handled by a watcher object can include one or more types, and correspondingly, the target listening type also includes one or more types.
For example, when the observer object determines that the message type of the monitored distribution message is the preset target monitoring type corresponding to the message type, it indicates that the observer object is a processor of the distribution message, and can perform processing such as display, response and the like on message data in the monitored distribution message; when the observer object determines that the message type of the monitored distribution message does not belong to the preset target monitoring type corresponding to the observer object, the observer object is not a processor of the distribution message, and the monitored distribution message can be directly discarded.
According to the technical scheme of the embodiment, 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, 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 of the message distributor, the monitored distribution message is processed through the at least one observer object according to the set processing mode, and the message analyzing and distributing processes are completed uniformly through the independently arranged message distributor, so that the problems that in the prior art, because all objects in the client need to analyze and process each received message, a large amount of memory is occupied, and the message distribution processing efficiency is reduced are solved, memory resources are saved, and the message distribution processing efficiency is improved.
On the basis of the above embodiment, optionally, the message distributor exposes the protocol method to the outside in advance; at least one watcher object completes listening to messages notified by the message distributor by implementing a protocol method exposed by the message distributor.
For example, a protocol method exposed to the outside may be predefined in the message distributor, and the protocol method may be implemented by calling the observer object to implement the monitoring of the interface, where the protocol method is used as an interface for the message distributor to issue a distribution message notification to the outside. Wherein the protocol method may be a global method comprising parameters for carrying the distribution message.
Example two
Fig. 2 is a schematic flow chart of a message distribution processing method according to a second embodiment of the present disclosure. The present embodiment is embodied on the basis of various optional solutions in the foregoing embodiments, and provides an optional message distribution processing method, specifically that before a client receives a target message pushed by a server through a message distributor, the method further includes: the client establishes long connection with the server according to the target domain name issued by the server. The method for receiving the target message pushed by the server through the message distributor by the client 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 includes 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 if no data packet is transmitted during the connection holding period, a link detection packet needs to be transmitted by two sides. The long connection can be used for communication with frequent operation and point-to-point, and the number of connections cannot be too many. Because each TCP connection needs three-step handshake and needs a lot of time, if each operation is short connection, the processing speed can be greatly reduced, so that each operation is not disconnected after being completed, and a data packet can be directly sent during the next processing without reestablishing the TCP connection.
In this embodiment, since the server continuously pushes the message to the client during the use of the client, a long connection can be established between the client and the server, so as to save the communication time and improve the message transmission speed. Specifically, the server may be correspondingly provided with a plurality of domain names, and when the server issues a domain name to the client, the server may select a target domain name 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 the server in the prior art, the method for connecting the server by using the dynamic domain name has the advantages that the optimal data transmission path can be selected at any time according to the position change of the client, and the message pushing efficiency is improved.
Optionally, before the client establishes the long connection with the server according to the target domain name issued by the server, the method further includes: when detecting a client starting instruction, the client sends a domain name request to 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 side is determined from the at least two alternative domain names and is issued to the client side.
For example, if the server in this embodiment is a server cluster including a plurality of server rooms, and the server rooms are located in 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 the moment, a domain name request can be sent to the server, after the server receives the domain name request, the server room with the highest access speed of the client can be selected from a plurality of server 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 room is taken 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 be that domain names corresponding to several server rooms close to the client are used as alternative domain names, the client sends speed measurement data packets to the alternative domain names respectively, and the server determines the speed of each link according to the sending and receiving time, so as to select the alternative domain name with the highest speed as the target domain name and send the target domain name to the client.
Further, in another optional implementation, the preset speed measurement algorithm may be that domain names corresponding to several server rooms close to the client are used as alternative domain names, and the number of router nodes in a link corresponding to each alternative domain name is calculated, so that the alternative domain name with the smallest number of router nodes is sent to the client as a target domain name.
And S220, the client receives the target message pushed by the server through the message distributor by adopting long connection.
Illustratively, when the client acquires the target domain name issued by the server, the long connection can be established with the server according to the target domain name, and the long connection link is adopted to receive the target message pushed by the server, so that the message pushing efficiency is improved.
And 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 notifies the distribution message to at least one observer object pre-registered in the message distributor through the message distributor.
And S250, the client determines a processing mode of the distribution message according to the monitored message type in the distribution message through at least one observer object.
According to the technical scheme of the embodiment, long connection is established with the server according to the issued target domain name, the target message pushed by the server is received through the long connection, then the target message is analyzed and processed through the message distributor, 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 which is registered in the message weather in advance, finally the processing mode of the distribution message is determined through the at least one observer object according to the message type in the monitored distribution message, the target domain name is dynamically issued to the client through the server, the message pushed by the server is received through the long connection mode, and the message pushing efficiency is improved, so that the message distribution processing time is further shortened, and the message distribution processing efficiency is improved.
On the basis of the foregoing embodiments, optionally, the method further includes: and 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.
For example, when the target observer object exits, for example, when the user closes the target webpage, indicating that the target observer object does not need to receive the 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, which are described in detail below.
A message receiving module 310, configured to receive, through a message distributor, a target message pushed by a server;
the message analysis module 320 is configured to analyze 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 according to a set processing manner through at least one observer object.
The message distribution processing apparatus provided by this embodiment, by setting a message distributor in a client, receives a target message pushed by a server using the message distributor, and analyzes the target message, generates a distribution message according to the message type and the message data in the target message, then the distribution message is informed to at least one observer object in the message distributor, the at least one observer object processes the monitored distribution message according to the set processing mode, the message distributor which is independently arranged is utilized to uniformly complete the analysis and distribution process of the message, thereby solving the problem that all objects in the client side need to analyze and process each received message in the prior art, the problems of large occupation of the memory and reduction of the message distribution processing efficiency are caused, the memory resource is saved, and the message distribution processing efficiency is improved.
Optionally, the message distribution module 330 may be specifically configured to:
notifying, by the message distributor, the distribution message to at least one watcher object that matches the message type according to the message type;
correspondingly, the message processing module 340 may specifically be configured to:
processing the distribution message as heard by at least one watcher object.
Optionally, the message distribution module 330 may be specifically configured to:
notifying, by the message distributor, the distribution message to at least one watcher object pre-registered in the message distributor;
correspondingly, the message processing module 340 may specifically be configured to:
and determining a processing mode of the distribution message by at least one observer object according to the monitored message type in the distribution message.
Optionally, the apparatus may further include:
the link establishing module is used for establishing long connection with the server according to a target domain name sent by the server before receiving a target message pushed by the server through the message distributor;
the message receiving module 310 may be specifically configured to:
and receiving the target message pushed by the server by adopting the long connection through a message distributor.
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 with the server according to a target domain name issued by the server;
and the domain name request is used for indicating the server to adopt a preset speed measurement algorithm, and determining a target domain name matched with the client side from at least two alternative domain names and issuing the target domain name to the client side.
Optionally, the message distributor exposes the protocol method to the outside in advance;
the at least one watcher object completes listening to messages notified by the message distributor by implementing the protocol method exposed by the message distributor.
Optionally, the manner determining module 340 may be specifically 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 so, processing the monitored message data in the distribution message, otherwise, discarding the monitored distribution 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 the iOS operating system.
The product can execute the method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Referring now to fig. 4, a block diagram of a terminal device 400 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The terminal device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the terminal device 400 may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 401 that 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 means 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 via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, 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, 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 illustrates a terminal apparatus 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the 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 illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present 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 contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be included in the terminal device; or may exist separately without being assembled 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 the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, 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 for aspects of the present disclosure may be written in any combination of 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a module or unit does not in some cases constitute a limitation of the module or unit itself, for example, the 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 exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (11)

1. A message distribution processing method, comprising:
the client receives a 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 notifying at least one observer object of a message distributor of the distribution message through the message distributor;
and the client processes the monitored distribution message through at least one observer object according to a set processing mode.
2. The method of claim 1, wherein the client notifies at least one watcher object of a message distributor of the distribution message through the message distributor, comprising:
the client side informs the distribution information to at least one observer object matched with the information type according to the information type through the information 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 processes the monitored distribution message through at least one observer object.
3. The method of claim 1, wherein the client notifies at least one watcher object of a message distributor of the distribution message through 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;
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 a processing mode of the distribution message according to the monitored message type in the distribution message through at least one observer object.
4. The method of claim 1, wherein the client, before receiving the target message pushed by the server through the message distributor, further comprises:
the client establishes long connection with the server according to a target domain name issued by the server;
the client receives a target message pushed by a server through a message distributor, and specifically includes:
and the client receives the target message pushed by the server by adopting the long connection through a message distributor.
5. The method of claim 4, wherein before the client establishes the long connection with the server according to the target domain name issued by the server, the method further comprises:
the method comprises the steps that when a client side starting instruction is detected by the client side, a domain name request is sent to a server;
and the domain name request is used for indicating the server to adopt a preset speed measurement algorithm, and determining a target domain name matched with the client side from at least two alternative domain names and issuing the target domain name to the client side.
6. The method according to any one of claims 1 to 5, wherein:
the message distributor exposes the protocol method to the outside in advance;
the at least one watcher object completes listening to messages notified by the message distributor by implementing the protocol method exposed by the message distributor.
7. The method of claim 3, wherein the determining, by the client, a processing manner of the distribution message according to the monitored message type in the distribution message by the at least one watcher object comprises:
the client verifies whether the message type of the monitored distribution message is a preset target monitoring type through at least one observer object; if so, processing the monitored message data in the distribution message, otherwise, discarding the monitored distribution message.
8. The method of any one of claims 1-5, further comprising:
and if the client detects an object destruction instruction matched with the target observer object, the client destroys the registered target observer object in the message distributor.
9. 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;
the message analysis module is used for analyzing the target message through a message distributor and generating a distribution message according to the message type and the message data in the target message;
a message distribution module to notify, by a message distributor, the distribution message to at least one observer object of the message distributor;
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.
10. A terminal device, characterized in that the device comprises:
one or more processing devices;
storage means for storing one or more programs;
when executed by the one or more processing devices, cause the one or more processing devices to implement the message distribution processing method of any one of claims 1-8.
11. A computer-readable storage medium on which a computer program is stored, characterized in that the program, when executed by a processing device, implements a message distribution processing method according to any one of claims 1 to 8.
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 true CN111694674A (en) 2020-09-22
CN111694674B 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)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711490A (en) * 2021-03-26 2021-04-27 统信软件技术有限公司 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
CN113254839A (en) * 2021-06-18 2021-08-13 每日互动股份有限公司 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
CN114003471A (en) * 2022-01-04 2022-02-01 深圳市明源云科技有限公司 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
CN116662040A (en) * 2023-07-28 2023-08-29 百家云集团有限公司 Message distribution method and device, electronic equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132489A (en) * 2021-04-22 2021-07-16 中国工商银行股份有限公司 Method, device, computing equipment and medium for downloading file

Citations (8)

* 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
US20110289172A1 (en) * 2009-02-25 2011-11-24 Apple Inc. Managing notification messages
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
US20180160396A1 (en) * 2016-12-06 2018-06-07 Guangzhou Ucweb Computer Technology Co., Ltd. Message pushing method, client, server and programmable device
US20180262358A1 (en) * 2017-03-10 2018-09-13 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for monitoring broadcast message and terminal
CN108833950A (en) * 2018-06-29 2018-11-16 武汉斗鱼网络科技有限公司 A kind of barrage message issuing method, server, system and storage medium

Family Cites Families (4)

* 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
CN106648570A (en) * 2015-11-03 2017-05-10 深圳市中兴微电子技术有限公司 Multi-task display processing method and device for mobile terminal
CN108023808B (en) * 2017-12-07 2020-10-16 深圳乐信软件技术有限公司 Message distribution method and device in application program

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110289172A1 (en) * 2009-02-25 2011-11-24 Apple Inc. Managing notification messages
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
US20180160396A1 (en) * 2016-12-06 2018-06-07 Guangzhou Ucweb Computer Technology Co., Ltd. Message pushing method, client, server and programmable device
US20180262358A1 (en) * 2017-03-10 2018-09-13 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for monitoring broadcast message and terminal
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

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112711490A (en) * 2021-03-26 2021-04-27 统信软件技术有限公司 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
CN113254839A (en) * 2021-06-18 2021-08-13 每日互动股份有限公司 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
CN114003471A (en) * 2022-01-04 2022-02-01 深圳市明源云科技有限公司 Page loading analysis method and device and readable storage medium
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
CN116662040A (en) * 2023-07-28 2023-08-29 百家云集团有限公司 Message distribution 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

Also Published As

Publication number Publication date
WO2020181913A1 (en) 2020-09-17
CN111694674B (en) 2023-08-08

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
CN109446309B (en) Question feedback method and device
CN110177300B (en) Program running state monitoring method and device, electronic equipment and storage medium
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
CN110908921A (en) Game problem positioning method and device, electronic equipment and storage medium
CN112887420B (en) Message pushing method and device, computer readable storage medium and electronic equipment
CN111935497B (en) Video stream management method and data server for traffic police system
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
CN113094002B (en) Message processing method, device, electronic equipment and computer medium
CN111290873B (en) Fault processing method and device
CN116260747A (en) Monitoring method and device of terminal test equipment and electronic equipment
CN109614137B (en) Software version control method, device, equipment and medium
CN111382057B (en) Test case generation method, test method and device, server and storage medium
CN109842549B (en) Instant messaging interaction method and device and electronic equipment
CN106604244B (en) Method and device for prompting notification message
CN111142740A (en) Data updating method, device and storage medium
CN111324512B (en) Method, apparatus, electronic device, and computer-readable medium for generating text
CN117149450A (en) Message processing method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant