CN113205173A - Electronic ticket selection method and device - Google Patents
Electronic ticket selection method and device Download PDFInfo
- Publication number
- CN113205173A CN113205173A CN202110594784.5A CN202110594784A CN113205173A CN 113205173 A CN113205173 A CN 113205173A CN 202110594784 A CN202110594784 A CN 202110594784A CN 113205173 A CN113205173 A CN 113205173A
- Authority
- CN
- China
- Prior art keywords
- electronic ticket
- electronic
- fitness
- ticket
- particle
- 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
- 238000010187 selection method Methods 0.000 title claims abstract description 24
- 239000002245 particle Substances 0.000 claims abstract description 139
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 50
- 238000000034 method Methods 0.000 claims abstract description 38
- 238000004364 calculation method Methods 0.000 claims abstract description 23
- 230000006870 function Effects 0.000 claims description 62
- 238000004590 computer program Methods 0.000 claims description 16
- 238000003860 storage Methods 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 17
- 230000008569 process Effects 0.000 description 8
- 238000012163 sequencing technique Methods 0.000 description 6
- 230000003044 adaptive effect Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
- G06Q30/0212—Chance discounts or incentives
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0207—Discounts or incentives, e.g. coupons or rebates
- G06Q30/0222—During e-commerce, i.e. online transactions
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Physics & Mathematics (AREA)
- Development Economics (AREA)
- Theoretical Computer Science (AREA)
- Strategic Management (AREA)
- General Physics & Mathematics (AREA)
- Game Theory and Decision Science (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention provides an electronic ticket selection method and device, belonging to big data, and the method comprises the following steps: acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm; establishing a fitness function according to a particle swarm algorithm; according to the fitness function, performing parallel calculation on each electronic ticket in the electronic ticket particle swarm to determine the fitness of each electronic ticket; and determining the optimal electronic ticket according to the fitness of each electronic ticket. The intelligent ticket selection is realized by utilizing the particle swarm algorithm, the accuracy and the high efficiency are realized, a distributed system is utilized to carry out parallel processing on all electronic tickets, the fitness is respectively calculated, the optimal electronic ticket is recommended according to the calculated value, the calculation speed is improved, and the optimal ticket is intelligently and efficiently selected.
Description
Technical Field
The invention relates to the technical field of computer data processing, in particular to a big data technology, and particularly relates to an electronic ticket selection method and device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In the age of rapid development of internet finance, electronic coupons are an important means for developing, acquiring and sticking customers. Particularly, under the influence of epidemic situations, the economic situation is severe, the external demand is fatigue, the internal demand is insufficient, and governments in various places stimulate consumption by issuing a large number of electronic coupons to drive economy. The high-speed development of two-dimensional code payment, the use of electronic coupons is more and more popular, and the cardinal number of the electronic coupons is increased more and more rapidly.
The traditional electronic ticket selecting algorithm is that the electronic tickets are sorted according to the difference between the electronic ticket denomination and the consumption amount, and then sorted from near to far according to the first round of sorting results and the expiration time of the electronic tickets, and the electronic tickets can be selected only by two rounds of sorting. Because the electronic ticket base number is large, the processing efficiency is low, the operation speed is slow, and the serial processing can be realized only. How to improve the system operation efficiency and quickly select an optimal ticket is a difficult problem to be solved urgently in the field.
Therefore, how to provide a new solution, which can solve the above technical problems, is a technical problem to be solved in the art.
Disclosure of Invention
The embodiment of the invention provides an electronic ticket selection method, which realizes intelligent ticket selection by utilizing a particle swarm algorithm, is accurate and efficient, utilizes a distributed system to perform parallel processing on all electronic tickets, respectively calculates fitness, recommends the optimal electronic ticket according to the calculated value, improves the calculation speed and realizes intelligent and efficient selection of the optimal ticket, and the method comprises the following steps:
acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm;
establishing a fitness function according to a particle swarm algorithm;
according to the fitness function, performing parallel calculation on each electronic ticket in the electronic ticket particle swarm to determine the fitness of each electronic ticket;
and determining the optimal electronic ticket according to the fitness of each electronic ticket.
An embodiment of the present invention further provides an electronic ticket selecting apparatus, including:
the electronic ticket particle swarm establishment module is used for acquiring all electronic tickets as particles and establishing electronic ticket particle swarms;
the fitness function establishing module is used for establishing a fitness function according to the particle swarm algorithm;
the electronic ticket fitness parallel computing module is used for computing each electronic ticket in the electronic ticket particle swarm in parallel according to a fitness function and determining the fitness of each electronic ticket;
and the optimal electronic ticket determining module is used for determining the optimal electronic ticket according to the fitness of each electronic ticket.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the electronic ticket selection method when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing the above-mentioned electronic ticket selecting method is stored in the computer-readable storage medium.
The embodiment of the invention provides an electronic ticket selection method and device, which comprise the following steps: firstly, acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm; then, according to a particle swarm algorithm, a fitness function is established; next, according to the fitness function, performing parallel calculation on each electronic ticket in the electronic ticket particle swarm, and determining the fitness of each electronic ticket; and finally, determining the optimal electronic ticket according to the fitness of each electronic ticket. The invention provides a scheme for optimizing the processing efficiency of the system on the basis of large base number of electronic coupons in the system, low efficiency of the original coupon selection algorithm and low processing speed of the system. By using the 'divide and conquer' idea of a distributed framework, the electronic coupons are processed in parallel, the fitness function is established by combining the particle swarm algorithm, the parallel calculation of each electronic coupon is realized, the problem of low original processing efficiency is solved, and the optimal coupon is selected intelligently and efficiently. In the invention, a fitness function is established through a particle swarm algorithm in the process of intelligently selecting the optimal ticket for the electronic ticket. And (3) utilizing a distributed system to perform parallel processing on all the electronic coupons, respectively calculating the fitness, and recommending the optimal electronic coupon according to the calculated value. The traditional coupon selection needs two rounds of sequencing, and is serial processing, so that the processing efficiency is low. The invention obviously improves the processing efficiency through parallel computation. And the intelligent ticket selection is realized by utilizing a particle swarm algorithm, so that the accuracy and the efficiency are high. The distributed system is used, so that the calculation speed is improved by dividing and treating the data in parallel.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic diagram of an electronic ticket selection method according to an embodiment of the present invention.
Fig. 2 is a system configuration diagram of an electronic ticket selection method according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of an electronic ticket held by a client in an example of an electronic ticket selection method according to an embodiment of the present invention.
Fig. 4 is an algorithm flowchart of an electronic ticket selecting method according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of a computer device for executing an electronic ticket selection method implemented by the present invention.
Fig. 6 is a schematic diagram of an electronic ticket selecting apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
The invention belongs to big data technology. Fig. 1 is a schematic diagram of an electronic ticket selection method according to an embodiment of the present invention, and as shown in fig. 1, an embodiment of the present invention provides an electronic ticket selection method, which uses a particle swarm algorithm to realize intelligent ticket selection, is accurate and efficient, uses a distributed system to perform parallel processing on all electronic tickets, respectively calculates fitness, recommends an optimal electronic ticket according to a calculated value, increases calculation speed, and achieves intelligent and efficient selection of an optimal ticket, and the method includes:
step 101: acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm;
step 102: establishing a fitness function according to a particle swarm algorithm;
step 103: according to the fitness function, performing parallel calculation on each electronic ticket in the electronic ticket particle swarm to determine the fitness of each electronic ticket;
step 104: and determining the optimal electronic ticket according to the fitness of each electronic ticket.
The electronic ticket selection method provided by the embodiment of the invention comprises the following steps: firstly, acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm; then, according to a particle swarm algorithm, a fitness function is established, next, according to the fitness function, each electronic ticket in the electronic ticket particle swarm is calculated in parallel, and the fitness of each electronic ticket is determined; and finally, determining the optimal electronic ticket according to the fitness of each electronic ticket. The invention provides a scheme for optimizing the processing efficiency of the system on the basis of large base number of electronic coupons in the system, low efficiency of the original coupon selection algorithm and low processing speed of the system. By using the 'divide and conquer' idea of a distributed framework, the electronic coupons are processed in parallel, the fitness function is established by combining the particle swarm algorithm, the parallel calculation of each electronic coupon is realized, the problem of low original processing efficiency is solved, and the optimal coupon is selected intelligently and efficiently. In the invention, a fitness function is established through a particle swarm algorithm in the process of intelligently selecting the optimal ticket for the electronic ticket. And (3) utilizing a distributed system to perform parallel processing on all the electronic coupons, respectively calculating the fitness, and recommending the optimal electronic coupon according to the calculated value. The traditional coupon selection needs two rounds of sequencing, and is serial processing, so that the processing efficiency is low. The invention obviously improves the processing efficiency through parallel computation. And the intelligent ticket selection is realized by utilizing a particle swarm algorithm, so that the accuracy and the efficiency are high. The distributed system is used, so that the calculation speed is improved by dividing and treating the data in parallel.
When the method for selecting an electronic ticket provided by the embodiment of the present invention is implemented specifically, in one implementation, the method may include:
acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm;
establishing a fitness function according to a particle swarm algorithm;
according to the fitness function, performing parallel calculation on each electronic ticket in the electronic ticket particle swarm to determine the fitness of each electronic ticket;
and determining the optimal electronic ticket according to the fitness of each electronic ticket.
The invention provides a scheme for optimizing the processing efficiency of the system on the basis of large base number of electronic coupons in the system, low efficiency of the original coupon selection algorithm and low processing speed of the system. By using the 'divide and conquer' idea of a distributed framework, the electronic coupons are processed in parallel, the fitness function is established by combining the particle swarm algorithm, the parallel calculation of each electronic coupon is realized, the problem of low original processing efficiency is solved, and the optimal coupon is selected intelligently and efficiently.
In a specific implementation of the method for selecting an electronic ticket according to an embodiment of the present invention, in one implementation, the obtaining all electronic tickets and establishing an electronic ticket particle group includes:
inquiring and acquiring all electronic tickets according to the client number;
initializing all electronic coupons as particles, selecting a group of random electronic coupons as an initial particle group, and establishing an electronic coupon particle group.
In the embodiment, when the electronic ticket is optimized, a set of electronic tickets needs to be determined, and first, all the electronic tickets of the customer are inquired and obtained from the electronic ticket service system according to the customer number, as shown in a schematic diagram of the electronic ticket held by the customer in the example of the electronic ticket selection method in the embodiment of the invention in fig. 3, in one example, when the customer pays a 40-yuan order on 11/15/2020, one electronic ticket of a financial institution can be used. The situation of the electronic tickets held by the customer is shown in fig. 3, the electronic tickets with the electronic ticket serial numbers 1,2,3,4,5 and 6 of the customer are obtained through inquiry, and each electronic ticket corresponds to the face value and the due date of the electronic ticket; and initializing all the electronic coupons as particles, selecting a group of random electronic coupons as an initial particle group, and establishing an electronic coupon particle group, wherein the size of the electronic coupon particle group is 6.
In one embodiment, the aforementioned electronic ticket, as a particle, has two attributes: speed and position. In the invention, the difference between the expiration date and the system date of the electronic ticket is the speed of the particle, and the difference between the face value and the order amount of the electronic ticket is the position of the particle.
In a specific implementation of the method for selecting an electronic ticket according to the embodiment of the present invention, in one implementation, a fitness function is established as follows:
f(x,v)=x2+x+v
wherein f (x, v) is fitness; x is the position of the particle; v is the velocity of the particle.
The foregoing expressions for establishing the fitness function are exemplary, and it will be understood by those skilled in the art that the above formulas may be modified in certain forms and other parameters or data may be added or other specific formulas may be provided as required, and such modifications are intended to fall within the scope of the present invention.
In an embodiment, the fitness function established as described above is calculated by first determining the position and velocity (x) of the particle ii,vi) Substituting the fitness function f (x, v) into x2And + x + v, the fitness of each particle can be calculated.
Fig. 2 is a system structure diagram of an electronic ticket selecting method according to an embodiment of the present invention, and as shown in fig. 2, when the electronic ticket selecting method according to the embodiment of the present invention is specifically implemented, in an implementation, according to a fitness function, the foregoing parallel calculation is performed on each electronic ticket in an electronic ticket particle group, and a fitness of each electronic ticket is determined, including:
distributing electronic coupons corresponding to different activities in the electronic coupon particle swarm on different containers, deploying particle swarm micro-service processing units on the respective containers to form micro-service container groups, and deploying the micro-service container groups in a distributed service framework;
and according to the fitness function, parallel calling is initiated to each container in the micro-service container group through the distributed service framework, and the fitness of each electronic ticket is calculated through parallel calling of the particle swarm micro-service processing unit.
In an embodiment, fig. 2 provides a system for implementing an electronic ticket selection method, which at least includes: an optimal electronic ticket selection component and a distributed service framework. In the system, by using the concept of 'divide and conquer' of a distributed system, the electronic tickets corresponding to different activities are distributed on different containers, and are provided with respective micro-service processing units for parallel computing. By using the 'divide and conquer' idea of a distributed framework, the electronic coupons are processed in parallel, the fitness function is established by combining the particle swarm algorithm, the parallel calculation of each electronic coupon is realized, the problem of low original processing efficiency is solved, and the optimal coupon is selected intelligently and efficiently.
In the embodiment, the method for determining the fitness of each electronic ticket by utilizing a distributed system and calculating each electronic ticket in the electronic ticket particle swarm in parallel according to the fitness function comprises the following steps:
first, the electronic tickets corresponding to different activities in the electronic ticket group are distributed on different containers, for example, the electronic ticket 1 is distributed on the container 1, the electronic ticket 2 is distributed on the container 2, the electronic ticket 3 is distributed on the container 3, …, and the electronic ticket N is distributed on the container N; in the container 1, the container 2 and the container 3 …, a particle swarm micro-service processing unit is disposed on each container to provide particle swarm computing service, and then the container 1, the container 2 and the container 3 …, the container N, form a micro-service container group and are disposed in a distributed service framework;
when the fitness of each electronic ticket is calculated, according to the fitness function, the optimal electronic ticket selecting component initiates parallel calling to each container in the micro-service container group through the distributed service framework, and the particle swarm micro-service processing unit calls and calculates the fitness of each electronic ticket in parallel, so that the parallel calling of each electronic ticket is realized.
In the invention, a fitness function is established through a particle swarm algorithm in the process of intelligently selecting the optimal ticket for the electronic ticket. And (3) utilizing a distributed system to perform parallel processing on all the electronic coupons, respectively calculating the fitness, and recommending the optimal electronic coupon according to the calculated value. The traditional coupon selection needs two rounds of sequencing, and is serial processing, so that the processing efficiency is low. The invention obviously improves the processing efficiency through parallel computation. And the intelligent ticket selection is realized by utilizing a particle swarm algorithm, so that the accuracy and the efficiency are high. A distributed system is utilized, so that the calculation speed is improved by dividing and treating the data in parallel; the invention uses the idea of combining the particle swarm algorithm and the distributed service framework to intelligently and efficiently select the electronic ticket with the denomination closest to the order amount and the earliest due, thereby providing a new method for solving the problem of the optimal ticket in the field of the electronic ticket.
Through parallel computing, the invention obviously improves the processing efficiency.
In a specific implementation of the method for selecting an electronic ticket according to the embodiment of the present invention, in one implementation, the calculating a fitness of each electronic ticket includes:
inputting the speed of the particles and the positions of the particles into a fitness function, and calculating the fitness of each electronic ticket; the speed of the particles is the difference between the expiration date of the electronic ticket and the system date, and the position of the particles is the difference between the face value of the electronic ticket and the amount of the order.
In the embodiment, when calculating the fitness of each electronic ticket, the main process comprises the following steps: the velocity and position (x) of each particlei,vi) Input fitness function f (x, v) ═ x2+ x + v, calculating to obtain the fitness of each electronic ticket; the speed of the particles is the difference between the expiration date of the electronic ticket and the system date, and the position of the particles is the difference between the face value of the electronic ticket and the amount of the order.
The electronic ticket group held by the client is preferentially selected according to the electronic ticket whose face value is close to the order amount and which is expired earliest. And taking the difference between the expiration date and the system date of the electronic ticket as the speed of the particle, and taking the difference between the face value and the order amount of the electronic ticket as the position of the particle. And calculating the fitness value of each electronic ticket according to the fitness function. In the present invention, the smaller the value of the fitness means the closer to the order amount and the earlier due, and thus the more the fitness of the electronic ticket is.
With reference to the electronic tickets described in fig. 3, the fitness of each electronic ticket is calculated:
calculating the fitness of the No. 1 electronic ticket:x1is the difference 60, v between the face value 100 of the electronic ticket and the amount 40 of the order1The value of fitness is 3705, which is the difference 45 between the e-coupon due date 2020/12/30 and the system date 2020/11/15.
And (3) calculating the fitness of the No. 2 electronic ticket:x2is the difference value-20, v between the face value 20 of the electronic ticket and the order amount 402The difference 16 between the electronic coupon due date 2020/12/1 and the system date 2020/11/15 yields a fitness value of 396.
Calculating the fitness of the No. 3 electronic ticket:x3the difference value between the face value of the electronic ticket 29.9 and the order amount 40 is-10.1 v3The fitness value is 106.91 for the difference 15 between the expiration date 2020/11/30 of the electronic ticket and the system date 2020/11/15.
And (3) calculating the fitness of the No. 4 electronic ticket:x4the difference value between the face value of the electronic ticket 29.9 and the order amount 40 is-10.1 v4The fitness value is 137.91 for the difference 46 between the electronic coupon expiration date 2020/12/31 and the system date 2020/11/15.
And (3) calculating the fitness of the No. 5 electronic ticket:x5the difference value between the face value 5 of the electronic ticket and the order amount 40 is-35, v5Is the difference between the expiration date 2020/12/31 and the system date 2020/11/1546, the resulting fitness value is 1236.
And (3) calculating the fitness of the No. 6 electronic ticket:x6is the difference 10 v between the face value 50 of the electronic ticket and the amount 40 of the order6The difference 15 between the electronic coupon due date 2020/11/30 and the system date 2020/11/15 yields a fitness value of 125.
In a specific implementation of the method for selecting an electronic ticket according to the embodiment of the present invention, in one implementation, the determining an optimal electronic ticket according to the fitness of each electronic ticket includes:
and iteratively comparing the fitness of each electronic ticket, and taking the electronic ticket with the minimum fitness value as the optimal electronic ticket.
In the embodiment, after the fitness of each electronic ticket is obtained through parallel calculation, the fitness of each electronic ticket is iteratively compared, and the electronic ticket with the minimum fitness value is taken as the optimal electronic ticket, for example, the fitness of 6 electronic tickets calculated in the above example, wherein the fitness value of the electronic ticket No. 3 is the minimum, the adaptability is stronger, and therefore, the electronic ticket No. 3 is the optimal electronic ticket, and is provided for the user to pay.
The invention provides a scheme for optimizing the processing efficiency of the system on the basis of large base number of electronic coupons in the system, low efficiency of the original coupon selection algorithm and low processing speed of the system. By using the 'divide and conquer' idea of a distributed framework, the electronic coupons are processed in parallel, the fitness function is established by combining the particle swarm algorithm, the parallel calculation of each electronic coupon is realized, the problem of low original processing efficiency is solved, and the optimal coupon is selected intelligently and efficiently. In the invention, a fitness function is established through a particle swarm algorithm in the process of intelligently selecting the optimal ticket for the electronic ticket. And (3) utilizing a distributed system to perform parallel processing on all the electronic coupons, respectively calculating the fitness, and recommending the optimal electronic coupon according to the calculated value. The traditional coupon selection needs two rounds of sequencing, and is serial processing, so that the processing efficiency is low. The invention obviously improves the processing efficiency through parallel computation. And the intelligent ticket selection is realized by utilizing a particle swarm algorithm, so that the accuracy and the efficiency are high. The distributed system is used, so that the calculation speed is improved by dividing and treating the data in parallel. The invention uses the idea of combining the particle swarm algorithm and the distributed service framework to intelligently and efficiently select the electronic ticket with the denomination closest to the order amount and the earliest due, thereby providing a new method for solving the problem of the optimal ticket in the field of the electronic ticket.
The following briefly describes an electronic ticket selection method provided by an embodiment of the present invention with reference to specific scenarios:
the invention provides a scheme for optimizing the processing efficiency of the system on the basis of large base number of electronic coupons in the system, low efficiency of the original coupon selection algorithm and low processing speed of the system. The idea of 'divide and conquer' of a distributed framework is applied, parallel processing is carried out, a particle swarm algorithm is combined, an adaptive function is established, parallel computing of each electronic ticket is achieved, the problem of low original processing efficiency is solved, and intelligent and efficient selection of the optimal ticket is achieved.
In the invention, an adaptive function is established through a particle swarm algorithm in the process of intelligently selecting the optimal ticket for the electronic ticket. And (3) utilizing a distributed system to perform parallel processing on all the electronic coupons, respectively calculating the fitness, and recommending the optimal electronic coupon according to the calculated value. The traditional coupon selection needs two rounds of sequencing, and is serial processing, so that the processing efficiency is low. The invention obviously improves the processing efficiency.
As shown in fig. 2, the system internal structure of the electronic ticket selecting method according to the embodiment of the present invention, which is implemented by the system of the electronic ticket selecting method according to the embodiment of the present invention, at least includes: an optimal electronic ticket selection component and a distributed service framework. By using the 'divide and conquer' idea of a distributed system, the electronic coupons corresponding to different activities are distributed on different containers, and are provided with respective micro-service processing units for parallel computing. And establishing a fitness function for the electronic ticket group by using a particle swarm algorithm, and acquiring the optimal electronic ticket according to the fitness of each electronic ticket.
The realization idea of solving the optimal electronic ticket by the particle swarm algorithm is as follows:
a random set of electronic coupons, called "particles", is selected. The particles have two properties: speed and position. In the invention, the difference between the expiration date and the system date of the electronic ticket is the speed of the particle, and the difference between the face value and the order amount of the electronic ticket is the position of the particle.
Establishing a fitness function f (x, v) ═ x2+ x + v, will (x)i,vi) The fitness function f (x, v) is substituted to calculate the fitness of each particle.
And finding the optimal electronic ticket solution through iterative comparison.
The implementation of the invention also provides an example of an electronic ticket selection method, which comprises the following steps:
according to the actual payment scene, the particle swarm algorithm is combined to explain how to select an optimal electronic ticket. For example, a customer may use an electronic coupon from a financial institution when paying a 40 dollar order on day 11, month 15 of 2020. The situation of the electronic ticket held by the customer is shown in fig. 3.
In the problem of solving the optimal electronic ticket of the client, the step of solving the optimal electronic ticket by using the particle swarm optimization is as follows:
1) initialization of electronic coupons
And selecting the electronic tickets with the electronic ticket serial numbers 1,2,3,4,5 and 6 of the customers as the initial particle group, wherein the size of the electronic ticket group is 6.
2) And evaluating the fitness of each particle, namely calculating the fitness value of the particle according to the fitness function.
Calculating the fitness of the No. 1 electronic ticket:x1is the difference 60, v between the face value 100 of the electronic ticket and the amount 40 of the order1The value of fitness is 3705, which is the difference 45 between the e-coupon due date 2020/12/30 and the system date 2020/11/15.
And (3) calculating the fitness of the No. 2 electronic ticket:x2is the difference value-20, v between the face value 20 of the electronic ticket and the order amount 402The difference 16 between the electronic coupon due date 2020/12/1 and the system date 2020/11/15 yields a fitness value of 396.
Calculating the fitness of the No. 3 electronic ticket:x3the difference value between the face value of the electronic ticket 29.9 and the order amount 40 is-10.1 v3The fitness value is 106.91 for the difference 15 between the expiration date 2020/11/30 of the electronic ticket and the system date 2020/11/15.
And (3) calculating the fitness of the No. 4 electronic ticket:x4the difference value between the face value of the electronic ticket 29.9 and the order amount 40 is-10.1 v4The fitness value is 137.91 for the difference 46 between the electronic coupon expiration date 2020/12/31 and the system date 2020/11/15.
And (3) calculating the fitness of the No. 5 electronic ticket:x5the difference value between the face value 5 of the electronic ticket and the order amount 40 is-35, v5The difference 46 between the e-coupon due date 2020/12/31 and the system date 2020/11/15 yields a fitness value of 1236.
And (3) calculating the fitness of the No. 6 electronic ticket:x6is the difference 10 v between the face value 50 of the electronic ticket and the amount 40 of the order6The difference 15 between the electronic coupon due date 2020/11/30 and the system date 2020/11/15 yields a fitness value of 125.
3) Finding an optimum value for a population of electronic ticket particles
The electronic ticket with the minimum adaptive value is taken as the optimal value of the electronic ticket particle swarm; according to the calculated value, the 3 rd electronic ticket has the minimum adaptive value and stronger adaptability, so that the 3 rd electronic ticket is optimal.
The electronic ticket group held by the client is preferentially selected according to the electronic ticket whose face value is close to the order amount and which is expired earliest. And taking the difference between the expiration date and the system date of the electronic ticket as the speed of the particle, and taking the difference between the face value and the order amount of the electronic ticket as the position of the particle. And calculating the adaptive value of each electronic ticket according to the fitness function. In the present invention, the smaller the adaptation value, the closer to the order amount and the earlier due, the more it is adapted.
Fig. 4 is an algorithm flow chart of an electronic ticket selection method according to an embodiment of the present invention, and as shown in fig. 4, an algorithm flow of an electronic ticket selection method according to an embodiment of the present invention further includes:
initializing the electronic ticket;
establishing a fitness function;
calculating the fitness value of each electronic ticket;
the optimal value of the electronic ticket particle group is obtained.
And the intelligent ticket selection is realized by utilizing a particle swarm algorithm, so that the accuracy and the efficiency are high. The distributed system is used, so that the calculation speed is improved by dividing and treating the data in parallel. The invention uses the idea of combining the particle swarm algorithm and the distributed service framework to intelligently and efficiently select the electronic ticket with the denomination closest to the order amount and the earliest due, thereby providing a new method for solving the problem of the optimal ticket in the field of the electronic ticket.
Fig. 5 is a schematic diagram of a computer device for executing an electronic ticket selecting method implemented by the present invention, and as shown in fig. 5, an embodiment of the present invention further provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the electronic ticket selecting method.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for implementing the above-mentioned electronic ticket selection method is stored in the computer-readable storage medium.
The embodiment of the invention also provides an electronic ticket selecting device, which is described in the following embodiment. Because the principle of solving the problems of the device is similar to the electronic ticket selection method, the implementation of the device can be referred to the implementation of the electronic ticket selection method, and repeated details are not repeated.
Fig. 6 is a schematic view of an electronic ticket selecting apparatus according to an embodiment of the present invention, and as shown in fig. 6, an embodiment of the present invention further provides an electronic ticket selecting apparatus, which may further include:
the electronic ticket particle swarm establishment module 601 is used for acquiring all electronic tickets as particles and establishing electronic ticket particle swarms;
a fitness function establishing module 602, configured to establish a fitness function according to a particle swarm algorithm;
the electronic ticket fitness parallel computing module 603 is configured to compute each electronic ticket in the electronic ticket particle swarm in parallel according to a fitness function, and determine the fitness of each electronic ticket;
and an optimal electronic ticket determining module 604, configured to determine an optimal electronic ticket according to fitness of each electronic ticket.
In a specific implementation of the electronic ticket selecting apparatus provided in the embodiment of the present invention, in an implementation, the electronic ticket particle swarm establishment module is specifically configured to:
inquiring and acquiring all electronic tickets according to the client number;
initializing all electronic coupons as particles, selecting a group of random electronic coupons as an initial particle group, and establishing an electronic coupon particle group.
In a specific implementation of the electronic ticket selecting apparatus provided in the embodiment of the present invention, in an implementation, the fitness function establishing module is specifically configured to: the fitness function is established as follows:
f(x,v)=x2+x+v
wherein f (x, v) is fitness; x is the position of the particle; v is the velocity of the particle.
In an implementation of the electronic ticket selecting apparatus according to an embodiment of the present invention, the optimal electronic ticket determining module is specifically configured to:
and iteratively comparing the fitness of each electronic ticket, and taking the electronic ticket with the minimum fitness value as the optimal electronic ticket.
To sum up, the method and the device for selecting the electronic ticket provided by the embodiment of the invention comprise the following steps: firstly, acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm; then, according to a particle swarm algorithm, a fitness function is established, next, according to the fitness function, each electronic ticket in the electronic ticket particle swarm is calculated in parallel, and the fitness of each electronic ticket is determined; and finally, determining the optimal electronic ticket according to the fitness of each electronic ticket.
The invention provides a scheme for optimizing the processing efficiency of the system on the basis of large base number of electronic coupons in the system, low efficiency of the original coupon selection algorithm and low processing speed of the system. By using the 'divide and conquer' idea of a distributed framework, the electronic coupons are processed in parallel, the fitness function is established by combining the particle swarm algorithm, the parallel calculation of each electronic coupon is realized, the problem of low original processing efficiency is solved, and the optimal coupon is selected intelligently and efficiently.
In the invention, a fitness function is established through a particle swarm algorithm in the process of intelligently selecting the optimal ticket for the electronic ticket. And (3) utilizing a distributed system to perform parallel processing on all the electronic coupons, respectively calculating the fitness, and recommending the optimal electronic coupon according to the calculated value. The traditional coupon selection needs two rounds of sequencing, and is serial processing, so that the processing efficiency is low. The invention obviously improves the processing efficiency through parallel computation.
And the intelligent ticket selection is realized by utilizing a particle swarm algorithm, so that the accuracy and the efficiency are high. The distributed system is used, so that the calculation speed is improved by dividing and treating the data in parallel. The invention uses the idea of combining the particle swarm algorithm and the distributed service framework to intelligently and efficiently select the electronic ticket with the denomination closest to the order amount and the earliest due, thereby providing a new method for solving the problem of the optimal ticket in the field of the electronic ticket.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. An electronic ticket selection method, comprising:
acquiring all electronic coupons as particles, and establishing electronic coupon particle swarm;
establishing a fitness function according to a particle swarm algorithm;
according to the fitness function, performing parallel calculation on each electronic ticket in the electronic ticket particle swarm to determine the fitness of each electronic ticket;
and determining the optimal electronic ticket according to the fitness of each electronic ticket.
2. The method of claim 1, wherein obtaining all electronic coupons, establishing a population of electronic coupon particles, comprises:
inquiring and acquiring all electronic tickets according to the client number;
initializing all electronic coupons as particles, selecting a group of random electronic coupons as an initial particle group, and establishing an electronic coupon particle group.
3. The method of claim 1, wherein the fitness function is established as follows:
f(x,v)=x2+x+v
wherein f (x, v) is fitness; x is the position of the particle; v is the velocity of the particle.
4. The method of claim 1, wherein determining the optimal electronic ticket based on the fitness of each electronic ticket comprises:
and iteratively comparing the fitness of each electronic ticket, and taking the electronic ticket with the minimum fitness value as the optimal electronic ticket.
5. An electronic ticket selection apparatus, comprising:
the electronic ticket particle swarm establishment module is used for acquiring all electronic tickets as particles and establishing electronic ticket particle swarms;
the fitness function establishing module is used for establishing a fitness function according to the particle swarm algorithm;
the electronic ticket fitness parallel computing module is used for computing each electronic ticket in the electronic ticket particle swarm in parallel according to a fitness function and determining the fitness of each electronic ticket;
and the optimal electronic ticket determining module is used for determining the optimal electronic ticket according to the fitness of each electronic ticket.
6. The apparatus of claim 5, wherein the electronic ticket population establishing module is specifically configured to:
inquiring and acquiring all electronic tickets according to the client number;
initializing all electronic coupons as particles, selecting a group of random electronic coupons as an initial particle group, and establishing an electronic coupon particle group.
7. The apparatus of claim 5, wherein the fitness function establishing module is specifically configured to: the fitness function is established as follows:
f(x,v)=x2+x+v
wherein f (x, v) is fitness; x is the position of the particle; v is the velocity of the particle.
8. The apparatus of claim 5, wherein the optimal electronic ticket determination module is specifically configured to:
and iteratively comparing the fitness of each electronic ticket, and taking the electronic ticket with the minimum fitness value as the optimal electronic ticket.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing a method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110594784.5A CN113205173A (en) | 2021-05-28 | 2021-05-28 | Electronic ticket selection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110594784.5A CN113205173A (en) | 2021-05-28 | 2021-05-28 | Electronic ticket selection method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113205173A true CN113205173A (en) | 2021-08-03 |
Family
ID=77023565
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110594784.5A Pending CN113205173A (en) | 2021-05-28 | 2021-05-28 | Electronic ticket selection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113205173A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018176596A1 (en) * | 2017-03-31 | 2018-10-04 | 深圳市靖洲科技有限公司 | Unmanned bicycle path planning method based on weight-improved particle swarm optimization algorithm |
CN108832627A (en) * | 2018-07-09 | 2018-11-16 | 北京科东电力控制系统有限责任公司 | A kind of energy conservation and environmental protection power purchase method and device based on particle swarm algorithm |
CN110930182A (en) * | 2019-11-08 | 2020-03-27 | 中国农业大学 | Improved particle swarm optimization algorithm-based client classification method and device |
CN112328600A (en) * | 2020-11-16 | 2021-02-05 | 北京首汽智行科技有限公司 | Electronic coupon management method |
-
2021
- 2021-05-28 CN CN202110594784.5A patent/CN113205173A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018176596A1 (en) * | 2017-03-31 | 2018-10-04 | 深圳市靖洲科技有限公司 | Unmanned bicycle path planning method based on weight-improved particle swarm optimization algorithm |
CN108832627A (en) * | 2018-07-09 | 2018-11-16 | 北京科东电力控制系统有限责任公司 | A kind of energy conservation and environmental protection power purchase method and device based on particle swarm algorithm |
CN110930182A (en) * | 2019-11-08 | 2020-03-27 | 中国农业大学 | Improved particle swarm optimization algorithm-based client classification method and device |
CN112328600A (en) * | 2020-11-16 | 2021-02-05 | 北京首汽智行科技有限公司 | Electronic coupon management method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Victor et al. | Detecting and quantifying wash trading on decentralized cryptocurrency exchanges | |
CN106156092B (en) | Data processing method and device | |
CN110263821B (en) | Training of transaction feature generation model, and method and device for generating transaction features | |
CN110866771A (en) | Information processing method, system, medium, and computer system | |
US20150046218A1 (en) | Trend-factored rfm scores to improve campaign performance | |
CN114902273A (en) | System and method for optimizing resource allocation using GPU | |
US8924275B2 (en) | Hybrid multi-thread and multi-process computer simulation system and method | |
CN107146158A (en) | A kind of electronic data processing method and device | |
CN112182250A (en) | Construction method of checking relation knowledge graph, and financial statement checking method and device | |
CN110969350A (en) | Product information recommendation method and device, electronic equipment and storage medium | |
CN112613997A (en) | Method and apparatus for forecasting combined investment of money fund | |
US20140025454A1 (en) | Early Payment Rewards System and Method | |
CN112035681B (en) | Method and device for determining credit card rate information based on knowledge graph | |
CN114841820A (en) | Transaction risk control method and system | |
CN106708875A (en) | Characteristic screening method and system | |
Guajardo et al. | A forecasting methodology using support vector regression and dynamic feature selection | |
CN113205173A (en) | Electronic ticket selection method and device | |
CN110428278A (en) | Determine the method and device of resource share | |
CN111753386A (en) | Data processing method and device | |
CN111026933B (en) | Content recommendation method and device, electronic equipment and storage medium | |
CN109583964B (en) | Advertisement putting method and device | |
CN109472704A (en) | Screening technique, terminal device and the medium of fund product neural network based | |
CN109191056A (en) | The indicating means and system that certificate uploads | |
CN110610409A (en) | Order processing method and device and computer equipment | |
CN115829711A (en) | Method and device for determining fund transfer pricing of borrowing transaction |
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 |