A network request response method, device, electronic device and storage medium
By identifying the target web page identification information in the web page access request and reading the compressed web page files in the preset service scenario, the server stability and availability challenges in high concurrency scenarios are solved, and the effect of reducing network bandwidth usage, improving service performance and reducing hardware resource costs is achieved.
Patent Information
- Application Number
- CN202110673878.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-17
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-06-17
AI Technical Summary
In the highly concurrent web page access scenario, the server faces stability and usability challenges, resulting in online pages being inaccessible or service being damaged, affecting the user experience.
By identifying the destination web page identification information in the web page access request, it is determined whether it belongs to the preset web page identification whitelist. When the destination web page identifier belongs to a whitelist, the web page file compressed by the file volume is read on the server according to the identification information and feedback it to the requester of the access request.
It reduces the use of network bandwidth by web files, improves service feedback speed and performance, reduces hardware resource costs, and solves the problem of high hardware resource costs in high concurrency scenarios.
Smart Images

Figure CN113297453B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular, to a network request response method, device, electronic device, and storage medium. Background Art
[0002] In some scenarios, the front-end page will face the technical challenges of large traffic and high concurrency web page access. For example, in a limited-time lottery or voting event, millions or even tens of millions of people will visit a front-end page in a short period of time. The server where the front-end page is deployed will face the test of stability and availability. In the case of excessive traffic, the online page will be inaccessible or forced to provide damaged services, affecting the normal use of users.
[0003] Currently, more servers are deployed to ease the pressure on web page access; however, explosive growth in traffic is not normal, and deploying too many servers will lead to excessively high hardware resource costs. Summary of the invention
[0004] The embodiments of the present disclosure provide a network request response method, device, electronic device and storage medium, which can reduce the occupation of network bandwidth by web page files, improve service feedback speed and performance, and reduce hardware resource costs.
[0005] In a first aspect, an embodiment of the present disclosure provides a network request response method, including:
[0006] Obtaining a web page access request and identifying target web page identification information in the access request;
[0007] When the target web page identification information belongs to a preset web page identification whitelist, the target web page file is read from the configuration information of the server according to the target web page identification information, and the target web page file is fed back to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file that has been compressed in file size under a preset service scenario.
[0008] In a second aspect, the embodiment of the present disclosure further provides a network request response device, including:
[0009] A request receiving module, used to obtain a web page access request and identify target web page identification information in the access request;
[0010] A request response module is used to read the target web page file in the configuration information of the server according to the target web page identification information when the target web page identification information belongs to the preset web page identification whitelist, and feed back the target web page file to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file that has been compressed in file size under the preset service scenario.
[0011] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0012] one or more processors;
[0013] a storage device for storing one or more programs,
[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement the network request response method as described in any one of the embodiments of the present disclosure.
[0015] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the network request response method as described in any one of the embodiments of the present disclosure.
[0016] The technical solution of the disclosed embodiment is to identify whether the target web page identification information in the access request is a network request under a preset scenario when obtaining a web page access request; when the target web page identification information belongs to the preset web page identification whitelist, that is, the web page file corresponding to the target web page identification is a web page file that has been compressed in file volume under the preset service scenario, the target web page file can be read from the configuration information of the server according to the target web page identification information, and the target web page file can be fed back to the requester of the access request to complete the process of network request response. Among them, the web page file that has been compressed in volume can reduce the occupation of network bandwidth and reduce the jamming of network access. Directly reading the string in the compressed web page file from the server configuration parameters can further reduce network round trips and service resource occupation, and improve service performance. The technical solution of the disclosed embodiment solves the problem of high cost of deploying hardware resources to cope with high-concurrency service requests, can reduce the occupation of network bandwidth by web page files, improve service feedback speed and performance, and reduce hardware resource costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0018] Figure 1 A flowchart of a network request response method provided in the first embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a network request response method provided in Embodiment 2 of the present disclosure;
[0020] Figure 3 A schematic diagram of the structure of a network request response device provided in Embodiment 3 of the present disclosure;
[0021] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present disclosure. DETAILED DESCRIPTION
[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0024] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0025] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0026] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0027] Embodiment 1
[0028] Figure 1This is a flow chart of a network request response method provided by Embodiment 1 of the present disclosure. Embodiments of the present disclosure are applicable to situations in which network requests are responded to, and are particularly applicable to situations in which network requests with large traffic and high concurrency are responded to. The method can be executed by a network request response device, which can be implemented in the form of software and / or hardware, and can be configured in an electronic device, such as a mobile terminal or a server device.
[0029] like Figure 1 As shown, the network request response method provided in this embodiment includes:
[0030] S110: Obtain a web page access request, and identify target web page identification information in the access request.
[0031] In any application, such as audio and video, social or shopping applications, users can interact with the application server through the display content of the application display page, and send requests to the server through the response interface in the page to obtain the content they are interested in. The server responds to the obtained web page access request and gives the user feedback on the response content, such as entering the user's target access interface, playing the audio and video requested by yoghurt, etc.
[0032] However, in some scenarios, the number of web page access requests is too large, and the server is under too much access pressure, which may cause the server to crash, resulting in users being unable to obtain the network services corresponding to the requests normally, affecting the user experience. For example, network access anomalies often occur in scenarios such as sudden hot topics on social networks, limited-time red envelope activities, and limited-time sales on shopping platforms.
[0033] In order to cope with the above situation, in this embodiment, after receiving the network access request, the server will first determine the target web page identification information in the access request to determine whether the target web page is the target access web page in the above special scenario. This is because, in this implementation, personalized settings are pre-made for network pages that may receive a large number of requests in a short period of time to adapt to the scenario of high concurrent requests.
[0034] S120: When the target web page identification information belongs to a preset web page identification whitelist, read the target web page file from the configuration information of the server according to the target web page identification information, and feed back the target web page file to the requester of the access request to respond to the network request.
[0035] Specifically, when judging whether the target web page is the target access web page in the above special scenario, it can be determined by matching the target web page identifier with the preset web page identifier whitelist. The web page files corresponding to the web page identifiers included in the preset web page identifier whitelist are web page files pre-processed with file volume compression in the preset service scenario.
[0036] The web page file compression process can be to delete the parts that are irrelevant to the web page display content, and further compress the web page file by string compression and other methods. The file size of the compressed web page file is small enough, and can be directly written into the server's relevant configuration parameters for the web page in the form of parameters. Therefore, when the server responds to a request, there is no need for the server to gradually search for the web page file from the file library according to the storage path of the web page file to respond to the request, so that the web page content can be directly fed back, reducing the input and output process on the server side, and the network resource usage will also be reduced accordingly.
[0037] The technical solution of the disclosed embodiment can be achieved by identifying whether the target web page identification information in the access request is a network request under a preset scenario when obtaining a web page access request; when the target web page identification information belongs to the preset web page identification whitelist, that is, the web page file corresponding to the target web page identification is a web page file that has been compressed in file volume under the preset service scenario, the target web page file can be read from the configuration information of the server according to the target web page identification information, and the target web page file can be fed back to the requester of the access request to complete the process of network request response. Among them, the web page file that has been compressed in volume can reduce the occupation of network bandwidth and reduce the jamming of network access. Directly reading the string in the compressed web page file from the server configuration parameters can further reduce network round trips and service resource occupation, and improve service performance. The technical solution of the disclosed embodiment solves the problem of high cost of deploying hardware resources to cope with high-concurrency service requests, can reduce the occupation of network bandwidth by web page files, improve service feedback speed and performance, and reduce hardware resource costs.
[0038] Embodiment 2
[0039] The embodiments of the present disclosure can be combined with the various optional solutions in the network request response method provided in the above embodiments. The network request response method provided in this embodiment further describes the process of compressing web page files in high concurrency scenarios, which can effectively reduce the bandwidth occupied by web page files.
[0040] Figure 2 This is a flow chart of a network request response method provided by Embodiment 2 of the present disclosure. Figure 2 As shown, the network request response method provided in this embodiment includes:
[0041] S210, obtaining a web page file to be compressed, parsing the content structure in the header tag in the web page file to be compressed, identifying and deleting tags and content in the header tag content that are not related to the implementation of the preset service scenario, and obtaining a preliminary compressed web page file.
[0042] The web page file to be compressed is a web page file whose service request volume (web page visit volume) may be greater than a preset request volume threshold within a certain period of time in its application scenario.
[0043] Web page files use HyperText Markup Language (HTML) to mark the various parts of the web page to be displayed. The web page file itself is a text file. By adding tags to the text file, you can tell the browser how to display the content. The structure of a web page file includes a "header" part and a "body" part. The "header" part provides information about the web page, and the "body" part provides the specific content of the web page.
[0044] The content that can be compressed in the web page file is the content in the "head" part. After obtaining the web page file to be compressed, the text structure in the "head" part can be parsed according to the content tags in the "head" part, such as "meta" (meta information), "link" (link) and other tag contents, and the content that is irrelevant to the service scenario of the web page is deleted to obtain a preliminary compressed web page file. Exemplarily, for example, under the "meta" tag, including "name", "title", "description" and "template" and other contents, can be matched with the preset redundant content tag set, and the characters that are irrelevant to the specific display content of the web page can be deleted.
[0045] In addition, all external resource files that need to be introduced in the web page file to be compressed, such as pictures, music, etc., can be introduced in the form of links, and the corresponding files can be stored in the preset content distribution network.
[0046] All web page files that meet the characteristics of high-concurrency request scenarios can be compressed through the above-mentioned web page file compression process.
[0047] S220: compress the initially compressed web page file.
[0048] For web page files that have been initially compressed, further compression can be performed through character encoding and other methods, such as Zip compression and HTML minimization compression. Among them, Zip compression is a widely used file compression method. It compresses the binary content of the file and achieves the compression purpose by reducing repeated 0s and 1s. HTML minimization is to delete redundant whitespace characters (such as spaces, tabs, and line breaks) in the HTML content while retaining the original semantics of HTML to achieve the compression purpose. Its output format is still HTML text. In some cases, thousands of lines of HTML text are reduced to only one line after minimization. The smaller the file size, the less bandwidth the network transmission occupies, and the more concurrency can be tolerated under limited bandwidth conditions.
[0049] S230: Save the web page file to be compressed after the file volume is compressed in the web page configuration information of the server.
[0050] By compressing the web page files in the above two steps, the HTML file may be optimized to less than 1kb. Then, the web page files to be compressed that have been compressed in file size can be directly saved in the web page configuration information of the server. When the server receives a network service request, it can directly return the corresponding web page file content, reducing network round trips and service resource usage, improving service performance, and eliminating the need to deploy too many server resources.
[0051] At present, the front-end page deployment scheme is basically to provide access to HTML resources by a static resource server. The static resource server can be Nginx (engine x). Nginx is a high-performance HTTP and reverse proxy web server, and also provides IMAP / POP3 / SMTP services. Its characteristics are that it occupies less memory and has strong concurrency capabilities.
[0052] S240: Obtain a web page access request, and identify target web page identification information in the access request.
[0053] After receiving the network access request, the server will first determine the target web page identification information in the access request to determine whether the target web page is the target access web page in the preset scenario.
[0054] S250: When the target web page identification information belongs to a preset web page identification whitelist, read the target web page file from the configuration information of the server according to the target web page identification information, and feed back the target web page file to the requester of the access request to respond to the network request.
[0055] The web page files corresponding to the web page identifiers included in the preset web page identifier whitelist are web page files compressed in file size under the preset service scenario.
[0056] The technical solution of the disclosed embodiment is to compress the web page files that meet the high-concurrency request scenario in advance, and directly write the compression results into the server configuration information. When obtaining a web page access request, it is identified whether the target web page identification information in the access request is a network request in a preset scenario; when the target web page identification information belongs to the preset web page identification whitelist, that is, the web page file corresponding to the target web page identification is a web page file that has been compressed in file volume in the preset service scenario, the target web page file can be read in the configuration information of the server according to the target web page identification information, and the target web page file can be fed back to the requester of the access request to complete the process of network request response. The technical solution of the disclosed embodiment solves the problem of high cost of deploying hardware resources to cope with high-concurrency service requests, can reduce the occupation of network bandwidth by web page files, improve service feedback speed and performance, and reduce hardware resource costs.
[0057] Embodiment 3
[0058] Figure 3 The schematic diagram of the structure of a network request response device provided in the third embodiment of the present disclosure is as follows. The network request response device provided in this embodiment is suitable for responding to network requests, and is particularly suitable for responding to high-traffic and high-concurrency network request scenarios.
[0059] like Figure 3 As shown, the network request response device includes: a request receiving module 310 and a request response module 320.
[0060] Among them, the request receiving module 310 is used to obtain a web page access request and identify the target web page identification information in the access request; the request response module 320 is used to read the target web page file in the configuration information of the server according to the target web page identification information when the target web page identification information belongs to a preset web page identification whitelist, and feed back the target web page file to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file that has been compressed in file size under a preset service scenario.
[0061] The technical solution of the disclosed embodiment is to identify whether the target web page identification information in the access request is a network request under a preset scenario when obtaining a web page access request; when the target web page identification information belongs to the preset web page identification whitelist, that is, the web page file corresponding to the target web page identification is a web page file that has been compressed in file volume under the preset service scenario, the target web page file can be read from the configuration information of the server according to the target web page identification information, and the target web page file can be fed back to the requester of the access request to complete the process of network request response. Among them, the web page file that has been compressed in volume can reduce the occupation of network bandwidth and reduce the jamming of network access. Directly reading the string in the compressed web page file from the server configuration parameters can further reduce network round trips and service resource occupation, and improve service performance. The technical solution of the disclosed embodiment solves the problem of high cost of deploying hardware resources to cope with high-concurrency service requests, can reduce the occupation of network bandwidth by web page files, improve service feedback speed and performance, and reduce hardware resource costs.
[0062] In some optional implementations, the network request response device further includes:
[0063] A file compression module, used to obtain a web page file to be compressed, and parse the content structure in the header tag of the web page file to be compressed;
[0064] Identify and delete tags and content in the header tag content that are not related to the implementation of the preset service scenario, and obtain a preliminary compressed web page file;
[0065] The preliminary compressed web page file is compressed.
[0066] In some optional implementations, the file compression module is further used to:
[0067] The files introduced by the web page files to be compressed are introduced in the form of links, and the corresponding files are stored in a preset content distribution network.
[0068] In some optional implementations, the network request response device further includes:
[0069] The parameter setting module is used to save the web page file to be compressed after the file volume is compressed in the web page configuration information of the server.
[0070] In some optional implementations, the preset service scenario is a service scenario in which the service request volume is greater than a preset request volume threshold within a preset time period.
[0071] In some optional implementations, the server is an Nginx server.
[0072] The network request response device provided in the embodiments of the present disclosure can execute the network request response method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0073] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0074] Embodiment 4
[0075] Reference below Figure 4 , which shows an electronic device (eg, Figure 4 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0076] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 406 to a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0077] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0078] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 406, or installed from the ROM402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the network request response method of the embodiment of the present disclosure are executed.
[0079] The electronic device provided in the embodiment of the present disclosure and the network request response method provided in the above embodiment belong to the same public concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0080] Embodiment 5
[0081] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the network request response method provided by the above embodiment is implemented.
[0082] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a flash memory (FLASH), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0083] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0084] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0085] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0086] Obtaining a web page access request and identifying target web page identification information in the access request;
[0087] When the target web page identification information belongs to a preset web page identification whitelist, the target web page file is read from the configuration information of the server according to the target web page identification information, and the target web page file is fed back to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file that has been compressed in file size under a preset service scenario.
[0088] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0089] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0090] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The names of the units and modules do not, in some cases, limit the units and modules themselves. For example, the data generation module may also be described as a "video data generation module".
[0091] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), etc.
[0092] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0093] According to one or more embodiments of the present disclosure, [Example 1] provides a network request response method, the method comprising:
[0094] Obtaining a web page access request and identifying target web page identification information in the access request;
[0095] When the target web page identification information belongs to a preset web page identification whitelist, the target web page file is read from the configuration information of the server according to the target web page identification information, and the target web page file is fed back to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file that has been compressed in file size under a preset service scenario.
[0096] According to one or more embodiments of the present disclosure, [Example 2] provides a network request response method, further comprising:
[0097] The compression processing process of the web page files corresponding to the web page identifiers included in the preset web page identifier whitelist includes:
[0098] Obtaining a web page file to be compressed, and parsing a content structure in a header tag of the web page file to be compressed;
[0099] Identify and delete tags and content in the header tag content that are not related to the implementation of the preset service scenario, and obtain a preliminary compressed web page file;
[0100] The preliminary compressed web page file is compressed.
[0101] According to one or more embodiments of the present disclosure, [Example 3] provides a network request response method, further comprising:
[0102] The compression processing process of the web page files corresponding to the web page identifiers included in the preset web page identifier white list also includes:
[0103] The files introduced by the web page files to be compressed are introduced in the form of links, and the corresponding files are stored in a preset content distribution network.
[0104] According to one or more embodiments of the present disclosure, [Example 4] provides a network request response method, further comprising:
[0105] The method further comprises:
[0106] The web page file to be compressed which has been compressed in file volume is stored in the web page configuration information of the server.
[0107] According to one or more embodiments of the present disclosure, [Example 5] provides a network request response method, further comprising:
[0108] The preset service scenario is a service scenario in which the service request volume is greater than a preset request volume threshold within a preset time period.
[0109] According to one or more embodiments of the present disclosure, [Example 6] provides a network request response method, further comprising:
[0110] The server is an Nginx server.
[0111] According to one or more embodiments of the present disclosure, [Example 7] provides a network request response device, including:
[0112] A request receiving module, used to obtain a web page access request and identify target web page identification information in the access request;
[0113] A request response module is used to read the target web page file in the configuration information of the server according to the target web page identification information when the target web page identification information belongs to the preset web page identification whitelist, and feed back the target web page file to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file that has been compressed in file size under the preset service scenario.
[0114] According to one or more embodiments of the present disclosure, [Example 8] provides a network request response device, further comprising:
[0115] In some optional implementations, the network request response device further includes:
[0116] A file compression module, used to obtain a web page file to be compressed, and parse the content structure in the header tag of the web page file to be compressed;
[0117] Identify and delete tags and content in the header tag content that are not related to the implementation of the preset service scenario, and obtain a preliminary compressed web page file;
[0118] The preliminary compressed web page file is compressed.
[0119] According to one or more embodiments of the present disclosure, [Example 9] provides a network request response device, further comprising:
[0120] In some optional implementations, the file compression module is further used to:
[0121] The files introduced by the web page files to be compressed are introduced in the form of links, and the corresponding files are stored in a preset content distribution network.
[0122] According to one or more embodiments of the present disclosure, [Example 10] provides a network request response device, further comprising:
[0123] In some optional implementations, the network request response device further includes:
[0124] The parameter setting module is used to save the web page file to be compressed after the file volume is compressed in the web page configuration information of the server.
[0125] According to one or more embodiments of the present disclosure, [Example 11] provides a network request response device, further comprising:
[0126] In some optional implementations, the preset service scenario is a service scenario in which the service request volume is greater than a preset request volume threshold within a preset time period.
[0127] According to one or more embodiments of the present disclosure, [Example 12] provides a network request response device, further comprising:
[0128] In some optional implementations, the server is an Nginx server.
[0129] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0130] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0131] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A network request response method, applied to a server, characterized in that: include: Obtaining a web page access request and identifying target web page identification information in the access request; When the target web page identification information belongs to a preset web page identification whitelist, the target web page file is read from the configuration information of the server according to the target web page identification information, and the target web page file is fed back to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file compressed in file volume under a preset service scenario; the web page file compressed in file volume is stored in the web page configuration information of the server in the form of parameters; The preset service scenario is a service scenario in which the service request volume is greater than a preset request volume threshold within a preset time period; The compression process of the web page files corresponding to the web page identifiers included in the preset web page identifier whitelist includes: Obtaining a web page file to be compressed, and parsing a content structure in a header tag of the web page file to be compressed; Identify and delete tags and content in the header tag content that are not related to the implementation of the preset service scenario, and obtain a preliminary compressed web page file; The preliminary compressed web page file is compressed.
2. The method according to claim 1, characterized in that The compression processing process of the web page files corresponding to the web page identifiers included in the preset web page identifier white list also includes: The files introduced by the web page files to be compressed are introduced in the form of links, and the corresponding files are stored in a preset content distribution network.
3. The method according to any one of claims 1-2, characterized in that: The method further comprises: The web page file to be compressed that has been compressed in file volume is saved in the web page configuration information of the server.
4. The method according to claim 1, characterized in that: The server is Nginx server.
5. A network request response device, characterized in that: include: A request receiving module, used to obtain a web page access request and identify target web page identification information in the access request; A request response module, used for, when the target web page identification information belongs to a preset web page identification whitelist, reading the target web page file in the configuration information of the server according to the target web page identification information, and feeding back the target web page file to the requester of the access request to respond to the network request, wherein the web page file corresponding to the web page identification included in the preset web page identification whitelist is a web page file compressed in file volume under a preset service scenario; the web page file compressed in file volume is stored in the web page configuration information of the server in the form of parameters; wherein the preset service scenario is a service scenario in which the service request volume is greater than a preset request volume threshold within a preset time period; Among them, the network request response device also includes: a file compression module, which is used to obtain the web page file to be compressed, parse the content structure in the header tag in the web page file to be compressed; identify and delete the tags and content in the header tag content that are not related to the implementation of the preset service scenario, and obtain a preliminary compressed web page file; compress the preliminary compressed web page file.
6. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the network request response method as described in any one of claims 1-4.
7. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute the network request response method as described in any one of claims 1 to 4 when executed by a computer processor.
Citation Information
Patent Citations
Network storage and calling method and storage system of 3D printing model file
CN105025102A