CN107708194A - A kind of message filtering method and device, terminal and readable storage medium storing program for executing - Google Patents

A kind of message filtering method and device, terminal and readable storage medium storing program for executing Download PDF

Info

Publication number
CN107708194A
CN107708194A CN201711105232.3A CN201711105232A CN107708194A CN 107708194 A CN107708194 A CN 107708194A CN 201711105232 A CN201711105232 A CN 201711105232A CN 107708194 A CN107708194 A CN 107708194A
Authority
CN
China
Prior art keywords
data message
application program
link layer
message
filtering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711105232.3A
Other languages
Chinese (zh)
Inventor
尹斌斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Meizu Technology Co Ltd
Original Assignee
Meizu 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 Meizu Technology Co Ltd filed Critical Meizu Technology Co Ltd
Priority to CN201711105232.3A priority Critical patent/CN107708194A/en
Publication of CN107708194A publication Critical patent/CN107708194A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0238Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where the received signal is an unwanted signal, e.g. interference or idle signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0229Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal where the received signal is a wanted signal
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present invention relates to communication technical field, more particularly to a kind of message filtering method and device, terminal and readable storage medium storing program for executing.This method is:Data message is received, and judges the type of message of the data message in a link layer;When it is determined that the data message is unicast data message, it is based on default filtering rule in link layer and filtration treatment is carried out to the data message, and according to filter result, it is determined whether by the data message forwarding to corresponding application program.Using the above method, the judgement of type of message is carried out to the data message received on end link layer, and judge data message for unicast data message when, filtration treatment is carried out to unicast data message using default filtering rule, terminal system is avoided to be waken up by useless unicast data message, so as to reduce terminal CPU processing loads, terminal system power consumption is reduced.

Description

Message filtering method and device, terminal and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for filtering a packet, a terminal, and a readable storage medium.
Background
With the rapid development of information technology and the brought of the era of mobile internet, mobile phones, tablet computers and the like have become a necessity in daily life of people, and people can perform activities such as social contact, shopping, office work and the like by using the mobile phones/tablet computers. For example, a person may receive mail using a cell phone/tablet. The intelligent terminal greatly improves the convenience of daily life of people.
At present, in a mobile phone/tablet computer system, filtering processing is not performed on a received multicast data packet, a received broadcast data packet, or a received unicast data packet, or filtering based on a Media Access Control (MAC) address is performed only on a link layer on the received multicast data packet and/or the received broadcast data packet, that is, it is determined in the link layer whether a destination MAC address carried by the received multicast data packet and/or the received broadcast data packet is an MAC address of the mobile phone/tablet computer itself, if so, the multicast data packet and/or the received broadcast data packet is received, and the multicast data packet and/or the received broadcast data packet is transmitted to a corresponding Application program (APP) based on a destination port carried by the multicast data packet and/or the received broadcast data packet; otherwise, discarding the multicast data message and/or the broadcast data message.
However, in the current mobile phone/tablet computer system, the unicast data messages received by the WIFI chip of the mobile phone/tablet computer are not filtered, so that the mobile phone/tablet computer system needs to be awakened to perform subsequent processing when the WIFI chip receives one unicast data message, and some unicast data messages are not received by the corresponding APP and are meaningless unicast data messages for the user, so that the mobile phone/tablet computer system is awakened by the meaningless unicast data messages, the processing load of the CPU of the mobile phone/tablet computer is increased, and the power consumption of the system is increased.
Disclosure of Invention
The embodiment of the invention aims to provide a message filtering method and device, a terminal and a readable storage medium, which are used for solving the problems of large processing load of a mobile phone CPU and high system power consumption in the prior art.
The specific technical scheme provided in the embodiment of the invention is as follows:
a message filtering method comprises the following steps:
receiving a data message, and judging the message type of the data message in a link layer;
and when the data message is determined to be a unicast data message, filtering the data message based on a preset filtering rule in a link layer, and determining whether to forward the data message to a corresponding application program according to a filtering result.
Preferably, the determining the packet type of the data packet in the link layer specifically includes:
and determining the message type of the data message in a link layer based on a destination IP address and/or an MAC address carried by the received data message, wherein the message type is a multicast data message, a broadcast data message or a unicast data message.
Preferably, the preset filtering rule at least includes one of the following:
setting a white list mapping list in the link layer in advance, wherein the white list mapping list stores a mapping relation between an application program which is allowed to receive the unicast data message and a port number used by the application program; or,
setting a blacklist mapping list in the link layer in advance, wherein a mapping relation between an application program for prohibiting receiving the unicast data message and a port number used by the application program is stored in the blacklist mapping list.
Preferably, the filtering processing is performed on the data packet based on a preset filtering rule in the link layer, and whether to forward the data packet to the corresponding application program is determined according to a filtering result, which specifically includes:
if a white list mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
Judging whether a mapping relation between the destination port number and an application program which uses the destination port number to receive the data message is stored in the white list mapping list, and if the judging result is negative, discarding the data message;
if the judgment result is yes, continuing to judge whether the destination port number is activated, and if the judgment result is yes, forwarding the data message to an application program corresponding to the destination port number;
otherwise, discarding the data message.
Preferably, the filtering processing is performed on the data packet based on a preset filtering rule in the link layer, and whether to forward the data packet to the corresponding application program is determined according to a filtering result, which specifically includes:
if a blacklist mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
And judging whether the blacklist mapping list stores the mapping relation between the destination port number and an application program which uses the destination port number to receive the data message, if so, discarding the data message, otherwise, forwarding the data message to the application program corresponding to the destination port number.
Preferably, the filtering processing is performed on the data packet based on a preset filtering rule in the link layer, and whether to forward the data packet to the corresponding application program is determined according to a filtering result, which specifically includes:
judging whether the number of unicast data messages received within a preset time length is greater than or equal to a first set threshold value, if so, discarding the data messages, otherwise, forwarding the data messages to corresponding application programs based on a target port number carried by the data messages; and/or the presence of a gas in the gas,
and judging whether the number of times of awakening the terminal system in a preset time is greater than or equal to a second set threshold value, if so, discarding the data message, otherwise, forwarding the data message to a corresponding application program based on a target port number carried by the data message.
A message filtering device, comprising:
the judging unit is used for receiving the data message and judging the message type of the data message in a link layer;
and the filtering unit is used for filtering the data message based on a preset filtering rule in a link layer when the data message is determined to be a unicast data message, and determining whether to forward the data message to a corresponding application program according to a filtering result.
Preferably, when the packet type of the data packet is determined in the link layer, the determining unit is specifically configured to:
and determining the message type of the data message in a link layer based on a destination IP address and/or an MAC address carried by the received data message, wherein the message type is a multicast data message, a broadcast data message or a unicast data message.
Preferably, the preset filtering rule at least includes one of the following:
setting a white list mapping list in the link layer in advance, wherein the white list mapping list stores a mapping relation between an application program which is allowed to receive the unicast data message and a port number used by the application program; or,
setting a blacklist mapping list in the link layer in advance, wherein a mapping relation between an application program for prohibiting receiving the unicast data message and a port number used by the application program is stored in the blacklist mapping list.
Preferably, when the link layer performs filtering processing on the data packet based on a preset filtering rule, and determines whether to forward the data packet to a corresponding application program according to a filtering result, the filtering unit is specifically configured to:
if a white list mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
Judging whether a mapping relation between the destination port number and an application program which uses the destination port number to receive the data message is stored in the white list mapping list, and if the judging result is negative, discarding the data message;
if the judgment result is yes, continuing to judge whether the destination port number is activated, and if the judgment result is yes, forwarding the data message to an application program corresponding to the destination port number;
otherwise, discarding the data message.
Preferably, when the link layer performs filtering processing on the data packet based on a preset filtering rule, and determines whether to forward the data packet to a corresponding application program according to a filtering result, the filtering unit is specifically configured to:
if a blacklist mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
And judging whether the blacklist mapping list stores the mapping relation between the destination port number and an application program which uses the destination port number to receive the data message, if so, discarding the data message, otherwise, forwarding the data message to the application program corresponding to the destination port number.
Preferably, when the link layer performs filtering processing on the data packet based on a preset filtering rule, and determines whether to forward the data packet to a corresponding application program according to a filtering result, the filtering unit is specifically configured to:
judging whether the number of unicast data messages received within a preset time length is greater than or equal to a first set threshold value, if so, discarding the data messages, otherwise, forwarding the data messages to corresponding application programs based on a target port number carried by the data messages; and/or the presence of a gas in the gas,
and judging whether the times of awakening the device system in a preset time length is greater than or equal to a second set threshold value, if so, discarding the data message, otherwise, forwarding the data message to a corresponding application program based on a target port number carried by the data message.
A terminal comprising a processor for implementing the steps of any one of the methods described above when executing a computer program stored in a memory.
A readable storage medium, having stored thereon a computer program (instructions) which, when executed by a processor, implement the steps of any one of the methods as described above.
The invention has the following beneficial effects:
in summary, in the embodiment of the present invention, in the process of filtering a packet, a data packet is received, and a packet type of the data packet is determined in a link layer; and when the data message is determined to be a unicast data message, filtering the data message based on a preset filtering rule in a link layer, and determining whether to forward the data message to a corresponding application program according to a filtering result.
By adopting the method, the message type of the received data message is judged on the terminal link layer, and when the data message is judged to be the unicast data message, the unicast data message is filtered by adopting the preset filtering rule, so that the terminal system is prevented from being awakened by useless unicast data messages, the processing load of a terminal CPU is reduced, and the power consumption of the terminal system is reduced.
Drawings
Fig. 1 is a detailed flowchart of a message filtering method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a message filtering apparatus according to an embodiment of the present invention.
Detailed Description
In order to solve the problems of large processing load of a mobile phone CPU and high system power consumption in the prior art, the embodiment of the invention provides a new message filtering method and a device, wherein the method comprises the following steps: receiving a data message, and judging the message type of the data message in a link layer; and when the data message is determined to be a unicast data message, filtering the data message based on a preset filtering rule in a link layer, and determining whether to forward the data message to a corresponding application program according to a filtering result.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The scheme of the present invention will be described in detail by way of specific examples, but the present invention is not limited to the following examples.
Referring to fig. 1, in the embodiment of the present invention, a detailed flow of a message filtering method is as follows:
step 100: and receiving a data message, and judging the message type of the data message in a link layer.
Specifically, in the embodiment of the present invention, when step 100 is executed, the terminal receives a data packet through a local communication chip (e.g., a Wifi module), and determines a packet type of the data packet in a link layer based on a destination IP address and/or an MAC address carried by the received data packet, where the packet type is a multicast data packet, a broadcast data packet, or a unicast data packet.
In practical application, the IP network data transmission mode includes three modes, namely unicast transmission, multicast transmission and broadcast transmission, where a data packet sent by the source terminal in the unicast transmission mode is a unicast data packet, correspondingly, a data packet sent by the source terminal in the multicast transmission mode is a multicast data packet, and a data packet sent by the source terminal in the broadcast transmission mode is a broadcast data packet. Any data message sent by the source terminal through the IP network data transmission mode at least carries information such as a corresponding source port number, a source IP address, a destination port number, a destination IP address, a destination MAC address, and the like. Then, in the embodiment of the present invention, when receiving the data packet, the destination terminal may determine, according to the destination IP address and/or the MAC address carried in the data packet, that the data type of the data packet is a unicast data packet, a multicast data packet, or a broadcast data packet.
For example, assuming that the IP address of the terminal 1 is IP1, when the terminal 1 receives the data packet 1, the terminal 1 obtains the destination IP address carried by the data packet 1, and if the destination IP address is IP1, the data type of the data packet 1 is determined to be a unicast data packet.
For another example, assuming that the multicast IP address of the multicast group in which the terminal 1 is located is IP2, when receiving the data packet 2, the terminal 1 acquires the destination IP address carried in the data packet 2, and if the destination IP address is determined to be IP2, determines that the data type of the data packet 2 is a multicast data packet.
For another example, assuming that after the data packet 3 is received by the terminal 1, the destination IP address carried in the obtained data packet 3 is a broadcast address, the data type of the data packet 3 is determined to be a broadcast data packet.
Step 110: and when the data message is determined to be a unicast data message, filtering the data message on the basis of a preset filtering rule in a link layer, and determining whether to forward the data message to a corresponding application program according to a filtering result.
In the embodiment of the present invention, for a unicast data packet, a terminal presets a corresponding unicast data packet filtering rule in a link layer, and specifically, the mode of presetting the filtering rule includes, but is not limited to, any one or a combination of the following modes:
the first mode is as follows: and setting a white list mapping list in the link layer in advance, wherein the white list mapping list stores a mapping relation between an application program which is allowed to receive the unicast data message and a port number used by the application program.
If the filtering rule of the first mode is preset in the link layer of the terminal, when the terminal determines that the message type of the received data message is a unicast data message, the specific process of filtering the data message based on the preset filtering rule in the link layer and determining whether to forward the data message to a corresponding application program according to the filtering result is as follows: if a white list mapping list is set in the link layer, acquiring a destination port number carried by the data message; judging whether the white list mapping list stores the mapping relation between the destination port number and an application program which uses the destination port number to receive the data message, and if not, discarding the data message; if yes, continuing to judge whether the destination port number is activated, and if yes, forwarding the data message to an application program corresponding to the destination port number; otherwise, discarding the data message.
In practical applications, different application programs on the terminal may use different ports to transmit and receive data packets, and then, the link layer may determine that the data packet needs to be forwarded to a specific application program by determining a destination port number carried in the received data packet.
Further, before sending a unicast data message to a destination terminal, a source terminal needs to establish an individual data channel, at this time, a port corresponding to an application program to receive the unicast data message on the destination terminal is in a state of waiting for receiving data, namely, an activated state, so in the embodiment of the present invention, when receiving a unicast data message, according to a destination port number carried by the unicast data message, it is determined whether the unicast data message is a useless unicast data message (i.e., it is determined whether a corresponding application program is to be received, and if there is a corresponding application program to be received, it is useful; otherwise, discarding the unicast data message.
Specifically, when it is determined that a mapping relationship exists between a destination port number carried by the unicast data packet and an application program that receives the data packet using the destination port number in a white list mapping list preset in a link layer, and the destination port is in an active state, it is determined that the unicast data packet is a useful data packet.
The second way is: and setting a blacklist mapping list in the link layer in advance, wherein the blacklist mapping list stores a mapping relation between an application program for prohibiting receiving the unicast data message and a port number used by the application program.
If the filtering rule of the first mode is preset in the link layer of the terminal, when the terminal determines that the message type of the received data message is a unicast data message, the specific process of filtering the data message based on the preset filtering rule in the link layer and determining whether to forward the data message to a corresponding application program according to the filtering result is as follows: if the link layer is provided with a blacklist mapping list, acquiring a destination port number carried by the data message; and judging whether the blacklist mapping list stores the mapping relation between the destination port number and an application program which uses the destination port number to receive the data message, if so, discarding the data message, otherwise, forwarding the data message to the application program corresponding to the destination port number.
In practical application, the unicast data messages sent to one or more application programs in the terminal can be filtered and dropped in the link layer by setting a blacklist mapping list in the link layer, that is, the mapping relation between the application program/programs and the ports used by the application program/programs is stored in the blacklist mapping list in the link layer, and when the terminal receives the unicast data message of which any carried target port number is one port in the blacklist mapping list, the terminal discards the unicast data message.
For example, assuming that a mapping relationship between the application program 1 and the port 1 used by the application program is stored in a blacklist mapping list preset in the link layer, when the terminal receives a unicast data packet, it determines that a destination port number carried by the terminal is the port 1, and directly discards the unicast data packet.
Of course, in the embodiment of the present invention, the setting of the filtering rule may be set according to different requirements of different users and/or different application scenarios, and in the embodiment of the present invention, the setting is not specifically limited herein.
Optionally, in order to avoid that the terminal power consumption is large due to too frequent communication when the terminal is in a sleep state and the number of times of awakening the terminal system is large, in the embodiment of the present invention, a corresponding filtering rule may be set in the terminal link layer, so as to avoid the problem of large terminal power consumption.
Preferably, it is determined, according to the statistical result, whether the number of unicast data packets received by the terminal link layer within a preset time period is greater than or equal to a first set threshold, if so, the data packet is discarded, otherwise, the data packet is forwarded to a corresponding application program based on a destination port number carried by the data packet.
Of course, in the embodiment of the present invention, a corresponding first setting threshold may be set for the number of unicast data packets received by the terminal, or a corresponding first setting threshold may be set for the number of unicast data packets received by the terminal and respectively sent to each application program.
For example, if the first set threshold preset in the link layer is 100, when the number of the unicast data packets received in the latest hour is determined to be 100, the unicast data packets received subsequently are directly discarded.
For another example, assuming that the first set threshold preset for the application program 1 is 20, when it is determined that the number of unicast data packets sent to the application program 1 received within the latest hour is 20, discarding the unicast data packets sent to the application program 1 received subsequently; assuming that the first set threshold preset for the application program 2 is 15, when it is determined that the number of unicast data packets sent to the application program 1 received within the last hour is 16, the unicast data packets sent to the application program 2 received subsequently are discarded.
Preferably, in the embodiment of the present invention, it may be determined, according to the statistical result, whether the number of times that the terminal system is awakened within the preset duration is greater than or equal to a second set threshold, if the determination result is yes, the data packet is discarded, otherwise, the data packet is forwarded to the corresponding application program based on the destination port number carried in the data packet.
For example, if the second set threshold preset in the link layer is 50, then when it is determined that the number of times that the terminal system is awakened in the last hour is 50, the unicast data packet received subsequently is directly discarded, so as to avoid that the terminal system is frequently awakened and the power consumption is large.
Based on the foregoing embodiments, referring to fig. 2, in an embodiment of the present invention, a message filtering apparatus at least includes a determining unit 20 and a filtering unit 21, wherein,
a determining unit 20, configured to receive a data packet, and determine a packet type of the data packet in a link layer;
the filtering unit 21 is configured to, when it is determined that the data packet is a unicast data packet, filter the data packet based on a preset filtering rule in a link layer, and determine whether to forward the data packet to a corresponding application according to a filtering result.
Preferably, when determining the packet type of the data packet in the link layer, the determining unit 20 is specifically configured to:
and determining the message type of the data message in a link layer based on a destination IP address and/or an MAC address carried by the received data message, wherein the message type is a multicast data message, a broadcast data message or a unicast data message.
Preferably, the preset filtering rule at least includes one of the following:
setting a white list mapping list in the link layer in advance, wherein the white list mapping list stores a mapping relation between an application program which is allowed to receive the unicast data message and a port number used by the application program; or,
setting a blacklist mapping list in the link layer in advance, wherein a mapping relation between an application program for prohibiting receiving the unicast data message and a port number used by the application program is stored in the blacklist mapping list.
Preferably, when the link layer performs filtering processing on the data packet based on a preset filtering rule, and determines whether to forward the data packet to a corresponding application program according to a filtering result, the filtering unit 21 is specifically configured to:
if a white list mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
Judging whether a mapping relation between the destination port number and an application program which uses the destination port number to receive the data message is stored in the white list mapping list, and if the judging result is negative, discarding the data message;
if the judgment result is yes, continuing to judge whether the destination port number is activated, and if the judgment result is yes, forwarding the data message to an application program corresponding to the destination port number;
otherwise, discarding the data message.
Preferably, when the link layer performs filtering processing on the data packet based on a preset filtering rule, and determines whether to forward the data packet to a corresponding application program according to a filtering result, the filtering unit 21 is specifically configured to:
if a blacklist mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
And judging whether the blacklist mapping list stores the mapping relation between the destination port number and an application program which uses the destination port number to receive the data message, if so, discarding the data message, otherwise, forwarding the data message to the application program corresponding to the destination port number.
Preferably, when the link layer performs filtering processing on the data packet based on a preset filtering rule, and determines whether to forward the data packet to a corresponding application program according to a filtering result, the filtering unit 21 is specifically configured to:
judging whether the number of unicast data messages received within a preset time length is greater than or equal to a first set threshold value, if so, discarding the data messages, otherwise, forwarding the data messages to corresponding application programs based on a target port number carried by the data messages; and/or the presence of a gas in the gas,
and judging whether the times of awakening the device system in a preset time length is greater than or equal to a second set threshold value, if so, discarding the data message, otherwise, forwarding the data message to a corresponding application program based on a target port number carried by the data message.
In summary, in the embodiment of the present invention, in the process of filtering a packet, a data packet is received, and a packet type of the data packet is determined in a link layer; and when the data message is determined to be a unicast data message, filtering the data message based on a preset filtering rule in a link layer, and determining whether to forward the data message to a corresponding application program according to a filtering result.
By adopting the method, the message type of the received data message is judged on the terminal link layer, and when the data message is judged to be the unicast data message, the unicast data message is filtered by adopting the preset filtering rule, so that the terminal system is prevented from being awakened by useless unicast data messages, the processing load of a terminal CPU is reduced, and the power consumption of the terminal system is reduced.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (10)

1. A message filtering method is characterized by comprising the following steps:
receiving a data message, and judging the message type of the data message in a link layer;
and when the data message is determined to be a unicast data message, filtering the data message based on a preset filtering rule in a link layer, and determining whether to forward the data message to a corresponding application program according to a filtering result.
2. The method according to claim 1, wherein determining the packet type of the data packet in a link layer specifically comprises:
and determining the message type of the data message in a link layer based on a destination IP address and/or an MAC address carried by the received data message, wherein the message type is a multicast data message, a broadcast data message or a unicast data message.
3. The method of claim 1 or 2, wherein the manner of presetting the filtering rules comprises at least one of:
setting a white list mapping list in the link layer in advance, wherein the white list mapping list stores a mapping relation between an application program which is allowed to receive the unicast data message and a port number used by the application program; or,
setting a blacklist mapping list in the link layer in advance, wherein a mapping relation between an application program for prohibiting receiving the unicast data message and a port number used by the application program is stored in the blacklist mapping list.
4. The method according to claim 3, wherein the filtering processing is performed on the data packet based on a preset filtering rule at a link layer, and whether to forward the data packet to a corresponding application program is determined according to a filtering result, specifically comprising:
if a white list mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
Judging whether a mapping relation between the destination port number and an application program which uses the destination port number to receive the data message is stored in the white list mapping list, and if the judging result is negative, discarding the data message;
if the judgment result is yes, continuing to judge whether the destination port number is activated, and if the judgment result is yes, forwarding the data message to an application program corresponding to the destination port number;
otherwise, discarding the data message.
5. The method according to claim 3, wherein the filtering processing is performed on the data packet based on a preset filtering rule at a link layer, and whether to forward the data packet to a corresponding application program is determined according to a filtering result, specifically comprising:
if a blacklist mapping list is set in the link layer, acquiring a destination port number carried by the data message; and are
And judging whether the blacklist mapping list stores the mapping relation between the destination port number and an application program which uses the destination port number to receive the data message, if so, discarding the data message, otherwise, forwarding the data message to the application program corresponding to the destination port number.
6. The method according to claim 1 or 2, wherein the filtering processing is performed on the data packet based on a preset filtering rule at a link layer, and determining whether to forward the data packet to a corresponding application program according to a filtering result includes:
judging whether the number of unicast data messages received within a preset time length is greater than or equal to a first set threshold value, if so, discarding the data messages, otherwise, forwarding the data messages to corresponding application programs based on a target port number carried by the data messages; and/or the presence of a gas in the gas,
and judging whether the number of times of awakening the terminal system in a preset time is greater than or equal to a second set threshold value, if so, discarding the data message, otherwise, forwarding the data message to a corresponding application program based on a target port number carried by the data message.
7. A message filtering apparatus, comprising:
the judging unit is used for receiving the data message and judging the message type of the data message in a link layer;
and the filtering unit is used for filtering the data message based on a preset filtering rule in a link layer when the data message is determined to be a unicast data message, and determining whether to forward the data message to a corresponding application program according to a filtering result.
8. The apparatus of claim 7, wherein the filtering rules are preset in a manner that includes at least one of:
setting a white list mapping list in the link layer in advance, wherein the white list mapping list stores a mapping relation between an application program which is allowed to receive the unicast data message and a port number used by the application program; or,
setting a blacklist mapping list in the link layer in advance, wherein a mapping relation between an application program for prohibiting receiving the unicast data message and a port number used by the application program is stored in the blacklist mapping list.
9. A terminal, characterized in that the terminal comprises a processor for implementing the steps of the method according to any of claims 1-6 when executing a computer program stored in a memory.
10. A readable storage medium having stored thereon a computer program (instructions), characterized in that: the computer program (instructions), when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.
CN201711105232.3A 2017-11-10 2017-11-10 A kind of message filtering method and device, terminal and readable storage medium storing program for executing Pending CN107708194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711105232.3A CN107708194A (en) 2017-11-10 2017-11-10 A kind of message filtering method and device, terminal and readable storage medium storing program for executing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711105232.3A CN107708194A (en) 2017-11-10 2017-11-10 A kind of message filtering method and device, terminal and readable storage medium storing program for executing

Publications (1)

Publication Number Publication Date
CN107708194A true CN107708194A (en) 2018-02-16

Family

ID=61179008

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711105232.3A Pending CN107708194A (en) 2017-11-10 2017-11-10 A kind of message filtering method and device, terminal and readable storage medium storing program for executing

Country Status (1)

Country Link
CN (1) CN107708194A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600110A (en) * 2018-04-24 2018-09-28 新华三技术有限公司 A kind of PIM message processing methods and device
CN108984319A (en) * 2018-06-25 2018-12-11 广州视源电子科技股份有限公司 Method, device, computer equipment and storage medium for solving operation instruction conflict
CN109714716A (en) * 2019-02-01 2019-05-03 Oppo广东移动通信有限公司 Data packet forwarding method, device and mobile terminal
CN112261618A (en) * 2020-09-29 2021-01-22 南京航空航天大学 ZigBee-based communication method between multiple four-rotor aircrafts
CN114258044A (en) * 2020-09-25 2022-03-29 华为技术有限公司 Standby method, system and terminal equipment
CN115550265A (en) * 2022-09-30 2022-12-30 中国第一汽车股份有限公司 Vehicle-mounted network communication event filtering method, device, equipment and medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1474563A (en) * 2002-08-06 2004-02-11 ��Ϊ�������޹�˾ Repeating method for multi-broadcast message in network communication
CN101321072A (en) * 2008-07-21 2008-12-10 华为技术有限公司 Network awakening method, device and equipment
WO2009072721A1 (en) * 2007-12-03 2009-06-11 Electronics And Telecommunications Research Institute Apparatus and method for broadcasting data, and apparatus and method for broadcasting response data, of sensor node in wireless sensor network system
CN103368850A (en) * 2013-07-16 2013-10-23 杭州华三通信技术有限公司 Method and device for processing unicast message with unknown destination
CN103428108A (en) * 2013-08-07 2013-12-04 大唐移动通信设备有限公司 Data frame processing method and device
CN104221445A (en) * 2013-11-15 2014-12-17 华为终端有限公司 Method for waking up terminal system and terminal
CN105530179A (en) * 2014-09-29 2016-04-27 杭州华三通信技术有限公司 Data message processing method and network equipment
CN106385450A (en) * 2016-09-13 2017-02-08 宇龙计算机通信科技(深圳)有限公司 Data filtering method and system
CN107294863A (en) * 2017-06-22 2017-10-24 深圳市泰信通信息技术有限公司 Network data stream forwarding method, device, system and readable storage medium storing program for executing

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1474563A (en) * 2002-08-06 2004-02-11 ��Ϊ�������޹�˾ Repeating method for multi-broadcast message in network communication
WO2009072721A1 (en) * 2007-12-03 2009-06-11 Electronics And Telecommunications Research Institute Apparatus and method for broadcasting data, and apparatus and method for broadcasting response data, of sensor node in wireless sensor network system
CN101321072A (en) * 2008-07-21 2008-12-10 华为技术有限公司 Network awakening method, device and equipment
CN103368850A (en) * 2013-07-16 2013-10-23 杭州华三通信技术有限公司 Method and device for processing unicast message with unknown destination
CN103428108A (en) * 2013-08-07 2013-12-04 大唐移动通信设备有限公司 Data frame processing method and device
CN104221445A (en) * 2013-11-15 2014-12-17 华为终端有限公司 Method for waking up terminal system and terminal
CN105530179A (en) * 2014-09-29 2016-04-27 杭州华三通信技术有限公司 Data message processing method and network equipment
CN106385450A (en) * 2016-09-13 2017-02-08 宇龙计算机通信科技(深圳)有限公司 Data filtering method and system
CN107294863A (en) * 2017-06-22 2017-10-24 深圳市泰信通信息技术有限公司 Network data stream forwarding method, device, system and readable storage medium storing program for executing

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108600110A (en) * 2018-04-24 2018-09-28 新华三技术有限公司 A kind of PIM message processing methods and device
CN108600110B (en) * 2018-04-24 2020-12-29 新华三技术有限公司 PIM message processing method and device
CN108984319A (en) * 2018-06-25 2018-12-11 广州视源电子科技股份有限公司 Method, device, computer equipment and storage medium for solving operation instruction conflict
CN108984319B (en) * 2018-06-25 2021-10-15 广州视源电子科技股份有限公司 Method, device, computer equipment and storage medium for solving operation instruction conflict
CN109714716A (en) * 2019-02-01 2019-05-03 Oppo广东移动通信有限公司 Data packet forwarding method, device and mobile terminal
CN114258044A (en) * 2020-09-25 2022-03-29 华为技术有限公司 Standby method, system and terminal equipment
CN112261618A (en) * 2020-09-29 2021-01-22 南京航空航天大学 ZigBee-based communication method between multiple four-rotor aircrafts
CN112261618B (en) * 2020-09-29 2022-04-08 南京航空航天大学 ZigBee-based communication method between multiple four-rotor aircrafts
CN115550265A (en) * 2022-09-30 2022-12-30 中国第一汽车股份有限公司 Vehicle-mounted network communication event filtering method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN107708194A (en) A kind of message filtering method and device, terminal and readable storage medium storing program for executing
US20180227852A1 (en) Techniques for managing idle state activity in mobile devices
WO2021057572A1 (en) Data processing method and apparatus, electronic device, terminal device, and storage medium
US20200192457A1 (en) Power-saving processing method and device, mobile terminal and computer-readable storage medium
KR101798016B1 (en) Data processing method and device
KR20140030338A (en) Power save proxy in communication networks
EP2988219A1 (en) Power saving management method and device for intelligent terminal
US9954787B2 (en) Intelligent terminal power-saving management method and apparatus
CN106851799B (en) Method and device for sending heartbeat packet in long connection
CN110602771B (en) Power consumption control method and device and vehicle networking terminal
CN109936868A (en) A kind of paging method, terminal and base station
CN105611505B (en) Message pushing method, message pushing device and terminal
WO2012071835A1 (en) Method for managing wireless services of single-chip dual-card code division multiple access terminal, and cdma terminal thereof
WO2017107339A1 (en) Method for waking network telephone
JP2009182956A (en) Network connection control method and terminal
US11700189B2 (en) Method for performing task processing on common service entity, common service entity, apparatus and medium for task processing
WO2012155608A1 (en) Information storage method for mobile terminal and mobile terminal
WO2014180302A1 (en) Application internet access processing method, apparatus, and terminal
US10771597B2 (en) Synchronized connection closing
CN107251593B (en) Data packet processing method and related equipment
EP3185611B1 (en) Method, terminal and system for acquiring mail
WO2016086684A1 (en) Energy-saving processing method and apparatus for terminal
CN103701837B (en) A kind of point-to-point protocol dial on demand method and home gateway
WO2015100662A1 (en) Data processing method, device and system
WO2016011614A1 (en) Method and device for blocking harassment number

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180216