A data processing method and device thereof
By starting from the starting object at the preset position during the draw, the problem of huge amount of data traversal and excessive time in the existing serial draw method is solved, and a more efficient draw process is achieved.
Patent Information
- Application Number
- CN202010633383.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-02
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-07-02
AI Technical Summary
The existing serial lottery method faces a large number of users and limited bills, resulting in a huge amount of data traversal and taking too long.
By obtaining the lottery target list of objects, sorting according to the preset sorting method, in response to satisfying the preset conditions, a second traversal is performed from the starting object at the preset position, reducing the traversal amount and shortening the traversal time.
While ensuring the existing lottery rules, the traversal amount of the original traversal is reduced and the traversal time is shortened, which improves the efficiency of the lottery process.
Smart Images

Figure CN113888248B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method and device thereof. Background Art
[0002] With the rapid development and promotion of Internet technology, more and more users tend to buy tickets online, where online ticket purchase refers to buying tickets using the ticketing system of electronic terminals.
[0003] Online ticket purchases often face the situation where the number of buyers exceeds the number of tickets. For example, the number of people who want to buy tickets for a certain sports event is far greater than the number of tickets. In this case, a serial lottery method can usually be used to determine the users who are eligible to buy tickets. Simply put, the lottery applications of all users can be randomly sorted by user, and then each volunteer of each user can be traversed in sequence according to the user sorting order. When traversing the current volunteer, if the number of tickets in stock corresponding to the current volunteer is greater than the number of current applications, the user is allocated a ticket, and the other volunteers of the user are skipped, and the lottery application of the next user is traversed; if the number of tickets in stock is not greater than the number of current applications, the user is not eligible to purchase and after traversing all users for the current volunteer, continue to traverse the other volunteers of the user until there are no untraversed volunteers, and repeat the above process until all volunteers of all users have been traversed.
[0004] It can be seen that the data traversal amount of the above serial lottery method is huge and will take a long time. Therefore, a technical solution is needed to reduce the traversal amount of the serial lottery method and shorten the traversal time. Summary of the invention
[0005] The embodiments of the present application provide a data processing method and a device thereof, which are at least used to solve the above-mentioned technical problems.
[0006] An embodiment of the present application also provides a data processing method, which includes obtaining a drawing target list of at least one object, wherein the drawing target list includes at least one drawing target; during a first traversal of the at least one object for a current drawing target, in response to satisfying a preset condition, a second traversal is performed starting from a starting object at a preset position.
[0007] An embodiment of the present application also provides a data processing method, which includes: when a video anchor terminal provides at least one product, obtaining a product wish list of the at least one user terminal from at least one user terminal, wherein the product wish list includes a list of products selected by each user terminal from the at least one object; during a first traversal of the at least one user terminal for the current lottery product, in response to satisfying a preset condition, performing a second traversal starting from a starting user terminal at a preset position.
[0008] The embodiment of the present application also provides a computer-readable storage medium on which computer instructions are stored, and the above method is implemented when the instructions are executed.
[0009] An embodiment of the present application also provides a data processing device, which includes: a processor; and a memory arranged to store computer-executable instructions, and when the executable instructions are executed, the processor executes the above method.
[0010] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:
[0011] According to the data processing method of the exemplary embodiment of the present application, by determining a new traversal starting point from the at least one object during the traversal of the at least one object and traversing these objects, the traversal amount of the original traversal can be reduced and the traversal time can be shortened while ensuring the existing lottery rules. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0013] Figure 1 is a scene diagram for performing a lottery operation according to an exemplary embodiment of the present application;
[0014] Figure 2 is a flowchart of steps of a data processing method according to an exemplary embodiment of the present application;
[0015] Figure 3 is a diagram of a data processing method according to an exemplary embodiment of the present application;
[0016] Figure 4 is a block diagram of a data processing device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0018] The following is a detailed description of the technical solutions provided by each embodiment of the present application in conjunction with the accompanying drawings. The data processing method of the exemplary embodiment of the present application can be applied to a situation where a large number of users apply for a lottery and each user can submit a lottery application form including multiple lottery targets (hereinafter referred to as a lottery target list). In the present application, winning the lottery means that the user can be selected to be eligible to obtain these lottery targets.
[0019] Based on this, the data processing method can be applied to sports events. For example, for Olympic tickets, each user can fill in at least one Olympic ticket that he or she wishes to apply for in the lottery application form, and the data processing method of the exemplary embodiment of the present application can be used to determine the users who can win these tickets. In addition, the data processing method can also be applied to the course selection system. For example, each student can fill in the courses that he or she wishes to choose in the course selection list, and the exemplary embodiment of the present application can be used to determine the students who win each course. In addition, the data processing method can also be applied to more scenarios that meet the above requirements.
[0020] In order to better describe the present application, the following Figure 1 A scene diagram of a lottery operation performed using an exemplary embodiment of the present application in a sports event. Figure 1 In the scenario of executing a lottery operation shown in , user A, user B and user C submit respective lottery application forms 10 to 30 through their respective electronic devices, and the lottery targets in each lottery application form may be the same or different.
[0021] Specifically, the lottery application form submitted by user A includes the expected winning lottery targets of opening ceremony tickets, basketball final tickets, football final tickets and closing ceremony tickets; the lottery application form submitted by user B includes the expected winning lottery targets of opening ceremony tickets, basketball final tickets and figure skating tickets; the lottery application form submitted by user C includes the expected winning lottery targets of opening ceremony tickets and closing ceremony tickets.
[0022] After obtaining the lottery application forms submitted by each user, the computer system 100 may sort the lottery application forms. For example, the lottery application forms may be sorted according to the time sequence in which each user submits the lottery application forms. In this application, the arrangement order of each lottery application form may correspond to the probability of winning the lottery for each lottery target in each lottery application form. For example, if lottery application form 10 is ranked before lottery application form 20 in the order, user 10 will win the lottery if there is only one opening ceremony ticket.
[0023] Figure 1 The computer system 100 in the embodiment refers to a system that uses at least one electronic device with computing capabilities to provide various functions in a specific manner (e.g., distributed, etc.). It should be noted that Figure 1 The computer system 100 in the figure is merely exemplary, and there may be a case where the data processing method of the exemplary embodiment of the present application is implemented by only a single computer.
[0024] For ease of description, assume that Figure 1 The order of the lottery application forms in the lottery application form is lottery application form 10, lottery application form 20, and lottery application form 30. Then, the computer system 100 can traverse the first lottery target (i.e., the opening ceremony ticket) in the lottery application form 10, that is, the computer system 10 can determine whether the opening ceremony inventory meets the current lottery target. If the current lottery target is met, the opening ceremony ticket is allocated to the user 10, and the lottery application form 10 is placed in the lottery pool to wait for the next round of lottery.
[0025] If the computer system 10 can determine that the opening ceremony inventory does not meet the current lottery target, that is, the user 10 did not win the opening ceremony ticket, the computer system can directly traverse the second lottery target (that is, the basketball final ticket) in the lottery application form 10. If the current lottery target is met, the basketball final ticket is allocated to the user 10, and the lottery application form 10 is placed in the lottery pool waiting for the next round of lottery.
[0026] If the computer system 10 can determine that the basketball final ticket does not meet the current lottery target, that is, the user 10 did not win the basketball final ticket, the computer system can directly traverse the third lottery target (that is, the football final ticket) in the lottery application form 10. If the current lottery target is met, the football final ticket is allocated to the user 10, and the lottery application form 10 is placed in the lottery pool waiting for the next round of lottery.
[0027] If the computer system 10 can determine that the inventory of football final tickets does not meet the current lottery target, that is, user 10 has not won a football final ticket, the computer system can directly traverse the fourth lottery target (i.e., closing ceremony ticket) in the lottery application form 10. If the current lottery target is met, the closing ceremony ticket is allocated to user 10, and the above traversal is performed on the lottery application form 20 of user B who is ranked behind user A.
[0028] If the current lottery target is not met, that is, all lottery targets in the lottery application form 10 of user A are not won, the above traversal is performed on the lottery application form 20 of user B who is behind user A.
[0029] It can be seen from the above description that in the scenario of executing the lottery operation of the exemplary embodiment of the present application, each lottery is traversed on a user-by-user basis, and the lottery application form of each user can be processed only when the user wins the current lottery target or none of the lottery targets on the lottery application form of the user wins. In the case where there are many users participating in the lottery and each user can choose many lottery targets, the above method will result in a huge amount of data for the lottery and a long lottery time.
[0030] In order to solve the above problems, the data processing method of the present application can add a new traversal starting point and use the existing traversal results to filter the objects after the traversal starting point without affecting the current traversal method, thereby reducing the traversal amount of the original traversal and shortening the traversal time. Figure 2 The data processing method of the exemplary embodiment of the present application is described in detail.
[0031] Figure 2 is a flowchart of the steps of a data processing method according to an exemplary embodiment of the present application.
[0032] In step S210, a lottery target list of at least one object is obtained, wherein the lottery target list includes at least one lottery target. In the present application, the at least one object refers to a user or group (e.g., a company, a community, etc.) that issues a lottery application for a lottery target, and the lottery target refers to a target that issues a lottery application, such as concert tickets, elective courses, various sports event tickets, movie tickets, etc.
[0033] In implementation, the method may first sort the objects according to the object sorting method, and then perform subsequent processing on the objects according to the sorted order. As an example, the object sorting method may include a shuffling algorithm, wherein the shuffling algorithm scatters the order of the objects so that the probability of each object appearing in each position after the shuffling is the same.
[0034] Preferably, the following shuffling algorithm can be used to sort these objects. These randomly sorted objects can be regarded as the original team, and a certain object (for example, the fourth object) is randomly selected from them and moved to the end of the team, and then another object (for example, the third object) is selected from the original team before the object and moved to the end of the team, and so on, until only one object is retained in the original team.
[0035] In addition, the object sorting method may also include various specific sorting methods specified by the user. For example, the objects may be sorted according to the time when each object submits the volunteer application form, or objects that meet specific conditions may be placed in front, for example, objects whose ticket application date is the same as their birthday may be placed in front.
[0036] In an exemplary embodiment of the present application, the object sorting method includes sorting according to the probability of the at least one object being drawn, that is, the sorting of each object may indicate the probability of each object being drawn.
[0037] Step S220 is executed to perform a second traversal starting from a starting object at a preset position in response to a preset condition being met during the first traversal of the at least one object for the current lottery target.
[0038] Specifically, for the current lottery target, the winning information of each object can be determined in sequence according to the sorted order. In implementation, it can be determined whether the inventory of the current lottery target satisfies the current object in units of objects. If it satisfies, the winning information of the current object is determined and the next object of the current object is traversed. For example, if there are still 5 in the inventory of the current lottery target when traversing the current object, it is determined that the current object has won the lottery and the next object of the current object is traversed.
[0039] Subsequently, in response to satisfying a preset condition, a new traversal (i.e., a second traversal) is performed on the remaining objects starting from the starting object at the preset position, wherein the preset condition includes that the process of performing the traversal on the at least one object for the current lottery target has reached a threshold, for example, 10%. And the remaining objects refer to the objects of the at least one object starting from the starting object.
[0040] In addition, according to an exemplary embodiment of the present application, once the preset condition is met, a new starting object can be added and a new traversal can be performed on the remaining objects starting from the new starting object. In other words, multiple starting objects may be generated and multiple parallel second traversals may be performed starting from the multiple starting objects.
[0041] For example, the preset condition can be set to that whenever the process of traversing the at least one object for the current lottery target has reached 15%, the starting object can be determined and the traversal can be started from the starting object when the process reaches 15%, and when the process reaches 30%, the starting object can be determined and the traversal can be started from the object, and so on.
[0042] As an example, in response to the process of traversing the at least one object for the current drawing target reaching 10%, the starting object of a preset position can be determined, wherein the preset position can be a position selected by a technician from a queue in which these objects are arranged, optionally, the preset position can be the last position in the queue, or the preset position can be a position in the queue where the traversal has been performed with 25% increase.
[0043] According to a preset traversal order, the winning information of the starting object is determined and the next object of the starting object is traversed, wherein the preset traversal order includes a forward traversal order and a reverse traversal order. Therefore, the remaining objects can be more specifically indicated as other objects of the at least one object starting from the starting object along the preset traversal order.
[0044] In implementation, for the current lottery target, the first object whose winning information for the current lottery target indicates that the lottery is not won is determined starting from the starting object. In this way, during the traversal of the at least one object for the current lottery target, the first object is directly skipped.
[0045] Alternatively, starting from the starting object, it is determined that the winning information of the lottery targets in the lottery target list all indicate the second object that did not win the lottery. In this way, during the traversal of the at least one object for each lottery target, the second object is directly skipped.
[0046] That is, after determining the winning information of each object by traversing from the starting object, objects that do not win the lottery only for the current lottery target can be determined from these objects and skipped when drawing lots for the current lottery target. Alternatively, after determining the winning information of each object by traversing from the starting object, objects that do not win the lottery for each lottery target in their lottery application form can be determined from these objects, including the case where the lottery application form of the object only includes a single lottery target. Then, skip these objects when traversing for various lottery targets.
[0047] As an example, traversing the current lottery target from the starting object at the preset position includes taking the last-ordered object as the starting object and traversing the objects that have not been traversed for the current lottery target in reverse order from back to front.
[0048] As an example, traversing the current lottery target starting from the starting object at a preset position includes traversing the objects that have not been traversed for the current lottery object from front to back by adding the objects with a preset interval backward as the starting objects. For example, if the current lottery object has been traversed to 20% of the queue, the objects that have not been traversed for the current lottery object can be traversed from front to back starting from 50% of the queue.
[0049] In addition, for the current object, after determining that the winning information for the current lottery target indicates that the lottery is not won, the next lottery target to be traversed is determined from the lottery target list corresponding to the current object, and the execution is repeated. Figure 2 The data processing method shown is performed until any lottery target in the lottery target list in the current object has been traversed.
[0050] In implementation, a separate thread (which may be referred to as a main thread) may be used to traverse the at least one object for the current draw target, wherein the thread is the smallest unit during program execution and is the basic unit that can be scheduled and allocated by a central processing unit (CPU). In this case, in response to satisfying a preset condition, a secondary thread is created and the secondary thread traverses the current draw target from the starting object at a preset position.
[0051] In implementation, the main thread can traverse these objects forward according to the inventory of the current lottery target to determine whether these objects have won the lottery, while the secondary thread can determine and filter out the objects that have not won the lottery from the starting object forward or reverse according to the inventory quantity traversed by the main thread.
[0052] When the main thread determines that the current object does not win the lottery for the current lottery target based on the inventory of the current lottery target, the secondary thread can be used to identify the objects that include the current lottery target in the lottery application form and set the lottery information of these objects for the current lottery target as not winning. If the lottery application forms of these objects only include the current lottery target, these objects can be directly filtered out without traversing them.
[0053] As described above, during the main thread's traversal of these objects for the current lottery target, multiple secondary threads may be generated, wherein the starting positions and execution orders of these secondary threads are different. When these secondary threads start from their respective starting objects and traverse these objects in their respective orders, the inventory of the current lottery target at the beginning of the traversal may be used to determine the winning information.
[0054] In summary, the data processing method according to the exemplary embodiment of the present application can reduce the traversal amount of the original traversal and shorten the traversal time while ensuring the existing lottery rules by determining a new traversal starting point from the at least one object during the traversal of the at least one object and traversing these objects. Furthermore, multiple processes can be added to perform traversal for the same target object at the same time, thereby shortening the time consumption. Furthermore, objects that do not win all lottery targets can be screened out from all objects, thereby shortening the traversal time. Furthermore, objects that do not win the current lottery target can be screened out from all objects, thereby shortening the traversal time.
[0055] In order to better understand this application, the following Figure 3 Give a description. Figure 3 FIG. 1 is a diagram showing a data processing method according to an exemplary embodiment of the present application. Figure 3 As shown in the figure, suppose there are 10 subjects who have uploaded their own lottery application forms, and each subject is represented by a small black person in the figure. In addition, for the convenience of description, Figure 3 The lottery application form shown in FIG. 1 is a diagram showing a traversal only for the current lottery target (eg, opening ceremony tickets).
[0056] In implementation, all objects or lottery application forms of all objects may be arranged in a preset arrangement to form a queue 301, and the probability of winning the lottery of each black person in the queue 301 decreases from left to right.
[0057] Figure 3 The middle arrow 310 indicates the progress of the traversal, and the user's lottery application form is traversed from left to right. For the same lottery target, the arrow 310 is used to determine whether the current user has won the lottery. If the user has won the lottery, the black man will be marked as a gray man, and if the user has not won the lottery, no processing will be done. Figure 3 As shown, object 3020 of queue 302 and object 3030 of queue 303 are marked as little gray men.
[0058] As an example, when arrow 310 traverses more than 30% of queue 301, queue 301 may be traversed from the end of the queue, such as Figure 3 As shown, it can be known from the position of arrow 310 (object 3023) that more than 30% has been traversed, and a reverse traversal starting from object 3029 indicated by arrow 320 is added to determine whether object 3029 has won the lottery.
[0059] As shown in queue 303, arrow 320 can determine whether the object of the reverse traversal has a probability of winning the lottery according to the inventory of the current object. For example, if there is only one opening ceremony ticket, and the object indicated by arrow 310 has been determined to be the winning object as object 3030, then all objects arranged after 3030 in queue 303 are unlikely to win the lottery. In this case, object 3038, which only includes the opening ceremony ticket in the lottery application form, can be marked as a little white person, such as Figure 3 As shown, object 3038 in queue 303 can be marked as a little white person, that is, object 3038 that is determined to have failed to win all lottery applications is marked as a little white person. As shown in queue 304, after arrow 310 traverses to object 3047, little white person 3048 can be directly skipped to traverse subsequent objects.
[0060] Finally, as shown in queue 305, for the current lottery target, each object is traversed in the direction shown by arrows 310 and 320, and the winning status of each object for the current target is finally determined.
[0061] In implementation, after traversing each object in the lottery application form of all objects, it can be determined whether the lottery target on each user's lottery application form has been drawn. Subsequently, the lottery system can send the corresponding lottery situation to each object that submitted the lottery application form, including whether the lottery target in each lottery application form has won the lottery and is eligible to purchase the lottery target. After receiving the notification about the lottery situation, the object can submit confirmation information to the lottery system, including information such as whether to confirm the purchase of the lottery target.
[0062] According to an exemplary embodiment of the present application, the lottery target indicates the target for issuing the lottery application. In the ticketing scenario, the lottery target may include but is not limited to concert tickets, various sports event tickets, movie tickets, etc. Since the above has been described in detail using sports tickets as an example, it will not be repeated here.
[0063] In an e-commerce scenario, the lottery target may include goods purchased by lottery. For example, in a promotional activity, a merchant provides multiple goods, but the quantity of each good is limited. Users can submit wish lists (i.e., lottery target lists) according to their needs. Then, after collecting the wish lists provided by each user, each wish in these wish lists can be traversed using the data processing method according to the exemplary embodiment of the present application, so as to determine the goods that the user is eligible to purchase.
[0064] More specifically, in the scenario of purchasing goods in a live video broadcast, the live broadcast host can provide various goods for users to choose from. At this time, the user can add the goods they want to buy to the wish list according to their needs. Finally, the data processing method according to the exemplary embodiment of the present application can be used to traverse each wish in these wish lists to determine the goods that the user is eligible to purchase.
[0065] In addition, the data processing method of the exemplary embodiment of the present application can also be applied in the scenario of grabbing red envelopes. In order to increase the enthusiasm and fun of users in grabbing red envelopes, the rules for grabbing red envelopes can be set so that users can determine to participate in grabbing multiple red envelopes within a preset time, and the red envelope lists of these users are processed to finally determine the red envelopes grabbed by the users.
[0066] As an example, multiple users in the same group send red envelopes at the same time, and then the users in the group can determine the red envelopes to be received within the preset time according to their own needs, for example, they can click on the red envelopes they want to receive. In this way, the red envelope lists of users participating in the red envelope grabbing can be collected within the preset time, and then each red envelope in these red envelope lists can be traversed using the data processing method according to the exemplary embodiment of the present application, so as to determine the red envelopes that the user can draw. Finally, the red envelope amount of the red envelope obtained by the user can be determined according to the set red envelope rules.
[0067] Figure 4 In order to more clearly understand the inventive concept of the exemplary embodiments of the present application, the following will refer to Figure 4 A block diagram of a data processing device describing an exemplary embodiment of the present application. A person of ordinary skill in the art will understand that: Figure 4 The device in the embodiment only shows the components related to the exemplary embodiment, and the device also includes Figure 4 Common components other than those shown in .
[0068] Figure 4 A block diagram of a data processing device according to an exemplary embodiment of the present application is shown. Figure 4 At the hardware level, the device includes a processor, an internal bus and a computer-readable storage medium, wherein the computer-readable storage medium includes a volatile memory and a non-volatile memory. The processor reads the corresponding computer program from the non-volatile memory and then runs it. Of course, in addition to the software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0069] Specifically, the processor performs the following operations: obtaining a drawing target list of at least one object, wherein the drawing target list includes at least one drawing target; during a first traversal of the at least one object for a current drawing target, in response to satisfying a preset condition, performing a second traversal starting from a starting object at a preset position.
[0070] The processor may further execute the step of sorting the at least one object according to the object sorting method, thereby performing a first traversal of the at least one object in the sorted order.
[0071] Optionally, the arrangement order of the at least one object indicates the probability of the corresponding object winning the lottery.
[0072] Optionally, the processor implements the step of performing a first traversal on the at least one object for the current lottery target, including: determining, for the current lottery target, winning information of whether each object has won the lottery in sequence according to the sorted order.
[0073] Optionally, the processor implements the step of determining the winning information of each object in the sorted order for the current lottery target, including: determining whether the inventory of the current lottery target satisfies the current object in units of objects; if so, determining the winning information of the current object and traversing the next object of the current object.
[0074] Optionally, the preset condition includes that a process of traversing the at least one object for the current lottery target has reached a threshold.
[0075] Optionally, the processor performs a second traversal starting from a starting object at a preset position in response to a preset condition being met in the implementation step, including: determining the starting object at the preset position in response to the preset condition being met; determining the winning information of the starting object in accordance with a preset traversal order and performing traversal on the next object of the starting object.
[0076] Optionally, the processor determines the winning information of the starting object according to a preset traversal order in the implementation step and performs traversal on the next object of the starting object, including: determining the inventory quantity of the starting object for the current lottery target when the traversal starts; using the inventory quantity to determine the winning information of the starting object and using the inventory quantity to perform traversal on the next object.
[0077] Optionally, the preset traversal order includes a forward traversal order and a reverse traversal order.
[0078] Optionally, the processor may further execute the step of: determining, for the current lottery target, a first object whose winning information for the current lottery target, starting from the starting object, indicates that the first object did not win the lottery.
[0079] Optionally, the processor may further execute the step of: directly skipping the first object during traversal of the at least one object for the current lottery target.
[0080] Optionally, the processor may further execute the step of: starting from the starting object, determining that the winning information of the lottery targets in the lottery target list all indicate a second object that did not win the lottery.
[0081] Optionally, the processor may further execute the step of directly skipping the second object during traversal of the at least one object for each lottery target.
[0082] Optionally, the processor may further execute the steps of: for the current object, after determining that the winning information for the current lottery target indicates a failure to win, determining the next lottery target to be traversed from the lottery target list corresponding to the current object.
[0083] Optionally, the processor executes the step of performing a second traversal starting from a starting object at a preset position in response to satisfying a preset condition, including: determining each starting object from each preset position whenever the preset condition is satisfied; and performing each second traversal on the at least one object for the current drawing target according to each starting object and in their respective traversal directions.
[0084] Optionally, the processor executes the step of performing each second traversal on the at least one object for the current lottery target from each starting object according to the respective traversal direction, including: determining the inventory quantity of each starting object for the current lottery target when the traversal starts; using the inventory quantity, performing a second traversal on the at least one object from each starting object according to the corresponding traversal direction to determine the winning information of each object.
[0085] Optionally, the processor may further perform the following steps: after the first traversal and the second traversal for each lottery target in the lottery target list are completed, determining the winning information of each lottery target of the at least one object.
[0086] Optionally, the processor may further perform the following steps: sending the winning information of each lottery target of the at least one object to the at least one object respectively.
[0087] In addition, according to an exemplary embodiment of the present application, the processor performs the following operations: when the video anchor terminal provides at least one commodity, obtaining a commodity wish list of the at least one user terminal from at least one user terminal, wherein the commodity wish list includes a list of commodities selected by each user terminal from the at least one object; during a first traversal of the at least one user terminal for the current lottery commodity, in response to satisfying a preset condition, performing a second traversal starting from a starting user terminal at a preset position.
[0088] In summary, the data processing device according to the exemplary embodiment of the present application can reduce the traversal amount of the original traversal and shorten the traversal time while ensuring the existing lottery rules by determining a new traversal starting point from the at least one object during the traversal of the at least one object and performing a new traversal on these objects. Furthermore, multiple processes can be added to simultaneously perform traversals for the same target object, thereby shortening the time consumption. Furthermore, objects that do not win all lottery targets can be screened out from all objects, thereby shortening the traversal time. Furthermore, objects that do not win the current lottery target can be screened out from all objects, thereby shortening the traversal time.
[0089] It should be noted that the execution subject of each step of the method provided in Example 1 can be the same device, or the method can be executed by different devices. For example, the execution subject of step 21 and step 22 can be device 1, and the execution subject of step 23 can be device 2; for another example, the execution subject of step 21 can be device 1, and the execution subject of step 22 and step 23 can be device 2; and so on.
[0090] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0091] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0094] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0095] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0096] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0097] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0098] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0099] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A data processing method, comprising: Acquire a lottery target list of at least one object, wherein the lottery target list includes at least one lottery target; During the first traversal of the at least one object for the current lottery target, when a preset condition is met, the starting object at the preset position is determined, and the inventory quantity of the starting object for the current lottery target when the traversal starts is determined. Using the inventory quantity, a second traversal is performed starting from the starting object in the corresponding traversal direction to determine the winning information of each object.
2. The method of claim 1, further comprising: The at least one object is sorted according to the object sorting method, so as to perform a first traversal on the at least one object in the sorted order.
3. The method of claim 2, wherein: The arrangement order of the at least one object indicates the probability of the at least one object winning the lottery.
4. The method of claim 3, wherein: Performing a first traversal on the at least one object for the current lottery target includes: For the current lottery target, the lottery information of whether each object has won the lottery is determined in turn according to the sorted order.
5. The method of claim 4, wherein: The winning information for determining whether each object has won the lottery in the sorted order for the current lottery target includes: Determine the inventory quantity of the current lottery target in units of objects; According to the inventory quantity, the winning information of the current object is determined and the next object of the current object is traversed.
6. The method of claim 1, wherein: The preset condition includes that the process of traversing the at least one object for the current lottery target has reached a threshold.
7. The method of claim 1, wherein: In response to satisfying a preset condition, performing a second traversal starting from a starting object at a preset position includes: In response to satisfying the preset condition, determining a starting object at the preset position; According to the preset traversal order, the winning information of the starting object is determined and the traversal is performed on the next object of the starting object.
8. The method of claim 7, wherein: Determining the winning information of the starting object according to the preset traversal order and performing traversal on the next object of the starting object includes: Determine the inventory quantity of the starting object for the current lottery target at the start of traversal; The winning information of the starting object is determined using the inventory quantity and the following objects are traversed using the inventory quantity.
9. The method of claim 8, wherein: The preset traversal order includes a forward traversal order and a reverse traversal order.
10. The method of claim 8, further comprising: For the current lottery target, determine the first object whose winning information for the current lottery target indicates that the object has not won the lottery, starting from the starting object.
11. The method of claim 10, further comprising: During the traversal of the at least one object for the current lottery target, the first object is directly skipped.
12. The method of claim 8, further comprising: Starting from the starting object, it is determined that the winning information of the lottery targets in the lottery target list all indicates a second object that did not win the lottery.
13. The method of claim 12, further comprising: For each lottery target, during the traversal of the at least one object, the second object is directly skipped.
14. The method of claim 1, further comprising: For the current object, after determining that the winning information for the current lottery target indicates that the lottery is not won, the next lottery target to be traversed is determined from the lottery target list corresponding to the current object.
15. The method of claim 1, wherein: When the preset conditions are met, determining the starting object at the preset position, determining the inventory quantity of the starting object for the current lottery target when starting the traversal, and using the inventory quantity, performing a second traversal from the starting object in the corresponding traversal direction to determine the winning information of each object includes: Whenever a preset condition is met, determining each starting object from each preset position; Determining the inventory quantity of each starting object for the current draw target at the start of the traversal; Using the inventory quantity, a second traversal is performed starting from each starting object in a corresponding traversal direction to determine the winning information of each object.
16. The method of claim 1, further comprising: After the first traversal and the second traversal for each lottery target in the lottery target list are completed, the winning information of each lottery target of the at least one object is determined.
17. The method of claim 16, further comprising: The winning information of each lottery target of the at least one object is sent to the at least one object respectively.
18. A data processing method, comprising: When the video host terminal provides at least one commodity, obtaining a commodity wish list of the at least one user terminal from at least one user terminal, wherein the commodity wish list includes a list of commodities selected by each user terminal from the at least one commodity; During the first traversal of the at least one user terminal for the current lottery item, when a preset condition is met, the starting user at the preset position is determined, and the inventory quantity of the current lottery item by the starting user when the traversal starts is determined. Using the inventory quantity, a second traversal is performed starting from the starting user in the corresponding traversal direction to determine the winning information of each user.
19. A computer-readable storage medium having computer instructions stored thereon, wherein: When the instructions are executed, the method of any one of claims 1 to 18 is implemented.
20. A data processing device, comprising: processor; as well as A memory arranged to store computer executable instructions which, when executed, cause the processor to perform a method as claimed in any one of claims 1 to 18.
Citation Information
Patent Citations
Multithreading file traversal technology
CN101526948A
Resource allocation tree
CN103858103A