CN115037801B - Priority adjustment method, electronic device and storage medium - Google Patents
Priority adjustment method, electronic device and storage medium Download PDFInfo
- Publication number
- CN115037801B CN115037801B CN202210247930.1A CN202210247930A CN115037801B CN 115037801 B CN115037801 B CN 115037801B CN 202210247930 A CN202210247930 A CN 202210247930A CN 115037801 B CN115037801 B CN 115037801B
- Authority
- CN
- China
- Prior art keywords
- network request
- processing priority
- page
- current
- network
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000012545 processing Methods 0.000 claims abstract description 232
- 230000001960 triggered effect Effects 0.000 claims description 18
- 230000001965 increasing effect Effects 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 11
- 230000003247 decreasing effect Effects 0.000 claims description 7
- 238000010586 diagram Methods 0.000 description 8
- 230000002829 reductive effect Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000015556 catabolic process Effects 0.000 description 2
- 238000006731 degradation reaction Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
Abstract
The embodiment of the disclosure discloses a priority adjustment method, electronic equipment and a storage medium, wherein the method comprises the following steps: after detecting a current page entering an application client, acquiring a plurality of network requests to be processed currently; adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page; the plurality of network requests are processed based on the processing priority. According to the technical scheme, the processing efficiency of a plurality of concurrent network requests can be improved, the processing performance of processing equipment can be improved, and further the experience of a user in using an application client can be improved.
Description
Technical Field
The disclosure relates to the technical field of computer networks, and in particular relates to a priority adjustment method, electronic equipment and a storage medium.
Background
With the development of intelligent terminals and the popularization of network environments, users can access a network through application clients installed on the terminals, and in the access process, multiple network requests of an opened application can be received at the same time, which is also called network request concurrency; however, the processing capability of the terminal for simultaneously processing a plurality of network requests is limited, which easily results in the degradation of the processing performance of the terminal.
In order to solve the problem of the degradation of the processing performance of the terminal caused by the concurrency of network requests, the prior art presets the priorities of different network requests, and after the concurrency of the network requests occurs, the terminal accesses the network based on the priorities of the network requests. The existing priority setting mode is static and cannot be dynamically adjusted. For example, in an application client, a kernel network request in a page is generally defined as the highest priority, which easily results in that the priorities of multiple network requests concurrent at the client runtime are all the highest priorities, and the problem of high concurrency of the network requests still cannot be thoroughly solved.
Therefore, how to effectively solve the technical problem that the processing performance of the terminal is reduced due to the concurrence of multiple network requests is one of the main technical problems that needs to be solved by those skilled in the art currently.
Disclosure of Invention
The embodiment of the disclosure provides a priority adjustment method, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a priority adjustment method, where the method includes:
after detecting a current page entering an application client, acquiring a plurality of network requests to be processed currently;
adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page;
The plurality of network requests are processed based on the processing priority.
Further, after detecting the current page entering the application client, acquiring a plurality of network requests to be processed currently, including:
After detecting a current page entering an application client, acquiring a current network request triggered by entering the current page and a history network request which is not processed before entering the current page.
Further, adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page, comprising:
Increasing the processing priority of the current network request and decreasing the processing priority of the historical network request.
Further, increasing the processing priority of the current network request and decreasing the processing priority of the historical network request includes:
weighting the processing priority of the current network request to improve the processing priority of the current network request;
And processing the processing priority of the historical network request in a weight reducing way so as to reduce the processing priority of the historical network request.
Further, after detecting a request for entering a current page, acquiring a current network request triggered by entering the current page and a historical network request which is not sent completely, the method comprises the following steps:
setting the initial processing priority of the current network request, so that the initial processing priority of the preset core network request in the current network request is higher than the initial processing priority of the non-preset core network request in the current network request.
Further, the method further comprises:
after detecting a request for opening the application client to enter a home page, acquiring a network request triggered by entering the home page;
setting the initial processing priority of the network requests, so that the initial processing priority of the preset core network requests in the network requests is higher than the initial processing priority of the non-preset core network requests.
Further, adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page, comprising:
The processing priority of the network request for the current page is adjusted to be higher than the processing priority of other network requests.
Further, adjusting the processing priority of the network request for the current page to be higher than the processing priority of other network requests, including:
And adjusting the priority of a preset core network request in the network requests aiming at the current page to be higher than the processing priority of other network requests.
In a second aspect, an embodiment of the present disclosure provides a priority adjustment apparatus, including:
The first acquisition module is configured to acquire a plurality of network requests to be processed currently after detecting a current page entering the application client;
An adjustment module configured to adjust a processing priority of the network request based on whether a page for which the network request is directed is the current page;
A processing module configured to process the plurality of network requests based on the processing priority.
The functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
In one possible design, the structure of the above apparatus includes a memory for storing one or more computer instructions for supporting the above apparatus to perform the corresponding method, and a processor configured to execute the computer instructions stored in the memory. The apparatus may further comprise a communication interface for the apparatus to communicate with other devices or a communication network.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored on the memory, where the processor executes the computer program to implement the method of any one of the above aspects.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium storing computer instructions for use by any one of the above-described apparatuses, which when executed by a processor, are configured to implement the method of any one of the above-described aspects.
In a fifth aspect, embodiments of the present disclosure provide a computer program product comprising computer instructions for implementing the method of any one of the above aspects when executed by a processor.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
In order to solve the problem of reduced processing performance of a device caused by concurrency of a plurality of network requests, in the operation process of an application client, events such as entering a page or switching the page are detected in real time, after entering a current page is detected, a plurality of network requests to be processed currently are obtained, processing priorities of the plurality of network requests are adjusted based on whether the page aimed at by the plurality of network requests is the current page, and after adjustment is completed, the plurality of network requests are processed based on the adjusted processing priorities. By the method, the processing efficiency of a plurality of concurrent network requests can be improved, the processing performance of the processing equipment can be improved, and the experience of a user in using an application client can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 illustrates a flow chart of a priority adjustment method according to an embodiment of the present disclosure;
FIG. 2 illustrates an application flow diagram in an electronic map scenario in accordance with an embodiment of the present disclosure;
FIG. 3 shows a block diagram of a priority adjustment device according to an embodiment of the present disclosure;
Fig. 4 is a schematic structural diagram of an electronic device suitable for use in implementing a priority adjustment method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, portions irrelevant to description of the exemplary embodiments are omitted in the drawings.
In this disclosure, it should be understood that terms such as "comprises" or "comprising," etc., are intended to indicate the presence of features, numbers, steps, acts, components, portions, or combinations thereof disclosed in this specification, and do not preclude the presence or addition of one or more other features, numbers, steps, acts, components, portions, or combinations thereof.
In addition, it should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Details of embodiments of the present disclosure are described in detail below with reference to specific embodiments.
Fig. 1 shows a flowchart of a priority adjustment method according to an embodiment of the present disclosure. As shown in fig. 1, the priority adjustment method includes the steps of:
in step S101, after detecting a current page entering an application client, acquiring a plurality of network requests to be processed currently;
In step S102, adjusting a processing priority of the network request based on whether the page for which the network request is directed is the current page;
in step S103, the plurality of network requests are processed based on the processing priority.
In this embodiment, the application client may be any application client installed on the device, where the application client may include multiple pages, and after the application client is opened, the application client may directly enter the first page of the application client, and by clicking on a page element on the first page, the application client may enter a next-level page, that is, a non-first page, and clicking on a page element from the next-level page may also enter a next-level page, and so on. It will be understood, of course, that the non-home page of the application client may also be accessed directly via a web site link.
In the embodiment of the disclosure, the priority adjustment method can be executed on the device on which the application client is installed, and in the execution process, the opening and page switching events of the application client can be detected in real time. And after detecting that the application client enters a certain page, executing a priority dynamic adjustment method of the network request. For convenience of description, this incoming page may be referred to as the current page. The current page may be the top page of the application client or may be a non-top page.
The dynamic adjustment of priority may be triggered by an event entering the home page or page switch of the application client. After detecting the current page entering the application client, a plurality of network requests which need to be processed currently can be acquired. It will be appreciated that if the network request currently being processed is one, no priority adjustment may be made.
In some embodiments, the plurality of network requests that currently need to be processed may be newly received network requests after entering the current page, or may be network requests that have been generated on the previous page but have not been processed.
In some embodiments, the plurality of network requests may be pre-set with an initial processing priority.
In some embodiments, the processing priority of a network request may be adjusted based on whether the page for which the network request is directed is a current page.
In some embodiments, the priority of network requests for the current page may be appropriately increased, while the priority of network requests for other pages may be decreased. By the method, the network request of the current page can be processed quickly, the current page browsing requirement of the user can be responded quickly, and the network requests of other pages can be processed later.
After the processing priority is adjusted, the plurality of network requests may be processed based on the processing priority, that is, the network request with the higher priority is processed first, and the network request with the lower priority is processed later.
In order to solve the problem of reduced processing performance of a device caused by concurrency of a plurality of network requests, in the operation process of an application client, events such as entering a page or switching the page are detected in real time, after entering a current page is detected, a plurality of network requests to be processed currently are obtained, processing priorities of the plurality of network requests are adjusted based on whether the page aimed at by the plurality of network requests is the current page, and after adjustment is completed, the plurality of network requests are processed based on the adjusted processing priorities. By the method, the processing efficiency of a plurality of concurrent network requests can be improved, the processing performance of the processing equipment can be improved, and the experience of a user in using an application client can be improved.
In an optional implementation manner of this embodiment, step S101, that is, after detecting the current page entering the application client, is a step of acquiring a plurality of network requests to be processed currently, and further includes the following steps:
After detecting a current page entering an application client, acquiring a current network request triggered by entering the current page and a history network request which is not processed before entering the current page.
In this optional implementation manner, if the number of network requests generated concurrently is excessive, or the user page switching speed is high, so that when entering the next page, there are some unprocessed historical network requests, after detecting the current page entering the application client, the current network request triggered by entering the current page and the unprocessed historical network request before entering the current page may be obtained.
In an optional implementation manner of this embodiment, step S102, that is, a step of adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page, further includes the following steps:
Increasing the processing priority of the current network request and decreasing the processing priority of the historical network request.
In this embodiment, when the priority is adjusted, the priority of the historical network request may be reduced, and the priority of the current network request may be increased, so that the device may be able to process the network request of the current page preferentially.
In some embodiments, the initial processing priority of the current network request may be preset, and the initial processing priority of the historical network request may be an adjusted priority on the previous page or a preset initial processing priority. After entering the current page, the device may increase based on the initial processing priority of the current network request and increase based on the initial processing priority of the historical network request, and then process the current network request and the historical network request with the adjusted processing priority.
In some embodiments, after the adjustment, the current network request may have a higher processing priority than the historical network request, or may have a lower processing priority than the historical network request.
In an optional implementation manner of this embodiment, the step of increasing the processing priority of the current network request and decreasing the processing priority of the historical network request further includes the steps of:
weighting the processing priority of the current network request to improve the processing priority of the current network request;
And processing the processing priority of the historical network request in a weight reducing way so as to reduce the processing priority of the historical network request.
In this alternative implementation, the initial processing priority of the current network request may be set after entering the current page, and the initial processing priority may be a default value or another processing priority set in another manner. And the initial processing priority of the historical network request may be the processing priority adjusted on the previous page. Therefore, after entering the current page, weighting processing can be performed on the basis of the initial processing priority of the current network request, so that the priority of the current network request is improved, and the weighting processing can be performed on the basis of the initial processing priority of the historical network request, so that the priority of the historical network request is reduced.
In some embodiments, different weights may be given to the preset core network request and the non-preset core network request, for example, when the current network request belongs to the preset core network request, a higher weight may be given to greatly increase the processing priority of the current network request, and when the current network request does not belong to the preset core network request, a lower weight may be given to slightly increase the processing priority of the current network request; similarly, when the history network request belongs to the preset core network request, a lower weight can be given to reduce the processing priority of the history network request by a smaller extent, and when the history network request does not belong to the preset core network request, a higher weight can be given to reduce the processing priority of the history network request by a larger extent.
It should be noted that, after the weighting and the de-weighting processing, there may be a case where the processing priority of the historical network request is still higher than the processing priority of the current network request, for example, the processing priority of the preset core network request in the historical network request may be higher than the processing priority of the non-preset core network request in the current network request.
In an optional implementation manner of this embodiment, after the step of acquiring the current network request triggered by entering the current page and the historical network request that is not yet transmitted after detecting the request for entering the current page, the method further includes the following steps:
setting the initial processing priority of the current network request, so that the initial processing priority of the preset core network request in the current network request is higher than the initial processing priority of the non-preset core network request in the current network request.
In this alternative implementation, after entering the current page, an initial processing priority may also be set for the current network request for the current page, which may be a default value or otherwise set value. And when the current network request is a preset core network request, the initial processing priority of the current network request may be higher than the initial processing priority of a non-preset core network request for the current page.
It should be noted that the default priorities of the preset core network requests for different pages may be the same or different. For example, the default priority of the preset core network request for the home page may be higher than the preset core network requests for other pages.
In an alternative implementation of this embodiment, the method further includes the steps of:
after detecting a request for opening the application client to enter a home page, acquiring a network request triggered by entering the home page;
setting the initial processing priority of the network requests, so that the initial processing priority of the preset core network requests in the network requests is higher than the initial processing priority of the non-preset core network requests.
In this alternative implementation, the initial processing priority of the network request may be preset, and after the page switch occurs, the processing priority of the network request may be dynamically adjusted.
In some embodiments, after the home page entering the application client is detected, a network request triggered by the home page may be acquired, and an initial processing priority of the network request may be set, where the initial processing priority may be a default value or a processing priority set by another manner. When the initial processing priority is set, the initial processing priority of the preset core network request corresponding to the home page can be set to be higher than the initial processing priority of the non-preset core network request, so that the preset core network request is processed before the non-preset core network request.
In an optional implementation manner of this embodiment, step S102, that is, a step of adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page, further includes the following steps:
The processing priority of the network request for the current page is adjusted to be higher than the processing priority of other network requests.
In this alternative implementation, the processing priority of the network request for the current page may also be directly adjusted to be higher than the processing priority of other network requests. The other network request may be a network request for other pages than the network request for the current page.
In some embodiments, when the processing priority of the network request of the current page is increased, priority adjustment may be further performed based on whether the network request is a preset core network request, that is, the processing priority of the preset core network request of the current page may be adjusted to be higher than the processing priority of the non-preset core network request of the current page.
In an optional implementation of this embodiment, the step of adjusting the processing priority of the network request for the current page to be higher than the processing priority of other network requests further includes the steps of:
And adjusting the priority of a preset core network request in the network requests aiming at the current page to be higher than the processing priority of other network requests.
In this alternative implementation, it is also important to consider that the processing priority of the preset core network request of the other page is also important, so when the processing priority is adjusted, the processing priority of the preset core network request of the current page may be only adjusted to be higher than that of the other network request, but the processing priority of the non-preset core network request of the current page is not necessarily adjusted to be higher than that of the other network request, that is, the processing priority of the non-preset core network request of the current page may be increased, but not necessarily increased to be higher than that of the other network request. Other network requests herein include network requests for non-current pages.
Fig. 2 shows a schematic application flow in an electronic map scenario according to an embodiment of the present disclosure. As shown in fig. 2, a user double-clicks a map application installed on a mobile phone to enter a home page, and the map application triggers several tens of network requests, such as a location request, a drawing data request, a home route request, a going-to-company route request, etc., in response to an event that the home page is opened. These network requests may be given initial processing priority by default after entering the home page, with higher priority for core network requests and lower priority for non-core network requests. The map application processes these network requests based on the assigned priority schedule.
If a fast switch to a nearby page is made before these network requests are not processed, then the incoming event of the nearby page will trigger some new network requests, such as a Golduser guide request, an operation activity request, a POI list request, etc. At this time, the application end can dynamically adjust the priority for the new network requests and the network requests which are not processed before, and can increase the priority of the new network requests and reduce the priority of the network requests which are not processed before. After the adjustment is completed, all network requests are processed based on the adjusted priority.
The following are device embodiments of the present disclosure that may be used to perform method embodiments of the present disclosure.
Fig. 3 illustrates a priority adjustment apparatus according to an embodiment of the present disclosure, which may be implemented as part or all of an electronic device by software, hardware, or a combination of both. The priority adjustment device includes:
the first obtaining module 301 is configured to obtain a plurality of network requests to be processed currently after detecting a current page entering the application client;
an adjustment module 302 configured to adjust a processing priority of the network request based on whether a page for which the network request is directed is the current page;
A processing module 303 is configured to process the plurality of network requests based on the processing priority.
In this embodiment, the application client may be any application client installed on the device, where the application client may include multiple pages, and after the application client is opened, the application client may directly enter the first page of the application client, and by clicking on a page element on the first page, the application client may enter a next-level page, that is, a non-first page, and clicking on a page element from the next-level page may also enter a next-level page, and so on. It will be understood, of course, that the non-home page of the application client may also be accessed directly via a web site link.
In the embodiment of the disclosure, the priority adjustment method can be executed on the device on which the application client is installed, and in the execution process, the opening and page switching events of the application client can be detected in real time. And after detecting that the application client enters a certain page, executing a priority dynamic adjustment method of the network request. For convenience of description, this incoming page may be referred to as the current page. The current page may be the top page of the application client or may be a non-top page.
The dynamic adjustment of priority may be triggered by an event entering the home page or page switch of the application client. After detecting the current page entering the application client, a plurality of network requests which need to be processed currently can be acquired. It will be appreciated that if the network request currently being processed is one, no priority adjustment may be made.
In some embodiments, the plurality of network requests that currently need to be processed may be newly received network requests after entering the current page, or may be network requests that have been generated on the previous page but have not been processed.
In some embodiments, the plurality of network requests may be pre-set with an initial processing priority.
In some embodiments, the processing priority of a network request may be adjusted based on whether the page for which the network request is directed is a current page.
In some embodiments, the priority of network requests for the current page may be appropriately increased, while the priority of network requests for other pages may be decreased. By the method, the network request of the current page can be processed quickly, the current page browsing requirement of the user can be responded quickly, and the network requests of other pages can be processed later.
After the processing priority is adjusted, the plurality of network requests may be processed based on the processing priority, that is, the network request with the higher priority is processed first, and the network request with the lower priority is processed later.
In order to solve the problem of reduced processing performance of a device caused by concurrency of a plurality of network requests, in the operation process of an application client, events such as entering a page or switching the page are detected in real time, after entering a current page is detected, a plurality of network requests to be processed currently are obtained, processing priorities of the plurality of network requests are adjusted based on whether the page aimed at by the plurality of network requests is the current page, and after adjustment is completed, the plurality of network requests are processed based on the adjusted processing priorities. By the method, the processing efficiency of a plurality of concurrent network requests can be improved, the processing performance of the processing equipment can be improved, and the experience of a user in using an application client can be improved.
In an optional implementation manner of this embodiment, the first obtaining module includes:
The first acquisition sub-module is configured to acquire a current network request triggered by entering the current page and a history network request which is not processed and completed before entering the current page after detecting the current page entering the application client.
In this optional implementation manner, if the number of network requests generated concurrently is excessive, or the user page switching speed is high, so that when entering the next page, there are some unprocessed historical network requests, after detecting the current page entering the application client, the current network request triggered by entering the current page and the unprocessed historical network request before entering the current page may be obtained.
In an optional implementation manner of this embodiment, the adjusting module includes:
An increase sub-module configured to increase the processing priority of the current network request and decrease the processing priority of the historical network request.
In this embodiment, when the priority is adjusted, the priority of the historical network request may be reduced, and the priority of the current network request may be increased, so that the device may be able to process the network request of the current page preferentially.
In some embodiments, the initial processing priority of the current network request may be preset, and the initial processing priority of the historical network request may be an adjusted priority on the previous page or a preset initial processing priority. After entering the current page, the device may increase based on the initial processing priority of the current network request and increase based on the initial processing priority of the historical network request, and then process the current network request and the historical network request with the adjusted processing priority.
In some embodiments, after the adjustment, the current network request may have a higher processing priority than the historical network request, or may have a lower processing priority than the historical network request.
In an optional implementation manner of this embodiment, the enhancing sub-module includes:
a weighting sub-module configured to weight the processing priority of the current network request to increase the processing priority of the current network request;
and the de-weighting sub-module is configured to de-weight the processing priority of the historical network request so as to reduce the processing priority of the historical network request.
In this alternative implementation, the initial processing priority of the current network request may be set after entering the current page, and the initial processing priority may be a default value or another processing priority set in another manner. And the initial processing priority of the historical network request may be the processing priority adjusted on the previous page. Therefore, after entering the current page, weighting processing can be performed on the basis of the initial processing priority of the current network request, so that the priority of the current network request is improved, and the weighting processing can be performed on the basis of the initial processing priority of the historical network request, so that the priority of the historical network request is reduced.
In some embodiments, different weights may be given to the preset core network request and the non-preset core network request, for example, when the current network request belongs to the preset core network request, a higher weight may be given to greatly increase the processing priority of the current network request, and when the current network request does not belong to the preset core network request, a lower weight may be given to slightly increase the processing priority of the current network request; similarly, when the history network request belongs to the preset core network request, a lower weight can be given to reduce the processing priority of the history network request by a smaller extent, and when the history network request does not belong to the preset core network request, a higher weight can be given to reduce the processing priority of the history network request by a larger extent.
It should be noted that, after the weighting and the de-weighting processing, there may be a case where the processing priority of the historical network request is still higher than the processing priority of the current network request, for example, the processing priority of the preset core network request in the historical network request may be higher than the processing priority of the non-preset core network request in the current network request.
In an optional implementation manner of this embodiment, after the first obtaining module, the apparatus further includes:
The first setting module is configured to set the initial processing priority of the current network request, so that the initial processing priority of the preset core network request in the current network request is higher than the initial processing priority of the non-preset core network request in the current network request.
In this alternative implementation, after entering the current page, an initial processing priority may also be set for the current network request for the current page, which may be a default value or otherwise set value. And when the current network request is a preset core network request, the initial processing priority of the current network request may be higher than the initial processing priority of a non-preset core network request for the current page.
It should be noted that the default priorities of the preset core network requests for different pages may be the same or different. For example, the default priority of the preset core network request for the home page may be higher than the preset core network requests for other pages.
The apparatus further comprises:
The second acquisition module is configured to acquire a network request triggered by entering the home page after detecting a request for entering the home page for opening the application client;
the second setting module is configured to set the initial processing priority of the network requests so that the initial processing priority of the preset core network requests in the network requests is higher than the initial processing priority of the non-preset core network requests.
In this alternative implementation, the initial processing priority of the network request may be preset, and after the page switch occurs, the processing priority of the network request may be dynamically adjusted.
In some embodiments, after the home page entering the application client is detected, a network request triggered by the home page may be acquired, and an initial processing priority of the network request may be set, where the initial processing priority may be a default value or a processing priority set by another manner. When the initial processing priority is set, the initial processing priority of the preset core network request corresponding to the home page can be set to be higher than the initial processing priority of the non-preset core network request, so that the preset core network request is processed before the non-preset core network request.
In an optional implementation manner of this embodiment, the adjusting module includes:
A first adjustment sub-module configured to adjust a processing priority of the network request for the current page to be higher than processing priorities of other network requests.
In this alternative implementation, the processing priority of the network request for the current page may also be directly adjusted to be higher than the processing priority of other network requests. The other network request may be a network request for other pages than the network request for the current page.
In some embodiments, when the processing priority of the network request of the current page is increased, priority adjustment may be further performed based on whether the network request is a preset core network request, that is, the processing priority of the preset core network request of the current page may be adjusted to be higher than the processing priority of the non-preset core network request of the current page.
In an optional implementation manner of this embodiment, the first adjustment sub-module includes:
and the second adjusting sub-module is configured to adjust the priority of a preset core network request in the network requests for the current page to be higher than the processing priority of other network requests.
In this alternative implementation, it is also important to consider that the processing priority of the preset core network request of the other page is also important, so when the processing priority is adjusted, the processing priority of the preset core network request of the current page may be only adjusted to be higher than that of the other network request, but the processing priority of the non-preset core network request of the current page is not necessarily adjusted to be higher than that of the other network request, that is, the processing priority of the non-preset core network request of the current page may be increased, but not necessarily increased to be higher than that of the other network request. Other network requests herein include network requests for non-current pages.
Fig. 4 is a schematic structural diagram of an electronic device suitable for use in implementing a priority adjustment method according to an embodiment of the present disclosure.
As shown in fig. 4, the electronic device 400 includes a processing unit 401, which may be implemented as a processing unit CPU, GPU, FPGA, NPU or the like. The processing unit 401 may execute various processes in the embodiments of any of the above methods of the present disclosure according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data necessary for the operation of the electronic device 400 are also stored. The processing unit 401, ROM402, and RAM403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output portion 407 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage section 408 including a hard disk or the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. The drive 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
In particular, according to embodiments of the present disclosure, any of the methods described above with reference to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods of embodiments of the present disclosure. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 409 and/or installed from the removable medium 411.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware. The units or modules described may also be provided in a processor, the names of which in some cases do not constitute a limitation of the unit or module itself.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a device. The computer-readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention referred to in this disclosure is not limited to the specific combination of features described above, but encompasses other embodiments in which any combination of features described above or their equivalents is contemplated without departing from the inventive concepts described. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Claims (10)
1. A priority adjustment method, comprising:
after detecting a current page entering an application client, acquiring a plurality of network requests to be processed currently;
adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page;
Processing the plurality of network requests based on the processing priority;
Wherein the adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page includes:
The processing priority of the current network request is improved; the processing priority of the current network request is the network request triggered by entering the current page.
2. The method of claim 1, wherein, after detecting a current page into the application client, obtaining a plurality of network requests currently pending comprises:
After detecting a current page entering an application client, acquiring a current network request triggered by entering the current page and a history network request which is not processed before entering the current page.
3. The method of claim 2, wherein adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page comprises:
and reducing the processing priority of the historical network request.
4. The method of claim 3, wherein increasing the processing priority of the current network request and decreasing the processing priority of the historical network request comprises:
weighting the processing priority of the current network request to improve the processing priority of the current network request;
And processing the processing priority of the historical network request in a weight reducing way so as to reduce the processing priority of the historical network request.
5. The method according to any of claims 2-4, wherein after detecting a request to enter a current page, obtaining a current network request triggered to enter the current page and a historical network request that has not been sent, the method comprises:
setting the initial processing priority of the current network request, so that the initial processing priority of the preset core network request in the current network request is higher than the initial processing priority of the non-preset core network request in the current network request.
6. The method of any of claims 1-4, wherein the method further comprises:
after detecting a request for opening the application client to enter a home page, acquiring a network request triggered by entering the home page;
setting the initial processing priority of the network requests, so that the initial processing priority of the preset core network requests in the network requests is higher than the initial processing priority of the non-preset core network requests.
7. The method of any of claims 1-4, wherein adjusting the processing priority of the network request based on whether the page for which the network request is directed is the current page comprises:
The processing priority of the network request for the current page is adjusted to be higher than the processing priority of other network requests.
8. The method of claim 7, wherein adjusting the processing priority of the network request for the current page to be higher than the processing priority of other network requests comprises:
And adjusting the priority of a preset core network request in the network requests aiming at the current page to be higher than the processing priority of other network requests.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the processor executes the computer program to implement the method of any of claims 1-8.
10. A computer readable storage medium having stored thereon computer instructions, wherein the computer instructions, when executed by a processor, implement the method of any of claims 1-8.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210247930.1A CN115037801B (en) | 2022-03-14 | 2022-03-14 | Priority adjustment method, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210247930.1A CN115037801B (en) | 2022-03-14 | 2022-03-14 | Priority adjustment method, electronic device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115037801A CN115037801A (en) | 2022-09-09 |
| CN115037801B true CN115037801B (en) | 2024-07-12 |
Family
ID=83119304
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210247930.1A Active CN115037801B (en) | 2022-03-14 | 2022-03-14 | Priority adjustment method, electronic device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115037801B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112231604A (en) * | 2020-06-12 | 2021-01-15 | 北京沃东天骏信息技术有限公司 | A page display method, apparatus, electronic device and storage medium |
Family Cites Families (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7325045B1 (en) * | 2003-08-05 | 2008-01-29 | A9.Com, Inc. | Error processing methods for providing responsive content to a user when a page load error occurs |
| CN102123168B (en) * | 2011-01-14 | 2012-07-18 | 广州市动景计算机科技有限公司 | Web page pre-reading and integration method and system based on relay server |
| US10013500B1 (en) * | 2013-12-09 | 2018-07-03 | Amazon Technologies, Inc. | Behavior based optimization for content presentation |
| CN108073580A (en) * | 2016-11-08 | 2018-05-25 | 北京国双科技有限公司 | A kind of processing method and processing device based on page concurrent request |
| CN110764682B (en) * | 2018-07-27 | 2022-09-30 | 北京京东尚科信息技术有限公司 | Page control method, page control device and computer-readable storage medium |
| CN109167761B (en) * | 2018-08-14 | 2021-06-01 | 河南恒茂创远科技股份有限公司 | Method and device for automatically processing request |
| CN109582899B (en) * | 2018-10-26 | 2024-09-13 | 平安科技(深圳)有限公司 | Page loading method and device, computer equipment and storage medium |
| US20200403929A1 (en) * | 2018-12-31 | 2020-12-24 | Facebook, Inc. | Systems and methods for digital media delivery prioritization |
| CN113656108A (en) * | 2021-08-25 | 2021-11-16 | 北京知道创宇信息技术股份有限公司 | Method, apparatus, electronic device and computer-readable storage medium for loading web page |
-
2022
- 2022-03-14 CN CN202210247930.1A patent/CN115037801B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112231604A (en) * | 2020-06-12 | 2021-01-15 | 北京沃东天骏信息技术有限公司 | A page display method, apparatus, electronic device and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115037801A (en) | 2022-09-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11012892B2 (en) | Resource obtaining method, apparatus, and system | |
| US10489476B2 (en) | Methods and devices for preloading webpages | |
| US9450912B2 (en) | Method and device for accessing application server | |
| CN113467910B (en) | Overload protection scheduling method based on service level | |
| CN110708256A (en) | CDN scheduling method, device, network device and storage medium | |
| WO2022104754A1 (en) | Network resource management method, management apparatus, electronic device, and storage medium | |
| US20230275976A1 (en) | Data processing method and apparatus, and computer-readable storage medium | |
| CN114490048A (en) | Task execution method and device, electronic equipment and computer storage medium | |
| CN106649640A (en) | Instant search method and device | |
| US12519713B2 (en) | Method, device, equipment and storage medium for redirecting edge nodes for clients | |
| US11025712B1 (en) | Load balancer employing slow start, weighted round robin target selection | |
| CN112784139B (en) | Query method, device, electronic equipment and computer readable medium | |
| CN116846831A (en) | Current limiting processing method and device, electronic equipment and computer readable medium | |
| CN115037801B (en) | Priority adjustment method, electronic device and storage medium | |
| CN110855787A (en) | Method for realizing OpenResty dynamic load balancing based on Consul | |
| US8271651B1 (en) | Methods and systems for regulating resource usage | |
| CN118233389A (en) | Access flow control method and device | |
| CN115086300B (en) | Video file scheduling method and device | |
| CN117459535A (en) | Application calling method, device, equipment and storage medium | |
| US20230216939A1 (en) | Dynamically switching between synchronous and asynchronous communication channels | |
| CN114116943B (en) | A method, terminal device and storage medium for optimizing map tile loading | |
| US9479579B2 (en) | Grouping processing method and system | |
| CN116541167A (en) | System flow control method, device, electronic equipment and computer readable medium | |
| CN116719640A (en) | Service load balancing method, device, equipment and storage medium | |
| CN109542601B (en) | Policy compiling method and device, electronic equipment and computer storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |