CN116232919A - Method and device for statistics of secret state data, storage medium and electronic equipment - Google Patents

Method and device for statistics of secret state data, storage medium and electronic equipment Download PDF

Info

Publication number
CN116232919A
CN116232919A CN202211738098.1A CN202211738098A CN116232919A CN 116232919 A CN116232919 A CN 116232919A CN 202211738098 A CN202211738098 A CN 202211738098A CN 116232919 A CN116232919 A CN 116232919A
Authority
CN
China
Prior art keywords
rule
segment
sequence
segmentation
secret
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211738098.1A
Other languages
Chinese (zh)
Inventor
潘无穷
李婷婷
金杯
李天一
韦韬
卫振强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202211738098.1A priority Critical patent/CN116232919A/en
Publication of CN116232919A publication Critical patent/CN116232919A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pure & Applied Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Algebra (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The specification discloses a method, a device, a storage medium and an electronic device for statistics of secret state data, wherein the method comprises the following steps: firstly, arranging the determined secret data to be counted to obtain a secret data sequence, dividing the secret data sequence according to the preset segmentation rules to obtain sub-sequences, and carrying out secret statistics on the secret data contained in each sub-sequence in parallel to obtain the segmentation statistics value of each sub-sequence. Then, dividing the dense state data sequence according to each preset side segment dividing rule to obtain each side segment, determining the side segment statistic value of each side segment in parallel according to the segmentation statistic value of each sub-sequence corresponding to each segmentation rule, and determining the statistic result of the dense state statistics on each dense state data according to each side segment statistic value. And the method adopts a serial-parallel combination mode to carry out the statistics of the secret state data, so that the serial degree can be reduced, and the time of network interaction delay can be reduced.

Description

Method and device for statistics of secret state data, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for statistics of secret data, a storage medium, and an electronic device.
Background
Along with the development of trusted secret computing technology, secret computing is widely applied, and private data can be better protected by computing by using secret data in a trusted environment, wherein the trusted secret computing is a trusted secret computing technology for computing, storing and circulating data in a secret form in a high-speed interconnected trusted node cluster.
The secret state data statistics is a calculation mode for obtaining an output result through a certain calculation strategy according to input secret state data. In general, the secret data statistics are not only counted once in a fixed statistical range, but are required to be counted multiple times in a plurality of different statistical ranges, for example: the method has the advantages that a group of data with the number of 0-3 is needed to count the secret state data in the three ranges of 0-1, 2-3 and 0-3, the secret state data in the three ranges can be counted simultaneously, the secret state data in the two ranges of 0-1 and 2-3 can be counted first, the secret state data in the range of 0-3 is counted again, and when the secret state data in the range of 0-3 is counted, the counting result in the range of 0-3 can be obtained according to the counting result in the two ranges of 0-1 and 2-3.
Meanwhile, since the secret data may be stored in different nodes, when the secret operation of the secret data statistics is performed, network interaction needs to be performed with the node storing the secret data, so as to obtain the secret data stored in the node, for example: the three elements 1-3 need to be subjected to the secret state statistics, but the three elements are respectively stored in the node 1, the node 2 and the node 3, and the three elements 1-3 stored in the node 1-3 need to be subjected to the network interaction by respectively sending the statistics request to the node 1-3. The impact of network interaction delay on serial, dense state operations is very large, such as assuming that the delay of one network interaction is 1ms,1000 serial, dense state operations require 1s of delay, and for 1000 possible concurrent operations, only 2ms of delay may be required.
Therefore, how to perform the statistics of the secret data to reduce the serialization is a urgent problem to be solved.
Disclosure of Invention
The present disclosure provides a method, an apparatus, a storage medium, and an electronic device for statistics of secret data, so as to partially solve the foregoing problems in the prior art.
The technical scheme adopted in the specification is as follows:
the present specification provides a method for statistics of secret data, comprising:
Determining each piece of secret data to be counted, and arranging the secret data to obtain a secret data sequence;
dividing the secret state data sequence according to each preset segmentation rule aiming at the segmentation rules to obtain each subsequence corresponding to the segmentation rules, and carrying out secret state statistics on secret state data contained in each subsequence corresponding to the segmentation rules in parallel to obtain the segmentation statistics value of each subsequence corresponding to the segmentation rules;
dividing the dense data sequence according to each preset edge segment dividing rule to obtain each edge segment corresponding to the edge segment dividing rule, and parallelly determining the edge segment statistic value of each edge segment corresponding to the edge segment dividing rule according to the segment statistic value of each sub-sequence corresponding to each segment rule; the edge segment dividing rule comprises the following steps: taking the starting position of the secret state data sequence as the rule for dividing the starting position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule, or taking the ending position of the secret state data sequence as the ending position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule;
And determining a statistical result of the secret state statistics of the secret state data according to the edge segment statistical value of each edge segment corresponding to each edge segment division rule.
Optionally, for each preset segmentation rule, dividing the secret data sequence according to the segmentation rule to obtain each sub-sequence corresponding to the segmentation rule, which specifically includes:
aiming at the ith segmentation rule, acquiring a preset appointed value k;
dividing the dense data sequence into a length k i Wherein i is a positive integer.
Optionally, performing the secret state statistics on the secret state data contained in each sub-sequence corresponding to the segmentation rule in parallel, which specifically includes:
aiming at the ith segmentation rule, inquiring the segmentation statistical value of each subsequence corresponding to the ith-1 segmentation rule;
if the sub-sequence is inquired, determining the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule in parallel according to the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule;
if not, carrying out secret state statistics on each sub-sequence corresponding to the ith segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence.
Optionally, the sequence of secret data is divided into a length k i Specifically comprising:
judging whether the number of each secret data contained in the secret data sequence is k n N is any positive integer;
if yes, dividing the dense state data sequence into a length k i Is a sequence of the subsequence of (a);
otherwise, the blank data is supplemented to the secret data sequence, so that the quantity of the secret data contained in the supplemented secret data sequence is k n Dividing the supplemented dense data sequence into a length k i Each of the sub-sets of (2) sequence.
Optionally, for each preset edge segment division rule, dividing the secret state data sequence according to the edge segment division rule to obtain each edge segment corresponding to the edge segment division rule, which specifically includes:
aiming at an ith side segment dividing rule, determining a step length k corresponding to the ith side segment dividing rule n-i-1 According to the step length k n-i-1 Will be m x k n-i-1 Determining each appointed length corresponding to the ith side segment division rule, wherein m is a positive integer;
dividing the secret state data sequence by taking the starting position of the secret state data sequence as the starting position of the dividing edge segments and respectively taking the length of the starting position as each appointed length corresponding to the ith edge segment dividing rule to obtain each edge segment corresponding to the ith edge segment dividing rule; or, taking the termination position of the secret state data sequence as the termination position of the divided edge segments, and dividing the secret state data sequence by using the termination position and the length of the secret state data sequence as each designated length corresponding to the ith edge segment division rule, so as to obtain each edge segment corresponding to the ith edge segment division rule.
Optionally, determining, in parallel, the edge segment statistics value of each edge segment corresponding to the edge segment division rule according to the segment statistics value of each sub-sequence corresponding to each segment rule, where the method specifically includes:
inquiring the edge segment statistic value of each edge segment corresponding to the i-1 th edge segment dividing rule aiming at the i-th edge segment dividing rule;
if the query is found, determining the side segment statistic value of each side segment corresponding to the ith side segment division rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule and the side segment statistic value of each side segment corresponding to the ith-1 th side segment division rule;
if not, determining the edge segment statistic value of each edge segment corresponding to the ith edge segment dividing rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule.
Optionally, determining a step length k corresponding to the ith side segment division rule n-i-1 The method specifically comprises the following steps:
and when n-i-1 is not more than 0, determining mk+j as each specified length corresponding to the ith side segment division rule, wherein j is a positive integer less than k.
Optionally, determining, in parallel, the edge segment statistics value of each edge segment corresponding to the edge segment division rule according to the segment statistics value of each sub-sequence corresponding to each segment rule, where the method specifically includes:
When n-i-1 is not more than 0, determining subsequences contained in the side segments as designated subsequences aiming at each side segment corresponding to the ith side segment division rule in parallel, and determining secret state data contained in the side segments except the subsequences as designated secret state data;
and determining the edge segment statistic value of the edge segment according to the segment statistic value of the appointed subsequence and the appointed secret state data.
The present specification provides a device for statistics of secret data, including:
the determining module is used for determining each piece of secret state data to be counted, and arranging the secret state data to obtain a secret state data sequence;
the segmentation module is used for dividing the secret state data sequence according to each preset segmentation rule to obtain each subsequence corresponding to the segmentation rule, and carrying out secret state statistics on secret state data contained in each subsequence corresponding to the segmentation rule in parallel to obtain a segmentation statistical value of each subsequence corresponding to the segmentation rule;
the side segment module is used for dividing the dense data sequence according to each preset side segment division rule to obtain each side segment corresponding to the side segment division rule, and parallelly determining the side segment statistic value of each side segment corresponding to the side segment division rule according to the segmentation statistic value of each sub-sequence corresponding to each segmentation rule; the edge segment dividing rule comprises the following steps: taking the starting position of the secret state data sequence as the rule for dividing the starting position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule, or taking the ending position of the secret state data sequence as the ending position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule;
And the result module is used for determining the statistical result of the secret state statistics of the secret state data according to the edge segment statistical value of each edge segment corresponding to each edge segment division rule.
Optionally, the segmentation module is specifically configured to obtain a preset specified value k for an ith segmentation rule; dividing the dense data sequence into a length k i Wherein i is a positive integer.
Optionally, the segmentation module is specifically configured to query, for the ith segmentation rule, a segmentation statistic value of each sub-sequence corresponding to the ith-1 segmentation rule; if the sub-sequence is inquired, determining the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule in parallel according to the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule; if not, carrying out secret state statistics on each sub-sequence corresponding to the ith segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence.
Optionally, the segmentation module is specifically configured to determine whether the number of each secret data included in the secret data sequence is k n N is any positive integer; if yes, dividing the dense state data sequence into a length k i Is a sequence of the subsequence of (a); otherwise, the blank data is supplemented to the secret data sequence, so that the quantity of the secret data contained in the supplemented secret data sequence is k n Dividing the supplemented dense data sequence into a length k i Each of the sub-sets of (2) sequence.
Optionally, the edge segment module is specifically configured to determine, for an ith edge segment division rule, a step length k corresponding to the ith edge segment division rule n-i-1 According to the step length k n-i-1 Will be m x k n-i-1 Determining each appointed length corresponding to the ith side segment division rule, wherein m is a positive integer; dividing the secret state data sequence by taking the starting position of the secret state data sequence as the starting position of the dividing edge segments and respectively taking the length of the starting position as each appointed length corresponding to the ith edge segment dividing rule to obtain each edge segment corresponding to the ith edge segment dividing rule; or, the termination position of the secret state data sequence is taken as the termination position of the dividing edge section, and the length of each finger is respectively corresponding to the ith edge section dividing ruleAnd determining the length, and dividing the dense data sequence to obtain each side segment corresponding to the ith side segment division rule.
Optionally, the edge segment module is specifically configured to query edge segment statistics values of each edge segment corresponding to the i-1 th edge segment division rule for the i-th edge segment division rule; if the query is found, determining the side segment statistic value of each side segment corresponding to the ith side segment division rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule and the side segment statistic value of each side segment corresponding to the ith-1 th side segment division rule; if not, determining the edge segment statistic value of each edge segment corresponding to the ith edge segment dividing rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule.
Optionally, the side segment module is specifically configured to determine mk+j as each specified length corresponding to the ith side segment division rule when n-i-1 is not greater than 0, where j is a positive integer less than k.
Optionally, when n-i-1 is not greater than 0, the side segment module is specifically configured to determine, in parallel, a subsequence included in the side segment for each side segment corresponding to the ith side segment division rule, as a specified subsequence, and determine, as specified secret data, secret data included in the side segment except for the subsequence; and determining the edge segment statistic value of the edge segment according to the segment statistic value of the appointed subsequence and the appointed secret state data.
The present specification provides a computer readable storage medium storing a computer program which when executed by a processor implements the method of secure data statistics described above.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of secret data statistics described above when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
In the method for counting the secret state data provided by the specification, the secret state data to be counted are firstly determined, the secret state data are arranged to obtain a secret state data sequence, then, for each preset segmentation rule, the secret state data sequence is divided according to the segmentation rule to obtain each subsequence corresponding to the segmentation rule, secret state statistics is carried out on the secret state data contained in each subsequence corresponding to the segmentation rule in parallel to obtain the segmentation statistics value of each subsequence corresponding to the segmentation rule. Then, dividing the dense data sequence according to each preset edge division rule to obtain each edge corresponding to the edge division rule, determining the edge statistics value of each edge corresponding to the edge division rule in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule, and determining the statistics result of the dense statistics of each dense data according to the edge statistics value of each edge corresponding to the edge division rule.
According to the method, the determined secret state data to be counted are arranged to obtain the secret state data sequence, the secret state data sequence is divided according to each preset segmentation rule to obtain sub-sequences, and secret state statistics is carried out on the secret state data contained in each sub-sequence in parallel to obtain the segmentation statistic value of each sub-sequence. Then, dividing the dense state data sequence according to each preset side segment dividing rule to obtain each side segment, determining the side segment statistic value of each side segment in parallel according to the segmentation statistic value of each sub-sequence corresponding to each segmentation rule, and determining the statistic result of the dense state statistics on each dense state data according to each side segment statistic value. And the method adopts a serial-parallel combination mode to carry out the statistics of the secret state data, so that the serial degree can be reduced, and the time of network interaction delay can be reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. Attached at
In the figure:
FIG. 1 is a flow chart of a method for providing a dense data statistics in the present specification;
FIG. 2 is a schematic diagram of a secret data sequence partitioning segment provided in the present specification;
FIG. 3 is a schematic diagram of a dense data sequence dividing edge segment provided in the present specification;
FIG. 4 is a schematic illustration of a screening of the segmented edge segments provided in the present specification;
FIG. 5 is a schematic diagram of a divided encrypted data sequence according to the present disclosure
FIG. 6 is a schematic diagram of a device for statistics of secret data provided in the present specification;
fig. 7 is a schematic view of the electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The embodiments of the present disclosure provide a method, an apparatus, a storage medium, and an electronic device for statistics of encrypted data, and in the following, with reference to the drawings, the technical solutions provided by each embodiment of the present disclosure are described in detail.
Fig. 1 is a flow chart of a method for statistics of secret data in the present specification, specifically including the following steps:
s100: and determining each piece of secret state data to be counted, and arranging the secret state data to obtain a secret state data sequence.
The secret data may be stored in different nodes, and only part of the secret data is stored in each node, so that when the secret data is counted, network interaction with the node storing the secret data is required to be performed, and the secret data stored in different nodes is obtained. The encrypted data is the data obtained by encrypting the plaintext information by any encryption technology.
The device for carrying out the secret data statistics determines each secret data to be counted, and arranges each secret data to obtain a secret data sequence. The device for performing the secret data statistics may be a node storing the secret data to be counted, or may be a node not storing the secret data to be counted. For convenience of explanation, the following description will be made with the node as the execution subject. When the secret data are arranged to obtain a secret data sequence, the secret data can be arranged randomly to obtain the secret data sequence, or the secret data can be arranged according to a preset rule to obtain the secret data sequence, and the specification is not particularly limited.
For example, assuming that the secret data to be counted is 0 to 15, the node determines each secret data to be counted (i.e., 0 to 15), and arranges the data 0 to 15 to obtain a secret data sequence, and assuming that the data 0 to 15 are arranged according to the order of 0 to 15 to obtain a secret data sequence with the sequence number of 0 to 15.
S102: and dividing the secret state data sequence according to each preset segmentation rule aiming at the segmentation rules to obtain each subsequence corresponding to the segmentation rules, and carrying out secret state statistics on secret state data contained in each subsequence corresponding to the segmentation rules in parallel to obtain the segmentation statistics value of each subsequence corresponding to the segmentation rules.
The node divides the secret state data sequence according to each preset segmentation rule aiming at the segmentation rule to obtain each sub-sequence corresponding to the segmentation rule, and performs secret state statistics on secret state data contained in each sub-sequence corresponding to the segmentation rule in parallel to obtain the segmentation statistics value of each sub-sequence corresponding to the segmentation rule. Specifically, the node may acquire a preset specified value k according to the ith segmentation rule, and divide the secret data sequence into a length k i Each sub-sequence of (2)And (3) carrying out the secret state statistics on the secret state data contained in each sub-sequence corresponding to the ith segmentation rule in parallel to obtain the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule. Where i is a positive integer, dividing the sequence of the secret data into lengths k i K at each subsequence of (2) i And cannot be greater than the length of the sequence of the encrypted data, i.e. cannot be greater than the amount of encrypted data. The value of k may be 2 or any positive integer, and for convenience of explanation, the description will take the value of k as 2 as an example in the following process.
Continuing with the above example, with reference to fig. 2, fig. 2 is a schematic diagram of dividing a secret data sequence into segments provided in the present specification, and assuming that a preset specified value k is 2, a node may obtain the preset specified value k (i.e. 2) for the ith segmentation rule, and divide the secret data sequence into segments with a length of 2 i And carrying out the secret state statistics on the secret state data contained in each sub-sequence corresponding to the segmentation rule in parallel to obtain the segmentation statistic value of each sub-sequence corresponding to the ith segmentation rule. For example, when i is 2, the secret data sequence is divided into length 2 according to the 2 nd segmentation rule 2 The subsequences (4), namely the 4 subsequences of 0-3, 4-7, 8-11 and 12-15 in fig. 2, carry out the secret state statistics on the secret state data contained in the subsequences corresponding to the 2 nd segmentation rule in parallel to obtain the segmentation statistical value of each subsequence corresponding to the 2 nd segmentation rule.
When carrying out secret state statistics on secret state data contained in each sub-sequence corresponding to the segmentation rule in parallel, the node can inquire the segmentation statistical value of each sub-sequence corresponding to the i-1 segmentation rule aiming at the i-th segmentation rule, and if so, the node can parallelly determine the segmentation statistical value of each sub-sequence corresponding to the i-1 segmentation rule according to the segmentation statistical value of each sub-sequence corresponding to the i-1 segmentation rule. If not, carrying out secret state statistics on each sub-sequence corresponding to the ith segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence. Continuing to use the above example, the node may query the segment statistics value of each sub-sequence corresponding to the segment rule of the 2 nd type, and if so, determine the segment statistics value of each sub-sequence corresponding to the segment rule of the 2 nd type in parallel according to the segment statistics value of each sub-sequence corresponding to the segment rule of the 1 st type. If not, carrying out secret state statistics on each sub-sequence corresponding to the 2 nd segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence.
Assuming that the node performs the secret state statistics on the secret state data contained in each sub-sequence corresponding to the 1 st segmentation rule (namely, the 8 sub-sequences of 0-1, 2-3, 4-5, 6-7, 8-9, 10-11, 12-13 and 14-15 in fig. 2) in parallel to obtain the segmentation statistics value of each sub-sequence corresponding to the 1 st segmentation rule, so that the node can inquire the segmentation statistics value of each sub-sequence corresponding to the 1 st segmentation rule, then the segmentation statistics value of each sub-sequence corresponding to the 2 nd segmentation rule is determined in parallel according to the segmentation statistics value of each sub-sequence corresponding to the 1 st segmentation rule, for example, the segmentation statistics values of the sub-sequences 0-1 and 2-3 (namely, the segmentation statistics values of the sub-sequences corresponding to the 1 st segmentation rule) can be determined.
Assuming that the node does not perform the secret state statistics on the secret state data contained in each sub-sequence corresponding to the 1 st segmentation rule before performing the secret state statistics on the secret state data contained in each sub-sequence corresponding to the 2 nd segmentation rule to obtain the secret state statistics value of each sub-sequence corresponding to the 2 nd segmentation rule, and does not obtain the segmentation statistics value of each sub-sequence corresponding to the 1 st segmentation rule, the node queries the segmentation statistics value of each sub-sequence corresponding to the 1 st segmentation rule, and then performs the secret state statistics on each sub-sequence (namely sub-sequences 0-3, sub-sequences 4-7, sub-sequences 8-11 and sub-sequences 12-15) corresponding to the 2 nd segmentation rule in parallel according to the secret state data contained in the sub-sequence to obtain the segmentation statistics value of the sub-sequence.
The node can also determine the sequence of the segmentation rules according to each preset segmentation rule, divide the dense state data sequence according to the segmentation rules and each sub-sequence corresponding to the segmentation rules, and perform the dense state statistics on the dense state data contained in each sub-sequence corresponding to the segmentation rules in parallel to obtain the segmentation statistics value of each sub-sequence corresponding to the segmentation rules. The process of dividing the secret data sequence according to the segmentation rules and carrying out secret statistics on the secret data contained in each sub-sequence in parallel is similar to the process, except that nodes divide the secret data sequence according to the sequence of the segmentation rules in sequence and carry out secret statistics on the secret data contained in each segmented sub-sequence in parallel to obtain the segmentation statistics value of each sub-sequence, so that when secret statistics is carried out on the secret data contained in each segmented sub-sequence in parallel, the segmentation statistics value of each sub-sequence corresponding to other segmentation rules except for each sub-sequence corresponding to the 1 st segmentation rule can be determined in parallel through the segmentation statistics value of each sub-sequence corresponding to the last segmentation rule of the segmentation rule. The sequence of the segmentation rules can be determined according to the numerical value of i, and the segmentation rules can be sequenced according to the sequence from i to i, so that the sequence of the segmentation rules is obtained.
S104: and dividing the dense data sequence according to each preset edge segment division rule to obtain each edge segment corresponding to the edge segment division rule, and parallelly determining the edge segment statistics value of each edge segment corresponding to the edge segment division rule according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule.
The edge segment dividing rule comprises the following steps: and taking the starting position of the secret state data sequence as the starting position of the dividing edge section and the length as the rule of each appointed length corresponding to the edge section dividing rule, or taking the ending position of the secret state data sequence as the ending position of the dividing edge section and the length as the rule of each appointed length corresponding to the edge section dividing rule.
The node divides the dense state data sequence according to each preset edge division rule to obtain each edge corresponding to the edge division rule, and determines the edge statistics value of each edge corresponding to the edge division rule in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule, wherein the edge division rule can be a rule that the starting position of the dense state data sequence is taken as the starting position of the divided edge, the length of the adjacent edge is respectively taken as each appointed length corresponding to the edge division rule, and the end position of the dense state data sequence is taken as the end position of the divided edge, and the length of the adjacent edge is respectively taken as each appointed length corresponding to the edge division rule.
It should be noted that, in the present specification, a side segment refers to a sequence segment with a fixed starting position and a non-fixed ending position or a sequence segment with a fixed ending position and a non-fixed starting position, where the fixed starting position of the side segment is the starting position of the dense data sequence, and the fixed ending position of the side segment is the ending position of the dense data sequence.
Specifically, the node may determine, for an ith side segment division rule, a step length k corresponding to the ith side segment division rule n-i-1 According to step size k n-i-1 Will be m x k n-i-1 Determining each designated length corresponding to the ith side segment division rule, wherein m is a positive integer, and n can be k according to the number of each secret data contained in the secret data sequence n Determination is made, m×k n-i-1 Cannot be greater than the length of the sequence of the encrypted data, i.e. cannot be greater than the amount of encrypted data, so that the data can be stored in the range of the length of the sequence of encrypted data according to m x k n-i-1 And determining the value range of m according to the rule that the value range is not larger than the length of the dense data sequence.
And then, the node can divide the dense state data sequence by taking the starting position of the dense state data sequence as the starting position of the dividing edge section and respectively taking the length of the starting position as each appointed length corresponding to the ith edge section dividing rule, so as to obtain each edge section corresponding to the ith edge section dividing rule. The node may further divide the secret data sequence with a termination position of the secret data sequence as a termination position of the divided edge segments, and lengths of the termination position and the termination position are respectively designated lengths corresponding to the ith edge segment division rule, so as to obtain each edge segment corresponding to the ith edge segment division rule. The node can divide the secret data sequence in the two modes at the same time to obtain each side segment corresponding to the ith side segment dividing rule. In the description, the secret data sequence is divided in the two modes at the same time, and each side segment corresponding to the ith side segment division rule is obtained for subsequent description. And then, according to the segmentation statistical value of each sub-sequence corresponding to each segmentation rule, determining the edge segment statistical value of each edge segment corresponding to the ith edge segment division rule in parallel.
Continuing with the above example, with reference to fig. 3, fig. 3 is a schematic diagram of dividing the edges of a secret data sequence provided in the present specification, where n may be k according to the number of secret data contained in the secret data sequence n Determination is made, i.e. according to 2 n For 16, n is 4, assuming i is 1, the node can determine step length 2 corresponding to the 1 st side segment division rule according to the 1 st side segment division rule 4-1-1 That is, 4, m×4 is determined as each specified length corresponding to the 1 st side segment division rule based on the step size 4, and the value range of m is determined to be 1 to 4 based on the rule that m×4 is not greater than the length of the secret data sequence (that is, 16), so that each specified length is determined to be 4, 8, 12, and 16. Then, the node may divide the dense data sequence with the starting position of the dense data sequence as the starting position of the divided edge (i.e. the position with the sequence number of 0 in the dense data sequence) and the lengths of the designated lengths (i.e. 4, 8, 12 and 16) corresponding to the 1 st edge dividing rule, so as to obtain each edge corresponding to the 1 st edge dividing rule (i.e. the subsequences 0-3, 0-7, 0-11 and 0-15 in the subsequence corresponding to the 1 st edge dividing rule in fig. 3). The node may further divide the dense data sequence by using the end position of the dense data sequence as the end position of the divided edge (i.e. the position with the sequence number of 15 in the dense data sequence) and the length of each specified length (i.e. 4, 8, 12 and 16) corresponding to the 1 st edge dividing rule, so as to obtain each edge corresponding to the 1 st edge dividing rule (i.e. the subsequences 12-15, the subsequences 8-15, the subsequences 4-15 and the subsequences 0-15 in the subsequences corresponding to the 1 st edge dividing rule in fig. 3).
Because some subsequences have been already divided and have been already made the statistics of the secret state data contained in the subsequence in the above-mentioned segmentation dividing process, for example, the subsequence 0-3 corresponding to the 1 st kind of edge segment dividing rule has been already divided by the above-mentioned 2 nd kind of segmentation rule, and have been made the statistics of the secret state data contained in the subsequence 0-3, for example, the subsequence 0-1 corresponding to the 2 nd kind of edge segment dividing rule has been already divided by the above-mentioned 1 st kind of segmentation rule, and have been made the statistics of the secret state data contained in the subsequence 0-1, so that for the subsequence that has been already divided and has been made the statistics in the above-mentioned segmentation process, the secret state statistics is not in progress, in this example, no more needs to be made to the subsequence 0-3, the subsequence 0-7, the subsequence 0-15, the subsequence 8-15 and the subsequence 12-15, only need to make the statistics of the secret state data contained in the subsequence 0-11 and the subsequence 4-15, as shown in fig. 4, the value of the rule of the edge of the specification can be determined according to the value of the rule of the edge of the rule of the edge segment corresponding to the 1 st kind of the edge segment of the rule provided by the specification, for the figure 4, and the value of the statistics of the value of the rule of the edge segment corresponding to be determined to be respectively divided to the sub-1 to the value of the sub-sequence 1 to the value of the edge segment corresponding to the value of the rule corresponding to the rule of the rule 1 to the edge segment corresponding to the value of the rule 1.
When the edge segment statistics values of the edge segments corresponding to the edge segment division rules are determined in parallel according to the segmentation statistics values of each sub-sequence corresponding to each segmentation rule, the node can inquire the edge segment statistics values of the edge segments corresponding to the i-1 th edge segment division rule according to the i-1 th edge segment division rule, if so, the edge segment statistics values of each sub-sequence corresponding to each segmentation rule and the edge segment statistics values of the edge segments corresponding to the i-1 th edge segment division rule are determined in parallel, and if not, the edge segment statistics values of the edge segments corresponding to the i-1 th edge segment division rule are determined in parallel according to the segmentation statistics values of each sub-sequence corresponding to each segmentation rule.
Continuing to use the above example, assuming that i is 2, the node may query the edge statistics value of each edge corresponding to the 1 st edge division rule for the 2 nd edge division rule, if the node queries the segment statistics value of each sub-sequence corresponding to each segment rule, and the edge statistics value of each edge corresponding to the 1 st edge division rule, determine the edge statistics value of each edge corresponding to the 2 nd edge division rule in parallel, and if the node does not query the node determines the edge statistics value of each sub-sequence corresponding to each segment rule, in parallel, according to the segment statistics value of each sub-sequence corresponding to each segment rule.
The node is assumed to have determined the edge statistics value of each edge corresponding to the 1 st edge division rule in parallel, so the node can query the edge statistics value of each edge corresponding to the 1 st edge division rule, can determine the edge statistics value of each edge corresponding to the 2 nd edge division rule in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule and the edge statistics value of each edge corresponding to the 1 st edge division rule, for example, can determine the edge statistics value of each sub-sequence 2-15 corresponding to the 2 nd edge division rule according to the segmentation statistics value of each sub-sequence 2-3 corresponding to the 1 st segmentation rule and the edge statistics value of each sub-sequence 4-15 corresponding to the 1 st edge division rule.
The node is assumed to determine the edge statistics value of each edge corresponding to the 2 nd edge division rule before determining the edge statistics value of each edge corresponding to the 1 st edge division rule, so the node can not query the edge statistics value of each edge corresponding to the 1 st edge division rule, and can determine the edge statistics value of each edge corresponding to the 2 nd edge division rule in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule, for example, can determine the edge statistics value of each sub-sequence 0-5 corresponding to the 2 nd edge division rule according to the segmentation statistics value of each sub-sequence 4-5 corresponding to the 1 st segmentation rule and the segmentation statistics value of each sub-sequence 0-3 corresponding to the 2 nd segmentation rule.
The node can also determine the sequence of the edge segment division rules according to each preset edge segment division rule, divide the dense data sequence according to the edge segment division rules according to each edge segment division rule in turn, obtain each edge segment corresponding to the edge segment division rules, and determine the edge segment statistics value of each edge segment corresponding to the edge segment division rules in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule.
The process of dividing the secret data sequence according to the edge division rule and determining the edge statistics value of each divided edge is similar to the process, except that nodes divide the secret data sequence according to the edge division rule in turn according to the edge division rule, the edge statistics value of each sub-sequence corresponding to each segmentation rule is determined in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule, so when the edge statistics value of each divided edge is determined in parallel, the edge statistics value of each edge corresponding to the other edge division rule except for the edge corresponding to the 1 st edge division rule can be determined according to the segment statistics value of each sub-sequence corresponding to each edge corresponding to the last edge division rule of the edge division rule and the segmentation statistics value of each sub-sequence corresponding to each segmentation rule, and the edge statistics value of each edge corresponding to the 1 st edge segmentation rule is determined in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule. The sequence of the edge segment division rules can be determined according to the value of i, and the edge segment division rules can be ordered according to the sequence from i to i, so that the sequence of the edge segment division rules is obtained.
S106: and determining a statistical result of the secret state statistics of the secret state data according to the edge segment statistical value of each edge segment corresponding to each edge segment division rule.
The node can determine the statistic result of the secret state statistics on the secret state data according to the edge segment statistic value of each edge segment corresponding to each edge segment division rule. Continuing to use the above example, the node may determine, according to the edge segment statistics values of the edge segments corresponding to the edge segment division rules, a statistics result of each of the 16 secret state data in a range from the start position to the secret state data and a statistics result of each of the secret state data in a range from the secret state data to the end position, that is, taking 32 statistics results formed by two statistics results of two ranges corresponding to each of the secret state data as statistics results of the secret state statistics.
The node can also determine the statistics result of the secret state statistics on the secret state data according to the segmentation statistics value of each sub-sequence corresponding to each segmentation division rule, and can also determine the statistics result of the secret state statistics on the secret state data according to the segmentation statistics value of each sub-sequence corresponding to each segmentation division rule and the side segment statistics value of each side segment corresponding to each side segment division rule.
According to the method, each piece of secret state data to be counted is determined in advance, the secret state data are arranged to obtain a secret state data sequence, then the secret state data sequence is divided according to each preset segmentation rule, each sub-sequence corresponding to the segmentation rule is obtained, secret state statistics is carried out on the secret state data contained in each sub-sequence corresponding to the segmentation rule in parallel, and the segmentation statistics value of each sub-sequence corresponding to the segmentation rule is obtained. Then, dividing the dense data sequence according to each preset edge division rule to obtain each edge corresponding to the edge division rule, determining the edge statistics value of each edge corresponding to the edge division rule in parallel according to the segmentation statistics value of each sub-sequence corresponding to each segmentation rule, and determining the statistics result of the dense statistics of each dense data according to the edge statistics value of each edge corresponding to the edge division rule. By adopting a serial-parallel combination mode to carry out the statistics of the secret state data, the serialization degree can be reduced, and the time of network interaction delay can be reduced.
In the step S102, the secret data sequence is divided into the length k i When each sub-sequence of (2) is executed, the node needs to determine whether the number of each secret data contained in the secret data sequence is k n N is any positive integer, when each secret isThe number of state data is k n Then the secret data sequence is divided into a length k i If not, supplementing blank data into the encrypted data sequence to make the number of the encrypted data contained in the supplemented encrypted data sequence be k n Dividing the supplemented dense data sequence into a length k i Each of the sub-sets of (2) sequence. The complementary null data can be secret state data or plaintext data, the specification is not limited in particular, and the statistical result of the secret state data sequence after the complementary null data is only required to be consistent with the statistical result of the secret state data sequence before the complementary null data in secret state statistics, and the complementary null data cannot influence the statistical result of the secret state statistics. And, for the convenience of statistics, the number k of the cipher state data after the null data is supplemented n The difference between the number of the encrypted data before the empty data is supplemented is as small as possible, namely k n The value of n is as follows: such that the number of the encrypted data after the supplementation of the blank data is greater than the minimum integer value of the number of the encrypted data before the supplementation of the blank data.
Continuing with the above example, assuming that the number of the secret data to be counted is 15, it is obvious that 15 is not 2 n Null data can be supplemented to the secret data sequence, so that the quantity of the secret data contained in the secret data sequence after supplementation is 2 n In this example, one blank data may be added to the secret data sequence, so that the number of secret data included in the secret data sequence after the addition is 2 n I.e. 16.
When the number of the secret data is not k n In the step S102, for each preset segmentation rule, the secret data sequence is divided according to the segmentation rule, so that each sub-sequence corresponding to the segmentation rule is obtained, if the starting position of the divided sub-sequence is not less than the ending position of the secret data sequence, the sub-sequence is discarded, and the secret statistics is not performed on the sub-sequence. If the starting position of the divided sub-sequence is smaller than the ending position of the dense data sequence and the ending position of the divided sub-sequence is not larger than the ending position of the dense data sequence, the node can take the sub-sequence as the segmentAnd carrying out dense statistics on the subsequence corresponding to the rule. If the starting position of the divided sub-sequence is smaller than the ending position of the dense state data sequence and the ending position of the divided sub-sequence is larger than the ending position of the dense state data sequence, modifying the ending position of the sub-sequence into the ending position of the dense state data sequence, taking the modified sub-sequence as the sub-sequence corresponding to the segmentation rule, and carrying out dense state statistics on the modified sub-sequence.
In the step S104, for each preset edge segment division rule, the dense state data sequence is divided according to the edge segment division rule, so that each edge segment corresponding to the edge segment division rule is obtained, if the starting position of the divided edge segment is not less than the ending position of the dense state data sequence, the edge segment is discarded, and the dense state statistics is not performed on the edge segment. If the starting position of the divided edge is smaller than the ending position of the dense state data sequence and the ending position of the divided edge is not larger than the ending position of the dense state data sequence, the node can take the edge as the edge corresponding to the edge dividing rule and carry out dense state statistics on the edge. If the starting position of the divided edge is smaller than the ending position of the dense state data sequence and the ending position of the divided edge is larger than the ending position of the dense state data sequence, modifying the ending position of the edge into the ending position of the dense state data sequence, taking the modified edge as the edge corresponding to the edge dividing rule, and carrying out dense state statistics on the modified edge.
In the step S104, the step k corresponding to the ith edge segment division rule is determined n-i-1 When n-i-1 is not greater than 0, the node may determine mk+j as each designated length corresponding to the ith side segment division rule, then divide the dense data sequence according to each designated length to obtain each side segment corresponding to the ith side segment division rule, and determine the corresponding segment statistics value of each sub-sequence corresponding to each segment according to each segmentation rule in parallel, where the node may determine, as the designated sub-sequence, the sub-sequence included in each side segment corresponding to the ith side segment division rule in parallel for each side segment corresponding to the ith side segment division rule And determining the secret state data contained in the edge except the subsequence as the appointed secret state data, and determining the edge statistic of the edge according to the segmentation statistic of the appointed subsequence and the appointed secret state data. Wherein mk+j cannot be greater than the length of the sequence of the encrypted data, that is, cannot be greater than the number of the encrypted data, and j is a positive integer less than k, so that the value range of m and the value of j can be determined. Since the segments and the edge segments having even lengths have been counted in the above steps S102 and S104, in order to avoid repeated counting, the value range of m and the value of j when mk+j is an odd number may be determined, and in the following process in this specification, description will be made with mk+j as an odd number.
Continuing with the above example, according to the number of the secret data (i.e. 16), according to the number of 2m+j not greater than the secret data, and 2m+j being an odd number, the value of 2m+j may be made odd when j is 1, and the value range of m may be 1 to 7, assuming i is 3, it is determined whether n-3-1 is not greater than 0, obviously 4-3-1 is equal to 0, the node may determine 2m+1 as each specified length corresponding to the 3 rd side segment division rule, that is, 3, 5, 7, 9, 11, 13 and 15, then divide the secret data sequence according to each specified length, and obtain each side segment corresponding to the 3 rd side segment division rule, as shown in fig. 5, fig. 5 is a schematic diagram provided in this specification after division of the secret data sequence, for example, the subsequence 0 to 2 corresponding to the 3 rd side segment division rule in fig. 5 is divided according to the specified length 3, and for example, the subsequence 0 to 4 corresponding to the 3 rd side segment division rule in fig. 5 is divided according to the specified length of 0 to the specified length. When the corresponding segment statistics value of each sub-sequence corresponding to each segment rule is determined in parallel, the node can determine the sub-sequence contained in the corresponding segment for each segment corresponding to the 3 rd segment rule, and determine the secret state data contained in the segment except the sub-sequence as the specified secret state data, and determine the segment statistics value of the segment according to the segment statistics value and the specified secret state data of the specified sub-sequence. For example, one of the side segments corresponding to the 3 rd side segment division rule is a subsequence 1-15, the subsequence contained in the subsequence 1-15 is a subsequence 2-15, as a specified subsequence, the secret state data, namely data 1, contained accidentally except the subsequence is used as specified secret state data, and the side segment statistic value of the subsequence 1-15 is determined according to the segmentation statistic value and the data 1 of the subsequence 2-15.
The above method for statistics of the secret data provided for one or more embodiments of the present disclosure further provides a corresponding device for statistics of the secret data based on the same concept, as shown in fig. 6.
Fig. 6 is a schematic diagram of a device for statistics of secret data provided in the present specification, which specifically includes:
the determining module 200 is configured to determine each piece of secret data to be counted, and arrange each piece of secret data to obtain a secret data sequence;
the segmentation module 202 is configured to divide the secret data sequence according to each preset segmentation rule, obtain each sub-sequence corresponding to the segmentation rule, and perform secret statistics on secret data included in each sub-sequence corresponding to the segmentation rule in parallel, so as to obtain a segmentation statistics value of each sub-sequence corresponding to the segmentation rule;
the side segment module 204 is configured to divide the secret data sequence according to each preset side segment division rule to obtain each side segment corresponding to the side segment division rule, and determine, in parallel, a side segment statistic value of each side segment corresponding to the side segment division rule according to a segmentation statistic value of each sub-sequence corresponding to each segmentation rule; the edge segment dividing rule comprises the following steps: taking the starting position of the secret state data sequence as the rule for dividing the starting position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule, or taking the ending position of the secret state data sequence as the ending position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule;
And a result module 206, configured to determine a statistics result of the secret state statistics on the secret state data according to the edge segment statistics value of each edge segment corresponding to each edge segment division rule.
Optionally, the segmentation module 202 is specifically configured to obtain, for an ith segmentation rule, a preset specified value k; dividing the dense data sequence into a length k i Wherein i is a positive integer.
Optionally, the segmentation module 202 is specifically configured to query, for the ith segmentation rule, a segmentation statistic value of each sub-sequence corresponding to the ith-1 segmentation rule; if the sub-sequence is inquired, determining the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule in parallel according to the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule; if not, carrying out secret state statistics on each sub-sequence corresponding to the ith segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence.
Optionally, the segmentation module 202 is specifically configured to determine whether the number of each secret data included in the secret data sequence is k n N is any positive integer; if yes, dividing the dense state data sequence into a length k i Is a sequence of the subsequence of (a); otherwise, the blank data is supplemented to the secret data sequence, so that the quantity of the secret data contained in the supplemented secret data sequence is k n Dividing the supplemented dense data sequence into a length k i Each of the sub-sets of (2) sequence.
Optionally, the edge segment module 204 is specifically configured to determine, for an ith edge segment division rule, a step length k corresponding to the ith edge segment division rule n-i-1 According to the step length k n-i-1 Will be m x k n-i-1 Determining each appointed length corresponding to the ith side segment division rule, wherein m is a positive integer; dividing the secret state data sequence by taking the starting position of the secret state data sequence as the starting position of the dividing edge segments and respectively taking the length of the starting position as each appointed length corresponding to the ith edge segment dividing rule to obtain each edge segment corresponding to the ith edge segment dividing rule; or, the terminal position of the secret state data sequence is taken as the terminal position of the dividing side section, the length is respectively the designated length corresponding to the ith side section dividing rule, and the secret state data sequence is divided into the following partsAnd dividing the columns to obtain each side segment corresponding to the ith side segment dividing rule.
Optionally, the edge segment module 204 is specifically configured to query, for the ith edge segment division rule, an edge segment statistic value of each edge segment corresponding to the ith-1 th edge segment division rule; if the query is found, determining the side segment statistic value of each side segment corresponding to the ith side segment division rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule and the side segment statistic value of each side segment corresponding to the ith-1 th side segment division rule; if not, determining the edge segment statistic value of each edge segment corresponding to the ith edge segment dividing rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule.
Optionally, the side segment module 204 is specifically configured to determine mk+j as each specified length corresponding to the ith side segment division rule when n-i-1 is not greater than 0, where j is a positive integer less than k.
Optionally, the edge segment module 204 is specifically configured to, when n-i-1 is not greater than 0, determine, in parallel, a subsequence included in an i-th edge segment corresponding to an i-th edge segment partitioning rule, as a specified subsequence, and determine, as specified secret data, secret data included in the edge segment except for the subsequence; and determining the edge segment statistic value of the edge segment according to the segment statistic value of the appointed subsequence and the appointed secret state data.
The present specification also provides a computer readable storage medium storing a computer program operable to perform the method of the above-described statistics of the secret data shown in fig. 1.
The present specification also provides a schematic structural diagram of the electronic device shown in fig. 7. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as described in fig. 7, although other hardware required by other services may be included. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to realize the method for statistics of the secret state data shown in fig. 1.
Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.

Claims (18)

1. A method of dense data statistics, comprising:
determining each piece of secret data to be counted, and arranging the secret data to obtain a secret data sequence;
dividing the secret state data sequence according to each preset segmentation rule aiming at the segmentation rules to obtain each subsequence corresponding to the segmentation rules, and carrying out secret state statistics on secret state data contained in each subsequence corresponding to the segmentation rules in parallel to obtain the segmentation statistics value of each subsequence corresponding to the segmentation rules;
Dividing the dense data sequence according to each preset edge segment dividing rule to obtain each edge segment corresponding to the edge segment dividing rule, and parallelly determining the edge segment statistic value of each edge segment corresponding to the edge segment dividing rule according to the segment statistic value of each sub-sequence corresponding to each segment rule; the edge segment dividing rule comprises the following steps: taking the starting position of the secret state data sequence as the rule for dividing the starting position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule, or taking the ending position of the secret state data sequence as the ending position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule;
and determining a statistical result of the secret state statistics of the secret state data according to the edge segment statistical value of each edge segment corresponding to each edge segment division rule.
2. The method of claim 1, wherein for each preset segmentation rule, dividing the secret data sequence according to the segmentation rule to obtain each subsequence corresponding to the segmentation rule, specifically comprising:
aiming at the ith segmentation rule, acquiring a preset appointed value k;
Dividing the dense data sequence into a length k i Wherein i is a positive integer.
3. The method of claim 2, wherein the performing, in parallel, the secret state statistics on the secret state data included in each sub-sequence corresponding to the segmentation rule specifically includes:
aiming at the ith segmentation rule, inquiring the segmentation statistical value of each subsequence corresponding to the ith-1 segmentation rule;
if the sub-sequence is inquired, determining the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule in parallel according to the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule;
if not, carrying out secret state statistics on each sub-sequence corresponding to the ith segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence.
4. The method of claim 2, dividing the sequence of secret data into lengths k i Specifically comprising:
judging whether the number of each secret data contained in the secret data sequence is k n N is any positive integer;
if yes, dividing the dense state data sequence into a length k i Is a sequence of the subsequence of (a);
otherwise, the blank data is supplemented to the secret data sequence, so that the quantity of the secret data contained in the supplemented secret data sequence is k n Dividing the supplemented dense data sequence into a length k i Each of the sub-sets of (2) sequence.
5. The method of claim 4, wherein for each preset edge segment division rule, dividing the secret data sequence according to the edge segment division rule to obtain each edge segment corresponding to the edge segment division rule, specifically comprising:
aiming at an ith side segment dividing rule, determining a step length k corresponding to the ith side segment dividing rule n-i-1 According to the step length k n-i-1 Will be m x k n-i-1 Determining each appointed length corresponding to the ith side segment division rule, wherein m is a positive integer;
dividing the secret state data sequence by taking the starting position of the secret state data sequence as the starting position of the dividing edge segments and respectively taking the length of the starting position as each appointed length corresponding to the ith edge segment dividing rule to obtain each edge segment corresponding to the ith edge segment dividing rule; or, taking the termination position of the secret state data sequence as the termination position of the divided edge segments, and dividing the secret state data sequence by using the termination position and the length of the secret state data sequence as each designated length corresponding to the ith edge segment division rule, so as to obtain each edge segment corresponding to the ith edge segment division rule.
6. The method of claim 5, wherein determining the edge segment statistics of each edge segment corresponding to the edge segment partitioning rule in parallel according to the segment statistics of each sub-sequence corresponding to each segment rule, specifically comprises:
Inquiring the edge segment statistic value of each edge segment corresponding to the i-1 th edge segment dividing rule aiming at the i-th edge segment dividing rule;
if the query is found, determining the side segment statistic value of each side segment corresponding to the ith side segment division rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule and the side segment statistic value of each side segment corresponding to the ith-1 th side segment division rule;
if not, determining the edge segment statistic value of each edge segment corresponding to the ith edge segment dividing rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule.
7. The method of claim 5, wherein a step size k corresponding to the ith edge segment partitioning rule is determined n-i-1 The method specifically comprises the following steps:
and when n-i-1 is not more than 0, determining mk+j as each specified length corresponding to the ith side segment division rule, wherein j is a positive integer less than k.
8. The method of claim 7, wherein determining the edge segment statistics of the edge segments corresponding to the edge segment partitioning rule in parallel according to the segment statistics of each sub-sequence corresponding to the segmentation rule, specifically comprises:
when n-i-1 is not more than 0, determining subsequences contained in the side segments as designated subsequences aiming at each side segment corresponding to the ith side segment division rule in parallel, and determining secret state data contained in the side segments except the subsequences as designated secret state data;
And determining the edge segment statistic value of the edge segment according to the segment statistic value of the appointed subsequence and the appointed secret state data.
9. An apparatus for secret data statistics, comprising:
the determining module is used for determining each piece of secret state data to be counted, and arranging the secret state data to obtain a secret state data sequence;
the segmentation module is used for dividing the secret state data sequence according to each preset segmentation rule to obtain each subsequence corresponding to the segmentation rule, and carrying out secret state statistics on secret state data contained in each subsequence corresponding to the segmentation rule in parallel to obtain a segmentation statistical value of each subsequence corresponding to the segmentation rule;
the side segment module is used for dividing the dense data sequence according to each preset side segment division rule to obtain each side segment corresponding to the side segment division rule, and parallelly determining the side segment statistic value of each side segment corresponding to the side segment division rule according to the segmentation statistic value of each sub-sequence corresponding to each segmentation rule; the edge segment dividing rule comprises the following steps: taking the starting position of the secret state data sequence as the rule for dividing the starting position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule, or taking the ending position of the secret state data sequence as the ending position of the side segment and the length of the secret state data sequence as each specified length corresponding to the side segment dividing rule;
And the result module is used for determining the statistical result of the secret state statistics of the secret state data according to the edge segment statistical value of each edge segment corresponding to each edge segment division rule.
10. The apparatus of claim 9, wherein the segmentation module is specifically configured to obtain a preset specification for an ith segmentation ruleA value k; dividing the dense data sequence into a length k i Wherein i is a positive integer.
11. The apparatus of claim 10, the segmentation module is specifically configured to query, for an ith segmentation rule, a segmentation statistic value of each sub-sequence corresponding to the ith-1 segmentation rule; if the sub-sequence is inquired, determining the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule in parallel according to the segmentation statistical value of each sub-sequence corresponding to the ith segmentation rule; if not, carrying out secret state statistics on each sub-sequence corresponding to the ith segmentation rule in parallel according to secret state data contained in the sub-sequence to obtain a segmentation statistic value of the sub-sequence.
12. The apparatus of claim 10, wherein the segmentation module is specifically configured to determine whether the number of each secret data included in the secret data sequence is k n N is any positive integer; if yes, dividing the dense state data sequence into a length k i Is a sequence of the subsequence of (a); otherwise, the blank data is supplemented to the secret data sequence, so that the quantity of the secret data contained in the supplemented secret data sequence is k n Dividing the supplemented dense data sequence into a length k i Each of the sub-sets of (2) sequence.
13. The apparatus of claim 12, wherein the edge segment module is specifically configured to determine, for an ith edge segment partitioning rule, a step size k corresponding to the ith edge segment partitioning rule n-i-1 According to the step length k n-i-1 Will be m x k n-i-1 Determining each appointed length corresponding to the ith side segment division rule, wherein m is a positive integer; dividing the secret state data sequence by taking the starting position of the secret state data sequence as the starting position of the dividing edge segments and respectively taking the length of the starting position as each appointed length corresponding to the ith edge segment dividing rule to obtain each edge segment corresponding to the ith edge segment dividing rule; or the end position of the secret state data sequence is taken as the end position of the dividing side section, and the length is respectively the firstAnd dividing the secret state data sequence by each appointed length corresponding to the i-type side segment dividing rule to obtain each side segment corresponding to the i-th side segment dividing rule.
14. The apparatus of claim 13, wherein the edge segment module is specifically configured to query, for an ith edge segment partitioning rule, an edge segment statistics value of each edge segment corresponding to the ith-1 th edge segment partitioning rule; if the query is found, determining the side segment statistic value of each side segment corresponding to the ith side segment division rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule and the side segment statistic value of each side segment corresponding to the ith-1 th side segment division rule; if not, determining the edge segment statistic value of each edge segment corresponding to the ith edge segment dividing rule in parallel according to the segment statistic value of each sub-sequence corresponding to each segment rule.
15. The apparatus of claim 13, wherein the side segment module is specifically configured to determine mk+j as each specified length corresponding to the ith side segment partitioning rule when n-i-1 is not greater than 0, where j is a positive integer less than k.
16. The apparatus of claim 15, wherein the edge segment module is specifically configured to, when n-i-1 is not greater than 0, determine, in parallel, for each edge segment corresponding to an ith edge segment division rule, a subsequence included in the edge segment as a specified subsequence, and determine, as specified secret data, secret data included in the edge segment except for the subsequence; and determining the edge segment statistic value of the edge segment according to the segment statistic value of the appointed subsequence and the appointed secret state data.
17. A computer readable storage medium storing a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-8.
18. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the preceding claims 1-8 when the program is executed.
CN202211738098.1A 2022-12-31 2022-12-31 Method and device for statistics of secret state data, storage medium and electronic equipment Pending CN116232919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211738098.1A CN116232919A (en) 2022-12-31 2022-12-31 Method and device for statistics of secret state data, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211738098.1A CN116232919A (en) 2022-12-31 2022-12-31 Method and device for statistics of secret state data, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116232919A true CN116232919A (en) 2023-06-06

Family

ID=86576073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211738098.1A Pending CN116232919A (en) 2022-12-31 2022-12-31 Method and device for statistics of secret state data, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116232919A (en)

Similar Documents

Publication Publication Date Title
JP6793838B2 (en) Blockchain-based data processing methods and equipment
KR102125177B1 (en) Blockchain-based data processing method and device
EP3640813B1 (en) Cluster-based random walk method and apparatus
CN112905365B (en) Data processing method, device, equipment and medium
CN115829017B (en) Method, device, medium and equipment for processing data based on core particles
CN117312394B (en) Data access method and device, storage medium and electronic equipment
CN116822657B (en) Method and device for accelerating model training, storage medium and electronic equipment
CN116167461B (en) Model training method and device, storage medium and electronic equipment
CN111190655B (en) Processing method, device, equipment and system for application cache data
CN116232919A (en) Method and device for statistics of secret state data, storage medium and electronic equipment
CN116384505A (en) Data processing method and device, storage medium and electronic equipment
CN116501927A (en) Graph data processing system, method, equipment and storage medium
CN110019975B (en) Random walk, random walk method based on cluster, random walk device and equipment
CN116150563A (en) Service execution method and device, storage medium and electronic equipment
CN113641872B (en) Hashing method, hashing device, hashing equipment and hashing medium
CN112787664B (en) ASIC automatic frequency division method and device based on multiple clock sources
CN110032563B (en) Processing method and system of mismatch value and electronic equipment
CN109753351B (en) Time-limited task processing method, device, equipment and medium
CN109614388B (en) Budget deduction method and device
CN110032433B (en) Task execution method, device, equipment and medium
CN116107636B (en) Hardware acceleration method and device, storage medium and electronic equipment
CN107645541B (en) Data storage method and device and server
CN115098271B (en) Multithreading data processing method, device, equipment and medium
CN117118523B (en) Information transmission system, method and device, storage medium and electronic equipment
CN113641871B (en) Lock-free hashing method, device, equipment and medium

Legal Events

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