Page request processing method and device, electronic equipment, storage medium and product

By inserting the request into the target request queue to execute the first page's request, the page switching timeout issue caused by the browser's limit on the number of concurrent requests to a single domain is resolved, ensuring smooth page display and improving user experience.

CN118802882BActive Publication Date: 2025-12-09CHINA MOBILE M2M +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410775233.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2025-12-09
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In web applications with a front-end and back-end separation, browsers have a limit on the number of concurrent requests per domain. When switching pages, if the previous page request has not been completed, it may block the current page request, resulting in a timeout error and affecting the user experience.

Method used

By identifying pages in the target request queue that meet the deletion criteria, initiating requests for those pages, and deleting them, the system prioritizes executing requests for the first page, thus avoiding timeout errors.

Benefits of technology

This avoids timeout errors caused by requests from the first page, ensuring smooth page display and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802882B_ABST
    Figure CN118802882B_ABST
Patent Text Reader

Abstract

The present disclosure provides a page request processing method and device, electronic equipment, storage medium and product, wherein the method comprises: obtaining a first page initiation request sent by a page application; in a case where it is determined that the number of second page initiation requests in a target request queue reaches the maximum execution number of page initiation requests of the same domain name, and it is determined that the page displayed by the front-end visualization window at the current time is a first page corresponding to the first page initiation request, determining whether there is a target page initiation request meeting a deletion condition in the target request queue; wherein the target request queue contains second page initiation requests that have not been executed completely; in a case where it is determined that there is a target page initiation request meeting the deletion condition in the target request queue, deleting the target page initiation request from the target request queue, and adding the first page initiation request to the target request queue.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computers, and in particular, to a page request processing method and device, electronic equipment, storage medium and product. BACKGROUND

[0002] Currently, web (World Wide Web) application development mostly adopts front-end and back-end separation, and front-end and back-end data interaction adopts an ajax (Asynchronous Javascript And XML) method. Due to the limitation of the browser on the number of concurrent requests for a single domain name, when a single-page application switches pages, each page request is executed in turn. At this time, if the previous page request is not executed, it may block the current page request, thereby affecting the display of the current page, or it may cause the current page request to time out, thereby affecting the user experience. SUMMARY

[0003] The embodiments of the present disclosure at least provide a page request processing method and device, electronic equipment, storage medium and product.

[0004] In a first aspect, the embodiments of the present disclosure provide a page request processing method, applied to a server, comprising:

[0005] obtaining a first page initiation request sent by a page application;

[0006] In a case where it is determined that the number of second page initiation requests in a target request queue reaches the maximum execution number of page initiation requests of the same domain name, and it is determined that the page displayed in the front-end visual window at the current time is a first page corresponding to the first page initiation request, determining whether there is a target page initiation request in the target request queue that meets a deletion condition; wherein the target request queue contains a second page initiation request that has not been executed, and the domain name of the second page initiation request is the same as that of the first page initiation request;

[0007] In a case where it is determined that there is a target page initiation request in the target request queue that meets the deletion condition, deleting the target page initiation request from the target request queue, and adding the first page initiation request to the target request queue.

[0008] In an optional implementation, the method further comprises:

[0009] In a case where it is determined that the number of requests of the second page initiation request in the target request queue reaches the maximum execution number of the server, and it is determined that the page displayed in the front-end visualization window at the current time is not the first page corresponding to the first page initiation request, the first page initiation request is added to a to-be-executed request queue; wherein the page initiation request in the to-be-executed request queue is executed after the execution of the second page initiation request in the target request queue is completed.

[0010] In an optional implementation, the method further includes:

[0011] In a case where the execution of the third page initiation request in the second page initiation request of the target request queue is completed, a request execution result is determined;

[0012] The request execution result is returned to the page corresponding to the third page initiation request, and the third page initiation request is deleted from the target request queue;

[0013] A target to-be-executed page request in a to-be-executed request queue is added to the target request queue; wherein the target to-be-executed page is a page displayed in a display area of the front end at the current time, and the page initiation request in the to-be-executed request queue is executed after the execution of the second page initiation request in the target request queue is completed.

[0014] In an optional implementation, the determining whether the target page initiation request meeting the deletion condition exists in the target request queue includes:

[0015] A fourth page initiation request with a timeout time set in the target request queue is determined;

[0016] Based on a time when the fourth page initiation request is added to the target request queue, a request execution time of the fourth page initiation request is determined;

[0017] In a case where it is determined that the page displayed in the front-end visualization window at the current time is not the page corresponding to the fourth page initiation request, and the request execution time is greater than or equal to a preset timeout time, it is determined that the fourth page initiation request is the target page initiation request meeting the deletion condition.

[0018] In an optional implementation, after the first page initiation request is added to the target request queue, the method further includes:

[0019] In a case where it is detected that the front-end visualization window is switched from the first page to display a second page, it is determined whether the page information of the first page meets a cache condition;

[0020] In a case where it is determined that the first page does not satisfy the cache condition and it is determined that the first page initiation request satisfies the request deletion condition, the first page initiation request is deleted from the target request queue.

[0021] In an optional implementation, the determining that the first page initiation request satisfies the request deletion condition comprises:

[0022] In a case where the first page initiation request is provided with a timeout time, it is determined that the first page initiation request satisfies the request deletion condition.

[0023] In an optional implementation, after the first page initiation request sent by the page application is acquired, the method further comprises:

[0024] In a case where the number of requests of the second page initiation request in the target request queue is less than the maximum execution number, the first page initiation request is added to the target request queue.

[0025] In a second aspect, the embodiments of the present disclosure further provide a page request processing apparatus, comprising:

[0026] an acquisition module, configured to acquire a first page initiation request sent by a page application;

[0027] a first determination module, configured to, in a case where it is determined that the number of requests of a second page initiation request in a target request queue reaches a maximum execution number of page initiation requests of a same domain name and it is determined that a page displayed by a front-end visual window at a current time is a first page corresponding to the first page initiation request, determine whether there is a target page initiation request satisfying a deletion condition in the target request queue; the target request queue comprises a second page initiation request which is not executed completely, and the domain name of the second page initiation request is the same as the domain name of the first page initiation request;

[0028] a second determination module, configured to, in a case where it is determined that there is a target page initiation request satisfying the deletion condition in the target request queue, delete the target page initiation request from the target request queue and add the first page initiation request to the target request queue.

[0029] In a third aspect, the embodiments of the present disclosure further provide an electronic device, comprising a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, and the machine readable instructions are executed by the processor to execute the steps of the first aspect or any possible implementation manner of the first aspect.

[0030] In a fourth aspect, the present disclosure also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, performs the steps of the first aspect or any possible implementation of the first aspect.

[0031] In a fifth aspect, the present disclosure also provides a computer program product stored in a storage medium, which, when executed by at least one processor, performs the steps of the first aspect or any possible implementation of the first aspect.

[0032] In a case where the first page initiation request sent by the page application cannot be immediately added to the target request queue for execution, it is determined whether there is a target page initiation request meeting the deletion condition in the target request queue. In a case where there is a target page initiation request in the target request queue, the target page initiation request is deleted from the target request queue, and the first page initiation request is added to the target request queue.

[0033] In the prior art, page initiation requests are executed in the order of their reception. Since the first page initiation request can be a page request that needs to be executed immediately or a page rendering request of a page displayed by the front-end visualization window at the current time, the request of the current page can not be displayed due to a timeout error if it is not executed within a preset time. The embodiment can make the first page initiation request execute by cutting in line, thereby avoiding the situation that the page displayed by the front-end visualization window at the current time cannot be displayed due to a timeout error of the first page initiation request.

[0034] In order to make the above objectives, features and advantages of the present disclosure more apparent, the following will specifically describe preferred embodiments in conjunction with the accompanying drawings, and make a detailed description as follows. BRIEF DESCRIPTION OF DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings needed to be used in the embodiments, the drawings herein are incorporated into the description and form a part of the description, which show the embodiments consistent with the present disclosure, and are used to explain the technical solutions of the present disclosure together with the description. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be considered as a limitation to the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor.

[0036] Figure 1 A flowchart of a page request processing method provided by the embodiments of the present disclosure is shown;

[0037] Figure 2A flow chart of a specific method of page switching in a page request processing method provided by an embodiment of the present disclosure is shown.

[0038] Figure 3 A specific flow chart of a page request processing method provided by an embodiment of the present disclosure is shown.

[0039] Figure 4 A schematic diagram of a page request processing apparatus provided by an embodiment of the present disclosure is shown.

[0040] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0041] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the claimed present disclosure, but only represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present disclosure.

[0042] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0043] The term “and / or” herein only describes an association relationship, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the term “at least one” herein means any one of multiple or any combination of at least two of multiple, for example, including at least one of A, B and C can mean including any one or more elements selected from the set consisting of A, B and C.

[0044] It is found through research that current web (World Wide Web) application development mostly adopts front-end and back-end separation, and the front-end and back-end data interaction adopts an ajax (Asynchronous Javascript And XML) method. Due to the limitation of the browser on the number of concurrent requests for a single domain name, when a single-page application switches pages, each page request is executed in turn. At this time, if the previous page request is not executed, the current page request may be blocked, thereby affecting the display of the current page, or the current page request may time out, thereby affecting the user experience.

[0045] Based on the above research, the present disclosure provides a page request processing method. In a case where a first page initiation request sent by a page application cannot be immediately added to a target request queue for execution, it is determined whether there is a target page initiation request in the target request queue that meets a deletion condition. In a case where there is a target page initiation request in the target request queue, the target page initiation request is deleted from the target request queue, and the first page initiation request is added to the target request queue.

[0046] In the prior art, page initiation requests are executed in turn according to their received order. Since the first page initiation request may be a page request that needs to be executed immediately or a page rendering request of a page displayed by a front-end visual window at the current time, if it is not executed within a preset time, a timeout error may occur in the current page request, and the current page cannot be displayed. The present embodiment can make the first page initiation request execute by cutting in line, thereby avoiding the situation that the page displayed by the front-end visual window at the current time cannot be displayed due to a timeout error of the first page initiation request.

[0047] To facilitate understanding of the present embodiment, first, a page request processing method disclosed by the present embodiment is described in detail. The execution subject of the page request processing method provided by the present embodiment is generally an electronic device with certain computing capability. In some possible implementation manners, the page request processing method can be realized by a processor calling computer readable instructions stored in a memory.

[0048] Referring to FIG. 1, Figure 1 The method includes steps S101-S103, wherein:

[0049] S101, a first page initiation request sent by a page application is acquired.

[0050] In the embodiments of the present disclosure, the browser can accept the request information sent by the page application, so as to obtain the first page initiation request based on the request information. The page information includes but is not limited to a page identifier, a request identifier and request data.

[0051] Here, the page identifier (i.e., pageId) is a unique ID corresponding to each page. The request identifier (i.e., requestId) is a unique ID corresponding to each request. The request data is the body of the request, including a uniform resource locator (i.e., url), a method used to resolve the request (i.e., method), and the like.

[0052] Here, the browser can return a Promise object to the page application after receiving the request information sent by the page application. The Promise object includes but is not limited to a resolve (i.e., completed) callback object and a reject (i.e., failed) callback object.

[0053] Here, the browser can determine the page information, the resolve callback object and the reject callback object in the Promise object as the first page initiation request.

[0054] S102, in a case where it is determined that the number of second page initiation requests in the target request queue reaches the maximum execution number of page initiation requests of the same domain name, and it is determined that the page displayed in the front-end visualization window at the current time is the first page corresponding to the first page initiation request, it is determined whether there is a target page initiation request in the target request queue that meets the deletion condition; wherein the target request queue contains uncompleted second page initiation requests, and the domain name of the second page initiation request is the same as that of the first page initiation request.

[0055] In the embodiments of the present disclosure, the number of single-domain page initiation requests that can be executed by the browser at the same time is determined as the maximum execution number. That is, at the same time, the browser can execute a maximum execution number of page initiation requests of the same domain name.

[0056] Here, first, the queue length (i.e., the number of requests) of the target request queue can be determined. Second, it can be determined whether the queue length is equal to the maximum execution number of page initiation requests of the same domain name.

[0057] Secondly, in the case that the queue length is equal to the maximum number of page initiation requests of the same domain name, the page identifier corresponding to the first page initiation request can be determined. Finally, in the case that the page identifier of the first page is the page identifier of the page displayed by the front-end visualization window at the current time (i.e., currentPageId), it can be determined whether there is a target page initiation request meeting the deletion condition in the target request queue.

[0058] Here, the second page initiation request in the target request queue is always in a parallel execution state. Moreover, the target request queue is a queue composed of requests being executed, i.e., an ingQueue.

[0059] Here, it can be determined, based on the execution time of the second page initiation request in the target request queue and the page identifier of the second page request, whether there is a target page initiation request meeting the deletion condition in the target request queue.

[0060] S103, in the case that it is determined that there is a target page initiation request meeting the deletion condition in the target request queue, the target page initiation request is deleted from the target request queue, and the first page initiation request is added to the target request queue.

[0061] In an embodiment of the present disclosure, the second page initiation request meeting the deletion condition in the target request queue can be taken as the target page initiation request.

[0062] Here, after the target page initiation request in the target request queue is deleted, the target page initiation request can be added to a waitQueue.

[0063] Here, before the first page initiation request is added to the target request queue, the request object (i.e., requestObj) of the first page initiation request can be obtained based on the request data of the first page initiation request. At the same time when the browser starts executing the first page initiation request, i.e., at the same time when the first page initiation request is added to the target request queue, the time of starting execution (i.e., startTime) is recorded.

[0064] Here, the request object of the first page initiation request and the time of starting execution can be added to the page information of the first page initiation object to update the page information of the first page initiation request.

[0065] In the embodiments of the present disclosure, first, a first page initiation request sent by a page application is acquired; second, in a case where it is determined that the number of requests of second page initiation requests in a target request queue reaches the maximum number of executions of page initiation requests of the same domain name, and it is determined that the page displayed by the front-end visual window at the current time is a first page corresponding to the first page initiation request, it is determined whether there is a target page initiation request meeting a deletion condition in the target request queue; the target request queue contains second page initiation requests that have not been executed completely; finally, in a case where it is determined that there is a target page initiation request meeting the deletion condition in the target request queue, the target page initiation request is deleted from the target request queue, and the first page initiation request is added to the target request queue.

[0066] In the above embodiments, in a case where the first page initiation request sent by the page application cannot be immediately added to the target request queue for execution, it is determined whether there is a target page initiation request meeting a deletion condition in the target request queue. It can be determined whether the target page initiation request meeting the deletion condition exists in the target request queue.

[0067] In a case where there is a target page initiation request in the target request queue, the target page initiation request is deleted from the target request queue, and the first page initiation request is added to the target request queue.

[0068] In the prior art, page initiation requests are executed in the order of reception. Since the first page initiation request can be a page request that needs to be executed immediately or a page rendering request of the page displayed by the front-end visual window at the current time, if the first page initiation request is not executed within a preset time, a timeout error of the current page can occur, and the current page cannot be displayed. The present embodiment can make the first page initiation request execute in advance, so that the current page displayed by the front-end visual window at the current time cannot be displayed due to a timeout error of the first page initiation request.

[0069] In an optional embodiment, the method further includes the following steps on the basis of the above embodiments:

[0070] In a case where it is determined that the number of requests of second page initiation requests in the target request queue reaches the maximum number of executions of page initiation requests of the same domain name, and it is determined that the page displayed by the front-end visual window at the current time is not the first page corresponding to the first page initiation request, the first page initiation request is added to a to-be-executed request queue; the page initiation requests in the to-be-executed request queue are executed after the execution of the second page initiation requests in the target request queue is completed.

[0071] In the embodiments of the present disclosure, the second page initiation request is a page request initiated by a page application that is not the first page.

[0072] Here, in the case that the page switching occurs and the first page after the switching has been displayed in the visualization window, the first page initiation request sent by the page application before the switching can be received, that is, the page identifier corresponding to the first page initiation request is inconsistent with the page identifier of the first page. At this time, the first page initiation request does not need to be added to the target request queue, and the first page initiation request is added to the to-be-executed request queue.

[0073] Here, the first page initiation request can be placed at the head of the to-be-executed request queue. Here, after the one or more second page initiation requests in the target request queue are executed, the first page initiation request in the to-be-executed request queue can be added to the target request queue and the first page initiation request is started to be executed.

[0074] In an optional embodiment, based on the above embodiment, the method further comprises the following steps:

[0075] First, in the case that the execution of the third page initiation request in the second page initiation request of the target request queue is completed, the request execution result is determined;

[0076] Secondly, the request execution result is returned to the page application corresponding to the third page initiation request, and the third page initiation request is deleted in the target request queue;

[0077] Finally, the target to-be-executed page request in the to-be-executed request queue is added to the target request queue; wherein, the target to-be-executed page is a page displayed in the display area of the front end at the current time, and the page initiation request in the to-be-executed request queue is executed after the execution of the second page initiation request in the target request queue is completed.

[0078] In the embodiments of the present disclosure, the executed second page initiation request can be the third page initiation request.

[0079] Here, the request identifier of the third page initiation request can be determined, and the third page initiation request is deleted in the target request queue based on the request identifier.

[0080] Here, the request execution result of the third page initiation request can also be called based on the request identifier of the third page initiation request, and the request execution result is sent to the page application corresponding to the third page initiation request.

[0081] Wherein, in the case that the third page initiation request is successfully executed, the request execution result of the third page initiation request is a resolve callback object. In the case that the third page initiation request is not successfully executed, the request execution result of the third page initiation request is a reject callback object.

[0082] Here, in the case that there is a page initiation request in the to-be-executed request queue, the page identifier of the page initiation request in the to-be-executed request queue is determined. In the case that it is determined that the page identifier is the page identifier of the page displayed in the display area in the front end at the current time, the page initiation request corresponding to the page identifier is taken as the target to-be-executed page request.

[0083] Here, all the page initiation requests in the to-be-executed request queue are in an unexecuted state.

[0084] Here, the request object of the target to-be-executed page request can be determined before the target to-be-executed page request is added to the target request queue. The time of starting execution is recorded at the same time when the browser starts executing the target to-be-executed page request, that is, at the same time when the target to-be-executed page request is added to the target request queue.

[0085] Here, the request object of the target to-be-executed page request and the time of starting execution can be added to the page information of the target to-be-executed page request to update the page information of the target to-be-executed page request.

[0086] In an optional embodiment, the above step of determining whether there is a target page initiation request satisfying the deletion condition in the target request queue comprises the following steps:

[0087] First, a fourth page initiation request provided with a timeout time is determined in the target request queue;

[0088] Second, the request execution time of the fourth page initiation request is determined based on the adding time of the fourth page initiation request added to the target request queue;

[0089] Finally, in the case that it is determined that the page displayed in the front-end visualization window at the current time is not the page corresponding to the fourth page initiation request, and the request execution time is greater than or equal to the preset timeout time, the fourth page initiation request is determined as the target page initiation request satisfying the deletion condition.

[0090] In the embodiments of the present disclosure, the second page initiation request provided with a timeout time is taken as the fourth page initiation request.

[0091] Here, the timeout time is the timeout time of the request being forcibly cancelled. In the case that no timeout time is set, the timeout time is 0. In the case that the request timeout time is 0, it indicates that the request will not be forcibly cancelled.

[0092] Here, in the case that the request is provided with a timeout time, in the case that the execution time of the request exceeds the set timeout time, the execution of the request can be forcibly cancelled, that is, the execution of the request is interrupted.

[0093] Here, the request execution time is the difference between the current time and the time when the request from the fourth page was added to the target request queue.

[0094] Here, firstly, if the page identifier of the request initiated by the fourth page is different from the page identifier of the page currently displayed in the front-end visualization window, it is determined whether the execution time of the request initiated by the fourth page is greater than or equal to the preset timeout. Secondly, if the execution time of the request initiated by the fourth page is greater than or equal to the preset timeout, it is determined that the request initiated by the fourth page is a request initiated by the target page that meets the deletion conditions. Here, the preset timeout is the timeout period for the request initiated by the fourth page.

[0095] In an optional implementation, after adding the request for the first page to the target request queue, the method further includes the following steps:

[0096] First, when the front-end visualization window switches from the first page to display the second page, it is determined whether the page information of the first page meets the caching conditions.

[0097] Then, if it is determined that the first page does not meet the caching conditions, and it is determined that the request initiated by the first page meets the request deletion conditions, the request initiated by the first page is deleted from the target request queue.

[0098] In the embodiments of this disclosure, when the front-end visualization window is detected to switch from the first page to displaying the second page, the page identifier of the page displayed by the front-end visualization window is the page identifier of the second page.

[0099] Here, the execution time of the request initiated by the first page can be used to determine whether the request to delete meets the conditions.

[0100] See here. Figure 2 The diagram shown is a flowchart of a specific method for page switching in the page request processing method provided in this embodiment of the disclosure, wherein:

[0101] First, after the first page displayed in the front-end visualization window switches to the second page, it can be determined whether the first page meets the caching conditions. Then, if it is determined that the first page meets the caching conditions based on the page information, no processing is required on the target request queue and the pending request queue.

[0102] Then, after determining that the first page does not meet the caching conditions based on the page information of the first page, and if it is determined that the page in the target request queue that initiates a request meets the request deletion conditions, the page in the target request queue that initiates a request to delete the first page is deleted.

[0103] Finally, in a case that the page initiation request of the first page in the to-be-executed request queue is determined to meet the request deletion condition, the page initiation request of the first page is deleted from the to-be-executed request queue.

[0104] In an optional embodiment, the step of determining that the first page initiation request meets the request deletion condition specifically comprises the following steps:

[0105] In a case that the first page initiation request is provided with a timeout time, it is determined that the first page initiation request meets the request deletion condition.

[0106] In an embodiment of the present disclosure, in a case that the first page initiation request is not provided with a timeout time, the first page initiation request is continuously retained in the target request queue.

[0107] Here, in a case that the first page initiation request is provided with a timeout time, the execution time of the first page initiation request can be determined. In a case that the execution time of the first page initiation request is greater than or equal to the timeout time, it is determined that the first page initiation request meets the request deletion condition.

[0108] In an optional embodiment, after the first page initiation request sent by the page application is acquired, the following step is further included:

[0109] In a case that the number of requests of the second page initiation request in the target request queue is less than the maximum execution number, the first page initiation request is added to the target request queue.

[0110] In an embodiment of the present disclosure, the number of requests of the second page initiation request in the target request queue being less than the maximum execution number can be understood as that the number of the page initiation requests executed in parallel by the browser does not exceed the maximum executable number of the page initiation requests of a single domain name by the browser.

[0111] Here, the first page initiation request can be directly added to the target request queue and the execution of the first page initiation request can be started.

[0112] Referring to Figure 3 FIG. 1 shows a specific flowchart of a page request processing method provided by an embodiment of the present disclosure, wherein:

[0113] First, a first page initiation request sent by a page application is acquired.

[0114] Second, the number of requests of a second page initiation request in a target request queue is determined.

[0115] Second, it is determined whether the number of requests of the second page initiation request is greater than a maximum execution number.

[0116] Secondly, in a case where the number of requests initiated by the second page is less than the maximum execution number, the request initiated by the first page is added to the target request queue.

[0117] Secondly, in a case where the number of requests initiated by the second page is equal to the maximum execution number, it is determined whether the page displayed by the front-end visualization window at the current time is the first page corresponding to the request initiated by the first page.

[0118] Secondly, in a case where the page displayed by the front-end visualization window at the current time is not the first page corresponding to the request initiated by the first page, the request initiated by the first page is added to the to-be-executed request queue.

[0119] Secondly, in a case where the page displayed by the front-end visualization window at the current time is not the first page corresponding to the request initiated by the first page, the request initiated by the first page is added to the to-be-executed request queue.

[0120] Secondly, in a case where the page displayed by the front-end visualization window at the current time is not the first page corresponding to the request initiated by the first page, the request initiated by the first page is added to the to-be-executed request queue.

[0121] Finally, in a case where it is determined that there is no target request initiated by a target page in the target request queue that meets the deletion condition, the request initiated by the first page is added to the to-be-executed request queue.

[0122] In the above embodiment, in a case where it is determined that the request initiated by the first page sent by the page application cannot be immediately added to the target request queue for execution, it is determined whether there is a target request initiated by a target page in the target request queue that meets a deletion condition. In a case where there is a target request initiated by a target page in the target request queue, the target request initiated by the target page is deleted from the target request queue, and the request initiated by the first page is added to the target request queue.

[0123] In the prior art, page initiation requests are executed in the order of reception. Since the request initiated by the first page can be a page request that needs to be executed immediately or a page rendering request of the page displayed by the front-end visualization window at the current time, if the request is not executed within a preset time, a timeout error can occur in the current page, and the current page cannot be displayed. The present embodiment can make the request initiated by the first page execute in a queue, thereby avoiding the situation that the page displayed by the front-end visualization window at the current time cannot be displayed due to a timeout error of the request initiated by the first page.

[0124] Those skilled in the art can understand that the sequence of writing each step in the foregoing method of the specific embodiment does not mean a strict execution sequence and does not constitute any limitation on the implementation process, and the specific execution sequence of each step should be determined according to its function and possible internal logic.

[0125] Based on the same inventive concept, the disclosure embodiments also provide a page request processing device corresponding to the page request processing method. Since the principle of solving problems by the device in the disclosure embodiments is similar to the above-mentioned page request processing method of the disclosure embodiments, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described here.

[0126] Referring to Figure 4 Fig. 1 shows a schematic diagram of a page request processing device provided by the disclosure embodiments, which comprises an acquisition module 11, a first determination module 12, and a second determination module 13.

[0127] The acquisition module is configured to acquire a first page initiation request sent by a page application.

[0128] The first determination module is configured to determine whether there is a target page initiation request meeting a deletion condition in a target request queue, in a case where it is determined that the number of second page initiation requests in the target request queue reaches the maximum execution number of page initiation requests of the same domain name, and it is determined that the page displayed by the front-end visual window at the current time is a first page corresponding to the first page initiation request.

[0129] The second determination module is configured to delete the target page initiation request from the target request queue and add the first page initiation request to the target request queue, in a case where it is determined that there is a target page initiation request meeting the deletion condition in the target request queue.

[0130] In a case where it is acquired that the first page initiation request sent by the page application cannot be immediately added to the target request queue for execution, the disclosure embodiments determine whether there is a target page initiation request meeting a deletion condition in the target request queue. In a case where there is a target page initiation request in the target request queue, the target page initiation request is deleted from the target request queue, and the first page initiation request is added to the target request queue.

[0131] In the prior art, page initiation requests are executed in the order of their reception. Since the first page initiation request can be a page request that needs to be executed immediately or a page rendering request of a page displayed in the front-end visualization window at the current time, if the first page initiation request is not executed within a preset time, a timeout error can occur in the current page request, which cannot be displayed. The embodiment can make the first page initiation request execute in a queue, thereby avoiding the situation that the page displayed in the front-end visualization window at the current time cannot be displayed due to a timeout error of the first page initiation request.

[0132] In a possible implementation, the first determining module is further configured to: in a case where the number of second page initiation requests in the target request queue reaches the maximum execution number of page initiation requests with the same domain name, and it is determined that the page displayed in the front-end visualization window at the current time is not a first page corresponding to the first page initiation request, add the first page initiation request to a to-be-executed request queue; and the page initiation requests in the to-be-executed request queue are executed after the execution of the second page initiation requests in the target request queue is completed.

[0133] In a possible implementation, the first determining module is further configured to: in a case where the number of second page initiation requests in the target request queue is less than the maximum execution number, add the first page initiation request to the target request queue.

[0134] The processing flow of each module in the device and the interaction flow between the modules can refer to the related description in the above method embodiments, and will not be described in detail here.

[0135] Corresponding to the processing method of the page request in Figure 1 , the embodiment of the disclosure further provides an electronic device 500, as shown in Figure 5 , which is a structural schematic diagram of the electronic device 500 provided by the embodiment of the disclosure, comprising:

[0136] a processor 51, a memory 52, and a bus 53; the memory 52 is configured to store execution instructions, including an internal memory 521 and an external memory 522; the internal memory 521 is also referred to as an internal storage, and is configured to temporarily store operation data in the processor 51 and exchange data with the external memory 522 such as a hard disk; the processor 51 exchanges data with the external memory 522 through the internal memory 521; when the electronic device 500 is running, the processor 51 and the memory 52 communicate through the bus 53, so that the processor 51 executes the following instructions:

[0137] obtain a first page initiation request sent by a page application;

[0138] In a case where it is determined that the number of requests of the second page in the target request queue reaches the maximum execution number of page requests of the same domain name, and it is determined that the page displayed in the front-end visualization window at the current time is the first page corresponding to the first page request, it is determined whether there is a target page request in the target request queue that meets a deletion condition; the target request queue includes the second page request that is not executed completely.

[0139] In a case where it is determined that there is a target page request in the target request queue that meets the deletion condition, the target page request is deleted from the target request queue, and the first page request is added to the target request queue.

[0140] The disclosure also provides a computer readable storage medium having a computer program stored thereon, and the computer program is run by a processor to perform the steps of the page request processing method described in the method embodiments.

[0141] The disclosure also provides a computer program product carrying a program code, and the program code includes instructions for performing the steps of the page request processing method described in the method embodiments. For details, refer to the method embodiments described above, which will not be repeated here.

[0142] The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.

[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. In several embodiments provided by the disclosure, it should be understood that the disclosed system, device and method can be implemented by other ways. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0145] In addition, each functional unit in various embodiments of the present disclosure can be integrated into one processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.

[0146] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present disclosure or the part of the present disclosure that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present disclosure. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0147] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present disclosure, used to illustrate the technical solutions of the present disclosure, and not to limit it, the protection scope of the present disclosure is not limited to this, although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: any skilled person in the art within the technical range disclosed by the present disclosure, they can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and all should be covered in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A method for processing page requests, characterized in that, include: The application sends a request to the first page it retrieves. If it is determined that the number of requests initiated by the second page in the target request queue reaches the maximum number of requests initiated by the same domain, and it is determined that the page displayed in the front-end visualization window at the current moment is the first page corresponding to the first page request, then it is determined whether there are any target page requests in the target request queue that meet the deletion conditions; wherein, the target request queue contains second page requests that have not been completed, and the domain name of the second page request is the same as the domain name of the first page request. If it is determined that there is a target page request in the target request queue that meets the deletion conditions, the target page request is deleted from the target request queue, and the first page request is added to the target request queue; a fourth page request with a timeout is determined in the target request queue. Based on the time when the request initiated by the fourth page is added to the target request queue, the request execution time of the request initiated by the fourth page is determined; If it is determined that the page displayed in the front-end visualization window at the current moment is not the page corresponding to the request initiated by the fourth page, and the execution time of the request is greater than or equal to the preset timeout time, then the request initiated by the fourth page is determined to be a request initiated by the target page that meets the deletion conditions.

2. The method according to claim 1, characterized in that, The method further includes: If the request initiated by the third page in the second page of the target request queue has been completed, the request execution result is determined. The application corresponding to the request sent to the third page returns the request execution result, and the request sent to the third page is deleted from the target request queue. Add the target page request to the target request queue from the pending request queue; wherein, the target page is the page currently displayed in the front-end display area, and the page in the pending request queue is executed after the second page in the target request queue has completed its request.

3. The method according to claim 1, characterized in that, After adding the request sent to the first page to the target request queue, the method further includes: If the front-end visualization window is detected to switch from the first page to display the second page, it is determined whether the page information of the first page meets the caching conditions; If it is determined that the first page does not meet the caching conditions, and it is determined that the request initiated by the first page meets the request deletion conditions, the request initiated by the first page is deleted from the target request queue.

4. The method according to claim 3, characterized in that, The step of determining that the request initiated by the first page meets the deletion request conditions includes: If a timeout is set for the request initiated on the first page, it is determined that the request initiated on the first page meets the request deletion conditions.

5. A page request processing apparatus, characterized in that, include: The retrieval module is used to retrieve the first page request sent by the page application. The first determining module is used to determine whether there are any target page requests in the target request queue that meet the deletion conditions when the number of requests initiated by the second page in the target request queue reaches the maximum number of requests initiated by the page with the same domain name, and the page displayed in the front-end visualization window at the current moment is the first page corresponding to the first page request; wherein, the target request queue contains second page requests that have not been completed, and the domain name of the second page requests is the same as the domain name of the first page requests; The second determining module is used to, when determining that there is a target page initiating request in the target request queue that meets the deletion conditions, delete the target page initiating request from the target request queue and add the first page initiating request to the target request queue; The first determining module is further configured to determine, in the target request queue, the fourth page with a timeout period set to initiate a request; Based on the time when the request initiated by the fourth page is added to the target request queue, the request execution time of the request initiated by the fourth page is determined; If it is determined that the page displayed in the front-end visualization window at the current moment is not the page corresponding to the request initiated by the fourth page, and the execution time of the request is greater than or equal to the preset timeout time, then the request initiated by the fourth page is determined to be a request initiated by the target page that meets the deletion conditions.

6. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the page request processing method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the page request processing method as described in any one of claims 1 to 4.

8. A computer program product, characterized in that, The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the page request processing method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Page loading method and device, and storage medium

    CN111753235A

  • Page loading method, device and equipment and storage medium

    CN112364275A