Countdown processing system, method, component, equipment and medium

Through the collaborative work of the countdown component and the server, the unified management of the countdown function is realized, the problem of code redundancy in the existing technology is solved, and the code reusability and management efficiency are improved.

CN120499247APending Publication Date: 2025-08-15SHENZHEN LEXIN INFORMATION SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510478244.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, the countdown function needs to be written and managed separately in each page that requires countdown, resulting in severe code redundancy and increasing the development and maintenance workload.

Method used

It provides a countdown processing system, which calls the countdown component through the client, uses the countdown component to subscribe to the countdown service to the countdown server, obtains the remaining countdown time in real time, and feedbacks information at the end of the countdown, unsubscribe to unsubscribe to uniformly manage the countdown logic.

Benefits of technology

It reduces code redundancy, improves code reusability, facilitates unified management of global countdown, and reduces the amount of tasks to implement and maintain countdown functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499247A_ABST
    Figure CN120499247A_ABST
Patent Text Reader

Abstract

The invention provides a countdown processing system, method, component, equipment and medium, and relates to the technical field of computers, a client calls a countdown component when needing countdown on any interactive page, and subscribes to countdown service from a countdown server by using the component so as to add monitoring at the countdown server, so that the countdown processing efficiency is improved. The countdown remaining time is obtained in real time through the monitoring, the countdown assembly feeds back countdown ending information to the client side when countdown is ended, and the monitoring is cancelled. When any interaction page needs countdown, the countdown component can be called by the client, and then the countdown component is responsible for interacting with the countdown service, so that the countdown task is completed. Therefore, unified countdown processing logic is provided, code redundancy of the countdown processing logic is reduced, code reusability is improved, meanwhile, unified management of global countdown is facilitated, and the task load of implementation and maintenance of the countdown function is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a countdown processing system, method, component, device and medium. Background Art

[0002] In today's digital age, countdown features are widely used in many fields. For example, countdowns are widely used in various application pages and mini-program pages. For example, the payment countdown on the order page and the game end countdown on the game page are all involved in the user interaction process.

[0003] In existing technologies, countdown functions are usually implemented locally, requiring the countdown logic to be written and managed separately on each page that requires the countdown function. This implementation method increases the workload of developing, maintaining, and expanding the countdown function, and also causes serious code redundancy. Summary of the Invention

[0004] Based on this, it is necessary to provide a countdown processing system, method, component, device and medium to address the above technical problems, so as to simplify the implementation and maintenance of the countdown function and improve code reusability.

[0005] In the first aspect, a countdown processing system is proposed, which includes: a client, a countdown component and a countdown server; the client is used to call the countdown component when there is a countdown requirement on the interactive page, and pass preset input parameters to the countdown component, wherein the preset input parameters include countdown time information; the countdown component is used to send the preset input parameters to the countdown server, and subscribe to the countdown service of the countdown server to add a countdown monitoring function in the countdown server; the countdown server is used to obtain the remaining countdown time in real time according to the countdown time information in the preset input parameters; and return the remaining countdown time to the countdown component through the countdown monitoring function; the countdown component is used to receive the remaining countdown time; when the remaining countdown time is zero, the countdown end information is fed back to the client, and the subscription to the countdown service is canceled to remove the countdown monitoring function from the countdown server.

[0006] In an embodiment of the present application, after receiving the remaining countdown time, the countdown component is further used to: render the remaining countdown time to the interactive page.

[0007] In an embodiment of the present application, the countdown time information includes the countdown end time, and the real-time acquisition of the countdown remaining time based on the countdown time information includes: obtaining the system time of the countdown server; calculating the time difference between the system time and the countdown end time, determining the countdown remaining time, and refreshing the countdown remaining time in real time.

[0008] In an embodiment of the present application, after the client calls the countdown component, it is also used to: request the countdown component to pause the countdown when the interactive page enters the background hidden state; and request the countdown component to start the countdown when the interactive page switches from the background hidden state to the user interface display state.

[0009] In an embodiment of the present application, the countdown component is also used to: when the client requests to pause the countdown, record the latest received countdown remaining time, and cancel the subscription to the countdown service to remove the countdown listening function from the countdown server; when the client requests to start the countdown, send the latest received countdown remaining time to the countdown server, and re-subscribe to the countdown service to add the countdown listening function to the countdown server; so that the countdown server can refresh the latest received countdown remaining time in real time, and return the refreshed countdown remaining time to the countdown component.

[0010] In an embodiment of the present application, the preset input information also includes a time rendering format; the countdown server is further used to: format the countdown remaining time according to the time rendering format, and return the formatted countdown remaining time to the countdown component.

[0011] In the second aspect, a countdown processing method is proposed, which includes: obtaining preset input parameters sent by the client when there is a countdown requirement on the interactive page, and the preset input parameters include countdown time information; sending the preset input parameters to the countdown server, and subscribing to the countdown service of the countdown server to add a countdown monitoring function in the countdown server; receiving the countdown remaining time returned by the countdown server through the countdown monitoring function, and the countdown remaining time is obtained in real time by the countdown server according to the countdown time information; when the countdown remaining time is zero, feedback countdown end information to the client, and cancel the subscription to the countdown service to remove the countdown monitoring function from the countdown server.

[0012] In a third aspect, a countdown component is proposed, which includes: an acquisition module for acquiring preset input parameters sent by the client when there is a countdown requirement on the interactive page, wherein the preset input parameters include countdown time information; a sending module for sending the preset input parameters to the countdown server, and subscribing to the countdown service of the countdown server to add a countdown monitoring function in the countdown server; a receiving module for receiving the countdown remaining time returned by the countdown server through the countdown monitoring function, wherein the countdown remaining time is obtained in real time by the countdown server according to the countdown time information; a processing module for feeding back countdown end information to the client when the countdown remaining time is zero, and canceling the subscription to the countdown service to remove the countdown monitoring function from the countdown server.

[0013] In a fourth aspect, an electronic device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the countdown processing method proposed in the second aspect are implemented.

[0014] In a fifth aspect, a computer-readable storage medium is proposed, on which a computer program is stored. When the program is executed by a processor, the steps of the countdown processing method proposed in the second aspect are implemented.

[0015] In summary, the present application proposes a countdown processing system, method, component, device and medium. The system uses the client to provide a countdown service for any interactive page by calling the countdown component when the countdown is required. The client passes preset input parameters including countdown time information to the called countdown component, so that the countdown component provides the preset input parameters to the countdown server and subscribes to the countdown service to the countdown server. The countdown server adds a countdown monitoring function to the subscriber who subscribes to the countdown service on this end. The countdown server uses the provided countdown service to obtain the remaining countdown time in real time according to the countdown time information in the preset input parameters, and uses the countdown monitoring function to return the remaining countdown time to the countdown component. The countdown component then determines whether the countdown is over based on the remaining countdown time, and feeds back countdown end information to the client at the end of the countdown, and cancels the subscription of the countdown server to remove the countdown monitoring function corresponding to the countdown component from the countdown server. This application provides unified countdown management in this way. When any interactive page requires a countdown, the client can call the countdown component, and then the countdown component is responsible for interacting with the countdown service to complete the countdown task. This is equivalent to only calling the countdown component through the client when the interactive page requires a countdown. There is no need to design a complete countdown processing code for each interactive page with a countdown requirement. The unified countdown processing logic provided by this application can be reused for the countdown requirements of each interactive page, thereby reducing code redundancy and improving code reusability. At the same time, it facilitates the unified management of the global countdown and reduces the amount of tasks required to implement and maintain the countdown function. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0017] Figure 1 This is a multi-terminal interaction diagram of a countdown processing system according to an exemplary embodiment of the present application; Figure 2 is a flow chart of a countdown processing system according to an exemplary embodiment of the present application; Figure 3 is a multi-terminal interaction diagram of a countdown processing system according to another exemplary embodiment of the present application; Figure 4 is a flowchart of a countdown processing method according to an exemplary embodiment of the present application; Figure 5 is a schematic block diagram of a countdown component according to an exemplary embodiment of the present application; Figure 6 It is a schematic block diagram of an electronic device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. The embodiments described with reference to the drawings are exemplary and are intended to be used to explain this application, and should not be understood as limiting this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0019] Figure 1 The figure is a multi-terminal interaction diagram of a countdown processing system according to an exemplary embodiment of the present application.

[0020] like Figure 1 As shown, the countdown processing system may include but is not limited to a client, a countdown component, and a countdown server.

[0021] The client can be the caller, and the countdown server can be the provider of the countdown service. It should be noted that the client can be the device where the caller resides or a program capable of implementing the countdown component call function; the server can be the device that provides the countdown service or a program capable of implementing the countdown service. This application does not limit the specific form of the client and server.

[0022] When a countdown is required on an interactive page, the client calls the countdown component and passes preset input parameters to the countdown component.

[0023] For example, the client can be an application client such as WeChat or Alipay, and the interactive page is a mini-program page that needs to be displayed on the user interface. When a user operation triggers the display of the mini-program page on the user interface, the client can analyze whether the mini-program page requires a countdown. If so, the client can satisfy the countdown requirement of the mini-program page by calling the countdown component.

[0024] The client passes input parameters to the called countdown component, i.e., inputs preset input parameters to the countdown component. These preset input parameters may include, but are not limited to, countdown time information. The countdown time information can be used to represent information related to the countdown requirements of the mini program page, such as the countdown duration or countdown end time.

[0025] The countdown component receives preset input parameters from the client and sends them to the countdown server. The countdown service can be understood as a service class that provides global countdown functionality. This countdown service implements the countdown by calling the APIs of various utility classes (for example, utility classes that provide system time acquisition and time subtraction functions).

[0026] The countdown component is also used to subscribe to the countdown service of the countdown server. For example, when the client and the server are deployed on different devices respectively, after calling the countdown component, the client passes the preset input parameters to the countdown component, and the countdown component generates a countdown service subscription request and writes the above preset input parameters into the countdown service subscription request; then, the countdown component sends the countdown service subscription request to the countdown server, and the countdown server receives the countdown service subscription request, locally adds a countdown listening function for returning the countdown result to the countdown component and creates a unique ID for the listening function, and then returns the unique ID to the countdown component, so that the countdown component can use the unique ID to request the countdown server to remove the countdown listening function when needed. Among them, the countdown listening function can be understood as a listening program or a listening mechanism, which is used to feedback relevant information of the service to the service subscriber. It should be noted that this is only an exemplary implementation for the countdown component to subscribe to the countdown service, and is not a limitation on the specific implementation of the countdown component to subscribe to the countdown service.

[0027] The countdown server provides countdown services to subscribers (such as the aforementioned countdown component). The countdown server obtains the remaining countdown time in real time based on the countdown time information in the preset input parameters provided by the countdown component. Through the countdown listening function added to the countdown component, the countdown server returns the real-time remaining countdown time to the countdown component. For example, the countdown server uses a service class that provides a global countdown function to process the countdown time information to obtain the remaining countdown time. For example, the remaining countdown time may include remaining hours, remaining minutes, remaining seconds, etc. It is worth noting that this is only an exemplary description of the remaining countdown time and does not limit the remaining countdown time.

[0028] The countdown component receives the remaining countdown time returned by the countdown server and determines whether the remaining countdown time is 0.

[0029] When the remaining countdown time reaches zero, the countdown component determines that the countdown is complete and sends a countdown end message to the client to remind the client that the countdown has ended. After receiving the countdown end message, the client can trigger subsequent processing tasks.

[0030] In addition, the countdown component can further cancel the subscription to the countdown service when the remaining countdown time reaches zero. For example, when the countdown component needs to cancel the subscription to the countdown server, it sends a request to cancel the service subscription to the countdown server and writes the unique ID mentioned in the above example in the request to cancel the service subscription; after receiving the request to cancel the service subscription, the countdown server will remove the countdown monitoring function corresponding to the unique ID. It should be noted that this is only an exemplary implementation for canceling the countdown service, and is not a limitation on the specific implementation of canceling the countdown service.

[0031] In summary, the countdown processing system provided by the embodiment of the present application utilizes the client to provide a countdown service for any interactive page by calling the countdown component when the countdown is required. The client passes preset input parameters including countdown time information to the called countdown component, so that the countdown component provides the preset input parameters to the countdown server and subscribes to the countdown service to the countdown server. The countdown server adds a countdown monitoring function to the subscriber who subscribes to the countdown service on this end. The countdown server uses the provided countdown service to obtain the remaining countdown time in real time according to the countdown time information in the preset input parameters, and uses the countdown monitoring function to return the remaining countdown time to the countdown component. The countdown component then determines whether the countdown is over based on the remaining countdown time, and feeds back the countdown end information to the client at the end of the countdown, and cancels the subscription of the countdown server so as to remove the countdown monitoring function corresponding to the countdown component from the countdown server. The present application provides a unified countdown management in this way. When a countdown is required on any interactive page, the countdown component can be called by the client, and the countdown component is responsible for interacting with the countdown service to complete the countdown task. This is equivalent to calling the countdown component through the client when the interactive page requires a countdown. There is no need to design a complete countdown processing code for each interactive page with a countdown requirement. The unified countdown processing logic provided by this application can be reused for the countdown requirements of each interactive page, thereby reducing code redundancy and improving code reusability. At the same time, it facilitates the unified management of the global countdown and reduces the amount of tasks required to implement and maintain the countdown function.

[0032] In some embodiments, when an interactive page needs to display a countdown, after the countdown component receives the remaining countdown time obtained in real time by the countdown server, the countdown component renders the remaining time to the interactive page.

[0033] For example, if a mini-program page within Alipay needs to display different countdowns at two different locations on the user interface, the Alipay client can call the countdown components at the nodes corresponding to the two locations in the mini-program page's node tree and pass the preset input parameters related to the countdown at the corresponding location to the called countdown components. After obtaining the remaining countdown time, each countdown component renders the remaining countdown time at the corresponding location.

[0034] It should be noted that the countdown components called at different locations in this example can be understood as different application instances of a program package. When the countdown component is needed to implement the countdown function, the program package corresponding to the countdown component is called to create an application instance at the calling location. The application instance is destroyed when the call is canceled or the call ends. In this embodiment, the countdown component is used to realize the self-rendering of the remaining countdown time, and the countdown processing logic of each interactive page is unified (including countdown and countdown rendering). When there is a countdown demand at any location of any interactive page, the countdown can be obtained by calling the countdown component with the help of a unified countdown service, and the countdown can be displayed by relying on the self-rendering mechanism of the countdown component. The resources occupied by each interactive page are reduced, thereby reducing the performance overhead of the interactive page.

[0035] In some embodiments, the above-mentioned preset input information may also include a time rendering format. For example, the interactive page needs to render the remaining hours, minutes, and seconds in the format of xx:xx:xx.

[0036] In this case, the countdown server is also used to format the countdown remaining time obtained in real time according to the time rendering format provided in the preset input information, and return the formatted countdown remaining time to the countdown component.

[0037] Furthermore, when a countdown display is required on an interactive page, the client can obtain the time rendering format required by the interactive page. The client then passes the time rendering format as a parameter in the preset input information to the countdown component, allowing the countdown component to obtain the remaining countdown time that meets the time rendering format requirements by subscribing to the countdown service. Conversely, when a countdown display is not required on an interactive page, the client does not need to obtain the time rendering format.

[0038] This embodiment further improves the unified architecture of countdown processing by transmitting the time rendering format to the countdown server, and also centralizes the format conversion involved in the countdown task to be executed by the countdown server.

[0039] In some embodiments, if the countdown time information includes the countdown end time, such as Figure 2As shown, the process of the countdown server obtaining the remaining countdown time in real time according to the countdown time information may include the following steps: S201, obtaining the system time of the countdown server.

[0040] For example, the system time can be obtained by calling getSystemTime (a function that obtains system time). System time is the time displayed by the internal clock of an electronic device. The system time is typically initialized from the hardware clock when the device is started. Alternatively, to ensure the accuracy and consistency of the system time, the device synchronizes with a standard time server using methods such as the Network Time Protocol.

[0041] In this embodiment, the countdown server may be deployed in a server or service cluster corresponding to the client, or deployed together with the client in the same electronic device.

[0042] S202, calculating the time difference between the system time and the countdown end time, determining the countdown remaining time, and refreshing the countdown remaining time in real time.

[0043] For example, the time difference between the system time and the countdown end time can be calculated by calling the diffTime function in the Time tool class, and the time difference can be used as the remaining countdown time. The calculated time difference is then refreshed in real time using a timer.

[0044] In some embodiments, after the client calls the countdown component, the client is further configured to: Get the state of the interactive page. When the interactive page enters the background hidden state, the client requests the countdown component to pause the countdown; when the interactive page switches from the background hidden state to the user interface display state, the client requests the countdown component to start the countdown.

[0045] For example, when a user enters the order payment page, which needs to display a payment countdown, the client invokes the countdown component to process the payment countdown and renders the real-time remaining countdown time on the payment page. If the user switches to another page, the payment page will enter a hidden backstage state. After the payment page enters a hidden backstage state, the client requests the countdown component to pause the countdown. In response to the client's request to pause the countdown, the countdown component cancels its subscription to the countdown service, removing the countdown listener function on the countdown server that returns the remaining countdown time to the countdown component.

[0046] When the user switches back to the payment page, the payment page switches from the background hidden state to the user interface display state; after the payment page switches from the background hidden state to the user interface display state, the client requests the countdown component to start the countdown, that is, requests the countdown component to continue the countdown involved in the payment page; the countdown component responds to the client's request to start the countdown, re-subscribes to the countdown service, and re-adds the countdown listening function to the countdown server, so that the countdown server continues to execute the countdown service subscribed by the countdown component and returns the real-time obtained countdown remaining time to the countdown component.

[0047] In this embodiment, after the interactive page enters the background hidden state, the countdown is paused by the countdown component, and the countdown is resumed when the interactive page is re-displayed on the user interface. In this way, the countdown processing is paused when the interactive page enters the background running, thereby saving the processing resources occupied by the interactive page.

[0048] In some embodiments, when the client requests to pause the countdown, the countdown component records the latest received countdown remaining time and cancels the subscription to the countdown service to remove the countdown monitoring function from the countdown server.

[0049] When the client requests to start the countdown, the countdown component sends the latest received countdown remaining time to the countdown server and re-subscribes to the countdown service to add a countdown listening function on the countdown server; so that the countdown server can refresh the latest received countdown remaining time in real time and return the refreshed countdown remaining time to the countdown component.

[0050] In some embodiments, the client of this application may refer to the running program corresponding to the interactive page, and the countdown server may refer to the running program corresponding to the countdown service; the running program corresponding to the interactive page and the running program corresponding to the countdown service may be deployed simultaneously on the same terminal device. When there is a countdown requirement on the interactive page, the running program corresponding to the interactive page calls the countdown component, so that the countdown component adds a countdown listener to the running program corresponding to the countdown service. The countdown service determines the remaining countdown time by calling the API in the time processing tool class Time, such as getSystemTime and diffTime.

[0051] For example, Figure 3As shown, the caller (such as the running program corresponding to the interactive page) calls a countdown component (such as the count-down component) and passes in the countdown end time and time rendering format. After being called, the countdown component adds a listener to the countdown service (such as countdownservice). When processing the countdown, the countdown service first calls the system time acquisition tool (getSystemTime) to obtain the system time, and then calls the diffTime method in the Time tool class to obtain the remaining countdown time. The countdown service refreshes the remaining countdown time in real time and returns the remaining countdown time obtained at each moment to the countdown component in real time through the countdown listening function. The countdown component renders the received countdown remaining time to the caller's interactive page and returns the countdown end information to the caller when the remaining countdown time reaches the preset remaining time, while removing the specified listening function.

[0052] In this way, a global countdown service class framework is deployed in the terminal device. When any interactive page requires countdown, the framework can be used to continue the countdown processing. There is no need to design countdown logic for each interactive page, which realizes the collection of countdown logic code and reduces code redundancy.

[0053] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0054] Figure 4 A countdown processing method is shown according to an exemplary embodiment of the present application. Figure 4 As shown, the method includes the following steps: S401, obtaining preset input parameters sent by the client when there is a countdown requirement on the interactive page, where the preset input parameters include countdown time information.

[0055] S402: Sending preset input parameters to the countdown server, and subscribing to the countdown service of the countdown server to add a countdown monitoring function in the countdown server.

[0056] S403: Receive the countdown remaining time returned by the countdown server through the countdown monitoring function. The countdown remaining time is obtained in real time by the countdown server according to the countdown time information.

[0057] S404: When the remaining countdown time reaches zero, countdown end information is fed back to the client, and the subscription to the countdown service is canceled to remove the countdown monitoring function from the countdown server.

[0058] It should be noted that the implementation of the above steps S401-S404 can refer to the description of the countdown component implementation steps in the above embodiment, and will not be repeated here.

[0059] In some embodiments, after receiving the countdown remaining time in the above step S403, the countdown processing method further includes: rendering the countdown remaining time to the interactive page.

[0060] In some embodiments, when the client requests to pause the countdown, the latest received countdown remaining time is recorded, and the subscription to the countdown service is canceled to remove the countdown monitoring function from the countdown server; when the client requests to start the paused countdown, the latest received countdown remaining time is sent to the countdown server, and the countdown service is re-subscribed to add the countdown monitoring function to the countdown server.

[0061] In some embodiments, the preset input information also includes a time rendering format, and the preset input information is sent to the countdown server so that the countdown server formats the obtained countdown remaining time according to the time rendering format in the preset input information.

[0062] In summary, the countdown processing method provided by the embodiment of the present application receives preset input parameters passed in by the client when any interactive page requires a countdown, provides the preset input parameters to the countdown server and subscribes to the countdown service to the countdown server, so that the countdown server adds a countdown monitoring function on this end for the subscriber who subscribes to the countdown service, and then obtains the countdown remaining time in real time based on the countdown time information in the preset input parameters through the countdown monitoring function. Then, the countdown processing method of the present application determines whether the countdown is over based on the remaining countdown time, and feeds back the countdown end information to the client at the end of the countdown, and cancels the subscription of the countdown server at the same time so as to remove the countdown monitoring function corresponding to the countdown component from the countdown server. When any interactive page requires a countdown, the preset input parameters provided by the client can be received through this method, and interaction with the countdown service can be initiated to complete the countdown task. It is equivalent to the countdown processing method provided by this application, which provides a countdown processing proxy service for any interactive page of the client that requires a countdown. In this way, the countdown processing logic is unified, and a global countdown implementation method is provided for the client. In this way, there is no need to design a complete countdown processing code for each interactive page with a countdown requirement. The unified countdown processing logic provided by this application can be reused for the countdown requirements of each interactive page, thereby reducing code redundancy and improving code reusability. At the same time, it facilitates the unified management of the global countdown and reduces the amount of tasks required to implement and maintain the countdown function.

[0063] Figure 5This is a block diagram of a countdown component according to an exemplary embodiment of the present application. Figure 5 As shown, the countdown component 500 includes: an acquisition module 501 , a sending module 502 , a receiving module 503 and a processing module 504 .

[0064] The acquisition module 501 is used to acquire preset input parameters sent by the client when there is a countdown requirement on the interactive page, and the preset input parameters include countdown time information.

[0065] The sending module 502 is configured to send preset input parameters to the countdown server and subscribe to the countdown service of the countdown server to add a countdown monitoring function in the countdown server.

[0066] The receiving module 503 is used to receive the countdown remaining time returned by the countdown server through the countdown monitoring function. The countdown remaining time is obtained in real time by the countdown server according to the countdown time information.

[0067] The processing module 504 is configured to feed back countdown end information to the client when the remaining countdown time reaches zero, and cancel the subscription to the countdown service to remove the countdown monitoring function from the countdown server.

[0068] In some embodiments, the countdown component 500 further includes a rendering module for rendering the remaining countdown time to an interactive page.

[0069] In some embodiments, the processing module 504 is also used to: when the client requests to pause the countdown, record the latest received countdown remaining time, and cancel the subscription to the countdown service to remove the countdown service listening function from the countdown server; when the client requests to start the paused countdown, send the latest received countdown remaining time to the countdown server, and re-subscribe to the countdown service to add the countdown listening function on the countdown server.

[0070] In some embodiments, the preset input information further includes a time rendering format. The sending module 502 sends the preset input information to the countdown server so that the countdown server formats the obtained countdown remaining time according to the time rendering format in the preset input information.

[0071] In summary, the countdown component provided by the embodiment of the present application receives preset input parameters passed in by the client when any interactive page requires a countdown, provides the preset input parameters to the countdown server, and subscribes to the countdown service to the countdown server, so that the countdown server adds a countdown monitoring function on this end for the subscriber who subscribes to the countdown service, and then obtains the countdown remaining time in real time based on the countdown time information in the preset input parameters through the countdown monitoring function. Then, the countdown processing device of the present application determines whether the countdown is over based on the remaining countdown time, and feeds back the countdown end information to the client at the end of the countdown, and cancels the subscription of the countdown server at the same time so as to remove the countdown monitoring function corresponding to the countdown component from the countdown server. When any interactive page requires a countdown, the preset input parameters provided by the client can be received through this method to initiate interaction with the countdown service, thereby completing the countdown task. It is equivalent to the countdown processing device provided by this application, which provides a countdown processing proxy service for any interactive page of the client that requires a countdown. In this way, the countdown processing logic is unified, and a global countdown implementation method is provided for the client. In this way, there is no need to design a complete countdown processing code for each interactive page with a countdown requirement. The unified countdown processing logic provided by this application can be reused for the countdown requirements of each interactive page, thereby reducing code redundancy and improving code reusability. At the same time, it facilitates the unified management of the global countdown and reduces the amount of tasks required to implement and maintain the countdown function.

[0072] To implement the above embodiment, the embodiment of the present application also proposes an electronic device 600, including a memory 601, a processor 602 and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the steps of the countdown processing method in the above embodiment are implemented.

[0073] To implement the above embodiment, the embodiment of the present application further proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the countdown processing method are implemented.

[0074] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0075] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0076] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A countdown processing system, characterized in that: The system includes: a client, a countdown component and a countdown server; The client is used to call the countdown component when there is a countdown requirement on the interactive page, and pass preset input parameters to the countdown component, wherein the preset input parameters include countdown time information of the interactive page; The countdown component is used to send the preset input parameters to the countdown server and subscribe to the countdown service of the countdown server to add a countdown monitoring function in the countdown server; The countdown server is used to obtain the remaining countdown time in real time according to the countdown time information in the preset input parameters; and return the remaining countdown time to the countdown component through the countdown monitoring function; The countdown component is used to receive the remaining countdown time; when the remaining countdown time is zero, it feeds back countdown end information to the client, and cancels the subscription to the countdown service to remove the countdown monitoring function from the countdown server.

2. The countdown processing system according to claim 1, characterized in that: After receiving the remaining countdown time, the countdown component is further configured to: The remaining countdown time is rendered to the interactive page.

3. The countdown processing system according to claim 1, characterized in that: The countdown time information includes the countdown end time, and the real-time acquisition of the countdown remaining time according to the countdown time information in the preset input parameters includes: Obtain the system time of the countdown server; The time difference between the system time and the countdown end time is calculated to determine the countdown remaining time, and the countdown remaining time is refreshed in real time.

4. The countdown processing system according to claim 3, characterized in that: After the client calls the countdown component, it is further used to: When the interactive page enters the background hidden state, requesting the countdown component to pause the countdown; When the interactive page switches from the background hidden state to the user interface displayed state, the countdown component is requested to start the countdown.

5. The countdown processing system according to claim 4, characterized in that: The countdown component is also used to: When the client requests to pause the countdown, recording the latest received countdown remaining time, and canceling the subscription to the countdown service to remove the countdown monitoring function from the countdown server; When the client requests to start the countdown, the countdown remaining time received most recently is sent to the countdown server, and the countdown service is re-subscribed to add the countdown monitoring function to the countdown server; so that the countdown server can refresh the countdown remaining time received most recently in real time, and return the refreshed countdown remaining time to the countdown component.

6. The countdown processing system according to claim 1, characterized in that: The preset input information also includes a time rendering format; the countdown server is further configured to: The countdown remaining time is formatted according to the time rendering format, and the formatted countdown remaining time is returned to the countdown component.

7. A countdown processing method, characterized in that: The method comprises: Obtaining preset input parameters sent by the client when a countdown is required on an interactive page, wherein the preset input parameters include countdown time information; Sending the preset input parameters to a countdown server, and subscribing to the countdown service of the countdown server to add a countdown monitoring function in the countdown server; Receiving the countdown remaining time returned by the countdown server through the countdown monitoring function, where the countdown remaining time is obtained in real time by the countdown server according to the countdown time information; When the remaining countdown time is zero, countdown end information is fed back to the client, and the subscription to the countdown service is canceled to remove the countdown monitoring function from the countdown server.

8. A countdown component, characterized in that: The countdown component includes: An acquisition module, configured to acquire preset input parameters sent by the client when a countdown requirement exists on an interactive page, wherein the preset input parameters include countdown time information; A sending module, configured to send the preset input parameters to a countdown server, and subscribe to the countdown service of the countdown server to add a countdown monitoring function in the countdown server; A receiving module, configured to receive the countdown remaining time returned by the countdown server through the countdown monitoring function, wherein the countdown remaining time is obtained in real time by the countdown server according to the countdown time information; The processing module is used to feed back countdown end information to the client when the remaining countdown time is zero, and cancel the subscription of the countdown service to remove the countdown monitoring function from the countdown server.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the countdown processing method according to claim 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the countdown processing method according to claim 7 are implemented.