Traffic statistical method, traffic statistical device and terminal

By using multiple hash functions to generate multiple hash values ​​and selecting the serial number extreme value to determine the target location index, the problem of statistical errors caused by hash collisions in the existing technology is solved, the accuracy of traffic statistics is improved, and randomness is achieved through Protect user privacy.

CN118740696APending Publication Date: 2024-10-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310379405.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Due to statistical errors caused by hash collisions, existing traffic statistics methods cannot accurately distinguish the number of visits to multiple traffic data, affecting the accuracy of statistical results.

Method used

By obtaining the location index group of multiple traffic data, using multiple hash functions to generate multiple hash values, selecting the serial number extreme value to determine the target location index, and generating an access status identification vector based on the disturbance value, reducing the impact of hash collisions and improving Accuracy of statistics.

Benefits of technology

It effectively reduces the impact of hash collisions and improves the accuracy of traffic statistics. At the same time, it protects user privacy and enhances data security through the randomness of disturbance values.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740696A_ABST
    Figure CN118740696A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a flow statistical method, a flow statistical device and a terminal, which can improve the accuracy of a flow statistical result, and the method comprises the following steps: after obtaining a position index group of a plurality of pieces of flow data and receiving messages sent by a plurality of terminals, selecting messages from the messages sent by the plurality of terminals one by one as to-be-processed messages, according to the position index group of each piece of traffic data, obtaining a serial number group of each piece of traffic data from a sorting matrix included in the to-be-processed message, then selecting a serial number extreme value from the serial number group of each piece of traffic data, and determining a target position index of each piece of traffic data according to the serial number extreme value, and then generating an access state identification vector corresponding to the to-be-processed message according to a comparison result of the position index of the disturbance value in the to-be-processed message and the target position index of each traffic data and the disturbance value, and determining a statistical value of the target traffic data according to the access state identification vectors corresponding to all the messages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a flow statistics method, a flow statistics device and a terminal. Background Art

[0002] Based on local differential privacy technology, the terminal can send false data with a certain probability. Therefore, the traffic data of a single user collected by the receiver is inaccurate, which can protect user privacy.

[0003] At present, there is a traffic statistics method that is roughly as follows: the terminal uses the kth hash function to hash the traffic data into a hash value, determines the location index of the traffic data based on k and the hash value, sets the value of the location index to 1, and the values ​​of other locations to -1, and then the terminal uses a random response mechanism to perturb each value of the vector to obtain a perturbation vector, and then sends the perturbation vector to the server. The server forms a matrix with the perturbation vectors of n users, and determines the number of visits to the mth traffic data based on the mth column vector of the matrix and the perturbation probability.

[0004] However, when a terminal visits multiple websites, multiple traffic data will be generated. When the hash values ​​generated based on two or more traffic data are the same, the server cannot distinguish which traffic data the number of visits corresponding to the hash value belongs to, thus causing statistical errors. Summary of the invention

[0005] In view of this, the present application provides a flow statistics method, which can reduce the impact of hash value collisions and improve the accuracy of flow statistics results. The present application also provides a flow statistics device and a terminal that can implement the above flow statistics method.

[0006] A first aspect provides a traffic statistics method, which includes: after obtaining location index groups of multiple traffic data and receiving messages sent by multiple terminals, selecting messages one by one from the messages sent by the multiple terminals as messages to be processed, obtaining a sequence number group for each traffic data from a sorting matrix included in the message to be processed according to the location index group of each traffic data, and then selecting a sequence number extreme value from the sequence number group for each traffic data, determining a target location index for each traffic data in the location index groups of multiple traffic data according to the sequence number extreme value, and then generating an access state identification vector corresponding to the message to be processed according to a comparison result of a location index of a disturbance value in the message to be processed and the target location index of each traffic data and the disturbance value; and determining a statistical value of the target traffic data according to the access state identification vectors corresponding to all messages.

[0007] The traffic data includes a domain name and / or an IP address. The message includes a disturbance value, a position index of the disturbance value, and a sorting matrix, the sorting matrix includes a first group of sequence numbers and a second group of sequence numbers, the sequence numbers of the first group of sequence numbers correspond to the first numerical value, and the sequence numbers of the second group of sequence numbers correspond to the second numerical value. The position index group of each traffic data includes multiple position indexes, and each position index includes a hash function sequence number and a hash value. The target traffic data is any one of the multiple traffic data.

[0008] According to the method of the first aspect, the extreme value of the sequence number of each flow data can be obtained from the sorting matrix according to the position index group of each flow data. Since the extreme value of the sequence number of the accessed flow data belongs to the second group of sequence numbers, and the extreme value of the sequence number of the unaccessed flow data has a high probability of belonging to the first group of sequence numbers, the position indexes corresponding to the extreme values ​​of the sequence numbers of the above two types of flow data are likely to be different. Compared with determining the position index of the flow data according to a single hash function, the probability that the position indexes corresponding to the extreme values ​​of the sequence numbers of the two flow data are the same is lower, so the impact of hash collisions can be reduced, and the accuracy of flow statistics data can be improved.

[0009] Moreover, since the value received by the traffic statistics device is a disturbance value, the traffic statistics device cannot determine the true value of the value, and thus cannot determine whether the terminal user has accessed certain traffic data, thereby effectively protecting user privacy.

[0010] In a possible implementation, generating an access state identification vector corresponding to the message to be processed based on the comparison result of the position index of the disturbance value in the message to be processed and the target position index of each flow data and the disturbance value includes: after selecting the target position index of the flow data one by one from the target position indexes of multiple flow data as the target position index of the flow data to be compared, when the position index of the disturbance value in the message to be processed is the same as the target position index of the flow data to be compared, modifying the access state identification of the flow data to be compared to the disturbance value; when the position index of the disturbance value in the message to be processed is different from the target position index of the flow data to be compared, setting the access state identification of the flow data to be compared to a default value; according to the sequence number of the flow data, the access state identification of multiple flow data is combined into an access state identification vector corresponding to the message to be processed. The access state vector contains the access state identifications of multiple flow data. Among them, the disturbance value is used to indicate whether the flow data is accessed, and the default value is used to indicate that the behavior of the flow data being accessed is unknown.

[0011] In another possible implementation, selecting a sequence number extreme value from the sequence number group of each flow data includes: selecting a minimum sequence number from the sequence number group of each flow data as the sequence number extreme value.

[0012] In another possible implementation, selecting a sequence number extreme value from the sequence number group of each flow data includes: selecting a maximum sequence number from the sequence number group of each flow data as the sequence number extreme value.

[0013] In another possible implementation, the access status identification vectors and the statistical values ​​of the target traffic data corresponding to all messages satisfy the following formula:

[0014]

[0015] is the statistical value of the target traffic data, ε is the privacy budget, C i (x) is the access status identifier of the target traffic data in the access status identifier vector corresponding to the i-th message, K is the total number of hash functions, M is the number of hash bits, n is the total number of messages, and i is a positive integer not greater than n.

[0016] In another possible implementation, obtaining a location index group of multiple traffic data includes: selecting traffic data one by one from multiple traffic data as traffic data to be processed, and using multiple hash functions to calculate multiple hash values ​​of the traffic data to be processed; determining a location index of the traffic data to be processed according to the sequence number of each hash function and the hash value corresponding to the hash function; and grouping all location indexes of the traffic data to be processed into a location index group.

[0017] The second aspect provides a traffic statistics method, which includes: after obtaining the traffic data that has been accessed within the statistical period, using the counting minimum sketch algorithm to generate a coding matrix corresponding to each traffic data, and performing an OR operation on the coding matrices corresponding to all the traffic data; randomly selecting a value from the target matrix obtained by the OR operation; perturbing the randomly selected value into a disturbance value; selecting a first group of sequence numbers from a first interval according to the number of first values ​​in the target matrix; selecting a second group of sequence numbers from a second interval according to the number of second values ​​in the target matrix, and then generating a sorting matrix according to the first group of position indexes of the target matrix, the second group of position indexes of the target matrix, the first group of sequence numbers, and the second group of sequence numbers, and sending the disturbance value, the position index of the disturbance value, and the sorting matrix to the traffic statistics device.

[0018] The encoding matrix includes a first value and a second value, the first value is used to indicate that the traffic data has not been accessed, and the second value is used to indicate that the traffic data has been accessed. There is no overlapping portion between the first interval and the second interval. The values ​​corresponding to the first group of position indexes are all first values, and the values ​​corresponding to the second group of position indexes are all second values.

[0019] In the method of the second aspect, the counting minimum sketch algorithm includes the step of using multiple hash functions to calculate the hash value of the traffic data. Due to the hash characteristics of the hash function, the position indexes of different traffic data in the encoding matrix are different. The sequence numbers corresponding to the accessed traffic data do not include the sequence numbers of the first group of sequences, and the unaccessed traffic data most likely include the sequence numbers of the first group of sequences. Therefore, the accessed traffic data and the unaccessed traffic data can be distinguished according to the sequence numbers. Compared with using a single hash function to calculate the hash value of the traffic data, using multiple hash functions to calculate multiple hash values ​​of the traffic data, the receiver uses one of the multiple hash values ​​when counting the traffic, which can reduce the impact of hash collisions and improve the accuracy of statistical data.

[0020] Moreover, after randomly selecting a value from the matrix and perturbing it into a perturbation value, the receiver cannot know the true value of the value based on the perturbation value, and thus cannot determine whether the terminal user has visited a certain domain name, thereby effectively protecting user privacy.

[0021] In a possible implementation, generating a sorting matrix according to a first group of position indexes of a target matrix, a second group of position indexes of the target matrix, a first group of sequence numbers, and a second group of sequence numbers includes: using a random mapping method to determine a first correspondence between a first group of position indexes of the target matrix and a first group of sequence numbers; writing the first group of sequence numbers into a matrix to be processed according to the first correspondence; using a random mapping method to determine a second correspondence between a second group of position indexes of the target matrix and a second group of sequence numbers; writing the second group of sequence numbers into the matrix to be processed according to the second correspondence; and using the matrix to be processed after writing the first group of sequence numbers and the second group of sequence numbers as a sorting matrix. After randomly mapping the position indexes and the sequence numbers, the positions of the sequence numbers in the sorting matrix are random, so that an attacker cannot determine which sequence numbers belong to the first group of sequence numbers and which sequence numbers belong to the second group of sequence numbers based on the sequence numbers of the sorting matrix, and therefore cannot determine the true values ​​corresponding to the sequence numbers, thereby improving data security.

[0022] In another possible implementation, the maximum sequence number of the first group of sequence numbers is less than the minimum sequence number of the second group of sequence numbers. According to this implementation, when the minimum sequence number of the flow data belongs to the first group of sequence numbers, it indicates that the flow data has not been accessed. When the minimum sequence number of the flow data belongs to the second group of sequence numbers, it indicates that the flow data has been accessed.

[0023] In another possible implementation, the maximum sequence number of the second group of sequence numbers is less than the minimum sequence number of the first group of sequence numbers. According to this implementation, when the maximum sequence number of the flow data belongs to the first group of sequence numbers, it indicates that the flow data has not been accessed. When the maximum sequence number of the flow data belongs to the second group of sequence numbers, it indicates that the flow data has been accessed.

[0024] In another possible implementation, processing the randomly selected numerical disturbance as a disturbance value includes: processing the randomly selected numerical disturbance as a disturbance value using a random response mechanism.

[0025] The third aspect provides a flow statistics device, which includes an acquisition module, a receiving module, an index module, a generation module and a determination module; the acquisition module is used to acquire a position index group of multiple flow data; the receiving module is used to receive messages sent by multiple terminals; the index module is used to select messages one by one from the messages sent by multiple terminals as messages to be processed; according to the position index group of each flow data, a sequence number group of each flow data is acquired from the sorting matrix included in the message to be processed; the sequence number extreme value is selected from the sequence number group of each flow data; the target position index of each flow data is determined according to the sequence number extreme value in the position index group of multiple flow data; the generation module is used to generate an access state identification vector corresponding to the message to be processed according to the comparison result of the position index of the disturbance value in the message to be processed and the target position index of each flow data and the disturbance value; the determination module is used to determine the statistical value of the target flow data according to the access state identification vectors corresponding to all messages.

[0026] For the explanation of terms in the third aspect, the steps performed by each module and the beneficial effects, please refer to the corresponding description of the first aspect.

[0027] A fourth aspect provides a terminal, which includes an acquisition module, an encoding module, a sampling module, a disturbance module, a generation module and a sending module; the acquisition module is used to acquire the traffic data that has been accessed within the statistical period; the encoding module is used to use the counting minimum sketch algorithm to generate a coding matrix corresponding to each traffic data; the coding matrices corresponding to all traffic data are ORed; the sampling module is used to randomly select values ​​from the target matrix obtained by the OR operation; the disturbance module is used to perturb the randomly selected values ​​into disturbance values; the generation module is used to select a first group of sequence numbers from a first interval according to the number of first values ​​in the target matrix; select a second group of sequence numbers from a second interval according to the number of second values ​​in the target matrix; generate a sorting matrix according to the first group of position indexes of the target matrix, the second group of position indexes of the target matrix, the first group of sequence numbers and the second group of sequence numbers; the sending module is used to send the disturbance values, the position indexes of the disturbance values ​​and the sorting matrix to the traffic statistics device.

[0028] For the explanation of terms in the fourth aspect, the steps performed by each module and the beneficial effects, please refer to the corresponding description of the second aspect.

[0029] The fifth aspect provides a computing device, which includes a processor and a memory, the memory is used to store programs; the processor implements the method of the first aspect by executing the program.

[0030] A sixth aspect provides a terminal, which includes a processor and a memory, the memory is used to store programs; the processor implements the method of the second aspect by executing the program.

[0031] A seventh aspect provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is executed on a computing device, the computing device executes the methods of the above aspects.

[0032] An eighth aspect provides a computer program product comprising instructions, which, when executed on a computer, enables the computing device to execute the methods of the above aspects.

[0033] The ninth aspect provides a chip system, which includes at least one processor, the processor is coupled to a memory, the memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions to implement the methods of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of a traffic statistics scenario in an embodiment of the present application;

[0035] Figure 2 A structural diagram of a terminal in an embodiment of the present application;

[0036] Figure 3 A schematic diagram of a method for performing traffic statistics on a terminal in an embodiment of the present application;

[0037] Figure 4 A structural diagram of a server in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a method for performing traffic statistics on a server in an embodiment of the present application;

[0039] Figure 6 A flow chart of the traffic statistics method in the embodiment of the present application;

[0040] Figure 7 Another flow chart of the traffic statistics method in the embodiment of the present application;

[0041] Figure 8 A structural diagram of a flow statistics device in an embodiment of the present application;

[0042] Fig. 9 Another structural diagram of a terminal in an embodiment of the present application;

[0043] Fig.10 A structural diagram of a computing device in an embodiment of the present application;

[0044] Fig.11A schematic diagram of a computing device cluster in an embodiment of the present application;

[0045] Fig.12 This is another schematic diagram of a computing device cluster in an embodiment of the present application. DETAILED DESCRIPTION

[0046] The method of the present application can be applied to a communication system including a terminal and a traffic statistics device. The terminal can be, but is not limited to, a desktop, a laptop, or a smart phone. The traffic statistics device of the present application includes, but is not limited to, an application server or a security server, and can also be a central server, an edge server, a distributed server, a local server in a local data center, or other computing devices of the communication system.

[0047] like Figure 1 As shown, in one embodiment, the traffic statistics device takes a server as an example, and the communication system includes a server and multiple terminals. Terminal 1 generates first disturbance data and a first sorting matrix based on traffic data, terminal 2 generates second disturbance data and a second sorting matrix based on traffic data, terminal n generates nth disturbance data and nth sorting matrix based on traffic data, and the process of generating disturbance data and sorting matrix by other terminals is similar to the process of generating disturbance data and sorting matrix by the above-mentioned terminals. It should be understood that the traffic data obtained by each terminal can be the same or different.

[0048] The server calculates the statistical value of a certain traffic data based on n disturbance data and n sorting matrices, where n is a positive integer. When the traffic data is a domain name, the statistical value can be how many terminals access the domain name during the statistical period, how many IP addresses access a certain domain name during the statistical period, etc.

[0049] The following introduces the terminal and server respectively. Figure 2 In one embodiment, taking terminal 1 as an example, terminal 1 includes an encoder 21 and a disturber 22, the encoder 21 includes a counting unit 211 and a storage unit 212, the disturber 22 includes a sampling unit 221, a random response unit 222 and a generation sorting matrix unit 223.

[0050] The following describes the process of generating the first disturbance data and the first sorting matrix according to the traffic data by the terminal 1. Figure 3 , the process includes:

[0051] Step 301: The encoder 21 obtains flow data. The encoder 21 generates a target matrix according to the flow data, and then executes step 302.

[0052] Step 302: The encoder 21 sends the target matrix to the sampling unit 221 and the generating order matrix unit 223. The sampling unit 221 selects a random number from the target matrix and obtains the position index of the random number, and then executes step 303. The generating order matrix unit 223 generates an order matrix according to the target matrix, and then executes step 305.

[0053] Step 303: The sampling unit 221 sends the random number and the position index of the random number to the random response unit 222. The random response unit 222 generates a disturbance value according to the random number.

[0054] It should be noted that the sampling unit 221 may also only send the random number to the random response unit 222 and directly output the position index of the random number.

[0055] Step 304: The random response unit 222 outputs the first disturbance data. The first disturbance data includes the position index of the random number and the disturbance value, and the position index of the random number is the position index of the disturbance value.

[0056] Step 305: The generating sorting matrix unit 223 outputs a first sorting matrix.

[0057] It should be understood that the structures of other terminals are similar to that of terminal 1, and the steps performed by the encoder and the perturbator in other terminals can refer to the steps performed by the encoder and the perturbator in terminal 1, which will not be repeated here.

[0058] See also Figure 4 In one embodiment, the server includes a decoder 41 and a corrector 42 , the decoder 41 includes a query unit 411 , an index unit 412 , and a vector generation unit 413 , and the corrector 42 includes a data integration unit 421 and a data estimation unit 422 .

[0059] The following describes the process of determining the statistical value of the server based on n disturbance data and n sorting matrices. Figure 5 , the process includes:

[0060] Step 501 : The query unit 411 sends the location index of the traffic data to the index unit 412 .

[0061] Step 502: The index unit 412 obtains a sorting matrix. The index unit 412 searches for the minimum value position index from the sorting matrix according to the position index of the flow data.

[0062] Step 503 : The index unit 412 sends the minimum value position index to the vector generation unit 413 .

[0063] Step 504: The vector generation unit 413 obtains the disturbance data. The vector generation unit 413 generates an access state identification vector according to the minimum value position index and the disturbance data.

[0064] Step 505: the vector generation unit 413 sends the access state identification vector to the data integration unit 421. The data integration unit 421 integrates the access state identification vectors corresponding to all messages into an access state identification matrix.

[0065] Step 506: The vector generation unit 413 sends the access state identification matrix to the data estimation unit 422. The data estimation unit 422 estimates the statistical value of any flow data according to the access state identification matrix.

[0066] Step 507: The data estimation unit 422 outputs the statistical value.

[0067] The following is an introduction to some of the terms in this application:

[0068] Traffic statistics are calculated based on the values ​​of discrete variables within a period of time, such as the domain names visited by users in a day. Therefore, the traffic data during the statistical period is not a single discrete value, but contains multiple values. In order to protect the privacy of users, these multiple values ​​need to be perturbed separately. When there are multiple values ​​that need to be perturbed on the same user terminal, the user terminal needs to execute the local differential privacy algorithm multiple times locally. In this case, according to the sequential combination property of local differential privacy, the limited privacy budget needs to be allocated to multiple values ​​in a single execution process, resulting in a small privacy budget for each value, large perturbation noise, and poor availability.

[0069] In addition, traffic statistics also have the following characteristics: 1) Network traffic of different users is heterogeneous, that is, different users generate different numbers of values ​​in the same time period. The number of values ​​affects the amount of privacy budget used for a single value perturbation, and thus affects the strength of privacy protection. Therefore, in order to maintain the consistency of privacy protection strength for different users, some studies assume that each user only generates one value in the period, and some studies use sets to represent network traffic and unify the size of the data set through a predefined length. However, these studies may have usability problems due to assumptions that are inconsistent with the actual situation, or due to the poor universality of the predefined unified length caused by the dynamic nature of network traffic, which leads to usability and efficiency problems; 2) The value space of discrete variables involved in network traffic is large, such as domain name space, IP address space, etc., which will lead to high computing and communication costs.

[0070] The local differential privacy algorithm involves the terminal and the traffic statistics device. The terminal encodes and disturbs the data, and the traffic statistics device estimates and decodes based on the disturbed data. For the disturbed data, the traffic statistics device cannot determine the original value.

[0071] A hash function is a function that compresses a message of any length into a message digest of a fixed length. A hash collision is a phenomenon where different values ​​are hashed to the same value.

[0072] The count min sketch algorithm can use the hash function to store as much original data statistics as possible with much less space overhead than the original data.

[0073] The privacy budget is used to characterize the privacy protection strength in local differential privacy. The larger the privacy budget, the weaker the privacy protection strength; the smaller the privacy budget, the more indistinguishable any input is, that is, the greater the degree of disturbance, the stronger the privacy protection strength. The value of the privacy budget ε in this application can be set according to the actual situation.

[0074] Availability is used to indicate the degree of closeness between the statistical value calculated based on the data perturbed by the local differential privacy algorithm and the true statistical value, and is usually measured by mean squared error (MSE).

[0075] The random response mechanism is a perturbation mechanism in the local differential privacy method. This mechanism allows users to answer the opposite of the true situation with a certain probability. Specifically, when a user The probability of answering the true situation is The probability of answering the opposite situation, the collector estimates the statistical value of the actual situation based on the perturbation probability and the statistical value of the perturbed data. For any two inputs x, x′ and output y satisfying Where M represents the perturbation algorithm.

[0076] The existing traffic statistics method has the problem of hash collision. The present application can use multiple hash functions to generate multiple hash values ​​of traffic data to obtain the location index group of traffic data, and then map the location index group to the sequence number group so that the sequence number extreme values ​​corresponding to different traffic data are different, thereby reducing the impact of hash collision and improving the accuracy of traffic statistics. Figure 6 , an embodiment of the traffic statistics method of the present application includes:

[0077] Step 601: Obtain a plurality of location index groups of traffic data.

[0078] Each location index group of traffic data includes multiple location indexes, and each location index includes a hash function sequence number and a hash value. The traffic data includes a domain name and / or an Internet protocol (IP) address.

[0079] Optionally, step 601 includes: obtaining a plurality of location index groups of traffic data from pre-configured data.

[0080] Alternatively, step 601 includes: selecting traffic data one by one from multiple traffic data as traffic data to be processed; using multiple hash functions to calculate multiple hash values ​​of the traffic data to be processed; determining a location index of the traffic data to be processed according to the sequence number of each hash function and the hash value corresponding to the hash function; and grouping all location indexes of the traffic data to be processed into a location index group.

[0081] Specifically, the flow data is recorded as x, and the location index of the flow data can be recorded as (k, H k (x)), k is the hash function serial number, H k (x) is the hash value obtained by hashing the traffic data with the kth hash function. The location index group of the traffic data includes (1, H 1 (x)), (2,H 2 (x)),…,(k,H k (x)).

[0082] Step 602: Receive messages sent by multiple terminals.

[0083] The message includes a perturbation value, a position index of the perturbation value, and a sorting matrix. Each message may include one or more perturbation values, a position index of each perturbation value, and a sorting matrix.

[0084] Step 603: Select messages one by one from the messages sent by multiple terminals as messages to be processed.

[0085] Step 604: Obtain the sequence number group of each flow data from the sorting matrix included in the message to be processed according to the position index group of each flow data.

[0086] The sorting matrix includes a first group of sequence numbers and a second group of sequence numbers, and any two sequence numbers in the sorting matrix are not equal. The values ​​corresponding to the first group of sequence numbers are all first values, and the values ​​corresponding to the second group of sequence numbers are all second values. The first value is used to indicate that the flow data has not been accessed, and the second value is used to indicate that the flow data has been accessed.

[0087] Step 605: Select the extreme value of the sequence number from the sequence number group of each flow data.

[0088] The sequence number extreme value may be the maximum sequence number or the minimum sequence number. The mode for selecting the sequence number extreme value may be preconfigured. For example, both the terminal and the traffic statistics device are preconfigured with a mode for selecting the sequence number extreme value. In mode 1, the minimum sequence number is selected from the sequence number group of each traffic data as the sequence number extreme value. In mode 2, the maximum sequence number is selected from the sequence number group of each traffic data as the sequence number extreme value. It should be noted that in mode 1, the maximum value of the first group of sequence numbers is less than the minimum value of the second group of sequence numbers. In mode 2, the maximum value of the second group of sequence numbers is less than the minimum value of the first group of sequence numbers.

[0089] If the mode for selecting the sequence number extreme value is not pre-configured, the terminal and the traffic statistics counting device may negotiate the mode for selecting the sequence number extreme value, and carry the mode identifier in the message for transmission.

[0090] Step 606: Determine the target location index of each flow data in the location index group of multiple flow data according to the extreme value of the sequence number.

[0091] When the sequence number extreme value is the minimum sequence number of the sequence number group, the target position index of the flow data is the position index corresponding to the minimum sequence number. When the sequence number extreme value is the maximum sequence number of the sequence number group, the target position index of the flow data is the position index corresponding to the maximum sequence number.

[0092] Step 607: Generate an access state identification vector corresponding to the message to be processed according to the comparison result between the position index of the disturbance value in the message to be processed and the target position index of each flow data and the disturbance value.

[0093] The access state vector corresponding to the message to be processed includes the access state identifier of each flow data. For example, the access state identifier can be -1, 0 or 1. For any flow data, -1 means that the flow data has not been accessed, 1 means that the flow data has been accessed, and 0 means that the behavior of accessing the flow data is unknown. It should be understood that the corresponding relationship between the access state identifier and the numerical value can be set according to the actual situation, and this application does not limit it.

[0094] Step 608: Determine the statistical value of the target traffic data according to the access status identification vectors corresponding to all messages.

[0095] The target traffic data is any one of the multiple traffic data. Optionally, the statistical value of the target traffic data may be the ratio of the number of terminals accessing the target traffic data to the number of terminals accessing all traffic data. The statistical value of the target traffic data may be set according to actual statistical requirements, and this application does not limit it.

[0096] Optionally, the statistical values ​​of the access status identification vectors and target traffic data corresponding to all messages satisfy the following formula:

[0097]

[0098] is the statistical value of the target traffic data, ε is the privacy budget, C i (x) is the access status identifier of the target traffic data in the access status identifier vector corresponding to the i-th message, K is the total number of hash functions, M is the number of hash bits, n is the total number of messages, and i is a positive integer not greater than n.

[0099] It should be noted that the formulas satisfied by the access status identification vectors and the statistical values ​​of the target traffic data corresponding to all messages are not limited to the above examples, and can be adjusted according to actual conditions.

[0100] In this embodiment, the extreme value of the sequence number of each flow data can be obtained from the sorting matrix according to the position index group of each flow data. Since the extreme value of the sequence number of the accessed flow data belongs to the second group of sequence numbers, and the extreme value of the sequence number of the unaccessed flow data is likely to belong to the first group of sequence numbers, the position indexes corresponding to the extreme values ​​of the sequence numbers of the above two types of flow data are likely to be different. Compared with determining the position index of the flow data according to a single hash function, the probability that the position indexes corresponding to the extreme values ​​of the sequence numbers of the two flow data are the same is lower, so the impact of hash collisions can be reduced and the accuracy of statistical data can be improved.

[0101] Secondly, the traffic statistics device cannot determine the true value of the disturbance value, and thus cannot determine whether the terminal user has accessed certain traffic data, thus effectively protecting user privacy.

[0102] Thirdly, the disturbance value and the position index of the disturbance value are both random, and the traffic statistics device cannot determine which domain name the disturbance value is related to, thereby further improving the security of user privacy.

[0103] It should be noted that, although the traffic statistics device cannot determine the state of a specific user accessing traffic data, the traffic statistics device can determine the statistical value of the target traffic data according to the access state identification vectors corresponding to all messages. The process of obtaining the location index groups of multiple traffic data in step 601 and the process of obtaining the messages to be processed in steps 602 to 603 have no fixed order.

[0104] In an optional embodiment, step 607 includes: selecting the target position index of the traffic data one by one from the target position indexes of multiple traffic data as the target position index of the traffic data to be compared; when the position index of the disturbance value in the message to be processed is the same as the target position index of the traffic data to be compared, modifying the access state identifier of the traffic data to be compared to the disturbance value; when the position index of the disturbance value in the message to be processed is different from the target position index of the traffic data to be compared, setting the access state identifier of the traffic data to be compared to a default value; and combining the access state identifiers of multiple traffic data into an access state identifier vector corresponding to the message to be processed according to the sequence number of the traffic data.

[0105] For example, the total number of traffic data is 10, and the initial access state identification vector is (0, 0, ..., 0), which means that the access state identification of each traffic data is 0. For example, if the target position index of traffic data 1 is the same as the position index of the disturbance value, the access state identification of traffic data 1 is modified to the disturbance value, taking 1 as an example. The access state identification of other traffic data is the default value (i.e. 0). In the updated vector, the corresponding relationship between the access state identification and the sequence number of the traffic data can be as follows:

[0106] As shown in Table 1:

[0107] Traffic data serial number 1 2 3 4 5 6 7 8 9 10 Access status indicator 1 0 0 0 0 0 0 0 0 0

[0108] Table 1

[0109] It should be understood that the total amount of flow data, disturbance value and default value can be set according to actual conditions and are not limited in this application.

[0110] The following is an introduction to the process of executing the traffic statistics method on the terminal. Figure 7 , an embodiment of the traffic statistics method of the present application includes:

[0111] Step 701: Obtain traffic data that has been accessed during the statistical period. The traffic data includes domain names and / or IP addresses.

[0112] Step 702: Generate a coding matrix corresponding to each flow data using a counting minimum sketch algorithm. The coding matrix includes a first value and a second value.

[0113] Optionally, step 702 includes: selecting traffic data one by one from at least one traffic data as traffic data to be processed, using multiple hash functions to hash the traffic data to be processed into multiple hash values, selecting a value in the row vector corresponding to the hash function according to the hash value corresponding to each hash function, replacing the selected value with a second value, and forming all the row vectors after the replacement of the values ​​into a coding matrix corresponding to the traffic data to be processed.

[0114] The first value and the second value are different values, the first value is used to indicate that the terminal has not accessed the traffic data, and the second value is used to indicate that the terminal has accessed the traffic data. The first value and the second value can be set according to actual conditions, and this application does not limit them. Optionally, the first value is -1 and the second value is 1. Alternatively, the first value is 1 and the second value is -1. Alternatively, the first value is 0 and the second value is 1. Alternatively, the first value is 1 and the second value is 0.

[0115] Step 703: Perform an OR operation on the coding matrices corresponding to all the traffic data.

[0116] Specifically, the values ​​with position index (i, j) in all encoding matrices are ORed to obtain the values ​​with position index (i, j) in the target matrix, where i is a row variable and j is a column variable, and both i and j are positive integers.

[0117] Step 704: randomly select a value from the target matrix obtained by the OR operation.

[0118] Step 705: Process the randomly selected numerical disturbance into a disturbance value.

[0119] Optionally, step 705 includes: using a random response mechanism to process the randomly selected numerical disturbance into a disturbance value. It should be understood that the method for obtaining the disturbance value in the present application includes but is not limited to a random response mechanism.

[0120] This embodiment can generate one or more disturbance values. When a disturbance value is generated, the entire privacy budget is allocated to the disturbance value. At this time, the disturbance probability is When multiple perturbation values ​​are generated, the entire privacy budget can be allocated to the multiple perturbation values. The allocation method can be, but is not limited to, average allocation. It should be noted that when the entire privacy budget is allocated to L perturbation values, the perturbation probability is Since L is an integer greater than 1, Greater than This will reduce the usability of statistical results.

[0121] Step 706: Select a first group of sequence numbers from the first interval according to the number of first values ​​in the target matrix.

[0122] Step 707: Select a second group of serial numbers from the second interval according to the number of second values ​​in the target matrix.

[0123] There is no overlapping part between the first interval and the second interval. Any two sequence numbers in the first group of sequence numbers are different, and any two sequence numbers in the second group of sequence numbers are different. The sequence numbers in the first group of sequence numbers can be continuous, for example, the first group of sequence numbers includes 5 sequence numbers, and the sequence numbers are 1 to 5. The sequence numbers in the first group of sequence numbers can also be discontinuous, for example, the first group of sequence numbers includes 5 sequence numbers, and the sequence numbers are 1, 3, 5, 7, and 10. The sequence numbers in the second group of sequence numbers can be continuous or discontinuous. The first group of sequence numbers and the second group of sequence numbers can be set according to actual conditions, and this application does not limit them.

[0124] Step 708: Generate a sorting matrix according to the first group of position indexes of the target matrix, the second group of position indexes of the target matrix, the first group of sequence numbers and the second group of sequence numbers. The values ​​corresponding to the first group of position indexes are all first values, and the values ​​corresponding to the second group of position indexes are all second values.

[0125] Step 709: Send the disturbance value, the position index of the disturbance value and the sorting matrix to the traffic statistics device.

[0126] In this embodiment, the counting minimum sketch algorithm includes the step of using multiple hash functions to calculate the hash value of the traffic data. Due to the hash characteristics of the hash function, the position indexes of different traffic data in the encoding matrix are different. The serial numbers corresponding to the accessed traffic data do not include the serial numbers of the first group of sequences, and the unaccessed traffic data most likely include the serial numbers of the first group of sequences. Therefore, the accessed traffic data and the unaccessed traffic data can be distinguished according to the two groups of serial numbers. Compared with using a single hash function to calculate the hash value of the traffic data, using multiple hash functions to calculate multiple hash values ​​of the traffic data and then taking one from the multiple hash values ​​can reduce the impact of hash collisions and improve the accuracy of statistical data.

[0127] Secondly, the traffic statistics device cannot determine the true value of the disturbance value, and thus cannot determine whether the terminal user has accessed a certain traffic data, so it can effectively protect user privacy. It should be noted that sending a single disturbance value and the location index of the disturbance value can reduce the noise caused by allocating the privacy budget, improve information utilization, and improve the usability of the traffic statistics method.

[0128] Thirdly, the disturbance value and the position index of the disturbance value are both random, and the traffic statistics device cannot determine which domain name the disturbance value is related to, thereby further improving the security of user privacy.

[0129] In an optional embodiment, step 708 includes: using a random mapping method to determine a first correspondence between a first group of position indices of the target matrix and a first group of serial numbers; writing the first group of serial numbers into the matrix to be processed according to the first correspondence; using a random mapping method to determine a second correspondence between a second group of position indices of the target matrix and a second group of serial numbers; writing the second group of serial numbers into the matrix to be processed according to the second correspondence; and using the matrix to be processed after writing the first group of serial numbers and the second group of serial numbers as a sorting matrix.

[0130] In this embodiment, random mapping can make it impossible for the receiver to determine how the first group of sequence numbers and the second group of sequence numbers are grouped, and can make it difficult for the receiver to identify whether the value corresponding to the sequence number is the first value or the second value, thereby improving the security of user data and further protecting user privacy.

[0131] In another optional embodiment, the maximum sequence number of the first group of sequence numbers is smaller than the minimum sequence number of the second group of sequence numbers.

[0132] In this embodiment, the K hash values ​​corresponding to the traffic data correspond to K position indexes, and the K position indexes correspond to K sequence numbers, so that the minimum sequence number can be obtained from the K sequence numbers. When the minimum sequence number of the traffic data belongs to the first group of sequence numbers, it indicates that the traffic data has not been accessed. When the minimum sequence number of the traffic data belongs to the second group of sequence numbers, it indicates that the traffic data has been accessed.

[0133] In another optional embodiment, the maximum sequence number of the second group of sequence numbers is smaller than the minimum sequence number of the first group of sequence numbers.

[0134] In this embodiment, the K hash values ​​corresponding to the traffic data correspond to K position indexes, and the K position indexes correspond to K sequence numbers, so that the maximum sequence number can be obtained from the K sequence numbers. When the maximum sequence number of the traffic data belongs to the first group of sequence numbers, it indicates that the traffic data has not been accessed. When the maximum sequence number of the traffic data belongs to the second group of sequence numbers, it indicates that the traffic data has been accessed.

[0135] For ease of understanding, the traffic statistics method of this application is introduced below using a specific application scenario:

[0136] During the statistical period, terminal 1 accessed two domain names, namely domain name A and domain name B. Domain name A is first hashed using four hash functions, and the four hash values ​​obtained are 3, 2, 1, and 4. Domain name B is then hashed using four hash functions, and the four hash values ​​obtained are 3, 4, 1, and 1.

[0137] The corresponding relationship between the hash function serial number, domain name, hash value and location index is shown in Table 2:

[0138] domain name Hash function serial number Hash value Position Index Domain Name A 1 3 (1,3) Domain Name A 2 2 (2,2) Domain Name A 3 1 (3,1) Domain Name A 4 4 (4,4) Domain B 1 3 (1,3) Domain B 2 4 (2,4) Domain B 3 1 (3,1) Domain B 4 1 (4,1)

[0139] Table 2

[0140] The initial row vector corresponding to each hash function is [-1, -1, -1, -1], and the matrix A can be obtained.

[0141]

[0142] Modify the matrix element value corresponding to the position index group of domain name A to 1, and obtain matrix A 1 .

[0143]

[0144] Modify the matrix element value corresponding to the position index group of domain name B to 1, and get matrix A 2 .

[0145]

[0146] The matrix A 1 and the matrix A 2The target matrix A′ is obtained by OR operation.

[0147]

[0148] It should be understood that in the above matrix, -1 represents false and 1 represents true.

[0149] A value is randomly selected from the target matrix A′, for example, the element value at (3,1) is 1, and the element value is scrambled to -1.

[0150] The value corresponding to the first group of position indexes obtained according to the target matrix A′ is -1. The first group of position indexes includes (1,1), (1,2), (1,4), (2,1), (2,3), (3,2), (3,3), (3,4), (4,2), (4,3). There are 10 -1s, so the first group of serial numbers is 1,2, ..., 10 as an example. The mapping relationship between the first group of position indexes and the first group of serial numbers is established, and the mapping relationship is shown in Table 3:

[0151] Position Index Serial number (1,1) 5 (1,2) 7 (1,4) 3 (2,1) 1 (2,3) 6 (3,2) 8 (3,3) 9 (3,4) 4 (4,2) 10 (4,3) 2

[0152] Table 3

[0153] The value corresponding to the second group of position indexes obtained according to the target matrix A′ is 1, and the second group of position indexes includes (1,3), (2,2), (2,4), (3,1)(4,1), (4,4). There are 6 1s, so the second group of serial numbers is 11, 12, ..., 16. A mapping relationship between the second group of position indexes and the second group of serial numbers is established, and the mapping relationship is shown in Table 4:

[0154] Position Index Serial number (1,3) 12 (2,2) 14 (2,4) 11 (3,1) 16 (4,1) 15 (4,4) 13

[0155] Table 4

[0156] Generate the sorting matrix A according to the corresponding relationships shown in Table 2 and Table 3 1,p .

[0157]

[0158] Terminal 1 takes the disturbance value (i.e. -1), the position index of the disturbance value (3,1) and the sorting matrix A 1,p The process of generating disturbance values, position indexes of disturbance values ​​and sorting matrices by other terminals is similar to the process of generating disturbance values, position indexes of disturbance values ​​and sorting matrices by terminal 1, and will not be repeated here.

[0159] The server is pre-configured with 10 domain names, and 4 hash functions are used to hash the 10 domain names respectively, and a location index group of the domain name is formed according to the hash function sequence number and the hash value.

[0160] In one example, the location index group of domain name A includes (1,3), (2,2), (3,1), (4,4). Taking the sorting matrix sent by terminal 1 as an example, the server p The sequence number group corresponding to the position index group is determined in , and the sequence numbers included in the sequence number group are 12, 14, 16 and 13 respectively. The minimum sequence number is found from the sequence number group, which is 12, and the target position index corresponding to 12 is determined to be (1,3). The position index (3,1) of the disturbance value is different from the target position index (1,3) corresponding to domain name A, so the access status flag of domain name A is kept as 0. When the target position index of other domain names is (3,1), the access status flag of the domain name is updated to -1, thereby obtaining the first access status flag vector.

[0161] During the statistical period, terminal 2 accessed 1 domain name, taking domain name C as an example. The location index group of domain name C is (1,1), (2,3), (3,1), (4,2) as an example. A target matrix is ​​generated according to the location index group of domain name C, a disturbance value is selected from the target matrix, and after obtaining the location index and sorting matrix of the disturbance value, the disturbance value, the location index and sorting matrix of the disturbance value are sent to the server.

[0162] In an example, the perturbation value is 1, the position index of the perturbation value is (3,1), and the sorting matrix is:

[0163]

[0164] In one example, the sequence number group corresponding to the position index group of domain name C includes the following sequence numbers: 15, 13, 16, 14. The minimum sequence number is 13 from the sequence number group, and the position index corresponding to 13 is (2, 3) as an example. Since the position index (3, 1) of the disturbance value is different from the target position index (2, 3) of domain name C, the access status flag of domain name C is kept as 0. When the target position index of other domain names is (3, 1), the access status flag of the domain name is updated to 1, thereby obtaining a second access status flag vector.

[0165] A matrix is ​​generated based on the access status identification vectors corresponding to all messages, and the access status identification vector corresponding to each message is a row vector of the matrix. The statistical value of the i-th domain name is calculated based on formula (1) and the i-th column vector of the matrix. The statistical value can represent the proportion of users accessing the i-th domain name.

[0166] The following is an introduction to the traffic statistics device and terminal of this application. Figure 8 An embodiment of a traffic statistics device 800 provided in the present application includes an acquisition module 801, a receiving module 802, an index module 803, a generation module 804 and a determination module 805.

[0167] The acquisition module 801 is used to acquire a location index group of multiple flow data;

[0168] The receiving module 802 is used to receive messages sent by multiple terminals;

[0169] The index module 803 is used to select messages one by one from the messages sent by multiple terminals as messages to be processed; obtain the sequence number group of each flow data from the sorting matrix included in the message to be processed according to the position index group of each flow data; select the sequence number extreme value from the sequence number group of each flow data; determine the target position index of each flow data according to the sequence number extreme value in the position index group of multiple flow data;

[0170] The generating module 804 is used to generate an access state identification vector corresponding to the message to be processed according to the comparison result of the position index of the disturbance value in the message to be processed and the target position index of each flow data and the disturbance value;

[0171] The determination module 805 is used to determine the statistical value of the target traffic data according to the access state identification vectors corresponding to all messages.

[0172] As an example of a software functional unit, the acquisition module 801 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the acquisition module 801 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0173] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0174] As an example of a hardware functional unit, the acquisition module 801 may include at least one computing device, such as a server, etc. Alternatively, the acquisition module 801 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0175] The multiple computing devices included in the acquisition module 801 can be distributed in the same region or in different regions. The multiple computing devices included in the acquisition module 801 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the acquisition module 801 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0176] It should be noted that, in other embodiments, the acquisition module 801 may be used to execute Figure 6 In any step of the traffic statistics method in the embodiment shown, the receiving module 802 can be used to execute Figure 6 In any step of the traffic statistics method in the embodiment shown, the index module 803 can be used to perform Figure 6 In any step of the traffic statistics method in the embodiment shown, the generation module 804 can be used to perform Figure 6 In any step of the traffic statistics method in the embodiment shown, the determination module 805 can be used to perform Figure 6 Any step in the traffic statistics method in the illustrated embodiment; the steps that each module is responsible for implementing can be specified as needed, and all functions of the terminal can be realized by implementing different steps in the traffic statistics method through each module.

[0177] See also Fig. 9 In one embodiment, the terminal 900 provided in the present application includes an acquisition module 901, an encoding module 902, a sampling module 903, a disturbance module 904, a generation module 905 and a sending module 906.

[0178] The acquisition module 901 is used to acquire the traffic data that has been accessed during the statistical period; the encoding module 902 is used to use the counting minimum sketch algorithm to generate the encoding matrix corresponding to each traffic data, and perform an OR operation on the encoding matrices corresponding to all the traffic data; the sampling module 903 is used to randomly select values ​​from the target matrix obtained by the OR operation; the disturbance module 904 is used to perturb the randomly selected values ​​into disturbance values; the generation module 905 is used to select a first group of sequence numbers from a first interval according to the number of first values ​​in the target matrix; select a second group of sequence numbers from a second interval according to the number of second values ​​in the target matrix; generate a sorting matrix according to the first group of position indexes of the target matrix, the second group of position indexes of the target matrix, the first group of sequence numbers and the second group of sequence numbers, the values ​​corresponding to the first group of position indexes are all first values, and the values ​​corresponding to the second group of position indexes are all second values; the sending module 906 is used to send the disturbance value, the position index of the disturbance value and the sorting matrix to the traffic statistics device.

[0179] As an example of a software functional unit, the acquisition module 901 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the acquisition module 901 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.

[0180] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0181] As an example of a hardware functional unit, the acquisition module 901 may include at least one computing device, such as a server, etc. Alternatively, the acquisition module 901 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0182] The multiple computing devices included in the acquisition module 901 can be distributed in the same region or in different regions. The multiple computing devices included in the acquisition module 901 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the acquisition module 901 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0183] It should be noted that, in other embodiments, the acquisition module 901 may be used to execute Figure 7 In any step of the traffic statistics method in the embodiment shown, the encoding module 902 can be used to execute Figure 7 In any step of the traffic statistics method in the embodiment shown, the sampling module 903 can be used to perform Figure 7 In any step of the traffic statistics method in the embodiment shown, the disturbance module 904 can be used to perform Figure 7 In any step of the traffic statistics method in the embodiment shown, the generation module 905 can be used to perform Figure 7 In any step of the traffic statistics method in the embodiment shown, the sending module 906 can be used to execute Figure 7 Any steps in the traffic statistics method in the illustrated embodiment. The steps that each module is responsible for implementing can be specified as needed, and all functions of the server are realized by implementing different steps in the traffic statistics method by each module.

[0184] The present application also provides a computing device 1000, such as Fig.10As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006 and communication interface 1008. Processor 1004, memory 1006 and communication interface 1008 communicate through bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1000.

[0185] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 The bus 1004 may include a path for transmitting information between various components of the computing device 1000 (eg, the memory 1006, the processor 1004, and the communication interface 1008).

[0186] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0187] The memory 1006 may include a volatile memory, such as a random access memory (RAM). The processor 1004 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0188] The memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to respectively implement the functions of the aforementioned acquisition module, receiving module, indexing module, generating module, and determining module, thereby implementing the traffic statistics method. Alternatively, the processor 1004 executes the executable program codes to respectively implement the functions of the aforementioned acquisition module, encoding module, sampling module, perturbation module, generating module, and sending module, thereby implementing the traffic statistics method. That is, the memory 1006 stores instructions for executing the traffic statistics method.

[0189] The communication interface 1003 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.

[0190] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0191] like Fig.11 As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same instructions for executing the traffic statistics method.

[0192] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store some instructions for executing the traffic statistics method. In other words, the combination of one or more computing devices 1000 may jointly execute the instructions for executing the traffic statistics method.

[0193] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the server. That is, the instructions stored in the memory 1006 in different computing devices 1000 can implement the functions of one or more modules of the acquisition module, the receiving module, the indexing module, the generation module and the determination module.

[0194] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.12 A possible implementation is shown. Fig.12As shown, two computing devices 1000A and 1000B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device. In this type of possible implementation, the memory 1006 in the computing device 1000A stores instructions for executing the functions of the acquisition module. At the same time, the memory 1006 in the computing device 1000B stores instructions for executing the functions of the receiving module, the indexing module, the generating module, and the determining module.

[0195] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the traffic statistics method.

[0196] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computer or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computer to execute the traffic statistics method.

[0197] The present application also provides a chip system, which includes a processor and a memory coupled to each other. The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions stored in the memory, so that the server executes the steps performed by the acquisition module, the receiving module, the indexing module, the generation module or the determination module in the above embodiment. Optionally, the memory is a memory in the chip, such as a register, a cache, etc., and the memory can also be a memory located outside the chip in the site, such as a read-only memory or other types of static storage devices that can store static information and instructions, a random access memory, etc. The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, a dedicated integrated circuit or one or more integrated circuits for implementing the above-mentioned traffic statistics method.

[0198] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A traffic statistics method, It is characterized in that include: Acquire a plurality of location index groups of traffic data, each location index group of traffic data includes a plurality of location indexes, and each location index includes a hash function sequence number and a hash value; Receiving messages sent by multiple terminals, the messages including disturbance values, position indexes of the disturbance values, and a sorting matrix; Selecting messages one by one from messages sent by multiple terminals as messages to be processed; Obtaining a sequence number group for each flow data from a sorting matrix included in the message to be processed according to a position index group for each flow data; Select the extreme value of the sequence number from the sequence number group of each flow data; Determining a target position index of each flow data in the position index group of the plurality of flow data according to the sequence number extreme value; Generate an access state identification vector corresponding to the message to be processed according to a comparison result of the position index of the disturbance value in the message to be processed and the target position index of each flow data and the disturbance value; The statistical value of the target traffic data is determined according to the access state identification vectors corresponding to all the messages, and the target traffic data is any one of the multiple traffic data.

2. The method according to claim 1, It is characterized in that The step of generating an access state identification vector corresponding to the message to be processed according to a comparison result of the position index of the disturbance value in the message to be processed with the target position index of each flow data and the disturbance value comprises: Selecting target position indexes of flow data one by one from target position indexes of multiple flow data as target position indexes of flow data to be compared; When the position index of the disturbance value in the message to be processed is the same as the target position index of the traffic data to be compared, modifying the access state identifier of the traffic data to be compared to the disturbance value; When the position index of the disturbance value in the message to be processed is different from the target position index of the traffic data to be compared, setting the access state identifier of the traffic data to be compared to a default value; The access status identifiers of the plurality of traffic data are combined into an access status identifier vector corresponding to the message to be processed according to the sequence numbers of the traffic data.

3. The method according to claim 1, It is characterized in that The step of selecting a sequence number extreme value from a sequence number group of each flow data comprises: The smallest sequence number is selected from the sequence number group of each flow data as the sequence number extreme value.

4. The method according to claim 1, It is characterized in that The step of selecting a sequence number extreme value from a sequence number group of each flow data comprises: The maximum sequence number is selected from the sequence number group of each flow data as the sequence number extreme value.

5. The method according to any one of claims 1 to 4, It is characterized in that The statistical values ​​of the access status identification vectors and target traffic data corresponding to all messages satisfy the following formula: is the statistical value of the target traffic data, ε is the privacy budget, C i (x) is the access status identifier of the target traffic data in the access status identifier vector corresponding to the i-th message, K is the total number of hash functions, M is the number of hash bits, n is the total number of messages, and i is a positive integer not greater than n.

6. The method according to any one of claims 1 to 4, It is characterized in that The location index group for obtaining multiple flow data includes: Selecting flow data one by one from a plurality of flow data as flow data to be processed; Using multiple hash functions to calculate multiple hash values ​​of the traffic data to be processed; Determine a location index of the traffic data to be processed according to the sequence number of each hash function and the hash value corresponding to the hash function; All the location indexes of the traffic data to be processed are combined into a location index group.

7. A traffic statistics method, It is characterized in that include: Get the traffic data that has been accessed during the statistical period; Generate a coding matrix corresponding to each of the flow data using a counting minimum sketch algorithm, wherein the coding matrix includes a first value and a second value; Performing an OR operation on the coding matrices corresponding to all the traffic data; Randomly select values ​​from the target matrix obtained by OR operation; Treat the randomly selected numerical perturbation as the perturbation value; Selecting a first group of sequence numbers from a first interval according to the number of the first values ​​in the target matrix; Selecting a second group of serial numbers from a second interval according to the number of the second values ​​in the target matrix, wherein the first interval has no overlapping portion with the second interval; Generate a sorting matrix according to a first group of position indexes of the target matrix, a second group of position indexes of the target matrix, the first group of sequence numbers, and the second group of sequence numbers, wherein the values ​​corresponding to the first group of position indexes are all the first values, and the values ​​corresponding to the second group of position indexes are all the second values; The disturbance value, the position index of the disturbance value and the sorting matrix are sent to a traffic statistics device.

8. The method according to claim 7, It is characterized in that Generating a sorting matrix according to the first group of position indexes of the target matrix, the second group of position indexes of the target matrix, the first group of sequence numbers, and the second group of sequence numbers comprises: Determine a first correspondence between a first group of position indexes of the target matrix and the first group of sequence numbers using a random mapping method; Writing the first group of sequence numbers into the matrix to be processed according to the first corresponding relationship; Determine a second corresponding relationship between a second group of position indexes of the target matrix and the second group of sequence numbers using a random mapping method; Writing the second group of sequence numbers into the matrix to be processed according to the second corresponding relationship; The matrix to be processed after the first group of sequence numbers and the second group of sequence numbers are written is used as a sorting matrix.

9. The method according to any one of claims 7 to 8, It is characterized in that The maximum sequence number of the first group of sequence numbers is smaller than the minimum sequence number of the second group of sequence numbers.

10. The method according to any one of claims 7 to 8, It is characterized in that The maximum sequence number of the second group of sequence numbers is smaller than the minimum sequence number of the first group of sequence numbers.

11. A flow statistics device, It is characterized in that include: An acquisition module, used for acquiring a plurality of location index groups of traffic data, each location index group of traffic data includes a plurality of location indexes, and each location index includes a hash function sequence number and a hash value; A receiving module, configured to receive messages sent by multiple terminals, wherein the messages include a disturbance value, a position index of the disturbance value, and a sorting matrix; An index module is used to select messages one by one from messages sent by multiple terminals as messages to be processed; obtain a sequence number group of each flow data from a sorting matrix included in the message to be processed according to a position index group of each flow data; and select a sequence number extreme value from the sequence number group of each flow data; Determining a target position index of each flow data in the position index group of the plurality of flow data according to the sequence number extreme value; A generating module, configured to generate an access state identification vector corresponding to the message to be processed according to a comparison result of a position index of the disturbance value in the message to be processed and a target position index of each flow data and the disturbance value; The determination module is used to determine the statistical value of the target flow data according to the access state identification vectors corresponding to all the messages, and the target flow data is any one of the multiple flow data.

12. The flow statistics device according to claim 11, It is characterized in that The generating module is specifically used to select the target position index of the traffic data one by one from the target position indexes of the multiple traffic data as the target position index of the traffic data to be compared; when the position index of the disturbance value in the message to be processed is the same as the target position index of the traffic data to be compared, modify the access state identifier of the traffic data to be compared to the disturbance value; When the position index of the disturbance value in the message to be processed is different from the target position index of the traffic data to be compared, the access status identifier of the traffic data to be compared is set to a default value; and the access status identifiers of the multiple traffic data are combined into an access status identifier vector corresponding to the message to be processed according to the sequence number of the traffic data.

13. The flow statistics device according to claim 11, It is characterized in that The index module is specifically used to select the minimum sequence number from the sequence number group of each flow data as the sequence number extreme value.

14. The flow statistics device according to claim 11, It is characterized in that The index module is specifically used to select the maximum sequence number from the sequence number group of each flow data as the sequence number extreme value.

15. The flow statistics device according to any one of claims 11 to 14, It is characterized in that The statistical values ​​of the access status identification vectors and target traffic data corresponding to all messages satisfy the following formula: is the statistical value of the target traffic data, ε is the privacy budget, C i (x) is the access status identifier of the target traffic data in the access status identifier vector corresponding to the i-th message, K is the total number of hash functions, M is the number of hash bits, n is the total number of messages, and i is a positive integer not greater than n.

16. The flow statistics device according to any one of claims 11 to 14, It is characterized in that The acquisition module is specifically used to select traffic data one by one from multiple traffic data as traffic data to be processed; and use multiple hash functions to calculate multiple hash values ​​of the traffic data to be processed; A position index of the traffic data to be processed is determined according to the sequence number of each hash function and the hash value corresponding to the hash function; and all the position indexes of the traffic data to be processed are combined into a position index group.

17. A terminal, It is characterized in that include: The acquisition module is used to obtain the traffic data that has been accessed during the statistical period; An encoding module, used for generating an encoding matrix corresponding to each of the flow data by using a counting minimum sketch algorithm, wherein the encoding matrix includes a first value and a second value, and performing an OR operation on the encoding matrices corresponding to all of the flow data; The sampling module is used to randomly select values ​​from the target matrix obtained by the OR operation; A perturbation module, used to process randomly selected numerical perturbations into perturbation values; A generating module, configured to select a first group of sequence numbers from a first interval according to the number of the first values ​​in the target matrix; and select a second group of sequence numbers from a second interval according to the number of the second values ​​in the target matrix, wherein the first interval has no overlapping portion with the second interval; Generate a sorting matrix according to a first group of position indexes of the target matrix, a second group of position indexes of the target matrix, the first group of sequence numbers, and the second group of sequence numbers, wherein the values ​​corresponding to the first group of position indexes are all the first values, and the values ​​corresponding to the second group of position indexes are all the second values; The sending module is used to send the disturbance value, the position index of the disturbance value and the sorting matrix to the traffic statistics device.

18. The terminal according to claim 17, It is characterized in that The generating module is specifically used to determine a first correspondence between a first group of position indexes of the target matrix and the first group of serial numbers by using a random mapping method; and write the first group of serial numbers into the matrix to be processed according to the first correspondence; Determine a second corresponding relationship between a second group of position indexes of the target matrix and the second group of sequence numbers using a random mapping method; The second group of sequence numbers are written into the matrix to be processed according to the second corresponding relationship; and the matrix to be processed after the first group of sequence numbers and the second group of sequence numbers are written into the matrix is ​​used as a sorting matrix.

19. The terminal according to any one of claims 17 to 18, It is characterized in that The maximum sequence number of the first group of sequence numbers is smaller than the minimum sequence number of the second group of sequence numbers.

20. The terminal according to any one of claims 17 to 18, It is characterized in that The maximum sequence number of the second group of sequence numbers is smaller than the minimum sequence number of the first group of sequence numbers.

21. A computing device, It is characterized in that The method comprises a processor and a memory, wherein the processor is configured to execute instructions stored in the memory so that the computing device executes the method according to any one of claims 1 to 6.

22. A terminal, It is characterized in that The device comprises a processor and a memory, wherein the processor is used to execute instructions stored in the memory so that the terminal executes the method according to any one of claims 7 to 10.

23. A computer-readable storage medium, It is characterized in that The method comprises computer program instructions, which, when executed by a computing device, perform the method according to any one of claims 1 to 10.

24. A computer program product comprising instructions, It is characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 10.