CN112714040A - Holographic message detection method, device, equipment and storage medium - Google Patents

Holographic message detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN112714040A
CN112714040A CN202011436853.1A CN202011436853A CN112714040A CN 112714040 A CN112714040 A CN 112714040A CN 202011436853 A CN202011436853 A CN 202011436853A CN 112714040 A CN112714040 A CN 112714040A
Authority
CN
China
Prior art keywords
target
vector
values
message
preset
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
CN202011436853.1A
Other languages
Chinese (zh)
Other versions
CN112714040B (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.)
Shenzhen Power Supply Bureau Co Ltd
Original Assignee
Shenzhen Power Supply Bureau 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 Shenzhen Power Supply Bureau Co Ltd filed Critical Shenzhen Power Supply Bureau Co Ltd
Priority to CN202011436853.1A priority Critical patent/CN112714040B/en
Publication of CN112714040A publication Critical patent/CN112714040A/en
Application granted granted Critical
Publication of CN112714040B publication Critical patent/CN112714040B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • H04L43/028Capturing of monitoring data by filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a holographic message detection method, a device, equipment and a storage medium, and relates to the field of message detection. The method comprises the steps of obtaining t candidate messages to be detected, carrying out Hash mapping operation on each candidate message based on k preset Hash mapping functions for each candidate message to obtain k first position indication Hash values, determining whether values of vector elements indicated by the k first position indication Hash values in a target vector are all target values for each candidate message, and identifying the candidate messages as the target messages if the values are the target values. According to the technical scheme provided by the embodiment of the application, the hash value of the first position indication is obtained by performing hash mapping operation on each message to be detected, and whether the value of the vector element indicated by the hash value of the first position indication is the target value or not is judged, so that the message detection efficiency can be improved.

Description

Holographic message detection method, device, equipment and storage medium
Technical Field
The present application relates to the field of message detection, and in particular, to a method, an apparatus, a device, and a storage medium for detecting a holographic message.
Background
With the continuous development of the internet, the number of users and new network applications of the internet continuously increase, which brings huge and continuously increasing traffic, and users usually have a demand for quickly extracting a required target message from a large number of messages when receiving messages, which requires that network equipment can have holographic message detection capability, that is, detect a target message required by a user from a plurality of transmitted candidate messages.
In the prior art, a candidate Packet to be detected is usually detected by a DPI (Deep Packet Inspection), however, Deep Packet Inspection requires to create a Packet Inspection task when each candidate Packet is detected, and delete the Packet Inspection task after the Inspection is completed.
However, the network device needs to repeatedly create and delete the packet inspection task, which results in inefficient packet inspection.
Disclosure of Invention
Based on this, the embodiments of the present application provide a method, an apparatus, a device, and a storage medium for detecting a holographic packet, which can improve the efficiency of packet detection.
In a first aspect, a method for detecting a holographic message is provided, where the method includes:
acquiring t candidate messages to be detected, wherein t is a positive integer greater than 1; for each candidate message, performing hash mapping operation on the candidate message based on preset k hash mapping functions to obtain k first position indication hash values, wherein each first position indication hash value is used for indicating one vector element in a target vector included by a preset bloom filter, the value of each vector element in the target vector is obtained according to the target message to be identified, and k is a positive integer; and for each candidate message, determining whether the values of the vector elements indicated by the k first position indication hash values in the target vector are all target values, and if so, identifying the candidate message as the target message.
In one embodiment, the method further comprises:
and if the k first positions in the target vector indicate that the values of the vector elements indicated by the hash values are not uniform to be target values, determining that the candidate message is not the target message.
In one embodiment, the method further comprises:
acquiring a preset target message and acquiring an initial vector, wherein the values of all vector elements in the initial vector are not target values; based on k hash mapping functions, performing hash mapping operation on the target message to obtain k second position indication hash values, wherein each second position indication hash value is used for indicating one vector element in the initial vector; and setting the values of the vector elements indicated by the k second position indication hash values in the initial vector as target values to obtain a target vector.
In one embodiment, the obtaining of the initial vector includes:
calculating the number m of vector elements in the initial vector according to the number n of preset target messages; an initial vector is obtained based on the number m of vector elements.
In one embodiment, calculating the number m of vector elements in the initial vector according to the preset number n of target packets includes:
calculating the number m of vector elements in the initial vector according to the number n of preset target messages and a preset first formula;
wherein the first formula comprises:
Figure BDA0002829406030000021
wherein n is the number of the target messages, and p is the misjudgment rate.
In one embodiment, the method further comprises:
and calculating the number k of the Hash mapping function according to the number n of the preset target messages and the number m of the vector elements in the initial vector.
In one embodiment, calculating the number k of the hash mapping function according to the number n of the preset target packets and the number m of vector elements in the initial vector includes:
calculating the number k of the Hash mapping functions according to the number n of preset target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure BDA0002829406030000022
wherein n is the number of the target messages, and m is the number m of the vector elements in the initial vector.
In a second aspect, a holographic message detection apparatus is provided, which includes:
the first acquisition module is used for acquiring t candidate messages to be detected, wherein t is a positive integer greater than 1;
the first operation module is used for performing Hash mapping operation on each candidate message based on preset k Hash mapping functions to obtain k first position indication Hash values, wherein each first position indication Hash value is used for indicating one vector element in a target vector included by a preset bloom filter, the value of each vector element in the target vector is obtained according to the target message to be obtained, and k is a positive integer;
and the determining module is used for determining whether the values of the vector elements indicated by the k first position indication hash values in the target vector are all target values or not for each candidate message, and if the values are all the target values, determining the candidate message as the target message.
In one embodiment, the determining module is further configured to:
and if the k first positions in the target vector indicate that the values of the vector elements indicated by the hash values are not uniform to be target values, determining that the candidate message is not the target message.
In one embodiment, the holographic message detection apparatus further comprises:
the second acquisition module is used for acquiring a preset target message and acquiring an initial vector, wherein the values of all vector elements in the initial vector are not target values;
the second operation module is used for performing hash mapping operation on the target message based on the k hash mapping functions to obtain k second position indication hash values, wherein each second position indication hash value is used for indicating one vector element in the initial vector;
and the setting module is used for setting the values of the vector elements indicated by the k second position indication hash values in the initial vector as target values to obtain the target vector.
In one embodiment, the second obtaining module is specifically configured to:
calculating the number m of vector elements in the initial vector according to the number n of preset target messages; an initial vector is obtained based on the number m of vector elements.
In one embodiment, the second obtaining module is specifically configured to:
calculating the number m of vector elements in the initial vector according to the number n of preset target messages and a preset first formula;
wherein the first formula comprises:
Figure BDA0002829406030000031
wherein n is the number of the target messages, and p is the misjudgment rate.
In one embodiment, the second operation module is specifically configured to:
and calculating the number k of the Hash mapping function according to the number n of the preset target messages and the number m of the vector elements in the initial vector.
In one embodiment, the second operation module is specifically configured to:
calculating the number k of the Hash mapping functions according to the number n of preset target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure BDA0002829406030000041
wherein n is the number of the target messages, and m is the number m of the vector elements in the initial vector.
In a third aspect, a message detection device is provided, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the holographic message detection method according to any one of the first aspect when executing the computer program.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, implements the holographic message detection method according to any of the first aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
in the technical scheme provided by the embodiment of the application, t candidate messages to be detected are obtained, for each candidate message, hash mapping operation is performed on each candidate message based on preset k hash mapping functions to obtain k first position indication hash values, for each candidate message, whether values of vector elements indicated by the k first position indication hash values in a target vector are all target values is determined, and if the values are all the target values, the candidate message is identified as the target message. Compared with the prior art, generally, when detecting a transmitted message through deep message detection, a message detection task needs to be created when detecting each message to be detected, and the message detection task is deleted after the detection is completed, the technical scheme provided by the embodiment of the application obtains a first position indication hash value in a target vector by performing hash mapping operation on each candidate message to be detected, obtains values of all vector elements in the target vector included by a preset bloom filter by identifying the target message, and if the target vector determined by each candidate message is only the vector elements indicated by the first position indication hash value and are all the target values, indicates that the candidate message to be detected is the same as the identified target message, the process does not need to create the message detection task when detecting each message to be detected and delete the message detection task after the detection is completed, therefore, the efficiency of message detection can be improved by judging whether the vector elements indicated by the first position indication hash value are all the target values or not.
Drawings
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a flow chart of a method provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a pre-set bloom filter provided in an embodiment of the present application;
FIG. 4 is a flow chart of a method provided by an embodiment of the present application;
FIG. 5 is a flow chart of a method provided by an embodiment of the present application;
fig. 6 is a block diagram of a holographic message detection apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram of a holographic message detection apparatus according to an embodiment of the present application;
fig. 8 is a block diagram of a message detection device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
At present, with the continuous development of the internet, the number of users and the novel network application of the internet continuously increase, which brings huge and continuously increasing traffic, and users usually have a demand for quickly extracting required target messages from a large number of messages when receiving messages, which requires that network equipment can have holographic message detection capability, i.e. detect the required target messages of users in a plurality of transmitted candidate messages.
In the prior art, a candidate packet to be detected is usually detected through deep packet inspection, however, deep packet inspection requires creating a packet inspection task when each candidate packet is inspected, and deleting the packet inspection task after the inspection is completed.
However, the network device needs to repeatedly create and delete the packet inspection task, which results in inefficient packet inspection.
In view of this, embodiments of the present application provide a method, an apparatus, a device, and a storage medium for detecting a holographic packet, which can improve the efficiency of packet detection.
Next, an implementation environment related to the holographic message detection method provided in the embodiment of the present application will be described.
Fig. 1 is a schematic diagram of an implementation environment related to a holographic message detection method provided in an embodiment of the present application. As shown in fig. 1, the implementation environment may include a message sending device 101, a holographic message detection terminal 102, and a message receiving device 103, where the message sending device 101, the holographic message detection terminal 102, and the message receiving device 103 may communicate with each other in a wired or wireless manner. The message sending device 101 can send a message, and the holographic message detection terminal 102 performs message detection on the sent message to be detected, and transmits the detected target message to the message receiving device 103.
Please refer to fig. 2, which shows a flowchart of a holographic message detection method provided by an embodiment of the present application, and the holographic message detection method can be applied to the holographic message detection terminal 102 (hereinafter referred to as a terminal) in the above implementation environment. As shown in fig. 2, the holographic message detection method may include the following steps:
step 201, a terminal obtains t candidate messages to be detected, wherein t is a positive integer larger than 1.
In the process of communication between the message sending device and the message receiving device, the message needs to be sent, for example, the message includes various messages used for negotiation or management of the message receiving device, and the various messages to be transmitted may be t candidate messages to be detected.
Step 202, the terminal performs hash mapping operation on each candidate message based on k preset hash mapping functions to obtain k first position indication hash values.
Each first position indication hash value is used for indicating one vector element in a target vector included by a preset bloom filter, the value of each vector element in the target vector is obtained according to a target message to be identified, and k is a positive integer.
In this embodiment of the present application, the number of vector elements in an initial vector of a preset bloom filter is m, that is, the size of the preset bloom filter is m, when more and more candidate packets are inserted, a preset bloom detector may have a small miscalculation rate, the tolerated misjudgment rate is p, the number n of preset target packets, the misjudgment rate p, the number k of preset hash mapping functions, and the number m of vector elements in the initial vector of the preset bloom filter satisfy a first formula, a second formula, and a third formula, and the first formula, the second formula, and the third formula may be:
Figure BDA0002829406030000061
Figure BDA0002829406030000062
Figure BDA0002829406030000063
the number of vector elements in the initial vector of the preset bloom filter is m, and the number k of the preset hash mapping function is certainly a positive integer, so that the values obtained by the first formula and the second formula are rounded up.
Step 203, the terminal determines whether the values of the vector elements indicated by the k first position indication hash values in the target vector are all target values for each candidate message, and if so, identifies the candidate message as the target message.
And if the k first positions in the target vector indicate that the values of the vector elements indicated by the hash values are not uniform to be target values, determining that the candidate message is not the target message.
In an optional embodiment, the target value may be 1, and the meaning of the target value may be that the target packet passes through k hash mapping functions to obtain vector elements in k target vectors, and in order to characterize the vector elements in the k target vectors, the target value of the k vector elements is set to 1. If the vector elements in the k target vectors obtained by one candidate message through the same k hash mapping functions are the same as the vector elements obtained by the target message, that is, the candidate message determines that the values of the vector elements indicated by the k first position indication hash values in the target vectors are all the target values, it is indicated that the candidate message to be detected is the same as the identified target message.
Fig. 3 shows a process of comparing a candidate packet with one vector element (the value of the vector element is 1, and the vector element is at the position 2 and the position 4 of the target vector respectively) in the target vector included in the preset bloom filter through k Hash mapping functions (Hash1, Hash2 … … Hash).
Further, for example, in an optional embodiment of the present application, the preset bloom filter size m is 10, the candidate messages t to be detected are 3, which are the message No. 1, the message No. 2, and the message No. 3, respectively, the number of the preset hash mapping functions k is 5, the target value is set to 1, the target message passes through the preset bloom filter to obtain the positions No. 2, 3, 5, 7, and 9 in the target vector, and these positions are marked as target value 1, which may be represented as [ 0,1,1,0,1,0,1,0 ].
For each candidate message to be detected, for example, message No. 1, 5 first position indication hash values 2, 3, 5, 7, and 9 are obtained based on 5 preset hash mapping functions. For the message 1, the positions 2, 3, 5, 7 and 9 in the preset bloom filter are all 1, and the message 1 is indicated as the target message.
If for the message 2, 5 first position indication hash values 2, 3, 5, 6, and 9 are obtained based on 5 preset hash mapping functions. For the message 2, the position 6 in the positions 2, 3, 5, 6, and 9 in the preset bloom filter is not the target value 1, that is, the value of the vector element indicated by the hash value is not uniform to the target value as indicated by the 5 first positions in the target vector, and then it is determined that the message 2 is not the target message.
In the technical scheme provided by the embodiment of the application, t candidate messages to be detected are obtained, for each candidate message, hash mapping operation is performed on each candidate message based on preset k hash mapping functions to obtain k first position indication hash values, for each candidate message, whether values of vector elements indicated by the k first position indication hash values in a target vector are all target values is determined, and if the values are all the target values, the candidate message is identified as the target message. Compared with the prior art, generally, when detecting a transmitted message through deep message detection, a message detection task needs to be created when detecting each message to be detected, and the message detection task is deleted after the detection is completed, the technical scheme provided by the embodiment of the application obtains a first position indication hash value in a target vector by performing hash mapping operation on each candidate message to be detected, obtains values of all vector elements in the target vector included by a preset bloom filter by identifying the target message, and if the target vector determined by each candidate message is only the vector elements indicated by the first position indication hash value and are all the target values, indicates that the candidate message to be detected is the same as the identified target message, the process does not need to create the message detection task when detecting each message to be detected and delete the message detection task after the detection is completed, therefore, the efficiency of message detection can be improved by judging whether the vector elements indicated by the first position indication hash value are all the target values or not.
In an alternative embodiment of the present application, as shown in fig. 4, the technical process of the terminal in constructing the target vector included in the preset bloom filter includes the following steps:
step 301, the terminal obtains a preset target message and obtains an initial vector.
In an optional embodiment of the present application, the non-target value may be set to 0, and the values of all vector elements in the initial vector in the preset bloom filter are set to 0.
Step 302, the terminal performs hash mapping operation on the target packet based on the k hash mapping functions to obtain k second position indication hash values.
And the second position indication hash value is used for indicating one vector element in the initial vector, and the hash mapping operation of k hash mapping functions is carried out on the target message to obtain k second position indication hash values.
Step 303, the terminal sets all values of vector elements indicated by the k second position indication hash values in the initial vector as target values to obtain a target vector.
For example, in an optional embodiment of the present application, the preset bloom filter size m is 10, the number of the preset hash mapping functions k is 5, the target value is set to 1, the non-target value is set to 0, the first target packet passes through the preset bloom filter to indicate positions 2, 3, 5, 7, and 9 in the target vector, and these positions are marked as target values 1, so that the target values of vector elements in the first target vector in the preset bloom filter are obtained as [ 0,1,1,0,1,0,1,0,1,0 ].
Further, the target packet may be multiple, for example, if there is a second target packet indicating positions 1, 2, 3, 4, and 5 in the target vector through a preset bloom filter, the vector element in the second target vector in the preset bloom filter is obtained as [ 1,1,1,1,1,0,0,0,0,0 ], and the vector element of the target vector in the current preset bloom filter includes [ 1,1,1,1,1,0,1,0 ].
However, when the number of inserted elements is more and more, the bloom filter has a false judgment, for example, when the vector element indicated by the candidate packet through the first position indication hash value obtained based on the 5 hash mapping functions is [ 1,1,1,1,0,0,0,0,1,0 ], although the candidate packet does not belong to the first target packet and the second target packet, the candidate packet is still identified as the target packet, so that a false judgment rate p exists in the bloom filter. However, when the candidate packet is subjected to the vector element indicated by the first position indication hash value obtained based on the 5 hash mapping functions, the vector element is [ 1,1,1,0,0,0,0,0,1,1 ], the candidate packet is identified as a non-target packet, and when the candidate packet is identified as the non-target packet, there is certainly no erroneous judgment.
In an alternative embodiment of the present application, as shown in fig. 5, the terminal obtains an initial vector, and the technical process includes the following steps:
step 401, the terminal calculates the number m of vector elements in the initial vector according to the number n of the preset target messages.
Calculating the number m of vector elements in the initial vector according to the number n of preset target messages and a preset first formula;
wherein the first formula comprises:
Figure BDA0002829406030000091
wherein n is the number of the target messages, and p is the misjudgment rate.
Step 402, the terminal obtains an initial vector based on the number m of vector elements.
The terminal determines the initial vector of the preset bloom filter according to the number m of the vector elements, when the number m of the vector elements is more, the number of the initial vectors of the preset bloom filter is more, and the number of the vector elements in the initial vector of the preset bloom filter can be equal to m.
In one optional embodiment, the number k of the hash mapping function may be calculated according to the preset number n of the target packets and the number m of the vector elements in the initial vector, where the number m of the vector elements in the initial vector is used.
Calculating the number k of the Hash mapping functions according to the number n of preset target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure BDA0002829406030000092
wherein n is the number of the target messages, and m is the number m of the vector elements in the initial vector.
Referring to fig. 6, which shows a block diagram of a holographic message detection apparatus 500 according to an embodiment of the present application, as shown in fig. 6, the holographic message detection apparatus 500 may include: a first obtaining module 501, a first operation module 502 and a determining module 503.
A first obtaining module 501, configured to obtain t candidate messages to be detected, where t is a positive integer greater than 1;
a first operation module 502, configured to perform hash mapping operation on each candidate packet based on preset k hash mapping functions to obtain k first position indication hash values, where each first position indication hash value is used to indicate one vector element in a target vector included in a preset bloom filter, a value of each vector element in the target vector is obtained according to a target packet to be obtained, and k is a positive integer.
A determining module 503, configured to determine, for each candidate packet, whether values of vector elements indicated by the k first position indication hash values in the target vector are all target values, and if the values are all target values, determine that the candidate packet is the target packet.
In an alternative embodiment of the present application, the determining module 503 is further configured to: and if the k first positions in the target vector indicate that the values of the vector elements indicated by the hash values are not uniform to be target values, determining that the candidate message is not the target message.
Referring to fig. 7, an embodiment of the present application further provides another holographic message detection apparatus 600, where the holographic message detection apparatus 600 includes, in addition to the modules included in the holographic message detection apparatus 500, optionally, the holographic message detection apparatus 600 further includes a second obtaining module 504, a second operation module 505, and a setting module 506.
A second obtaining module 504, configured to obtain a preset target packet, and obtain an initial vector, where values of all vector elements in the initial vector are not target values;
a second operation module 505, configured to perform hash mapping operation on the target packet based on the k hash mapping functions to obtain k second position indication hash values, where each second position indication hash value is used to indicate one vector element in the initial vector;
a setting module 506, configured to set, as the target values, all values of the vector elements indicated by the k second position indication hash values in the initial vector, so as to obtain a target vector.
In an optional embodiment of the present application, the second obtaining module 504 is specifically configured to:
calculating the number m of vector elements in the initial vector according to the number n of preset target messages; an initial vector is obtained based on the number m of vector elements.
In an optional embodiment of the present application, the second obtaining module 504 is specifically configured to:
calculating the number m of vector elements in the initial vector according to the number n of preset target messages and a preset first formula;
wherein the first formula comprises:
Figure BDA0002829406030000101
wherein n is the number of the target messages, and p is the misjudgment rate.
In an optional embodiment of the present application, the second operation module is specifically configured to:
and calculating the number k of the Hash mapping function according to the number n of the preset target messages and the number m of the vector elements in the initial vector.
In an optional embodiment of the present application, the second operation module is specifically configured to:
calculating the number k of the Hash mapping functions according to the number n of preset target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure BDA0002829406030000111
wherein n is the number of the target messages, and m is the number m of the vector elements in the initial vector.
For specific limitations of the holographic message detection apparatus, reference may be made to the above limitations of the holographic message detection method, which are not described herein again. All or part of each module in the holographic message detection device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a message inspection device is provided, which may be a holographic message inspection terminal, and its internal structure diagram may be as shown in fig. 8. The message detection device comprises a processor, a memory and a network interface which are connected through a system bus. Wherein the processor of the message detection device is configured to provide computational and control capabilities. The memory of the message detection device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the message detection device is used for storing message detection data. The network interface of the message detection device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a message detection method.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a message detection apparatus comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program:
acquiring t candidate messages to be detected, wherein t is a positive integer greater than 1; for each candidate message, performing hash mapping operation on the candidate message based on preset k hash mapping functions to obtain k first position indication hash values, wherein each first position indication hash value is used for indicating one vector element in a target vector included by a preset bloom filter, the value of each vector element in the target vector is obtained according to the target message to be identified, and k is a positive integer; and for each candidate message, determining whether the values of the vector elements indicated by the k first position indication hash values in the target vector are all target values, and if so, identifying the candidate message as the target message.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: and if the k first positions in the target vector indicate that the values of the vector elements indicated by the hash values are not uniform to be target values, determining that the candidate message is not the target message.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: acquiring a preset target message and acquiring an initial vector, wherein the values of all vector elements in the initial vector are not target values; based on k hash mapping functions, performing hash mapping operation on the target message to obtain k second position indication hash values, wherein each second position indication hash value is used for indicating one vector element in the initial vector; and setting the values of the vector elements indicated by the k second position indication hash values in the initial vector as target values to obtain a target vector.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: calculating the number m of vector elements in the initial vector according to the number n of preset target messages; an initial vector is obtained based on the number m of vector elements.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: calculating the number m of vector elements in the initial vector according to the number n of preset target messages and a preset first formula;
wherein the first formula comprises:
Figure BDA0002829406030000121
wherein n is the number of the target messages, and p is the misjudgment rate.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: and calculating the number k of the Hash mapping function according to the number n of the preset target messages and the number m of the vector elements in the initial vector.
In one embodiment of the application, the processor when executing the computer program further performs the following steps: calculating the number k of the Hash mapping functions according to the number n of preset target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure BDA0002829406030000131
wherein n is the number of the target messages, and m is the number m of the vector elements in the initial vector.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of:
acquiring t candidate messages to be detected, wherein t is a positive integer greater than 1; for each candidate message, performing hash mapping operation on the candidate message based on preset k hash mapping functions to obtain k first position indication hash values, wherein each first position indication hash value is used for indicating one vector element in a target vector included by a preset bloom filter, the value of each vector element in the target vector is obtained according to the target message to be identified, and k is a positive integer; and for each candidate message, determining whether the values of the vector elements indicated by the k first position indication hash values in the target vector are all target values, and if so, identifying the candidate message as the target message.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: and if the k first positions in the target vector indicate that the values of the vector elements indicated by the hash values are not uniform to be target values, determining that the candidate message is not the target message.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring a preset target message and acquiring an initial vector, wherein the values of all vector elements in the initial vector are not target values; based on k hash mapping functions, performing hash mapping operation on the target message to obtain k second position indication hash values, wherein each second position indication hash value is used for indicating one vector element in the initial vector; and setting the values of the vector elements indicated by the k second position indication hash values in the initial vector as target values to obtain a target vector.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: calculating the number m of vector elements in the initial vector according to the number n of preset target messages; an initial vector is obtained based on the number m of vector elements.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: calculating the number m of vector elements in the initial vector according to the number n of preset target messages and a preset first formula;
wherein the first formula comprises:
Figure BDA0002829406030000141
wherein n is the number of the target messages, and p is the misjudgment rate.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: and calculating the number k of the Hash mapping function according to the number n of the preset target messages and the number m of the vector elements in the initial vector.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of:
calculating the number k of the Hash mapping functions according to the number n of preset target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure BDA0002829406030000142
wherein n is the number of the target messages, and m is the number m of the vector elements in the initial vector.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in M forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (SyMchliMk) DRAM (SLDRAM), RaMbus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A holographic message detection method, the method comprising:
acquiring t candidate messages to be detected, wherein t is a positive integer greater than 1;
for each candidate message, performing hash mapping operation on the candidate message based on preset k hash mapping functions to obtain k first position indication hash values, wherein each first position indication hash value is used for indicating one vector element in a target vector included by a preset bloom filter, the value of each vector element in the target vector is obtained according to the target message to be identified, and k is a positive integer;
and for each candidate message, determining whether the values of the vector elements indicated by the k first position indication hash values in the target vector are all target values, and if so, identifying the candidate message as the target message.
2. The method of claim 1, further comprising:
and if the values of the vector elements indicated by the k first position indication hash values in the target vector are not uniform to be the target values, determining that the candidate message is not the target message.
3. The method of claim 1, further comprising:
acquiring a preset target message, and acquiring an initial vector, wherein the values of all vector elements in the initial vector are not the target value;
based on the k hash mapping functions, performing hash mapping operation on the target packet to obtain k second position indication hash values, where each second position indication hash value is used for indicating one vector element in the initial vector;
and setting the values of the vector elements indicated by the k second position indication hash values in the initial vector as the target values to obtain the target vector.
4. The method according to claim 3, wherein the number of the preset target packets is n, and the obtaining the initial vector comprises:
calculating the number m of vector elements in the initial vector according to the preset number n of the target messages;
and acquiring the initial vector based on the number m of the vector elements.
5. The method according to claim 4, wherein the calculating the number m of vector elements in the initial vector according to the preset number n of the target packets comprises:
calculating the number m of vector elements in the initial vector according to the preset number n of the target messages and a preset first formula;
wherein the first formula comprises:
Figure FDA0002829406020000021
wherein n is the number of the target messages, and p is the misjudgment rate.
6. The method of claim 4, further comprising:
and calculating the number k of the Hash mapping function according to the preset number n of the target messages and the number m of vector elements in the initial vector.
7. The method according to claim 6, wherein the calculating the number k of the hash mapping function according to the preset number n of the target packets and the number m of vector elements in the initial vector comprises:
calculating the number k of the Hash mapping functions according to the preset number n of the target messages, the number m of vector elements in the initial vector and a preset second formula;
wherein the second formula comprises:
Figure FDA0002829406020000022
wherein n is the number of the target packets, and m is the number m of vector elements in the initial vector.
8. A holographic message detection apparatus, the apparatus comprising:
the first acquisition module is used for acquiring t candidate messages to be detected, wherein t is a positive integer greater than 1;
a first operation module, configured to perform hash mapping operation on each candidate packet based on k preset hash mapping functions to obtain k first position indication hash values, where each first position indication hash value is used to indicate one vector element in a target vector included in a preset bloom filter, a value of each vector element in the target vector is obtained according to a target packet to be obtained, and k is a positive integer;
a determining module, configured to determine, for each candidate packet, whether values of vector elements indicated by the k first position indication hash values in the target vector are all target values, and if the values are all the target values, determine that the candidate packet is the target packet.
9. A message detection device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, implements the holographic message detection method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the holographic message detection method according to any one of claims 1 to 7.
CN202011436853.1A 2020-12-11 2020-12-11 Holographic message detection method, device, equipment and storage medium Active CN112714040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011436853.1A CN112714040B (en) 2020-12-11 2020-12-11 Holographic message detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011436853.1A CN112714040B (en) 2020-12-11 2020-12-11 Holographic message detection method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112714040A true CN112714040A (en) 2021-04-27
CN112714040B CN112714040B (en) 2022-10-28

Family

ID=75542921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011436853.1A Active CN112714040B (en) 2020-12-11 2020-12-11 Holographic message detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112714040B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113627561A (en) * 2021-08-20 2021-11-09 北京软通智慧科技有限公司 Data fusion method and device, electronic equipment and storage medium
CN114786141A (en) * 2022-04-29 2022-07-22 恒玄科技(上海)股份有限公司 Message filtering method and device in Bluetooth wireless mesh network
CN116132319A (en) * 2021-11-15 2023-05-16 华为技术有限公司 Method and device for identifying stream

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1416666A1 (en) * 2002-10-28 2004-05-06 Abb Research Ltd. Method to simplify the management and enhance the security of passwords
CN101227318A (en) * 2007-12-04 2008-07-23 东南大学 Method for overtrick real-time detection of high speed network flow quantity
CN101309179A (en) * 2007-05-18 2008-11-19 北京启明星辰信息技术有限公司 Real-time flux abnormity detection method on basis of host activity and communication pattern analysis
CN101459560A (en) * 2009-01-09 2009-06-17 中国人民解放军信息工程大学 Long stream recognition method, data flow measuring method and device thereof
CN101795273A (en) * 2010-01-26 2010-08-04 联想网御科技(北京)有限公司 Method and device for a filtering junk mail
CN102546293A (en) * 2011-12-20 2012-07-04 东南大学 High speed network flow network address measuring method based on Hash bit string multiplexing
US20140036912A1 (en) * 2012-07-31 2014-02-06 Cisco Technology, Inc. Multicast group assignment using probabilistic approximations
EP2993866A1 (en) * 2014-09-08 2016-03-09 Alcatel Lucent Method for distribution of service requests
US20160112254A1 (en) * 2014-10-17 2016-04-21 Cisco Technology, Inc. Address autoconfiguration using bloom filter parameters for unique address computation
CN106131086A (en) * 2016-08-31 2016-11-16 迈普通信技术股份有限公司 A kind of matching process accessing control list and device
CN107357843A (en) * 2017-06-23 2017-11-17 东南大学 Mass network data search method based on data flow architecture
CN107368527A (en) * 2017-06-09 2017-11-21 东南大学 More property index methods based on data flow
US20180248698A1 (en) * 2017-02-28 2018-08-30 Blackberry Limited Inadvertent password entry detection
CN109145158A (en) * 2017-06-13 2019-01-04 华为技术有限公司 The processing method and Bloom filter of data in a kind of Bloom filter
CN110191109A (en) * 2019-05-17 2019-08-30 杭州迪普信息技术有限公司 A kind of packet sampling method and device
CN110865982A (en) * 2019-11-19 2020-03-06 深信服科技股份有限公司 Data matching method and device, electronic equipment and storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1416666A1 (en) * 2002-10-28 2004-05-06 Abb Research Ltd. Method to simplify the management and enhance the security of passwords
CN101309179A (en) * 2007-05-18 2008-11-19 北京启明星辰信息技术有限公司 Real-time flux abnormity detection method on basis of host activity and communication pattern analysis
CN101227318A (en) * 2007-12-04 2008-07-23 东南大学 Method for overtrick real-time detection of high speed network flow quantity
CN101459560A (en) * 2009-01-09 2009-06-17 中国人民解放军信息工程大学 Long stream recognition method, data flow measuring method and device thereof
CN101795273A (en) * 2010-01-26 2010-08-04 联想网御科技(北京)有限公司 Method and device for a filtering junk mail
CN102546293A (en) * 2011-12-20 2012-07-04 东南大学 High speed network flow network address measuring method based on Hash bit string multiplexing
US20140036912A1 (en) * 2012-07-31 2014-02-06 Cisco Technology, Inc. Multicast group assignment using probabilistic approximations
EP2993866A1 (en) * 2014-09-08 2016-03-09 Alcatel Lucent Method for distribution of service requests
US20160112254A1 (en) * 2014-10-17 2016-04-21 Cisco Technology, Inc. Address autoconfiguration using bloom filter parameters for unique address computation
CN106131086A (en) * 2016-08-31 2016-11-16 迈普通信技术股份有限公司 A kind of matching process accessing control list and device
US20180248698A1 (en) * 2017-02-28 2018-08-30 Blackberry Limited Inadvertent password entry detection
CN107368527A (en) * 2017-06-09 2017-11-21 东南大学 More property index methods based on data flow
CN109145158A (en) * 2017-06-13 2019-01-04 华为技术有限公司 The processing method and Bloom filter of data in a kind of Bloom filter
CN107357843A (en) * 2017-06-23 2017-11-17 东南大学 Mass network data search method based on data flow architecture
CN110191109A (en) * 2019-05-17 2019-08-30 杭州迪普信息技术有限公司 A kind of packet sampling method and device
CN110865982A (en) * 2019-11-19 2020-03-06 深信服科技股份有限公司 Data matching method and device, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
孙志刚等: "BFPC:一种新型的基于Bloom Filter的报文分类算法", 《计算机工程与科学》 *
曾鹏等: "Analysis and Enhancement of a Watermarking Protocol Suitable for Web Context", 《JOURNAL OF SHANGHAI JIAOTONG UNIVERSITY(SCIENCE)》 *
白建东等: "基于Bloom Filter的报文分类算法", 《计算机工程》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113627561A (en) * 2021-08-20 2021-11-09 北京软通智慧科技有限公司 Data fusion method and device, electronic equipment and storage medium
CN116132319A (en) * 2021-11-15 2023-05-16 华为技术有限公司 Method and device for identifying stream
CN114786141A (en) * 2022-04-29 2022-07-22 恒玄科技(上海)股份有限公司 Message filtering method and device in Bluetooth wireless mesh network
CN114786141B (en) * 2022-04-29 2023-11-21 恒玄科技(上海)股份有限公司 Message filtering method and device in Bluetooth wireless mesh network

Also Published As

Publication number Publication date
CN112714040B (en) 2022-10-28

Similar Documents

Publication Publication Date Title
CN112714040B (en) Holographic message detection method, device, equipment and storage medium
CN108377240B (en) Abnormal interface detection method and device, computer equipment and storage medium
CN110209652B (en) Data table migration method, device, computer equipment and storage medium
CN108400978B (en) Vulnerability detection method and device, computer equipment and storage medium
CN109413153B (en) Data crawling method and device, computer equipment and storage medium
CN110597709B (en) Interactive debugging method and device for mixed-mode mobile application and computer equipment
CN108200087B (en) Web intrusion detection method and device, computer equipment and storage medium
CN108011898B (en) Vulnerability detection method and device, computer equipment and storage medium
CN111178752A (en) Order form dispatching method and device, computer equipment and storage medium
CN111224939B (en) Task request intercepting method and device, computer equipment and storage medium
CN113472803A (en) Vulnerability attack state detection method and device, computer equipment and storage medium
CN112527357A (en) Service hot loading updating method and device, computer equipment and storage medium
CN115174212A (en) Method for discriminating whether network data transmission is encrypted or not by utilizing entropy technology
CN111552696A (en) Data processing method and device based on big data, computer equipment and medium
CN112541102B (en) Abnormal data filtering method, device, equipment and storage medium
CN108389124B (en) Data processing method, data processing device, computer equipment and storage medium
CN110659188A (en) Page portrait data processing method and device, computer equipment and storage medium
CN111787108A (en) Content sharing method and device, computer equipment and storage medium
CN108650249B (en) POC attack detection method and device, computer equipment and storage medium
CN111814052A (en) Mobile internet user management method, device, server and readable storage medium
CN109471852B (en) Medical database establishing method, medical database establishing device, computer equipment and storage medium
CN110597782A (en) Database dynamic switching method and device, computer equipment and storage medium
CN111667190B (en) Electric power construction grounding monitoring method, device and server
CN111901324B (en) Method, device and storage medium for flow identification based on sequence entropy
CN111431888B (en) Method, device, equipment and storage medium for shielding key information

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