Access request data processing method and device, computer equipment and storage medium
By dynamically resolving the domain name and updating the target access address in the shared cache, the problem that nginx cannot perceive and update the domain name IP address changes in time is solved, and the stability of the data request process is improved.
Patent Information
- Application Number
- CN202411761683.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-04
AI Technical Summary
In nginx, if a domain name is configured, the domain name needs to be parsed into an IP address when the program starts, and the resolved IP address is continuously used. If the IP address of the domain name changes, nginx will not be sensed and will not be updated accordingly, resulting in the inability to switch the changed server in time, and access failure occurs.
Provides a method of processing access request data, by obtaining access request data and extracting domain name data, and querying the target access address corresponding to the domain name in the shared cache. When the target access address fails, the domain name data is parsed, the new target access address is obtained, and it is added to the shared cache. Finally, the data processing address is determined based on the new target access address and the access request data is sent.
It realizes dynamic domain name resolution during the request stage, obtain dynamic and effective target access address, and share update data between multiple data requests through sharing cache, thereby improving the stability of the entire data processing process.
Smart Images

Figure CN119561930A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer application technology, and in particular to an access request data processing method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] In nginx, if a domain name is configured, it is necessary to resolve the domain name into an IP address when the program starts, and continue to use the resolved IP address. During the subsequent data processing, if the IP address of the domain name changes, nginx will not be aware of it and will not update it accordingly, which will result in failure to switch to the changed server in time. Therefore, access failure will occur when the IP address changes.
[0003] The related technology uses a method of dynamically resolving domain names to solve the above problem. Every time the DNS changes, nginx is restarted. However, this method performs DNS resolution when nginx is started, and will not resolve again within the set TTL expiration time. Only after the expiration time will a DNS resolution request be initiated again to update the resolution result. If the resolution fails, the process startup fails, resulting in a high risk of this method and insufficient stability of the data request process. Summary of the invention
[0004] Based on this, it is necessary to provide an access request data processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can dynamically perform domain name resolution to improve the process stability of data requests in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for processing access request data, comprising:
[0006] Obtain access request data, and extract domain name data corresponding to the access request data;
[0007] Querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests;
[0008] In the case where the target access address is invalid, resolving the domain name data to obtain a new target access address, and adding the new target access address to the shared cache;
[0009] A data processing address is determined according to the new target access address, and the access request data is sent to the data processing address.
[0010] In one embodiment, determining the data processing address according to the new target access address includes:
[0011] Determine a processing address range according to the new target access address;
[0012] Obtaining allocation weight data for each candidate processing address within the processing address range;
[0013] According to the allocation weight data, one of the candidate processing addresses is selected as the data processing address.
[0014] In one embodiment, after selecting one of the candidate processing addresses as the data processing address according to the allocation weight data, the method further includes:
[0015] The allocation weight data is updated according to the selected candidate processing address.
[0016] In one of the embodiments, when the target access address is invalid, parsing the domain name data to obtain a new target access address includes:
[0017] In the case where the target access address fails, acquiring a task lock;
[0018] The domain name data is parsed according to the task lock to obtain a new target access address, and the task lock is released.
[0019] In one of the embodiments, when the target access address fails, after acquiring the task lock, the method further includes:
[0020] In the case where the task lock acquisition fails, continuously querying the update status of the target access address in the shared cache;
[0021] If an updated target access address is found, the updated target access address is obtained, and a data processing address is determined according to the updated target access address, and the access request data is sent to the data processing address.
[0022] In one embodiment, after continuously querying the update status of the target access address in the shared cache, the method further includes:
[0023] In the case that the target access address is not updated, a data processing address is determined according to the current target access address, and the access request data is sent to the data processing address.
[0024] In a second aspect, the present application further provides an access request data processing device, comprising:
[0025] A data acquisition module, used to acquire access request data and extract domain name data corresponding to the access request data;
[0026] An address query module, used to query the target access address corresponding to the domain name data in the shared cache; wherein the shared cache is used to share the target access address between multiple different access requests;
[0027] A domain name resolution module, used for resolving the domain name data to obtain a new target access address when the target access address fails, and adding the new target access address to the shared cache;
[0028] The data processing module is used to determine a data processing address according to the new target access address and send the access request data to the data processing address.
[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0030] Obtain access request data, and extract domain name data corresponding to the access request data;
[0031] Querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests;
[0032] In the case where the target access address is invalid, resolving the domain name data to obtain a new target access address, and adding the new target access address to the shared cache;
[0033] A data processing address is determined according to the new target access address, and the access request data is sent to the data processing address.
[0034] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0035] Obtain access request data, and extract domain name data corresponding to the access request data;
[0036] Querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests;
[0037] In the case where the target access address is invalid, resolving the domain name data to obtain a new target access address, and adding the new target access address to the shared cache;
[0038] A data processing address is determined according to the new target access address, and the access request data is sent to the data processing address.
[0039] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0040] Obtain access request data, and extract domain name data corresponding to the access request data;
[0041] Querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests;
[0042] In the case where the target access address is invalid, resolving the domain name data to obtain a new target access address, and adding the new target access address to the shared cache;
[0043] A data processing address is determined according to the new target access address, and the access request data is sent to the data processing address.
[0044] The access request data processing method, device, computer equipment, storage medium and computer program product obtain access request data, extract domain name data corresponding to the access request data, and query the target access address corresponding to the domain name data according to the resolved information in the current shared cache. The shared cache can share the target access address between multiple different access requests. When the target access address fails, the domain name data is resolved to obtain a new target access address, and the new target access address is added to the shared cache. Subsequent access requests can obtain the updated target access address from the shared cache. Finally, the data processing address is determined according to the new target access address, and the access request data is sent to the data processing address. Domain name resolution can be dynamically performed in the request stage to obtain a dynamically valid target access address, and updated data can be shared between multiple data requests through the shared cache, thereby improving the stability of the entire data processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] FIG1 is an application environment diagram of an access request data processing method according to an embodiment;
[0047] FIG2 is a schematic diagram of a flow chart of a method for processing access request data in one embodiment;
[0048] FIG3 is a flow chart of step S208 of a method for processing access request data in one embodiment;
[0049] FIG4 is a block diagram of a device for processing access request data in one embodiment;
[0050] FIG5 is a diagram showing the internal structure of a computer device in one embodiment;
[0051] FIG. 6 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The access request data processing method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network, and the terminal 102 can be used to receive the instruction corresponding to the access request and send the access request data to the server 104. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The data storage system can be provided with a shared cache unit for storing the domain name data and the corresponding target access address for which the domain name resolution has been completed, and can also be used to store information such as the valid status of the target access address. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0054] In an exemplary embodiment, as shown in FIG2 , a method for processing access request data is provided, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps S202 to S206 . Among them:
[0055] Step S202, obtaining access request data, and extracting domain name data corresponding to the access request data.
[0056] Exemplarily, when a user's access request reaches the server 104 through the terminal 102, the server 104 may receive and parse the data packet of this request, which contains various information about the user's access, including domain name data corresponding to the request.
[0057] Step S204, querying the target access address corresponding to the domain name data in the shared cache.
[0058] The shared cache is used to share the target access address between multiple different access requests.
[0059] For example, when the server 104 receives a user request and extracts the domain name data, it can query the records in the shared cache to quickly obtain the target access address corresponding to the domain name. The shared cache is a mechanism for sharing information between multiple requests, which can improve query efficiency and reduce repeated resolution operations. If the target access address corresponding to the domain name already exists in the shared cache, the server 104 can directly use this address for subsequent operations without having to perform a time-consuming resolution process again.
[0060] Step S206, when the target access address is invalid, the domain name data is parsed to obtain a new target access address, and the new target access address is added to the shared cache.
[0061] Exemplarily, when the target access address fails, the server 104 may acquire the task lock, parse the domain name data according to the task lock, obtain a new target access address, and release the task lock.
[0062] Exemplarily, when the target access address in the shared cache has expired, in order to ensure that the request can be processed normally, the server 104 can start the domain name resolution process and re-acquire the latest target access address. Before performing the resolution, in order to avoid multiple requests resolving the same domain name at the same time, the system will obtain a task lock to ensure that only one process is responsible for resolving the domain name data to prevent waste of resources due to repeated resolution. After obtaining the task lock, the server 104 can start resolving the domain name data to obtain a new target access address. After the resolution is completed, the server 104 can update the new target access address to the shared cache so that subsequent requests can directly use the latest address. Finally, the server 104 can release the task lock to allow other requests to continue normal operation.
[0063] Furthermore, when the task lock acquisition fails, the server 104 can continuously query the update status of the target access address in the shared cache; if an updated target access address is found, the updated target access address is obtained, and the data processing address is determined based on the updated target access address, and the access request data is sent to the data processing address.
[0064] When the server 104 attempts to obtain the task lock to resolve the domain name data, if the lock is not successfully obtained, the server 104 will not stop working, but can continue to query the status of the target access address in the shared cache, and can periodically check whether other processes have completed the domain name resolution and address update tasks. If the updated target access address is found to already exist in the shared cache, the server 104 can immediately obtain the new address. Subsequently, the server 104 can use the updated target access address to determine which data processing server the request should be forwarded to, and quickly send the access request data to the address. This process ensures that even in the case of a task lock competition failure, the server 104 can use the cached data to complete the forwarding of the request, avoiding delays or service interruptions caused by waiting for the task lock.
[0065] Step S208, determining a data processing address according to the new target access address, and sending the access request data to the data processing address.
[0066] Exemplarily, when a valid target access address is obtained, server 104 can determine the data processing address based on the new target access address, thereby determining the data processing server IP, and then send the access request data to the data processing address to complete this access request.
[0067] Furthermore, the server 104 can also determine the data processing address based on the current target access address when the target access address has not been updated, and send the access request data to the data processing address. If the server 104 finds that the target access address in the shared cache has not been updated, and the new address cannot be immediately obtained due to the task lock, the server 104 can still use the target access address in the current cache to process the request. At this time, the server 104 can determine the specific location of the data processing server based on the existing target access address, and send the access request data to the address. In this way, even if the target access address may have begun to expire, the server 104 can still continue to provide services to users to ensure that the request is not interrupted. This approach sacrifices accuracy to a certain extent, but improves the fault tolerance and response speed of the system, and avoids service interruptions or failures caused by address update delays.
[0068] In the access request data processing method described above, the server 104 obtains the access request data, extracts the domain name data corresponding to the access request data, and queries the target access address corresponding to the domain name data according to the resolved information in the current shared cache. The shared cache can share the target access address between multiple different access requests; when the target access address is invalid, the domain name data is resolved to obtain a new target access address, and the new target access address is added to the shared cache. Subsequent access requests can obtain the updated target access address from the shared cache, and finally the data processing address is determined according to the new target access address, and the access request data is sent to the data processing address; the domain name resolution can be dynamically performed in the request stage to obtain a dynamically valid target access address, and the updated data can be shared between multiple data requests through the shared cache, thereby improving the stability of the entire data processing process.
[0069] In an exemplary embodiment, as shown in FIG3 , step S208 includes steps S302 to S306 . Among them:
[0070] Step S302, determining a processing address range according to the new target access address.
[0071] Exemplarily, server 104 can determine the processing address range based on the updated target access address, and server 104 can share the status information of candidate processing addresses between multiple requests: such as IP list, current weight of each IP, number of failures of each IP, current number of connections of each IP, etc.; it can also obtain private status information of candidate processing addresses for each request, such as a list of IPs that have been tried by the request, etc.
[0072] Step S304, obtaining allocation weight data of each candidate processing address within the processing address range.
[0073] Exemplarily, to implement the above process, the server 104 may encapsulate or generate a general balancer object, which stores specific type objects and private state information. Each request has its own balancer object, and the balancer_strategy object in the balancer object is shared by all requests.
[0074] In the balancer object: req_info is used to save the private status information of each request; balancer_strategy points to the specific load balancing algorithm object; find() is used to call balancer_strategy->find(req_info); new(): used to find whether there is a balancer_strategy object in the cache. If there is, the specific algorithm object is used directly. Otherwise, balancer_strategy->new() is called to generate a specific algorithm object and cache the generated specific algorithm object. After initializing the data members, a general balancer object is finally returned.
[0075] In the balaner_strategy object: peers is used to save the algorithm status information shared by all requests, such as data processing server IP information, current weight, etc.; find() is used to implement specific algorithm logic; new(): is used to initialize the algorithm status according to the configuration and return a specific algorithm object. Users do not need to care about the specific algorithm details, they only need to call the new() interface to generate the balancer object, and call the balancer.find() interface to obtain the algorithm selection result. The subsequent developers of specific load balancing algorithms only need to implement the find and new interfaces of the specific algorithm.
[0076] Step S306: selecting a candidate processing address as the data processing address according to the allocation weight data.
[0077] Exemplarily, the server 104 may also update the allocation weight data according to the selected candidate processing address. After each time the server selects a data processing address, it updates the allocation weight data according to the selection result, and uses the weight of the data processing address corresponding to the selection result minus the total weight of all candidate processing addresses as the new allocation weight data, thereby realizing weighted polling of the allocation weights, and making the data processing addresses corresponding to adjacent data access requests more balanced.
[0078] Exemplarily, when the server 104 needs to select a data processing address, a smooth weighted polling algorithm can be used to select according to the weight of the candidate address to ensure a more balanced load distribution. Assume that there are three candidate addresses A, B, and C, with weights of 4, 2, and 1, respectively. In each round of selection, the current weight of each address is increased by its weight, and the address with the highest current weight is selected as the data processing address. After selection, the current weight of the address is subtracted from the sum of the weights of all addresses to smoothly distribute subsequent requests. For example, in the first selection, the weight of A becomes 4, B is 2, and C is 1, so A with the highest weight is selected. At this time, the current weight of A is subtracted from the total weight of 7, becoming -3; then, in the second selection, the weight of A is restored to 1, B and C become 4 and 2 respectively, so B is selected, and the current weight of B is subtracted from the total weight and becomes -3; in the third selection, the weight of A increases to 5, B is -1, and C is 3, so A is selected, and the process is repeated. Finally, according to the weight ratio and algorithm rules, the order of selection is {A, B, A, C, A, B, A}. This algorithm ensures load balancing while avoiding the problem of the same address being selected continuously, which is in line with the weight distribution ratio of each address.
[0079] In another exemplary embodiment, the server 104 obtains access request data and extracts domain name data corresponding to the access request data, thereby querying a target access address corresponding to the domain name data in a shared cache between multiple different access requests.
[0080] In the case where the target access address is invalid, the server 104 acquires the task lock, parses the domain name data according to the task lock, obtains a new target access address, and releases the task lock. In the case where the task lock acquisition fails, the update of the target access address in the shared cache is continuously queried; if an updated target access address is found, the updated target access address is acquired, and the data processing address is determined according to the updated target access address, and the access request data is sent to the data processing address. In the case where the target access address is not updated, the data processing address is determined according to the current target access address, and the access request data is sent to the data processing address.
[0081] Next, the server 104 adds the new target access address to the shared cache and determines the processing address range according to the new target access address. The server 104 obtains the allocation weight data of each candidate processing address within the processing address range; based on the allocation weight data, a candidate processing address is selected as the data processing address, and then the allocation weight data is updated according to the selected candidate processing address to implement weighted polling calculation of the allocation weight data. Finally, the server 104 sends the access request data to the data processing address.
[0082] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0083] Based on the same inventive concept, the embodiment of the present application also provides an access request data processing device for implementing the access request data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more access request data processing device embodiments provided below can refer to the limitations of the access request data processing method above, and will not be repeated here.
[0084] In an exemplary embodiment, as shown in FIG. 4 , an access request data processing device is provided, comprising: a data acquisition module 402 , an address query module 404 , a domain name resolution module 406 and a data processing module 408 , wherein:
[0085] The data acquisition module 402 is used to acquire access request data and extract domain name data corresponding to the access request data;
[0086] The address query module 404 is used to query the target access address corresponding to the domain name data in the shared cache; wherein the shared cache is used to share the target access address between multiple different access requests;
[0087] The domain name resolution module 406 is used to resolve the domain name data when the target access address fails, obtain a new target access address, and add the new target access address to the shared cache;
[0088] The data processing module 408 is used to determine a data processing address according to the new target access address and send the access request data to the data processing address.
[0089] In one embodiment, the data processing module 408 is specifically used to: determine the processing address range according to the new target access address; obtain the allocation weight data of each candidate processing address within the processing address range; and select a candidate processing address as the data processing address according to the allocation weight data.
[0090] In one embodiment, the data processing module 408 is further configured to update the allocation weight data according to the selected candidate processing address.
[0091] In one embodiment, the domain name resolution module 406 includes:
[0092] A task lock acquisition unit, used to acquire the task lock when the target access address fails;
[0093] The domain name resolution unit is used to resolve the domain name data according to the task lock, obtain a new target access address, and release the task lock.
[0094] In one embodiment, when the target access address fails, the domain name resolution module 406 further includes:
[0095] The cache query unit is used to continuously query the update status of the target access address in the shared cache when the task lock acquisition fails; if an updated target access address is found, the updated target access address is obtained, and the data processing address is determined according to the updated target access address, and the access request data is sent to the data processing address.
[0096] In one of the embodiments, the cache query unit is further used to: determine the data processing address according to the current target access address when the target access address is not updated, and send the access request data to the data processing address.
[0097] Each module in the access request data processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0098] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store domain name data and corresponding target access addresses for which domain name resolution has been completed, and can also be used to store information such as the effective status of the target access address. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing access request data is implemented.
[0099] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for processing access request data is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0100] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0101] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining access request data and extracting domain name data corresponding to the access request data; querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests; in the event that the target access address fails, resolving the domain name data to obtain a new target access address, and adding the new target access address to the shared cache; determining a data processing address based on the new target access address, and sending the access request data to the data processing address.
[0102] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the processing address range based on the new target access address; obtaining the allocation weight data of each candidate processing address within the processing address range; and selecting a candidate processing address as the data processing address based on the allocation weight data.
[0103] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: updating the allocation weight data according to the selected candidate processing address.
[0104] In one embodiment, the processor further implements the following steps when executing the computer program: acquiring a task lock when the target access address fails; parsing the domain name data according to the task lock to obtain a new target access address, and releasing the task lock.
[0105] In one embodiment, the processor also implements the following steps when executing the computer program: in the event that the task lock acquisition fails, continuously query the update status of the target access address in the shared cache; if an updated target access address is found, obtain the updated target access address, determine the data processing address based on the updated target access address, and send the access request data to the data processing address.
[0106] In one embodiment, when executing the computer program, the processor further implements the following steps: when the target access address is not updated, determining the data processing address according to the current target access address, and sending the access request data to the data processing address.
[0107] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining access request data, and extracting domain name data corresponding to the access request data; querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests; in the event that the target access address fails, parsing the domain name data, obtaining a new target access address, and adding the new target access address to the shared cache; determining a data processing address based on the new target access address, and sending the access request data to the data processing address.
[0108] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a processing address range based on a new target access address; obtaining allocation weight data for each candidate processing address within the processing address range; and selecting a candidate processing address as a data processing address based on the allocation weight data.
[0109] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: updating the allocation weight data according to the selected candidate processing address.
[0110] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the target access address fails, a task lock is acquired; domain name data is parsed according to the task lock to obtain a new target access address, and the task lock is released.
[0111] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in the event that the task lock acquisition fails, the update status of the target access address in the shared cache is continuously queried; if an updated target access address is found, the updated target access address is obtained, and the data processing address is determined based on the updated target access address, and the access request data is sent to the data processing address.
[0112] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the target access address is not updated, determining the data processing address according to the current target access address, and sending the access request data to the data processing address.
[0113] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: obtaining access request data and extracting domain name data corresponding to the access request data; querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests; in the event that the target access address fails, parsing the domain name data to obtain a new target access address, and adding the new target access address to the shared cache; determining a data processing address based on the new target access address, and sending the access request data to the data processing address.
[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a processing address range based on a new target access address; obtaining allocation weight data for each candidate processing address within the processing address range; and selecting a candidate processing address as a data processing address based on the allocation weight data.
[0115] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: updating the allocation weight data according to the selected candidate processing address.
[0116] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the target access address fails, a task lock is acquired; domain name data is parsed according to the task lock to obtain a new target access address, and the task lock is released.
[0117] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in the event that the task lock acquisition fails, the update status of the target access address in the shared cache is continuously queried; if an updated target access address is found, the updated target access address is obtained, and the data processing address is determined based on the updated target access address, and the access request data is sent to the data processing address.
[0118] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the target access address is not updated, determining the data processing address according to the current target access address, and sending the access request data to the data processing address.
[0119] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0120] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0121] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0122] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing access request data, characterized in that: The method comprises: Obtain access request data, and extract domain name data corresponding to the access request data; Querying a target access address corresponding to the domain name data in a shared cache; wherein the shared cache is used to share the target access address between multiple different access requests; In the case where the target access address is invalid, resolving the domain name data to obtain a new target access address, and adding the new target access address to the shared cache; A data processing address is determined according to the new target access address, and the access request data is sent to the data processing address.
2. The method according to claim 1, characterized in that The step of determining the data processing address according to the new target access address includes: Determine a processing address range according to the new target access address; Obtaining allocation weight data for each candidate processing address within the processing address range; According to the allocation weight data, one of the candidate processing addresses is selected as the data processing address.
3. The method according to claim 2, characterized in that After selecting one of the candidate processing addresses as the data processing address according to the allocation weight data, the method further includes: The allocation weight data is updated according to the selected candidate processing address.
4. The method according to claim 1, characterized in that When the target access address fails, parsing the domain name data to obtain a new target access address includes: In the case where the target access address fails, acquiring a task lock; The domain name data is parsed according to the task lock to obtain a new target access address, and the task lock is released.
5. The method according to claim 4, characterized in that In the case where the target access address fails, after acquiring the task lock, the method further includes: In the case where the task lock acquisition fails, continuously querying the update status of the target access address in the shared cache; If an updated target access address is found, the updated target access address is obtained, and a data processing address is determined according to the updated target access address, and the access request data is sent to the data processing address.
6. The method according to claim 5, characterized in that After the continuously querying the update status of the target access address in the shared cache, the method further includes: In the case that the target access address is not updated, a data processing address is determined according to the current target access address, and the access request data is sent to the data processing address.
7. An access request data processing device, characterized in that: The device comprises: A data acquisition module, used to acquire access request data and extract domain name data corresponding to the access request data; An address query module, used to query the target access address corresponding to the domain name data in the shared cache; wherein the shared cache is used to share the target access address between multiple different access requests; A domain name resolution module, used for resolving the domain name data to obtain a new target access address when the target access address fails, and adding the new target access address to the shared cache; The data processing module is used to determine a data processing address according to the new target access address and send the access request data to the data processing address.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Network request method, device, equipment and storage medium
CN113438336A
Database concurrency control method and device, electronic equipment and storage medium
CN116719832A
Resource access and data processing method and device, electronic equipment and medium
CN117318964A
Domain name resolution method and device, computer equipment and computer readable storage medium
CN118368270A
Data access device, method and system, data processing unit, and network interface card
WO2024045643A1