CN111090515B - Access control method, device, terminal equipment and storage medium - Google Patents

Access control method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN111090515B
CN111090515B CN201911157959.5A CN201911157959A CN111090515B CN 111090515 B CN111090515 B CN 111090515B CN 201911157959 A CN201911157959 A CN 201911157959A CN 111090515 B CN111090515 B CN 111090515B
Authority
CN
China
Prior art keywords
asynchronous request
asynchronous
request
page
acquiring
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911157959.5A
Other languages
Chinese (zh)
Other versions
CN111090515A (en
Inventor
吴明骏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rajax Network Technology Co Ltd
Original Assignee
Rajax Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rajax Network Technology Co Ltd filed Critical Rajax Network Technology Co Ltd
Priority to CN201911157959.5A priority Critical patent/CN111090515B/en
Publication of CN111090515A publication Critical patent/CN111090515A/en
Application granted granted Critical
Publication of CN111090515B publication Critical patent/CN111090515B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Abstract

The embodiment of the invention provides an access control method, an access control device, terminal equipment and a storage medium, wherein the access control method comprises the following steps: acquiring a data acquisition change signal; determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data; acquiring each asynchronous request according to the asynchronous request identifier, and acquiring an asynchronous request cancellation command corresponding to each asynchronous request; and operating each asynchronous request cancellation command to cancel each asynchronous request. The embodiment of the invention can cancel the asynchronous request with the asynchronous request identifier in batches, improves the rationality of access control, reduces the occupancy rate of the terminal memory, improves the speed of web page access and improves the use experience of users.

Description

Access control method, device, terminal equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to an access control method, an access control device, terminal equipment and a storage medium.
Background
With the popularization of computer technology, users mostly use a browser to search information, and when the browser is used for searching information, in order to avoid the long-term waiting state of the browser, ensure the use friendliness of the browser, multiple asynchronous requests can be generated, and the efficiency of access is improved by using the asynchronous requests.
Although the asynchronous request can improve the access efficiency, the asynchronous request is a plurality of parallel requests, which can occupy the memory resources of the client, so that the consumption of the memory resources is caused, especially when a plurality of pages are accessed, the page access is blocked, and the use experience is affected.
Therefore, how to improve the rationality of access control and improve the rationality of access control is a technical problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present invention provide an access control method, apparatus, terminal device, and storage medium, so as to improve the rationality of access control.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
in aspect 1, an embodiment of the present invention provides an access control method, including:
acquiring a data acquisition change signal;
determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data;
acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the asynchronous request identifiers;
and operating each asynchronous request cancellation command to cancel each asynchronous request.
With reference to aspect 1, in an implementation manner of aspect 1 of the present invention,
the acquiring the data acquisition variation signal includes:
acquiring a page jump signal from a first page to a second page;
the step of determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data, and the step of determining the asynchronous request identifier comprises the following steps of:
determining a first page domain request identifier according to the page skip signal, wherein the first page domain request identifier is used for identifying each asynchronous request for acquiring data in a preset area of a first page;
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
and acquiring an asynchronous request cancellation command corresponding to each asynchronous request according to the first page domain request identifier.
With reference to implementation manner of the 1 st aspect, in a 2 nd implementation manner of the 1 st aspect, the predetermined area of the first page includes an entire area of the first page or a partial area of the first page. .
With reference to aspect 1, in a 3 rd implementation manner of aspect 1,
The acquiring the data acquisition variation signal includes:
acquiring a target data receiving signal;
the step of determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data, and the step of determining the asynchronous request identifier comprises the following steps of:
acquiring a target data request identifier according to the target data receiving signal, wherein the target data request identifier is used for identifying each asynchronous request for acquiring the same target data;
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
and acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the target data request identifiers.
With reference to aspect 1 or any implementation manner of 1 st to 3 rd implementation manners of aspect 1, in a 4 th implementation manner of aspect 1,
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
acquiring the asynchronous requests according to the asynchronous request identifiers;
acquiring each asynchronous request cancellation command corresponding to the asynchronous request according to the asynchronous request
With reference to aspect 1 or any implementation manner of 1 st to 3 rd implementation manners of aspect 1, in a 5 th implementation manner of aspect 1, an embodiment of the present invention sets the asynchronous request identifier for each asynchronous request when the asynchronous request is triggered.
With reference to aspect 1 or any implementation manner of 1 st to 3 rd implementation manners of aspect 1, in a 6 th implementation manner of aspect 1, an embodiment of the present invention is at least 2 asynchronous requests for acquiring the data.
In aspect 2, an embodiment of the present invention further provides an access control apparatus, including:
a change signal acquisition unit adapted to acquire a data acquisition change signal;
an identifier acquisition unit adapted to determine an asynchronous request identifier according to the data acquisition variation signal, the asynchronous request identifier being used for identifying each asynchronous request for acquiring the data;
a cancel command acquisition unit adapted to acquire an asynchronous request cancel command corresponding to each of the asynchronous requests according to the asynchronous request identifier;
and the asynchronous request cancellation unit is suitable for running each asynchronous request cancellation command and canceling each asynchronous request.
In aspect 3, an embodiment of the present invention further provides a terminal device, including at least one memory and at least one processor, where the memory stores one or more computer instructions, and where the one or more computer instructions are executed by the processor to implement an access control method as described above.
In a 4 th aspect, embodiments of the present invention further provide a storage medium storing one or more computer instructions for implementing an access control method as described above.
According to the access control method provided by the embodiment of the invention, the asynchronous request identification can be determined according to the data acquisition change signal, and because each asynchronous request for acquiring the data is identified by the asynchronous request identification, according to the asynchronous request identification, an asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be run in batches, the asynchronous requests are cancelled in batches, and further when the data acquisition change signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
The access control method provided by the embodiment of the application can timely cancel the asynchronous request with the asynchronous request identifier in batches when the data acquisition change signal is acquired, thereby improving the rationality of access control, reducing the occupancy rate of the terminal memory, improving the speed of web page access and improving the use experience of users.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an access control method provided by an embodiment of the present application;
FIG. 2 is a request relation schematic of an access control method according to an embodiment of the present application;
FIG. 3 is another flowchart of an access control method according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating an access control method according to an embodiment of the present application;
fig. 5 is a block diagram of an access control device according to an embodiment of the present application;
Fig. 6 is a hardware configuration diagram of the terminal device.
Detailed Description
The access control method provided by the embodiment of the invention can timely cancel the asynchronous request with the asynchronous request identifier in batches when the data acquisition change signal is acquired, thereby improving the rationality of access control.
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As an optional implementation, fig. 1 shows a flowchart of an access control method provided by an embodiment of the present invention, and referring to fig. 1, the flowchart may include:
step S10, acquiring a data acquisition change signal.
When acquiring data by using a browser, the general procedure is as follows:
the user initiates a request for acquiring data through the browser, so that the browser sends the data acquisition request to the server to request the data from the server, the server transmits the data requested by the browser to the browser, and the browser presents the data to the user in a page refreshing mode.
Based on the above process, it can be understood that the data acquisition change signal is a signal of a change condition of data acquisition after the browser sends an asynchronous request for data acquisition to the server, for example: the signal that the data has been acquired, the signal that the user initiated the asynchronous request through the browser to acquire the corresponding data, but the signal that is not interested in the requested data is indicated through the operation of the browser, or the signal that the user initiated the asynchronous request through the browser, but the asynchronous request has been executed for a long time and has not yet acquired the corresponding data, etc., of course, the data acquisition change signal will also be different according to the different application scenarios of the specific asynchronous request, the expression form of the specific data acquisition change signal may be determined according to the needs, and the limitation is not made herein, as long as the change of the data acquisition is embodied.
In various embodiments, the specific form of the data acquisition variation signal may be set as desired, such as: page skip signals, data receive signals, timeout signals, etc.
And step S11, determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data.
And triggering the execution of the acquisition of the asynchronous request identification when the data acquisition change signal is obtained, and corresponding to the specific data acquisition change signal, wherein the asynchronous request identified by the obtained asynchronous request identification is a request for acquiring the data in the data acquisition change signal, and the asynchronous request identification can be determined based on the data acquisition change signal due to the corresponding relationship between the asynchronous request identification and the data in the data acquisition change signal.
In addition, in the access control method provided by the embodiment of the present invention, in a specific implementation manner, the asynchronous request identifier obtained according to the data obtaining change signal may identify only one asynchronous request, that is, the data to be obtained is obtained only through one asynchronous request; in other embodiments, the asynchronous request identifier obtained according to the data obtaining change signal may also identify at least 2 asynchronous requests, that is, the data to be obtained is obtained by a plurality of asynchronous requests, and the plurality of asynchronous requests are identified by one and the same asynchronous request identifier.
Referring to fig. 2 specifically, fig. 2 is a schematic diagram of a request relationship of an access control method according to an embodiment of the present invention.
As can be seen from the figure, the user triggers the asynchronous request 1, the asynchronous request 2 and the asynchronous request 3 to acquire the data a through the browser, and it is known that the asynchronous request 1, the asynchronous request 2 and the asynchronous request 3 are all used for requesting the data related to the data a to be acquired by the data acquisition change signal, and may be all used for requesting all the data of the data a, or may respectively request to acquire the data (the data A1, the data A2 and the data A3) of different parts of the data a, namely: the asynchronous request 1 is used for requesting to acquire the data A1, the asynchronous request 2 is used for requesting to acquire the data A2, and the asynchronous request 3 is used for requesting to acquire the data A3; in either case, three of asynchronous request 1, asynchronous request 2, and asynchronous request 3 have the same asynchronous request identity, asynchronous request identity a.
When the data acquisition change signal of the data a is acquired, the asynchronous request identifier a can be obtained based on the data acquisition change signal.
It can be understood that, the asynchronous request identifier a of the asynchronous request 1, the asynchronous request 2 and the asynchronous request 3 are preset before the access control method provided by the embodiment of the present invention is executed, and in a specific embodiment, the asynchronous request identifier may be set for each asynchronous request when data needs to be acquired to trigger the asynchronous request. Thus, the access control method provided by the embodiment of the invention can be ensured to be smoothly executed, the asynchronous request identification does not exist for a long time, and the space occupied by storing the asynchronous request when the asynchronous request is not triggered can be reduced.
Specifically, it may be set as required that each asynchronous request for acquiring which data has the same asynchronous request identifier, for example, it may be set that an asynchronous request for acquiring picture data of region a in one page has the same asynchronous request identifier, or it may be set that all asynchronous requests for acquiring all picture data, video data, and text data in one entire page have the same asynchronous request identifier.
Because of the Promise asynchronous request provided by JavaScript, the asynchronous data acquisition and the business logic are separated, so that a developer can concentrate on one thing, and the asynchronous data acquisition and the business logic do not need to be considered at the same time, and the asynchronous data acquisition system is widely applied.
In a specific implementation manner, in order to implement the access control method provided by the embodiment of the present invention in JavaScript, a CancelManager object is provided in JavaScript, where an instruction of a CancelManager module may set an asynchronous request identifier for each asynchronous request when triggering the asynchronous request.
Thus, when browser access is realized by using the Promise asynchronous request provided by JavaScript, in order to realize cancellation of the Promise asynchronous request for requesting the same data (including all requests of data and partial requests of data), an instruction of a cancelmanager module can be called when the asynchronous request is triggered, so that asynchronous request identification is set for each Promise asynchronous request.
And step S12, acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the asynchronous request identifiers.
After the asynchronous request identifier is obtained, based on the asynchronous request identifier, an asynchronous request cancellation command can be further obtained so as to cancel the asynchronous request provided with the asynchronous request identifier.
In one embodiment, the corresponding asynchronous request may be obtained based on the asynchronous request identification, and further an asynchronous request cancellation command corresponding to the asynchronous request may be obtained.
With continued reference to fig. 2, when the acquisition of the data a changes, and a data acquisition change signal of the data a is acquired, the asynchronous request identifier a corresponding to the data acquisition change signal can be obtained based on the information in the data acquisition change signal, so as to obtain an asynchronous request 1, an asynchronous request 2 and an asynchronous request 3.
After each asynchronous request is obtained, an asynchronous request cancellation command corresponding to the asynchronous request is obtained according to the specific asynchronous request, and after an asynchronous request 1, an asynchronous request 2 and an asynchronous request 3 are obtained by combining with fig. 2, an asynchronous request cancellation command 1 is obtained according to the asynchronous request 1, an asynchronous request cancellation command 2 is obtained according to the asynchronous request 2, and an asynchronous request cancellation command 3 is obtained according to the asynchronous request 3.
Of course, the binding relationship between the asynchronous request and the asynchronous request cancellation command is also preset, and when access control is performed, the corresponding asynchronous request cancellation command can be found according to the asynchronous request.
In another embodiment, the asynchronous request cancellation command corresponding to each asynchronous request may also be directly acquired based on the asynchronous request identifier, and of course, association information between the asynchronous request cancellation command and the asynchronous request identifier needs to be preset, for example: the method can set the asynchronous request identifier for the asynchronous request, and set the cancel command identifier for the asynchronous request cancel command, wherein the cancel command identifier has a corresponding relation with the asynchronous request identifier, so that the acquisition logic of the asynchronous request cancel command is simplified, and the operation amount is reduced.
And step S13, operating each asynchronous request cancellation command, and canceling each asynchronous request.
After the asynchronous request cancellation command is obtained, each asynchronous request cancellation command is operated, so that cancellation of each asynchronous request is realized.
It is understood that cancelling each asynchronous request refers to cancelling operations of subsequent events due to the asynchronous request, such as processing and presentation of data, and the like.
In a specific embodiment, after an asynchronous request cancellation command is obtained, the asynchronous request cancellation command is firstly dispatched to a request management center, then the request management center finds out a corresponding asynchronous request according to the asynchronous request cancellation command, and then executes the cancellation operation of each asynchronous request by running the asynchronous request cancellation command matched with the asynchronous request.
According to the access control method provided by the embodiment of the invention, the asynchronous request identification can be determined according to the data acquisition change signal, and because each asynchronous request for acquiring the data is identified by the asynchronous request identification, according to the asynchronous request identification, an asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be run in batches, each asynchronous request is cancelled, the asynchronous requests can be cancelled in batches, and further when the data acquisition change signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
The access control method provided by the embodiment of the invention can timely cancel the asynchronous request with the asynchronous request identifier in batches when the data acquisition change signal is acquired, thereby improving the rationality of access control, reducing the occupancy rate of the terminal memory, improving the speed of web page access and improving the use experience of users.
When a user accesses a browser, the user often switches from a first page click to a second page click, and a page jump is generated.
After the page jump, the data request of the first page before the page jump is still valid in general, and data is continuously requested from the server in the background, if the user accesses a website (such as a data portal and a big data website) which needs to display a large amount of data for the browser, the opening of the first page of the browser triggers an asynchronous request for acquiring a large amount of data, after a part of data is acquired and displayed to the user through a web page, the user may acquire the data of interest based on the displayed part of data, and click on a related link to perform the page jump, but in this case, if the asynchronous request for requesting to acquire the data of the first page is still executed, more memory resources are occupied.
In order to realize cancellation of an asynchronous request in the case of page skip, another specific implementation manner is provided in the embodiment of the present invention, please refer to fig. 3, and fig. 3 is another flowchart of an access control method provided in the embodiment of the present invention.
As shown in the figure, the access control method provided by the embodiment of the invention comprises the following steps:
Step S20: a page skip signal is obtained to skip from a first page to a second page.
When the user switches from the first page to the second page, a page jump signal of the first page to the second page is generated, and the browser can acquire the relevant page jump signal, which is one of the data acquisition change signals.
It will be appreciated that the first page and the second page may be set as required, for example, the first page is a specific browser page with a large amount of data, the second page is any one of all pages obtained based on the first page, and is not limited to a specific page, for example, the first page may be jumped to 10 pages, and the page jump information may be obtained as long as the first page clicks on a link and jumps to any one of 10 pages.
Of course, when the amount of data displayed on the first page reaches a large value, the step of acquiring page skip information in the access control method provided by the embodiment of the present invention needs to be triggered, and the step may also be set according to the need, which is not limited herein.
Step S21: and determining a first page domain request identifier according to the page jump signal, wherein the first page domain request identifier is used for identifying each asynchronous request for acquiring data in a preset area of the first page.
After the page jump signal is obtained, the first page area request identification can be determined according to the page jump signal.
It will be appreciated that the first page field request identifies the various asynchronous requests identified as being generated when accessing the first page for retrieving data presented within a certain area of the first page. The first page field request identifier is also configured for each asynchronous request when an asynchronous request to retrieve data within a predetermined area of the first page is triggered.
In a specific embodiment, the predetermined area of the first page is the whole area of the first page, in which case, when the page jump signal is acquired, according to the page jump signal, the acquired first page field request identifier identifies an asynchronous request for requesting all data of the first page; in another specific embodiment, the predetermined area of the first page is a partial area of the first page, in which case, when the page jump signal is acquired, according to the page jump signal, the acquired first page field request identifier identifies an asynchronous request for requesting the partial data of the first page, and specifically, what part of the asynchronous request of the data may be set in advance as required.
When the preset area of the first page is set, the area can be divided according to the position of the page, and then the preset area is determined; the regions may also be divided according to the form of the data presented by the page (text data, picture data, video data) to determine the predetermined regions.
Such as: the specific area of the first page may be set as the video data of the first page, so that when the page skip signal is received, the first page request identifier is obtained according to the page skip signal, and the first page request identifier is identified as an asynchronous request for requesting the video data of the first page; it is also possible to set the specific area of the first page as the first page area B (assuming the left area), and when the page jump signal is received, the first page area request identifier is acquired according to the page jump signal, and the first page area request identifier is identified as an asynchronous request for requesting the data of the first page area B.
In general, each asynchronous request for acquiring data in a predetermined area of a first page is used for requesting different data, but if each asynchronous request for acquiring data in the predetermined area of the first page has the same first page area request identifier, each asynchronous request to be canceled can be obtained in time when a page jump signal is obtained.
Step S22: and acquiring an asynchronous request cancellation command corresponding to each asynchronous request according to the first page domain request identifier.
After the first page domain request identifier is obtained, an asynchronous request cancellation command corresponding to each asynchronous request can be directly obtained according to the first page domain request identifier.
In another embodiment, after the first page area request identifier is obtained, each asynchronous request may be obtained according to the first page area request identifier, and further based on a binding relationship between the asynchronous request and the asynchronous request cancellation command, an asynchronous request cancellation command corresponding to each asynchronous request may be obtained.
And S23, running each asynchronous request cancellation command and canceling each asynchronous request.
The specific content of step S23 is shown in fig. 1 and the content of step S13 is not described herein.
According to the access control method provided by the embodiment of the invention, the first page area request identification can be determined according to the page jump signal, and as the first page area request identification identifies each asynchronous request for acquiring the data in the preset area of the first page, according to the first page area request identification, the asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be run in batches, the asynchronous requests can be cancelled in batches, and further, when the page jump signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
The access control method provided by the embodiment of the invention can timely cancel the asynchronous request with the first page area request identifier in batches when the page jump signal is acquired, thereby improving the rationality of access control, reducing the occupancy rate of the terminal memory, improving the speed of web page access and improving the use experience of users.
When a user accesses a browser, in order to increase the data acquisition speed and improve the user experience, a plurality of asynchronous requests are generated to acquire the same data from different servers, and when one of the asynchronous requests acquires the data and is displayed in the browser, other asynchronous requests may be in the process of acquiring the requests, so that the waste of equipment memory resources is caused.
In order to implement cancellation of an asynchronous request in the foregoing situation, another embodiment of the present invention is further provided, and referring to fig. 4, fig. 4 is a further flowchart of an access control method provided by the embodiment of the present invention.
In order to solve the foregoing problems, as shown in the drawings, the access control method provided by the embodiment of the present invention includes:
step S30: a target data reception signal is acquired.
The target data reception signal as described herein refers to a signal that target data requested to the server through an asynchronous request is received by a requesting terminal.
To obtain the target data a, the browser generates a plurality of asynchronous requests, which may include: the asynchronous requests A1, A2 and A3 respectively request target data from different servers, the speed of target data feedback of each server is different under the influence of the working conditions of different servers, when one of the asynchronous requests such as the target data requested by the asynchronous request A1 is received by a terminal, a target data receiving signal is obtained, and certainly under the influence of the target data feedback speed, the target data received first may be obtained by the request of the asynchronous request A2 or the target data received first by the request of the asynchronous request A3, and the method is not limited herein, so long as any one of the target data requested by the asynchronous requests is received by the terminal, the target data receiving signal is triggered to be generated, and then the target data receiving signal is received.
Step S31: and acquiring a target data request identifier according to the target data receiving signal, wherein the target data request identifier is used for identifying each asynchronous request for acquiring the same target data.
After the target data receiving signal is obtained, the target data request identifier can be obtained according to the target data receiving signal.
It will be appreciated that each asynchronous request identified by the target data request identifier for obtaining the target data is, of course, also preset, so that the corresponding asynchronous request can be successfully found when access control is performed.
Step S32: and acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the target data request identifiers.
After the target data request identifier is obtained, the asynchronous request cancellation command corresponding to each asynchronous request can be directly obtained according to the target data request identifier, and the association between the target data request identifier and the asynchronous request cancellation command is required to be established in advance.
After the target data request identifier is obtained, each asynchronous request can be obtained according to the target data request identifier, and the asynchronous request cancellation command corresponding to each asynchronous request can be further obtained based on the binding relationship between the asynchronous request and the asynchronous request cancellation command.
And step S33, running each asynchronous request cancellation command and canceling each asynchronous request.
The specific content of step S33 is shown in fig. 1 and the content of step S13 is not described herein.
According to the access control method provided by the embodiment of the invention, the target data request identification can be determined according to the target data receiving signal, and because each asynchronous request for acquiring the target data is identified by the target data request identification, according to the target data request identification, each asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be operated in batches, each asynchronous request can be cancelled in batches, and further when the target data receiving signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
The foregoing describes several embodiments of the present invention, and the various alternatives presented by the various embodiments may be combined, cross-referenced, with each other without conflict, extending beyond what is possible embodiments, all of which are considered to be embodiments of the present invention disclosed and disclosed.
In an application example, the access control method provided by the embodiment of the invention can be used for access control of a big data page, and the application process of the embodiment of the invention can be as follows:
When the user accesses the page A of the big data page by using the browser and only refreshes the area a of the page, the user finds interesting contents, clicks the link of the page A, and the browser jumps to the page B, and simultaneously acquires page jump information from the page A to the page B;
according to the page jump information, the page domain request identification A 'is acquired, the asynchronous request identified by the page domain request identification A' comprises an asynchronous request 1, asynchronous requests 2 and … … and an asynchronous request n, each asynchronous request is respectively used for acquiring data 1, data 2 and … … and data n of the page A, and the data 1, the data 2 and … … and the data n form all data of the page A.
Determining an asynchronous request 1, an asynchronous request 2, … … and an asynchronous request n according to a page domain request identifier A', further acquiring an asynchronous request cancellation command 1 corresponding to the asynchronous request 1 according to the asynchronous request 1, acquiring an asynchronous request cancellation command 2 corresponding to the asynchronous request 2 according to the asynchronous request 2, and acquiring an asynchronous request cancellation command n corresponding to the asynchronous request according to the asynchronous request n by … …;
the asynchronous request cancel command 1, the asynchronous request cancel commands 2, … …, and the asynchronous request cancel command n are run, and the asynchronous request 1, the asynchronous request 2, … …, and the asynchronous request n are canceled.
The access control method provided by the embodiment of the invention can timely cancel the asynchronous request with the asynchronous request identifier in batches when the data acquisition change signal is acquired, thereby improving the rationality of access control, reducing the occupancy rate of the terminal memory, improving the speed of web page access and improving the use experience of users.
The access control device provided by the embodiment of the present invention is described below, and the access control device described below may be considered as a functional module that is required to be set by a device to implement the access control method provided by the embodiment of the present invention. The contents of the access control apparatus described below may be referred to in correspondence with the contents of the access control method described above.
In an optional implementation, fig. 5 shows an optional block diagram of an access control apparatus provided by an embodiment of the present invention, and as shown in fig. 5, the access control apparatus may include:
a change signal acquisition unit 100 adapted to acquire a data acquisition change signal;
an identifier obtaining unit 110, adapted to determine an asynchronous request identifier according to the data obtaining change signal, where the asynchronous request identifier is used to identify each asynchronous request for obtaining the data;
a cancel command acquisition unit 120 adapted to acquire an asynchronous request cancel command corresponding to each of the asynchronous requests according to the asynchronous request identifier;
An asynchronous request cancellation unit 130 adapted to run each of said asynchronous request cancellation commands, cancel each of said asynchronous requests. .
When the browser is utilized to acquire data, a user initiates a request for acquiring the data through the browser, so that the browser sends the data acquisition request to the server to request the data from the server, the server transmits the data requested by the browser to the browser, and the browser presents the data to the user in a page refreshing mode.
Based on the above process, it can be understood that the data acquisition change signal acquired by the change signal acquiring unit 100 is a signal of a change condition of data acquisition after the browser sends an asynchronous request for data acquisition to the server, for example: the signal that the data has been acquired, the signal that the user initiates the asynchronous request through the browser to acquire the corresponding data, but the signal that the operation on the browser is not interested in the requested data, or the signal that the user initiates the asynchronous request through the browser, but the asynchronous request has been executed for a long time and the corresponding data is not acquired, etc., of course, the data acquisition change signal will also be different according to the different application scenarios of the specific asynchronous request, the specific expression form of the data acquisition change signal may be determined according to the needs, the limitation is not made here, and the specific form of the data acquisition change signal may be set according to the needs in different specific embodiments as long as the data acquisition change is embodied, for example: page skip signals, data receive signals, timeout signals, etc.
And triggering the execution of the acquisition of the asynchronous request identification when the data acquisition change signal is obtained, and corresponding to the specific data acquisition change signal, wherein the asynchronous request identified by the obtained asynchronous request identification is a request for acquiring the data in the data acquisition change signal, and the asynchronous request identification can be determined based on the data acquisition change signal due to the corresponding relationship between the asynchronous request identification and the data in the data acquisition change signal.
In addition, in the access control method provided by the embodiment of the present invention, in a specific implementation manner, the asynchronous request identifier obtained according to the data obtaining change signal may identify only one asynchronous request, that is, the data to be obtained is obtained only through one asynchronous request; in other embodiments, the asynchronous request identifier obtained according to the data obtaining change signal may also identify at least 2 asynchronous requests, that is, the data to be obtained is obtained by a plurality of asynchronous requests, and the plurality of asynchronous requests are identified by one and the same asynchronous request identifier.
It may be understood that, the asynchronous request identifier of each asynchronous request is preset before the access control method provided by the embodiment of the present invention is executed, and in a specific embodiment, the asynchronous request identifier may be set for each asynchronous request when data needs to be acquired to trigger the asynchronous request. Thus, the access control method provided by the embodiment of the invention can be ensured to be smoothly executed, the asynchronous request identification does not exist for a long time, and the space occupied by storing the asynchronous request when the asynchronous request is not triggered can be reduced.
Specifically, it may be set as required that each asynchronous request for acquiring which data has the same asynchronous request identifier, for example, it may be set that an asynchronous request for acquiring picture data of region a in one page has the same asynchronous request identifier, or it may be set that all asynchronous requests for acquiring all picture data, video data, and text data in one entire page have the same asynchronous request identifier.
Because of the Promise asynchronous request provided by JavaScript, the asynchronous data acquisition and the business logic are separated, so that a developer can concentrate on one thing, and the asynchronous data acquisition and the business logic do not need to be considered at the same time, and the asynchronous data acquisition system is widely applied.
In a specific implementation manner, in order to implement the access control method provided by the embodiment of the present invention in JavaScript, a CancelManager object is provided in JavaScript, where an instruction of a CancelManager module may set an asynchronous request identifier for each asynchronous request when triggering the asynchronous request.
Thus, when browser access is realized by using the Promise asynchronous request provided by JavaScript, in order to realize cancellation of the Promise asynchronous request for requesting the same data (including all requests of data and partial requests of data), an instruction of a cancelmanager module can be called when the asynchronous request is triggered, so that asynchronous request identification is set for each Promise asynchronous request.
After obtaining the asynchronous request identifications for identifying the respective asynchronous requests for acquiring the data, based on the asynchronous request identifications, the cancel command acquisition unit 120 may further acquire an asynchronous request cancel command so as to realize cancellation of the asynchronous request provided with the asynchronous request identifications.
In one embodiment, the corresponding asynchronous request may be obtained based on the asynchronous request identification, and further an asynchronous request cancellation command corresponding to the asynchronous request may be obtained.
Of course, the binding relationship between the asynchronous request and the asynchronous request cancellation command is also preset, and when access control is performed, the corresponding asynchronous request cancellation command can be found according to the asynchronous request.
In another embodiment, the cancel command obtaining unit 120 may directly obtain the asynchronous request cancel command corresponding to each asynchronous request based on the asynchronous request identifier, where, of course, association information between the asynchronous request cancel command and the asynchronous request identifier needs to be preset, for example: the method can set the asynchronous request identifier for the asynchronous request, and set the cancel command identifier for the asynchronous request cancel command, wherein the cancel command identifier has a corresponding relation with the asynchronous request identifier, so that the acquisition logic of the asynchronous request cancel command is simplified, and the operation amount is reduced.
After obtaining the asynchronous request cancel command, the asynchronous request cancel unit 130 runs each asynchronous request cancel command, thereby implementing cancellation of each asynchronous request.
In a specific embodiment, after an asynchronous request cancellation command is obtained, the asynchronous request cancellation command is firstly dispatched to a request management center, then the request management center finds out a corresponding asynchronous request according to the asynchronous request cancellation command, and then executes the cancellation operation of each asynchronous request by running the asynchronous request cancellation command matched with the asynchronous request.
In this way, the access control device provided by the embodiment of the invention can determine the asynchronous request identification according to the data acquisition change signal, and because each asynchronous request for acquiring the data is identified by the asynchronous request identification, according to the asynchronous request identification, an asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be run in batches, each asynchronous request is cancelled, the asynchronous requests can be cancelled in batches, and further when the data acquisition change signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
When a user accesses a browser, the user often switches from a first page click to a second page click, and a page jump is generated.
After the page jump, the data request of the first page before the page jump is still valid in general, and data is continuously requested from the server in the background, if the user accesses a website (such as a data portal and a big data website) which needs to display a large amount of data for the browser, the opening of the first page of the browser triggers an asynchronous request for acquiring a large amount of data, after a part of data is acquired and displayed to the user through a web page, the user may acquire the data of interest based on the displayed part of data, and click on a related link to perform the page jump, but in this case, if the asynchronous request for requesting to acquire the data of the first page is still executed, more memory resources are occupied.
In order to implement cancellation of an asynchronous request in the case of a page jump, in another specific implementation manner, the change signal obtaining unit 100 of the access control device provided by the embodiment of the present invention is adapted to obtain a data obtaining change signal, and may include: a page skip signal is obtained to skip from a first page to a second page.
When the user switches from the first page to the second page, a page jump signal of the first page to the second page is generated, and the browser can acquire the relevant page jump signal, which is one of the data acquisition change signals.
It will be appreciated that the first page and the second page may be set as required, for example, the first page is a specific browser page with a large amount of data, the second page is any one of all pages obtained based on the first page, and is not limited to a specific page, for example, the first page may be jumped to 10 pages, and the page jump information may be obtained as long as the first page clicks on a link and jumps to any one of 10 pages.
Of course, when the amount of data displayed on the first page reaches a certain value, the change signal acquiring unit 100 of the access control device provided in the embodiment of the present invention needs to be triggered to acquire the page skip information, and the page skip information may also be set according to the need, which is not limited herein.
The identifier obtaining unit 110 is adapted to determine an asynchronous request identifier according to the data obtaining change signal, where the asynchronous request identifier is used to identify each asynchronous request in the request domain, and the asynchronous request identifier includes:
And determining a first page domain request identifier according to the page jump signal, wherein the first page domain request identifier is used for identifying each asynchronous request for acquiring data in a preset area of the first page.
After the page jump signal is obtained, the first page area request identification can be determined according to the page jump signal.
It will be appreciated that the first page field request identifies the various asynchronous requests identified as being generated when accessing the first page for retrieving data presented within a certain area of the first page. The first page field request identifier is also configured for each asynchronous request when an asynchronous request to retrieve data within a predetermined area of the first page is triggered.
In a specific embodiment, the predetermined area of the first page is the whole area of the first page, in which case, when the page jump signal is acquired, according to the page jump signal, the acquired first page field request identifier identifies an asynchronous request for requesting all data of the first page; in another specific embodiment, the predetermined area of the first page is a partial area of the first page, in which case, when the page jump signal is acquired, according to the page jump signal, the acquired first page field request identifier identifies an asynchronous request for requesting the partial data of the first page, and specifically, what part of the asynchronous request of the data may be set in advance as required.
When the preset area of the first page is set, the area can be divided according to the position of the page, and then the preset area is determined; the regions may also be divided according to the form of the data presented by the page (text data, picture data, video data) to determine the predetermined regions.
Such as: the specific area of the first page may be set as the video data of the first page, so that when the page skip signal is received, the first page request identifier is obtained according to the page skip signal, and the first page request identifier is identified as an asynchronous request for requesting the video data of the first page; it is also possible to set the specific area of the first page as the first page area B (assuming the left area), and when the page jump signal is received, the first page area request identifier is acquired according to the page jump signal, and the first page area request identifier is identified as an asynchronous request for requesting the data of the first page area B.
In general, each asynchronous request for acquiring data in a predetermined area of a first page is used for requesting different data, but if each asynchronous request for acquiring data in the predetermined area of the first page has the same first page area request identifier, each asynchronous request to be canceled can be obtained in time when a page jump signal is obtained.
Correspondingly, the cancellation command obtaining unit 120, adapted to obtain, according to the asynchronous request identifier, an asynchronous request cancellation command corresponding to each of the asynchronous requests, includes: and acquiring an asynchronous request cancellation command corresponding to each asynchronous request according to the first page domain request identifier.
After the first page domain request identifier is obtained, an asynchronous request cancellation command corresponding to each asynchronous request can be directly obtained according to the first page domain request identifier.
In another embodiment, after the first page area request identifier is obtained, each asynchronous request may be obtained according to the first page area request identifier, and further based on a binding relationship between the asynchronous request and the asynchronous request cancellation command, an asynchronous request cancellation command corresponding to each asynchronous request may be obtained.
Finally, the asynchronous request cancellation unit 130 runs each of the asynchronous request cancellation commands, canceling each of the asynchronous requests.
According to the access control device provided by the embodiment of the invention, the first page area request identification can be determined according to the page jump signal, and because the first page area request identification identifies each asynchronous request for acquiring data in a preset area of a first page, according to the first page area request identification, an asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be run in batches, the asynchronous requests can be cancelled in batches, and further when the page jump signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
When a user accesses a browser, in order to increase the data acquisition speed and improve the user experience, a plurality of asynchronous requests are generated to acquire the same data from different servers, and when one of the asynchronous requests acquires the data and is displayed in the browser, other asynchronous requests may be in the process of acquiring the requests, so that the waste of equipment memory resources is caused.
In order to implement cancellation of an asynchronous request in the foregoing situation, in another specific implementation manner, the change signal obtaining unit 100 of the access control device provided in the embodiment of the present invention is adapted to obtain a data obtaining change signal, and may include: a target data reception signal is acquired.
To obtain the target data a, the browser generates a plurality of asynchronous requests, which may include: the asynchronous requests A1, A2 and A3 respectively request target data from different servers, the speed of target data feedback of each server is different under the influence of the working conditions of different servers, when one of the asynchronous requests such as the target data requested by the asynchronous request A1 is received by a terminal, a target data receiving signal is obtained, and certainly under the influence of the target data feedback speed, the target data received first may be obtained by the request of the asynchronous request A2 or the target data received first by the request of the asynchronous request A3, and the method is not limited herein, so long as any one of the target data requested by the asynchronous requests is received by the terminal, the target data receiving signal is triggered to be generated, and then the target data receiving signal is received.
The identifier obtaining unit 110 is adapted to determine an asynchronous request identifier according to the data obtaining change signal, where the asynchronous request identifier is used to identify each asynchronous request for obtaining the data, and the asynchronous request identifier includes:
and acquiring a target data request identifier according to the target data receiving signal, wherein the target data request identifier is used for identifying each asynchronous request for acquiring the same target data.
After the target data receiving signal is obtained, the target data request identifier can be obtained according to the target data receiving signal.
It will be appreciated that each asynchronous request identified by the target data request identifier for obtaining the target data is, of course, also preset, so that the corresponding asynchronous request can be successfully found when access control is performed. The cancellation command obtaining unit 120, adapted to obtain, according to the asynchronous request identifier, an asynchronous request cancellation command corresponding to each of the asynchronous requests, includes: and acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the target data request identifiers.
After the target data request identifier is obtained, the asynchronous request cancellation command corresponding to each asynchronous request can be directly obtained according to the target data request identifier, and the association between the target data request identifier and the asynchronous request cancellation command is required to be established in advance.
After the target data request identifier is obtained, each asynchronous request can be obtained according to the target data request identifier, and the asynchronous request cancellation command corresponding to each asynchronous request can be further obtained based on the binding relationship between the asynchronous request and the asynchronous request cancellation command.
Finally, the asynchronous request cancellation unit 130 runs each of the asynchronous request cancellation commands, canceling each of the asynchronous requests.
According to the access control method provided by the embodiment of the invention, the target data request identification can be determined according to the target data receiving signal, and because each asynchronous request for acquiring the target data is identified by the target data request identification, according to the target data request identification, each asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be operated in batches, each asynchronous request can be cancelled in batches, and further when the target data receiving signal is obtained, the asynchronous requests are cancelled in batches in time, the rationality of access control is improved, the occupancy rate of a terminal memory is reduced, the speed of web page access is improved, and the use experience of a user is improved.
The embodiment of the invention also provides a terminal device, which can realize the access control method provided by the embodiment of the invention through the access control device in the form of loading program. An optional hardware structure of the terminal device provided in the embodiment of the present invention may be shown in fig. 6, and includes: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04;
In the embodiment of the invention, the number of the processor 01, the communication interface 02, the memory 03 and the communication bus 04 is at least one, and the processor 01, the communication interface 02 and the memory 03 complete communication with each other through the communication bus 04;
alternatively, the communication interface 02 may be an interface of a communication module for performing network communication, such as an interface of a GSM module;
the processor 01 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention.
The memory 03 may comprise a high-speed RAM memory or may further comprise a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory.
The memory 03 stores one or more computer instructions that are executed by the processor 01 to implement the access control method provided by the embodiment of the present invention.
It should be noted that, the implementation terminal device may further include other devices (not shown) that may not be necessary for the disclosure of the embodiment of the present invention; embodiments of the present invention will not be described in detail herein, as such other devices may not be necessary to an understanding of the present disclosure.
The embodiment of the application also provides a storage medium which stores one or more computer instructions for realizing the access control method provided by the embodiment of the application.
The computer executable instructions stored in the storage medium provided by the embodiment of the application can determine the target data request identification according to the target data receiving signal, and because the target data request identification identifies each asynchronous request for acquiring the target data, according to the target data request identification, an asynchronous request cancellation command corresponding to each asynchronous request can be found, so that each asynchronous request cancellation command can be run in batches, the asynchronous requests can be cancelled in batches, and further, when the target data receiving signal is obtained, the asynchronous requests are cancelled in batches in time, thereby improving the rationality of access control, reducing the occupancy rate of a terminal memory, improving the speed of web page access and improving the use experience of users.
The embodiments of the application described above are combinations of elements and features of the application. Unless otherwise mentioned, the elements or features may be considered optional. Each element or feature may be practiced without combining with other elements or features. In addition, embodiments of the application may be constructed by combining some of the elements and/or features. The order of operations described in embodiments of the application may be rearranged. Some configurations of any embodiment may be included in another embodiment and may be replaced with corresponding configurations of another embodiment. It will be obvious to those skilled in the art that claims which are not explicitly cited in each other in the appended claims may be combined into embodiments of the present application or may be included as new claims in a modification after submitting the present application.
Embodiments of the invention may be implemented by various means, such as hardware, firmware, software or combinations thereof. In a hardware configuration, the method according to the exemplary embodiments of the present invention may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.
In a firmware or software configuration, embodiments of the present invention may be implemented in the form of modules, procedures, functions, and so on. The software codes may be stored in memory units and executed by processors. The memory unit may be located inside or outside the processor and may send and receive data to and from the processor via various known means.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Although the embodiments of the present invention are disclosed above, the present invention is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the invention, and the scope of the invention should be assessed accordingly to that of the appended claims.
In summary, in the 1 st aspect, an embodiment of the present invention provides an access control method, including:
acquiring a data acquisition change signal;
determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request in a request domain;
acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the asynchronous request identifiers;
and operating each asynchronous request cancellation command to cancel each asynchronous request.
With reference to aspect 1, in an implementation manner of aspect 1 of the present invention,
in aspect 1, an embodiment of the present invention provides an access control method, including:
acquiring a data acquisition change signal;
determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data;
Acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the asynchronous request identifiers;
and operating each asynchronous request cancellation command to cancel each asynchronous request.
With reference to aspect 1, in an implementation manner of aspect 1 of the present invention,
the acquiring the data acquisition variation signal includes:
acquiring a page jump signal from a first page to a second page;
the step of determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data, and the step of determining the asynchronous request identifier comprises the following steps of:
determining a first page domain request identifier according to the page skip signal, wherein the first page domain request identifier is used for identifying each asynchronous request for acquiring data in a preset area of a first page;
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
and acquiring an asynchronous request cancellation command corresponding to each asynchronous request according to the first page domain request identifier.
With reference to implementation manner of the 1 st aspect, in a 2 nd implementation manner of the 1 st aspect, the predetermined area of the first page includes an entire area of the first page or a partial area of the first page. .
With reference to aspect 1, in a 3 rd implementation manner of aspect 1,
the acquiring the data acquisition variation signal includes:
acquiring a target data receiving signal;
the step of determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data, and the step of determining the asynchronous request identifier comprises the following steps of:
acquiring a target data request identifier according to the target data receiving signal, wherein the target data request identifier is used for identifying each asynchronous request for acquiring the same target data;
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
and acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the target data request identifiers.
With reference to aspect 1 or any implementation manner of 1 st to 3 rd implementation manners of aspect 1, in a 4 th implementation manner of aspect 1,
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
acquiring the asynchronous requests according to the asynchronous request identifiers;
Acquiring each asynchronous request cancellation command corresponding to the asynchronous request according to the asynchronous request
With reference to aspect 1 or any implementation manner of 1 st to 3 rd implementation manners of aspect 1, in a 5 th implementation manner of aspect 1, an embodiment of the present invention sets the asynchronous request identifier for each asynchronous request when the asynchronous request is triggered.
With reference to aspect 1 or any implementation manner of 1 st to 3 rd implementation manners of aspect 1, in a 6 th implementation manner of aspect 1, an embodiment of the present invention is at least 2 asynchronous requests for acquiring the data.
In aspect 2, an embodiment of the present invention further provides an access control apparatus, including:
a change signal acquisition unit adapted to acquire a data acquisition change signal;
an identifier acquisition unit adapted to determine an asynchronous request identifier according to the data acquisition variation signal, the asynchronous request identifier being used for identifying each asynchronous request for acquiring the data;
a cancel command acquisition unit adapted to acquire an asynchronous request cancel command corresponding to each of the asynchronous requests according to the asynchronous request identifier;
and the asynchronous request cancellation unit is suitable for running each asynchronous request cancellation command and canceling each asynchronous request.
With reference to aspect 2, in implementation manner of aspect 2 of the present invention,
the change signal acquisition unit is adapted to acquire a data acquisition change signal including:
acquiring a page jump signal from a first page to a second page;
the identifier obtaining unit is adapted to determine an asynchronous request identifier according to the data obtaining change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for obtaining the data and comprises:
determining a first page domain request identifier according to the page skip signal, wherein the first page domain request identifier is used for identifying each asynchronous request for acquiring data in a preset area of a first page;
the cancel command obtaining unit is adapted to obtain, according to the asynchronous request identifier, an asynchronous request cancel command corresponding to each of the asynchronous requests, and includes:
and acquiring an asynchronous request cancellation command corresponding to each asynchronous request according to the first page domain request identifier.
With reference to implementation manner of the 1 st aspect in the 2 nd aspect, in an implementation manner of the 2 nd aspect, the predetermined area of the first page includes an entire area of the first page or a partial area of the first page.
With reference to aspect 2, in a 3 rd implementation manner of aspect 2,
the change signal acquisition unit is adapted to acquire a data acquisition change signal including:
acquiring a target data receiving signal;
the identifier obtaining unit is adapted to determine an asynchronous request identifier according to the data obtaining change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for obtaining the data and comprises:
acquiring a target data request identifier according to the target data receiving signal, wherein the target data request identifier is used for identifying each asynchronous request for acquiring the same target data;
the cancel command obtaining unit is adapted to obtain, according to the asynchronous request identifier, an asynchronous request cancel command corresponding to each of the asynchronous requests, and includes:
and acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the target data request identifiers.
With reference to aspect 2 or any implementation manner of the 1 st to 3 rd implementation manners of aspect 2, in a 4 th implementation manner of aspect 2,
the cancel command obtaining unit is adapted to obtain, according to the asynchronous request identifier, an asynchronous request cancel command corresponding to each of the asynchronous requests, and includes:
Acquiring the asynchronous requests according to the asynchronous request identifiers;
and acquiring each asynchronous request cancellation command corresponding to the asynchronous request according to the asynchronous request. .
With reference to aspect 2 or any implementation manner of the 1 st to 3 rd implementation manners of aspect 2, in a 5 th implementation manner of aspect 2, in the embodiment of the present invention, when the asynchronous request is triggered, the asynchronous request identifier is set for each of the asynchronous requests.
With reference to aspect 2 or any implementation manner of the 1 st to 3 rd implementation manners of aspect 2, in a 6 th implementation manner of aspect 2, the number of each asynchronous request for acquiring the data is at least 2.
In aspect 3, an embodiment of the present invention further provides a terminal device, including at least one memory and at least one processor, where the memory stores one or more computer instructions, and where the one or more computer instructions are executed by the processor to implement an access control method as described above.
In a 4 th aspect, embodiments of the present invention further provide a storage medium storing one or more computer instructions for implementing an access control method as described above.

Claims (10)

1. An access control method, comprising:
acquiring a data acquisition change signal;
determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data;
acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the asynchronous request identifiers;
and operating each asynchronous request cancellation command to cancel each asynchronous request.
2. The access control method according to claim 1, wherein the acquiring the data acquisition change signal includes:
acquiring a page jump signal from a first page to a second page;
the step of determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data, and the step of determining the asynchronous request identifier comprises the following steps of:
determining a first page domain request identifier according to the page skip signal, wherein the first page domain request identifier is used for identifying each asynchronous request for acquiring data in a preset area of a first page;
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
And acquiring an asynchronous request cancellation command corresponding to each asynchronous request according to the first page domain request identifier.
3. The access control method according to claim 2, wherein the predetermined area of the first page includes an entire area of the first page or a partial area of the first page.
4. The access control method according to claim 1, wherein,
the acquiring the data acquisition variation signal includes:
acquiring a target data receiving signal;
the step of determining an asynchronous request identifier according to the data acquisition change signal, wherein the asynchronous request identifier is used for identifying each asynchronous request for acquiring the data, and the step of determining the asynchronous request identifier comprises the following steps of:
acquiring a target data request identifier according to the target data receiving signal, wherein the target data request identifier is used for identifying each asynchronous request for acquiring the same target data;
the step of acquiring the asynchronous request cancellation command corresponding to each asynchronous request according to the asynchronous request identifier comprises the following steps:
and acquiring asynchronous request cancellation commands corresponding to the asynchronous requests according to the target data request identifiers.
5. The access control method according to any one of claims 1 to 4, wherein the step of acquiring an asynchronous request cancel command corresponding to each of the asynchronous requests based on the asynchronous request identification includes:
Acquiring the asynchronous requests according to the asynchronous request identifiers;
and acquiring each asynchronous request cancellation command corresponding to the asynchronous request according to the asynchronous request.
6. The access control method according to any one of claims 1-4, wherein the asynchronous request identification is set for each of the asynchronous requests when the asynchronous requests are triggered.
7. The access control method according to any one of claims 1-4, wherein the number of individual asynchronous requests for acquiring the data is at least 2.
8. An access control apparatus, comprising:
a change signal acquisition unit adapted to acquire a data acquisition change signal;
an identifier acquisition unit adapted to determine an asynchronous request identifier according to the data acquisition variation signal, the asynchronous request identifier being used for identifying each asynchronous request for acquiring the data;
a cancel command acquisition unit adapted to acquire an asynchronous request cancel command corresponding to each of the asynchronous requests according to the asynchronous request identifier;
and the asynchronous request cancellation unit is suitable for running each asynchronous request cancellation command and canceling each asynchronous request.
9. A terminal device comprising at least one memory and at least one processor, the memory storing one or more computer instructions, wherein the one or more computer instructions are executable by the processor to implement the access control method of any of claims 1-7.
10. A storage medium storing one or more computer instructions for implementing the access control method of any one of claims 1-7.
CN201911157959.5A 2019-11-22 2019-11-22 Access control method, device, terminal equipment and storage medium Active CN111090515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911157959.5A CN111090515B (en) 2019-11-22 2019-11-22 Access control method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911157959.5A CN111090515B (en) 2019-11-22 2019-11-22 Access control method, device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111090515A CN111090515A (en) 2020-05-01
CN111090515B true CN111090515B (en) 2023-08-18

Family

ID=70393621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911157959.5A Active CN111090515B (en) 2019-11-22 2019-11-22 Access control method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111090515B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842865A (en) * 2022-11-23 2023-03-24 紫光云技术有限公司 Method for mobile terminal to dynamically control network request

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145945A (en) * 2007-08-29 2008-03-19 中兴通讯股份有限公司 A message bus system and control method in telecommunication network management
US9239715B1 (en) * 2013-09-25 2016-01-19 Amazon Technologies, Inc. Cancel and rollback update stack requests
CN105607945A (en) * 2015-12-22 2016-05-25 中国科学院信息工程研究所 Asynchronous monitoring interception system and method of host behavior on the basis of virtualization
CN107015929A (en) * 2015-10-30 2017-08-04 三星电子株式会社 The method of transmitting request and the method that order is issued in main frame in storage facilities

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7605932B2 (en) * 2006-02-08 2009-10-20 Infoprint Solutions Company, Llc System and method of implementing a job cancel broadcast notification and parallel processing of the request

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101145945A (en) * 2007-08-29 2008-03-19 中兴通讯股份有限公司 A message bus system and control method in telecommunication network management
US9239715B1 (en) * 2013-09-25 2016-01-19 Amazon Technologies, Inc. Cancel and rollback update stack requests
CN107015929A (en) * 2015-10-30 2017-08-04 三星电子株式会社 The method of transmitting request and the method that order is issued in main frame in storage facilities
CN105607945A (en) * 2015-12-22 2016-05-25 中国科学院信息工程研究所 Asynchronous monitoring interception system and method of host behavior on the basis of virtualization

Also Published As

Publication number Publication date
CN111090515A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN110519401B (en) Method, device, equipment and storage medium for improving network access success rate
EP2732380B1 (en) Mobile web browser for pre-loading web pages
US9485240B2 (en) Multi-account login method and apparatus
JP2019520624A (en) Page component dynamic layout
US20190334872A1 (en) Advertisement interception method, terminal device and storage medium
US8935798B1 (en) Automatically enabling private browsing of a web page, and applications thereof
US20150154313A1 (en) A method, device, browser and program for accessing web page
US20170357735A1 (en) Information presentation method, device, and system
US20170372180A1 (en) Smart card read/write method and apparatus
WO2020024397A1 (en) Page access processing method, apparatus, computer device and storage medium
CN111372115B (en) Application program access method and device and communication system
US20150222512A1 (en) Event pages for web applications and extensions
CN107402938B (en) Page display method and device and client equipment
CN111212183B (en) Method, device and computer readable medium for running hosted application
CN111090515B (en) Access control method, device, terminal equipment and storage medium
CN110750744A (en) Page presentation method and device
CN110677506A (en) Network access method, device, computer equipment and storage medium
US20140157104A1 (en) Dynamic sharing and updating of a web page
US9164817B2 (en) Mobile communication terminal to provide widget expansion function using message communication, and operation method of the mobile communication terminal
US11570280B2 (en) Systems and methods for rendering interactive web pages
EP2998885A1 (en) Method and device for information search
CN115599669A (en) Debugging method and device of microservice, electronic equipment and readable storage medium
CN114637969A (en) Target object authentication method and device
CN114139079A (en) API request processing method, device, equipment and storage medium
CN110858238B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant