CN112035203B - Interface polling method, device, equipment and storage medium - Google Patents

Interface polling method, device, equipment and storage medium Download PDF

Info

Publication number
CN112035203B
CN112035203B CN202010887295.4A CN202010887295A CN112035203B CN 112035203 B CN112035203 B CN 112035203B CN 202010887295 A CN202010887295 A CN 202010887295A CN 112035203 B CN112035203 B CN 112035203B
Authority
CN
China
Prior art keywords
polling
access
data interface
interface
duration
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.)
Active
Application number
CN202010887295.4A
Other languages
Chinese (zh)
Other versions
CN112035203A (en
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.)
Beijing Inspur Data Technology Co Ltd
Original Assignee
Beijing Inspur Data Technology 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 Beijing Inspur Data Technology Co Ltd filed Critical Beijing Inspur Data Technology Co Ltd
Priority to CN202010887295.4A priority Critical patent/CN112035203B/en
Publication of CN112035203A publication Critical patent/CN112035203A/en
Application granted granted Critical
Publication of CN112035203B publication Critical patent/CN112035203B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses an interface polling method, an interface polling device, interface polling equipment and a storage medium. The method comprises the following steps: acquiring the access duration of the data interface, wherein the access duration is the interval duration which takes the moment of initiating an access request to the data interface as the initial moment and takes the moment of finishing page loading on response data of the data interface as the termination moment; generating a polling interval time length which is greater than or equal to the access time length according to the access time length; a polling access is performed to the data interface based on the polling interval duration. The method can avoid the blockage of the data interface, and relatively ensures the reliability of the front-end page for updating and displaying the data in the cloud platform. In addition, the application also provides an interface polling device, equipment and a storage medium, and the beneficial effects are as described above.

Description

Interface polling method, device, equipment and storage medium
Technical Field
The present application relates to the field of cloud computing, and in particular, to an interface polling method, apparatus, device, and storage medium.
Background
The cloud platform is also called a cloud computing platform, and refers to a network application platform which provides computing, network and storage capabilities based on services of hardware resources and software resources.
In the cloud platform, the data content of the service layer and the data layer continuously changes along with data acquisition and service flow, and the data content changing in real time needs to be reflected in the front-end page. However, the front-end page is generally static, and if the latest data needs to be acquired, the front-end page often needs to access a data interface of the cloud platform and load the accessed data, so as to achieve the purpose of synchronously displaying real-time changed data content. The front-end page usually accesses the data interface in a polling mode and displays the accessed data on the front-end page, but the current polling access to the data interface is easy to cause the blocking of the data interface, and the reliability of the front-end page for updating and displaying the data in the cloud platform is difficult to ensure.
Therefore, it is a problem to be solved by those skilled in the art to provide an interface polling method to relatively ensure the reliability of the front-end page for displaying the data update in the cloud platform.
Disclosure of Invention
The application aims to provide an interface polling method, an interface polling device, interface polling equipment and a storage medium, so that the reliability of updating and displaying data in a cloud platform by a front-end page is relatively ensured.
In order to solve the above technical problem, the present application provides an interface polling method, including:
acquiring the access duration of the data interface, wherein the access duration is the interval duration which takes the moment of initiating an access request to the data interface as the initial moment and takes the moment of finishing page loading on response data of the data interface as the termination moment;
generating a polling interval duration which is greater than or equal to the access duration according to the access duration;
a polling access is performed to the data interface based on the polling interval duration.
Preferably, performing polling access to the data interface based on the polling interval duration includes:
generating a timer object;
setting the polling interval duration as the trigger interval duration of the timer object, and setting the access request to the data interface as the trigger event of the timer object;
a polling access is performed to the data interface based on the timer object.
Preferably, performing a polling access to the data interface based on the timer object includes:
running timer objects and counting the number of target timer objects reaching the event triggering moment;
judging whether the number of the target timer objects is larger than a request concurrency threshold value or not;
if the number of the target timer objects is larger than the request concurrency threshold value, dividing the target timer objects into a plurality of execution groups, and controlling the target timer objects in a corresponding execution group to execute corresponding trigger events at each unit time in sequence; wherein the target timer object in each execution group is less than or equal to the request concurrency threshold.
Preferably, when the number of target timer objects is less than or equal to the request concurrency threshold, the method further comprises:
the control target timer object performs the corresponding trigger event.
Preferably, the method further comprises:
acquiring timer objects to be cleared meeting clearing conditions from the timer objects;
and controlling the thread to which the timer object to be cleared belongs to clear the timer object to be cleared.
Preferably, acquiring the timer object to be cleared satisfying the clearing condition from the timer objects includes:
and acquiring a timer object to be cleared, of which the data interface does not exist in the current front-end page, in the timer object.
Preferably, after performing polling access to the data interface based on the polling interval duration, the method further comprises:
and loading the response data of the data interface to the front-end page.
In addition, the present application also provides an interface polling device, including:
the time length obtaining module is used for obtaining the access time length of the data interface, wherein the access time length takes the moment of initiating an access request to the data interface as the starting moment and takes the moment of finishing page loading on response data of the data interface as the interval time length of the ending moment;
the interval generation module is used for generating polling interval duration which is greater than or equal to the access duration according to the access duration;
and the polling access module is used for performing polling access on the data interface based on the polling interval duration.
In addition, the present application also provides an interface polling device, including:
a memory for storing a computer program;
a processor for implementing the steps of the interface polling method as described above when executing a computer program.
Furthermore, the present application also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the interface polling method as described above.
The interface polling method provided by the application comprises the steps of firstly obtaining access duration of a data interface, wherein the access duration takes the moment of initiating an access request to the data interface as an initial moment and the moment of finishing page loading on response data of the data interface as interval duration of a termination moment, further generating polling interval duration which is greater than or equal to the access duration after obtaining the access duration, and executing polling access on the data interface based on the polling interval duration. Because the polling interval duration in the method is greater than or equal to the whole duration for accessing the data interface to acquire the response data and completing the page loading of the response data, the method can relatively ensure that each access to the same data interface in the polling process is performed after the data interface has completed the previous round of data response and the response data is loaded on the front-end page, can avoid the blocking of the data interface, and relatively ensure the reliability of the front-end page for updating and displaying the data in the cloud platform. In addition, the application also provides an interface polling device, equipment and a storage medium, and the beneficial effects are as described above.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of an interface polling method disclosed in an embodiment of the present application;
fig. 2 is a flowchart of an interface polling method disclosed in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an interface polling device disclosed in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
In the cloud platform, the data content of the service layer and the data layer continuously changes along with data acquisition and service flow, and the data content changing in real time needs to be reflected in the front-end page. However, the front-end page is generally static, and if the latest data needs to be acquired, the front-end page often needs to access a data interface of the cloud platform and load the accessed data, so as to achieve the purpose of synchronously displaying real-time changed data content. The front-end page usually accesses the data interface in a polling mode and displays the accessed data on the front-end page, but the current polling access to the data interface easily causes the blocking of the data interface, and the reliability of the front-end page for updating and displaying the data in the cloud platform is difficult to ensure.
Therefore, the core of the application is to provide an interface polling method to relatively ensure the reliability of the front-end page for data update display in the cloud platform.
In order that those skilled in the art will better understand the disclosure, the following detailed description is given with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present application discloses an interface polling method, including:
step S10: and acquiring the access duration of the data interface.
The access duration is an interval duration which takes the moment of initiating an access request to the data interface as an initial moment and takes the moment of finishing page loading on response data of the data interface as an end moment.
It should be noted that the data Interface in this step refers to an Application Programming Interface (API) for providing service data to the front-end page of the cloud platform by the bottom-layer Application of the cloud platform, and is some predefined functions, or refers to an agreement for linking different components of the software system. The system comprises a set of routines for providing access to software or hardware for application programs and developers, and does not need to access source codes or understand details of internal working mechanisms when data access is performed on the cloud platform bottom application through a data interface.
In this step, the access duration of the data interface may be obtained specifically by reading a configuration file, or may be counted by accessing the data interface.
It should be emphasized that the key point of this embodiment is that the access duration is an interval duration which takes a time when an access request is initiated to the data interface as a starting time and a time when the page loading of the response data of the data interface is completed as an ending time, that is, the access duration is an overall duration which is required from the initiation of the data access request to the data interface until the response data fed back by the data interface is loaded to the front page.
Step S11: and generating a polling interval duration which is greater than or equal to the access duration according to the access duration.
It should be noted that, after the access duration of the data interface is obtained, the step further generates a polling interval duration greater than or equal to the access duration according to the access duration, where the polling interval duration referred to herein refers to a time interval between two adjacent data access requests initiated to the data interface. The polling interval duration in this step needs to be greater than or equal to the access duration, so that each time a data access request is initiated to the data interface, it can be ensured that the data interface has completed a response to the previous access request, and data obtained from the previous access is loaded to the front-end page.
Step S12: a polling access is performed to the data interface based on the polling interval duration.
After generating a polling interval duration greater than or equal to the access duration in accordance with the access duration, this step further performs a polling access to the data interface based on the polling interval duration.
The interface polling method provided by the application comprises the steps of firstly obtaining access duration of a data interface, wherein the access duration takes the moment of initiating an access request to the data interface as an initial moment and the moment of finishing page loading on response data of the data interface as interval duration of a termination moment, further generating polling interval duration which is greater than or equal to the access duration after obtaining the access duration, and executing polling access on the data interface based on the polling interval duration. Because the polling interval duration in the method is greater than or equal to the whole duration for accessing the data interface to acquire the response data and completing the page loading of the response data, the method can relatively ensure that each access to the same data interface in the polling process is performed after the data interface has completed the previous round of data response and the response data is loaded on the front-end page, can avoid the blocking of the data interface, and relatively ensure the reliability of the front-end page for updating and displaying the data in the cloud platform.
Referring to fig. 2, an embodiment of the present application discloses an interface polling method, including:
step S20: and acquiring the access duration of the data interface.
The access duration is an interval duration which takes the moment of initiating an access request to the data interface as an initial moment and takes the moment of finishing page loading on response data of the data interface as an end moment.
Step S21: and generating a polling interval duration which is greater than or equal to the access duration according to the access duration.
Step S22: a timer object is generated.
It should be noted that the timer object generated in this step refers to an application object capable of performing a specific operation after a specific time period. The step of generating the timer object may be performed before the step of acquiring the access duration of the data interface or before the step of generating the polling interval duration greater than or equal to the access duration according to the access duration, or may be performed simultaneously with any of the above steps, which is not specifically limited herein.
Step S23: and setting the polling interval duration as the trigger interval duration of the timer object, and setting the access request to the data interface as the trigger event of the timer object.
After the timer object and the polling interval duration are obtained, the triggering interval duration of the timer object is further set as the polling interval duration, and the triggering event of the timer object is set as the access request to the data interface, so that the access request to the data interface is triggered by the timer according to the triggering interval duration in the subsequent steps.
Step S24: a polling access is performed to the data interface based on the timer object.
After the timer object is set, the step further executes polling access to the data interface based on the timer object, that is, the timer object performs timing through the timer object, when the timing duration reaches the triggering interval duration, the timer object executes a triggering event for initiating an access request to the data interface, and performs the next round of timing again after executing the triggering event, so as to achieve the purpose of executing polling access to the data interface. According to the embodiment, the overall reliability of the interface polling process is further ensured by the mode that the timer object executes polling access to the data interface based on the polling interval duration.
On the basis of the above embodiment, as a preferred implementation, performing polling access to the data interface based on the timer object includes:
running timer objects, and counting the number of target timer objects reaching the event triggering moment;
judging whether the number of the target timer objects is larger than a request concurrency threshold value or not;
if the number of the target timer objects is larger than the request concurrency threshold value, dividing the target timer objects into a plurality of execution groups, and controlling the target timer objects in a corresponding execution group to execute corresponding trigger events at each unit time in sequence; wherein the target timer object in each execution group is less than or equal to the request concurrency threshold.
It should be noted that, considering that when the front-end page initiates an access request to the data interface, the operation resource of the front-end page is occupied, and at the same unit time, the number of requests that the front-end page can initiate is often limited, and is affected by the number of HTTP (HyperText Transfer Protocol) concurrent requests, and the front-end page can only concurrently issue access requests smaller than or equal to the number of concurrent requests at the unit time.
When polling access is performed on a data interface based on a timer object, the timer object is firstly operated, then the number of target timers with the timed duration reaching the trigger interval duration in the timer object is counted, and then whether the number of the target timers is greater than a request concurrency threshold is judged, wherein the concurrency threshold referred to herein is a value less than or equal to the number of HTTP concurrent requests, if the number of the target timers is greater than the request concurrency threshold, the target timers are divided into a plurality of execution groups, and the target timers in a corresponding execution group are sequentially controlled to execute corresponding trigger events at each unit time, that is, when the number of the target timers is greater than the request concurrency threshold, the target timers in each execution group are grouped to obtain execution groups, the target timers in each execution group are less than or equal to the request concurrency threshold, and each execution group respectively corresponds to one unit time, and then the target timers in a corresponding execution group are sequentially controlled to execute corresponding trigger events at each unit time, so as to ensure that the number of the trigger events is less than or equal to the number of the concurrent requests of each unit. The embodiment further ensures the overall reliability of the polling access process performed on the data interface based on the timer object.
Further, as a preferred embodiment, when the number of target timer objects is less than or equal to the request concurrency threshold, the method further comprises:
the control target timer object performs the corresponding trigger event.
In the present embodiment, when the number of target timer objects is smaller than or equal to the request concurrency threshold as a result of determining whether the number of target timer objects is greater than the request concurrency threshold, the target timer objects are controlled to execute corresponding trigger events in a concurrent manner. The embodiment further ensures the overall reliability of the polling access process performed on the data interface based on the timer object.
On the basis of the above embodiment, as a preferred implementation, the method further includes:
acquiring timer objects to be cleared meeting clearing conditions from the timer objects;
and controlling the thread to which the timer object to be cleared belongs to clear the timer object to be cleared.
It should be noted that the interface polling method in this embodiment further includes an operation of clearing the timer object, specifically, acquiring a timer object to be cleared that meets a clearing condition from the timer object, and further controlling a thread to which the timer object to be cleared belongs to clear the timer object to be cleared, that is, deleting the timer object to be cleared. The clearing condition here can be determined according to the actual demand of the user, the key point of the embodiment is that the control thread clears the timer object to be cleared of the thread, so that the purpose of releasing the calculation resource occupied by the thread can be achieved, the crash of a front-end page caused by the exhaustion of the calculation resource is avoided, the thread can be further used for controlling the newly-operated timer object to execute interface polling, and the overall reliability of the interface polling process is further ensured.
Further, as a preferred embodiment, acquiring a timer object to be cleared, which satisfies a clearing condition, in the timer object, includes:
and acquiring the timer object to be cleared of which the data interface does not exist in the current front-end page from the timer objects.
It should be noted that, in the present embodiment, the clearing condition is that the data interface corresponding to the trigger event in the timer object does not exist in the current front-end page, that is, when the current front-end page does not need to access the acquired response data through a certain timer object by using the data interface, the timer object is taken as the timer object to be cleared. The embodiment further improves the overall reliability of acquiring the timer object to be cleared from the timer object.
On the basis of the above series of embodiments, as a preferred embodiment, after performing polling access to the data interface based on the polling interval duration, the method further includes:
and loading the response data of the data interface to the front-end page.
It should be noted that in this embodiment, polling access is performed on the data interface based on the polling interval duration, and the response data of the data interface is further loaded to the front-end page, so that the response data of the data interface can be displayed through the front-end page, and it is further ensured that the front-end page can update and display the service data in the cloud computing platform in real time.
Referring to fig. 3, an embodiment of the present application provides an interface polling apparatus, including:
a duration obtaining module 10, configured to obtain an access duration of the data interface, where the access duration is an interval duration in which a time when an access request is initiated to the data interface is an initial time, and a time when page loading is completed on response data of the data interface is an end time;
an interval generation module 11, configured to generate a polling interval duration greater than or equal to the access duration according to the access duration;
and the polling access module 12 is used for performing polling access on the data interface based on the polling interval duration.
The interface polling device provided by the application firstly obtains the access duration of the data interface, the access duration takes the moment of initiating an access request to the data interface as the starting moment and the moment of finishing page loading on response data of the data interface as the interval duration of the ending moment, after the access duration is obtained, the polling interval duration which is greater than or equal to the access duration is further generated, and polling access is executed on the data interface based on the polling interval duration. Because the polling interval duration in the device is greater than or equal to the whole duration for accessing the data interface to acquire the response data and completing the page loading of the response data, the device can relatively ensure that each access to the same data interface in the polling process is performed after the data interface has completed the previous round of data response and the response data is loaded on the front-end page, thereby avoiding the blockage of the data interface and relatively ensuring the reliability of the front-end page in updating and displaying the data in the cloud platform.
In addition, the present application also provides an interface polling device, including:
a memory for storing a computer program;
a processor for implementing the steps of the interface polling method as described above when executing a computer program.
The interface polling device provided by the application firstly obtains the access duration of the data interface, the access duration takes the moment of initiating an access request to the data interface as the starting moment and the moment of finishing page loading on response data of the data interface as the interval duration of the ending moment, after obtaining the access duration, the interface polling device further generates the polling interval duration which is greater than or equal to the access duration, and executes polling access on the data interface based on the polling interval duration. Because the polling interval duration in the equipment is greater than or equal to the duration of the whole process of acquiring the response data by the access data interface and completing the page loading of the response data, the data response of the previous round of the data interface can be completed in each access of the same data interface in the polling process, and the response data is loaded to the front-end page, so that the blocking of the data interface can be avoided, and the reliability of the front-end page for updating and displaying the data in the cloud platform is relatively ensured.
Furthermore, the present application also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the interface polling method as described above.
The computer-readable storage medium provided by the application firstly obtains the access duration of the data interface, the access duration takes the moment of initiating an access request to the data interface as the starting moment and takes the moment of completing page loading on response data of the data interface as the interval duration of the ending moment, after obtaining the access duration, a polling interval duration which is greater than or equal to the access duration is further generated, and polling access is executed on the data interface based on the polling interval duration. Because the polling interval duration in the computer-readable storage medium is greater than or equal to the whole duration for accessing the data interface to acquire the response data and completing page loading of the response data, the data response of the data interface in the previous round can be completed in each access of the same data interface in the polling process, and the response data is loaded to the front-end page, so that the blocking of the data interface can be avoided, and the reliability of the front-end page for updating and displaying the data in the cloud platform is relatively ensured.
The above description details an interface polling method, apparatus, device and storage medium provided by the present application. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.

Claims (8)

1. An interface polling method, comprising:
acquiring an access duration of a data interface, wherein the access duration is an interval duration which takes a moment of initiating an access request to the data interface as an initial moment and takes a moment of finishing page loading on response data of the data interface as an ending moment;
generating a polling interval duration which is greater than or equal to the access duration according to the access duration;
performing a polling access to the data interface based on the polling interval duration;
wherein the performing polling access to the data interface based on the polling interval duration comprises:
generating a timer object;
setting the polling interval duration as a trigger interval duration of the timer object, and setting an access request to the data interface as a trigger event of the timer object;
performing a polling access to the data interface based on the timer object;
correspondingly, the method further comprises:
acquiring timer objects to be cleared meeting clearing conditions from the timer objects;
and controlling the thread to which the timer object to be cleared belongs to clear the timer object to be cleared.
2. The interface polling method of claim 1, wherein performing a polling access to the data interface based on the timer object comprises:
running the timer objects, and counting the number of target timer objects reaching the event triggering moment;
judging whether the number of the target timer objects is larger than a request concurrency threshold value or not;
if the number of the target timer objects is larger than the request concurrency threshold, dividing the target timer objects into a plurality of execution groups, and controlling the target timer objects in a corresponding execution group to execute the corresponding trigger events at each unit time in sequence; wherein the target timer object in each of the execution groups is less than or equal to the request concurrency threshold.
3. The interface polling method of claim 2, wherein when the number of target timer objects is less than or equal to the request concurrency threshold, the method further comprises:
and controlling the target timer object to execute the corresponding trigger event.
4. The interface polling method according to claim 1, wherein the acquiring, from the timer objects, the to-be-cleared timer object that satisfies a clearing condition comprises:
and acquiring the timer object to be cleared, of which the data interface does not exist in the current front-end page, in the timer object.
5. The interface polling method of any one of claims 1 to 4, wherein after the performing polling access to the data interface based on the polling interval duration, the method further comprises:
and loading the response data of the data interface to a front-end page.
6. An interface polling apparatus, comprising:
the time length obtaining module is used for obtaining the access time length of a data interface, wherein the access time length is the interval time length which takes the moment of initiating an access request to the data interface as the starting moment and takes the moment of finishing page loading of response data of the data interface as the ending moment;
the interval generation module is used for generating a polling interval duration which is greater than or equal to the access duration according to the access duration;
the polling access module is used for performing polling access on the data interface based on the polling interval duration;
wherein performing polling access to the data interface based on the polling interval duration comprises:
generating a timer object;
setting the polling interval duration as a trigger interval duration of the timer object, and setting an access request to the data interface as a trigger event of the timer object;
performing a polling access to the data interface based on the timer object;
correspondingly, the method further comprises the following steps:
acquiring timer objects to be cleared meeting clearing conditions from the timer objects;
and controlling the thread to which the timer object to be cleared belongs to clear the timer object to be cleared.
7. An interface polling device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the interface polling method according to any one of claims 1 to 5 when executing said computer program.
8. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the interface polling method according to any one of claims 1 to 5.
CN202010887295.4A 2020-08-28 2020-08-28 Interface polling method, device, equipment and storage medium Active CN112035203B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010887295.4A CN112035203B (en) 2020-08-28 2020-08-28 Interface polling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010887295.4A CN112035203B (en) 2020-08-28 2020-08-28 Interface polling method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112035203A CN112035203A (en) 2020-12-04
CN112035203B true CN112035203B (en) 2023-04-07

Family

ID=73586800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010887295.4A Active CN112035203B (en) 2020-08-28 2020-08-28 Interface polling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112035203B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590410B (en) * 2021-06-20 2023-12-22 济南浪潮数据技术有限公司 Resource request method, system, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108134808A (en) * 2016-12-01 2018-06-08 阿里巴巴集团控股有限公司 A kind of network request method and device
CN110134036A (en) * 2019-04-26 2019-08-16 深圳市龙控智能技术有限公司 A kind of method, monitoring system and the storage medium of serial port data acquisition poll
WO2020112143A1 (en) * 2018-11-30 2020-06-04 Hewlett-Packard Development Company, L.P. Polling computing devices

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4779962B2 (en) * 2006-12-25 2011-09-28 パナソニック電工株式会社 Remote monitoring device
GB2499534B (en) * 2010-11-01 2018-09-19 Seven Networks Llc Caching adapted for mobile application behavior and network conditions
CN108512917B (en) * 2018-03-23 2021-02-26 杭州迪普科技股份有限公司 Data pushing method and system based on Websocket
CN109491803B (en) * 2018-10-11 2021-08-24 腾讯科技(深圳)有限公司 Page processing method and device and related equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108134808A (en) * 2016-12-01 2018-06-08 阿里巴巴集团控股有限公司 A kind of network request method and device
WO2020112143A1 (en) * 2018-11-30 2020-06-04 Hewlett-Packard Development Company, L.P. Polling computing devices
CN110134036A (en) * 2019-04-26 2019-08-16 深圳市龙控智能技术有限公司 A kind of method, monitoring system and the storage medium of serial port data acquisition poll

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘强 ; 杨岳湘 ; 唐川 ; .基于动态轮询策略的网络故障监视算法.计算机工程与设计.2009,(第09期),全文. *

Also Published As

Publication number Publication date
CN112035203A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CN105740326B (en) Thread state monitoring method and device for browser
US10628189B2 (en) Synchronous operation method performance in context of asynchronous event loop
US11018965B1 (en) Serverless function scaling
CN108491122B (en) Click event response method, computer readable storage medium and terminal equipment
CN112035203B (en) Interface polling method, device, equipment and storage medium
WO2014075599A1 (en) Method, device and system for processing client environment data
CN112988185A (en) Cloud application updating method, device and system, electronic equipment and storage medium
JP5754301B2 (en) Transaction concurrency control system, transaction concurrency control method, and program
CN112199170A (en) Timing processing method, device and equipment of real-time operating system and storage medium
CN109710679B (en) Data extraction method and device
US9442971B2 (en) Weighted transaction priority based dynamically upon phase of transaction completion
CN111026524A (en) Method and device for processing delay task, computer equipment and storage medium
CN113157426A (en) Task scheduling method, system, equipment and storage medium
US20130174166A1 (en) Efficient Sequencer
CN104462116B (en) Data selection method and device
CN109271193A (en) A kind of data processing method, device, equipment and storage medium
CN109325199A (en) It is a kind of to reduce the method and electronic equipment that webpage redraws number using programming language
CN108196934B (en) Timing setting method and device of timer and virtualization equipment
CN113191114A (en) Method and apparatus for authenticating a system
WO2019169727A1 (en) Network traffic test method and apparatus, device, and computer-readable storage medium
CN109521894A (en) Business executes method, apparatus and electronic equipment
CN112433872A (en) Interface request timeout reminding method, system and storage medium
CN107678945B (en) Method and device for judging webpage application blocking
CN109426554B (en) Timing implementation method and device for server
CN112805978A (en) Enhanced anchor protocol for event stream processing

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
GR01 Patent grant
GR01 Patent grant