Automatic expected data calculation method, system, equipment and medium
The itertools library algorithm is used to achieve fast and accurate calculation of the number of bets and winning amounts of sports lottery users in multiple matches, solving the problems of low computing efficiency and poor accuracy in the existing technology, and providing intuitive betting decision support.
Patent Information
- Application Number
- CN202510447067.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-07-29
AI Technical Summary
The existing technology is difficult to quickly and accurately calculate the number of bets and winning amounts of sports lottery users in multiple matches, especially for users with low education levels. Manual calculations are cumbersome and prone to errors. The existing tools are not intuitive and inefficient.
The expected data automation calculation method is adopted, and the itertools library algorithm is used to calculate the game odds and bet amounts selected by the user through scripts, organize the data and assemble it and call the function for calculation, and finally visually display the results on the user side.
Improves computing efficiency and accuracy, avoids manual errors, is suitable for large-scale computing scenarios, and provides strong betting decision support.
Smart Images

Figure CN120387078A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to an automated calculation method, system, device and medium for expected data. Background Art
[0002] In the field of sports lottery, for the majority of lottery fans, accurately calculating the possible winnings and the required betting amounts for their multiple-choice parlay bets has always been a difficult problem. Traditionally, due to the complexity of manual calculation, a large number of sports lottery users in China have often been limited to betting on single bets or a very small number of parlay bets. This is because only in such simple betting methods can users relatively easily calculate the funds they need to invest or the possible winning amounts.
[0003] However, this traditional manual calculation method or existing calculation tools cannot quickly and intuitively display the user's betting amounts and the possible winnings. On the one hand, the manual calculation process is cumbersome and error-prone. Especially when users want to bet on a large number of multi-parlay games, not only does it take a lot of time, but it is also easy to get inaccurate results due to calculation errors. On the other hand, existing calculation tools may not be intuitive enough for users to clearly see the results they want.
[0004] More notably, this calculation method has relatively high requirements for the user's educational level. When the user's educational level is low, it is difficult to require them to calculate a large number of data combinations, so they cannot accurately obtain the betting amounts and winning amounts. In addition, as the amount of parlay data increases, the method of manual calculation or relying on simple calculation tools becomes increasingly impractical, with low efficiency and easy to make mistakes.
[0005] In summary, although manual calculation is still feasible in some cases, with the growing demand of users to bet on more games to view the parlay betting amounts and winning amounts, this method has become inadequate. Therefore, it is particularly important to develop an automated script or tool that can quickly and accurately calculate the betting amounts and winnings in multiple games. Summary of the Invention
[0006] The purpose of the present invention is to provide an automated calculation method, system, device and medium for expected data, so as to solve all or one of the above problems existing in the prior art.
[0007] To solve the above technical problems, the specific technical solutions of the present invention are as follows: On the one hand, the present invention provides an automated calculation method for expected data, including the following steps: Determine the expected calculation event; Sort out the expected data calculation elements according to the event information of the expected calculation event; Assemble the data of the expected data calculation elements; Call the expected data calculation function to calculate the expected data based on the assembled data; Display the calculated expected data on the user side.
[0008] Furthermore, the event information of the event calculated according to the expectation, and the expected data calculation elements are sorted out, including: Record the number of game sessions of the event calculated according to the expectation; Record the odds values of the selected options related to the event calculated according to the expectation; Sort the number of game sessions and the betting odds of the event calculated according to the expectation into a list as the calculation elements.
[0009] Furthermore, the event information of the event calculated according to the expectation, and the expected data calculation elements are sorted out, further including: Sort the odds values into an array form according to the number of game sessions.
[0010] Furthermore, the assembling of the expected data calculation elements includes: Assemble the game odds of the event calculated according to the expectation according to the calculation elements; Determine the betting amount of the event calculated according to the expectation; Use the betting amount and the assembled game odds as the assembled data.
[0011] Furthermore, the data form of the assembled data includes: The number of selected game sessions, [odds values formed into an array structure according to the number of game sessions], betting amount.
[0012] Furthermore, the calling of the expected data calculation function to calculate the expected data based on the assembled data includes: Input the assembled data into the itertools.combinations code function for calculation.
[0013] Furthermore, the calculation logic of the itertools.combinations code function includes: Initialization: Convert each element in odds_list to a floating point number, initialize the list containing the initial single-bet amount, and calculate the total number of combinations; Calculate the combined odds: Use nested loops to traverse different combinations; For each combination, calculate the combined odds combo_odds and store it in combos_max; Output the combination information: Print the betting combination and the corresponding odds of the current combination; Calculate the resulting odds: store the maximum odds of each combination in result_odds_max; Calculate minimum and maximum system odds; Calculate the total bet amount; Calculate the minimum possible benefit; Calculate the maximum possible profit; The minimum and maximum system odds, the minimum possible return and the maximum possible return are used as the calculated expected data.
[0014] In another aspect, the present invention further provides a system for automatically calculating expected data, comprising: The event determination module is used to: determine the expected calculation event; An element arrangement module is used to: arrange expected data calculation elements according to the event information of the expected calculation event; A data assembly module is used to: assemble the expected data calculation elements; The data calculation module is used to: call the expected data calculation function to perform expected data calculation based on the assembled data; The result display module is used to display the calculated expected data on the user side.
[0015] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method for automatically calculating expected data when executed by a processor.
[0016] On the other hand, the present invention further provides a computer device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; wherein: The memory is used to store computer programs; The processor is used to execute the steps of the method for automatically calculating expected data by running the program stored in the memory.
[0017] The beneficial effects of the technical solution of the present invention are: 1. The automated calculation method for expected data described in the present invention can greatly improve calculation efficiency through script calculation. Lottery ticket buyers no longer need to manually or use a calculator to calculate the number of bets and the winning amount one by one. They only need to simply enter a few key values, and the script can quickly and automatically calculate the required results, greatly saving time and energy.
[0018] 2. The automated calculation method for expected data according to the present invention can significantly improve the calculation accuracy through script calculation, effectively avoiding calculation errors and data inaccuracies that may be caused by various reasons during manual calculation, thereby ensuring that the decision-making basis for user betting is more reliable and improving the betting accuracy.
[0019] 3. The automated calculation method for expected data according to the present invention can be applied to large-scale calculation scenarios through script calculation. Even when facing the calculation requirements of dozens or even hundreds of multi-game parlays, the script can easily complete the calculation within just a few seconds, which benefits from the powerful data processing ability of the itertools library algorithm; by assembling and disassembling the user input data information and through the efficient processing of professional algorithms, it can quickly and accurately calculate each possibility and intuitively present the results to the user, providing strong data support for the user's decision-making.
[0020] 4. The automated calculation system for expected data according to the present invention can, through the mutual cooperation of system modules, further implement the automated calculation method for expected data according to the present invention.
[0021] 5. The computer-readable storage medium according to the present invention can guide the system modules to cooperate, thereby implementing the automated calculation method for expected data according to the present invention, and the computer-readable storage medium according to the present invention also effectively improves the operability of the automated calculation method for expected data.
[0022] 6. The computer device according to the present invention can store and execute the computer-readable storage medium, thereby implementing the automated calculation method for expected data according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0024] Figure 1 It is an exemplary schematic diagram of step S100 in the automated calculation method for expected data according to Embodiment 1 of the present invention; Figure 2 It is an exemplary schematic diagram of step S200 in the automated calculation method for expected data according to Embodiment 1 of the present invention; Figure 3 It is an exemplary schematic diagram of step S300 in the automated calculation method for expected data according to Embodiment 1 of the present invention; Figure 4 It is a schematic diagram of an example of step S400 in the automated calculation method of expected data described in Embodiment 1 of the present invention; Figure 5 It is a partial schematic diagram of an example of step S500 in the automated calculation method of expected data described in Embodiment 1 of the present invention; Figure 6 It is a partial schematic diagram of an example of step S500 in the automated calculation method of expected data described in Embodiment 1 of the present invention; Figure 7 It is a schematic flow chart of the automated calculation method of expected data described in Embodiment 1 of the present invention; Figure 8 It is a schematic architecture diagram of the automated calculation system of expected data described in Embodiment 2 of the present invention; Figure 9 It is a schematic structural diagram of the computer device described in Embodiment 4 of the present invention; The reference numerals in the drawings are explained as follows: 1501, processor; 1502, communication interface; 1503, memory; 1504, communication bus. Detailed implementation manners
[0025] The following elaborates on the preferred embodiments of the present invention in conjunction with the drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0026] In the description of the present invention, it should be noted that the embodiments described in the present invention are some embodiments of the present invention, rather than all embodiments; based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present invention.
[0027] The terms "first", "second", etc. in the specification, claims and above-mentioned drawings of this article are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.
[0028] In the description of the present invention, it should be noted that the present invention uses the big data professional processing library itertools in the Python language to calculate the betting quantity and amount of the parlay games selected by the user. Embodiment 1
[0029] This embodiment provides an automated calculation method for expected data, as Figures 1 to 7 shown, including the following steps: S100. Select betting games, including: S101. The user selects the win-draw-loss parlay games to bet on at the official sports lottery or other betting channels.
[0030] For example, as Figure 1 shown, the user selects 8 games, the yellow options are the selected ones, and each option has a corresponding odds value.
[0031] S200. Record betting information, including: S201. Record the number of selected game sessions.
[0032] S202. Record the odds value of each selected option.
[0033] S203. Organize the betting sessions, betting amount (the specific amount can be not recorded for now, which will be involved in subsequent steps), and the odds of the bet in the form of a list (Python data format).
[0034] For example, as Figure 2 shown, if 8 games are selected and the odds values are [5.8, 2.32, 3.5, 3.9, 1.88, 3.75, 1.95, 3.35], organize them in the form of a list and remember.
[0035] S300. Assemble data and prepare for input, including: S301. After confirming the games to bet on (i.e., the expected calculation events), assemble the game odds.
[0036] S302. Determine the betting amount (for example, assume the betting amount is 20 yuan).
[0037] S303. Prepare to input the data of the betting games in the corresponding input box of the tool.
[0038] For example, as Figure 3 shown, taking the selection of 8 games, odds values [5.8, 2.32, 3.5, 3.9, 1.88, 3.75, 1.95, 3.35], and a betting amount of 20 yuan as an example.
[0039] S400. Input data and calculate, including: S401. Input the assembled list of match odds and the bet amount into the corresponding data calculation box.
[0040] S402. Click the calculation button.
[0041] S403. The background Python code starts to operate and uses the itertools.combinations code function for calculation.
[0042] For example, as Figure 4 shown, after inputting the above example data and clicking the calculation button, the code starts to execute the calculation logic.
[0043] Specifically, the specific calculation logic of the code function is as follows: (1) Initialization and preparation work: i) odds_list_float: Convert each element in odds_list to a floating-point number.
[0044] ii) sys_stake: Initialize a list containing the initial single-bet amount.
[0045] iii) total_combinations: Calculate the total number of combinations.
[0046] (2) Calculate the combined odds: i) Use nested loops to iterate through different numbers of combinations (from 2 selections to the number of match selections for a single combination).
[0047] ii) For each combination, calculate the combined odds combo_odds, round it to 4 decimal places, and store it in combos_max.
[0048] (3) Output the combination information: i) Print the bet combination and the corresponding odds for the current combination.
[0049] (4) Calculate the result odds: i) Store the maximum odds of each combination in result_odds_max.
[0050] (5) Calculate the minimum and maximum system odds: i) min_odds: Initialize it as the minimum single-bet odds.
[0051] ii) max_odds: Initialize it as the maximum single-bet odds.
[0052] (6) Calculate the total bet amount: i) total_stake: Calculate the total amount of all bets.
[0053] (7)Calculate possible returns: i) result['total_stake_amount']: Calculate the total stake amount.
[0054] ii) min_possible_payout: Calculate the minimum possible return, rounded to 0.00.
[0055] iii) max_possible_payout: Calculate the maximum possible return, rounded to 0.00.
[0056] S500. View the calculation results, including: S501. After calculation by the code script, wait for the combined data information after calculation to be presented on the page.
[0057] For example, as attached Figure 5 ~Attached Figure 6 shown, the page intuitively shows the number of bets for different parlay combinations (such as 2-way parlay, 3-way parlay, etc.) in 8-game parlays. For example, there are 28 bets for 2-way parlay, 56 bets for 3-way parlay, 70 bets for 4-way parlay, 56 bets for 5-way parlay, 28 bets for 6-way parlay, 8 bets for 7-way parlay, 1 bet for 8-way parlay, etc. (refer to attached Figure Five , Figure Six ); among them, calculate the maximum possible winning amount. For example, the maximum possible winning amount is 249,374.24 yuan, which facilitates users to make decisions when placing bets.
[0058] It should be noted that the above examples are only for explaining the present invention and should not limit the protection scope of the present invention. Example 2
[0059] This example provides an expected data automatic calculation system based on the same inventive concept as the expected data automatic calculation method described in Example 1. As Figure 8 shown, it includes: A game determination module for determining the game for expected calculation; An element arrangement module for arranging the elements for expected data calculation according to the game information of the game for expected calculation; A data assembly module for assembling the elements for expected data calculation; A data calculation module for calling an expected data calculation function to calculate expected data based on the assembled data; A result display module for displaying the calculated expected data on the user side. Example 3
[0060] This example provides a computer-readable storage medium, including: The storage medium is used to store computer software instructions for implementing the automated calculation method of the desired data described in the above Embodiment 1, and it includes a program set for the automated calculation method of the desired data; specifically, the executable program can be built into the automated calculation system of the desired data described in Embodiment 2. In this way, the automated calculation system of the desired data can implement the automated calculation method of the desired data described in the above Embodiment 1 by executing the built-in executable program.
[0061] In addition, the computer-readable storage medium of this embodiment can adopt any combination of one or more readable storage media, where the readable storage medium includes systems, devices or components of electricity, light, electromagnetism, infrared rays or semiconductors, or any combination of the above. Embodiment 4
[0062] This embodiment provides an electronic device. As Figure 9 shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504. Among them, the processor 1501, the communication interface 1502, and the memory 1503 complete mutual communication through the communication bus 1504.
[0063] The memory 1503 is used to store a computer program; The processor 1501, when executing the computer program stored on the memory 1503, implements the steps of the automated calculation method of the desired data described in the above Embodiment 1.
[0064] As an implementation manner of the present invention, the communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 9 only a thick line is shown in [the figure], but it does not mean that there is only one bus or one type of bus.
[0065] As an implementation manner of the present invention, the communication interface is used for communication between the above terminal and other devices.
[0066] As an implementation manner of the present invention, the memory may include a random access memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0067] As an implementation manner of the present invention, the aforementioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0068] Different from the prior art, by adopting a method, system, device and medium for automated calculation of expected data in this application, the betting quantity and winning amount of accumulator bets can be quickly and accurately displayed through script calculation, improving the calculation efficiency, avoiding human errors, and being applicable to large-scale calculations. Using the itertools library algorithm, each possibility is intuitively presented, providing strong support for betting decisions.
[0069] It should be understood that in various embodiments herein, the sequence numbers of the above processes do not mean the order of execution is prior or subsequent. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments herein.
[0070] It should also be understood that in the embodiments herein, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.
[0071] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this article.
[0072] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0073] In the several embodiments provided in this article, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can also be in the form of electrical, mechanical, or other connections.
[0074] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments in this article.
[0075] In addition, the functional units in the various embodiments of this article can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0076] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution herein, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments herein. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0077] The foregoing are only embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent structural or equivalent process transformations made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, are equally included in the patent protection scope of the present invention.
Claims
1. An automated calculation method for expected data, characterized in that, It includes the following steps: Determine the expected calculation event; Sort out the expected data calculation elements according to the event information of the expected calculation event; Perform data assembly on the expected data calculation elements; Call the expected data calculation function to calculate the expected data based on the assembled data; Display the calculated expected data on the user side.
2. The automated calculation method for expected data according to claim 1, wherein: The sorting out of the expected data calculation elements according to the event information of the expected calculation event includes: Record the number of game sessions of the expected calculation event; Record the odds values of the selected options related to the expected calculation event; Sort the number of game sessions and the betting odds of the expected calculation event in a list form as the calculation elements.
3. The automated calculation method for expected data according to claim 2, wherein: The sorting out of the expected data calculation elements according to the event information of the expected calculation event further includes: Sort the odds values in an array form according to the number of game sessions.
4. The automated calculation method for expected data according to claim 1, wherein: The performing of data assembly on the expected data calculation elements includes: Assemble the game odds of the expected calculation event according to the calculation elements; Determine the betting amount of the expected calculation event; Take the betting amount and the assembled game odds as the assembled data.
5. The automated calculation method for expected data according to claim 4, wherein: The data form of the assembled data includes: The number of selected game sessions, [odds values formed into an array structure according to the number of game sessions], betting amount.
6. The automated calculation method for expected data according to claim 1, wherein: The calling of the expected data calculation function to calculate the expected data based on the assembled data includes: Input the assembled data into the itertools.combinations code function for calculation.
7. The automated calculation method for expected data according to claim 6, wherein: The calculation logic of the itertools.combinations code function includes: Initialization: Convert each element in odds_list to a floating point number, initialize the list containing the initial single bet amount, and calculate the total number of combinations; Calculate the combined odds: Use nested loops to traverse different numbers of combinations; For each combination, calculate the combined odds combo_odds and store it in combos_max; Output the combination information: Print the betting combination and the corresponding odds of the current combination; Calculate the result odds: Store the maximum odds of each combination in result_odds_max; Calculate the minimum and maximum system odds; Calculate the total betting amount; Calculate the minimum possible profit; Calculate the maximum possible profit; Take the minimum and maximum system odds, the minimum possible profit, and the maximum possible profit as the calculated expected data.
8. An automated computing system for expected data, characterized in that, It includes: An event determination module for: determining the expected calculation event; Element sorting module, configured to: sort the expected data calculation elements according to the event information of the event calculated as expected; Data assembly module, configured to: perform data assembly on the expected data calculation elements; Data calculation module, configured to: call the expected data calculation function to perform expected data calculation according to the assembled data; Result display module, configured to: display the calculated expected data on the user side.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the expected data automatic calculation method according to any one of claims 1 to 7 are implemented.
10. A computer device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; where: The memory is used to store a computer program; The processor is configured to execute the steps of the expected data automatic calculation method according to any one of claims 1 to 7 by running the program stored on the memory.