CN107046564A - A kind of data decimation method and relevant apparatus - Google Patents
A kind of data decimation method and relevant apparatus Download PDFInfo
- Publication number
- CN107046564A CN107046564A CN201710044018.5A CN201710044018A CN107046564A CN 107046564 A CN107046564 A CN 107046564A CN 201710044018 A CN201710044018 A CN 201710044018A CN 107046564 A CN107046564 A CN 107046564A
- Authority
- CN
- China
- Prior art keywords
- data
- random number
- target data
- random
- module
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
A kind of data decimation method and relevant apparatus are disclosed in the embodiment of the present invention, by determining data acquisition system to be selected, the data acquisition system to be selected includes multiple data to be selected, and one data number of each data correspondence to be selected;According to current time and the time difference of initial time, set of random numbers is generated;According to the quantity of target data to be selected, random number is extracted from the set of random numbers, the quantity for the random number extracted is corresponding to the quantity of target data to be selected;According to the random number extracted, the data to be selected of corresponding data numbering are chosen from the data acquisition system to be selected, target data to be selected are obtained;Target data to be selected are associated with the current time.So as to for the different time, generate set of random numbers, according to the randomness of random number in set of random numbers, different target data to be selected are selected, the randomness of selected data is ensured.
Description
Technical field
The present invention relates to technical field of data processing, and in particular to a kind of data decimation method and relevant apparatus.
Background technology
Prior art is when server is to terminal propelling data, it usually needs pushed away according to concrete scene demand for terminal
Different data are sent, for example:In the game of some answer classes, server generally pushes a number of examination question, examination question to player
Species can be that multiple-choice question can also be True-False, player by select correct option or make it is correct judge so as to
Obtain corresponding integration or empirical value etc..
Fairness is taken into account again simultaneously in order to increase the interesting of game, and server is pushing examination question to the terminal where player
Or, it is necessary to ensure player when logging in any one server, the examination question that the same time is seen all is phase when examination question option
With, and the examination question that different time is seen is different, and ensure that each order of examination question option will be different, are based on
This, the randomness to the selected data of server proposes requirement.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of data decimation method and relevant apparatus, ensure that selected
The randomness of data.
To achieve the above object, the embodiment of the present invention provides following technical scheme:
A kind of data decimation method, methods described includes:
It is determined that data acquisition system to be selected, the data acquisition system to be selected includes multiple data to be selected, and each wait to select
Data one data number of correspondence;
According to current time and the time difference of initial time, set of random numbers is generated;
According to the quantity of target data to be selected, random number is extracted from the set of random numbers, the random number extracted
Quantity it is corresponding to the quantity of target data to be selected;
According to the random number extracted, the number to be selected of corresponding data numbering is chosen from the data acquisition system to be selected
According to obtaining target data to be selected;
Target data to be selected are associated with the current time.
A kind of data decimation device, described device includes:
Data acquisition system determining module to be selected, for determining data acquisition system to be selected, the data acquisition system to be selected includes
Multiple data to be selected, and one data number of each data correspondence to be selected;
Set of random numbers generation module, for the time difference according to current time and initial time, generates random manifold
Close;
Random number extraction module, for the quantity according to target data to be selected, extracted from the set of random numbers with
Machine number, the quantity for the random number extracted is corresponding to the quantity of target data to be selected;
Target data decimation module to be selected, for according to the random number extracted, from the data acquisition system to be selected
The data to be selected of corresponding data numbering are chosen, target data to be selected are obtained;
Association in time module, for target data to be selected to be associated with the current time.
Based on above-mentioned technical proposal, a kind of data decimation method and relevant apparatus are disclosed in the embodiment of the present invention, is passed through
It is determined that data acquisition system to be selected, the data acquisition system to be selected includes multiple data to be selected, and each data correspondence to be selected
One data number;According to current time and the time difference of initial time, set of random numbers is generated;According to target number to be selected
According to quantity, extract random number from the set of random numbers, the quantity for the random number extracted and target number to be selected
According to quantity it is corresponding;According to the random number extracted, the to be selected of corresponding data numbering is chosen from the data acquisition system to be selected
Data are selected, target data to be selected are obtained;Target data to be selected are associated with the current time.So as to for difference
Time, generate set of random numbers, according to the randomness of random number in set of random numbers, select different target numbers to be selected
According to the randomness of the selected data of guarantee.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is the system architecture schematic diagram of data decimation method provided in an embodiment of the present invention;
Fig. 2 is the signaling process figure of data decimation method provided in an embodiment of the present invention;
Fig. 3 is the flow chart of data decimation method provided in an embodiment of the present invention;
Fig. 4 is the flow chart of another data decimation method provided in an embodiment of the present invention;
Fig. 5 is the answer interface schematic diagram in a kind of game provided in an embodiment of the present invention;
Fig. 6 is the flow chart of another data decimation method provided in an embodiment of the present invention;
Fig. 7 is a kind of structured flowchart of data decimation device provided in an embodiment of the present invention;
Fig. 8 is a kind of hardware block diagram of data decimation device provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
Fig. 1 is a kind of system architecture of data decimation method provided in an embodiment of the present invention, reference picture 1, and the system can be with
Including:Client 10, server 20, wherein, server 20 can be cluster server, be erected at network side, client 10 can
To be loaded on the user equipmenies such as smart mobile phone, tablet personal computer, notebook computer, application software, application software are installed thereon
Can be any type, such as game class application software, social class application software, shopping class application software etc..
Based on system shown in Figure 1 framework, Fig. 2 shows the signaling process of data decimation method provided in an embodiment of the present invention
Figure, with reference to shown in Fig. 1 and Fig. 2, the flow can include:
Step S10:User end to server sends data acquisition request;
It should be noted that for example in answer scene of game, the data acquisition request that user end to server is sent can
Think that examination question obtains request, request can also be obtained for examination question option, the embodiment of the present invention is not specifically limited.
Step S11:Server determines to receive the time of the data acquisition request of client transmission;
Step S12:Time of the server according to the data acquisition request for receiving client transmission, choose and receive visitor
The time corresponding target data to be selected for the data acquisition request that family end is sent;
Step S13:Server sends target data to be selected to client.
It should be noted that in the embodiment of the present invention server will receive client transmission data acquisition request when
Between be defined as current time, be specifically the time difference according to current time and initial time, choose and receive client hair
The time corresponding target data to be selected for the data acquisition request sent, and send to client.So as to ensure that client is logged in
After server, the target data to be selected that the same time receives from server are identicals, and different time is from server
The target data to be selected received are different, so as to ensure that the randomness of the data received.Specific server is held
Capable data decimation process is discussed in detail in the examples below.
Fig. 3 shows a kind of flow chart of data decimation method, and this method can be realized by server, reference picture 3, the side
Method can include:
Step S100, determine data acquisition system to be selected;
It should be noted that the data acquisition system to be selected includes multiple data to be selected, and each data pair to be selected
A data number is answered, what data number was represented is the arrangement in data acquisition system to be selected of the data to be selected where itself
Position, the order that respectively data to be selected can be numbered from small to large according to numeral be numbered, and the embodiment of the present invention is not done specifically
Limit.
When selecting data that there is different type, difference can also be respectively divided in different types of data to be selected
In the data acquisition system to be selected of type, a unique set number of data acquisition system correspondence to be selected;For respectively data to be selected
Each data to be selected in set sequentially set data number, a unique data number of data correspondence to be selected.
What data number was represented is the arrangement position in data acquisition system to be selected of the data to be selected where itself.
For example, the allocation result to each data distribution data number to be selected in different data acquisition systems to be selected can
Think:Result=P1(a, b)+P2(c, d)+...+Pn(x, y), wherein, Result is allocation result, P1, P2…PnCompiled in collaboration with for collection
Number, a, b, c, d ... x, y are the data to be selected in different data acquisition systems to be selected.In the embodiment of the present invention can be a, b, c,
D ... x, y each distribute a data number.
For example:In the game of answer class, server examination question species to be selected can be:Literature, scientific and technological class, health class
Deng different types of examination question being divided into different examination question set, the unique examination question collection of examination question set correspondence is compiled in collaboration with
Number, one of unique data number of examination question correspondence.
Step S110, the time difference according to current time and initial time, generate set of random numbers;
Optionally, the initial time that the embodiment of the present invention is chosen can be 0 point of January 1 day in 1970, the current time of acquisition
Minute is can be as accurate as with the time difference of initial time, the second can also be accurate to, the embodiment of the present invention is not specifically limited.
Optionally, in the embodiment of the present invention can using the time difference of current time and initial time as random number kind
Son, according to default random algorithm, generates set of random numbers, after being determined due to the seed of random number, according to default random algorithm
What the set of random numbers of generation was just to determine, also, the random number of each in set of random numbers has randomness, according to random number
The target data to be selected that each random number in set is chosen from respectively data to be selected also just have randomness.
Optionally, in the embodiment of the present invention can using the time difference of current time and initial time as random number kind
Son, according to linear congruence random algorithm, generating can also be using the life of other random algorithms in set of random numbers, the embodiment of the present invention
Into set of random numbers, the specific random algorithm embodiment of the present invention is not specifically limited.
It should be noted that the congruence in linear congruence random algorithm is referred to:If m is a positive integer, if two
Integer a, b are removed with m, and the remainder of gained is identical, then claims a, b is to mould m congruences.
The linear congruence random algorithm formula used in the embodiment of the present invention is as follows:
X [i+1]=(A*X [i]+C) mod M;
I is for the positive integer more than or equal to 0, it is necessary to illustrate, under conditions of M=2^q, parameter A, C are chosen as following,
Cycle is larger, and probabilistic statistical characteristicses are good:
A=2^b+1=2^ (log2 (M)/2)+1=2^log2 (sqrt (M))+1=sqrt (M)+1;B is taken near q/2
Number;C=(1/2+sqrt (3)) * M, specifically, M=2^32, A=1103515245, C=12345.
By the way that the time difference of current time and initial time as X [0], is obtained by X [0], X [1], X [2], X successively
[3], the set of random numbers that ... .. is constituted, the number of random number can be by technical staff according to selection wherein in set of random numbers
Data amount check determine that the embodiment of the present invention is not specifically limited.
Step S120, the quantity according to target data to be selected, random number is extracted from the set of random numbers;
Wherein, the quantity for the random number extracted is corresponding to the quantity of target data to be selected, and is specifically extracted
The quantity of random number can be identical with marking the quantity of data to be selected.
Optionally, according to the quantity of target data to be selected, according to the order of random number in the set of random numbers, successively
A random number is extracted, the quantity for the random number extracted is corresponding to the quantity of target data to be selected.
Step S130, according to the random number extracted, corresponding data numbering is chosen from the data acquisition system to be selected
Data to be selected, obtain target data to be selected;
Because random number has randomness, according to the random number extracted successively, the target chosen from data to be selected is treated
Select data that then there is randomness.
Step S140, target data to be selected are associated with the current time.
It is for the different target data to be selected of different selection of time, so that for different in the embodiment of the present invention
Time, set of random numbers is generated, according to the randomness of random number in set of random numbers, selects different target data to be selected,
Ensure the randomness of selected data.
By the above-mentioned technical proposal in the embodiment of the present invention, client is linked into cell server, can be by each small
Area's server obtains target data to be selected from database, and sends to each affiliated client, as long as one during machine pair
Cause, different clients are logged in after each cell server, are managed collectively without a Central Data Server, each cell serves
Device just can guarantee that each client of synchronization gets identical target data to be selected, and different targets are not got in the same time
Data to be selected.Therefore, technical scheme of the embodiment of the present invention accesses different districts server in unified one without considering
The difficulty in machine deployment during heart data server.
Optionally, Fig. 4 shows the flow chart of another data decimation method, and this method can be realized by server, reference
Fig. 4, methods described can include:
Step S200, determine data acquisition system to be selected;
It should be noted that the data acquisition system to be selected includes multiple data to be selected, and each data pair to be selected
Answer a data number.
Step S210, the time difference according to current time and initial time, generate set of random numbers;
Step S220, the quantity according to target data to be selected, random number is extracted from the set of random numbers;
Wherein, the quantity for the random number extracted is corresponding to the quantity of target data to be selected, and is specifically extracted
The quantity of random number can be identical with marking the quantity of data to be selected.
Optionally, according to the quantity of target data to be selected, according to the order of random number in the set of random numbers, successively
A random number is extracted, the quantity for the random number extracted is corresponding to the quantity of target data to be selected.
Step S230, the summation for obtaining all data amount checks to be selected in the data acquisition system to be selected, are transported as modulus
Calculate object;
Step S240, by each random number extracted successively respectively to the modulo operation object carry out modulo operation, obtain
The corresponding modulus result of each random number;
Summation by each random number extracted successively respectively to the data amount check to be selected carries out the process of modulo operation
For:By each random number extracted successively respectively divided by data amount check to be selected summation, obtained remainder is used as each random number pair
The modulus result answered.
Step S250, determination data number corresponding with modulus result data to be selected, are used as target data to be selected;
By each random number extracted successively respectively divided by data amount check to be selected summation, obtained remainder is corresponding specific
Numerical value as target data to be selected data number.
Step S260, target data to be selected are associated with the current time.
The different time is directed in the embodiment of the present invention, set of random numbers is generated, according to random number in set of random numbers
Randomness, randomly selects target data to be selected from all data to be selected, and ensures selected target data to be selected
Randomness.
Describe the technical scheme disclosed in above-described embodiment in detail with the scene of answer in a specific game below:
It refer to and show that universe question and answer open four daily in the answer interface in a game shown in Fig. 5, answer interface
Secondary, participation can obtain experience, tie up silver and article reward.Player has been participated in after universe question and answer activity, and the topic on interface is every time
Otherwise same, the order that the option of answer is each will be different.It was found from the answer interface shown in Fig. 5, answer task a total of 10
Problem, there is tetra- choosings of A, B, C, D per problem.There are 100 problems in examination question exam pool to be selected, enter respectively according to the order from 1 to 100
Line number, calls the technical scheme in the embodiment of the present invention, as follows in the process for not randomly selecting 10 problems in the same time:
Using the movable time started as current time, according to current time and the time difference of initial time, generation is random
Manifold is closed:{ 1,26,59,30,98,5,9,33,76,68 };Above-mentioned each random number is subjected to modulo operation to 100 respectively, obtained
The corresponding modulus result of each random number is respectively:1,26,59,30,98,5,9,33,76,68, then each above-mentioned modulus result is then
The examination question numbering in examination question exam pool to be selected is corresponded to respectively, so that it is respectively 1,26,59 that examination question numbering is transferred out from exam pool,
30,98,5,9,33,76,68 examination question is sent to client as selected examination question, and this time selected examination question is used as universe
The examination question collection of question and answer activity start time.
For the option of examination question, due to only having four options, the option per problem can be directed in option exam pool and is distinguished
Digital numbering is carried out, such as 0,1,2,3, according to current time and the time difference of initial time, set of random numbers is generated:{3、
46th, 91,4 }, above-mentioned each random number is subjected to modulo operation to 4 respectively, obtaining the corresponding modulus result of each random number is respectively:
3,2,1,0, then each above-mentioned modulus result then correspond to the option number in option exam pool respectively, so as to be transferred from option exam pool
Go out the option that option number is respectively 3,2,1,0 to send to client as selected option order, for per pass examination question
Option order takes above-mentioned identical choosing method.
Optionally, the respectively selected weighted value of data to be selected is can be combined with the embodiment of the present invention and customizes different numbers
According to choosing method, Fig. 6 shows the flow chart of another data decimation method, and this method can be realized by server, reference picture 6,
Methods described can include:
Step S300, determine data acquisition system to be selected;
It should be noted that the data acquisition system to be selected includes multiple data to be selected, and each data pair to be selected
Answer a data number.
Step S310, the time difference according to current time and initial time, generate set of random numbers;
Step S320, the quantity according to target data to be selected, random number is extracted from the set of random numbers;
Wherein, the quantity for the random number extracted is corresponding to the quantity of target data to be selected, and is specifically extracted
The quantity of random number can be identical with marking the quantity of data to be selected.
Optionally, according to the quantity of target data to be selected, according to the order of random number in the set of random numbers, successively
A random number is extracted, the quantity for the random number extracted is corresponding to the quantity of target data to be selected.
Step S330, to respectively a probable value is respectively configured in data to be selected in the data acquisition system to be selected;
The probable value is the selected weighted value of the data to be selected, it is necessary in explanation, the embodiment of the present invention
The weighted value being selected for all data to be selected can be respectively configured for respectively data to be selected, can also be respectively to treat
The weight being selected for all data to be selected in data acquisition system to be selected where itself is respectively configured in selection data
Value, can also be respectively configured the weighted value being selected for a reference value, such as relative to benchmark for respectively data to be selected
The weighted value being selected for value 100.
All each self-corresponding probable value summations of data to be selected in step S340, the acquisition data acquisition system to be selected;
Step S350, it regard the preset multiple of all each self-corresponding probable value summations of data to be selected as modulo operation pair
As;
Specifically, modulo operation pair can be regard 100 times of all each self-corresponding probable value summations of data to be selected as
As the embodiment of the present invention is not specifically limited.
Step S360, by each random number extracted successively respectively to the modulo operation object carry out modulo operation, obtain
The corresponding modulus result of each random number;
It is to the process that the modulo operation object carries out modulo operation respectively by each random number extracted successively:Will successively
Each random number difference divided by modulo operation object extracted, obtained remainder are used as the corresponding modulus result of each random number.
Step S370, determination data number corresponding with modulus result data to be selected, are used as target data to be selected;
Step S380, target data to be selected are associated with the current time.
Below, the specific implementation procedure of the above-mentioned data decimation method disclosed in the embodiments of the present invention is illustrated:
A probable value can be respectively configured for n data to be selected:Wn%, one probable value of each probable value correspondence is interval;
Using 100 times of n each self-corresponding probable value summations of data to be selected as modulo operation object, then modulo operation
Object Vt=W1+W2+ ...+Wn;
A random number M is taken, modulo operation is done to Vt, modulus result Vmod=M%Vt is obtained;
Probable value where determining modulus result Vmod values is interval, and the probable value interval where modulus result Vmod values is right
The probable value answered obtains the data to be selected of the corresponding data number of destination probability value, treated as target as destination probability value
Select data.For each random number, said process is repeated, until obtaining predetermined number target data to be selected.
Optionally, when being respectively configured an equal probabilities value W% for n data select, also, the individual data to be selected of n
In the case that probable value W% sum n W% are 1, then by 100 times of works of n each self-corresponding probable value summations of data to be selected
For modulo operation object, then modulo operation object Vt=100;A random number M is taken, modulo operation is done to 100, modulus knot is obtained
Fruit Vmod=M%100;Determine that the corresponding probable value of modulus result, as destination probability value, for each random number, is repeated above-mentioned
Process, until obtaining predetermined number target data to be selected.
It should be noted that when the corresponding data number of destination probability value data to be selected be at least two situation,
That is the not unique situation of data to be selected of the corresponding data number of a destination probability value, then give up this data to be selected of acquisition
Abandon, choose target data to be selected according to the method described above again.
Data decimation device provided in an embodiment of the present invention is introduced below, data decimation device described below,
Can be with above-described data decimation method mutually to should refer to.Data decimation device described below, it is believed that be service
Device is to realize data decimation method provided in an embodiment of the present invention, the functional module framework of required setting.
Fig. 7 is the structured flowchart of data decimation device provided in an embodiment of the present invention, and the device can be applied to server, is joined
According to Fig. 7, the device can include:
Data acquisition system determining module 100 to be selected, for determining data acquisition system to be selected, the data acquisition system bag to be selected
Include multiple data to be selected, and one data number of each data correspondence to be selected;
Set of random numbers generation module 110, for the time difference according to current time and initial time, generates random number
Set;
Optionally, in the embodiment of the present invention can using the time difference of current time and initial time as random number kind
Son, according to default random algorithm, generates set of random numbers, after being determined due to the seed of random number, according to default random algorithm
What the set of random numbers of generation was just to determine, also, the random number of each in set of random numbers has randomness, according to random number
The target data to be selected that each random number in set is chosen from respectively data to be selected also just have randomness.
Random number extraction module 120, for the quantity according to target data to be selected, is extracted from the set of random numbers
Random number, the quantity for the random number extracted is corresponding to the quantity of target data to be selected;
Target data decimation module 130 to be selected, for according to the random number extracted, from the data acquisition system to be selected
The middle data to be selected for choosing corresponding data numbering, obtain target data to be selected;
Association in time module 140, for target data to be selected to be associated with the current time.
It is for the different target data to be selected of different selection of time, so that for different in the embodiment of the present invention
Time, set of random numbers is generated, according to the randomness of random number in set of random numbers, selects different target data to be selected,
Ensure the randomness of selected data.
A kind of alternative construction of the set of random numbers generation module includes:
Set of random numbers generate submodule, for using the time difference of current time and initial time as random number kind
Son, according to default random algorithm, generates set of random numbers.
A kind of alternative construction of the set of random numbers generation submodule includes:
Linear congruence random algorithm module, for using the time difference of current time and initial time as random number kind
Son, according to linear congruence random algorithm, generates set of random numbers.
A kind of alternative construction of the random number extraction module includes:
Random number extracting sub-module, for the quantity according to target data to be selected, according in the set of random numbers with
The order of machine number, extracts a random number successively, the quantity phase of the quantity for the random number extracted and target data to be selected
Should.
A kind of alternative construction of the target data decimation module to be selected includes:
First modulo operation object select module, for obtaining an all data to be selected in the data acquisition system to be selected
Several summations, is used as modulo operation object;
First modulo operation module, for each random number extracted successively to be taken to the modulo operation object respectively
Modular arithmetic, obtains the corresponding modulus result of each random number;
First object data determining module to be selected, the number to be selected for determining data number corresponding with modulus result
According to being used as target data to be selected.
Also include:
Probable value distribute module, to respectively a probable value, institute is respectively configured in data to be selected in the data acquisition system to be selected
It is the selected weighted value of the data to be selected to state probable value.
A kind of alternative construction of the target data decimation module to be selected includes:
Probable value summation acquisition module, is each corresponded to for obtaining all data to be selected in the data acquisition system to be selected
Probable value summation;
Second modulo operation object select module, for by the pre- of all each self-corresponding probable value summations of data to be selected
If multiple is used as modulo operation object;
Second modulo operation module, for each random number extracted successively to be taken to the modulo operation object respectively
Modular arithmetic, obtains the corresponding modulus result of each random number;
Second target data determining module to be selected, the number to be selected for determining data number corresponding with modulus result
According to being used as target data to be selected.
Also include:
Data acquisition request receiving module, the data acquisition request for receiving client transmission;
Reception time determining module, the time of the data acquisition request for determining to receive client transmission;
Target data transmission blocks to be selected, for by with receive client transmission data acquisition request time pair
The target data to be selected answered are sent to client.
The embodiment of the present invention also provides a kind of server, and the server can include data decimation device described above.
Optionally, Fig. 8 shows the hardware configuration of server, and reference picture 8, the server can include:
Processor 1, communication interface 2, memory 3 and communication bus 4;
Wherein processor 1, communication interface 2, memory 3 complete mutual communication by communication bus 4;
Optionally, communication interface 2 can be the interface of communication module, the interface of such as gsm module;
Processor 1 is probably a central processor CPU, or specific integrated circuit ASIC (Application
Specific Integrated Circuit), or it is arranged to implement one or more integrated electricity of the embodiment of the present invention
Road.
Memory 3 may include high-speed RAM memory, it is also possible to also including nonvolatile memory (non-volatile
Memory), for example, at least one magnetic disk storage.
Wherein, processor 1 specifically for:
It is determined that data acquisition system to be selected, the data acquisition system to be selected includes multiple data to be selected, and each wait to select
Data one data number of correspondence;
According to current time and the time difference of initial time, set of random numbers is generated;
According to the quantity of target data to be selected, random number is extracted from the set of random numbers, the random number extracted
Quantity it is corresponding to the quantity of target data to be selected;
According to the random number extracted, the number to be selected of corresponding data numbering is chosen from the data acquisition system to be selected
According to obtaining target data to be selected;
Target data to be selected are associated with the current time.
In summary:
A kind of data decimation method and relevant apparatus are disclosed in the embodiment of the present invention, by determining data set to be selected
Close, the data acquisition system to be selected includes multiple data to be selected, and one data number of each data correspondence to be selected;Foundation
The time difference of current time and initial time, generates set of random numbers;According to the quantity of target data to be selected, from it is described with
Machine manifold extracts random number in closing, and the quantity for the random number extracted is corresponding to the quantity of target data to be selected;According to
The random number extracted, the data to be selected of corresponding data numbering are chosen from the data acquisition system to be selected, target is obtained and treats
Select data;Target data to be selected are associated with the current time.So as to for the different time, generate random number
Set, according to the randomness of random number in set of random numbers, selects different target data to be selected, ensures selected data
Randomness.
The embodiment of each in this specification is described by the way of progressive, and what each embodiment was stressed is and other
Between the difference of embodiment, each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description
And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software, generally describes the composition and step of each example according to function in the above description.These
Function is performed with hardware or software mode actually, depending on the application-specific and design constraint of technical scheme.Specialty
Technical staff can realize described function to each specific application using distinct methods, but this realization should not
Think beyond the scope of this invention.
Directly it can be held with reference to the step of the method or algorithm that the embodiments described herein is described with hardware, processor
Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), internal memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or using the present invention.
A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention
The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one
The most wide scope caused.
Claims (16)
1. a kind of data decimation method, it is characterised in that methods described includes:
It is determined that data acquisition system to be selected, the data acquisition system to be selected includes multiple data to be selected, and each data to be selected
One data number of correspondence;
According to current time and the time difference of initial time, set of random numbers is generated;
According to the quantity of target data to be selected, random number is extracted from the set of random numbers, the number for the random number extracted
Amount is corresponding to the quantity of target data to be selected;
According to the random number extracted, the data to be selected of corresponding data numbering are chosen from the data acquisition system to be selected, are obtained
To target data to be selected;
Target data to be selected are associated with the current time.
2. according to the method described in claim 1, it is characterised in that described according to current time and the time difference of initial time
Value, the process of generation set of random numbers includes:
Using the time difference of current time and initial time as the seed of random number, according to default random algorithm, generation is random
Manifold is closed.
3. method according to claim 2, it is characterised in that the time difference by current time and initial time is made
For the seed of random number, according to default random algorithm, the process of generation set of random numbers includes:
Using the time difference of current time and initial time as the seed of random number, according to linear congruence random algorithm, generate
Set of random numbers.
4. according to the method described in claim 1, it is characterised in that the quantity according to target data to be selected, from described
Random number is extracted in set of random numbers, the quantity for the random number extracted mistake corresponding with the quantity of target data to be selected
Journey includes:
According to the quantity of target data to be selected, according to the order of random number in the set of random numbers, one is extracted successively random
Number, the quantity for the random number extracted is corresponding to the quantity of target data to be selected.
5. method according to claim 4, it is characterised in that described according to the random number extracted, waits to select from described
The data to be selected of corresponding data numbering are chosen in data acquisition system, obtaining the process of target data to be selected includes:
The summation of all data amount checks to be selected in the data acquisition system to be selected is obtained, modulo operation object is used as;
Each random number extracted successively is subjected to modulo operation to the modulo operation object respectively, each random number is obtained corresponding
Modulus result;
It is determined that the data to be selected of data number corresponding with modulus result, are used as target data to be selected.
6. method according to claim 4, it is characterised in that described according to the random number extracted, from described to be selected
The data to be selected that corresponding data numbering is chosen in data acquisition system are selected, obtain also including before target data to be selected:
To respectively a probable value is respectively configured in data to be selected in the data acquisition system to be selected, the probable value is waited to select to be described
The selected weighted value of data.
7. method according to claim 6, it is characterised in that described according to the random number extracted, waits to select from described
The data to be selected of corresponding data numbering are chosen in data acquisition system, obtaining the process of target data to be selected includes:
Obtain all each self-corresponding probable value summations of data to be selected in the data acquisition system to be selected;
It regard the preset multiple of all each self-corresponding probable value summations of data to be selected as modulo operation object;
Each random number extracted successively is subjected to modulo operation to the modulo operation object respectively, each random number is obtained corresponding
Modulus result;
It is determined that the data to be selected of data number corresponding with modulus result, are used as target data to be selected.
8. according to the method described in claim 1, it is characterised in that by target data to be selected and the current time
After association, in addition to:
Receive the data acquisition request that client is sent;
It is determined that receiving the time of the data acquisition request of client transmission;
Target data to be selected corresponding with the time for receiving the data acquisition request that client is sent are sent to client.
9. a kind of data decimation device, it is characterised in that described device includes:
Data acquisition system determining module to be selected, for determining data acquisition system to be selected, the data acquisition system to be selected includes multiple
Data to be selected, and one data number of each data correspondence to be selected;
Set of random numbers generation module, for the time difference according to current time and initial time, generates set of random numbers;
Random number extraction module, for the quantity according to target data to be selected, random number is extracted from the set of random numbers,
The quantity for the random number extracted is corresponding to the quantity of target data to be selected;
Target data decimation module to be selected, for according to the random number extracted, being chosen from the data acquisition system to be selected
The data to be selected of corresponding data numbering, obtain target data to be selected;
Association in time module, for target data to be selected to be associated with the current time.
10. device according to claim 9, it is characterised in that the set of random numbers generation module includes:
Set of random numbers generate submodule, for using the time difference of current time and initial time as random number seed,
According to default random algorithm, set of random numbers is generated.
11. device according to claim 10, it is characterised in that the set of random numbers generation submodule includes:
Linear congruence random algorithm module, for using the time difference of current time and initial time as random number seed,
According to linear congruence random algorithm, set of random numbers is generated.
12. device according to claim 9, it is characterised in that the random number extraction module includes:
Random number extracting sub-module, for the quantity according to target data to be selected, according to random number in the set of random numbers
Order, a random number is extracted successively, the quantity for the random number extracted is corresponding to the quantity of target data to be selected.
13. device according to claim 12, it is characterised in that the target data decimation module to be selected includes:
First modulo operation object select module, for obtaining all data amount checks to be selected in the data acquisition system to be selected
Summation, is used as modulo operation object;
First modulo operation module, for each random number extracted successively to be carried out into modulus fortune to the modulo operation object respectively
Calculate, obtain the corresponding modulus result of each random number;
First object data determining module to be selected, the data to be selected for determining data number corresponding with modulus result,
It is used as target data to be selected.
14. device according to claim 12, it is characterised in that also include:
Probable value distribute module, it is described general to respectively a probable value is respectively configured in data to be selected in the data acquisition system to be selected
Rate value is the selected weighted value of the data to be selected.
15. device according to claim 14, it is characterised in that the target data decimation module to be selected includes:
Probable value summation acquisition module, it is each self-corresponding general for obtaining all data to be selected in the data acquisition system to be selected
Rate value summation;
Second modulo operation object select module, for by default times of all each self-corresponding probable value summations of data to be selected
Number is used as modulo operation object;
Second modulo operation module, for each random number extracted successively to be carried out into modulus fortune to the modulo operation object respectively
Calculate, obtain the corresponding modulus result of each random number;
Second target data determining module to be selected, the data to be selected for determining data number corresponding with modulus result,
It is used as target data to be selected.
16. device according to claim 9, it is characterised in that also include:
Data acquisition request receiving module, the data acquisition request for receiving client transmission;
Reception time determining module, the time of the data acquisition request for determining to receive client transmission;
Target data transmission blocks to be selected, for will with receive client transmission data acquisition request time it is corresponding
Target data to be selected are sent to client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710044018.5A CN107046564A (en) | 2017-01-19 | 2017-01-19 | A kind of data decimation method and relevant apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710044018.5A CN107046564A (en) | 2017-01-19 | 2017-01-19 | A kind of data decimation method and relevant apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107046564A true CN107046564A (en) | 2017-08-15 |
Family
ID=59543622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710044018.5A Pending CN107046564A (en) | 2017-01-19 | 2017-01-19 | A kind of data decimation method and relevant apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107046564A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108926845A (en) * | 2018-07-24 | 2018-12-04 | 合肥爱玩动漫有限公司 | A method of scene of game is distributed based on playtime and random points |
CN109284493A (en) * | 2018-07-25 | 2019-01-29 | 深圳点猫科技有限公司 | Random exam pool implementation method and electronic equipment in a kind of education cloud platform |
CN109671206A (en) * | 2018-12-03 | 2019-04-23 | 广东工业大学 | A kind of method, apparatus, equipment and the storage medium of random determining terminal |
CN109947658A (en) * | 2019-04-03 | 2019-06-28 | 颜沿(上海)智能科技有限公司 | A kind of method and device that simulation of real scenes data generate |
CN111427540A (en) * | 2020-03-24 | 2020-07-17 | 北京奇艺世纪科技有限公司 | Random number generation method and device, electronic equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101197019A (en) * | 2007-12-10 | 2008-06-11 | 天津工业大学 | Electric test paper examination system |
US20080263117A1 (en) * | 2007-04-23 | 2008-10-23 | Gregory Gordon Rose | Initial seed management for pseudorandom number generator |
CN102663911A (en) * | 2012-03-14 | 2012-09-12 | 北京邮电大学 | Method for distributing paper options evenly of on-line examination system based on pseudo random number |
CN103713895A (en) * | 2013-11-29 | 2014-04-09 | 北京奇虎科技有限公司 | Data sending method and device |
CN104156551A (en) * | 2013-05-14 | 2014-11-19 | 腾讯科技(深圳)有限公司 | Method and device for dynamically adjusting hitting of target data based on time intervals |
CN105468764A (en) * | 2015-12-02 | 2016-04-06 | 广州华多网络科技有限公司 | Data processing method and apparatus and cluster service system |
CN105812470A (en) * | 2016-03-23 | 2016-07-27 | 重庆至善信息技术有限公司 | Objective question display method and device |
-
2017
- 2017-01-19 CN CN201710044018.5A patent/CN107046564A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080263117A1 (en) * | 2007-04-23 | 2008-10-23 | Gregory Gordon Rose | Initial seed management for pseudorandom number generator |
CN101197019A (en) * | 2007-12-10 | 2008-06-11 | 天津工业大学 | Electric test paper examination system |
CN102663911A (en) * | 2012-03-14 | 2012-09-12 | 北京邮电大学 | Method for distributing paper options evenly of on-line examination system based on pseudo random number |
CN104156551A (en) * | 2013-05-14 | 2014-11-19 | 腾讯科技(深圳)有限公司 | Method and device for dynamically adjusting hitting of target data based on time intervals |
CN103713895A (en) * | 2013-11-29 | 2014-04-09 | 北京奇虎科技有限公司 | Data sending method and device |
CN105468764A (en) * | 2015-12-02 | 2016-04-06 | 广州华多网络科技有限公司 | Data processing method and apparatus and cluster service system |
CN105812470A (en) * | 2016-03-23 | 2016-07-27 | 重庆至善信息技术有限公司 | Objective question display method and device |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108926845A (en) * | 2018-07-24 | 2018-12-04 | 合肥爱玩动漫有限公司 | A method of scene of game is distributed based on playtime and random points |
CN109284493A (en) * | 2018-07-25 | 2019-01-29 | 深圳点猫科技有限公司 | Random exam pool implementation method and electronic equipment in a kind of education cloud platform |
CN109284493B (en) * | 2018-07-25 | 2023-07-14 | 深圳点猫科技有限公司 | Random question bank implementation method on education cloud platform and electronic equipment |
CN109671206A (en) * | 2018-12-03 | 2019-04-23 | 广东工业大学 | A kind of method, apparatus, equipment and the storage medium of random determining terminal |
CN109947658A (en) * | 2019-04-03 | 2019-06-28 | 颜沿(上海)智能科技有限公司 | A kind of method and device that simulation of real scenes data generate |
CN111427540A (en) * | 2020-03-24 | 2020-07-17 | 北京奇艺世纪科技有限公司 | Random number generation method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107046564A (en) | A kind of data decimation method and relevant apparatus | |
CN108717630A (en) | One kind going out block method and its realizes system | |
CN107404481B (en) | User information recognition methods and device | |
CN104219069B (en) | access frequency control method, device and control system | |
CN110110509A (en) | Right management method and Related product | |
CN103891175B (en) | For the method providing M2M to service, for M2M communication method and apparatus | |
CN105245620B (en) | The method, apparatus and system of information transmission | |
CN105635960A (en) | Terminal management method, terminal management apparatus and terminal management system | |
CN106792653A (en) | A kind of communicating number information processing method, apparatus and system | |
CN110535808A (en) | A kind of monitoring of tools, deregistering method and device | |
CN109451537A (en) | Network shunt method and relevant device | |
CN106604398A (en) | Resource distribution method and device | |
CN104298596B (en) | Random distribution method and device for test scheme and server | |
CN108416652A (en) | A kind of ticketing service distribution method, computer readable storage medium and server | |
CN106162586A (en) | Method for limiting incoming call, device and system | |
CN109962987A (en) | Method, device and system for establishing communication connection | |
CN111124672A (en) | Data distribution method based on Redis cluster and related equipment | |
CN106651428A (en) | Lucky draw data processing method and device | |
CN104980483B (en) | A kind of data transfering method, server and data transferring system | |
CN107666365A (en) | A kind of CSI acquisition methods, server, terminal and AP | |
CN115720227A (en) | Election method and device for consensus nodes of block chain and electronic equipment | |
CN108513303A (en) | The abnormality monitoring method and device of jack per line terminal | |
CN112153701B (en) | Method and device for determining bandwidth usage | |
CN105557033B (en) | Method, user equipment and the base station of transmission discovery signal | |
CN108021639A (en) | Information-pushing method, device, server and storage 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170815 |