Network request method and device, terminal and medium

The client obtains the IP address corresponding to the domain name and builds the target IP request, which solves the problem of restricted network requests caused by domain name matching interception, and achieves the effect of bypassing interception and improving the success rate of requests.

CN119835247APending Publication Date: 2025-04-15CHONGQING YIFANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510043241.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the case of domain name matching interception, the client cannot effectively bypass the interception, resulting in restricted network requests and unable to obtain the required content.

Method used

When the client monitors that the domain name request is intercepted, it obtains the IP address corresponding to the domain name, and builds a target IP request carrying the target parameters, and resends the request to the server to bypass the interception. When the server responds, replace the domain name in the HTTP link with the IP address to avoid intercepting subsequent requests.

Benefits of technology

Effectively bypass domain name interception, improve the success rate of client requesting HTTP content, and ensure the normal progress of business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835247A_ABST
    Figure CN119835247A_ABST
Patent Text Reader

Abstract

The invention provides a network request method and device, a terminal and a medium, and the method is applied to a client, and comprises the steps: obtaining an IP address corresponding to a domain name in a domain name request when monitoring that the domain name request initiated to a server has a domain name interception condition; constructing a target IP request carrying a target parameter used for identifying the domain name interception condition by using the IP address; and the target IP request is resent to the server, and the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address. When the domain name request initiated by the client is intercepted, the IP address corresponding to the domain name in the request is acquired, and the request is initiated to the server again by using the IP address, so that domain name interception can be effectively bypassed, and when the server issues the HTTP link to the client, the domain name in the link is replaced by the IP address, so that the subsequent request of the client is prevented from being intercepted by the domain name.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network technology, and in particular to a network request method, device, terminal and medium. Background Art

[0002] At present, in the existing network environment, common ad blocking and access prohibition solutions are mostly implemented based on the principle of domain name matching. When a domain name request is blocked, the existing technology does not provide an effective way to bypass the blockade. The client can only accept the result of the request failure and cannot take further measures to obtain the required content.

[0003] Therefore, how to provide a solution to the problem of client network request restriction caused by domain name matching interception is a problem that technical personnel in this field need to solve at present. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a network request method, device, terminal and medium for the above-mentioned defects of the prior art, which can effectively bypass domain name interception, improve the success rate of client requests for HTTP content, and ensure the normal operation of client services.

[0005] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0006] A network request method, wherein the method is applied to a client, and the method comprises:

[0007] When a domain name request initiated to a server is detected to be blocked, an IP address corresponding to the domain name in the domain name request is obtained;

[0008] Using the IP address to construct a target IP request carrying a target parameter; wherein the target parameter is a parameter used to identify the domain name interception situation;

[0009] The target IP request is resent to the server so that the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

[0010] In one implementation, obtaining the IP address corresponding to the domain name in the domain name request includes:

[0011] A domain name resolution request is sent to an HTTPDNS server to obtain an IP address returned by the HTTPDNS server and corresponding to the domain name in the domain name request.

[0012] In one implementation, obtaining the IP address corresponding to the domain name in the domain name request includes:

[0013] A domain name resolution request is sent to a private DNS server to obtain an IP address returned by the private DNS server and corresponding to the domain name in the domain name request.

[0014] In one implementation, the step of constructing a target IP request carrying target parameters using the IP address includes:

[0015] The corresponding IP request is constructed using the IP address, and a target parameter for identifying the domain name interception situation is added to a request data packet corresponding to the IP request to obtain a target IP request carrying the target parameter.

[0016] In one implementation, before resending the target IP request to the server so that the server responds to the target IP request, the method further includes:

[0017] Encrypting the request data packet corresponding to the target IP request to obtain an encrypted target IP request;

[0018] Wherein, resending the target IP request to the server so that the server responds to the target IP request includes:

[0019] The encrypted target IP request is resent to the server so that the server can decrypt the encrypted target IP request and respond to the decrypted target IP request.

[0020] In one implementation, before resending the target IP request to the server so that the server responds to the target IP request, the method further includes:

[0021] Processing the request data packet corresponding to the target IP request using a preset data format to obtain a processed target IP request;

[0022] Wherein, resending the target IP request to the server so that the server responds to the target IP request includes:

[0023] The processed target IP request is resent to the server so that the server responds to the processed target IP request.

[0024] A network request method, wherein the method is applied to a server, and the method comprises:

[0025] Receive a target IP request sent by a client; wherein the target IP request is a request carrying a target parameter constructed by the client using the IP address to obtain the IP address corresponding to the domain name in the domain name request when the client monitors in real time that the domain name request initiated by the client to the server is blocked; wherein the target parameter is a parameter used to identify the domain name blocking situation;

[0026] Respond to the target IP request, and replace the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

[0027] The present invention also discloses a network request device, which is applied to a client and includes:

[0028] A domain name resolution request module is used to obtain an IP address corresponding to the domain name in the domain name request when a domain name interception occurs in the domain name request initiated to the server;

[0029] A request construction module, used to construct a target IP request carrying a target parameter using the IP address; wherein the target parameter is a parameter used to identify the domain name interception situation;

[0030] The IP request module is used to resend the target IP request to the server so that the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

[0031] The present invention also discloses a terminal, which includes: a memory, a processor, and a network request program stored in the memory and executable on the processor, wherein the network request program implements the steps of the network request method described above when executed by the processor.

[0032] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the network request method as described above.

[0033] The present invention provides a network request method, device, terminal and medium. The network request method is applied to a client and includes: when a domain name interception is detected in a domain name request initiated to a server, an IP address corresponding to the domain name in the domain name request is obtained; a target IP request carrying a target parameter is constructed using the IP address; wherein the target parameter is a parameter used to identify the domain name interception situation; the target IP request is resent to the server so that the server responds to the target IP request, and the domain name of the target HTTP link related to the content required by the client in the request result returned to the client is replaced with the IP address. It can be seen that, according to the present invention, when a domain name request initiated by a client encounters domain name interception, the client obtains the IP address corresponding to the domain name in the domain name request, and then uses the IP address to re-initiate a request to the server, which can effectively bypass the domain name interception and solve the traditional situation where the request cannot be continued due to the domain name being intercepted. At the same time, when re-requesting to the server, a parameter for identifying the domain name interception situation is added to inform the server that the request has encountered domain name interception. When the server sends the target HTTP link to the client, the original domain name is replaced with the IP address to prevent the client's subsequent requests from being intercepted by the domain name, thereby improving the success rate of the client's HTTP content requests and ensuring the normal operation of the client's business. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a flow chart of a preferred embodiment of the network request method of the present invention;

[0035] Figure 2 It is a flow chart of another preferred embodiment of a network request method disclosed in the present invention;

[0036] Figure 3 It is a specific flow chart of a network request method disclosed in the present invention;

[0037] Figure 4 It is a functional principle block diagram of a preferred embodiment of the network request device of the present invention;

[0038] Figure 5 It is a functional principle block diagram of a preferred embodiment of the terminal in the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0040] See also Figure 1 , Figure 1 Flowchart of the network request method in the present invention. Figure 1As shown, the network request method according to the embodiment of the present invention is applied to a client, and includes:

[0041] Step S11: when it is detected that a domain name request initiated to the server is intercepted, an IP address corresponding to the domain name in the domain name request is obtained.

[0042] It can be understood that when the client initiates a domain name request to the server, it monitors in real time whether the domain name request is intercepted, that is, it monitors in real time whether the domain name request initiated to the server is intercepted. When the domain name request (HTTP request) initiated by the client to the server encounters domain name interception, the client obtains the IP address corresponding to the domain name in the HTTP request.

[0043] In a specific implementation, a domain name resolution request is sent to an HTTPDNS (Hypertext Transfer Protocol Domain Name System) server to obtain the IP address corresponding to the domain name in the domain name request returned by the HTTPDNS server. It is understandable that the client requests HTTPDNS to obtain the IP address corresponding to the domain name. It should be pointed out that HTTPDNS is a domain name resolution system based on the HTTP protocol, which is mainly used to improve the efficiency and accuracy of domain name resolution. HTTPDNS provides domain name resolution services through HTTP or HTTPS protocols.

[0044] In another specific implementation, a domain name resolution request is sent to a private DNS (Domain Name System) server to obtain an IP address corresponding to the domain name in the domain name request returned by the private DNS server. It can be understood that the client requests the private DNS server to obtain the IP address corresponding to the domain name.

[0045] Step S12: construct a target IP request carrying a target parameter using the IP address; wherein the target parameter is a parameter used to identify the domain name interception situation.

[0046] In this embodiment, the request is reconstructed using the IP address to effectively bypass domain name interception, and the request carries a target parameter for identifying the domain name interception situation. Specifically, the corresponding IP request is constructed using the IP address, and the target parameter for identifying the domain name interception situation is added to the request data packet corresponding to the IP request to obtain a target IP request carrying the target parameter. That is to say, a specific parameter is added to the data packet of the client requesting the server to inform the server that the request has encountered domain name interception, so that the server can understand the network status of the client and better perform subsequent processing.

[0047] Step S13: resend the target IP request to the server so that the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

[0048] It is understandable that after encountering domain name interception, the client actively obtains the IP address corresponding to the domain name, reconstructs the request using the IP address, and re-initiates the request, which solves the traditional situation where the request cannot be continued due to domain name interception. Then, when the server returns the HTTP link to the client, it uses the IP address to replace the domain name, that is, replaces the domain name with the IP address, further avoiding possible domain name interception from the server side, preventing the client's subsequent requests from being intercepted by the domain name, and ensuring the smooth progress of subsequent network request processes. It should be pointed out that the server can use a preset intelligent replacement algorithm to replace the domain name with an IP address, that is, according to different network environments and business needs, select the most appropriate IP address to replace the domain name, and improve the success rate of subsequent client network requests.

[0049] In this embodiment, before resending the target IP request to the server, the request data packet corresponding to the target IP request can be encrypted to obtain the encrypted target IP request, and then the encrypted target IP request can be resent to the server so that the server can decrypt the encrypted target IP request and respond to the decrypted target IP request, or the request data packet corresponding to the target IP request can be processed using a preset data format to obtain a processed target IP request, and then the processed target IP request can be resent to the server so that the server can respond to the processed target IP request. It can be understood that for the target parameter that identifies the domain name interception situation, different data formats or encryption methods can be used for transmission to prevent interception and tampering by a third party.

[0050] It can be seen that in the embodiment of the present invention, when the domain name request initiated by the client encounters domain name interception, the client obtains the IP address corresponding to the domain name in the domain name request, and then uses the IP address to re-initiate a request to the server, which can effectively bypass the domain name interception and solve the traditional situation where the request cannot be continued due to the domain name being intercepted. At the same time, when re-requesting to the server, a parameter for identifying the domain name interception situation is added to inform the server that the request has encountered domain name interception. When the server sends the target HTTP link to the client, the original domain name is replaced with the IP address to prevent the client's subsequent requests from being intercepted by the domain name, thereby improving the success rate of the client's request for HTTP content and ensuring the normal operation of the client's business.

[0051] See also Figure 2 , Figure 2 Flowchart of the network request method in the present invention. Figure 2As shown, the network request method according to the embodiment of the present invention is applied to the server, and includes:

[0052] Step S21, receiving a target IP request sent by the client; wherein, the target IP request is a request carrying a target parameter constructed by the client using the IP address to obtain the IP address corresponding to the domain name in the domain name request when the client monitors in real time that a domain name interception occurs in the domain name request initiated by the client to the server; wherein, the target parameter is a parameter used to identify the domain name interception situation.

[0053] Step S22: respond to the target IP request, and replace the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

[0054] For the specific contents of the above steps S21 to S22, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0055] It can be seen that in the embodiment of the present invention, when the domain name request initiated by the client encounters domain name interception, the client obtains the IP address corresponding to the domain name in the domain name request, and then uses the IP address to re-initiate a request to the server, which can effectively bypass the domain name interception and solve the traditional situation where the request cannot be continued due to the domain name being intercepted. At the same time, when re-requesting to the server, a parameter for identifying the domain name interception situation is added to inform the server that the request has encountered domain name interception. When the server sends the target HTTP link to the client, the original domain name is replaced with the IP address to prevent the client's subsequent requests from being intercepted by the domain name, thereby improving the success rate of the client's request for HTTP content and ensuring the normal operation of the client's business.

[0056] For example, see Figure 3As shown, the client sends a domain name request to the server, and the domain name request initiated by the client is intercepted, which means that the domain name request is intercepted, resulting in the server not receiving the domain name request, that is, the client finds that the domain name request fails, and then the client immediately triggers measures to deal with the domain name interception, that is, sends a request to the HTTPDNS server to obtain the IP address corresponding to the domain name, and obtains the IP address corresponding to the domain name returned by the HTTPDNS server. Then, the client uses the obtained IP address to reconstruct the IP request carrying parameters for identifying the interception situation, and re-initiates the IP request to the server. The server receives the IP request with the interception identification parameter sent by the client, processes the request according to the business logic, and processes the HTTP link returned to the client, that is, replaces the domain name in the HTTP link with the IP address, ensuring that the client can successfully obtain the required content. That is, when the domain name request sent by the client to the server is intercepted and causes the request to fail, the technical solution of the present application enables the client to bypass the domain name interception by obtaining the IP address and re-requesting, adding identification parameters and replacing the domain name with the IP address, thereby improving the success rate of the client's network request and ensuring the normal development of the client's related business.

[0057] In one embodiment, if Figure 4 As shown, based on the above network request method, the present invention also provides a network request device, which is applied to a client and includes:

[0058] The domain name resolution request module 11 is used to obtain the IP address corresponding to the domain name in the domain name request when it is detected that the domain name request initiated to the server is intercepted;

[0059] A request construction module 12, used to construct a target IP request carrying a target parameter using the IP address; wherein the target parameter is a parameter used to identify the domain name interception situation;

[0060] The IP request module 13 is used to resend the target IP request to the server so that the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

[0061] For example, a domain name interception monitoring module is set in the client software to monitor in real time whether there is an error in the domain name request initiated by the client. Once an error is detected, the HTTPDNS request module (domain name resolution request module) set in the client software is immediately triggered to send a request to the HTTPDNS server to obtain the IP address corresponding to the domain name in the domain name request. Then, the request construction module set in the client software uses the obtained IP address to reconstruct the request data packet, and adds parameters for identifying the interception situation to the data packet, that is, the request re-initiated by the client to the server carries the parameters for identifying the interception situation. Finally, the IP request module set in the client software re-initiates the request to the server, that is, the interception situation receiving and processing module set in the server receives the IP request with the interception identification parameter sent by the client, records the domain name interception situation according to the parameter, and processes the HTTP link returned to the client, that is, replaces the domain name in the HTTP link with the IP address, to ensure that the client can successfully obtain the required content.

[0062] Figure 5 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may include:

[0063] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0064] When the processor 502 executes the program, the network request method provided in the above embodiment is implemented.

[0065] Furthermore, the terminal further includes:

[0066] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0067] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0068] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0069] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0070] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0071] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0072] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above network request method is implemented.

[0073] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this application. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the claims.

[0074] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0075] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can read instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0076] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA, Programmable Gate Array), a field programmable gate array (FPGA, Field-Programmable Gate Array), etc.

[0077] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A network request method, characterized in that: Applied to a client, the method comprises: When a domain name request initiated to a server is detected to be blocked, an IP address corresponding to the domain name in the domain name request is obtained; Using the IP address to construct a target IP request carrying a target parameter; wherein the target parameter is a parameter used to identify the domain name interception situation; The target IP request is resent to the server so that the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

2. The network request method according to claim 1, characterized in that: The obtaining of the IP address corresponding to the domain name in the domain name request includes: A domain name resolution request is sent to an HTTPDNS server to obtain an IP address returned by the HTTPDNS server and corresponding to the domain name in the domain name request.

3. The network request method according to claim 1, characterized in that: The obtaining of the IP address corresponding to the domain name in the domain name request includes: A domain name resolution request is sent to a private DNS server to obtain an IP address returned by the private DNS server and corresponding to the domain name in the domain name request.

4. The network request method according to claim 1, characterized in that: The step of constructing a target IP request carrying target parameters by using the IP address includes: The corresponding IP request is constructed using the IP address, and a target parameter for identifying the domain name interception situation is added to a request data packet corresponding to the IP request to obtain a target IP request carrying the target parameter.

5. The network request method according to claim 4, characterized in that: Before the target IP request is resent to the server so that the server responds to the target IP request, the method further includes: Encrypting the request data packet corresponding to the target IP request to obtain an encrypted target IP request; Wherein, resending the target IP request to the server so that the server responds to the target IP request includes: The encrypted target IP request is resent to the server so that the server can decrypt the encrypted target IP request and respond to the decrypted target IP request.

6. The network request method according to claim 4, characterized in that: Before the target IP request is resent to the server so that the server responds to the target IP request, the method further includes: Processing the request data packet corresponding to the target IP request using a preset data format to obtain a processed target IP request; Wherein, resending the target IP request to the server so that the server responds to the target IP request includes: The processed target IP request is resent to the server so that the server responds to the processed target IP request.

7. A network request method, characterized in that: Applied to the server, the method includes: Receive a target IP request sent by a client; wherein the target IP request is a request carrying a target parameter constructed by the client using the IP address to obtain the IP address corresponding to the domain name in the domain name request when the client monitors in real time that the domain name request initiated by the client to the server is blocked; wherein the target parameter is a parameter used to identify the domain name blocking situation; Respond to the target IP request, and replace the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

8. A network request device, characterized in that: Applied to a client, the device comprises: A domain name resolution request module is used to obtain an IP address corresponding to the domain name in the domain name request when a domain name interception occurs in the domain name request initiated to the server; A request construction module, used to construct a target IP request carrying a target parameter using the IP address; wherein the target parameter is a parameter used to identify the domain name interception situation; The IP request module is used to resend the target IP request to the server so that the server responds to the target IP request and replaces the domain name of the target HTTP link related to the content required by the client in the request result returned to the client with the IP address.

9. A terminal, characterized in that: include: A memory, a processor, and a network request program stored in the memory and executable on the processor, wherein the network request program, when executed by the processor, implements the steps of the network request method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed to implement the steps of the network request method according to any one of claims 1 to 6.