CN119449806B - Network request method, device, equipment, storage medium and product - Google Patents
Network request method, device, equipment, storage medium and productInfo
- Publication number
- CN119449806B CN119449806B CN202411654084.0A CN202411654084A CN119449806B CN 119449806 B CN119449806 B CN 119449806B CN 202411654084 A CN202411654084 A CN 202411654084A CN 119449806 B CN119449806 B CN 119449806B
- Authority
- CN
- China
- Prior art keywords
- network
- request
- target
- determining
- state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/092—Reinforcement learning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/16—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks using machine learning or artificial intelligence
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/101—Server selection for load balancing based on network conditions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/143—Termination or inactivation of sessions, e.g. event-controlled end of session
- H04L67/145—Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Databases & Information Systems (AREA)
- Medical Informatics (AREA)
- Biomedical Technology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Cardiology (AREA)
- Computer Hardware Design (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a network request method, a device, equipment, a storage medium and a product, which relate to the technical field of cloud computing and disclose the network request method, wherein the network request method comprises the steps of responding to a request transmission instruction, determining request timeout duration based on a multi-dimensional network dynamic index, a reinforcement learning mode and a basic timeout duration corresponding to a current connection network; and performing state monitoring on the target request based on the request timeout duration to determine the transmission state of the target request, and performing resource recovery on the target request when the transmission state is the request timeout state. According to the method, the state of the target request is monitored through the reinforcement learning mode, the multidimensional network dynamic index and the request timeout duration determined by the basic timeout duration, corresponding measures are taken based on the corresponding transmission states, the integrity of data and the continuity of tasks are ensured, and meanwhile reasonable management of resources corresponding to the timeout request is realized.
Description
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a network request method, device, equipment, storage medium, and product.
Background
In the network transmission process of the computing network service, the message sender generally sets the timeout time. After overtime, the sender performs exception handling, including capturing system exception, retry mechanism, etc. The sender's process flow is 1) data transmission and timer starting the timer immediately after the sender sends a data message segment to the responder. To wait for acknowledgement messages (ACK messages) sent by the receiving end. The waiting time from the starting of the timer to the preset time point is the timeout time. 2) Timeout determination and retransmission decision if the sender does not receive the acknowledgement sent by the responder within the set timeout period, the sender may determine that the data packet may be lost or have other errors in network transmission. 3) The data retransmission sender will retransmit the unacknowledged data message and start the timer again to wait for acknowledgement information of the responder. This process may be repeated multiple times until the sender receives acknowledgement from the responder or a preset upper limit for the number of retransmissions is reached. When a timeout retry mechanism is involved, the responder needs to perform anti-retry processing. To sum up, in the prior art, there is no one-stop omnibearing method for timeout management, resource management, network selection, data consistency guarantee and the like in a network request.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present application and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The application mainly aims to provide a network request method, a device, equipment, a storage medium and a product, and aims to solve the technical problem that the prior art cannot reasonably handle the problems of overtime management, resource management and the like in a network request.
In order to achieve the above object, the present application provides a network request method, which includes:
Responding to a request transmission instruction, and determining a request timeout duration based on a multi-dimensional network dynamic index corresponding to a current connection network, a reinforcement learning mode and a basic timeout duration;
Performing state monitoring on a target request based on the request timeout duration, and determining a transmission state of the target request;
and when the transmission state is a request timeout state, recycling resources for the target request.
In an embodiment, the step of determining the request timeout period based on the multi-dimensional network dynamic index, the reinforcement learning mode and the basic timeout period corresponding to the current connected network includes:
Determining target weights corresponding to the network dynamic indexes according to the multi-dimensional network dynamic indexes corresponding to the current connection network and the reinforcement learning mode;
performing parameter calculation according to the target weight corresponding to each network dynamic index and each network dynamic index, and determining a dynamic adjustment factor;
and determining a request timeout period based on the dynamic adjustment factor and the base timeout period.
In an embodiment, the step of determining the target weight corresponding to each network dynamic index according to the multi-dimensional network dynamic index corresponding to the current connected network and the reinforcement learning mode includes:
Determining a state space corresponding to each moment according to a multi-dimensional network dynamic index corresponding to the current connection network and a basic timeout duration;
determining instant rewards of each state space according to the rewards function;
and performing iterative learning according to the state space corresponding to each moment, the instant reward value of each state space and the deep learning network, and determining the target weight corresponding to each network dynamic index according to the iterative learning result.
In an embodiment, after the step of performing state monitoring on the target request based on the request timeout period and determining the transmission state of the target request, the method further includes:
When the transmission state is a normal response state, cache verification data corresponding to the target request is requested from a cache queue;
performing consistency check on the cache verification data and the downstream received data to obtain a data check result;
and deleting the cache verification data in the cache queue when the data verification result is a data consistency result.
In an embodiment, the network request method further includes:
Acquiring a network state of a current connected network;
when the network state is abnormal, acquiring a plurality of performance indexes of each network to be selected;
determining index weights corresponding to the performance indexes according to the task types of the target requests;
inputting each performance index and index weight corresponding to each performance index into a target decision tree model for network evaluation, and determining the network score of each network to be selected;
And determining a target transmission network according to the network scores of the networks to be selected, and transmitting the target request through the target transmission network.
In an embodiment, before the step of inputting each performance index and the index weight corresponding to each performance index into the target decision tree model to perform network evaluation and determining the network score of each network to be selected, the method further includes:
constructing an initial decision tree according to the network information training set;
Determining target splitting characteristics and dynamic characteristic weights in the node splitting process according to the reinforcement learning mode;
Training the initial decision tree according to the target split characteristic and the dynamic characteristic weight to obtain a model to be tested;
And performing performance test on the model to be tested according to the network information test set, and obtaining a target decision tree model according to a performance test result.
In addition, in order to achieve the aim, the application also provides a network request device, which comprises a processing module, a processing module and a processing module, wherein the processing module is used for responding to a request transmission instruction and determining a request timeout duration based on a multi-dimensional network dynamic index, a reinforcement learning mode and a basic timeout duration corresponding to a current connection network;
The monitoring module is used for carrying out state monitoring on the target request based on the request timeout duration and determining the transmission state of the target request;
And the recycling module is used for recycling the resources of the target request when the transmission state is the request overtime state.
In addition, in order to achieve the above object, the application also proposes a network request device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the network request method as described above.
In addition, to achieve the above object, the present application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps of the network request method as described above.
Furthermore, to achieve the above object, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the network request method as described above.
The application provides a network request method, which comprises the steps of responding to a request transmission instruction, determining request timeout duration based on a multi-dimensional network dynamic index corresponding to a current connected network, a reinforcement learning mode and a basic timeout duration, carrying out state monitoring on a target request based on the request timeout duration, determining a transmission state of the target request, and carrying out resource recovery on the target request when the transmission state is the request timeout state. According to the method, the state of the target request is monitored through the reinforcement learning mode, the multidimensional network dynamic index and the request timeout duration determined by the basic timeout duration, corresponding measures are taken based on the corresponding transmission states, the integrity of data and the continuity of tasks are ensured, and meanwhile reasonable management of resources corresponding to the timeout request is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of a network request method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a model structure of a depth Q network DQN according to an embodiment of the application;
FIG. 3 is a flow chart of a second embodiment of a network request method according to the present application;
FIG. 4 is a flow chart of a third embodiment of a network request method according to the present application;
FIG. 5 is a schematic diagram of a target decision tree model according to a third embodiment of the present application;
FIG. 6 is a schematic block diagram of a network request device according to an embodiment of the present application;
Fig. 7 is a schematic device structure diagram of a hardware operating environment related to a network request method in an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the technical solution of the present application and are not intended to limit the present application.
For a better understanding of the technical solution of the present application, the following detailed description will be given with reference to the drawings and the specific embodiments.
The main solution of the embodiment of the application is that the request overtime time is determined based on a multi-dimensional network dynamic index corresponding to the current connection network, a reinforcement learning mode and a basic overtime time in response to a request transmission instruction, the state of a target request is monitored based on the request overtime time, the transmission state of the target request is determined, and when the transmission state is the request overtime state, the resource recovery is carried out on the target request.
In the existing network transmission process of the computing network service, the message sender generally sets the timeout time. After overtime, the sender performs exception handling, including capturing system exception, retry mechanism, etc. The sender's process flow is 1) data transmission and timer starting the timer immediately after the sender sends a data message segment to the responder. To wait for acknowledgement messages (ACK messages) sent by the receiving end. The waiting time from the starting of the timer to the preset time point is the timeout time. 2) Timeout determination and retransmission decision if the sender does not receive the acknowledgement sent by the responder within the set timeout period, the sender may determine that the data packet may be lost or have other errors in network transmission. 3) The data retransmission sender will retransmit the unacknowledged data message and start the timer again to wait for acknowledgement information of the responder. This process may be repeated multiple times until the sender receives acknowledgement from the responder or a preset upper limit for the number of retransmissions is reached. When a timeout retry mechanism is involved, the responder needs to perform anti-retry processing. To sum up, in the prior art, there is no one-stop omnibearing method for timeout management, resource management, network selection, data consistency guarantee and the like in a network request.
In the prior art, the timeout time setting between the upstream system and the downstream system lacks an automatic synchronization mechanism, which causes that the timeout time is asynchronous and may cause data loss or transmission delay, the prior art mainly depends on a retry mechanism of a sender when the network is overtime or abnormal, thereby increasing network load and possibly causing system errors, the prior art generally needs additional mechanisms, such as periodical data comparison or compensation measures of a service logic layer, thereby increasing system complexity, and the prior art generally depends on manual intervention or simple retry logic and lacks intelligent network selection and quick recovery mechanism when the network is in fault or unstable.
The intelligent network is a highly integrated and intelligent network system, which combines advanced computing resources and network technology to provide efficient, flexible and safe computing services for users. The network realizes the deep fusion of computing power and network products through integrated arrangement and intelligent scheduling. Based on the characteristics of task type, large concurrency, real-time performance and the like of the computing network product, the computing network has high requirements on timeliness, stability and correctness of the network.
The application ensures the high efficiency and accuracy of network service from each node before, during and after the network request occurs in four aspects of automatic coordination of network transmission time limit, network resource source management, network anomaly intelligent selection network and data strong consistency guarantee.
According to the application, the state of the target request is monitored by the reinforcement learning mode, the multidimensional network dynamic index and the request timeout duration determined by the basic timeout duration, corresponding measures are taken based on the corresponding transmission state, the data integrity and the task continuity are ensured, and the reasonable management of resources corresponding to the timeout request is realized.
It should be noted that, the execution body of the embodiment may be a computing service device having functions of data processing, network communication and program running, such as a tablet computer, a personal computer, a mobile phone, or an electronic device, a network request device, or the like capable of implementing the above functions. The present embodiment and the following embodiments will be described below by taking a network request device as an example.
Based on this, an embodiment of the present application provides a network request method, and referring to fig. 1, fig. 1 is a flowchart of a first embodiment of the network request method of the present application.
In this embodiment, the network request method includes steps S10 to S30:
Step S10, responding to the request transmission instruction, and determining the request timeout duration based on the multi-dimensional network dynamic index corresponding to the current connection network, the reinforcement learning mode and the basic timeout duration.
It should be noted that, the multidimensional network dynamic indexes corresponding to the current connection network include, but are not limited to, indexes such as network status, system load, traffic, and the like. In this embodiment, the network status (NC) can be measured by Packet Loss Rate (PLR). The System Load (SL) may be measured by the CPU Utilization (CPUU). Traffic (BV) may be measured in terms of Request Rate (RR).
It will be appreciated that the base timeout period is set by the relevant upstream and downstream system technicians based on the primary requirements of the upstream and downstream systems and preliminary evaluations of the network environment. This duration is typically based on empirical or default values. For example, in a network computing task type product ticket synchronization scenario, the real-time performance requirement of a conversation ticket between an upstream system and a downstream system is high, the network bandwidth between the upstream system and the downstream system reaches gigabit, and the basic timeout duration is set to be 100ms.
It will be appreciated that in this embodiment, each network dynamic indicator is assigned a dynamic weight (W) to reflect the relative importance of each factor in calculating the adjustment factor. The dynamic adjustment factors can be calculated through the multi-dimensional network dynamic indexes and the corresponding dynamic weights, and the calculation method of the dynamic adjustment factors is a weighted average method, wherein the indexes and the weights are normalized or standardized in proper units or proportions. Specifically, the calculation formula of the dynamic adjustment factor is as follows, daf= (W NC×PLR+WSL×CPUU+WBV×RR)/(WNC+WSL+WBV). Wherein PLR represents packet loss rate, CPUU represents CPU usage, BV represents traffic, W NC represents network status weight, W SL represents system load weight, and W BV represents traffic weight. In this embodiment, in calculating the dynamic adjustment factor using the weighted average method, each index weight is determined by reinforcement learning (e.g., deep Q network DQN). Deep Q-Network (DQN) is an algorithm that combines Q learning (a reinforcement learning method) and Deep learning techniques.
In a specific implementation, the basic timeout period and the dynamic adjustment factor are combined, and the request timeout period is calculated, wherein the request timeout period=the basic timeout period (BaseTimeout) ×the Dynamic Adjustment Factor (DAF). In this embodiment, the request timeout period may be automatically updated according to the frequency set by dynamically adjusting the request timeout period. As in the example above, the base timeout period=100 ms, the dynamic adjustment factor=0.585. Request timeout period = 58.5ms.
It should be noted that the adjustment frequency of the request timeout period depends on the stability requirement of the system and the update frequency of the monitoring data. When the stability requirement of the system is high, the adjustment frequency is appropriately reduced. And the adjustment frequency is required to be lower than the update frequency of the monitoring data. In the network computing task type product ticket synchronization scene, the update frequency of the monitoring data of the index is 10ms, and the real-time performance requirement of the service on the system is higher than the stability, so that the frequency of the automatic update request timeout duration is set to be 1s.
It can be understood that when the set request timeout duration is adjusted, the latest request timeout duration is synchronized to the upstream and downstream in time, so as to ensure the real-time effectiveness of the request timeout duration and the consistency of the upstream and downstream timeout durations, and ensure that a responder timely responds to a sender in the network transmission process, so as to avoid data loss or transmission delay caused by asynchronous timeout time. And when the data of the upstream system are synchronized, the request timeout duration is used as a parameter to be transmitted to the downstream system. Synchronization is achieved, for example, by HTTP headers, query parameters, message bodies, or other mechanisms in the API request. If the upstream and downstream systems use the same configuration data, the downstream service may also directly obtain the same request timeout period configuration from the common configuration data.
In one possible implementation, step S10 may include steps a11 to a13:
and step A11, determining the target weight corresponding to each network dynamic index according to the multi-dimensional network dynamic index corresponding to the current connected network and the reinforcement learning mode.
It should be noted that, the reinforcement learning method will combine the multidimensional network dynamic indexes and the basic timeout duration to calculate the target weights corresponding to the network dynamic indexes.
And step A12, calculating parameters according to the target weight corresponding to each network dynamic index and each network dynamic index, and determining a dynamic adjustment factor.
And step A13, determining a request timeout duration based on the dynamic adjustment factor and the basic timeout duration.
In this embodiment, the dynamic adjustment factor is calculated based on average monitoring data of indexes such as network delay, packet loss rate, CPU usage rate, memory occupancy rate, request rate and the like in approximately 5 minutes, and the calculation method of the dynamic adjustment factor is a weighted average method, wherein the indexes and weights are normalized or standardized in an appropriate unit or proportion. Specifically, the calculation formula of the dynamic adjustment factor is as follows, daf= (W NC×PLR+WSL×CPUU+WBV×RR)/(WNC+WSL+WBV). The base timeout period and the dynamic adjustment factor are combined to calculate the request timeout period, the request timeout period=the base timeout period (BaseTimeout) ×the Dynamic Adjustment Factor (DAF).
In one possible implementation, the step A11 may include steps B11 to B13:
And step B11, determining a state space corresponding to each moment according to the multidimensional network dynamic index corresponding to the current connection network and the basic timeout duration.
It should be noted that, a state space S is defined, where the state space S includes, but is not limited to, indexes such as network delay, packet loss rate, CPU utilization, memory occupancy rate, request rate, and a current basic timeout period setting. These states reflect real-time conditions of network and system operation.
And step B12, determining the instant rewards of each state space according to the rewards function.
It should be noted that, a reward function is constructed, and the function can evaluate the effect of each action according to comprehensive indexes such as success rate, response time, resource utilization rate, system stability and the like of the network request. For example, adjustments that successfully transfer data and maintain low latency and low resource consumption may be rewarded positively, while actions that cause retransmissions or system anomalies may be penalized negatively. In particular, the bonus function may be expressed as r=w 1×S+w2×(-L)+w3×(-Rr)+w4×RU+w5 ×c. Where R represents a total prize value, S represents a data transmission success rate (a scale value between 0 and 1), w 1 represents a weight of S, L represents an average network delay (in milliseconds), w 2 represents a weight of L, rr represents a requested retry rate (a scale value between 0 and 1), w 3 represents a weight of R r, RU represents a resource utilization, w 4 represents a weight of RU, C represents a data consistency ratio (a scale value close to 1) represents good data consistency, and w 5 represents a weight of C. In this embodiment, w 1、w2、w3、w4、w5 needs to be adjusted based on empirical values according to actual service requirements and system characteristics. For example, if the immediacy of data transfer is critical, the value of w 2 can be increased to enhance the preference for low latency, and if data consistency is the core of the traffic, the weight of w 5 can be increased.
It will be appreciated that the instantaneous prize value for the state space at each instant in time may be determined from the prize function.
And step B13, performing iterative learning according to the state space corresponding to each moment, the instant reward value of each state space and the deep learning network, and determining the target weight corresponding to each network dynamic index according to the iterative learning result.
Note that, in the present embodiment, the deep learning network is a deep Q network DQN, and the structure thereof is shown in fig. 2. In the present embodiment, an action space a is defined, and actions are defined to adjust the weight allocation of each index, for example, change the values of W NC (network condition weight), W SL (system load weight), and W BV (traffic weight). A deep neural network DNN in a deep Q network DQN is defined and built that accepts S as input, outputting the expected return (i.e., Q value) for each possible action a.
It will be appreciated that an experience pool is created for storing information for each interaction, including the t-time state S t of the state space, the take action A t of the action space, the instant prize obtained R t+1, and the new state S t+1 at time t+1. And randomly extracting a batch of samples from the information of each interaction stored in the experience pool for training, and updating network parameters according to a Bellman equation to enable the Q value of network prediction to gradually approach to a true value, namely Q (S t,At)←Rt+1+γmax a′Q(St+1,a';θ-). Where Q (S t,At) represents the current estimated Q value of performing action a t in state S t. the Q value represents the expected value of the return that may be obtained in the future after taking a particular action in a given state. R t+1 represents the instant prize received at the next time step t+1 after action a t is performed at state S t. The rewards may be positive (indicating good results) or negative (indicating bad results). Gamma represents a discount factor, which is a constant between 0 and 1, for reducing the impact of future rewards, which can be adjusted according to empirical values. The discount factor reflects the tradeoff between instant rewards and future potential rewards. A higher gamma value means that the algorithm pays more attention to the long-term rewards. max a 'is an operator indicating that for the next state S t+1, the corresponding optimal action a' is selected that yields the highest Q value. I.e., selecting the optimal action in the next state, i.e., the action that appears to most likely result in the largest jackpot. Q (S t+1,a′;θ-) is the Q value predicted by the target network when the optimal action a' is performed in the next state S t+1. Firstly, finding out the optimal action a' in the next state S t+1, then calculating the Q value corresponding to the action, and finally discounting the Q value by using a discount factor gamma, thereby obtaining the discount estimation of the future rewards. This compromised future prize, plus the instant prize R t+1, constitutes the target Q value, i.e., the value that the network is attempting to predict. θ - represents a target network parameter for stable learning.
In a specific implementation, the dynamic adjustment of the index weight based on reinforcement learning is illustrated by an initial state that is network state s= [50ms,0.5] (50 ms represents network delay time, 0.5 represents packet loss rate). Action selection assuming three preset weight configurations a 1=[0.4,0.3,0.3],A2=[0.3,0.4,0.3],A3 = [0.3,0.3,0.4] representing different W NC,WSL,WBV allocations, respectively. DQN decision the DQN model predicts the Q value for each configuration based on the current state S and selects the action with the highest Q value, for example, assuming the action with the highest Q value is action A1, which represents more important network conditions. The act is performed in that the system adjusts the network request policy according to A1, such as prioritizing the low delay path. Rewarding feedback if the data transmission is successful and the delay is low, the DQN model receives the forward rewarding, and the strategy of selecting A 1 is strengthened. Iterative learning, namely, through multiple iterations, the DQN model is continuously adjusted according to feedback of each decision, and the optimal weight configuration mode under different network conditions is learned. Through the process, the optimal weight distribution strategy of different network environments can be automatically found and adapted through the deep Q network DQN, so that the deep Q network DQN and a weighted average method are combined, and the success rate of network requests and the efficiency of the whole system are improved.
It should be noted that, in a network task type product ticket synchronization scenario, the real-time monitoring data of the index (all the data are 5 minutes average values) includes a network condition index, a Packet Loss Rate (PLR) =0.05, a system load index, a traffic index, a Request Rate (RR) =0.9, and if the traffic estimated by the initial experience value is 10000 pens/second, the real-time monitoring finds that the traffic is 9000 pens/second, and the traffic index is normalized to 0.9. Further, the respective weights determined by the deep Q network DQN are as follows: network condition dynamic weight wnc=0.3, system load dynamic weight wsl=0.4, traffic dynamic weight wbv=0.3, and the sum of all index weights is 1. Thus, the result of the dynamic adjustment factor calculation is 0.05x0.3+0.75x0.4+0.9x0.3=0.585 using the method of weighted average sum and depth Q network DQN described previously.
And step S20, performing state monitoring on the target request based on the request timeout duration, and determining the transmission state of the target request.
It should be noted that, all the issued requests are monitored in real time, and unique identifiers (such as request IDs) are created for all the requests, and a timer is set, which corresponds to the timeout time of the requests. And records the related information of the request, including the information of the request initiating time, the target address, the request type, the identifier, the timer and the like. After the timer is started, the system starts to count. During the timer running, the system will constantly monitor the status of the request. In this embodiment, the transmission status of the target request is worth the status of the request monitored by the four systems.
And step S30, when the transmission state is a request overtime state, recovering resources of the target request.
It should be noted that if the target request completes successfully (e.g., a response from the server is received) before the timer expires, the system will cancel the timer and remove the relevant information of the network request from the request management table. If the system monitors that the timer expires, the request is not completed yet, the system judges that the request is overtime, and determines the transmission state of the target request as the request overtime state. At this point, the system triggers a callback function that is responsible for performing subsequent request reclamation operations.
It can be appreciated that executing the callback function, the system automatically closes the network connection associated with the target request, and releases the associated socket, memory buffer, and other resources. And putting the recovered resources into a resource pool for reuse by subsequent requests. After the reclamation is completed, the system removes the requested relevant information from the request information record. In this embodiment, the timer and self-management of network resources are implemented by the specific method illustrated by defining a RequestManager class to manage the network requests and timers. When a request is added, a Timer object (Timer) is created and the on_timeout () method is used as a function to be called when the Timer expires. When the timer expires, the request is removed from the request management table and an on_timeout_callback () callback function is called to recover the resource.
In a specific implementation, to implement and optimize network resource management, this embodiment further includes the operations of 1) introducing locks (locks) to secure shared resources, ensuring that requests and timers are operated safely in a multi-threaded environment, 2) providing a cancel_request method that allows timers to be manually cancelled and resources to be released when a request is completed or needs to terminate prematurely, 3) using a Queue to manage timer threads, facilitating control and tracking of all active timers, 4) facilitating future additions of more processing logic such as logging, status updates, etc., by encapsulating timeout processing logic in an internal method_handle_timeout, 5) adding wait_for_all_timers method, ensuring that all timers can be properly handled before a program exits, and avoiding resource leakage. The stable connection is continuously and autonomously reinforced. If the time-out occurs in the network transmission, detecting network abnormality, automatically judging to automatically reconnect and request retry, so as to ensure the smooth proceeding of data transmission, and recovering to a normal state after the network failure is recovered.
It should be noted that, the network monitoring tools (such as SolarWinds Network Performance Monitor, zabbix, nagios, etc.) are used to monitor the network status in real time, including the establishment and disconnection of network connection and the abnormal situation of data transmission. When a network connection disconnection or data transmission abnormality is detected, a reconnection retry mechanism is triggered. Automatic reconnection operation, automatically attempting to reestablish network connection after reconnection is triggered. A heartbeat detection mechanism is introduced to periodically send heartbeat packets to detect the validity of the network connection. When the heartbeat detection fails, a reconnection retry mechanism is triggered in advance, so that service interruption is avoided. Reasonable retry times and intervals are set to avoid resource waste and performance degradation caused by frequent retries. The initial retry interval may be set to a shorter time, and gradually extended as the number of retries increases, to achieve a smooth backoff mechanism. The latency between each retry is doubled by a simple back-off strategy, but the set maximum latency is not exceeded. To reduce frequent retries when the network is temporarily unstable.
In this embodiment, parameters such as the retry number, interval, and backoff algorithm may be dynamically adjusted according to the importance of the service, the change of the network condition, or the upstream synchronization timeout time. In the above network computing task type product ticket synchronization scenario, the requirements on the correctness and instantaneity of the data are high, so the maximum retry number is set to be relatively large, the initial retry time is set to be 1000ms, the interval time of each retry is adjusted to be 500ms each time, and the maximum interval time is 2000ms.
The embodiment provides a network request method, which comprises the steps of responding to a request transmission instruction, determining request timeout duration based on a multi-dimensional network dynamic index corresponding to a current connected network, a reinforcement learning mode and a basic timeout duration, monitoring a target request based on the request timeout duration, determining a transmission state of the target request, and recovering resources of the target request when the transmission state is the request timeout state. According to the method, the state of the target request is monitored through the reinforcement learning mode, the multidimensional network dynamic index and the request timeout duration determined by the basic timeout duration, corresponding measures are taken based on the corresponding transmission states, the integrity of data and the continuity of tasks are ensured, and meanwhile reasonable management of resources corresponding to the timeout request is realized.
In the second embodiment of the present application, the same or similar content as in the first embodiment of the present application may be referred to the above description, and will not be repeated. On this basis, referring to fig. 3, after step S30, the network request method further includes steps S31 to S33:
Step S31, when the transmission state is a normal response state, the buffer verification data corresponding to the target request is requested from the buffer queue.
It should be noted that, the upstream system data, the data nodes, the data hash values and the like are cached, so that when the upstream system data and the downstream system data are inconsistent, the data related information is quickly obtained from the cache queue, and the timely synchronization of the data is completed. In this embodiment, redis cache is adopted, and other manners may be adopted, which is not limited in this embodiment. The cache verification data refers to the cached upstream system data, data nodes, data hash values and other relevant information.
It can be appreciated that when the responder successfully receives the target request and receives the response, the transmission state is determined to be a normal response state, and the cache verification data is obtained from the cache queue.
And step S32, carrying out consistency check on the cache verification data and the downstream received data to obtain a data check result.
And step S33, deleting the cache verification data in the cache queue when the data verification result is a consistent result.
When the data is the same as the data check result, deleting the cache verification data in the cache queue after the upstream processing is finished; if the data verification result is a data inconsistency result, feeding back upstream working, and synchronizing the cache verification data to the downstream again.
It can be understood that in addition to the above-mentioned introduction of the caching mechanism, the embodiment introduces a transaction record-consistency check, a strong check mechanism and a data comparison mechanism, where the transaction record consistency check specifically records each data synchronization of the upstream system and generates a transaction log. And each transaction is assigned a unique transaction ID to facilitate tracking and locating problems. And after receiving the data, the downstream system performs consistency check on the data according to the information in the transaction log. This includes checking the source of the data, the timestamp, the transaction ID, etc., to ensure that the data is consistent with the transaction records of the upstream system.
In the specific implementation, the strong verification mechanism specifically includes that when data is transmitted from an upstream system to a downstream system, data interception is carried out, and strong verification of the data is carried out so as to ensure the integrity and accuracy of the data. The verification comprises data integrity verification, a hash algorithm is used for generating a unique hash value of each piece of data, and the transmitted data is verified, so that the data is ensured not to be tampered or damaged in the transmission process. And checking the data format, and checking whether the format and the range of the data accord with expectations, including the data type, the field length, the coding mode, the value range and the like. And checking the business logic, namely checking the data according to specific business logic and rules, and ensuring the consistency of business meanings of the data. And when the verification fails, the system feeds back abnormal information to the upstream system, and the upstream system is required to synchronize data again. If the price and the product are required to be matched in the process of synchronizing the multi-vector data of the computing network, the system finds that the price and the product of the synchronous data are not matched when receiving the data, the abnormal information of the upstream system is directly fed back, and the upstream system is required to synchronize the correct data again.
It should be noted that the data comparison mechanism specifically includes checking whether there is a difference by comparing the same data in the upstream and downstream systems. In this embodiment, this may be accomplished by writing a script or using a special alignment tool. In order to improve the efficiency and the safety of data comparison, a hash function is adopted in the embodiment to complete the data comparison. The hash function used is hash function SHA256. And carrying out hash calculation on the data to be compared in the upstream and downstream directions to obtain an output value (hash value) of a fixed length of each data block, and comparing whether the hash values of the same data block in different data sources are consistent. If the hash values are the same, the corresponding data blocks are considered to be consistent, and if the hash values are different, the data blocks are considered to be inconsistent.
The embodiment provides a network request method, which comprises the steps of obtaining a data verification result by carrying out consistency verification on cache verification data and downstream received data from a cache queue corresponding to a target request when the transmission state is a normal response state, and deleting the cache verification data in the cache queue when the data verification result is a data consistency result. Through an effective data synchronization and consistency check mechanism, the consistency of upstream and downstream data in the computing power network is ensured, so that the correct execution of computing tasks and the accuracy of results are ensured.
In the third embodiment of the present application, the same or similar contents as those of the first and second embodiments of the present application can be referred to the description above, and the description thereof will not be repeated. On this basis, referring to fig. 4, in step S40, the network request method further includes steps S01 to S05:
Step S01, obtaining the network state of the current connection network.
It should be noted that, in this embodiment, the network monitoring tool (such as SolarWinds Network Performance Monitor, zabbix, nagios, etc.) may be used to monitor the network state in real time, or the network state of the current connected network may be obtained through the heartbeat detection mechanism.
Step S02, when the network state is abnormal, a plurality of performance indexes of each network to be selected are obtained.
It should be noted that, in the multi-network environment, when the network state of the current connected network is an abnormal state such as network oscillation, a plurality of performance indexes of other networks to be selected are obtained. In this embodiment, the performance index includes, but is not limited to, bandwidth, delay, packet loss rate, availability.
And S03, determining index weights corresponding to the performance indexes according to the task types of the target requests.
When the task type of the target request is required to be described, determining the index weight corresponding to each performance index. In this embodiment, for applications requiring low latency and high reliability (e.g., online gaming or video conferencing), the latency and packet loss rate may be weighted higher. While bandwidth and availability may be more important for applications with large data transfers (such as file synchronization or backup). For example, in the above network computing task type product ticket synchronization scenario, the requirements on the correctness and instantaneity of the data are higher, and the weights of the delay and the packet loss rate are set to 0.4 and 0.3 in actual setting. The weight of bandwidth and availability is set to 0.1.
And S04, inputting each performance index and index weight corresponding to each performance index into a target decision tree model for network evaluation, and determining the network score of each network to be selected.
It should be noted that, a target decision tree model is constructed through a decision tree algorithm, each performance index and the index weight corresponding to each performance index are input into the target decision tree model to calculate the network score of each network to be selected. In this embodiment, the target decision tree model has the advantage of simplicity and easiness in understanding that the decision tree model is composed of nodes and branches, each node represents a test of a feature, understanding and explaining are easy, and the working principle of the target decision tree model can be understood without deep mathematical background. The method has low calculation complexity, and the prediction process of the decision tree model only needs simple calculation from the root node to the leaf node along the tree structure, so that the calculation complexity is relatively low, and the method is suitable for lightweight equipment or real-time application scenes. Efficient training the training process of the decision tree model usually does not need iterative optimization, but builds a tree structure by recursively splitting the data set, and the training efficiency is high.
The model provided by the embodiment can obviously reduce the consumption of computing resources and improve the efficiency and the practicability of the model on the premise of ensuring the accuracy of network selection. The target decision tree model consists of nodes and branches, each node represents a test of a feature, each branch represents a path of a test result, and the final leaf node represents a classification or regression result, and the model structure is shown in fig. 5. The input to the target decision tree model (such as the tree root shown in fig. 5) includes various network performance metrics such as delay, bandwidth, packet loss rate, etc., and metric weights corresponding to each performance metric. The middle tier outputs that each node (feature 1/2/3/4/5/6 as shown in fig. 5) splits according to a particular feature (threshold as shown in fig. 5) and outputs a decision path. The output layer outputs the predicted result of the network score or rank, which is a real value or classification result, by the output layer (green node as shown in fig. 5).
It should be noted that, for ease of understanding, the network evaluation process will be illustrated by the following examples, where the network 1 has a packet loss rate of 0.5%, an available bandwidth of 15Mbps, a maximum bandwidth of 25Mbps, a unit cost of 0.18 yuan/M, a delay of 50ms, and a jitter of 5, and is converted into a numerical form of 0.5 packet loss rate, an available bandwidth of 15, a maximum bandwidth of 25s, a unit cost of 0.18, a delay of 50, and a jitter of 5, and the network 2 has a packet loss rate of 0.5%, an available bandwidth of 10Mbps, a maximum bandwidth of 20Mbps, a unit cost of 0.14 yuan/M, a delay of 100ms, and a jitter of 6, and is converted into a numerical form of 0.5 packet loss rate, an available bandwidth of 10, a maximum bandwidth of 20, a unit cost of 0.14, a delay of 100, and a jitter of 6. The model comprises an input layer and a data processing layer, wherein the input layer comprises 6 characteristics including packet loss rate, available bandwidth, maximum bandwidth, unit cost, delay and jitter. The decision node, for example, the first node may test the packet loss rate, and if the packet loss rate is less than or equal to a certain threshold (0.5), then enter the next node. And the output layer is used for outputting the score or classification result of the network by the leaf nodes. For example, the input data is the characteristic value of the network 1 [0.5,15,25,0.18,50,5]. And the decision process is that the first node tests the packet loss rate to be 0.5 percent, which is less than or equal to the threshold value to be 0.5 percent, and enters the next node. The second node tests the available bandwidth 15, greater than the threshold 10, to enter the next node. And the third node tests the maximum bandwidth to be 25, is greater than the threshold value 25, and outputs a final result, wherein the score is 95 minutes. Similarly, the data of network 2 is subjected to the same decision process, and the score thereof is output, namely the input data is the characteristic value of network 2: [0.5,10,20,0.14,100,6]. And the decision process is that the first node tests the packet loss rate to be 0.5 percent, which is less than or equal to the threshold value to be 0.5 percent, and enters the next node. The second node tests the available bandwidth to 10, which is less than or equal to the threshold 10, and enters the next node. And the third node tests the unit cost to be 0.14, which is less than or equal to the threshold value of 0.15, and enters the next node. And the available bandwidth is tested by the first node and is 10, which is less than or equal to the threshold value 10, and the final result is output, and the score is 85 points.
In one possible implementation, step S04 may include steps C11 to C14:
And step C11, constructing an initial decision tree according to the network information training set.
It should be noted that, the collected network information is used as a sample set, and a certain proportion is selected according to the requirement to be divided into a network information training set and a network information testing set, and in this embodiment, cross-validation, a leave-out method and other modes can be adopted.
It will be appreciated that the initial decision tree is constructed using a training set of network information.
And step C12, determining target splitting characteristics and dynamic characteristic weights in the node splitting process according to the reinforcement learning mode.
It can be appreciated that in this embodiment, the method of reinforcement learning is introduced to dynamically adjust the weight of the initial decision tree, which specifically includes 1, in the preprocessing stage of decision tree construction, dynamically evaluating the importance of the features (such as packet loss rate, available bandwidth, maximum bandwidth, unit cost, delay, jitter, etc.) by using reinforcement learning algorithm (such as DQN). The DQN learns which features are most critical to decision under different network conditions through interaction with the environment, so that the dependence degree of a decision tree on the features in construction is automatically adjusted, and corresponding dynamic feature weights are determined. 2. The decision tree growth process is decided in conjunction with reinforcement learning strategies, such as when each node of the tree splits, instead of just based on the static threshold of the current feature, the optimal target splitting feature and splitting point are selected according to the strategy of DQN output. In this way, the decision tree is able to "intelligently" select the best path based on real-time changes in network state.
And step C13, training the initial decision tree according to the target split characteristic and the dynamic characteristic weight to obtain a model to be tested.
It should be noted that, training the initial decision tree according to the target splitting feature and the dynamic feature weight information until reaching a preset maximum depth or the number of samples contained in the leaf node is insufficient to continue splitting, so as to obtain the model to be tested.
And step C14, performing performance test on the model to be tested according to the network information test set, and obtaining a target decision tree model according to a performance test result.
It should be noted that, the network information test set is used to test the trained model to be tested, and indexes such as accuracy (the ratio of the number of samples correctly classified by the model to the total number of samples), precision (the ratio of the samples predicted to be the positive examples in the samples truly being the positive examples), recall (the ratio of the samples predicted to be the positive examples in all the positive examples) and the like are generally adopted to evaluate the performance of the model, so as to obtain the corresponding performance test result. If the model reaches the preset performance index (such as the accuracy rate is more than 90%) on the test set, the performance test result is that the model test passes, and the model test result can be used in the actual network selection task, so that the target decision tree model is obtained.
It can be understood that in this embodiment, the target decision tree model may be further adjusted by 1 forming an integrated learning system by combining multiple machine learning models, such as fusing decision tree with neural network (e.g. lightweight RNN or LSTM for time series prediction), support Vector Machine (SVM), etc., integrating the prediction results of different models by an integrated learning algorithm (e.g. Stacking), to improve the prediction accuracy and stability, by using Stacking as an integrated learning method to integrate decision tree with LSTM and SVM, by 1.1 basic model training, independently training decision tree, support Vector Machine (SVM), etc, LSTM and SVM models, and as a first layer model. 1.2 training of the second layer model taking the output of the first layer model as new features, training a meta model (e.g. logistic regression, random forest) to combine predictions of these models. The goal of the metamodel is to learn how to optimally combine the outputs of the individual base models to improve overall predictive performance. For the network selection problem, the meta-model may be a regression model that predicts the score or probability for each network and then selects the highest scoring network. Illustratively, the embodiment uses logistic regression as a meta-model, and describes the structure of the logistic regression model by using the input layer, namely, the output of the first layer model (decision tree, LSTM, SVM) as a new feature to be input into the logistic regression model. Assuming that each first layer model outputs a predictive probability or class label, the input dimension of the metamodel will be 3 (if the three models each output a value). Logistic regression is essentially a linear model plus sigmoid function transformation to solve the classification problem. The method is characterized in that input features are linearly combined through learning a set of weight parameters, and then the input features are converted into probability prediction through an activation function. The logistic regression model needs to build a linear model, i.e. assuming a linear relationship between the output y and the input feature x. If the input features are represented as a vector x= [ x1, x2, ], xn ], where n is the number of features, the logistic regression model attempts to learn a set of weight parameters w= [ w1, w2, ], wn ] and an intercept term b to form a linear combination of z = w0+w1x1+w2x2+ & wnxn where z is the output of the model. and the output layer outputs a probability value between 0 and 1 to represent the probability of belonging to the positive class. The probability may be converted into a class prediction based on the threshold of the application scenario (typically 0.5). 1.3 training with logistic regression as meta-model, specifically it may include 1.3.1) integrating the output of the first layer model, where decision tree, LSTM and SVM models are required to integrate the predicted output of the same dataset. These outputs may be continuous scores, probabilities or class labels (which, if a classification task, need to be converted into a numerical form). It is assumed that each model outputs a value, the integrated feature vector will have three elements, 1.3.2 segments the integrated dataset according to a certain ratio (e.g., 70% training set, 30% test set), 1.3.3 trains the logistic regression model using training set data, during training, the model learns a weight vector, which will map the output of the first layer model to the final prediction result, 1.3.4 uses the test set to test the model, and simultaneously adopts indexes such as accuracy, precision, recall rate, etc. to evaluate the test performance of the model. 1.4 prediction and decision, namely, for new network performance data, firstly, respectively obtaining prediction results through a decision tree, an LSTM and an SVM model, then taking the results as input, and finally, determining the optimal network selection through meta-model comprehensive analysis.
In a specific implementation, the model adjustment mode further comprises 2, introducing Deep Reinforcement Learning (DRL) on model training and selection strategies, so that the model can dynamically adjust the network selection strategies according to feedback (such as transmission speed and stability indexes) self-optimization decision logic of actual network selection, and learn optimal selection paths under different conditions. 3. And adding context information such as user position, time, network use habit and the like into the decision tree model, so that the model can make more personalized network selection according to specific conditions of users and environments, and user experience is improved. 4. Future network conditions are predicted by using a time series prediction technology (such as ARIMA, prophet or LSTM), and a decision of network switching or optimal configuration is made in advance in combination with a decision of a current model so as to prevent possible network congestion or instability. 5. And part of decision logic is deployed at a position close to a data source by utilizing an edge computing technology, so that quick response and low-delay decision are realized, meanwhile, a distributed decision architecture is designed, and the model is allowed to cooperatively work among different network nodes to jointly optimize network selection.
And step S05, determining a target transmission network according to the network scores of the networks to be selected, and transmitting the target request through the target transmission network.
It should be noted that, the network scores of the candidate networks are ordered, the higher the score is, the better the performance of the network is, the candidate network with the highest score is taken as the target transmission network, and the target request is transmitted through the target transmission network.
The embodiment provides a network request method, which comprises the steps of obtaining a network state of a current connected network, obtaining a plurality of performance indexes of each network to be selected when the network state is an abnormal state, determining index weights corresponding to the performance indexes according to task types of target requests, inputting the performance indexes and the index weights corresponding to the performance indexes into a target decision tree model for network evaluation, determining network scores of the networks to be selected, determining a target transmission network according to the network scores of the networks to be selected, and transmitting the target requests through the target transmission network. By the method, the optimal network can be intelligently selected for connection according to the network quality, stability and service requirements.
For example, in order to facilitate understanding of the implementation flow of the network request method obtained by combining the first embodiment and the second embodiment, the technical effects that can be achieved by all the embodiments are specifically described, where the network timeout processing and the network exception processing in the embodiment can improve the efficiency, the stability and the user experience of the transaction in the power transaction service. And has extremely high requirements on transaction speed and stability for the scenes needing high-frequency transaction, such as algorithm transaction, quantitative transaction and the like. The data consistency guarantee in the embodiment is used for ensuring that information is kept accurate and consistent in transmission and processing processes in the scenes of real-time transaction monitoring, order matching and settlement, risk management and control, cross-platform data synchronization and the like in the power transaction service, and specifically comprises the following steps of 1, reducing network load and timeout retransmission times, and solving the problem that a downstream system completes data receiving through automatic synchronization of upstream and downstream timeout time, but responding to data retransmission of an upstream system caused by timeout. By flexible and reasonable automatic adjustment of the timeout time, the scene and the number of times of triggering timeout retransmission are greatly reduced, so that the number of times of data synchronization is reduced, and the network load is lightened. 2. And the network exception handling efficiency is improved, namely the network state is monitored in real time, a heartbeat detection mechanism is introduced, and a reconnection retry mechanism is triggered in time. And a back-off strategy is adopted to adjust the retrying times and intervals, so that frequent retries when the network is temporarily unstable are reduced. 3. The upstream and downstream systems are decoupled, and the upstream and downstream systems do not need to care about the result of data synchronization and additional processing of anomalies. Coupling and interaction of upstream and downstream systems is reduced. 4. And the data consistency is improved, namely an efficient data synchronization and consistency checking mechanism is provided, the consistency of upstream and downstream data is ensured, calculation errors caused by data inconsistency are reduced, the work of manual offline data comparison, auditing and checking is reduced, and the operation efficiency is improved.
It should be noted that the foregoing examples are only for understanding the present application, and are not meant to limit the network request method of the present application, and many simple changes based on this technical concept are all within the scope of the present application.
The present application also provides a network request device, referring to fig. 6, the network request device includes:
The processing module 10 is configured to determine, in response to the request transmission instruction, a request timeout period based on a multi-dimensional network dynamic index corresponding to the current connection network, a reinforcement learning manner, and a basic timeout period.
And the monitoring module 20 is used for carrying out state monitoring on the target request based on the request timeout duration and determining the transmission state of the target request.
And the recycling module 30 is configured to recycle resources of the target request when the transmission state is a request timeout state.
Optionally, the processing module 10 is further configured to:
determining target weights corresponding to the network dynamic indexes according to the multidimensional network dynamic indexes corresponding to the current connected network and the reinforcement learning mode, performing parameter calculation according to the target weights corresponding to the network dynamic indexes and the network dynamic indexes to determine dynamic adjustment factors, and determining request timeout duration based on the dynamic adjustment factors and basic timeout duration.
Optionally, the processing module 10 is further configured to:
The method comprises the steps of determining a state space corresponding to each moment according to a multi-dimensional network dynamic index corresponding to a current connection network and a basic timeout duration, determining an instant rewarding value of each state space according to a rewarding function, performing iterative learning according to the state space corresponding to each moment, the instant rewarding value of each state space and a deep learning network, and determining a target weight corresponding to each network dynamic index according to an iterative learning result.
Optionally, the processing module 10 is further configured to:
And when the transmission state is a normal response state, cache verification data corresponding to the target request is requested from a cache queue, consistency verification is carried out on the cache verification data and the downstream received data to obtain a data verification result, and when the data verification result is a data consistency result, the cache verification data in the cache queue is deleted.
Optionally, the processing module 10 is further configured to:
The method comprises the steps of obtaining a network state of a current connected network, obtaining a plurality of performance indexes of each network to be selected when the network state is an abnormal state, determining index weights corresponding to the performance indexes according to task types of target requests, inputting the performance indexes and the index weights corresponding to the performance indexes into a target decision tree model for network evaluation, determining network scores of the networks to be selected, determining a target transmission network according to the network scores of the networks to be selected, and transmitting the target requests through the target transmission network.
Optionally, the processing module 10 is further configured to:
The method comprises the steps of determining sliding window parameters according to time sequence operation data, carrying out data extraction on the time sequence operation data according to the sliding window parameters and a target time node to obtain time sequence data to be drawn, carrying out image drawing according to the time sequence data to be drawn to obtain a time sequence information diagram corresponding to the time sequence operation data.
The network request device provided by the application can solve the technical problem that the problems of overtime management, resource management and the like in the network request cannot be reasonably processed by adopting the network request method in the embodiment. Compared with the prior art, the network request device provided by the application has the same beneficial effects as the network request method provided by the embodiment, and other technical features in the network request device are the same as the features disclosed by the method of the embodiment, and are not repeated herein.
The application provides network request equipment which comprises at least one processor and a memory in communication connection with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the network request method in the first embodiment.
Referring now to fig. 7, a schematic diagram of a network request device suitable for use in implementing embodiments of the present application is shown. The network request device in the embodiment of the present application may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal DIGITAL ASSISTANT: personal digital assistant), a PAD (Portable Application Description: tablet), a PMP (Portable MEDIA PLAYER: portable multimedia player), an in-vehicle terminal (e.g., an in-vehicle navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The network request device shown in fig. 7 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
As shown in fig. 7, the network request device may include a processing means 1001 (e.g., a central processing unit, a graphics processor, etc.), which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage means 1003 into a random access Memory (RAM: random Access Memory) 1004. In the RAM1004, various programs and data required for the operation of the network request device are also stored. The processing device 1001, the ROM1002, and the RAM1004 are connected to each other by a bus 1005. An input/output (I/O) interface 1006 is also connected to the bus. In general, a system including an input device 1007 such as a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc., an output device 1008 including a Liquid crystal display (LCD: liquid CRYSTAL DISPLAY), a speaker, a vibrator, etc., a storage device 1003 including a magnetic tape, a hard disk, etc., and a communication device 1009 may be connected to the I/O interface 1006. The communication means 1009 may allow the network requesting device to communicate wirelessly or by wire with other devices to exchange data. While a network requesting device having various systems is shown in the figures, it should be understood that not all of the illustrated systems are required to be implemented or provided. More or fewer systems may alternatively be implemented or provided.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through a communication device, or installed from the storage device 1003, or installed from the ROM 1002. The above-described functions defined in the method of the disclosed embodiment of the application are performed when the computer program is executed by the processing device 1001.
The network request equipment provided by the application can solve the technical problem that the problems of overtime management, resource management and the like in the network request cannot be reasonably processed by adopting the network request method in the embodiment. Compared with the prior art, the network request device provided by the application has the same beneficial effects as the network request method provided by the above embodiment, and other technical features in the network request device are the same as the features disclosed by the method of the above embodiment, and are not repeated here.
It is to be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon for performing the network request method in the above-described embodiments.
The computer readable storage medium provided by the present application may be, for example, a U disk, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access Memory (RAM: random Access Memory), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory (EPROM: erasable Programmable Read Only Memory or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to electrical wiring, fiber optic cable, RF (Radio Frequency) and the like, or any suitable combination of the foregoing.
The computer readable storage medium may be included in the network request device or may exist alone without being incorporated in the network request device.
The computer readable storage medium carries one or more programs, when the one or more programs are executed by the network request equipment, the network request equipment responds to a request transmission instruction, the request timeout duration is determined based on a multi-dimensional network dynamic index corresponding to a current connection network, a reinforcement learning mode and a basic timeout duration, a target request is subjected to state monitoring based on the request timeout duration, the transmission state of the target request is determined, and when the transmission state is the request timeout state, the resource recovery is carried out on the target request.
Computer program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of remote computers, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN: local Area Network) or a wide area network (WAN: wide Area Network), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present application may be implemented in software or in hardware. Wherein the name of the module does not constitute a limitation of the unit itself in some cases.
The readable storage medium provided by the application is a computer readable storage medium, and the computer readable storage medium stores computer readable program instructions (namely computer program) for executing the network request method, so that the technical problem that reasonable treatment cannot be performed on the problems of timeout management, resource management and the like in the network request can be solved. Compared with the prior art, the beneficial effects of the computer readable storage medium provided by the application are the same as those of the network request method provided by the above embodiment, and are not described herein.
The application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of a network request method as described above.
The computer program product provided by the application can solve the technical problem that the problems in aspects of overtime management, resource management and the like in the network request cannot be reasonably processed. Compared with the prior art, the beneficial effects of the computer program product provided by the application are the same as those of the network request method provided by the above embodiment, and are not described herein.
The foregoing description is only a partial embodiment of the present application, and is not intended to limit the scope of the present application, and all the equivalent structural changes made by the description and the accompanying drawings under the technical concept of the present application, or the direct/indirect application in other related technical fields are included in the scope of the present application.
Claims (9)
1. A network request method, the network request method comprising:
Responding to a request transmission instruction, and determining a request timeout duration based on a multi-dimensional network dynamic index corresponding to a current connection network, a reinforcement learning mode and a basic timeout duration;
Performing state monitoring on a target request based on the request timeout duration, and determining a transmission state of the target request;
when the transmission state is a request overtime state, recycling resources of the target request;
The step of determining the request timeout duration based on the multi-dimensional network dynamic index, the reinforcement learning mode and the basic timeout duration corresponding to the current connection network comprises the following steps:
Determining target weights corresponding to the network dynamic indexes according to the multi-dimensional network dynamic indexes corresponding to the current connection network and the reinforcement learning mode;
performing parameter calculation according to the target weight corresponding to each network dynamic index and each network dynamic index, and determining a dynamic adjustment factor;
and determining a request timeout period based on the dynamic adjustment factor and the base timeout period.
2. The method of claim 1, wherein the step of determining the target weight corresponding to each network dynamic index according to the multi-dimensional network dynamic index corresponding to the current connected network and the reinforcement learning mode comprises:
Determining a state space corresponding to each moment according to a multi-dimensional network dynamic index corresponding to the current connection network and a basic timeout duration;
determining instant rewards of each state space according to the rewards function;
and performing iterative learning according to the state space corresponding to each moment, the instant reward value of each state space and the deep learning network, and determining the target weight corresponding to each network dynamic index according to the iterative learning result.
3. The method of claim 1 or 2, wherein after the step of determining the transmission status of the target request, the step of status monitoring the target request based on the request timeout period further comprises:
When the transmission state is a normal response state, cache verification data corresponding to the target request is requested from a cache queue;
Performing consistency check on the cache verification data and the downstream received data to obtain a data check result;
and deleting the cache verification data in the cache queue when the data verification result is a data consistency result.
4. The method of claim 1, wherein the network request method further comprises:
Acquiring a network state of a current connected network;
when the network state is abnormal, acquiring a plurality of performance indexes of each network to be selected;
determining index weights corresponding to the performance indexes according to the task types of the target requests;
inputting each performance index and index weight corresponding to each performance index into a target decision tree model for network evaluation, and determining the network score of each network to be selected;
And determining a target transmission network according to the network scores of the networks to be selected, and transmitting the target request through the target transmission network.
5. The method of claim 4, wherein before the step of inputting each performance indicator and the indicator weight corresponding to each performance indicator into the target decision tree model for network evaluation to determine the network score of each network to be selected, further comprising:
constructing an initial decision tree according to the network information training set;
Determining target splitting characteristics and dynamic characteristic weights in the node splitting process according to the reinforcement learning mode;
Training the initial decision tree according to the target split characteristic and the dynamic characteristic weight to obtain a model to be tested;
And performing performance test on the model to be tested according to the network information test set, and obtaining a target decision tree model according to a performance test result.
6. A network request device, the network request device comprising:
the processing module is used for responding to the request transmission instruction and determining the request timeout duration based on the corresponding multi-dimensional network dynamic index, reinforcement learning mode and basic timeout duration according to the current connection network;
The monitoring module is used for carrying out state monitoring on the target request based on the request timeout duration and determining the transmission state of the target request;
The recovery module is used for recovering resources of the target request when the transmission state is a request overtime state;
The processing module is also used for determining the target weight corresponding to each network dynamic index according to the multidimensional network dynamic index corresponding to the current connected network and the reinforcement learning mode, performing parameter calculation according to the target weight corresponding to each network dynamic index and each network dynamic index, determining a dynamic adjustment factor, and determining the request timeout duration based on the dynamic adjustment factor and the basic timeout duration.
7. A network request device, characterized in that the device comprises a memory, a processor and a network request program stored on the memory and executable on the processor, the network request program being configured to implement the steps of the network request method according to any one of claims 1 to 3 or 4 to 5.
8. A storage medium having stored thereon a network request program which, when executed by a processor, implements the steps of the network request method of any of claims 1 to 3 or 4 to 5.
9. A computer program product, characterized in that it comprises a network request program which, when executed by a processor, implements the steps of the network request method according to any of claims 1 to 3 or 4 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411654084.0A CN119449806B (en) | 2024-11-18 | 2024-11-18 | Network request method, device, equipment, storage medium and product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411654084.0A CN119449806B (en) | 2024-11-18 | 2024-11-18 | Network request method, device, equipment, storage medium and product |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN119449806A CN119449806A (en) | 2025-02-14 |
| CN119449806B true CN119449806B (en) | 2025-11-21 |
Family
ID=94524984
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411654084.0A Active CN119449806B (en) | 2024-11-18 | 2024-11-18 | Network request method, device, equipment, storage medium and product |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119449806B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119996574B (en) * | 2025-04-14 | 2025-08-08 | 安徽创瑞技术股份有限公司 | International number invalidation judging method and system |
| CN120353543B (en) * | 2025-06-25 | 2025-08-22 | 苏州元脑智能科技有限公司 | Automatic script execution method, system, server, medium and program product |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116828533A (en) * | 2023-03-06 | 2023-09-29 | 兴业银行股份有限公司 | Optimization methods, systems, media and equipment for mobile Internet processing timeout requests |
| CN118733391A (en) * | 2024-07-09 | 2024-10-01 | 华晨宝马汽车有限公司 | Process monitoring method, process monitoring device, computing device and computer readable storage medium |
| CN118785296A (en) * | 2023-04-07 | 2024-10-15 | 腾讯科技(深圳)有限公司 | A data transmission method and related device |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114648053A (en) * | 2021-12-20 | 2022-06-21 | 国网浙江省电力有限公司嘉兴供电公司 | 5G network quality automatic evaluation method based on machine learning |
| CN116069512B (en) * | 2023-03-23 | 2023-08-04 | 之江实验室 | A serverless efficient resource allocation method and system based on reinforcement learning |
| CN118413557B (en) * | 2024-07-02 | 2024-12-10 | 嘉兴贯文数字技术有限公司 | Equipment data acquisition method and system based on Internet of things control platform |
-
2024
- 2024-11-18 CN CN202411654084.0A patent/CN119449806B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116828533A (en) * | 2023-03-06 | 2023-09-29 | 兴业银行股份有限公司 | Optimization methods, systems, media and equipment for mobile Internet processing timeout requests |
| CN118785296A (en) * | 2023-04-07 | 2024-10-15 | 腾讯科技(深圳)有限公司 | A data transmission method and related device |
| CN118733391A (en) * | 2024-07-09 | 2024-10-01 | 华晨宝马汽车有限公司 | Process monitoring method, process monitoring device, computing device and computer readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119449806A (en) | 2025-02-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN119449806B (en) | Network request method, device, equipment, storage medium and product | |
| US10949254B2 (en) | Systems and methods for scheduling tasks | |
| EP4421689A1 (en) | Computing power distribution method and apparatus, and computing power server | |
| EP3758325A1 (en) | Traffic limiting method and system | |
| CN109165194B (en) | Data unloading method and device, electronic equipment and storage medium | |
| US11119828B2 (en) | Digital processing system for event and/or time based triggering management, and control of tasks | |
| US20250023943A1 (en) | An architecture for self-adaptive computation management in edge cloud | |
| CN120123184A (en) | Distributed server cluster log processing method and device | |
| US10616363B2 (en) | Constraint based signal for intelligent and optimized end user mobile experience enhancement | |
| CN112764957B (en) | Application fault demarcation method and device | |
| CN115103210B (en) | Information processing method, device, terminal and storage medium | |
| CN115328741A (en) | Exception handling method, device, equipment and storage medium | |
| US10348576B2 (en) | Modeling resiliency strategies for streaming queries | |
| US20210021690A1 (en) | Method and apparatus for generating information | |
| CN116902041B (en) | Interface data processing method and device, electronic equipment and medium | |
| CN112311842A (en) | Method and device for information interaction | |
| CN117743017A (en) | Fault root cause positioning method, device, equipment and storage medium | |
| US20240267796A1 (en) | Mobility protocol for narrow-band internet of things (nb-iot) networks | |
| CN115292081B (en) | Information sending method, device, electronic equipment and medium | |
| CN112766698B (en) | Application service pressure determining method and device | |
| US12536172B2 (en) | Data query optimization method, electronic device and storage medium | |
| US20240152504A1 (en) | Data interaction method, apparatus, and electronic device | |
| US20250232297A1 (en) | Method and apparatus to auto-heal microservices information flow breakdown across containers in a cloud-based application | |
| US20240388508A1 (en) | Data transmission | |
| US11941432B2 (en) | Processing system, processing method, higher-level system, lower-level system, higher-level program, and lower-level program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |