Embodiment
As stated in the Background Art, the existing method for sending electronic ticket is sent every time in order to ensure being sent at one in the cycle
Electronic ticket to user is unique, employs the mode that each electronic ticket is marked, for example, the electronics that will do not sent
Certificate is labeled as T, and the electronic ticket sent is labeled as into F, so that will not be sent again labeled as F electronic ticket.
But using this mark mode the server resource of consuming can be caused excessive.As an example it is assumed that at first
Sending in the cycle, 100 electronic tickets are sent by server, and the mark of this 100 electronic tickets has all been modified to F via T,
So it is next transmission the cycle in, due to server only can selected marker be T electronic ticket send, this 100 mark
Electronic ticket can not be sent.Therefore, in the method for existing transmission electronic ticket, it is each send after end cycle, it is necessary to
The mark of each electronic ticket is reset or regenerated each electronic ticket labeled as T, and this can expend excessive server money
Source, influence the efficiency that server sends electronic ticket.
And the core concept of this specification one or more embodiment is to send the cycle for each, the transmission cycle is set
Corresponding mark, also, within each transmission cycle, the mark for the electronic ticket not sent is that the currently transmitted cycle is corresponding
Available mark, and the mark of the electronic ticket sent can be changed, and amended mark is not corresponding to the currently transmitted cycle
Mark can be used, is that mark can be used corresponding to the follow-up transmission cycle.Server, can need not by performing above-mentioned transmission rule
The mark of each electronic ticket is reset after each transmission end cycle, without each electronic ticket regenerated labeled as T.
In order that those skilled in the art more fully understand the technical scheme in the application, below in conjunction with this specification
Accompanying drawing in one or more embodiments, the technical scheme in this specification embodiment is clearly and completely described, shown
So, described embodiment is only some embodiments of the present application, rather than whole embodiments.Implemented based on this specification
Example, the every other embodiment that those of ordinary skill in the art are obtained under the premise of creative work is not made, all should
Belong to the scope of the application protection.
Below in conjunction with accompanying drawing, the technical scheme that each embodiment of the application provides is described in detail.
Fig. 1 is the ladder numerical value method to set up flow chart that this specification embodiment provides, and is comprised the following steps:
S100:Receive user's transmission gets request.
In this explanation embodiment, server can receive user and pass through communication equipment (computer that can surf the Net, mobile phone etc.)
What is sent gets request for electronic ticket, and the operation that electronic ticket is sent to the user is triggered with this.Wherein, each electronic ticket is
Generated by server and stored.Electronic ticket can be specifically electronic lottery, electronic bill, electronic passwords etc..
S102:Request is got according to described, it is determined that described get sends the cycle corresponding to request, and determines the transmission week
Mark can be used corresponding to phase.
In this specification embodiment, server can according to it is described get the user that includes in request and send get request
Time, it is determined that described get sends the cycle corresponding to request, namely determine current transmission cycle.In this explanation one or more
Under the scene of individual embodiment, server periodically sends electronic ticket, is sent at one in the cycle, the electronics that each user gets
Certificate is all different.
In addition, described get can also include the time that user specifies, in such cases, the institute that server determines in request
State other transmission weeks got and send that the cycle is not necessarily the current transmission cycle or user specifies corresponding to request
Phase, server can be after other transmission cycles that user specifies start, then start to perform subsequent step S104~S106.Always
It, server can get request according to what user sent, determine that the user wants to get the opportunity of electronic ticket, so as in phase
In the transmission cycle answered electronic ticket is sent to the user.
Server is determined after getting the transmission cycle corresponding to request, can continue to determine to use corresponding to the transmission cycle
Mark.Herein it should be noted that server can send the cycle for each in advance, setting can use corresponding to the transmission cycle
Mark.One send the cycle corresponding to can use mark can with more than one, can with mark can be numerical value or word or
Other symbols.Each transmission cycle is corresponding respectively to be different with mark.
S104:From each electronic ticket of storage, determine labeled as the electronic ticket that can use mark.
In this specification embodiment, server is in each electronic ticket of storage, it is determined that labeled as the transmission cycle pair
The electronic ticket for the available mark answered.It can be seen that having only can use the electronic ticket of mark can labeled as corresponding to the currently transmitted cycle
Sent within the currently transmitted cycle.
Herein it should be noted that before first transmission cycle starts, that is, when initializing, server can be by each
The mark of electronic ticket is arranged to that mark can be used corresponding to first transmission cycle.
S106:Electronic ticket is selected to be sent to the user from the electronic ticket determined, and change the electronic ticket of selection
Mark.
In this specification embodiment, server can be from labeled as the electronics that mark can be used corresponding to the transmission cycle
Select at least one electronic ticket to be sent to the user in certificate, and change the mark of the electronic ticket sent, make amended mark
Note is not that can use mark corresponding to transmission cycle (namely currently transmitted cycle), and is corresponding to the follow-up transmission cycle
Mark can be used.
The method of transmission electronic ticket as shown in Figure 1, on the one hand, due within the currently transmitted cycle, each being sent
The mark of electronic ticket can all be changed, and amended mark is not that mark can be used corresponding to the currently transmitted cycle, and has mark only
For that can be sent corresponding to the currently transmitted cycle with the electronic ticket of mark within the currently transmitted cycle, therefore, current
Send in the cycle, same electronic ticket will not be repeatedly transmitted.On the other hand, within the currently transmitted cycle, sent out for each
The electronic ticket sent, the mark of the amended electronic ticket are that mark can be used corresponding to the follow-up transmission cycle, and therefore, server can
With it is each transmission the cycle in be multiplexed each electronic ticket, without it is each transmission end cycle after reset each electronic ticket mark or
Regenerate each electronic ticket.
Mark can be used corresponding to the cycle below for sending, is specifically described.
Example one
Adjacent two transmission cycles can be directed to, will first send and can be arranged to T with mark corresponding to the cycle, the
One sent in the cycle, and the electronic ticket not sent is labeled as T, and the mark of the electronic ticket sent is modified to F;By second
F can be arranged to corresponding to the cycle with mark by sending, and be sent at second in the cycle, the electronic ticket not sent is labeled as F, is sent out
The mark of the electronic ticket sent is modified to T.It is of course also possible to first is sent can be arranged to 1 with mark corresponding to the cycle, will
0 can be arranged to corresponding to second transmission cycle with mark.In a word, can be by first hair for two adjacent transmission cycles
The mark of the electronic ticket sent in the cycle is sent as mark can be used corresponding to a transmission cycle, as shown in Figure 2.
Example two
In general, sending the cycle has sequencing, server is by the way that each transmission cycle is numbered.Such a situation
Under, if the numbering for respectively sending the cycle is incremented by successively by the sequencing in each transmission cycle, server can will be less than the hair
Each numerical value of the numbering in cycle is sent to be defined as that mark can be used corresponding to the transmission cycle.Consequently, it is possible in step s 106,
The each electronic ticket for being chosen to send can be directed to, not less than the numbering in currently transmitted cycle and next transmission cycle will be less than
Numbering any value, the mark as the amended electronic ticket.
For example, the numbering for sending the cycle is 20170720, then can be used corresponding to the transmission cycle that numbering is 20170720
Mark can be less than 20170720 each numerical value, and the numerical value such as -10000,0.5,30 all may be used.Therefore, as long as some electronic ticket
Mark for 20170720 numerical value, it is possible to numbering be 20170720 the transmission cycle in sent.The electronic ticket
After sending, if next numbering for sending the cycle is 20170820, then the mark X of the electronic ticket after being changed, meet
Condition 20170820>X >=20170720.
Electronic ticket ID |
Electronic ticket marks |
Electronic ticket 1 |
-1 |
Electronic ticket 2 |
3.2 |
Electronic ticket 3 |
50 |
Electronic ticket 4 |
0 |
Table 1
Assuming that currently transmitted cycle numbering is 20170720, next transmission cycle numbering is 20170820, is enumerated in table 1
The mark of each electronic ticket, it is seen then that within the currently transmitted cycle, each electronic ticket can be chosen to send, and electronic ticket is once hair
Send, it, which is marked, is changed, and after each electronic ticket is all sent, the mark of each electronic ticket can be as shown in table 2, Mei Ge electricity
The mark of sub- certificate is 20170720 and the numerical value less than 20170820.
Electronic ticket ID |
Electronic ticket marks |
Electronic ticket 1 |
20170720 |
Electronic ticket 2 |
20170819 |
Electronic ticket 3 |
20170811 |
Electronic ticket 4 |
20170817.8 |
Table 2
In addition it is also necessary to explanation, sends in the cycle at one, it is understood that there may be all electronic tickets, which are not issued, to be finished,
The situation that the electronic ticket having is not sent.In this case, the mark for the electronic ticket not sent is not also changed, in this example
In, because the numbering in each transmission cycle is incremented by successively, and each sending can use mark to be smaller than transmission week corresponding to the cycle
Any value of the numbering of phase, therefore, upper one, which sent corresponding to the cycle, must be follow-up all transmission cycles with mark
Corresponding mark.That is, do not sent even if some electronic ticket is sent in the cycle at upper one, the mark of the electronic ticket
Note is not changed, and the mark of the electronic ticket is also that mark can be used corresponding to next transmission cycle.
In addition, in this specification embodiment, when determining labeled as the electricity that mark can be used corresponding to the currently transmitted cycle
After sub- certificate, server can randomly choose electronic ticket from each electronic ticket determined and be sent to user.Specifically, server
Random number corresponding to the electronic ticket can be generated in advance for each electronic ticket of storage, in step s 106, can be according to true
The size order of random number, is ranked up to each electronic ticket determined corresponding to each electronic ticket difference made;After sequence
Electronic ticket in selection top n electronic ticket be sent to the user, N is the natural number more than 0.
Herein it is emphasized that can after each transmission end cycle, regenerate corresponding to each electronic ticket with
Machine number, it can also be sent at one in the cycle, for each electronic ticket, if the electronic ticket is issued, regenerate the electronics
Random number corresponding to certificate.Thus, it is possible to realize within each transmission cycle, random selection electronic ticket is sent to user.
In addition, in practical application, in the step s 100, server may be connected to multiple getting for users' transmission simultaneously please
Ask.Specifically, server multiple can get what is received in a shorter time interval (such as 200 milliseconds) request and regard
Request is got for what is received simultaneously.In step s 102, server gets request according to any, is corresponded to it is determined that this gets request
The transmission cycle, as this it is multiple get request corresponding to send the cycle, and determine it is described transmission the cycle corresponding to can use mark.
In step S104, determine labeled as the electronic ticket that can use mark.
In step s 106, it is ascending when the size order of random number corresponding to each electronic ticket difference by determination
When selecting the electronic ticket to send successively, if server receive M user transmission simultaneously get request, then server can be with
M electronic ticket is selected successively, and this M electronic ticket is sent respectively to M user.In this way, can avoid servicing
Device gets request according to what this M user sent, founds M thread, while attempts random number in each electronic ticket that locking determines
Minimum electronic ticket, so as to cause thread block.
By taking each electronic ticket in table 3 as an example simultaneously, it is assumed that there are 3 users to be sent respectively to server and get request, service
Device gets request according to this 3 and determines that the numbering in current transmission cycle is 20170720.Obviously, each electronic ticket in table 3
The numerical value of mark be smaller than 20170720, namely be all that mark can be used corresponding to the current transmission cycle.Server can be by
It is ascending according to the size of random number corresponding to each electronic ticket difference, 3 electronic tickets (i.e. electronic ticket 2, electricity are determined from table 3
Sub- certificate 4, electronic ticket 3), by getting one-to-one 3 threads of request with this 3, this 3 electronic tickets, such as Fig. 3 are locked respectively
It is shown, so as to avoid thread block.
Electronic ticket ID |
Electronic ticket marks |
Random number |
Electronic ticket 1 |
-1 |
255 |
Electronic ticket 2 |
3.2 |
-0.5 |
Electronic ticket 3 |
50 |
23 |
Electronic ticket 4 |
0 |
8 |
Table 3
Based on the method for the transmission electronic ticket shown in Fig. 1, this specification embodiment is also corresponding to provide a kind of transmission electronics
The device of certificate, as shown in figure 4, including:
Receiving module 401, receive user's transmission gets request;
First determining module 402, request is got according to described, it is determined that described get sends the cycle corresponding to request, and really
Mark can be used corresponding to the fixed transmission cycle;
Second determining module 403, from each electronic ticket of storage, determine labeled as the electronic ticket that can use mark;
Modified module 404 is sent, selects electronic ticket to be sent to the user from the electronic ticket determined, and change selection
Electronic ticket mark;Amended mark is not that mark can be used corresponding to the transmission cycle, and is the follow-up transmission cycle
Corresponding mark.
First determining module 402, each numerical value less than the numbering in the transmission cycle is defined as the transmission
Mark can be used corresponding to cycle.
The transmission modified module 404, random selection electronic ticket is sent to user from the electronic ticket determined.
Described device also includes:Pretreatment module 405, in advance for each electronic ticket of storage, generate the electronic ticket pair
The random number answered;
The transmission modified module 404, it is right according to the size order of random number corresponding to each electronic ticket difference determined
Each electronic ticket determined is ranked up;Top n electronic ticket is selected to be sent to the user in electronic ticket after sequence, its
In, N is the natural number more than 0.
Each numbering for sending the cycle is incremented by successively by the sequencing in each transmission cycle;
The transmission modified module 404, for each electronic ticket of selection, by not less than the numbering in currently transmitted cycle and
Less than any value of the numbering in next transmission cycle, the mark as the amended electronic ticket.
The electronic ticket is electronic lottery.
Based on the method for the transmission electronic ticket shown in Fig. 1, this specification embodiment is also corresponding to provide a kind of electronic ticket hair
Equipment is sent, as shown in figure 5, the equipment includes one or more processors and memory, the memory storage has program, and
It is configured to by one or more of computing device following steps:
Receive user's transmission gets request;
Request is got according to described, it is determined that described get sends the cycle corresponding to request, and determines the transmission cycle pair
The available mark answered;
From each electronic ticket of storage, determine labeled as the electronic ticket that can use mark;
Select electronic ticket to be sent to the user from the electronic ticket determined, and change the mark of the electronic ticket of selection;
Amended mark is not that mark can be used corresponding to the transmission cycle, and is that mark can be used corresponding to the follow-up transmission cycle.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.Especially for Fig. 5 institutes
For the electronic ticket shown sends equipment, because it is substantially similar to embodiment of the method, so description is fairly simple, related part
Illustrate referring to the part of embodiment of the method.
In the 1990s, the improvement for a technology can clearly distinguish be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And as the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow is programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, PLD
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, its logic function is determined by user to device programming.By designer
Voluntarily programming comes a number character repertoire " integrated " on a piece of PLD, without asking chip maker to design and make
Make special IC chip.Moreover, nowadays, substitution manually makes IC chip, and this programming is also used instead mostly
" logic compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development
Seemingly, and the source code before compiling also handy specific programming language is write, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but have many kinds, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also should
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
Can is readily available the hardware circuit for realizing the logical method flow.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
Device and storage can by the computer of the computer readable program code (such as software or firmware) of (micro-) computing device
Read medium, gate, switch, application specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller include but is not limited to following microcontroller
Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, are deposited
Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that except with
Pure computer readable program code mode realized beyond controller, completely can be by the way that method and step is carried out into programming in logic to make
Controller is obtained in the form of gate, switch, application specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. to come in fact
Existing identical function.Therefore this controller is considered a kind of hardware component, and various for realizing to including in it
The device of function can also be considered as the structure in hardware component.Or even, can be by for realizing that the device of various functions regards
For that not only can be the software module of implementation method but also can be the structure in hardware component.
System, device, module or the unit that above-described embodiment illustrates, it can specifically be realized by computer chip or entity,
Or realized by the product with certain function.One kind typically realizes that equipment is computer.Specifically, computer for example may be used
Think that personal computer, laptop computer, cell phone, camera phone, smart phone, individual digital symbol assistant, media are broadcast
Put appointing in device, navigation equipment, electronic mail equipment, game console, tablet PC, wearable device or these equipment
The combination of what equipment.
For convenience of description, it is divided into various units during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each unit can be realized in same or multiple softwares and/or hardware during application.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and internal memory.
Internal memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved
State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM),
Digit multifunctional optical disk (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storages are set
Standby or any other non-transmission medium, the information that can be accessed by a computing device available for storage.Define, count according to herein
Calculation machine computer-readable recording medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of elements not only include those key elements, but also wrapping
Include the other element being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described
Other identical element also be present in the process of element, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer program product.
Therefore, the application can be using the embodiment in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Form.Deposited moreover, the application can use to can use in one or more computers for wherein including computer usable program code
The shape for the computer program product that storage media is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The application can be described in the general context of computer executable instructions, such as program
Module.Usually, program module includes performing particular task or realizes routine, program, object, the group of particular abstract data type
Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these DCEs, by
Task is performed and connected remote processing devices by communication network.In a distributed computing environment, program module can be with
In the local and remote computer-readable storage medium including storage device.
Embodiments herein is the foregoing is only, is not limited to the application.For those skilled in the art
For, the application can have various modifications and variations.All any modifications made within spirit herein and principle, it is equal
Replace, improve etc., it should be included within the scope of claims hereof.