A data processing method, apparatus, electronic device, and storage medium

By determining the data refresh time of HTTP requests and using the browser's indexDB database to generate response data, the problem of business link blockage caused by server failure was solved, improving user experience and communication resource utilization.

CN118784632BActive Publication Date: 2026-08-04CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2024-06-21
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In web development, when a server-side failure occurs, HTTP requests cannot be responded to, which disrupts the business process and degrades the user experience.

Method used

After receiving an HTTP request, the system determines the data refresh time for the corresponding business. If the refresh time exceeds the preset value and the response fails, the system generates the request content using the response data in the browser's indexDB database. Under rate limiting conditions, some requests are rejected, and the allocation of communication resources is dynamically adjusted.

Benefits of technology

It improves the response efficiency of HTTP requests, enhances the user experience, ensures the normal operation of time-insensitive services, and optimizes the resource utilization of browser communication threads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784632B_ABST
    Figure CN118784632B_ABST
Patent Text Reader

Abstract

This invention relates to the field of network technology, and more particularly to a data processing method, apparatus, electronic device, and storage medium. The method comprises: receiving a Hypertext Transfer Protocol (HTTP) request and determining the Uniform Resource Locator (URL) corresponding to the HTTP request; when it is determined that the data refresh duration of the service corresponding to the HTTP request exceeds a preset value, and information indicating a failure to respond to the HTTP request is received, searching for response data matching the URL in the browser's indexDB database, and generating the content requested by the HTTP request based on the response data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, in web development, Hypertext Transfer Protocol (HTTP) requests are the primary way for clients and servers to interact.

[0003] However, when a server malfunctions, the related services provided by that server cannot respond to HTTP requests sent by the client. Furthermore, if the HTTP request is a business request in a business chain, it may cause the entire business chain to be blocked, thus reducing the user experience. Summary of the Invention

[0004] This invention provides a data processing method, apparatus, electronic device, and storage medium to improve the efficiency of HTTP request responses and enhance user experience.

[0005] In a first aspect, embodiments of the present invention provide a data processing method, the method comprising: Receive a Hypertext Transfer Protocol (HTTP) request and determine the Uniform Resource Locator (URL) corresponding to the HTTP request; When it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and information indicating that the HTTP request response failed is received, the response data matching the URL is searched in the browser database indexDB, and the content requested by the HTTP request is generated based on the response data.

[0006] In one possible implementation, after receiving information indicating that the HTTP request response failed, the method further includes: Based on the sending time and number of times the HTTP request is sent, the rate limiting information of the HTTP request is determined; When the rate limiting information meets the preset conditions, the HTTP request is added to the rate limiting list; each HTTP request in the rate limiting list is received later.

[0007] In one possible implementation, the method further includes: Based on the set rate limiting time interval, a corresponding delayed task is created for each HTTP request in the rate limiting list; If it is determined that the current time is within the rate-limiting time interval corresponding to any HTTP request in the rate-limiting list, then the corresponding delayed task is invoked to refuse to receive any HTTP request.

[0008] In one possible implementation, the current limiting time interval is determined based on the following:

[0009] Where s represents the rate limiting time interval, e is a natural constant, n represents the number of HTTP requests to be received, and t represents the time interval value determined based on the multiple sending times of HTTP requests.

[0010] In one possible implementation, the method further includes: If the rate limiting information corresponding to the HTTP request does not meet the preset conditions, determine whether the HTTP request exists in the rate limiting list; If the HTTP request exists in the rate limiting list, then the delayed task corresponding to the HTTP request will be stopped.

[0011] In one possible implementation, the method further includes: When it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and information indicating that the HTTP request was successfully responded to is received, the historical response data corresponding to the HTTP request in the indexDB is replaced based on the response data corresponding to the HTTP request.

[0012] In a second aspect, embodiments of the present invention provide a data processing apparatus, the apparatus comprising: The determining unit is configured to receive a Hypertext Transfer Protocol (HTTP) request and determine the Uniform Resource Locator (URL) corresponding to the HTTP request. The processing unit is configured to, when it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and when it receives information indicating that the response to the HTTP request has failed, search for response data matching the URL in the browser database indexDB, and generate the content requested by the HTTP request based on the response data.

[0013] In one possible implementation, the processing unit is further configured to: Based on the sending time and number of times the HTTP request is sent, the rate limiting information of the HTTP request is determined; When the rate limiting information meets the preset conditions, the HTTP request is added to the rate limiting list; each HTTP request in the rate limiting list is received later.

[0014] In one possible implementation, the processing unit is further configured to: Based on the set rate limiting time interval, a corresponding delayed task is created for each HTTP request in the rate limiting list; If it is determined that the current time is within the rate-limiting time interval corresponding to any HTTP request in the rate-limiting list, then the corresponding delayed task is invoked to refuse to receive any HTTP request.

[0015] In one possible implementation, the current limiting time interval is determined based on the following:

[0016] Where s represents the rate limiting time interval, e is a natural constant, n represents the number of HTTP requests to be received, and t represents the time interval value determined based on the multiple sending times of HTTP requests.

[0017] In one possible implementation, the processing unit is further configured to: If the rate limiting information corresponding to the HTTP request does not meet the preset conditions, determine whether the HTTP request exists in the rate limiting list; If the HTTP request exists in the rate limiting list, then the delayed task corresponding to the HTTP request will be stopped.

[0018] In one possible implementation, the device further includes an updating unit for: When it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and information indicating that the HTTP request was successfully responded to is received, the historical response data corresponding to the HTTP request in the indexDB is replaced based on the response data corresponding to the HTTP request.

[0019] Thirdly, embodiments of the present invention provide an electronic device, including at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any method provided by the first aspect of the present invention.

[0020] Fourthly, embodiments of the present invention provide a computer storage medium, wherein the computer-readable storage medium stores a computer program that causes a computer to perform any of the methods provided in the first aspect of the present invention.

[0021] Fifthly, embodiments of the present invention provide a computer program product comprising: computer program code, which, when executed on a computer, causes the computer to perform any of the methods provided in the first aspect of the embodiments.

[0022] The beneficial effects of this invention are as follows: In this embodiment of the invention, after receiving an HTTP request and determining the Uniform Resource Locator (URL) corresponding to the HTTP request, the data refresh duration of the service corresponding to the HTTP request can be determined first. When it is determined that the data refresh duration of the service corresponding to the HTTP request is greater than a preset value, it can be determined that the service corresponding to the HTTP request is a time-insensitive service. Thus, when receiving a message indicating that the HTTP request response has failed, since the browser's index database stores the latest response data matching the URL, the response data matching the URL can be found in the browser's index database, and the content requested by the HTTP request can be generated based on the response data, thereby realizing the response to the HTTP request and improving the user experience.

[0023] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a schematic diagram of an application scenario in an embodiment of the present invention; Figure 2 This is a flowchart illustrating a data processing method according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the composition structure of a data processing device according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. Unless otherwise specified, the embodiments and features in the embodiments of this invention can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0027] The term "comprising" and any variations thereof in the specification and claims of this invention are intended to cover non-exclusive protection. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0028] In this invention, there are one or more instances; "multiple" refers to two or more. "And / or" describes the relationship between the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0029] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These are to be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of the present invention, references may be made to existing industry solutions such as software, components, and models. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of the present invention, and do not imply that the applicant has already used or necessarily used such solutions.

[0030] In the technical solution of this invention, the collection, dissemination, and use of data all comply with the requirements of relevant national laws and regulations.

[0031] Currently, as mentioned earlier, when a server fails, the related services provided by the server cannot respond to Hypertext Transfer Protocol (HTTP) requests sent by the client. Furthermore, if the HTTP request is a business request in a business chain, it may cause the entire business chain to be blocked, reducing the user experience.

[0032] In view of this, this embodiment of the invention provides a data processing method. This method receives a Hypertext Transfer Protocol (HTTP) request and determines the Uniform Resource Locator (URL) corresponding to the HTTP request. It then determines the data refresh duration of the service corresponding to the HTTP request. If the data refresh duration exceeds a preset value, the service corresponding to the HTTP request is determined to be a time-insensitive service. Thus, when a message indicating a failed response to the HTTP request is received, since the browser's index database stores the latest response data matching the URL, the response data matching the URL can be retrieved from the index database. Based on this response data, the content requested by the HTTP request is generated, thereby achieving a response to the HTTP request and improving the user experience.

[0033] After introducing the design concept of the embodiments of the present invention, the following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present invention are applicable. It should be noted that the application scenarios described below are only for illustrating the embodiments of the present invention and are not intended to limit it. In specific implementation, the technical solutions provided by the embodiments of the present invention can be flexibly applied according to actual needs.

[0034] The solution provided in this embodiment of the invention can be applied to any business scenario that processes HTTP requests.

[0035] See Figure 1 The diagram shown is a scenario illustration provided by an embodiment of the present invention. This scenario may include multiple terminal devices 101 and electronic devices 102. Terminal devices 101-1, 101-2, ..., 101-n can be used by different users, where n is a positive integer.

[0036] In this embodiment of the invention, when a user needs to open a webpage, a webpage display request can be triggered on the application platform set on the corresponding terminal device 101. Then, the terminal device 101 can receive an HTTP request to obtain webpage content and send the HTTP request to the electronic device 102, so that the electronic device 102 can respond to the HTTP request. Furthermore, after the terminal device 101 receives the HTTP request and determines the Uniform Resource Locator (URL) corresponding to the HTTP request, it can determine whether the data refresh duration of the service corresponding to the HTTP request is greater than a preset value. If it is determined that the data refresh duration of the service corresponding to the HTTP request is greater than the preset value, and the terminal device 101 receives information from the electronic device 102 indicating that the HTTP request response failed, then the terminal device 101 can search for response data matching the URL in the browser database indexDB and generate the content requested by the HTTP request based on the response data.

[0037] In this embodiment of the invention, the terminal device 101 may be, for example, a mobile phone, a tablet computer (PAD), a personal computer (PC), a smart TV, a smart vehicle device, or a wearable device, etc., and this embodiment of the invention does not limit the device.

[0038] In this embodiment of the invention, the electronic device 102 may be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. It may also be a physical server or a server cluster, but is not limited to these.

[0039] In this embodiment, terminal devices 101 and electronic devices 102, as well as various terminal devices 101, can communicate directly or indirectly through one or more networks 103. The network 103 can be a wired network or a wireless network. For example, the wireless network can be a mobile cellular network or a Wireless-Fidelity (WIFI) network, or other possible networks. This embodiment of the invention does not limit the types of networks that can be used.

[0040] Of course, the method provided in the embodiments of the present invention is not limited to... Figure 1 The application scenarios shown can also be used in other possible scenarios, and the embodiments of the present invention do not impose limitations. Figure 1 The functions that each device in the application scenario shown can achieve will be described in the subsequent method embodiments, and will not be elaborated on here.

[0041] To further illustrate the technical solutions provided by the embodiments of the present invention, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of the present invention provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on conventional or non-inventive methods. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided by the embodiments of the present invention. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.

[0042] Please see Figure 2 , Figure 2 This is a schematic flowchart of a webpage detection method according to an embodiment of the present invention. The method can be executed, for example, by an electronic device, which can be... Figure 1 The specific implementation process of this method is as follows: (101) Step 201: Receive the Hypertext Transfer Protocol (HTTP) request and determine the Uniform Resource Locator (URL) corresponding to the HTTP request.

[0043] In this embodiment of the invention, since HTTP requests are sent by calling methods of the XMLHttpRequest object, the methods of the XMLHttpRequest object can be proxied to monitor HTTP requests, thereby obtaining information about the HTTP requests and their corresponding responses. Optionally, the URL of the HTTP request can be obtained based on the open method of the XMLHttpRequest object, and the response status of the HTTP request, such as success or failure, can be monitored based on the onreadystatechange method.

[0044] Step 202: When it is determined that the data refresh time of the business corresponding to the HTTP request is greater than the preset value, and a message indicating that the HTTP request response failed is received, the response data matching the URL is searched in the browser database indexDB, and the content requested by the HTTP request is generated based on the response data.

[0045] In this embodiment of the invention, the electronic device can first determine whether the service corresponding to the HTTP request is a time-insensitive service. This refers to services with low timeliness requirements, such as services where information hardly changes over a period of time. Since the data in the indexDB represents correct response data within a certain timeframe, the data in the indexDB can be used as the response data to respond to the HTTP request. Examples of time-insensitive services include services that retrieve employee information or organizational information; this embodiment of the invention does not limit the scope of such services.

[0046] In one possible implementation, the electronic device can determine whether the data refresh duration of the service corresponding to the HTTP request is greater than a preset value. That is, when it is determined that the data refresh duration of the service corresponding to the HTTP request is greater than the preset value, the service corresponding to the HTTP request is determined to be a time-insensitive service.

[0047] In one possible implementation, the electronic device can also pre-determine the URLs corresponding to time-insensitive services, and form a pre-filtered URL list based on all the determined URLs. When the URL corresponding to an HTTP request belongs to the pre-filtered URL list, it can be determined that the service corresponding to the HTTP request is a time-insensitive service. Of course, other methods can also be used, and this embodiment of the invention does not limit them.

[0048] In this embodiment of the invention, when the electronic device determines that the service corresponding to the HTTP request is a time-insensitive service and receives information indicating that the HTTP request response failed, it can search for response data matching the URL in the browser database indexDB and generate the content requested by the HTTP request based on the response data.

[0049] Optionally, the electronic device can initialize the indexDB database before using it in the browser. Optionally, an indexDB object can be obtained, and the indexDB database can be opened based on the indexDB object to obtain a database connection object. Then, the database connection object can be used to open an object repository, where the object repository stores the response data corresponding to HTTP requests, and the instance object corresponding to the object repository used to link the response data is saved. Furthermore, methods of the object repository instance object can be called to clean up any historical response data stored in the object repository, so that subsequently obtained response data can be stored in the indexDB.

[0050] In this embodiment of the invention, when the electronic device determines that the service corresponding to the HTTP request is a time-insensitive service and receives information indicating that the HTTP request was successfully responded to, it replaces the historical response data corresponding to the HTTP request in the indexDB based on the response data corresponding to the HTTP request.

[0051] In this embodiment of the invention, after receiving information indicating that the HTTP request response failed, considering that the user may repeatedly trigger the HTTP request after receiving the HTTP request response failure information, resulting in resource occupation and waste of the browser communication thread, the HTTP request can be dynamically rate-limited according to the busy status of the browser communication thread. This reduces the occupation of the browser communication thread by the HTTP request with the failed response, and gives communication resources to other normal HTTP requests, thereby improving the resource utilization of the browser communication thread.

[0052] In embodiments of the present invention, the electronic device may dynamically rate-limit the HTTP request based on the busy status of the browser's communication thread, but is not limited to the following processes: Based on the sending time and number of HTTP requests, rate limiting information for HTTP requests is determined. When the rate limiting information meets preset conditions, the HTTP request is added to the rate limiting list. Each HTTP request in the rate limiting list is received with a delay. The preset conditions may include, for example, a sending count greater than 10 within 100 milliseconds, or a sending count greater than 30 within 150 milliseconds, etc., but are not limited in this embodiment. Furthermore, the electronic device can establish a corresponding delay task for each HTTP request in the rate limiting list based on a set rate limiting time interval. When it is determined that the current time is within the rate limiting time interval corresponding to any HTTP request in the rate limiting list, the corresponding delay task is invoked to reject the corresponding HTTP request.

[0053] Optionally, the rate limiting time interval is determined based on the following method:

[0054] Where s represents the rate limiting time interval, e is a natural constant, n represents the number of HTTP requests to be received, and t represents the time interval value determined based on the multiple sending times of HTTP requests.

[0055] In one possible implementation, if the number of HTTP requests to be received is less than a fixed value, such as 3, it can be determined that the current browser's communication resources are sufficient, and rate limiting can be waived, meaning that the HTTP requests to be received will be processed at the normal 100 millisecond interval. If the number of HTTP requests to be received is not less than the fixed value, then the rate limiting time interval is determined based on the aforementioned formula. In other words, after determining that the rate limiting information corresponding to an HTTP request meets the conditions and is added to the rate limiting list in this embodiment of the invention, the actual rate limiting time interval can also be determined by considering the current busy status of the browser's communication thread.

[0056] In this embodiment of the invention, if the electronic device determines that the rate limiting information corresponding to the HTTP request does not meet the preset conditions, it can further determine whether there is an HTTP request in the rate limiting list; if there is an HTTP request in the rate limiting list, the execution of the delayed task corresponding to the HTTP request is stopped.

[0057] As can be seen, this embodiment of the invention not only addresses the situation where HTTP requests fail, by using the corresponding data in the browser's indexDB database as the response data, thereby ensuring that users can normally use the business functions of time-insensitive services and improving the user experience. Furthermore, it can also address situations where an HTTP request fails and there is a high concurrency of the same HTTP request, by dynamically rate-limiting the HTTP request based on the busy status of the browser's communication thread. This reduces the HTTP request's occupation of the browser's communication thread, allocating communication resources to other normal HTTP requests, improving the resource utilization of the browser's communication thread, and thus enhancing the user experience.

[0058] Based on the same inventive concept, embodiments of the present invention also provide a data processing apparatus. For example... Figure 3 As shown, this is a schematic diagram of the structure of the data processing device 300, which may include: The determining unit 301 is used to receive a Hypertext Transfer Protocol (HTTP) request and determine the Uniform Resource Locator (URL) corresponding to the HTTP request; The processing unit 302 is configured to, when it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value and an information indicating that the response to the HTTP request has failed, search for response data matching the URL in the browser database indexDB, and generate the content requested by the HTTP request based on the response data.

[0059] In one possible implementation, the processing unit 302 is further configured to: Based on the sending time and number of times the HTTP request is sent, the rate limiting information of the HTTP request is determined; When the rate limiting information meets the preset conditions, the HTTP request is added to the rate limiting list; each HTTP request in the rate limiting list is received later.

[0060] In one possible implementation, the processing unit 302 is further configured to: Based on the set rate limiting time interval, a corresponding delayed task is created for each HTTP request in the rate limiting list; If it is determined that the current time is within the rate-limiting time interval corresponding to any HTTP request in the rate-limiting list, then the corresponding delayed task is invoked to refuse to receive any HTTP request.

[0061] In one possible implementation, the current limiting time interval is determined based on the following:

[0062] Where s represents the rate limiting time interval, e is a natural constant, n represents the number of HTTP requests to be received, and t represents the time interval value determined based on the multiple sending times of HTTP requests.

[0063] In one possible implementation, the processing unit 302 is further configured to: If the rate limiting information corresponding to the HTTP request does not meet the preset conditions, determine whether the HTTP request exists in the rate limiting list; If the HTTP request exists in the rate limiting list, then the delayed task corresponding to the HTTP request will be stopped.

[0064] In one possible implementation, the device further includes an updating unit for: When it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and information indicating that the HTTP request was successfully responded to is received, the historical response data corresponding to the HTTP request in the indexDB is replaced based on the response data corresponding to the HTTP request.

[0065] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this invention, the functions of each module (or unit) can be implemented in one or more software or hardware components.

[0066] After introducing the data processing method and apparatus according to exemplary embodiments of the present invention, the electronic device according to another exemplary embodiment of the present invention will be introduced next.

[0067] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”

[0068] Based on the same inventive concept as the above method embodiments, this invention also provides an electronic device. In this embodiment, the structure of the electronic device can be as follows: Figure 4 As shown, the electronic device is, for example, the aforementioned Figure 1 Electronic devices 102, such as Figure 4As shown, the electronic device in this embodiment of the invention includes at least one processor 401, a memory 402 connected to the at least one processor 401, and a communication interface 403. This embodiment of the invention does not limit the specific connection medium between the processor 401 and the memory 402. Figure 4 Taking the connection between processor 401 and memory 402 via system bus 400 as an example, the system bus 400 is... Figure 4 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The system bus 400 can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0069] In this embodiment of the invention, the memory 402 stores instructions that can be executed by at least one processor 401. By executing the instructions stored in the memory 402, at least one processor 401 can perform the steps included in the aforementioned data processing method.

[0070] The processor 401 is the control center of the electronic device. It can connect to various parts of the electronic device through various interfaces and lines. By running or executing instructions stored in the memory 402 and calling data stored in the memory 402, it can realize various functions of the electronic device. Optionally, the processor 401 may include one or more processing units. The processor 401 may integrate an application processor and a modem processor. The processor 401 mainly handles the operating system, client interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.

[0071] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0072] Memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 402 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 402 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In embodiments of the present invention, memory 402 may also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0073] Communication interface 403 is a transmission interface that can be used for communication. Data can be received or sent through communication interface 403.

[0074] In addition, the electronic device also includes a basic input / output system (I / O system) 404 that helps transmit information between various devices within the electronic device, and a large-capacity storage device 408 for storing the operating system 405, application programs 406 and other program modules 407.

[0075] The basic input / output system 404 includes a display 409 for displaying information and an input device 410 for user input, such as a mouse or keyboard. Both the display 409 and the input device 410 are connected to the processor 401 via the basic input / output system 404 connected to the system bus 400. The basic input / output system 404 may also include an input / output controller for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller also provides output to a display screen, printer, or other types of output devices.

[0076] Specifically, mass storage device 408 is connected to processor 401 via a mass storage controller (not shown) connected to system bus 400. Mass storage device 408 and its associated computer-readable media provide non-volatile storage for the server package. That is, mass storage device 408 may include computer-readable media (not shown) such as hard disks or CD-ROM drives.

[0077] According to various embodiments of the present invention, the electronic device can also be connected to a remote computer on a network such as the Internet. That is, the electronic device can be connected to the network 411 via the communication interface 403 connected to the system bus 400, or the communication interface 403 can be used to connect to other types of networks or remote computer systems (not shown).

[0078] This invention also provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, the computer program being used to cause a computer to execute the technical solution of the data processing method described in the above embodiments.

[0079] This invention also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it enables the computer to implement the technical solution of the data processing method described in the above embodiments.

[0080] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program instructions are computer programs, which can be stored in a computer-readable storage medium. When executed, the computer program performs the steps of the above method embodiments. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0081] The program product of this invention can be a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a computing device. However, the program product of this invention is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with a command execution system, apparatus, or device.

[0082] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with a command execution system, apparatus, or device.

[0083] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0084] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on a computing device, partially on an electronic device, as a standalone software package, partially on a computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0085] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0086] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A data processing method, characterized in that, The method includes: Receive a Hypertext Transfer Protocol (HTTP) request and determine the Uniform Resource Locator (URL) corresponding to the HTTP request; When it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and information indicating that the response to the HTTP request failed is received, the response data matching the URL is searched in the browser database indexDB, and the content requested by the HTTP request is generated based on the response data; Whenever the browser's communication thread is busy, dynamic rate limiting is applied to the received HTTP requests, including: Based on the sending time and number of times the HTTP request is sent, the rate limiting information of the HTTP request is determined; When the rate limiting information meets the preset conditions, the HTTP request is added to the rate limiting list; each HTTP request in the rate limiting list is delayed in receiving; wherein, the rate limiting list is used to: establish a corresponding delay task for each HTTP request in the rate limiting list based on a set rate limiting time interval; when it is determined that the current time is within the rate limiting time interval corresponding to any HTTP request in the rate limiting list, the corresponding delay task is invoked to refuse to receive the corresponding HTTP request; the rate limiting ends when the number of HTTP requests to be received is less than a fixed value; When the rate limiting information does not meet the preset conditions and the HTTP request exists in the rate limiting list, the delay task of the HTTP request is terminated.

2. The method as described in claim 1, characterized in that, The current limiting time interval is determined based on the following method: Where s represents the rate limiting time interval, e is a natural constant, n represents the number of HTTP requests to be received, and t represents the time interval value determined based on the multiple sending times of HTTP requests.

3. The method as described in claim 1 or 2, characterized in that, The method further includes: When it is determined that the data refresh time of the service corresponding to the HTTP request is greater than a preset value, and information indicating that the HTTP request was successfully responded to is received, the historical response data corresponding to the HTTP request in the indexDB is replaced based on the response data corresponding to the HTTP request.

4. A data processing apparatus, characterized in that, The device includes: The determining unit is configured to receive a Hypertext Transfer Protocol (HTTP) request and determine the Uniform Resource Locator (URL) corresponding to the HTTP request. The processing unit is configured to, when it is determined that the data refresh duration of the service corresponding to the HTTP request is greater than a preset value, and when it receives information indicating that the response to the HTTP request has failed, search for response data matching the URL in the browser database indexDB, and generate the content requested by the HTTP request based on the response data; The processing unit is further configured to: whenever the browser communication thread is busy, begin dynamically rate limiting the received HTTP requests, including: Based on the sending time and number of times the HTTP request is sent, the rate limiting information of the HTTP request is determined; When the rate limiting information meets the preset conditions, the HTTP request is added to the rate limiting list; each HTTP request in the rate limiting list is delayed in receiving; wherein, the rate limiting list is used to: establish a corresponding delay task for each HTTP request in the rate limiting list based on a set rate limiting time interval; when it is determined that the current time is within the rate limiting time interval corresponding to any HTTP request in the rate limiting list, the corresponding delay task is invoked to refuse to receive the corresponding HTTP request; the rate limiting ends when the number of HTTP requests to be received is less than a fixed value; When the rate limiting information does not meet the preset conditions and the HTTP request exists in the rate limiting list, the delay task of the HTTP request is terminated.

5. An electronic device, characterized in that, The method includes at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to implement the method as described in any one of claims 1-3.

6. A computer storage medium, characterized in that, The computer storage medium stores a computer program that enables the computer to perform the method as described in any one of claims 1-3.

7. A computer program product, characterized in that, The computer program product includes: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of claims 1-3.