CN112422662A - Method for overall scheduling of website global polling request - Google Patents

Method for overall scheduling of website global polling request Download PDF

Info

Publication number
CN112422662A
CN112422662A CN202011238341.4A CN202011238341A CN112422662A CN 112422662 A CN112422662 A CN 112422662A CN 202011238341 A CN202011238341 A CN 202011238341A CN 112422662 A CN112422662 A CN 112422662A
Authority
CN
China
Prior art keywords
website
control right
label
page
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011238341.4A
Other languages
Chinese (zh)
Inventor
吴建亮
胡鹏
陈文帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Jeeseen Network Technologies Co Ltd
Original Assignee
Guangzhou Jeeseen Network Technologies 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 Guangzhou Jeeseen Network Technologies Co Ltd filed Critical Guangzhou Jeeseen Network Technologies Co Ltd
Priority to CN202011238341.4A priority Critical patent/CN112422662A/en
Publication of CN112422662A publication Critical patent/CN112422662A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

A method for overall scheduling of global polling requests of a website comprises the following steps: generating a unique identifier for each of a plurality of label pages of the same website opened by a user; giving control right to a global polling request of a label page website opened for the first time; storing the unique identification of the label page for obtaining the control right; the label page which obtains the control right initiates a global polling request; judging whether the label page with the control right is closed or not, if so, setting the unique identifier of the label page stored in the empty state, and competing the rest label pages for the control right of the website polling request, otherwise, continuously judging whether the label page with the control right is closed or not; and the first response tab page in the rest tab pages obtains the control right of the website global polling request, and the tab page newly obtaining the control right initiates the global polling request. The method reduces the number of simultaneously sent requests by distributing the label page control right, so that resources occupied by a plurality of label pages of the same website when polling requests are carried out are greatly reduced.

Description

Method for overall scheduling of website global polling request
Technical Field
The invention relates to the technical field of computer networks, in particular to a method for overall polling requests of a comprehensive website.
Background
Polling is a way for the CPU to decide how to provide services to peripheral devices, also called "program controlled input/output", in order to solve the problem of server overstress. The polling method is that CPU sends out inquiry regularly to inquire each peripheral equipment in sequence whether it needs its service, if so, it gives service, after the service is over, it asks the next peripheral equipment, and then it repeats.
Currently, most websites have the requirement of polling requests, and the polling requests are sent at regular time mainly in a timer mode. However, in the case where the user opens the same website multiple times, that is, the same website exists in the form of multiple tab pages. The process of sending the request regularly by means of the timer sends the request regularly for each tab page when the request of global polling is carried out, but the server only responds to the request sent by one tab page. Therefore, when a plurality of tab pages send requests simultaneously, only the resources such as servers occupied by the requests for obtaining the server responses are effectively utilized, and the resources such as more servers occupied by the requests for not obtaining the responses are useless, thereby causing resource waste.
Therefore, it is necessary to provide a method for orchestrating the global polling requests of the website to overcome the deficiencies of the prior art.
Disclosure of Invention
One of the objectives of the present invention is to provide a method for overall scheduling of a website global polling request, which is capable of reducing the number of requests and saving resources such as servers and broadband by limiting the number of tab pages that send requests by limiting the tab pages to obtain the control right of the website global polling request.
The above object of the present invention is achieved by the following technical measures.
The method for overall scheduling the global polling request of the website comprises the following steps:
s1: and generating a unique identifier for each of a plurality of label pages of the same website opened by the user.
S2: and giving control over the global polling request of the website of the tab page opened for the first time.
S3: the unique identification of the tab page that gained control is stored.
S4: the tab page that obtains control initiates a global polling request.
S5: and judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and entering the step S6, otherwise, continuously judging whether the label page obtaining the control right is closed.
S6: the remaining tab pages compete for control of the website's polling request.
S7: the first response tab page in the remaining tab pages obtains the control right of the website global polling request, and the process returns to step S3.
Preferably, the unique identification of the local storage memory tag page is used in step S3.
Preferably, when the tab page having the control authority initiates the global polling request, the remaining tab pages do not initiate a request at step S4.
The invention discloses a global polling request method for a pool website, which comprises the following steps: s1: generating a unique identifier for each of a plurality of label pages of the same website opened by a user; s2: giving control right to a global polling request of a label page website opened for the first time; s3: storing the unique identification of the label page for obtaining the control right; s4: the label page which obtains the control right initiates a global polling request; s5: judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in null, and entering the step S6, otherwise, continuously judging whether the label page obtaining the control right is closed; s6: the rest label pages compete for the control right of the website polling request; s7: the first response tab page in the remaining tab pages obtains the control right of the website global polling request, and the process returns to step S3. The first opened label page can initiate a global polling request, the rest label pages are not sent, after the first label page is sent, one sending request is selected from the rest label pages until all the label pages send the requests, the number of the requests sent by the plurality of label pages at the same time can be limited, and resources such as a server, a broadband and the like are saved.
One of the objectives of the present invention is to provide a device for orchestrating a website global polling request, which can limit the number of tab pages for sending requests by limiting the tab pages to obtain the control right of the website global polling request, reduce the number of requests, and save resources such as servers and broadband.
The above object of the present invention is achieved by the following technical measures.
An apparatus for orchestrating website global polling requests is provided, comprising:
the identification generation module is used for generating a unique identification for each of a plurality of label pages of the same website opened by a user;
the control right issuing module is used for giving the control right of the website global polling request to the tab page which is opened for the first time;
the storage module is used for storing the unique identification of the label page for obtaining the control right;
the request initiating module is used for initiating a global polling request by the label page which obtains the control right;
and the judging module is used for judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and the rest label pages compete for the control right of the website polling request, otherwise, continuously judging whether the label page obtaining the control right is closed.
Preferably, the identification generation module is further configured to issue a control right of the website global polling request to a first response tab page of the remaining tab pages.
Preferably, the storage module is a local storage module.
Preferably, when the tab page having the control right initiates the global polling request, the request initiating module is further configured to restrict the remaining tab pages from initiating no request.
The invention discloses a global polling request device for a pool website, which comprises: the identification generation module is used for generating a unique identification for each of a plurality of label pages of the same website opened by a user; the control right issuing module is used for giving the control right of the website global polling request to the tab page which is opened for the first time; the storage module is used for storing the unique identification of the label page for obtaining the control right; the request initiating module is used for initiating a global polling request by the label page which obtains the control right; and the judging module is used for judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and the rest label pages compete for the control right of the website polling request, otherwise, continuously judging whether the label page obtaining the control right is closed. The first opened label page can initiate a global polling request, the rest label pages are not sent, and after the first label page is sent, one sending request is selected from the rest label pages until all the label pages are sent. The device for overall polling requests of the overall website can limit the number of requests sent by a plurality of label pages at the same time, and resources such as a server and a broadband are saved.
Another object of the present invention is to provide a computer-readable storage medium storing a program capable of limiting the number of tab pages to send requests, reducing the number of requests, and saving resources such as servers, broadband, etc., by limiting the control right of the tab pages to obtain the global polling request of the website, thereby avoiding the disadvantages of the prior art.
The above object of the present invention is achieved by the following technical measures.
There is provided a computer-readable storage medium storing a program for executing a method of orchestrating website global polling requests.
The computer-readable storage medium of the present invention stores a program for executing a method for aggregating global polling requests of a website, comprising the steps of: s1: generating a unique identifier for each of a plurality of label pages of the same website opened by a user; s2: giving control right to a global polling request of a label page website opened for the first time; s3: storing the unique identification of the label page for obtaining the control right; s4: the label page which obtains the control right initiates a global polling request; s5: judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in null, and entering the step S6, otherwise, continuously judging whether the label page obtaining the control right is closed; s6: the rest label pages compete for the control right of the website polling request; s7: the first response tab page in the remaining tab pages obtains the control right of the website global polling request, and the process returns to step S3. The first opened label page can initiate a global polling request, the rest label pages are not sent, and after the first label page is sent, one sending request is selected from the rest label pages until all the label pages are sent. The computer readable storage medium can limit the number of requests sent by a plurality of label pages at the same time, and save resources such as a server and a broadband.
Drawings
The invention is further illustrated by means of the attached drawings, the content of which is not in any way limiting.
FIG. 1 is a flowchart illustrating a method for orchestrating website global polling requests according to the present invention.
Detailed Description
The invention is further illustrated by the following examples.
Example 1.
A method for overall scheduling of global polling requests of a website comprises the following steps:
s1: and generating a unique identifier for each of a plurality of label pages of the same website opened by the user, wherein the identifier is used for distinguishing the plurality of label pages.
S2: and giving control over the global polling request of the website of the tab page opened for the first time. Only the tab page with the control right can send a request to the server, and the time of a sending end and the thread between the sending end and the server, the server resources and the like are occupied when the request is sent.
S3: the unique identification of the tab page that gained control is stored. In this embodiment, the unique identifier of the tag page is stored in the local storage, and it should be noted that the storage location of the identifier is not limited to the local storage, and may be other additional storage.
S4: the label pages with the control right initiate the global polling request, and when the label pages with the control right initiate the global polling request, the rest label pages do not initiate the request. The process of initiating the global polling request by the tab page is as follows: and establishing a polling request interface, only reserving a task id in the polling request interface, and acquiring the condition of the current task only by sending the task id. If the result is returned, the polling is finished, and if the result is not returned, the polling is waited for a while and the request is continuously sent.
S5: and judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and entering the step S6, otherwise, continuously judging whether the label page obtaining the control right is closed.
S6: the remaining tab pages compete for control of the website's polling request.
S7: the first response tab page in the remaining tab pages obtains the control right of the website global polling request, and the process returns to step S3.
According to the method for overall polling requests of the overall website, the unique identification is generated for each label page, the label pages are distinguished through the identification, then the process that the label pages send requests to a server is limited through limiting the control right of the label pages, the number of the label pages sending the requests is always kept to be one, and resource waste is greatly reduced.
Example 2.
An apparatus for orchestrating website global polling requests, comprising:
and the identification generation module is used for generating a unique identification for each of a plurality of label pages of the same website opened by the user. The identification generation module is also used for issuing the control right of the website global polling request to the first response label page in the rest label pages.
And the control right issuing module is used for giving the control right of the website global polling request to the tab page which is opened for the first time. The control right issuing module limits the number of the label page sending requests, reduces the connection which is not completely established between the sending end and the server, and saves resources.
And the storage module is used for storing the unique identification of the label page for obtaining the control right. The storage module is a local storage module.
And the request initiating module is used for initiating a global polling request by the label page which obtains the control right. When the label page with control authority initiates the global polling request, the request initiating module is also used for limiting the rest label pages not to initiate the request.
And the judging module is used for judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and the rest label pages compete for the control right of the website polling request, otherwise, continuously judging whether the label page obtaining the control right is closed.
This device of overall situation website global polling request can establish the sign for a plurality of label pages of same website, distinguishes the label page, then whether obtains control right through control label page and controls whether the label page can send the request to the server, reduces the transmission quantity of request for the resource that a plurality of label pages of same website occupy when carrying out the polling request significantly reduces.
Example 3.
A computer-readable storage medium stores a program for executing a method of orchestrating website global polling requests.
The method for overall scheduling the global polling request of the website comprises the following steps:
s1: and generating a unique identifier for each of a plurality of label pages of the same website opened by the user.
S2: and giving control over the global polling request of the website of the tab page opened for the first time.
S3: the unique identification of the tab page that gained control is stored.
S4: the tab page that obtains control initiates a global polling request.
S5: and judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and entering the step S6, otherwise, continuously judging whether the label page obtaining the control right is closed.
S6: the remaining tab pages compete for control of the website's polling request.
S7: the first response tab page in the remaining tab pages obtains the control right of the website global polling request, and the process returns to step S3.
The computer-readable storage medium can execute a method for overall scheduling of the website global polling requests, limit the number of requests sent by a plurality of label pages of the same website during polling requests, and reduce waste of resources.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention and not for limiting the protection scope of the present invention, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (8)

1. A method for coordinating global polling requests of a website is characterized by comprising the following steps:
s1: generating a unique identifier for each of a plurality of label pages of the same website opened by a user;
s2: giving control right to a global polling request of a label page website opened for the first time;
s3: storing the unique identification of the label page for obtaining the control right;
s4: the label page which obtains the control right initiates a global polling request;
s5: judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in null, and entering the step S6, otherwise, continuously judging whether the label page obtaining the control right is closed;
s6: the rest label pages compete for the control right of the website polling request;
s7: the first response tab page in the remaining tab pages obtains the control right of the website global polling request, and the process returns to step S3.
2. The method for orchestrating website global polling requests according to claim 1, wherein step S3 uses a unique identifier of a local storage tag page.
3. The method for global polling request of pooling of websites of claim 1, wherein step S4 is performed when the tab with control authority initiates the global polling request, and the remaining tab does not initiate the request.
4. An apparatus for orchestrating website global polling requests, comprising:
the identification generation module is used for generating a unique identification for each of a plurality of label pages of the same website opened by a user;
the control right issuing module is used for giving the control right of the website global polling request to the tab page which is opened for the first time;
the storage module is used for storing the unique identification of the label page for obtaining the control right;
the request initiating module is used for initiating a global polling request by the label page which obtains the control right;
and the judging module is used for judging whether the label page obtaining the control right is closed, if so, setting the unique identifier of the label page stored in the empty state, and the rest label pages compete for the control right of the website polling request, otherwise, continuously judging whether the label page obtaining the control right is closed.
5. The apparatus for orchestrating website global polling requests according to claim 4, wherein the identification generation module is further configured to issue control of the website global polling request to a first response tab of the remaining tab pages.
6. The apparatus for orchestrating website global polling requests according to claim 4, wherein the storage module is a local storage module.
7. The apparatus for orchestrating website global polling requests according to claim 4, wherein when a tab with control authority initiates a global polling request, the request initiation module is further configured to restrict remaining tabs from initiating no request.
8. A computer-readable storage medium storing a program for executing the method for orchestrating website global polling requests according to any one of claims 1 to 3.
CN202011238341.4A 2020-11-09 2020-11-09 Method for overall scheduling of website global polling request Pending CN112422662A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011238341.4A CN112422662A (en) 2020-11-09 2020-11-09 Method for overall scheduling of website global polling request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011238341.4A CN112422662A (en) 2020-11-09 2020-11-09 Method for overall scheduling of website global polling request

Publications (1)

Publication Number Publication Date
CN112422662A true CN112422662A (en) 2021-02-26

Family

ID=74780759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011238341.4A Pending CN112422662A (en) 2020-11-09 2020-11-09 Method for overall scheduling of website global polling request

Country Status (1)

Country Link
CN (1) CN112422662A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521295A (en) * 2011-11-30 2012-06-27 深圳市五巨科技有限公司 Method and device for automatically acquiring content updating on designated page
CN102694847A (en) * 2012-05-03 2012-09-26 北京新媒传信科技有限公司 Method and device for capturing user dynamic state in third-party open platform
CN103543954A (en) * 2012-07-16 2014-01-29 中兴通讯股份有限公司 Data storage management method and device
CN103973641A (en) * 2013-01-29 2014-08-06 国际商业机器公司 Method and device for managing conversations of different web sites
CN106465271A (en) * 2014-05-09 2017-02-22 Lg电子株式会社 Method and apparatus for power saving mode operation in wireless LAN
CN111125595A (en) * 2019-12-05 2020-05-08 网易传媒科技(北京)有限公司 Multi-page control method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521295A (en) * 2011-11-30 2012-06-27 深圳市五巨科技有限公司 Method and device for automatically acquiring content updating on designated page
CN102694847A (en) * 2012-05-03 2012-09-26 北京新媒传信科技有限公司 Method and device for capturing user dynamic state in third-party open platform
CN103543954A (en) * 2012-07-16 2014-01-29 中兴通讯股份有限公司 Data storage management method and device
CN103973641A (en) * 2013-01-29 2014-08-06 国际商业机器公司 Method and device for managing conversations of different web sites
CN106465271A (en) * 2014-05-09 2017-02-22 Lg电子株式会社 Method and apparatus for power saving mode operation in wireless LAN
CN111125595A (en) * 2019-12-05 2020-05-08 网易传媒科技(北京)有限公司 Multi-page control method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RASCK: "页面间通信-使用storage事件保持多tab页共享轮询请求的数据", 《掘金网》 *
谢小飞: "四种实现浏览器标签页数据通信的方式", 《知乎网》 *

Similar Documents

Publication Publication Date Title
CN100462977C (en) Capture server, distribution server, method and system for generating webpage capture
CN108924250B (en) Service request processing method and device based on block chain and computer equipment
US20190158626A1 (en) Method, apparatus and computer readable storage medium for processing service
CN105516086B (en) Method for processing business and device
CN103780679A (en) Long time delay remote invocation method based on HTTP protocol
US20130318144A1 (en) Network device, system, method, and storage medium
CN108173839B (en) Authority management method and system
CN110806928A (en) Job submitting method and system
CN110659131A (en) Task processing method, electronic device, computer device, and storage medium
CN111371848A (en) Request processing method, device, equipment and storage medium
JP6039446B2 (en) Web server device, control method, and program thereof.
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
CN106412079B (en) Request processing method and system
CN109002364A (en) Optimization method, electronic device and the readable storage medium storing program for executing of interprocess communication
CN112822299B (en) RDMA (remote direct memory Access) -based data transmission method and device and electronic equipment
CN108132836B (en) Task distribution method and device and electronic equipment
CN108388409B (en) Print request processing method, apparatus, computer device and storage medium
CN113377498A (en) Resource scheduling method and device, electronic equipment and storage medium
CN113419839A (en) Resource scheduling method and device for multi-type jobs, electronic equipment and storage medium
CN109922120B (en) Method and terminal for improving DNS availability
CN112422662A (en) Method for overall scheduling of website global polling request
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN105791295A (en) Application server based on Node.js
CN110764903B (en) Method, apparatus, device and storage medium for elastically performing heat container
CN114675954A (en) Task scheduling method and device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210226

RJ01 Rejection of invention patent application after publication