CN111782996A - Asynchronous request processing method and device - Google Patents

Asynchronous request processing method and device Download PDF

Info

Publication number
CN111782996A
CN111782996A CN202010477008.2A CN202010477008A CN111782996A CN 111782996 A CN111782996 A CN 111782996A CN 202010477008 A CN202010477008 A CN 202010477008A CN 111782996 A CN111782996 A CN 111782996A
Authority
CN
China
Prior art keywords
asynchronous request
request information
memory queue
asynchronous
browser
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010477008.2A
Other languages
Chinese (zh)
Inventor
魏超
吴鸿伟
叶立震
毕永辉
翟永强
鄢小征
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Public Security Bureau Network Police Detachment
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information 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 Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN202010477008.2A priority Critical patent/CN111782996A/en
Publication of CN111782996A publication Critical patent/CN111782996A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses an asynchronous request processing method and device. One embodiment of the method comprises: receiving at least one asynchronous request message generated by a current page; storing at least one asynchronous request message into a preset memory queue pool; the following request extraction steps are performed: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page; and if the asynchronous request information does not meet the requirement, continuing to execute the request extraction step based on the non-extracted asynchronous request information in the memory queue pool. The embodiment realizes that when large-scale asynchronous request information exists, the phenomenon that the browser is falsely dead or rushed due to the simultaneous occurrence of a large amount of asynchronous request information in a short time is avoided.

Description

Asynchronous request processing method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to an asynchronous request processing method and device.
Background
With the maturity and development of the B/S architecture, more and more enterprise applications, government websites, industry sites, personal websites, etc. are loaded on various browsers for interaction and presentation. In order to further improve the presentation effect based on browser interaction, the asynchronous data loading technology (ajax request) of the browser is popularized and used on a large scale. The technology well solves the problem of delaying the optimized presentation of the requested/loaded data as required after the page is acquired. With the increasing scale of single-page asynchronous data category display, the number of asynchronous requests on one page varies from several to tens, hundreds or even thousands.
And the browser performs parallel processing on the initiated asynchronous request according to the configuration of the concurrent request number of the browser. The browser blocks queuing for asynchronous requests that exceed the maximum number of parallel lines while processing asynchronous requests in parallel. If some asynchronous requests are very time consuming, they may result in the page failing to respond to other normal requests, or even in a browser crash.
Conventional solutions do not effectively solve this problem. Patience waits for the browser to respond, possibly to the extent that the browser itself slows down. The common coping mode is to modify the processing logic of the page and reduce the asynchronous request amount. But this actually alters the original business logic.
Disclosure of Invention
An object of the embodiments of the present application is to provide an improved asynchronous request processing method and apparatus, so as to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides an asynchronous request processing method, where the method includes: receiving at least one asynchronous request message generated by a current page; storing at least one asynchronous request message into a preset memory queue pool; the following request extraction steps are performed: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page; and if the asynchronous request information does not meet the requirement, continuing to execute the request extraction step based on the non-extracted asynchronous request information in the memory queue pool.
In some embodiments, extracting asynchronous request information from a memory queue pool comprises: and extracting asynchronous request information from the memory queue pool based on a preset number of parallel request processing threads.
In some embodiments, the preset number is less than a single-server maximum number of parallel connections for the browser.
In some embodiments, after storing the at least one asynchronous request message in the predetermined memory queue pool, the method further comprises: setting priority weights corresponding to asynchronous request information in a memory queue pool; and ordering the asynchronous request information in the memory queue pool based on the priority weight.
In some embodiments, setting a priority weight corresponding to each asynchronous request message in the memory queue pool includes: and setting priority weights for the asynchronous request information in the memory queue pool according to a preset sorting period.
In some embodiments, the request termination condition comprises at least one of: the number of the asynchronous request information in the memory queue pool is zero; the browser jumps from the current page to the target page.
In some embodiments, storing at least one asynchronous request message in a predetermined memory queue pool includes: storing at least one piece of asynchronous request information into a preset memory queue pool, and setting an event mark corresponding to a current page for each piece of asynchronous request information, wherein the event mark corresponding to the current page is generated when the current page is jumped to; the method further comprises the following steps: responding to the browser to jump from the current page to the target page, and generating an event mark of the target page; matching the event mark of the asynchronous request information in the current memory queue pool with the event mark of a target page, and matching the event mark of the asynchronous request information currently executed by the browser with the event mark of the target page; and destroying the unmatched asynchronous request information.
In a second aspect, an embodiment of the present application provides an asynchronous request processing apparatus, including: a receiving module for receiving at least one asynchronous request message generated by a current page; the storage module is used for storing at least one piece of asynchronous request information into a preset memory queue pool; an extraction module for performing the following request extraction steps: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page; and the execution module is used for continuing executing the request extraction step based on the non-extracted asynchronous request information in the memory queue pool if the asynchronous request information does not conform to the extracted asynchronous request information.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by one or more processors, cause the one or more processors to carry out a method as described in any one of the implementations of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the asynchronous request processing method and device provided by the embodiment of the application, at least one piece of asynchronous request information generated by the current page is stored in the preset memory queue pool, and then the browser sequentially extracts the asynchronous request information from the memory queue pool for processing, so that the phenomenon that the browser is falsely dead or rushed due to the fact that a large amount of asynchronous request information simultaneously appears in a short time when large-scale asynchronous request information exists is avoided.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram for one embodiment of an asynchronous request processing method according to the present application;
FIG. 3 is a flow diagram of yet another embodiment of an asynchronous request processing method according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of an asynchronous request processing method according to the present application;
FIG. 5 is a schematic block diagram illustrating one embodiment of an asynchronous request processing device according to the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary system architecture 100 to which the asynchronous request processing method of the embodiments of the present application may be applied.
As shown in fig. 1, system architecture 100 may include terminal device 101, network 102, and server 103. Network 102 is the medium used to provide communication links between terminal devices 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal device 101 to interact with server 103 over network 102 to receive or send messages and the like. The terminal device 101 may have various communication client applications installed thereon, such as a web browser application, a search-type application, a shopping-type application, an instant messaging tool, and the like.
The terminal device 101 may be various electronic devices including, but not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc.
The server 103 may be a server that provides various services, such as a background web server that provides support for web pages displayed on the terminal device 101. The background web server may respond to the request sent by the terminal device 101 and feed back a response result (e.g., image, text, video, etc.) to the terminal device 101.
It should be noted that the asynchronous request processing method provided in the embodiment of the present application is generally executed by the terminal device 101, and accordingly, the asynchronous request processing apparatus is generally disposed in the terminal device 101.
It should be understood that the number of terminal devices, networks, servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of an asynchronous request handling method according to the present application is shown. The method comprises the following steps:
at step 201, at least one asynchronous request message generated by a current page is received.
In this embodiment, an execution subject (e.g., a terminal device shown in fig. 1) of the asynchronous request processing method may receive at least one piece of asynchronous request information generated from the current page. The current page may be triggered by a user through an operation manner such as clicking or touching, or generated by automatic triggering of the execution main body, and the page may be displayed on a browser. The current page may include a variety of content therein, such as images, text, video, audio, animation, and the like. The content needs to be sent to the server shown in fig. 1 by the browser, and then the server feeds back the corresponding content to the execution main body for display according to each asynchronous request message.
Generally, the Asynchronous request information is generated by Ajax technology, which is "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), and is a web page development technology for creating interactive, fast and dynamic web page applications. By exchanging a small amount of data with the server in the background, Ajax can enable the webpage to be updated asynchronously. This means that certain parts of the web page can be updated without reloading the entire web page.
Step 202, storing at least one asynchronous request message into a preset memory queue pool.
In this embodiment, the execution agent may store at least one asynchronous request message into a predetermined memory queue pool. The memory queue pool is used for storing a plurality of asynchronous request messages, and the asynchronous request messages are arranged in a certain sequence. The browser can extract the asynchronous request information from the memory queue pool in sequence for processing.
After the execution of step 202, the execution agent performs the following request extraction steps (including steps 203 to 205).
Step 203, sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through the browser.
In this embodiment, the execution body may sequentially extract the asynchronous request information from the memory queue pool, and execute the extracted asynchronous request information through the browser. The browser is arranged on the execution body, and the browser can send asynchronous request information to the server shown in fig. 1, and then receive various contents sent by the server for the asynchronous request information. The browser can sequentially extract the asynchronous request information according to the arrangement sequence of the asynchronous request information in the memory queue pool. The browser can simultaneously extract at least one asynchronous request message for processing.
In some optional implementation manners of this embodiment, the execution main body may extract the asynchronous request information from the memory queue pool based on a preset number of parallel request processing threads. As an example, assuming that the preset number is N, the N parallel request processing threads may extract the asynchronous request information from the memory queue pool in parallel in sequence. And after a certain thread finishes executing an asynchronous request message, continuously extracting the asynchronous request message from the memory queue pool according to the sequence. The realization mode can enable the browser to process a plurality of asynchronous request messages in parallel by setting a preset number of parallel request processing threads, thereby accelerating the speed of processing the asynchronous request messages.
Optionally, the preset number may be smaller than the maximum parallel connection number of the single server of the browser, so that the maximum parallel connection number of the single server of the browser is always free, and is sufficient for executing operations such as picture loading and page jumping in real time.
Step 204, determining whether the asynchronous request information extracted by the browser meets the request ending condition.
In this embodiment, the execution body may determine whether the asynchronous request information extracted by the browser meets a request ending condition. If yes, go to step 205, otherwise go to step 206.
In some optional implementations of this embodiment, the request ending condition may include, but is not limited to, at least one of the following:
and under the condition one, the quantity of the asynchronous request information in the memory queue pool is zero.
When the number of the asynchronous request information in the memory queue pool is zero, the asynchronous request information indicates that all the requests corresponding to the current page are responded by the server, and the requests of the current page are finished.
And secondly, jumping to a target page from the current page by the browser.
The target page may be a page to be skipped to, for example, the user may skip the current page to the target page by manually clicking, touching, or the execution subject may automatically skip the current page to the target page. When the target page is jumped to, a new asynchronous request is generated aiming at the target page, and the asynchronous request operation of the original page is finished.
The request ending condition provided by the implementation mode can accurately represent whether the asynchronous request is ended or not, is beneficial to ending the asynchronous request in time, and improves the efficiency of large-scale asynchronous requests.
Step 205, the request for the current page is ended.
In this embodiment, after the browser executes the extracted asynchronous request information, if the request termination condition is met, the execution body may terminate the request for the current page.
Step 206, based on the non-extracted asynchronous request information in the memory queue pool, the request extraction step is continuously executed.
In this embodiment, if the request end condition is not met after the browser executes the extracted asynchronous request information, the execution body may continue to execute the request extraction step (including steps 203 to 205) based on the non-extracted asynchronous request information in the memory queue pool.
In some optional implementations of this embodiment, as shown in fig. 3, after the step 202, the executing main body may execute the following steps:
step 301, setting priority weights corresponding to the asynchronous request messages in the memory queue pool.
Wherein the priority weight is used for representing the priority degree of the asynchronous request information processed by the browser. As an example, the priority weight may be a number, with smaller numbers indicating higher priority. The priority weight may be manually set in advance, or may be automatically set by the execution agent according to the type of the asynchronous request.
Step 302, based on the priority weight, the asynchronous request information in the memory queue pool is sorted.
Generally, asynchronous request information with high priority is ranked first (i.e., priority processing), and asynchronous request information with low priority is ranked later.
According to the implementation mode, the asynchronous request information with high priority can be adjusted to the front end of the queue by setting the priority weight, namely the asynchronous request information with high priority is preferentially delivered to the browser to be executed, so that some important asynchronous request information can be preferentially executed, and the pertinence of the execution request is improved.
In some optional implementations of this embodiment, the execution body may set a priority weight to the asynchronous request information in the memory queue pool according to a preset sorting period. That is, each time, the execution main body resets the priority weight of the asynchronous request information in the memory queue pool, and further sequences the asynchronous request information in the memory queue pool according to the reset priority weight, so that the priority of the asynchronous request information is adjusted in real time, and the pertinence of the browser for dynamically executing the asynchronous request is improved.
In the method provided by the above embodiment of the application, at least one piece of asynchronous request information generated by the current page is stored in the preset memory queue pool, and then the browser sequentially extracts the asynchronous request information from the memory queue pool for processing, so that when large-scale asynchronous request information exists, the phenomenon that the browser is falsely dead or rushed due to the simultaneous occurrence of a large amount of asynchronous request information in a short time is avoided.
With further reference to FIG. 4, a flow 400 of yet another embodiment of an asynchronous request processing method in accordance with the present application is illustrated. In this embodiment, when the execution main body stores at least one piece of asynchronous request information into a preset memory queue pool, an event flag (eventstamp) corresponding to a current page is set for each piece of asynchronous request information. And the event mark corresponding to the current page is generated when jumping to the current page. That is, each page on the browser corresponds to a different event marker.
Based on this, the method comprises the following steps:
step 401, in response to the browser jumping from the current page to the target page, generating an event marker of the target page.
In this embodiment, the execution body may generate an event flag of the target page in response to the browser jumping from the current page to the target page. The target page may be a page to be skipped to, for example, the user may skip the current page to the target page by manually clicking, touching, or the execution subject may automatically skip the current page to the target page.
Step 402, matching the event mark of the asynchronous request information in the current memory queue pool with the event mark of the target page, and matching the event mark of the asynchronous request information currently executed by the browser with the event mark of the target page.
In this embodiment, the execution body may match an event flag of the asynchronous request information in the current memory queue pool with an event flag of the target page, and match an event flag of the asynchronous request information currently executed by the browser with an event flag of the target page.
Specifically, for a certain asynchronous request message, it may be determined whether the event flag of the asynchronous request message is the same as the event flag of the target page, and if so, it indicates that the two match, otherwise, they do not match.
Step 403, destroying the unmatched asynchronous request information.
In this embodiment, the execution subject may destroy the unmatched asynchronous request information. And if the unmatched asynchronous request information is overdue compared with the target page after the jump, destroying the overdue asynchronous request information in the queue and the executed asynchronous request information, and stopping the request of the original page.
In the method in the embodiment corresponding to fig. 4, by checking the consistency between the event flag of the skipped page and the event flags of the asynchronous request information in the memory queue pool and the asynchronous request information being executed, the unmatched asynchronous request information is destroyed, so that the resource occupied by the request in the memory queue can be released in the context of a large-scale asynchronous request of the browser, the initiated but not completed request can also be destroyed in time and the browser resource is released, and the resource utilization rate is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an asynchronous request processing apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 5, the asynchronous request processing apparatus 500 of the present embodiment includes: a receiving module 501, configured to receive at least one asynchronous request message generated by a current page; a storage module 502, configured to store at least one asynchronous request message into a preset memory queue pool; an extracting module 503, configured to perform the following request extracting steps: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page; an executing module 504, configured to continue executing the request extracting step based on the non-extracted asynchronous request information in the memory queue pool if the asynchronous request information does not match the asynchronous request information.
In this embodiment, the receiving module 501 may receive at least one asynchronous request message generated by the current page. The current page may be triggered by a user through clicking, touching, or the like, or may be automatically triggered by the apparatus 500 to generate a page, and the page may be displayed on a browser. The current page may include a variety of content therein, such as images, text, video, audio, animation, and the like. The browser sends the at least one asynchronous request message to the server shown in fig. 1, and the server feeds back corresponding content to the device 500 for display according to each asynchronous request message.
Generally, the Asynchronous request information is generated by Ajax technology, which is "Asynchronous JavaScript and XML" (Asynchronous JavaScript and XML), and is a web page development technology for creating interactive, fast and dynamic web page applications. By exchanging a small amount of data with the server in the background, Ajax can enable the webpage to be updated asynchronously. This means that certain parts of the web page can be updated without reloading the entire web page. .
In this embodiment, the storage module 502 may store at least one asynchronous request message into a predetermined memory queue pool. The memory queue pool is used for storing a plurality of asynchronous request messages, and the asynchronous request messages are arranged in a certain sequence. The browser can extract the asynchronous request information from the memory queue pool in sequence for processing.
In this embodiment, the extracting module 503 may sequentially extract the asynchronous request information from the memory queue pool, and execute the extracted asynchronous request information through the browser. The browser is provided on the apparatus 500, and the browser may send asynchronous request information to the server shown in fig. 1, and then receive various contents sent by the server for the asynchronous request information. The browser can sequentially extract the asynchronous request information according to the arrangement sequence of the asynchronous request information in the memory queue pool. The browser can simultaneously extract at least one asynchronous request message for processing.
In this embodiment, the extracting module 503 may further determine whether the asynchronous request information extracted by the browser meets the request ending condition.
In this embodiment, after the browser executes the extracted asynchronous request information, if the request termination condition is met, the extracting module 503 may terminate the request for the current page.
In this embodiment, after the browser executes the extracted asynchronous request information, if the request end condition is not met, the execution module 504 may continue to execute the request extraction step based on the non-extracted asynchronous request information in the memory queue pool.
In some optional implementations of this embodiment, the extracting module 503 may be further configured to: and extracting asynchronous request information from the memory queue pool based on a preset number of parallel request processing threads.
In some optional implementations of this embodiment, the preset number is smaller than the maximum number of parallel connections of a single server of the browser.
In some optional implementations of this embodiment, the apparatus 500 may further include: a setting module (not shown in the figure) configured to set priority weights corresponding to the asynchronous request messages in the memory queue pool; and a sorting module (not shown in the figure) for sorting the asynchronous request information in the memory queue pool based on the priority weight.
In some optional implementations of this embodiment, the setting module may be further configured to: and setting priority weights for the asynchronous request information in the memory queue pool according to a preset sorting period.
In some optional implementations of this embodiment, the request ending condition includes at least one of: the number of the asynchronous request information in the memory queue pool is zero; the browser jumps from the current page to the target page.
In some optional implementations of this embodiment, the storage module 502 may be further configured to: storing at least one piece of asynchronous request information into a preset memory queue pool, and setting an event mark corresponding to a current page for each piece of asynchronous request information, wherein the event mark corresponding to the current page is generated when the current page is jumped to; the apparatus 500 may further include: a generating module (not shown in the figure) for generating an event mark of the target page in response to the browser jumping from the current page to the target page; a matching module (not shown in the figure), configured to match an event flag of the asynchronous request information in the current memory queue pool with an event flag of the target page, and match an event flag of the asynchronous request information currently executed by the browser with an event flag of the target page; and a destroying module (not shown in the figure) for destroying the unmatched asynchronous request information.
The device provided by the above embodiment of the present application stores at least one asynchronous request message generated by a current page into a preset memory queue pool, and then the browser sequentially extracts the asynchronous request messages from the memory queue pool for processing, thereby avoiding a phenomenon that the browser is falsely dead or rushed due to a large amount of asynchronous request messages appearing simultaneously in a short time when a large-scale asynchronous request message exists.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601.
It should be noted that the computer readable storage medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart 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 application. 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 modules described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, a storage module, an extraction module, and an execution module. Where the names of these modules do not in some cases constitute a limitation of the unit itself, for example, the receiving module may also be described as a "module for receiving at least one asynchronous request message generated by the current page".
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving at least one asynchronous request message generated by a current page; storing at least one asynchronous request message into a preset memory queue pool; the following request extraction steps are performed: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page; and if the asynchronous request information does not meet the requirement, continuing to execute the request extraction step based on the non-extracted asynchronous request information in the memory queue pool.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. An asynchronous request processing method, the method comprising:
receiving at least one asynchronous request message generated by a current page;
storing the at least one asynchronous request message into a preset memory queue pool;
the following request extraction steps are performed: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page;
and if the asynchronous request information does not meet the requirement, continuing to execute the request extraction step based on the asynchronous request information which is not extracted in the memory queue pool.
2. The method of claim 1, wherein said extracting asynchronous request information from the memory queue pool comprises:
and extracting asynchronous request information from the memory queue pool based on a preset number of parallel request processing threads.
3. The method of claim 2, wherein the preset number is less than a single-server maximum number of parallel connections for the browser.
4. The method of claim 1, wherein after storing the at least one asynchronous request message into a predetermined memory queue pool, the method further comprises:
setting priority weights corresponding to the asynchronous request information in the memory queue pool respectively;
and sequencing the asynchronous request information in the memory queue pool based on the priority weight.
5. The method according to claim 4, wherein the setting of the priority weight corresponding to each asynchronous request message in the memory queue pool comprises:
and setting priority weights for the asynchronous request information in the memory queue pool according to a preset sorting period.
6. The method of claim 1, wherein the request termination condition comprises at least one of:
the number of the asynchronous request information in the memory queue pool is zero;
and the browser jumps to a target page from the current page.
7. The method of claim 1, wherein storing the at least one asynchronous request message into a predetermined memory queue pool comprises:
storing the at least one piece of asynchronous request information into a preset memory queue pool, and setting an event mark corresponding to the current page for each piece of asynchronous request information, wherein the event mark corresponding to the current page is generated when the current page is jumped to;
the method further comprises the following steps:
responding to the browser to jump from the current page to a target page, and generating an event mark of the target page;
matching the event mark of the asynchronous request information in the current memory queue pool with the event mark of the target page, and matching the event mark of the asynchronous request information currently executed by the browser with the event mark of the target page;
and destroying the unmatched asynchronous request information.
8. An asynchronous request processing apparatus, the apparatus comprising:
a receiving module for receiving at least one asynchronous request message generated by a current page;
the storage module is used for storing the at least one asynchronous request message into a preset memory queue pool;
an extraction module for performing the following request extraction steps: sequentially extracting asynchronous request information from the memory queue pool, and executing the extracted asynchronous request information through a browser; determining whether the asynchronous request information extracted by the browser is in accordance with a request ending condition or not; if yes, ending the request aiming at the current page;
and the execution module is used for continuing executing the request extraction step based on the non-extracted asynchronous request information in the memory queue pool if the asynchronous request information does not conform to the extracted asynchronous request information.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010477008.2A 2020-05-29 2020-05-29 Asynchronous request processing method and device Pending CN111782996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010477008.2A CN111782996A (en) 2020-05-29 2020-05-29 Asynchronous request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010477008.2A CN111782996A (en) 2020-05-29 2020-05-29 Asynchronous request processing method and device

Publications (1)

Publication Number Publication Date
CN111782996A true CN111782996A (en) 2020-10-16

Family

ID=72754406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010477008.2A Pending CN111782996A (en) 2020-05-29 2020-05-29 Asynchronous request processing method and device

Country Status (1)

Country Link
CN (1) CN111782996A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114885025A (en) * 2022-06-14 2022-08-09 中国电信股份有限公司 Asynchronous request processing method, device, equipment and storage medium
CN117453422A (en) * 2023-12-22 2024-01-26 南京研利科技有限公司 Data processing method, device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882161A (en) * 2010-06-23 2010-11-10 中国工商银行股份有限公司 Application level asynchronous task scheduling system and method
CN107463563A (en) * 2016-06-02 2017-12-12 腾讯科技(深圳)有限公司 A kind of information service processing method and device of browser
CN109739725A (en) * 2018-12-29 2019-05-10 云智慧(北京)科技有限公司 Monitoring method, device and system based on browser and storage medium
CN109753358A (en) * 2018-12-26 2019-05-14 新华三技术有限公司合肥分公司 task processing method and device
CN110245011A (en) * 2018-03-08 2019-09-17 北京京东尚科信息技术有限公司 A kind of method for scheduling task and device
WO2020077764A1 (en) * 2018-10-18 2020-04-23 网宿科技股份有限公司 Webpage loading method, intermediate server, and webpage loading system
CN111061804A (en) * 2019-10-30 2020-04-24 平安科技(深圳)有限公司 Asynchronous data processing method, device, equipment and storage medium based on big data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882161A (en) * 2010-06-23 2010-11-10 中国工商银行股份有限公司 Application level asynchronous task scheduling system and method
CN107463563A (en) * 2016-06-02 2017-12-12 腾讯科技(深圳)有限公司 A kind of information service processing method and device of browser
CN110245011A (en) * 2018-03-08 2019-09-17 北京京东尚科信息技术有限公司 A kind of method for scheduling task and device
WO2020077764A1 (en) * 2018-10-18 2020-04-23 网宿科技股份有限公司 Webpage loading method, intermediate server, and webpage loading system
CN109753358A (en) * 2018-12-26 2019-05-14 新华三技术有限公司合肥分公司 task processing method and device
CN109739725A (en) * 2018-12-29 2019-05-10 云智慧(北京)科技有限公司 Monitoring method, device and system based on browser and storage medium
CN111061804A (en) * 2019-10-30 2020-04-24 平安科技(深圳)有限公司 Asynchronous data processing method, device, equipment and storage medium based on big data

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114885025A (en) * 2022-06-14 2022-08-09 中国电信股份有限公司 Asynchronous request processing method, device, equipment and storage medium
CN114885025B (en) * 2022-06-14 2023-10-03 中国电信股份有限公司 Asynchronous request processing method, device, equipment and storage medium
CN117453422A (en) * 2023-12-22 2024-01-26 南京研利科技有限公司 Data processing method, device, electronic equipment and computer readable storage medium
CN117453422B (en) * 2023-12-22 2024-03-01 南京研利科技有限公司 Data processing method, device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11210109B2 (en) Method and system for loading resources
CN110287146B (en) Method, device and computer storage medium for downloading application
CN109582317B (en) Method and apparatus for debugging hosted applications
CN110955640B (en) Cross-system data file processing method, device, server and storage medium
US11095957B2 (en) Method and apparatus for publishing information, and method and apparatus for processing information
CN111782996A (en) Asynchronous request processing method and device
CN111294395A (en) Terminal page transmission method, device, medium and electronic equipment
US20230033164A1 (en) Webpage image monitoring method and apparatus, electronic device, and computer-readable storage medium
CN111061860A (en) Abstract generation method and device
CN113553123B (en) Data processing method, device, electronic equipment and storage medium
CN114265657A (en) Method and device for displaying page of applet
CN113094612A (en) Method and device for loading webpage at client, electronic equipment and medium
US11195248B2 (en) Method and apparatus for processing pixel data of a video frame
CN113760283A (en) Text rendering method and device
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN110874446A (en) Page display method and system, computer system and computer readable medium
CN110825342A (en) Memory scheduling device and system, method and apparatus for processing information
CN113835790B (en) Paging page display method and device based on Android
CN113656041A (en) Data processing method, device, equipment and storage medium
CN111552826B (en) Example picture generation method and device, computer equipment and storage medium
CN111367889B (en) Cross-cluster data migration method and device based on webpage interface
CN110888583B (en) Page display method, system and device and electronic equipment
CN113296771A (en) Page display method, device, equipment and computer readable medium
CN111131354B (en) Method and apparatus for generating information
CN113781154A (en) Information rollback method, system, electronic equipment and 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210625

Address after: 361000 unit 102-402, No.12, guanri Road, phase II, software park, Siming District, Xiamen City, Fujian Province

Applicant after: XIAMEN MEIYA PICO INFORMATION Co.,Ltd.

Applicant after: Guangzhou Public Security Bureau Network Police Detachment

Address before: 361000 unit 102-402, No.12, guanri Road, phase II, software park, Siming District, Xiamen City, Fujian Province

Applicant before: XIAMEN MEIYA PICO INFORMATION Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201016