CN107342857B - Grouping method and device - Google Patents

Grouping method and device Download PDF

Info

Publication number
CN107342857B
CN107342857B CN201710536111.8A CN201710536111A CN107342857B CN 107342857 B CN107342857 B CN 107342857B CN 201710536111 A CN201710536111 A CN 201710536111A CN 107342857 B CN107342857 B CN 107342857B
Authority
CN
China
Prior art keywords
group
distribution
item
value
key
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.)
Active
Application number
CN201710536111.8A
Other languages
Chinese (zh)
Other versions
CN107342857A (en
Inventor
李丽丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Ismartv Network Technologies Co ltd
Original Assignee
Whaley 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 Whaley Technology Co Ltd filed Critical Whaley Technology Co Ltd
Priority to CN201710536111.8A priority Critical patent/CN107342857B/en
Publication of CN107342857A publication Critical patent/CN107342857A/en
Application granted granted Critical
Publication of CN107342857B publication Critical patent/CN107342857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0866Generation of secret information including derivation or calculation of cryptographic keys or passwords involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics

Landscapes

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

Abstract

The invention provides a grouping method and a grouping device, wherein the method comprises the following steps: obtaining a configuration file comprising a plurality of group items, wherein the plurality of group items are set according to a preset proportion; analyzing the configuration file to obtain a distribution array of the plurality of group items; generating a key character string and a key random number according to the configuration file, and generating a confusion factor according to the key character string and the key random number; performing data conversion on the obtained user ID by using the confusion factor to obtain a conversion numerical value; and processing the conversion numerical value and the distribution array according to a preset rule to obtain a processing result, and obtaining a group item to which the user ID belongs according to the processing result. The grouping scheme provided by the invention has a mathematical theory basis, and can divide the user ID into different groups according to a preset proportion by generating different confusion factors. Through the grouping scheme, the user IDs can be grouped in a specified proportion according to requirements so as to provide different services for corresponding users.

Description

Grouping method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a grouping method and apparatus.
Background
In the actual production environment of internet products, there are many scenarios that require users to be classified into different groups, so that the corresponding users can experience different algorithms or services. In the prior art, a scheme capable of automatically grouping a large number of users according to user IDs according to a preset proportion is lacked.
Disclosure of Invention
In view of the above, the present invention provides a grouping method and apparatus to improve the above problem.
The embodiment of the invention provides a grouping method, which comprises the following steps:
obtaining a configuration file comprising a plurality of group items, wherein the plurality of group items are set according to a preset proportion;
analyzing the configuration file to obtain a distribution array of the plurality of group items;
generating a key character string and a key random number according to the configuration file, and generating a confusion factor according to the key character string and the key random number;
performing data conversion on the obtained user ID by using the confusion factor to obtain a conversion numerical value;
and processing the conversion numerical value and the distribution array according to a preset rule to obtain a processing result, and obtaining a group item to which the user ID belongs according to the processing result.
Further, the step of analyzing the configuration file to obtain the distribution array of the plurality of group items includes:
analyzing the configuration file to obtain a grouping array of the plurality of group items, wherein the number of the group items is N, and N is a positive integer;
accumulating the grouping numerical values of the previous i item group items in the grouping array to obtain the distribution numerical value of the ith item group item, wherein i is 1,2, … and N;
and changing the value i to obtain the distribution numerical values of the N group items, and obtaining the distribution array of the N group items according to the obtained distribution numerical values of the N group items.
Further, the step of generating an obfuscation factor from the key string and the key random number includes:
calculating to obtain an ASCII value of each character in the key character string;
performing bit offset operation on the key random number, and obtaining an updated key random number according to the key random number after the bit offset operation and the ASCII value of each character in the key character string;
and combining the random numbers of the keys before and after updating to obtain the confusion factor.
Further, the step of generating a key string and a key random number according to the configuration file includes:
and generating a key character string according to the service information and the version information of the configuration file, and setting a key random number.
Further, the step of processing the converted numerical value and the distribution array according to a preset rule to obtain a processing result includes:
and comparing the conversion numerical value with the distribution numerical value of the ith item group item and the distribution numerical value of the (i +1) th item group item in the distribution array respectively to obtain a comparison result.
Further, the step of processing the converted numerical value and the distribution array according to a preset rule to obtain a processing result, and obtaining a group item to which the user ID belongs according to the processing result includes:
performing difference processing on the conversion numerical values and the distribution numerical values of the ith item group item and the (i +1) th item group item in the distribution array respectively;
and if the difference value between the conversion numerical value and the distribution numerical value of the ith item group is greater than a preset value, and the difference value between the conversion numerical value and the distribution numerical value of the (i +1) th item group is less than the preset value, judging that the user ID belongs to the (i +1) th item group.
Another preferred embodiment of the present invention provides a grouping apparatus, which includes an obtaining module, an analyzing module, a generating module, a converting module and a processing module;
the acquisition module is used for acquiring a configuration file comprising a plurality of group items, and the group items are arranged according to a preset proportion;
the analysis module is used for analyzing the configuration file to obtain a distribution array of the plurality of group items;
the generating module is used for generating a key character string and a key random number according to the configuration file and generating a confusion factor according to the key character string and the key random number;
the conversion module is used for performing data conversion on the obtained user ID by using the confusion factor to obtain a conversion numerical value;
and the processing module is used for processing the conversion numerical value and the distribution array according to a preset rule to obtain a processing result, and obtaining the group item to which the user ID belongs according to the processing result.
Furthermore, the analysis module comprises a grouping array acquisition unit, an accumulation unit and a distribution array acquisition unit;
the grouping array obtaining unit is used for analyzing the configuration file to obtain a grouping array of the plurality of group items, wherein the number of the group items is N, and N is a positive integer;
the accumulation unit is used for accumulating the grouping numerical values of the previous i item group items in the grouping array to obtain the distribution numerical value of the ith item group item, wherein i is 1,2, …, N;
the distribution array obtaining unit is used for changing the value i, obtaining the distribution numerical values of the N group items, and obtaining the distribution array of the N group items according to the obtained distribution numerical values of the N group items.
Further, the generation module comprises a calculation unit, an updating unit and an aliasing factor generation unit;
the calculation unit is used for calculating and obtaining an ASCII value of each character in the key character string;
the updating unit is used for carrying out bit offset operation on the key random number and obtaining an updated key random number according to the key random number after the bit offset operation and the ASCII value of each character in the key character string;
the confusion factor generation unit is used for combining the random numbers of the keys before and after updating to obtain the confusion factor.
Further, the processing module comprises a difference value calculating unit and a judging unit;
the difference value calculation unit is used for performing difference processing on the conversion numerical value and the distribution numerical value of the ith item group item and the distribution numerical value of the (i +1) th item group item in the distribution array respectively;
the judging unit is used for judging that the user ID belongs to the (i +1) th item group when the difference value between the conversion numerical value and the distribution numerical value of the (i) th item group is larger than a preset value and the difference value between the conversion numerical value and the distribution numerical value of the (i +1) th item group is smaller than the preset value.
According to the grouping method and the grouping device provided by the embodiment of the invention, the key character string and the key random number are obtained by analyzing the configuration file comprising the group items arranged according to the preset proportion, and the confusion factor is generated according to the key character string and the key random number. And carrying out data conversion on the user IDs by using the confusion factor, and grouping the user IDs according to a preset proportion according to a conversion result. The grouping scheme provided by the invention has a mathematical theory basis, and can divide the user ID into different groups according to a preset proportion by generating different confusion factors. Through the grouping scheme, the user IDs can be grouped in a specified proportion according to requirements so as to provide different services for corresponding users.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic view of an application scenario of a grouping method according to an embodiment of the present invention.
Fig. 2 is a schematic structural block diagram of a server according to an embodiment of the present invention.
Fig. 3 is a flowchart of a grouping method according to an embodiment of the present invention.
Fig. 4 is a flowchart of the substeps of step S103 in fig. 3.
Fig. 5 is a flowchart of the substeps of step S105 in fig. 3.
Fig. 6 is a flowchart of the substeps of step S109 in fig. 3.
Fig. 7 is a functional block diagram of a grouping apparatus according to an embodiment of the present invention.
Fig. 8 is a functional block diagram of an analysis module according to an embodiment of the present invention.
Fig. 9 is a functional block diagram of a generating module according to an embodiment of the present invention.
Fig. 10 is a functional block diagram of a processing module according to an embodiment of the present invention.
Icon: 100-a server; 110-a grouping means; 111-an acquisition module; 112-a resolution module; 1121-grouping array obtaining unit; 1122-an accumulation unit; 1123-a distribution array obtaining unit; 113-a generating module; 1131 — a calculation unit; 1132 — an update unit; 1133, a confusion factor generation unit; 114-a conversion module; 115-a processing module; 1151-a difference calculation unit; 1152-a decision unit; 120-a processor; 130-a memory; 200-user side.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "disposed," and "connected" are to be construed broadly, e.g., as being fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Fig. 1 is a schematic view of an application scenario of a grouping method according to an embodiment of the present invention. The scenario includes a server 100 and a user terminal 200. The user terminal 200 is communicatively connected to the server 100 through a network to perform data communication or interaction. In this embodiment, the user terminal 200 may include a plurality of terminals (only one terminal is shown in the figure), and the plurality of terminals 200 are communicatively connected to the server 100.
The user end 200 may be, but is not limited to, a personal computer, a tablet computer, a smart phone, a mobile internet device, a digital television, and the like. The server 100 may be a web server, a database server, a single server, a server cluster, or the like.
Referring to fig. 2, a schematic block diagram of the server 100 according to an embodiment of the present invention is shown. The server 100 includes a grouping means 110, a processor 120 and a memory 130. The memory 130 is electrically connected to the processor 120 directly or indirectly, so as to implement data transmission or interaction. The grouping means 110 includes at least one software function module which can be stored in the memory 130 in the form of software or firmware or solidified in the operating system of the server 100. The processor 120 is configured to execute an executable module stored in the memory 130, such as a software functional module or a computer program included in the grouping apparatus 110.
Please refer to fig. 3, which is a flowchart illustrating a grouping method applied to the server 100 according to an embodiment of the present invention. It should be noted that the method provided by the present invention is not limited by the specific sequence shown in fig. 3 and described below. The respective steps shown in fig. 3 will be described in detail below.
Step S101, obtaining a configuration file comprising a plurality of group items, wherein the plurality of group items are set according to a preset proportion.
Step S103, analyzing the configuration file to obtain a distribution array of the plurality of group items.
In the actual production environment of internet products, there are many scenarios that require users to be grouped into different groups to experience different algorithms or services. Assuming that there is a series of user IDs [10000001, …,10000049, … ], there are three algorithms a, b, and c, and the series of user IDs needs to be grouped so that their corresponding users can experience one of three different algorithms a, b, and c, so as to compare the three algorithms.
Alternatively, a profile is obtained that is the basis for grouping the user IDs. Optionally, the configuration file includes a plurality of group items, and the plurality of group items are set according to a preset ratio. Wherein the proportion of each group term is greater than 0 but less than 1, and the sum of the proportions of all the group terms is equal to 1.
Optionally, referring to fig. 4, in the present embodiment, step S103 includes three substeps, namely step S1031, step S1033 and step S1035.
Step S1031, parsing the configuration file to obtain a grouped array of the plurality of group items, where the number of group items is N, and N is a positive integer.
Step S1033, accumulating the grouping values of the items in the group of the previous i items in the grouping array to obtain the distribution value of the item in the group of the i item, where i is 1,2, …, N.
In step S1035, the value i is changed to obtain the distribution values of the N group items, and the distribution array of the N group items is obtained according to the obtained distribution values of the N group items.
Optionally, the configuration file is firstly analyzed to obtain a grouping array of a plurality of group items in the configuration file, where the number of group items in the configuration file may be N, and N is a positive integer. Assuming that A, B, C three group entries are included in the configuration file and the ratio of each of the three group entries is 0.2,0.2, and 0.6, the obtained grouping array of the group entries is group [0.2,0.2, and 0.6 ].
And accumulating the grouping numerical values of the first i item group items in the obtained grouping array of the plurality of group items to obtain a distribution array of the ith item group item, wherein i is 1,2 … and N. Changing the value of i continuously to obtain the distribution array of all the group items in the configuration file, wherein the distribution array of the group items can be obtained by calculation according to the following mode: group [1] ═ groups [1], and group [ i ] ═ groups [1] + … + groups [ i ]. For example, the distribution array for the above A, B, C three groups of items is:
groupsums[1]=groups[1]=0.2
groupsums[2]=groups[1]+groups[2]=0.2+0.2=0.4
groupsums[3]=groups[1]+groups[2]+groups[3]=0.2+0.2+0.6=1
and step S105, generating a key character string and a key random number according to the configuration file, and generating a confusion factor according to the key character string and the key random number.
Optionally, in this embodiment, different configuration files carry different service information and version information, and a key string may be generated according to the obtained service information and version information of the configuration files. For example, if the service name of the profile is "key" and the version number thereof is "1.0", the generated key string is "key 1.0". In addition, a key random number keyRandom is set, so that a confusion factor is generated according to the key random number keyRandom and the key character string keyStr.
Optionally, referring to fig. 5, in the present embodiment, the step S105 includes three substeps, namely step S1051, step S1053 and step S1055.
Step S1051, calculates the ASCII value of each character in the key string.
Step S1053, performing a bit shift operation on the key random number, and obtaining an updated key random number according to the key random number after the bit shift operation and the ASCII value of each character in the key character string.
And step S1055, obtaining a confusion factor by combining the key random numbers before and after updating.
Optionally, in this embodiment, after obtaining the key string keyStr and the key random number keyRandom, first, each character in the key string keyStr is traversed to obtain an ASCII value corresponding to each character, for example, the first character of the key string keyStr is recorded as tmp 1. Meanwhile, the key random number keyRandom is subjected to bit shift operation, for example, the key random number keyRandom is shifted by 5 bits to obtain tmp2, the key random number keyRandom is shifted by 2 bits to obtain tmp3, and the sum of tmp1, tmp2 and tmp3 is taken and recorded as tmpsum. And then carrying out exclusive or operation on the obtained tmpsum and the key random number keyRandom before the bit offset is carried out to obtain an updated key random number keyRandom. And performing bit offset operation on the updated key random number keyRandom, obtaining a sum by combining the ASCII value corresponding to the second character of the key character string keyStr, and performing XOR operation on the obtained sum and the updated key random number keyRandom to update the key random number again. According to the logic, the finally obtained updated key random number keyRandom is the generated confusion factor key until each character in the key character string is traversed. In the present embodiment, for example, if the key string keyStr is "key 1.0" and the key random number keyRandom is 1315423911, the resulting confusion factor key is 1453132441224974378.
And step S107, performing data conversion on the obtained user ID by using the confusion factor to obtain a conversion numerical value.
In this embodiment, a series of calculations are performed on the obtained user ID and the generated confusion factor, so that data conversion is performed on the user ID to obtain a conversion value. The user ID may be obtained by the server 100 from the user end 200 in communication connection therewith, or may be a user ID pre-stored by the server 100, which is not limited in this embodiment. Assuming that an ID number longNum is arbitrarily selected from a large number of user IDs, the longNum and the generated confusion factor are calculated as follows: multiplying longNum by the aliasing factor, dividing the obtained product by 1000, obtaining the remainder, adding 1 to the remainder, dividing the obtained sum by 1000, and finally obtaining the number which is less than or equal to 1, namely the obtained conversion value transferredLongNum. Namely, transferredLongNum ═ (longNum:1000 + 1)/1000. In this embodiment, if longNum is 10000049, the obtained transformed longNum is 0.8129.
Step S109, processing the conversion numerical value and the distribution array according to a preset rule to obtain a processing result, and obtaining the group item to which the user ID belongs according to the processing result.
In this embodiment, the obtained conversion value is compared with the distribution value of the i-th item group item and the distribution value of the (i +1) -th item in the obtained distribution array of the plurality of item groups, and the item group to which the user ID belongs is determined according to the comparison result.
Optionally, referring to fig. 6, in the present embodiment, the step S109 may include two substeps, i.e., a step S1091 and a step S1093.
Step S1091, performing difference processing on the conversion numerical value and the distribution numerical value of the ith item group item and the distribution numerical value of the (i +1) th item group item in the distribution array respectively.
Step S1093, if the difference between the converted value and the distribution value of the i-th group item is greater than a preset value, and the difference between the converted value and the distribution value of the i + 1-th group item is less than the preset value, determining that the user ID belongs to the i + 1-th group item.
In this embodiment, the group item of the converted numerical value may be determined in the following manner: and respectively subtracting the conversion values with the distribution values of the ith item group item and the distribution values of the (i +1) th item in the distribution array, namely transferredLongNum-groups [ i ] and transferredLongNum-groups [ i +1 ]. If the difference between the converted value and the distribution value of the i-th group of items is greater than a predetermined value, and the difference between the converted value and the distribution value of the i + 1-th group of items is less than the predetermined value, for example, the predetermined value is 0.0001, that is:
Figure BDA0001340611170000121
it can be determined that the user ID corresponding to the transfer _ longnum belongs to the i +1 th group entry. In this example, if the obtained conversion value is 0.8129, the corresponding user ID before conversion can be obtained, that is, the group item to which 10000049 belongs is group C. And under the condition that the confusion factor is not changed and the configuration file grouping condition is not changed, the group item to which the user ID belongs is not changed.
The grouping method provided by the embodiment is adopted to group massive user IDs, and the ratio of the finally obtained grouping result is close to the preset specified ratio, namely 0.2:0.2: 0.6. In the above example, the series of user ID numbers 10000000 to 20000000 are grouped, the grouping result is 2016015:1999974:5984011, which is close to 0.2:0.2:0.6, and the grouping result for the mass user IDs is proved to be consistent with the preset specified proportion group item according to the law of large numbers.
Referring to fig. 7, a functional block diagram of a grouping apparatus 110 according to an embodiment of the present invention is shown. The grouping device 110 includes an obtaining module 111, a parsing module 112, a generating module 113, a converting module 114, and a processing module 115.
The obtaining module 111 is configured to obtain a configuration file including a plurality of group items, where the group items are set according to a preset ratio. Specifically, the obtaining module 111 may be configured to execute step S101 shown in fig. 3, and the detailed description of step S101 may be referred to for a specific operation method.
The parsing module 112 is configured to parse the configuration file to obtain a distribution array of the plurality of group items. Specifically, the parsing module 112 can be configured to execute step S103 shown in fig. 3, and the detailed description of step S103 can be referred to for a specific operation method.
The generating module 113 is configured to generate a key string and a key random number according to the configuration file, and generate a confusion factor according to the key string and the key random number. Specifically, the generating module 113 may be configured to execute step S105 shown in fig. 3, and the detailed description of step S105 may be referred to for a specific operation method.
The conversion module 114 is configured to perform data conversion on the obtained user ID by using the confusion factor to obtain a conversion value. Specifically, the conversion module 114 can be used to execute step S107 shown in fig. 3, and the detailed description of step S107 can be referred to for a specific operation method.
The processing module 115 is configured to process the converted numerical value and the distribution array according to a preset rule to obtain a processing result, and obtain a group item to which the user ID belongs according to the processing result. Specifically, the processing module 115 may be configured to execute step S109 shown in fig. 3, and the detailed description of step S109 may be referred to for a specific operation method.
Optionally, referring to fig. 8, in the present embodiment, the parsing module 112 includes a grouping array obtaining unit 1121, an accumulating unit 1122, and a distribution array obtaining unit 1123.
The grouping array obtaining unit 1121 is configured to parse the configuration file to obtain a grouping array of the plurality of group entries, where the number of the group entries is N, and N is a positive integer. Specifically, the grouping array obtaining unit 1121 may be configured to execute step S1031 shown in fig. 4, and a specific operation method may refer to the detailed description of step S1031.
The accumulation unit 1122 is configured to accumulate the grouping values of the items in the group of the previous i items in the grouping array to obtain the distribution value of the item in the group of the i item, where i is 1,2, …, N. Specifically, the accumulation unit 1122 can be used to execute step S1033 shown in fig. 4, and the detailed operation method can refer to the detailed description of step S1033.
The distribution array obtaining unit 1123 is configured to change the value i, obtain distribution values of the N group entries, and obtain a distribution array of the N group entries according to the obtained distribution values of the N group entries. Specifically, the distribution array obtaining unit 1123 may be configured to execute step S1035 shown in fig. 4, and the detailed operation method may refer to the detailed description of step S1035.
Optionally, referring to fig. 9, in the present embodiment, the generating module 113 includes a calculating unit 1131, an updating unit 1132 and an aliasing factor generating unit 1133.
The calculating unit 1131 is configured to calculate an ASCII value of each character in the key string. Specifically, the calculating unit 1131 may be configured to execute step S1051 shown in fig. 5, and a detailed description of the step S1051 may be referred to for a specific operation method.
The updating unit 1132 is configured to perform a bit offset operation on the key random number, and obtain an updated key random number according to the key random number after the bit offset operation and an ASCII value of each character in the key character string. Specifically, the updating unit 1132 may be configured to execute step S1053 shown in fig. 5, and a detailed operation method may refer to the detailed description of step S1053.
The confusion factor generation unit 1133 is configured to obtain the confusion factor by combining the key random numbers before and after updating. Specifically, the confusion factor generation unit 1133 can be used to execute step S1055 shown in fig. 5, and the detailed description of step S1055 can be referred to for a specific operation method.
Optionally, referring to fig. 10, in the present embodiment, the processing module 115 includes a difference calculating unit 1151 and a determining unit 1152.
The difference calculating unit 1151 is configured to perform difference processing on the conversion value and the distribution value of the i-th item group item and the distribution value of the i + 1-th item group item in the distribution array, respectively. Specifically, the difference calculation unit 1151 may be configured to execute step S1091 shown in fig. 6, and a specific operation method may refer to the detailed description of step S1091.
The determining unit 1152 is configured to determine that the user ID belongs to the i +1 th item group when a difference between the converted value and the distribution value of the i-th item group item is greater than a preset value and a difference between the converted value and the distribution value of the i +1 th item group item is less than the preset value. Specifically, the determination unit 1152 may be configured to execute step S1093 shown in fig. 6, and the detailed description of step S1093 may be referred to for a specific operation method.
In summary, the grouping method and apparatus provided by the present invention obtain the key string and the key random number by parsing the configuration file including the plurality of group items set according to the preset ratio, and generate the confusion factor according to the key string and the key random number. And carrying out data conversion on the user IDs by using the confusion factor, and grouping the user IDs according to a preset proportion according to a conversion result. The grouping scheme provided by the invention has a mathematical theory basis, and can divide the user ID into different groups according to a preset proportion by generating different confusion factors. Through the grouping scheme, the user IDs can be grouped according to requirements so as to provide different services for the corresponding users.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that, in this document, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (6)

1. A method of grouping, the method comprising:
obtaining a configuration file comprising a plurality of group items, wherein the plurality of group items are set according to a preset proportion;
analyzing the configuration file to obtain a grouping array of the plurality of group items, wherein the number of the group items is N, and N is a positive integer;
accumulating the grouping numerical values of the previous i item group items in the grouping array to obtain the distribution numerical value of the ith item group item, wherein i is 1,2, … and N;
changing the value i to obtain the distribution numerical values of the N group items, and obtaining a distribution array of the N group items according to the obtained distribution numerical values of the N group items;
generating a key character string and a key random number according to the configuration file, and generating a confusion factor according to the key character string and the key random number, wherein the key character string is generated according to the service information and the version information of the configuration file, and the key random number is set to be obtained;
performing data conversion on the obtained user ID by using the confusion factor to obtain a conversion numerical value;
and comparing the conversion numerical value with the distribution numerical value of the ith item group item and the distribution numerical value of the (i +1) th item group item in the distribution array respectively to obtain a processing result, and obtaining the item group to which the user ID belongs according to the processing result.
2. The grouping method according to claim 1, wherein the step of generating an obfuscation factor from the key string and the key random number comprises:
calculating to obtain an ASCII value of each character in the key character string;
performing bit offset operation on the key random number, and obtaining an updated key random number according to the key random number after the bit offset operation and the ASCII value of each character in the key character string;
and combining the random numbers of the keys before and after updating to obtain the confusion factor.
3. The grouping method according to claim 1, wherein the step of comparing the converted value with the distribution value of the i-th group entry and the distribution value of the i + 1-th group entry in the distribution array to obtain a processing result, and obtaining the group entry to which the user ID belongs according to the processing result comprises:
performing difference processing on the conversion numerical values and the distribution numerical values of the ith item group item and the (i +1) th item group item in the distribution array respectively;
and if the difference value between the conversion numerical value and the distribution numerical value of the ith item group is greater than a preset value, and the difference value between the conversion numerical value and the distribution numerical value of the (i +1) th item group is less than the preset value, judging that the user ID belongs to the (i +1) th item group.
4. The grouping device is characterized by comprising an acquisition module, an analysis module, a generation module, a conversion module and a processing module;
the acquisition module is used for acquiring a configuration file comprising a plurality of group items, and the group items are arranged according to a preset proportion;
the analysis module is used for analyzing the configuration file to obtain a distribution array of the plurality of group items;
the analysis module comprises a grouping array acquisition unit, an accumulation unit and a distribution array acquisition unit;
the grouping array obtaining unit is used for analyzing the configuration file to obtain a grouping array of the plurality of group items, wherein the number of the group items is N, and N is a positive integer;
the accumulation unit is used for accumulating the grouping numerical values of the previous i item group items in the grouping array to obtain the distribution numerical value of the ith item group item, wherein i is 1,2, …, N;
the distribution array obtaining unit is used for changing the value i, obtaining the distribution numerical values of the N group items, and obtaining the distribution array of the N group items according to the obtained distribution numerical values of the N group items;
the generation module is used for generating a key character string and a key random number according to the configuration file, and generating a confusion factor according to the key character string and the key random number, wherein the key character string is generated according to the service information and the version information of the configuration file, and the key random number is set and obtained;
the conversion module is used for performing data conversion on the obtained user ID by using the confusion factor to obtain a conversion numerical value;
the processing module is used for comparing the conversion numerical value with the distribution numerical value of the ith item group item and the distribution numerical value of the (i +1) th item group item in the distribution array respectively to obtain a processing result, and obtaining the item group to which the user ID belongs according to the processing result.
5. The grouping device according to claim 4, wherein the generating module includes a calculating unit, an updating unit, and an aliasing factor generating unit;
the calculation unit is used for calculating and obtaining an ASCII value of each character in the key character string;
the updating unit is used for carrying out bit offset operation on the key random number and obtaining an updated key random number according to the key random number after the bit offset operation and the ASCII value of each character in the key character string;
the confusion factor generation unit is used for combining the random numbers of the keys before and after updating to obtain the confusion factor.
6. The grouping device according to claim 4, wherein the processing module includes a difference value calculating unit and a determining unit;
the difference value calculation unit is used for performing difference processing on the conversion numerical value and the distribution numerical value of the ith item group item and the distribution numerical value of the (i +1) th item group item in the distribution array respectively;
the judging unit is used for judging that the user ID belongs to the (i +1) th item group when the difference value between the conversion numerical value and the distribution numerical value of the (i) th item group is larger than a preset value and the difference value between the conversion numerical value and the distribution numerical value of the (i +1) th item group is smaller than the preset value.
CN201710536111.8A 2017-07-04 2017-07-04 Grouping method and device Active CN107342857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710536111.8A CN107342857B (en) 2017-07-04 2017-07-04 Grouping method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710536111.8A CN107342857B (en) 2017-07-04 2017-07-04 Grouping method and device

Publications (2)

Publication Number Publication Date
CN107342857A CN107342857A (en) 2017-11-10
CN107342857B true CN107342857B (en) 2020-06-23

Family

ID=60218994

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710536111.8A Active CN107342857B (en) 2017-07-04 2017-07-04 Grouping method and device

Country Status (1)

Country Link
CN (1) CN107342857B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109409143B (en) * 2018-12-21 2022-05-17 北京思源理想控股集团有限公司 Safety keyboard system and method thereof
CN109697049A (en) * 2018-12-28 2019-04-30 拉扎斯网络科技(上海)有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN110334528A (en) * 2019-06-04 2019-10-15 北京口袋时尚科技有限公司 Digital ID obscures method, obscures digital ID method of calibration and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI259695B (en) * 2003-10-17 2006-08-01 Xu Bang Technology Co Ltd Method and computer system for encryption and classification management of a whole batch of electronic files
CN102957721A (en) * 2011-08-23 2013-03-06 北京百度网讯科技有限公司 Device and method for classifying users based on identification information
CN106127075A (en) * 2016-06-27 2016-11-16 湖南大学 The encryption method of can search for based on secret protection under a kind of cloud storage environment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI259695B (en) * 2003-10-17 2006-08-01 Xu Bang Technology Co Ltd Method and computer system for encryption and classification management of a whole batch of electronic files
CN102957721A (en) * 2011-08-23 2013-03-06 北京百度网讯科技有限公司 Device and method for classifying users based on identification information
CN106127075A (en) * 2016-06-27 2016-11-16 湖南大学 The encryption method of can search for based on secret protection under a kind of cloud storage environment

Also Published As

Publication number Publication date
CN107342857A (en) 2017-11-10

Similar Documents

Publication Publication Date Title
Zhao et al. A self-perturbed pseudo-random sequence generator based on hyperchaos
CN107342857B (en) Grouping method and device
Krishnamoorthy et al. An M/M/2 queueing system with heterogeneous servers including one with working vacation
CN107895038B (en) Link prediction relation recommendation method and device
CN110929799B (en) Method, electronic device, and computer-readable medium for detecting abnormal user
CN106227881B (en) Information processing method and server
CN110019205B (en) Data storage and restoration method and device and computer equipment
WO2010027046A1 (en) Information processing device, information processing method, information storage medium, and program
CN113076981A (en) Data processing method and device
CN111400126A (en) Network service abnormal data detection method, device, equipment and medium
CN106411683A (en) Determination method and apparatus of key social information
CN111010387B (en) Illegal replacement detection method, device, equipment and medium for Internet of things equipment
CN115062342A (en) Privacy calculation method and device, electronic equipment and readable storage medium
CN110798230A (en) Run length detection method and device and electronic equipment
US20190147358A1 (en) System and method for time-to-event process analysis
CN111667018B (en) Object clustering method and device, computer readable medium and electronic equipment
JP2015135662A (en) Information processing device, program and method
CN110019193A (en) Similar account number recognition methods, device, equipment, system and readable medium
CN113946648B (en) Structured information generation method and device, electronic equipment and medium
CN103778329B (en) A kind of construct the method that data supply value
Gupta et al. Queue Length and Server Content Distribution in an Infinite‐Buffer Batch‐Service Queue with Batch‐Size‐Dependent Service
CN110705256A (en) Method, device and equipment for counting number of characters and storage medium
Zhang et al. Drawing from hats by noise-based logic
CN108984556B (en) Method, apparatus and computer-readable storage medium for data processing
CN106547922B (en) Application program sorting method and device and server

Legal Events

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

Effective date of registration: 20240530

Address after: Room 212, Building 14, No. 350 Xianxia Road, Changning District, Shanghai, 200050

Patentee after: SHANGHAI ISMARTV NETWORK TECHNOLOGIES Co.,Ltd.

Country or region after: China

Address before: 201210 3rd floor, building e, Shangtou Shengyin building, 666 shengxia Road, Pudong New Area, Shanghai

Patentee before: WHALEY TECHNOLOGY Co.,Ltd.

Country or region before: China