CN112650567A - Implementation method and device of global universal timer and computer equipment - Google Patents

Implementation method and device of global universal timer and computer equipment Download PDF

Info

Publication number
CN112650567A
CN112650567A CN202011528255.7A CN202011528255A CN112650567A CN 112650567 A CN112650567 A CN 112650567A CN 202011528255 A CN202011528255 A CN 202011528255A CN 112650567 A CN112650567 A CN 112650567A
Authority
CN
China
Prior art keywords
timer
verification code
file
uibutton
countdown
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
Application number
CN202011528255.7A
Other languages
Chinese (zh)
Inventor
吴曹敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011528255.7A priority Critical patent/CN112650567A/en
Publication of CN112650567A publication Critical patent/CN112650567A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4825Interrupt from clock, e.g. time of day

Abstract

The embodiment of the invention discloses a method and a device for realizing a global universal timer, computer equipment and a storage medium, and relates to the technical field of information security. The method comprises the following steps: if the verification code sending button is clicked on the display interface by a user to send a request for obtaining the verification code, generating a preset verification code according to a preset rule; acquiring an extension file of a preset timer, wherein the timer provides a countdown function; based on the UIButton, calling the extension file and associating the extension file with the verification code sending button so that the extension file with the timer forms an extension class of the UIButton; and starting the countdown function of the UIButton, and displaying the countdown time of the timer on the display interface. The method of the embodiment of the invention can realize the global universality of the timer, thereby avoiding the repeated setting of the timer, reducing the development workload of developers, facilitating the management of the timer and the troubleshooting of the problem and improving the maintainability of the timer.

Description

Implementation method and device of global universal timer and computer equipment
Technical Field
The present invention relates to the field of information security technologies, and in particular, to a method and an apparatus for implementing a global universal timer, a computer device, and a storage medium.
Background
When a user logs in and registers or retrieves a password flow in an APP, the flow usually relates to the requirement of verifying identity information by obtaining a short message verification code, and the APP interface has a countdown mode after sending the verification code so that the user can visually see the effective time limit of the verification code. In the prior art, usually, a timer is separately set in each process to count down an issued verification code, but because the logic of the timer in each process for performing countdown is similar, if a timer is separately set for each process to perform countdown, an APP developer needs to do a lot of repeated work during application development, which increases the development workload, and if there is a subsequent modification requirement for the countdown scheme of the timer, the developer needs to synchronously modify the countdown scheme of the timer of each process, which results in that the maintainability of the existing countdown scheme is not high.
Therefore, it is desirable to provide a method for implementing a global universal timer to reduce the development workload of developers, facilitate the management of the timer and the troubleshooting of problems, and improve the maintainability of the timer.
Disclosure of Invention
The embodiment of the invention provides a method and a device for realizing a global universal timer, computer equipment and a storage medium, and aims to solve the problems that the related art is too much in timer setting, the development workload of developers is large, the management of the timer and the troubleshooting of the timer are inconvenient, and the maintainability of the timer is not high.
In a first aspect, an embodiment of the present invention provides a method for implementing a global universal timer, where the method includes: if the verification code sending button is clicked on the display interface by a user to send a request for obtaining the verification code, generating a preset verification code according to a preset rule; acquiring an extension file of a preset timer, wherein the timer provides a countdown function; based on the UIButton, calling the extension file and associating the extension file with the verification code sending button so that the extension file carrying the timer forms an extension class of the UIButton; and starting the countdown function of the UIButton, and displaying the countdown time of the timer on the display interface.
In a second aspect, an embodiment of the present invention provides an apparatus for implementing a global universal timer, where the apparatus includes: the generation and sending unit is used for generating a preset verification code according to a preset rule if the verification code sending button is clicked by a user on the display interface to send a request for obtaining the verification code; the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an extended file of a preset timer, and the timer provides a countdown function; the calling association unit is used for calling the extended file and associating the extended file with the verification code sending button based on the UIButton so that the extended file carrying the timer forms an extended class of the UIButton; and the starting display unit is used for starting the countdown function of the UIButton and displaying the countdown time of the timer on the display interface.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor implements the method described above when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a storage medium storing a computer program which, when executed by a processor, may implement the method as described above.
The embodiment of the invention provides a method, a device, computer equipment and a storage medium for realizing a global universal timer, based on the method, if a user clicks a verification code sending button on a display interface to send a request for obtaining a verification code, a preset verification code is generated according to a preset rule, the verification code sending button obtains an extension file for realizing the timer, based on UIButton, the extension file is called and is associated with the verification code sending button, so that the extension file carrying the timer forms an extension class of the UIButton, when the verification code sending button calls the extension file and is associated with the extension file, a countdown function provided by the timer is started at the same time, and countdown time of the timer is displayed on the display interface. According to the technical scheme, the timer is arranged in the extension file which can be associated with the button triggering the countdown function, the timer is globally universal, repeated setting of the timer is avoided, development workload of developers is reduced, management and troubleshooting on the timer are facilitated, and maintainability of the timer is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for implementing a global universal timer according to an embodiment of the present invention;
fig. 2 is a schematic sub-flow diagram of a method for implementing a global universal timer according to an embodiment of the present invention;
fig. 3 is another schematic sub-flow diagram of a method for implementing a global universal timer according to an embodiment of the present invention;
fig. 4 is another schematic flowchart of a method for implementing a global universal timer according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a method for implementing a global universal timer according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a method for implementing a global universal timer according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of an implementation apparatus of the global universal timer of the present invention;
FIG. 8 is a schematic block diagram of a call correlation unit of an implementation apparatus of a global universal timer according to the present invention;
FIG. 9 is a schematic block diagram of an acquisition encapsulation subunit of an apparatus for implementing a global universal timer according to the present invention;
FIG. 10 is another schematic block diagram of an apparatus for implementing the global universal timer of the present invention;
FIG. 11 is another schematic block diagram of an apparatus for implementing the global universal timer of the present invention; and
FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for implementing a global universal timer according to an embodiment of the present invention. The implementation method of the global universal timer can be applied to terminals, such as intelligent terminals of mobile phones, tablet computers and the like, and the implementation method of the global universal timer is implemented through software installed on the terminals. The following describes the implementation method of the global universal timer in detail by taking the example that the implementation method is applied to a mobile phone terminal.
As shown in fig. 1, a flowchart of a method for implementing a global universal timer according to an embodiment of the present invention includes the following steps S110 to S140:
s110, if the fact that the user clicks the verification code sending button on the display interface to send out a verification code obtaining request is detected, generating a preset verification code according to a preset rule.
In an embodiment, when a user performs a login registration or password recovery process in a terminal, in an operation of verifying identity information by obtaining a verification code, when the user clicks a verification code sending button on a display interface to send a request for obtaining the verification code, a preset verification code is generated according to a preset rule.
And S120, acquiring an extension file of a preset timer, wherein the timer provides a countdown function.
In an embodiment, since the verification code sending button is a UI control for displaying in a display interface, the UIButton is associated with the UI control for providing an extended function for the UI control, when the verification code sending button located on the display interface needs to extend a timer to obtain a countdown function, the verification code sending button performs countdown function extension through the UIButton. When an extended file of a preset timer is acquired, wherein the timer provides a countdown function, the UIButton can be associated with a verification code sending button, the countdown function of the verification code sending button can be expanded, and the expanded related file for realizing the countdown function is used as the extended file of the UIButton.
S130, based on the UIButton, calling the extension file and associating the extension file with the verification code sending button, so that the extension file carrying the timer forms an extension class of the UIButton.
In an embodiment, based on the UIButton, the extension file is called and associated with the verification code sending button to realize that when the verification code sending button is clicked, a countdown function can be started, so that the extension file carrying the timer forms an extension class of the UIButton. When different processes in the same application program need to use the countdown function of the timer, the timers can be called and carried through the UIButton, and the buttons for triggering the countdown function in other processes are dynamically associated with the extension files for realizing the timers through the UIButton, so that the buttons for triggering the countdown function in other processes can be associated with the timers for providing the countdown function. The overall universality of the timer with the countdown function is realized by acquiring the extension file with the countdown function.
S140, starting the countdown function of the UIButton, and displaying the countdown time of the timer on the display interface.
In an embodiment, after the preset verification code is sent out, after the verification code sending button is associated with the extension file of the UIButton, a countdown function of the timer is started, and a countdown time of the timer is displayed on the display interface.
In an embodiment, as shown in fig. 2, the specific step of step S130 includes steps S131 to S133:
s131, acquiring a header file of the extended file of the timer.
S132, obtaining a swift file used for expanding the UIButton, and packaging the correlation attribute of the timer and the countdown method of the timer package into the swift file through the header file.
S133, obtaining the UIButton with the swift file, and associating the UIButton with the verification code sending button so that the extension file carrying the timer forms an extension class of the UIButton.
In an embodiment, since an extension class in the extension file cannot directly define a timer attribute, a header file of the extension file of the timer needs to be acquired, a swift file used for extending the UIButton is acquired, an association attribute of the timer and a countdown method for timer encapsulation are encapsulated into the swift file through the header file, the UIButton provided with the swift file is acquired, and the UIButton is associated with the verification code sending button. The method comprises the steps of packaging the correlation attribute of the timer and the countdown method of the timer package into the swift file through the header file of the timer, and then correlating the UIButton with the swift file with the verification code sending button to enable the extension file carrying the timer to form the extension class of the UIButton, so that the verification code sending button is correlated with the timer, and the countdown function of the timer is obtained to serve as the extension function. When the verification code sending button is clicked, the associated attribute of the associated timer and the countdown method of the timer package can be called. In this embodiment, the timer is created by a GCD, specifically, a dispatch _ source _ t local variable is declared in advance, a special dispatch source is created by a dispatch _ source _ create function to set the timer, and then a parameter of the timer is set by a dispatch _ source _ set _ timer function, for example, a timer starting time is set as a time for enabling the timer, the preset timer time is 60s, and when the timer is started, the timer starts to count down by taking a current time as a timer initial time and according to the set timer time.
In one embodiment, as shown in fig. 3, the specific step of step S132 includes steps S1321 to S1322:
s1321, calling an Xcode tool.
S1322, acquiring a swift file for expanding the UIButton based on the Xcode tool.
In an embodiment, since the guest capturing item is opened by an Xcode tool in advance, a swift file in the iOS is selected, and the swift file is created in the swift file, for example, the file name of the swift file is LKButton + extension.
In one embodiment, the timer is limited to use only within the extension class through the use of the filecreate permission limiter.
In one embodiment, since the timer is not exposed to the outside, the timer is restricted to be used only within the extension class through the use of the filerule permission limiter.
In an embodiment, as shown in fig. 4, steps S151 to S153 are further included after step S140:
and S151, judging whether the verification code is input in a verification code input box in the display interface in the countdown process. If the verification code input box in the display interface has no verification code input in the countdown process, executing step S152, and if the verification code input box in the display interface has verification code input in the countdown process, executing step S153.
S152, if the verification code input box in the display interface does not input the verification code in the countdown process, closing the interactive function of the verification code sending button, and continuously displaying countdown time on the display interface.
And S153, if the verification code is input in the verification code input frame in the display interface in the countdown process, stopping displaying the countdown time on the display interface.
In an embodiment, in the process of executing countdown, whether a verification code is input in a verification code input box in the display interface in the countdown process is judged, if the verification code is not input in the verification code input box in the display interface, the interactive function of the verification code sending button is closed, and countdown time is continuously displayed on the display interface, so that the user is prevented from repeatedly clicking the verification code sending button in the countdown process. And if the verification code input frame in the display interface has the input of the verification code in the countdown process, stopping displaying the countdown time on the display interface.
In an embodiment, as shown in fig. 5, step S152 is followed by steps S154-S155:
and S154, judging whether the countdown time of the timer is finished. If the countdown time of the timer is over, step S155 is executed, and if the countdown time of the timer is not over, the countdown is continued until the countdown time is over.
And S155, if the countdown time of the timer is over, restarting the interactive function of the verification code sending button, and displaying preset prompt information to remind a user to obtain the verification code again.
In an embodiment, if no verification code is input in the verification code input box in the display interface during the countdown process, determining whether the countdown time of the timer is over, if the countdown time of the timer is over, re-enabling the interactive function of the verification code sending button, and displaying a preset prompt message to remind the user to re-acquire the verification code, for example, resetting the title of the verification code sending button to be "re-acquire the verification code" to remind the user to click the verification code sending button again to re-acquire the verification code.
In an embodiment, as shown in fig. 6, the step S140 further includes steps S156 to S158:
and S156, judging whether the verification code sending button or the verification code input box in the display interface has abnormal error reporting. If the verification code sending button or the verification code input box in the display interface has an abnormal error, executing step S157, and if the verification code sending button or the verification code input box in the display interface has no abnormal error, executing step S158.
And S157, if the verification code sending button or the verification code input box in the display interface has abnormal error, re-starting the interactive function of the verification code sending button, and displaying preset prompt information to remind a user to re-acquire the verification code.
And S158, if the verification code sending button or the verification code input box in the display interface has no abnormal error, determining that the verification code input by the user is correct.
In an embodiment, based on the UIButton, when the verification code sending button is associated with the extension file carrying the countdown function, the countdown function of the UIButton is started, and the countdown time of the timer is displayed on the display interface, it is determined whether an abnormal error report exists in the verification code sending button or the verification code input box in the display interface. If the verification code sending button or the verification code input box in the display interface has an abnormal error, for example, the verification code sending button is clicked in the display interface, but the verification code cannot be sent out and the user cannot obtain the preset verification code sent out as a short message by using the short message obtaining interface for receiving the preset verification code, or the verification code input by the user and obtained by the verification code input box in the display interface are inconsistent with the sent preset verification code, the interactive function of the verification code sending button is restarted, and the title of the verification code sending button is set as the preset prompt information, for example, the title of the verification code sending button is set as 'reacquire verification code' to remind the user to click again to obtain a new preset verification code. And if the verification code sending button or the verification code input box in the display interface has no abnormal error, determining that the verification code input by the user on the verification code input interface in the display interface is correct.
According to the method provided by the invention, if the fact that a user clicks a verification code sending button on a display interface to send a request for obtaining the verification code is detected, a preset verification code is generated according to a preset rule, the verification code sending button obtains an extension file of a preset timer, based on UIButton, the extension file is called and is associated with the verification code sending button, so that the extension file carrying the timer forms an extension class of the UIButton, wherein the timer provides a countdown function, when the verification code sending button calls the extension file and is associated with the extension file, the countdown function of the timer is started at the same time, and the countdown time of the timer is displayed on the display interface. According to the technical scheme, the timer is arranged in the extension file which can be associated with the button triggering the countdown function, the timer is globally universal, repeated setting of the timer is avoided, development workload of developers is reduced, management and troubleshooting on the timer are facilitated, and maintainability of the timer is improved.
The method can be applied to intelligent government affairs/intelligent city management/intelligent community/intelligent logistics/intelligent medical treatment/intelligent education/intelligent environmental protection/intelligent traffic scene, for example, global universality of the timer can be realized by adopting the above mode when the verification codes are required to be sent and received in the above scene so as to verify personal account/identity information of the user, development workload of developers is reduced, the timer is convenient to manage and troubleshoot problems, maintainability of the timer is improved, and construction of a smart city is promoted.
Fig. 7 is a schematic block diagram of an apparatus for implementing a global universal timer according to an embodiment of the present invention. As shown in fig. 7, the present invention further provides an implementation apparatus 200 of a global universal timer, corresponding to the implementation method of the global universal timer. The implementation apparatus 200 of the global universal timer includes a unit for executing the implementation method of the global universal timer, and the apparatus may be configured in a terminal such as a mobile phone, a desktop computer, a tablet computer, a laptop computer, and the like. Specifically, referring to fig. 7, the apparatus 200 for implementing a global universal timer includes a generating unit 210, an obtaining unit 220, a call associating unit 230, and a starting display unit 240.
The generating unit 210 is configured to generate a preset verification code according to a preset rule if it is detected that a user clicks a verification code sending button on a display interface to send a request for obtaining the verification code.
The obtaining unit 220 is configured to obtain an extension file of a preset timer, where the timer provides a countdown function.
The call association unit 230 is configured to call the extension file based on the UIButton and associate the extension file with the verification code sending button, so that the extension file carrying the timer forms an extension class of the UIButton.
The starting display unit 240 is configured to start a countdown function of the UIButton, and display a countdown time of the timer on the display interface.
In some embodiments, for example, in the present embodiment, referring to fig. 8, the call association unit 230 includes a first obtaining subunit 231, a obtaining encapsulation subunit 232, and a obtaining association subunit 233.
The first obtaining subunit 231 is configured to obtain a header file of the extension file of the timer.
The obtaining and encapsulating subunit 232 is configured to obtain a swift file used for expanding the UIButton, and encapsulate the association attribute of the timer and the countdown method for timer encapsulation into the swift file through the header file.
The obtaining association subunit 233 is configured to obtain the UIButton provided with the swift file, and associate the UIButton with the verification code sending button, so that the extension file carrying the timer forms an extension class of the UIButton.
In some embodiments, such as this embodiment, referring to fig. 9, the obtain package subunit 232 includes a calling subunit 2321 and a second obtain subunit 2322.
The calling subunit 2321 is configured to call an Xcode tool.
The second obtaining subunit 2322 is configured to obtain, based on the Xcode tool, a swift file used for expanding the UIButton.
In some embodiments, such as this embodiment, the timer is limited to use only within the extension class through the use of the filecreate permission limiter.
In some embodiments, for example, in this embodiment, referring to fig. 10, the apparatus 200 for implementing a global universal timer further includes a first determining unit 251, a closing displaying unit 252, and a stopping unit 253.
The first judging unit 251 is configured to judge whether a verification code is input in a verification code input box in the display interface during the countdown process;
the closing display unit 252 is configured to close the interaction function of the verification code sending button and continue to display countdown time on the display interface if no verification code is input in the verification code input box in the display interface during the countdown process;
the stopping unit 253 is configured to stop displaying the countdown time on the display interface if a verification code is input in a verification code input box in the display interface during the countdown process.
In some embodiments, for example, in this embodiment, referring to fig. 11, the apparatus 200 for implementing a global universal timer further includes a second determination unit 254 and an enabling unit 255.
The second judging unit 254 is configured to judge whether the countdown time of the timer is over;
the enabling unit 255 is configured to re-enable the interactive function of the verification code sending button if the countdown time of the timer is over, and display a preset prompt message to remind the user to re-acquire the verification code.
It should be noted that, as can be clearly understood by those skilled in the art, the implementation apparatus 200 of the global universal timer and the specific implementation process of each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided herein.
The implementation means of the global universal timer may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 12.
Referring to fig. 12, fig. 12 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 300 is a terminal, and the terminal may be an electronic device having a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
Referring to fig. 12, the computer device 300 includes a processor 302, memory, and a network interface 305 connected by a system bus 301, where the memory may include a non-volatile storage medium 303 and an internal memory 304.
The nonvolatile storage medium 303 may store an operating system 3031 and a computer program 3032. The computer program 3032 comprises program instructions that, when executed, cause the processor 302 to perform a method for implementing a global universal timer.
The processor 302 is used to provide computing and control capabilities to support the operation of the overall computer device 300.
The internal memory 304 provides an environment for the running of the computer program 3032 in the non-volatile storage medium 303, and the computer program 3032, when executed by the processor 302, causes the processor 302 to execute a method for implementing the global universal timer.
The network interface 305 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 12 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer apparatus 300 to which the present application is applied, and that a particular computer apparatus 300 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 302 is configured to run a computer program 3032 stored in the memory to implement the following steps: if the verification code sending button is clicked on the display interface by a user to send a request for obtaining the verification code, generating a preset verification code according to a preset rule; acquiring an extension file of a preset timer, wherein the timer provides a countdown function; based on the UIButton, calling the extension file and associating the extension file with the verification code sending button so that the extension file carrying the timer forms an extension class of the UIButton; and starting the countdown function of the UIButton, and displaying the countdown time of the timer on the display interface.
In an embodiment, when implementing the step of calling the extension file and associating the extension file with the verification code sending button based on the UIButton, so that the extension file carrying the timer forms the extension class of the UIButton, the processor 302 specifically implements the following steps: acquiring a header file of the extended file of the timer; obtaining a swift file used for expanding the UIButton, and packaging the correlation attribute of the timer and the countdown method of the timer package into the swift file through the header file; acquiring the UIButton with the swift file, and associating the UIButton with the verification code sending button so that the extension file carrying the timer forms an extension class of the UIButton; wherein the timer is limited to use only within the extension class through use of the filecreate permission limiter.
In an embodiment, when the processor 302 implements the step of obtaining the swift file for extending the UIButton, the following steps are specifically implemented: calling an Xcode tool; and acquiring a swift file for expanding the UIButton based on the Xcode tool.
In an embodiment, after the step of implementing the countdown function for starting the UIButton and displaying the countdown time of the timer on the display interface, the processor 302 further implements the following steps: judging whether a verification code is input in a verification code input box in the display interface in the countdown process; if the verification code input frame in the display interface does not input the verification code in the countdown process, closing the interactive function of the verification code sending button and continuously displaying countdown time on the display interface; and if the verification code input frame in the display interface has the input of the verification code in the countdown process, stopping displaying the countdown time on the display interface.
In an embodiment, after implementing the step of closing the interactive function of the verification code sending button and continuing to display the countdown time on the display interface if the verification code input box in the display interface has no verification code input during the countdown process, the processor 302 further implements the following steps: judging whether the countdown time of the timer is finished or not; and if the countdown time of the timer is over, restarting the interactive function of the verification code sending button, and displaying preset prompt information to remind the user to obtain the verification code again.
It should be understood that, in the embodiment of the present application, the processor 302 may be a Central Processing Unit (CPU), and the processor 302 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program includes program instructions, and the computer program may be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a plurality of computer programs that collectively implement various embodiments of the implementation method of the global universal timer of the above-described steps when executed by a plurality of processors, respectively.
The storage medium may be a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk or an optical disk, and various computer readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for implementing a global universal timer is characterized by comprising the following steps:
if the verification code sending button is clicked on the display interface by a user to send a request for obtaining the verification code, generating a preset verification code according to a preset rule;
acquiring an extension file of a preset timer, wherein the timer provides a countdown function;
based on the UIButton, calling the extension file and associating the extension file with the verification code sending button so that the extension file carrying the timer forms an extension class of the UIButton;
and starting the countdown function of the UIButton, and displaying the countdown time of the timer on the display interface.
2. The method for implementing the global universal timer according to claim 1, wherein the step of calling the extension file and associating the extension file with the verification code sending button based on the UIButton so that the extension file carrying the timer forms an extension class of the UIButton comprises:
acquiring a header file of the extended file of the timer;
obtaining a swift file used for expanding the UIButton, and packaging the correlation attribute of the timer and the countdown method of the timer package into the swift file through the header file;
and acquiring the UIButton with the swift file, and associating the UIButton with the verification code sending button so that the extension file carrying the timer forms an extension class of the UIButton.
3. The method for implementing the global universal timer according to claim 2, wherein the step of obtaining the swift file for extending the UIButton comprises:
calling an Xcode tool;
and acquiring a swift file for expanding the UIButton based on the Xcode tool.
4. The method of claim 2, wherein the timer is restricted to use only within the extension class through use of a filecreate permission limiter.
5. The method for implementing a global universal timer according to claim 1, wherein the step of starting the countdown function of the UIButton and displaying the countdown time of the timer on the display interface further comprises:
judging whether a verification code is input in a verification code input box in the display interface in the countdown process;
if the verification code input frame in the display interface does not input the verification code in the countdown process, closing the interactive function of the verification code sending button and continuously displaying countdown time on the display interface;
and if the verification code input frame in the display interface has the input of the verification code in the countdown process, stopping displaying the countdown time on the display interface.
6. The method as claimed in claim 5, wherein if no verification code is entered in the verification code entry box of the display interface during the countdown process, the method further comprises the step of turning off the interactive function of the verification code sending button and continuing to display the countdown time on the display interface, after the step of:
judging whether the countdown time of the timer is finished or not;
and if the countdown time of the timer is over, restarting the interactive function of the verification code sending button, and displaying preset prompt information to remind the user to obtain the verification code again.
7. An apparatus for implementing a global universal timer, comprising:
the generating unit is used for generating a preset verification code according to a preset rule if the verification code sending button is clicked by a user on the display interface to send a request for obtaining the verification code;
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an extended file of a preset timer, and the timer provides a countdown function;
the calling association unit is used for calling the extended file and associating the extended file with the verification code sending button based on the UIButton so that the extended file carrying the timer forms an extended class of the UIButton;
and the starting display unit is used for starting the countdown function of the UIButton and displaying the countdown time of the timer on the display interface.
8. The apparatus for implementing a global universal timer according to claim 7, wherein the call association unit comprises:
a first obtaining subunit, configured to obtain a header file of the extended file of the timer;
an obtaining and packaging subunit, configured to obtain a swift file used for expanding the UIButton, and package, by using the header file, an association attribute of a timer and a countdown method for timer packaging into the swift file;
and the obtaining association subunit is used for obtaining the UIButton provided with the swift file and associating the UIButton with the verification code sending button so that the extended file carrying the timer forms an extended class of the UIButton.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-6 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, is adapted to carry out the method according to any one of claims 1-6.
CN202011528255.7A 2020-12-22 2020-12-22 Implementation method and device of global universal timer and computer equipment Pending CN112650567A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011528255.7A CN112650567A (en) 2020-12-22 2020-12-22 Implementation method and device of global universal timer and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011528255.7A CN112650567A (en) 2020-12-22 2020-12-22 Implementation method and device of global universal timer and computer equipment

Publications (1)

Publication Number Publication Date
CN112650567A true CN112650567A (en) 2021-04-13

Family

ID=75359082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011528255.7A Pending CN112650567A (en) 2020-12-22 2020-12-22 Implementation method and device of global universal timer and computer equipment

Country Status (1)

Country Link
CN (1) CN112650567A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114428531A (en) * 2022-01-25 2022-05-03 上海中通吉网络技术有限公司 Method for unified timing on App

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114428531A (en) * 2022-01-25 2022-05-03 上海中通吉网络技术有限公司 Method for unified timing on App

Similar Documents

Publication Publication Date Title
WO2020140683A1 (en) Task scheduling method and apparatus, computer device, and storage medium
CN108023808B (en) Message distribution method and device in application program
WO2015188771A1 (en) Method and apparatus for processing application notification message, and terminal device
WO2022027867A1 (en) Mdc-based multithreaded link tracking method and apparatus, and computer-readable storage medium
CN107678782B (en) Process protection method, device, equipment and computer readable storage medium
CN111708655A (en) Application crash processing method, device and system
CN112118459A (en) Method for realizing common live broadcast of multiple apps by sharing camera data and readable medium
WO2017118315A1 (en) Security verification method and device for smart card application
CN111737137B (en) Interface test data generation method and device, host and storage medium
CN114257551A (en) Distributed current limiting method and system and storage medium
CN110764894A (en) Timed task management method, device, equipment and storage medium
CN107943270A (en) Control method, device and the storage medium and mobile terminal of application service
CN115495142A (en) Cloud resource arranging method and device, computer equipment and storage medium
CN112650567A (en) Implementation method and device of global universal timer and computer equipment
CN108509228B (en) Page loading method, terminal equipment and computer readable storage medium
CN108037989B (en) SDK component identification method and device
WO2019071927A1 (en) Authorization information obtaining method and apparatus, electronic device, and readable storage medium
CN106933932B (en) Data processing method and device and application server
CN117056904A (en) Application privacy compliance judging method, device, computer equipment and medium
CN109981873B (en) Address book permission opening method and device and electronic equipment
CN111416857A (en) Client crash processing method, device, system, equipment and storage medium
CN109086115B (en) Android animation execution method, device, terminal and readable medium
CN110659082A (en) Application program interface display method and device, terminal and storage medium
CN108133123B (en) Application program identification method and system
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium

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