CN117215523A - Numerical value determining method and device, electronic equipment and storage medium - Google Patents
Numerical value determining method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117215523A CN117215523A CN202311054474.XA CN202311054474A CN117215523A CN 117215523 A CN117215523 A CN 117215523A CN 202311054474 A CN202311054474 A CN 202311054474A CN 117215523 A CN117215523 A CN 117215523A
- Authority
- CN
- China
- Prior art keywords
- target
- determining
- digital
- offset distance
- instruction
- 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
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000004044 response Effects 0.000 claims abstract description 23
- 230000006870 function Effects 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 10
- 238000005096 rolling process Methods 0.000 claims description 10
- 230000001960 triggered effect Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 13
- 238000004891 communication Methods 0.000 description 12
- 230000008859 change Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 3
- 230000001788 irregular Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000011022 operating instruction Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The disclosure provides a method and device for determining a numerical value, electronic equipment and a storage medium. The method comprises the following steps: determining that a trigger instruction is received, and determining at least one target digital set from at least one digital set; for each target number set, performing: in response to receiving an operation instruction for the target digital set, determining a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction; determining a target number corresponding to the target number set based on the target offset distance and the initial position; arranging the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value; determining that a random number generation instruction is received, and generating a target random number; wherein the target random number is less than or equal to the maximum value.
Description
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a method and a device for determining a numerical value, electronic equipment and a storage medium.
Background
In conducting a lottery, it is widely used to conduct a lottery by generating random numbers by rolling numbers. However, the maximum value of the random number is preset, and the user cannot change, so that the user experience is affected.
In view of this, how to accurately change the maximum value of the random number is a problem to be solved.
Disclosure of Invention
Accordingly, an objective of the present disclosure is to provide a method, an apparatus, an electronic device and a storage medium for determining a numerical value, which are used for solving or partially solving the above technical problems.
Based on the above object, a first aspect of the present disclosure proposes a method of determining a numerical value, the method comprising:
determining that a trigger instruction is received, and determining at least one target digital set from at least one digital set;
for each of the target digital sets, performing:
in response to receiving an operation instruction for the target digital set, determining a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction;
determining a target number corresponding to the target number set based on the target offset distance and the initial position;
arranging the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value;
determining that a random number generation instruction is received, and generating a target random number; wherein the target random number is less than or equal to the maximum value.
Based on the same inventive concept, a second aspect of the present disclosure proposes a numerical value determining apparatus, including:
A first determining module configured to determine that a trigger instruction is received, determine at least one target digital set from the at least one digital set;
the second determining module is configured to determine a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction in response to receiving the operation instruction on the target digital set;
a third determining module configured to determine a target number corresponding to the target number set based on the target offset distance and the initial position;
the setting module is configured to arrange the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value;
the generation module is configured to determine that a random number generation instruction is received and generate a target random number; wherein the target random number is less than or equal to the maximum value.
Based on the same inventive concept, a third aspect of the present disclosure proposes an electronic device comprising a memory, a processor and a computer program stored on the memory and executable by the processor, the processor implementing the method as described above when executing the computer program.
Based on the same inventive concept, a fourth aspect of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as described above.
From the above, it can be seen that the present disclosure provides a method, an apparatus, an electronic device and a storage medium for determining a numerical value. And determining that a trigger instruction is received, and determining at least one target digital set from the at least one digital set, so as to determine which column of digital set is changed, and accurately determining that the at least one target digital set is changed. For each target number set, performing: and in response to receiving an operation instruction for the target digital set, determining a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction. And determining the target number corresponding to the target number set based on the target offset distance and the initial position, so that the determined target number set is more accurate. And arranging the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value, so that a user can conveniently set and change the maximum value, the target random number generated by rolling is in the range of the set maximum value, and the user experience is enhanced. Determining that a random number generation instruction is received, and generating a target random number; wherein the target random number is less than or equal to the maximum value.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or related art, the drawings required for the embodiments or related art description will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is a flow chart of a method of determining a value of an embodiment of the present disclosure;
FIG. 2A is a schematic diagram of a parent digital container of an embodiment of the present disclosure;
FIG. 2B is a schematic diagram of a sub-level digital container according to an embodiment of the present disclosure;
FIG. 2C is a schematic diagram of a digital collection beginning to scroll in accordance with an embodiment of the present disclosure;
FIG. 2D is a schematic diagram of a digital collection stopped scrolling in an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a numerical value determining apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of promoting an understanding of the principles and advantages of the disclosure, reference will now be made to the embodiments illustrated in the drawings and specific language will be used to describe the same.
It should be noted that unless otherwise defined, technical or scientific terms used in the embodiments of the present disclosure should be given the ordinary meaning as understood by one of ordinary skill in the art to which the present disclosure pertains. The terms "first," "second," and the like, as used in embodiments of the present disclosure, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
As described above, how to accurately change the maximum value of the random number becomes an important research problem.
Based on the above description, as shown in fig. 1, the method for determining a numerical value according to this embodiment includes:
step 101, determining that a trigger instruction is received, and determining at least one target digital set from at least one digital set.
In particular implementations, when a trigger instruction is received, at least one target set of digits is determined from the at least one set of digits. Wherein the trigger instruction is an instruction that can determine at least one target number set. The trigger instruction includes at least one of: click commands and voice commands. The click command includes a manual click command or a mouse click command.
At least one digit set, i.e. a set of digits of each digit, is represented in the form of a list of digits. For example, the at least one set of digits includes a list of digits, a list of tens digits, and a list of hundreds digits. As shown in fig. 2A, fig. 2A is a schematic diagram of a parent digital container according to an embodiment of the present disclosure. The list of hundred digits, the list of ten digits, and the list of units digits are shown in fig. 2A in order from left to right.
For example, it is determined that a manual click command of a user is received, a position corresponding to the manual click command is a list of digits, and at least one target digit set is determined to be a list of digits, so that the list of digits is changed to set a maximum value.
Or determining that the position corresponding to the manual click command is a unit number list and a ten-digit list, and determining that at least one target number set is the unit number list and the ten-digit list, so that the maximum value is set by changing the setting of the unit number list and the ten-digit list respectively.
Or determining that the position corresponding to the manual click command is a bit number list, determining that at least one target number set is a bit number list, and changing and setting the bit number list to obtain a bit target number; determining that the manual clicking instruction of the user is received again, determining that the position corresponding to the manual clicking instruction of the user is a ten-digit list, determining that at least one target digit set is the ten-digit list, and changing and setting the ten-digit list to obtain ten-digit target digits. The set maximum value is determined based on the unit target number and the ten target number.
For each of the target digital sets, performing:
step 102, in response to receiving an operation instruction for the target digital set, determining a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial time of the operation instruction.
In particular embodiments, the operating instructions include at least one of: a slide instruction and a drag instruction. The sliding instruction comprises a manual sliding instruction or a mouse sliding instruction; the drag instruction includes a manual drag instruction or a mouse drag instruction.
The target offset distance is the distance between the initial position and the end position corresponding to the sliding instruction or the dragging instruction. The initial position is an initial position corresponding to the initial time of the sliding instruction or the dragging instruction, and the end position is an end position corresponding to the end time of the sliding instruction or the dragging instruction.
In order to accurately determine the target offset distance, the initial position and the end position are both longitudinal position coordinates, so that the determined target offset distance is also a longitudinal distance, the determined target offset distance is more accurate, and the maximum value is further accurately set.
The number displayed at the present time may be the number displayed at the initial state, for example, the number displayed at the initial state is "000" or "999". Alternatively, the currently displayed number may be a target random number generated after the last scroll, for example, the target random number generated by the last scroll is "023", i.e., the number displayed in the initial state is "023".
And step 103, determining the target number corresponding to the target number set based on the target offset distance and the initial position.
In specific implementation, the initial position is the position of the currently displayed number, i.e. the corresponding initial number. The number of numbers to slide or scroll is determined based on the target offset distance. And determining a corresponding target number according to the initial number and the number of the numbers.
The target number is the number corresponding to the target number set. For example, when the set of target digits is a sequence of bit digits, the target digits are bit target digits. When the target number set is a ten-digit number sequence, the target number is a ten-digit target number.
And 104, arranging the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value.
In specific implementation, the target numbers corresponding to each target number set are arranged according to the numerical sequence to obtain the set maximum value. For example, when at least one target number set is a sequence of units and tens digits, the determined units and tens target numbers are arranged in order to obtain a set maximum value.
For example, when the unit target number is "7", the ten-bit target number is "1", the maximum value is set to "17".
Step 105, determining that a random number generation instruction is received, and generating a target random number; wherein the target random number is less than or equal to the maximum value.
In the specific implementation, after the maximum value setting is completed, the target random number is generated and displayed after the random number generation instruction is received. For example, after the random number generation instruction triggers the corresponding generation control, the target random number is generated.
By the embodiment, the trigger instruction is determined to be received, at least one target digital set is determined from at least one digital set, so that the change of which digital set is determined, and the change of at least one target digital set can be accurately determined. For each target number set, performing: and in response to receiving an operation instruction for the target digital set, determining a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction. And determining the target number corresponding to the target number set based on the target offset distance and the initial position, so that the determined target number set is more accurate. And arranging the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value, so that a user can conveniently set and change the maximum value, the target random number generated by rolling is in the range of the set maximum value, and the user experience is enhanced. Determining that a random number generation instruction is received, and generating a target random number; wherein the target random number is less than or equal to the maximum value.
In some embodiments, step 102 comprises:
in step 1021, in response to receiving a first operation instruction for the target digital set, a first offset distance corresponding to the first operation instruction is determined.
Step 1022, in response to receiving a second operation instruction for the target digital set, determines a second offset distance corresponding to the second operation instruction.
Step 1023, summing the first offset distance and the second offset distance to obtain the target offset distance.
In specific implementation, when the operation instruction of the user is multiple times, the target offset distance is determined according to the multiple offset distances determined by the multiple operation instructions. The first offset distance initial time corresponds to a first initial position, the end time corresponds to a first end position, and the first offset distance is the distance between the first initial position and the first end time; the initial moment of the second offset distance corresponds to a second initial position, the end moment corresponds to a second end position, and the second offset distance is the distance between the second initial position and the second end position; the sum of the first offset distance and the second offset distance is the target offset distance.
In addition, the second initial position is the same as the first end position, and the target offset distance may also be determined by the first initial position and the second end position, that is, the target offset distance is the distance between the first initial distance and the second end distance.
In addition, the target offset distance may be determined by the operating parameters of the operating instructions. The specific determination process is as follows: and acquiring the operation parameters of the operation instruction, and determining the target offset distance based on the operation parameters of the operation instruction. Wherein the operation instruction comprises a sliding instruction or a scrolling instruction; the operation parameters of the operation instruction comprise the operation speed or the operation strength of the operation instruction.
For example, when the operation instruction is a slip instruction, the slip speed of the slip instruction is acquired; comparing and judging the sliding speed with a preset speed threshold; and when the sliding speed is greater than the speed threshold, determining the target offset distance based on a first scale factor. Wherein the first scaling factor is a scaling factor between the sliding speed and the offset distance.
Or, acquiring the sliding force of at least two moments of the sliding instruction; comparing and judging the sliding force at the at least two moments with a preset force threshold; and determining the target offset distance based on a second scaling factor when the difference between the sliding forces at the at least two moments is greater than the force threshold. The second proportionality coefficient is a proportionality coefficient between the difference of sliding force at least two moments and the offset distance. The at least two moments may be an initial moment and an end moment of the sliding instruction.
By the scheme, when the user determines the target number through multiple sliding or multiple scrolling, the target number can be accurately obtained. At the same time, the influence of irregular sliding or irregular scrolling of the user on the determined target number can be avoided. In addition, the target offset distance is determined based on the operation parameters of the operation instruction, so that the determination mode of the target offset distance is more comprehensive and various. And judging the sliding speed or the sliding force, and determining the target offset distance based on the corresponding proportionality coefficient, so that the faster the sliding speed or the larger the sliding force, the larger the determined target offset distance, and the accelerated downslide of the parent digital container is realized.
In some embodiments, prior to step 101, further comprising:
step 10A, generating at least one parent digital container and at least one corresponding child digital container; wherein the parent digital container is used for displaying all digits in a digit set, and the child digital container is used for displaying the target digits in the digit set.
In particular, as shown in fig. 2A, fig. 2A is a schematic diagram of a parent digital container according to an embodiment of the disclosure. The parent digital container in fig. 2A is used to display all the digits in the digit sets, each digit set being disposed in one parent digital container. At least one parent number container is provided, one for each digital set. For example, a list of digits in a digit set corresponds to a parent digit container of digits.
As shown in fig. 2B, fig. 2B is a schematic diagram of a sub-level digital container according to an embodiment of the present disclosure. The child level number container in FIG. 2B is part of a parent level number container for displaying the target numbers in the number set. The part of the parent digital container except for the child digital container is hidden.
Step 10B, determining a parent level height of the at least one parent digital container and a child level height of the at least one child digital container.
In specific implementation, the parent level of the parent level digital container is the sum of the heights of all numbers, and the child level digital container is the height of the target number. The parts of the parent digital container except for the child digital containers are hidden by respectively determining the parent level height and the child level height, so that only the target number is displayed in the interface, and the user can conveniently view the target number.
And step 10C, hiding the part exceeding the child level in the parent level of the at least one parent level digital container for displaying the target number in the child level digital container.
In the specific implementation, the part exceeding the child level in the parent level is hidden, so that the part except the child level digital container in the parent level digital container is hidden, and only the target number in the child level digital container can be displayed.
Through the scheme, the part exceeding the child level in the parent level of the parent level digital container is hidden by determining the parent level and the child level, so that the part except the child level digital container in the parent level digital container is hidden, only the target number in the child level digital container can be displayed, and the user can conveniently set the maximum value and view the generated target random number.
In some embodiments, step 101 comprises:
in step 1011, in response to receiving the trigger instruction, a trigger position corresponding to the trigger instruction is determined.
When the implementation is carried out, when a trigger instruction is received, the coordinates of the trigger position corresponding to the trigger instruction are determined. For example, the coordinates of the trigger position are (x 0 ,y 0 )。
Step 1012, obtaining a first position of the at least one parent digital container in a first direction and a second position of the at least one parent digital container in a second direction by calling a function; wherein the first direction and the second direction are perpendicular to each other.
In particular, the first location of the first direction and the second location of the second direction of the at least one parent digital container are obtained by a getbase clientselect () calling function. For example, the coordinates (x) of the first position on the left side of the bit number list are acquired by the getbase clientintselect () call function 1 ,y 1 ) And the coordinates (x 2 ,y 2 ). The first direction and the second direction are perpendicular to each other, and the container position of the parent digital container can be accurately determined based on the first position and the second position.
The getbase clientselect () is a calling function used to obtain the positions of left, top, right and bottom of an element in a page, respectively, relative to the browser window.
Step 1013, determining a container position of the at least one parent digital container based on the first position and the second position.
In practice, the container position is a range of position coordinates. The container position is determined based on the coordinates of the first location, the coordinates of the second location, and the height and width of the parent digital container.
The container location of each parent digital container is determined, for example, a first container location of the parent digital container corresponding to the digit list is determined, a second container location of the parent digital container corresponding to the tens digit list is determined, and a third container location of the parent digital container corresponding to the hundreds digit list is determined.
And 1014, analyzing and processing the trigger position and the container position, and determining at least one target parent-level digital container corresponding to the trigger position from the at least one parent-level digital container.
In particular, the coordinates of the trigger position are (x 0 ,y 0 ) And comparing and judging the container position of each parent-level digital container, thereby determining at least one target parent-level digital container corresponding to the trigger position. For example, the coordinates of the trigger position are (x 0 ,y 0 ) Comparing and judging with the first container position, the second container position and the third container position, and when the coordinate of the triggering position is (x) 0 ,y 0 ) Within the range of the first container position, determining that the trigger instruction triggers a list of bit numbers, and accordingly setting and changing the numbers of the list of bit numbers to set target numbers of bits.
Step 1015, taking the number set corresponding to the at least one target parent digital container as the at least one target number set.
In particular, at least one target parent digital container is determined to determine at least one corresponding target digital set, so that the determined target digital set is more accurate, and the target digital of the target digital set is set by accurately changing the target digital set.
According to the scheme, the trigger position of the trigger instruction and the container position of the parent digital container are determined, and the at least one target parent digital container triggered based on the trigger position and the container position is determined, so that the corresponding at least one target digital set is determined, the determined target digital set is more accurate, the maximum value is further accurately set for the target digital set, and the maximum value is accurately set.
In some embodiments, after step 102, further comprising:
step 102A, comparing and judging the target offset distance with a preset offset distance threshold.
Step 102B, updating the initial position in response to determining that the target offset distance is equal to the offset distance threshold.
In the specific implementation, by comparing and judging the target offset distance with the preset offset distance, when the target offset distance is equal to the offset distance threshold value, the target number set is indicated to slide to the end of the number, no other numbers are arranged at the back, the initial position is updated, and the parent number container can be restored to other positions capable of sliding. The other slidable position may be the intermediate position or the start position.
For example, when the preset offset distance threshold is 10 and the target offset distance is 10, the target number set is indicated to slide to the number "9", the initial position is updated, and the parent number container is restored to "0".
Through the scheme, when the target offset distance is equal to the offset distance threshold value, the initial position is updated, and the middle position or the beginning position of the sliding number can be updated at the tail end, so that the infinite scrolling effect is realized.
In some embodiments, step 105 comprises:
step 1051, determining that the random number scroll control is triggered by the random number generation instruction, and performing scroll processing on the at least one digital set.
In implementation, as shown in fig. 2C, fig. 2C is a schematic diagram of the scrolling of the digital set according to the embodiment of the disclosure. The random number scroll control is a start button, and the random number generation instruction comprises a click instruction, which can be a manual click instruction or a mouse click instruction. When the start button receives a click command, the unit number list, the ten-digit list and the hundred-digit list start to scroll, and the digit list is in an infinite loop state based on animation in css animation, so that the effect of scrolling the digit list is generated.
css may add style to a node in hypertext markup language (HyperText Markup Language, html for short), animation refers to adding animation to an element node, and translate refers to shifting the position of an element node.
Step 1052, determining that the random number generation control is triggered by the random number generation instruction, the at least one digital set stops scrolling, and generating a target random number.
In implementation, as shown in fig. 2D, fig. 2D is a schematic diagram of stopping scrolling of the digital set according to an embodiment of the disclosure. The random number generation control is a stop button, and the random number generation instruction comprises a click instruction, which can be a manual click instruction or a mouse click instruction. When the "stop" button receives a click command, the list of units, tens and hundreds digits starts to scroll, and a target random number is generated.
The fonts, colors and sizes of the numbers in the number set can be set in a self-defined mode, and a user can select different styles according to own favorites or scenes used by random numbers, so that the user experience is improved.
In addition, a digital frame can be arranged in the interface, and at least one father-stage digital container is arranged in the digital frame, so that the digital display in the interface is clearer, and the user can conveniently check the digital display. The color and style of the digital frame can be set in a self-defined manner, and the color and style of the color frame can be set by selecting from preset colors and styles.
According to the scheme, the number list can be in an infinite loop state through the scrolling animation, at least one number set is controlled to start scrolling and stop scrolling based on the random number scrolling control and the random number generating control, and therefore the number set can be accurately controlled and the target random number can be generated.
In some embodiments, step 103 comprises:
step 1031, a digital height for each number is obtained.
In particular, the digital height of each digit is the sub-level height of the sub-level digital container.
Step 1032, determining a number of values based on the digital height and the target offset distance.
In particular implementations, a number of values is determined based on the number height and the target offset distance, where the number of values is the number of digits offset. For example, the target offset distance is 6, the digital height is 1, and the number of values is 6.
Step 1033, determining an operation direction of the operation instruction and a target operation mode corresponding to the operation direction.
In specific implementation, the operation direction of the operation instruction is determined, and the target operation mode is determined from the preset operation modes according to the operation direction. For example, if the operation direction of the sliding instruction or the scrolling instruction is from bottom to top, that is, the numbers in the number set scroll from "0" to "9", the target operation mode is determined to be an addition operation. The sliding instruction or the scrolling instruction scrolls from top to bottom, i.e. the numbers in the number set scroll from "9" to "0", and then the target operation mode is determined to be subtraction operation.
Step 1034, performing operation processing on the initial number corresponding to the initial position and the number of values according to the target operation mode, so as to obtain the target number.
In specific implementation, the initial number corresponding to the initial position and the determined number of the numerical values are calculated according to the target calculation mode to obtain the target number. For example, the initial number corresponding to the initial position is "2", the number of the determined numerical values is 6, the target operation mode is addition, and the obtained target number is "8".
By the embodiment, the number of the numerical values is determined based on the numerical height and the target offset distance, so that the determined number of the sliding or rolling numerical values is more accurate. And determining a target operation mode according to the operation direction of the operation instruction, so as to determine a target number according to the target operation mode, and avoid the problem of error operation of the target number.
It should be noted that the embodiments of the present disclosure may be further described in the following manner:
(1) And carrying out sliding processing on the numbers in the digital set through a mouse sliding instruction or a finger sliding instruction on a screen, and setting the maximum value of the random number. Clicking the "start" button number will scroll up and down quickly, clicking the "stop" button will generate a target random number, which is in the interval range of 0 to the maximum.
(2) The user sets the maximum value by mouse sliding and manual sliding.
1. The method comprises the steps of setting a digital list capable of realizing sliding, generating a digital set with three columns of 0-9, vertically arranging the digital set into a parent digital container (namely a parent div), setting a child digital container in the parent digital container, setting the child level of the child digital container, wherein the child digital container is used for displaying target numbers, and hiding a part exceeding the child level in the parent digital container. The interval effect of 0-999 can be simulated by generating three father-stage digital containers which are transversely arranged, and when the father-stage digital containers are scrolled to the tail end of the digital set, the effect of infinite scrolling can be simulated by integrally restoring the father-stage digital containers to the middle position or the beginning position as no other digital elements exist at the back.
2. The method comprises the steps of setting the maximum value through mouse sliding or manual sliding, firstly determining a target number set of the mouse sliding or manual sliding, and obtaining the positions of three parent digital containers in a document page when the three parent digital containers are generated, wherein document refers to webpage content and api which are developed through html, javascript, css and other technical languages and can be input into a mobile phone and a computer browser for website viewing.
The container position of the target parent digital container is determined by calling the getbase clientinetrect function in the function to obtain a first position on the left side of the parent digital container and a second position on the upper side. When a mouse sliding instruction or a manual sliding instruction is received, a point event of document (namely a click instruction in a trigger instruction) is monitored. In the callback function parameter of the pointeown event, a specific trigger position is acquired, so that the position where a finger or a mouse falls down can be determined, and further, whether the user operates a score or a tenth or a percentile is determined. The trigger position and the container position are recorded.
When a sliding instruction or a rolling instruction of a user is received, after the touch event (i.e. a manual sliding instruction in an operation instruction) or the point event (i.e. a mouse sliding instruction in the operation instruction) of the document is monitored, the coordinate in the longitudinal direction of the user sliding (i.e. the y-axis direction coordinate) is calculated after the touch event or the point event is monitored, the initial y-coordinate is subtracted to obtain the sliding distance of the user, the sliding effect of the user can be simulated by determining the target offset distance in the longitudinal direction of the parent digital container through the transfer: transfer () function of css in the parent digital container, and the last offset position can be recorded in the operation process of the user due to the irregular rolling of the user.
3. And when the sliding is finished, determining the distance of the last rolling of the user when the rolling of the user is finished, and rounding and finishing the remainder after dividing the height of the digital node to determine the offset position of the container. And the last offset position is recorded on the target father digital container, so that the user can conveniently acquire the last position when sliding operation is performed again. And meanwhile, the maximum value generated by the sliding is stored after each sliding is finished, so that the user can conveniently click to start to generate random numbers.
Through the above processing of three operations by the user, the maximum value of the user sliding setting is realized.
(3) After the user generates a random number, the maximum value is reset.
1. When a user clicks a start button, animation in css animation can enable random numbers to be in an infinite loop state all the time, after the random numbers are generated through a maximum value interval, the positions where the last three lists should stay are judged through multiplying the values of three hundreds of digits, ten digits, units and the like by the height of each number, and the numerical direction distance which needs to be offset finally is transmitted to each parent level digital container through the style attribute of the element. Each parent digital container can be slowly dropped to a final position by animation, thereby generating a target random number.
Where the style attribute contains all of the attributes of the object style (e.g., font, digital format, alignment, etc.), it can be used for any HTML element.
2. After the target random number is generated, multiplying the target random number by the number height of each number, resetting the target offset distance of the parent number digital container, wherein the target offset distance is the same as the effect of final result display, and updating the final position of the parent number digital container. Therefore, the problem that random sliding occurs again after the random number is generated can be solved, the display of results is not affected, and meanwhile, the fact that the sliding effect of the user in the next time cannot be abrupt due to offset generated when the target random number is generated is guaranteed.
Through the above embodiment, by setting the container offset distance by css after monitoring the operation command, the user can quickly set the maximum value, thereby determining the interval range of the random number. After the target random number is generated, the target offset distance of the father digital container is reset according to the generated target random number, so that the problem of sliding disorder when the user sets the maximum value again is solved, and the requirements of complex teaching scenes and other scenes are greatly met.
It should be noted that the method of the embodiments of the present disclosure may be performed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present disclosure, the devices interacting with each other to accomplish the methods.
It should be noted that the foregoing describes some embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the present disclosure also provides a device for determining a numerical value, corresponding to the method of any embodiment described above.
Referring to fig. 3, the numerical value determining apparatus includes:
a first determining module 301 configured to determine that a trigger instruction is received, determine at least one target digital set from the at least one digital set;
a second determining module 302, configured to determine, in response to receiving an operation instruction for the target number set, a target offset distance corresponding to the operation instruction, and an initial position corresponding to an initial time of the operation instruction;
A third determining module 303 configured to determine a target number corresponding to the target number set based on the target offset distance and the initial position;
the setting module 304 is configured to arrange the target numbers corresponding to each target number set according to a numerical sequence to obtain a set maximum value;
a generation module 305 configured to determine that a random number generation instruction is received, and generate a target random number; wherein the target random number is less than or equal to the maximum value.
In some embodiments, the second determination module 302 includes:
a first offset distance determining unit configured to determine a first offset distance corresponding to a first operation instruction in response to receiving the first operation instruction on the target digital set;
a second offset distance determining unit configured to determine a second offset distance corresponding to a second operation instruction for the target digital set in response to receiving the second operation instruction;
and the target offset distance determining unit is configured to sum the first offset distance and the second offset distance to obtain the target offset distance.
In some embodiments, the apparatus further comprises:
A digital container generation unit configured to generate at least one parent digital container and corresponding at least one child digital container; the parent digital container is used for displaying all numbers in the number set, and the child digital container is used for displaying the target numbers in the number set;
a height determining unit configured to determine a parent level height of the at least one parent digital container and a child level height of the at least one child digital container;
a hiding unit configured to hide a portion exceeding the child level in a parent level of the at least one parent level digital container for displaying the target number in the child level digital container.
In some embodiments, the first determining module 301 includes:
a trigger position determining unit configured to determine a trigger position corresponding to a trigger instruction in response to receiving the trigger instruction;
a position acquisition unit configured to acquire a first position in a first direction and a second position in a second direction of the at least one parent digital container by calling a function; wherein the first direction and the second direction are perpendicular to each other;
a container location unit configured to determine a container location of the at least one parent digital container based on the first location and the second location;
A target parent-level digital container determining unit configured to analyze the trigger position and the container position, and determine at least one target parent-level digital container corresponding to the trigger position from the at least one parent-level digital container;
and the target number set determining unit is configured to take the number set corresponding to the at least one target parent number container as the at least one target number set.
In some embodiments, the apparatus further comprises:
the comparison judging unit is configured to compare and judge the target offset distance with a preset offset distance threshold value;
and an updating unit configured to update the initial position in response to determining that the target offset distance is equal to the offset distance threshold.
In some embodiments, the generation module 305 includes:
a scrolling unit configured to determine that a random number scrolling control is triggered by the random number generation instruction, and scroll the at least one digital set;
and the generation unit is configured to determine that the random number generation control is triggered by the random number generation instruction, stop scrolling the at least one digital set and generate a target random number.
In some embodiments, the third determination module 303 includes:
a digital height acquisition unit configured to acquire a digital height of each of the numbers;
a number-of-values determination unit configured to determine a number of values based on the digital height and the target offset distance;
a target operation mode determining unit configured to determine an operation direction of the operation instruction and a target operation mode corresponding to the operation direction;
and the target number determining unit is configured to perform operation processing on the initial number corresponding to the initial position and the number of the numerical values according to the target operation mode to obtain the target number.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of the various modules may be implemented in the same one or more pieces of software and/or hardware when implementing the present disclosure.
The device of the foregoing embodiment is configured to implement the corresponding method for determining the numerical value in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, the present disclosure also provides an electronic device corresponding to the method of any embodiment, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the method of determining the numerical value of any embodiment when executing the program.
Fig. 4 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through wired mode (such as USB (Universal Serial Bus, universal serial bus), network cable, etc.), or may implement communication through wireless mode (such as mobile network, WIFI (Wireless Fidelity, wireless network communication technology), bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The electronic device of the foregoing embodiment is configured to implement the corresponding method for determining the numerical value in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, corresponding to any of the above embodiments of the method, the present disclosure further provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of determining a numerical value as described in any of the above embodiments.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The storage medium of the foregoing embodiments stores computer instructions for causing the computer to perform the method for determining a numerical value according to any of the foregoing embodiments, and has the advantages of the corresponding method embodiments, which are not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the disclosure, including the claims, is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined under the idea of the present disclosure, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in details for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the embodiments of the present disclosure. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present disclosure, and this also accounts for the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform on which the embodiments of the present disclosure are to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the embodiments of the disclosure, are intended to be included within the scope of the disclosure.
Claims (10)
1. A method of determining a value, comprising:
determining that a trigger instruction is received, and determining at least one target digital set from at least one digital set;
for each of the target digital sets, performing:
in response to receiving an operation instruction for the target digital set, determining a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction;
determining a target number corresponding to the target number set based on the target offset distance and the initial position;
Arranging the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value;
determining that a random number generation instruction is received, and generating a target random number; wherein the target random number is less than or equal to the maximum value.
2. The method of claim 1, wherein the determining, in response to receiving an operation instruction for the target number set, a target offset distance corresponding to the operation instruction comprises:
in response to receiving a first operation instruction for the target digital set, determining a first offset distance corresponding to the first operation instruction;
in response to receiving a second operation instruction for the target digital set, determining a second offset distance corresponding to the second operation instruction;
and summing the first offset distance and the second offset distance to obtain the target offset distance.
3. The method of claim 1, further comprising, prior to said determining that a trigger instruction is received:
generating at least one parent digital container and at least one corresponding child digital container;
the parent digital container is used for displaying all numbers in the number set, and the child digital container is used for displaying the target numbers in the number set;
Determining a parent level height of the at least one parent digital container and a child level height of the at least one child digital container;
hiding a portion of the parent level height of the at least one parent level digital container beyond the child level height for displaying the target number in the child level digital container.
4. A method according to claim 3, wherein said determining that a trigger instruction has been received, determining at least one target set of digits from at least one set of digits, comprises:
in response to receiving a trigger instruction, determining a trigger position corresponding to the trigger instruction;
acquiring a first position of the at least one parent digital container in a first direction and a second position of the at least one parent digital container in a second direction by calling a function; wherein the first direction and the second direction are perpendicular to each other;
determining a container location of the at least one parent digital container based on the first location and the second location;
analyzing the trigger position and the container position, and determining at least one target parent digital container corresponding to the trigger position from the at least one parent digital container;
and taking the digital set corresponding to the at least one target father-level digital container as the at least one target digital set.
5. The method of claim 1, wherein after the determining the target offset distance corresponding to the operation instruction in response to receiving the operation instruction for the target number set, further comprises:
comparing and judging the target offset distance with a preset offset distance threshold value;
the initial position is updated in response to determining that the target offset distance is equal to the offset distance threshold.
6. The method of claim 1, wherein the determining that the random number generation instruction is received, generating the target random number, comprises:
determining that a random number rolling control is triggered by the random number generation instruction, and rolling the at least one digital set;
determining that a random number generation control is triggered by the random number generation instruction, stopping scrolling of the at least one digital set, and generating a target random number.
7. The method of claim 1, wherein the determining a target number corresponding to the set of target numbers based on the target offset distance and the initial position comprises:
acquiring the digital height of each digital;
determining a number of values based on the digital height and the target offset distance;
Determining the operation direction of the operation instruction and a target operation mode corresponding to the operation direction;
and carrying out operation processing on the initial number corresponding to the initial position and the number of the numerical values according to the target operation mode to obtain the target number.
8. A numerical value determining apparatus, comprising:
a first determining module configured to determine that a trigger instruction is received, determine at least one target digital set from the at least one digital set;
the second determining module is configured to determine a target offset distance corresponding to the operation instruction and an initial position corresponding to the initial moment of the operation instruction in response to receiving the operation instruction on the target digital set;
a third determining module configured to determine a target number corresponding to the target number set based on the target offset distance and the initial position;
the setting module is configured to arrange the target numbers corresponding to each target number set according to the numerical sequence to obtain a set maximum value;
the generation module is configured to determine that a random number generation instruction is received and generate a target random number; wherein the target random number is less than or equal to the maximum value.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 7 when the program is executed.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311054474.XA CN117215523A (en) | 2023-08-21 | 2023-08-21 | Numerical value determining method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311054474.XA CN117215523A (en) | 2023-08-21 | 2023-08-21 | Numerical value determining method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117215523A true CN117215523A (en) | 2023-12-12 |
Family
ID=89041540
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311054474.XA Pending CN117215523A (en) | 2023-08-21 | 2023-08-21 | Numerical value determining method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117215523A (en) |
-
2023
- 2023-08-21 CN CN202311054474.XA patent/CN117215523A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103810089B (en) | Automatically testing gesture-based applications | |
WO2015039566A1 (en) | Method and system for facilitating automated web page testing | |
US9772978B2 (en) | Touch input visualizations based on user interface context | |
CN110634049B (en) | Page display content processing method and device, electronic equipment and readable medium | |
CN106293074A (en) | A kind of Emotion identification method and mobile terminal | |
US10410606B2 (en) | Rendering graphical assets on electronic devices | |
CN113393294B (en) | Page display method and device, equipment and storage medium | |
CN112667330A (en) | Page display method and computer equipment | |
CN105389079A (en) | Graph display apparatus, graph display method | |
CN110781427A (en) | Method, device, equipment and storage medium for calculating first screen time | |
CN113688341B (en) | Dynamic picture decomposition method and device, electronic equipment and readable storage medium | |
US10635286B2 (en) | Visualizations supporting unlimited rows and columns | |
US12079575B2 (en) | Character display method and apparatus, electronic device, and computer-readable storage medium | |
CN112947811A (en) | Page navigation display method and device, electronic equipment and storage medium | |
WO2018098960A1 (en) | Method for operating touchscreen device, and touchscreen device | |
US20160209988A1 (en) | Information Input Device, Control Method and Storage Medium | |
CN106919260A (en) | Web page operation method and apparatus | |
CN117215523A (en) | Numerical value determining method and device, electronic equipment and storage medium | |
CN105879389A (en) | Webgame display frame zoom operational method, device, and game platform | |
CN111506185B (en) | Method, device, electronic equipment and storage medium for operating document | |
CN109032476B (en) | Method for displaying big data set in graphical user interface | |
CN113485606A (en) | Method and device for realizing multi-list joint rolling | |
US11669234B2 (en) | Method for processing aerial view, electronic device, and storage medium | |
CN108446070A (en) | A kind of method and device for browsing information | |
CN107577393B (en) | List page display method, device and equipment |
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 |