Timeout time determination method and device, electronic equipment and storage medium
By dynamically determining the timeout time determination strategy, adjusting the timeout time according to the actual situation of the equipment to be collected and the equipment to be collected, the problem that the fixed timeout time in the prior art cannot meet the data acquisition needs, and a more efficient data acquisition process is achieved.
Patent Information
- Application Number
- CN202510028418.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the use of fixed timeout times cannot effectively deal with the timeout problem in the equipment data acquisition process in industrial control systems, resulting in system performance degradation or data loss.
By obtaining the number of acquisitions of the equipment to be collected, the business environment and the equipment performance of the equipment of the equipment, the target timeout determination strategy is dynamically determined, thereby dynamically adjusting the timeout time of the collection device when data acquisition is collected by the equipment to be collected.
Dynamic adjustment of timeout time is realized, making it more in line with the actual situation of the equipment to be collected and the equipment to be collected, meets the data acquisition needs, and avoids performance degradation and data loss caused by the use of a fixed timeout time.
Smart Images

Figure CN120029189A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial control technology, and in particular to a timeout determination method, device, electronic device and storage medium. Background Art
[0002] In industrial production scenarios, in order to ensure the normal and stable operation of the entire industrial control system, it is necessary to monitor the status and data of the equipment in the industrial control system in real time. During the monitoring process, in order to ensure that the industrial control system can receive effective feedback within the specified time, it is usually necessary to set a timeout for each device.
[0003] However, in the process of device data collection, timeouts may occur due to network delays, hardware failures, or other uncontrollable factors. Existing technologies usually adopt the method of setting a larger fixed timeout period, and all device data collection processes use this time parameter. Although this method can cover most scenarios, in actual online systems, traffic fluctuations and request failures may be very complex and unpredictable. The setting of a fixed timeout period lacks flexibility and adaptability in the face of abnormal changes in traffic, and cannot effectively handle timeout problems, which may lead to system performance degradation or data loss. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a timeout determination method, device, electronic device and storage medium to solve the problem in the prior art that a fixed timeout is used and cannot meet the data collection requirements of the device.
[0005] A first aspect of an embodiment of the present application provides a timeout determination method, the method comprising: obtaining the collection quantity and business environment of the device to be collected, and obtaining the device performance of the collection device; determining a target timeout determination strategy based on the collection quantity, business environment and device performance of the device to be collected; determining a target timeout time when the collection device collects data from the device to be collected based on the target timeout determination strategy.
[0006] According to a second aspect of an embodiment of the present application, a timeout determination device is provided, which includes: an acquisition module, used to obtain the collection quantity and business environment of the device to be collected, and obtain the equipment performance of the collection device; a determination module, used to determine a target timeout determination strategy based on the collection quantity, business environment and equipment performance of the device to be collected; the determination module is also used to determine the target timeout time when the collection device collects data from the device to be collected based on the target timeout determination strategy.
[0007] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0008] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0009] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the timeout determination method of the embodiments of the present application obtains the device performance of the collection device by obtaining the collection quantity and business environment of the device to be collected; determines the target timeout determination strategy according to the collection quantity, business environment and device performance of the device to be collected; determines the target timeout time when the collection device collects data from the device to be collected according to the target timeout determination strategy, and the present application realizes the dynamic determination of the target timeout determination strategy, so that the target timeout determination strategy can be more in line with the actual situation of the device to be collected and the collection device, and subsequently dynamically determines the target timeout time according to the target timeout determination strategy, so that the target timeout time can be more in line with the actual situation of the device to be collected and the collection device, so that the target timeout time can meet the data collection requirements of the device to be collected and the collection device, and avoids the problem of using a fixed timeout time and failing to meet the data collection requirements of the device. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 This is a basic schematic diagram of a method for determining a timeout period provided in an embodiment of the present application;
[0012] Figure 2 It is a flowchart of another method for determining a timeout period provided in an embodiment of the present application;
[0013] Figure 3 is a flowchart of another method for determining a timeout period provided in an embodiment of the present application;
[0014] Figure 4 It is a flowchart of another method for determining a timeout period provided in an embodiment of the present application;
[0015] Figure 5It is a flowchart of another method for determining a timeout period provided in an embodiment of the present application;
[0016] Figure 6 It is a flowchart of another optional timeout determination method provided in an embodiment of the present application;
[0017] Figure 7 It is a flowchart of another optional timeout determination method provided in an embodiment of the present application;
[0018] Figure 8 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0019] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0021] A method and device for determining a timeout period according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0022] Figure 1 This is a method for determining a timeout period provided by an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0023] S101, obtaining the collection quantity and business environment of the equipment to be collected, and obtaining the equipment performance of the collection equipment;
[0024] S102, determining a target timeout determination strategy according to the number of collection devices to be collected, the business environment, and the device performance of the collection devices;
[0025] S103: Determine a strategy according to the target timeout period to determine a target timeout period when the collection device collects data from the device to be collected.
[0026] It is understood that the method provided in the present application is applied to a collection device having a data interaction function, which may be a mobile phone, a tablet computer, an e-book reader, a multimedia player, a wearable device, a laptop computer, etc.
[0027] It can be understood that the device to be collected can be any device in the industrial control system. For example, the device to be collected can be an instrument or an industrial equipment, and the collection device can be communicatively connected with the device to be collected; wherein, the device to be collected and the collection device have wireless and / or wired communication interfaces, so that the device to be collected and the collection device can be communicatively connected wirelessly and / or wired.
[0028] In some examples, the collection device can be communicatively connected with multiple devices to be collected. Similarly, each device to be collected can also be connected to multiple collection devices. It can be understood that the data collection time required for the collection device to collect data from the standby device is affected by the business environment (including but not limited to at least one of the collection frequency of the collection device collecting data from the device to be collected, the data packet size, the network delay, the state of the collection device, and the state of the device to be collected) and the device performance of the collection device itself; illustratively, when other parameters remain unchanged, the better the device performance of the collection device itself and the faster the data collection speed, the less data collection time the collection device needs to collect data from the device to be collected; when other parameters remain unchanged, the worse the device performance of the collection device itself, the more data collection time the collection device needs to collect data from the device to be collected.
[0029] Continuing with the above example, in order to avoid setting a timeout period that is too small or too large, the present application will obtain the business environment and the equipment performance of the collection device. In some examples, the collection number of devices to be collected (that is, the collection number of devices to be collected to which the collection device is connected) will also affect the data collection time required for data collection. Specifically, when other parameters remain unchanged, the fewer the collection number of devices to be collected (the collection number of devices to be collected is at least 1), the faster the data collection speed is, and the less data collection time is required for the collection device to collect data from the collection device; when other parameters remain unchanged, the more the collection number of devices to be collected, the more data collection time is required for the collection device to collect data from the collection device. For this reason, the present application will also obtain the collection number of devices to be collected.
[0030] In some examples, the present application will comprehensively determine the target timeout determination strategy based on the number of collection devices to be collected, the business environment, and the device performance of the collection devices. The target timeout determination strategy is used to determine the target timeout time when the collection device collects data from the collection devices.
[0031] After determining the target timeout determination strategy, the present application will determine the target timeout when the collection device collects data from the collection device according to the target timeout determination strategy.
[0032] Among them, the above steps realize the dynamic determination of the target timeout determination strategy, so that the target timeout determination strategy can be more in line with the actual situation of the device to be collected and the collection device at the current time, and thus the subsequently determined target timeout time can be more matched with the device to be collected and the collection device.
[0033] According to the technical solution provided in the embodiment of the present application, the collection quantity and business environment of the device to be collected are obtained, and the equipment performance of the collection device is obtained; the target timeout determination strategy is determined according to the collection quantity, business environment and equipment performance of the device to be collected; according to the target timeout determination strategy, the target timeout time when the collection device collects data from the device to be collected is determined. The present application realizes the dynamic determination of the target timeout determination strategy, so that the target timeout determination strategy can be more in line with the actual situation of the device to be collected and the collection device. Subsequently, the target timeout time is dynamically determined according to the target timeout determination strategy, so that the target timeout time can be more in line with the actual situation of the device to be collected and the collection device, so that the target timeout time can meet the data collection requirements of the device to be collected and the collection device, and avoids the problem of using a fixed timeout time and failing to meet the data collection requirements of the device.
[0034] In some examples, such as Figure 2 As shown, the timeout determination strategy is determined according to the number of devices to be collected, the business environment, and the performance of the collection devices, including:
[0035] S201, obtaining a plurality of preset timeout determination strategies;
[0036] S202: Match the collection quantity, business environment, and device performance of the collection device with each timeout determination strategy, and determine a target timeout determination strategy according to the matching result.
[0037] It can be understood that multiple timeout determination strategies are pre-set in the present application, and each timeout determination strategy has a different strategy for determining the target timeout. In order to better determine the target timeout strategy, the present application will match the collection quantity, business environment, and equipment performance of the collection device with each timeout determination strategy.
[0038] Specifically, each timeout determination strategy includes parameters such as the number of collections to be matched, the business environment to be matched, and the equipment performance of the collection device to be matched. The present application determines the similarity between the number of collections, the business environment, and the equipment performance of the collection device and each timeout determination strategy by matching the number of collections, the business environment, and the equipment performance of the collection device with the parameters in each timeout determination strategy, and takes the timeout determination strategy with the highest similarity as the target timeout determination strategy.
[0039] Exemplarily, the present application pre-sets a first timeout determination strategy and a second timeout determination strategy. The first timeout determination strategy is to perform multiple data collections on the devices to be collected through the collection device to determine the target timeout; the second timeout determination strategy is to predict the target timeout through the timeout prediction model. The first timeout determination strategy only requires data collection and basic operations to determine the target timeout, while the second timeout determination strategy requires data collection and then a large number of operations using the timeout prediction model. Therefore, when the performance of the collection device is weak (it cannot support the operation of the timeout prediction model, or the operation speed of the timeout prediction model is slow), and there are fewer devices to be collected that require data collection, and the business environment is simple (relevant personnel can flexibly set the business environment to be simple according to actual needs), the device performance, collection quantity, and business environment of the above-mentioned collection device are matched with the first timeout determination strategy. The similarity of parameters such as the number of collections, the business environment to be matched, and the equipment performance of the collection device to be matched is higher, then the first timeout determination strategy is used as the target timeout determination strategy; when the equipment performance of the collection device is strong (can support the calculation of the timeout prediction model, and the calculation speed of the timeout prediction model is fast), and the equipment performance, number of collections, and business environment of the above-mentioned collection device are higher than the similarity of parameters such as the number of collections to be matched, the business environment to be matched, and the equipment performance of the collection device to be matched in the second timeout determination strategy, then the second timeout determination strategy is used as the target timeout determination strategy.
[0040] According to the technical solution provided in the embodiment of the present application, multiple pre-set timeout determination strategies are obtained; the collection quantity, business environment and equipment performance of the collection device are matched with each timeout determination strategy, and the target timeout determination strategy is determined according to the matching result. The above steps can accurately determine the target timeout determination strategy corresponding to the collection quantity, business environment and equipment performance of the collection device, so that the target timeout determination strategy can be more in line with the actual situation of the equipment to be collected and the collection device at the current time, and thus the subsequently determined target timeout time can be more matched with the equipment to be collected and the collection device.
[0041] In some examples, the target timeout determination strategy is a first timeout determination strategy, such as Figure 3 As shown, according to the target timeout time determination strategy, the target timeout time when the collection device collects data from the collection device is determined, including:
[0042] S301, controlling the acquisition device to perform multiple data acquisitions on the device to be acquired, and obtaining the data acquisition time when each data acquisition is successful;
[0043] S302, after the number of data collection times reaches a preset target number of data collection times, sorting the multiple data collection times;
[0044] S303: Determine a target timeout period according to the sorting result.
[0045] Specifically, when the target timeout determination strategy is the first timeout determination strategy, the present application will control the collection device to perform multiple data collections on the collection device, and obtain the data collection time when each data collection is successful. After the number of data collection times reaches the preset target collection number, the multiple data collection times will be sorted; the target timeout will be determined from the multiple data collection times according to the sorting result.
[0046] Exemplarily, taking the preset target collection number as N as an example, the collection device collects data from the collection device N times, and each data collection is successful, then N data collection times are obtained. This application will sort the N data collection times, and determine the data collection time with the largest value and the smallest data collection time according to the sorting result, and then calculate the target timeout time according to the preset target timeout time determination formula. The target timeout time determination formula is as follows: target timeout time = maximum data collection time + 2*(maximum data collection time - minimum data collection time). It can be understood that in addition to sorting, the maximum data collection time can also be determined by bubbling and other methods, and this example does not limit this.
[0047] It can be understood that, during the process of the collection device collecting data from the other collection device for N times, if any collection fails, the collection will be counted again from the number of failed collections. For example, during the process of the collection device collecting data from the other collection device for N times, if the fifth data collection fails, i.e. times out, then the first data collection after the timeout recovery will be counted as the fifth, until N data collections are successful.
[0048] According to the technical solution provided in the embodiment of the present application, a method for determining a timeout time is provided in the embodiment of the present application, which controls an acquisition device to perform multiple data acquisitions on a device to be acquired, and obtains the data acquisition time when each data acquisition is successful; after the number of data acquisitions reaches a preset target number of data acquisitions, the multiple data acquisition times are sorted; and the target timeout time is determined from the multiple data acquisition times according to the sorting result. This method realizes accurate determination of the target timeout time.
[0049] In some examples, such as Figure 4 As shown, the control acquisition device performs multiple data acquisitions on the acquisition device, and obtains the data acquisition time when each data acquisition is successful, including:
[0050] S401, obtaining a preset standard collection time, and controlling the collection device to collect data from the collection device within the standard collection time;
[0051] S402: If the collection device fails to collect data from the device to be collected within the standard collection time, increase the standard collection time according to a pre-set growth rule;
[0052] S403, controlling the collection device to collect data from the device to be collected within the increased standard collection time, and obtaining the data collection time when the collection device successfully collects data from the device to be collected.
[0053] It can be understood that in order to avoid the problem that the collection device takes too long to perform a single data collection from the other collection device during the process of multiple data collections from the other collection device, the present application will pre-set a standard collection time in advance so that the collection device can collect data from the other collection device within the standard collection time.
[0054] In some examples, if the collection device fails to collect data from the other collection device within the standard collection time (that is, the collection time exceeds the standard collection time and the data collection is still not completed), the standard collection time is increased according to a pre-set growth rule. Taking the pre-set growth rule of doubling as an example, the standard collection time is doubled.
[0055] Continuing with the above example, after the standard collection time is increased, this application will control the collection device to collect data from the device to be collected within the increased standard collection time, and obtain the data collection time when the collection device successfully collects data from the device to be collected.
[0056] It can be understood that if the control acquisition device fails to collect data from the other acquisition device within the increased standard acquisition time, the present application will increase the increased standard acquisition time again according to the increase rule until the acquisition device successfully collects data from the other acquisition device or the number of increases in the standard acquisition time reaches a preset increase threshold; if the number of increases in the standard acquisition time reaches the preset increase threshold, a fault reminder of data collection failure will be issued.
[0057] In order to better understand the above steps, the present application provides a more specific example for illustration. When the performance of the acquisition device is weak (it cannot support the operation of the timeout prediction model, or the operation speed of the timeout prediction model is slow), and the number of devices to be collected is small, and the business environment is simple (relevant personnel can flexibly set the business environment to be simple according to actual needs), first define a larger standard collection time, and record the time required for the acquisition device to collect data from the collection device within the standard collection time. When the number of records reaches n, take the largest data collection time and the smallest data collection time among the n times to determine the target timeout time (target timeout time = maximum data collection time + 2 * (maximum data collection time - minimum data collection time). When the time for the acquisition device to collect data from the collection device within the standard collection time exceeds the standard collection time, data collection is retried and the standard collection time is changed to twice the previous time. If the time for the acquisition device to collect data from the collection device within the standard collection time still exceeds the standard collection time after 3 retries, it is determined to be a fault. If the acquisition device successfully collects data from the collection device within the standard collection time after the retry, the time is restarted and the target timeout time is calculated.
[0058] According to the technical solution provided in the embodiment of the present application, a pre-set standard collection time is obtained, and the collection device is controlled to collect data from the device to be collected within the standard collection time; if the collection device fails to collect data from the device to be collected within the standard collection time, the standard collection time is increased according to a pre-set growth rule; the collection device is controlled to collect data from the device to be collected within the increased standard collection time, and the data collection time when the collection device successfully collects data from the device to be collected is obtained. By pre-setting a standard collection time, the method avoids the problem of the collection device taking too long to collect data from the device for a single time during the process of collecting multiple data from the device to be collected, thereby ensuring that the determined data collection time is within a certain range, thereby avoiding the problem of unlimited growth of the data collection time.
[0059] In some examples, the target timeout determination strategy is a second timeout determination strategy, such as Figure 5 As shown, according to the target timeout time, a strategy is determined to determine the timeout time when the collection device collects data from the collection device, including:
[0060] S501, obtaining acquisition parameters of the acquisition device for data acquisition of the device to be acquired;
[0061] S502: Input the collected parameters into a preset timeout prediction model to obtain a target timeout time output by the timeout prediction model.
[0062] It can be understood that the present application will pre-set a timeout prediction model, which is based on an input layer, a long short-term memory network (Long Short-Term Memory, LSTM) layer, a fully connected layer and an output layer, wherein the input layer is used to input processed time series data; the LSTM layer can better capture and retain long-term and short-term dependencies by introducing a gating mechanism, and predict future target timeouts. The current target timeout may be generated by relying on the data collection state a long time ago. LSTM can adjust its weights and biases at each time step to adapt to the time-varying characteristics of the data, which is very effective in dealing with uncertainty in instrument data collection; it can be understood that each LSTM layer consists of four main parts: an input gate, a forget gate, an output gate and a memory unit (cell state). They control the flow and update of information by cooperating with each other. Among them, the forget gate is used to control how much information the memory unit needs to forget at the previous moment. Its input is ht-1 and xt, where ht-1 represents the output of the unit at the previous moment, xt represents the data input at the current moment, σ is the activation function, wf is the weight matrix of the forget gate, and bf is the bias vector of the forget gate. The calculation method is shown in the following formula:
[0063] f t =σ(W f *[h t-1 ,x t ]+b f )
[0064] The input gate controls how much information needs to be stored for the candidate state at the current moment. First, the input gate it is calculated. Its input is ht-1 and xt, where ht-1 represents the output of the unit at the previous moment, xt represents the data input at the current moment, σ is the activation function, wi is the weight matrix of the input gate, and bi is the bias vector of the input gate. Then the candidate memory unit is calculated, tanh is the activation function, wc and bc are the weight matrix and bias vector of the calculation unit state, and the calculation method is shown in the following formula:
[0065] i t =σ(W i *[h t-1 ,x t ]+b i )
[0066]
[0067] Update the old memory unit to the new memory unit, where Ct and Ct-1 are the memory unit states at time t and time t-1 respectively. The calculation method is shown in the following formula:
[0068]
[0069] The output gate controls how many memory cells at the current moment need to be output to the external state ht, and multiplies it with the memory cells processed by the tanh layer to obtain the final information to be output. First, calculate the value of the output gate Ot, Wo is the weight matrix of the output gate, and bo is the bias vector of the output gate. Then calculate the output information, Ct is the updated memory cell, and the calculation method is shown in the following formula:
[0070] O t =σ(W O *[h t-1 ,x t ]+b o )
[0071] h t =O t *tanh(C t )
[0072] The fully connected layer is used to regress the output target timeout time; the output layer is used to predict the target timeout time.
[0073] The loss function uses quantile loss. Using this loss function can make the predicted value slightly higher than the actual value. If the predicted target timeout is smaller than the actual data collection time, when the actual data collection time is used as the target timeout, it may time out frequently, resulting in many redundant data packets remaining in the link, affecting the collection efficiency.
[0074]
[0075] Where α>0.5.
[0076] It can be understood that the above-mentioned timeout prediction model is trained based on training data, and the training data includes the collection frequency of the collection device collecting data from the device to be collected, the data packet size, the network delay, the status of the collection device, the status of the device to be collected, the equipment performance of the collection device, the collection quantity, etc.
[0077] It can be understood that the above training data is obtained by extracting the collection frequency, data packet size, network delay, state of the collection device, state of the device to be collected, device performance of the collection device, and collection quantity when the collection device collects data from the device to be collected within a preset time interval and a preset time length. The specific collection method can be to use a data collection system to collect real-time data from various instruments and sensors or to extract historical collection records from log files.
[0078] After obtaining the above training data, since the obtained training data does not necessarily have the same time interval, the interpolation method is needed to supplement the training data and delete unreasonable values such as negative numbers; then the training data is converted into features that can be input into LSTM, for example, the acquisition time, network delay, etc. are normalized, and finally the data is divided into training set, validation set and test set.
[0079] Then, the training set and validation set are input into the initial timeout prediction model for training. The performance of the model is improved by adjusting the learning rate, batch size, and number of training rounds. The validation set is used to monitor the performance of the model during training to avoid overfitting. If the validation loss no longer decreases after a certain number of rounds, the Early Stopping mechanism can be used to avoid wasting training resources.
[0080] Finally, the trained timeout prediction model is deployed in the actual production environment (that is, deployed in the collection device). Each time the collection device collects data, the collection time and feature data of a certain time window before the collection are collected (such as the collection frequency, data packet size, network delay, status of the collection device, status of the device to be collected, device performance of the collection device, and collection quantity) are collected. The timeout prediction model is used to predict the target timeout time to assist operation and maintenance personnel or automation systems in making decisions. In addition, this application will regularly collect new data and retrain the timeout prediction model to improve the prediction accuracy of the target timeout time.
[0081] According to the technical solution provided in the embodiment of the present application, a timeout determination method provided in the embodiment of the present application obtains acquisition parameters of an acquisition device for data acquisition of a device to be acquired; the acquisition parameters are input into a preset timeout prediction model to obtain a target timeout time output by the timeout prediction model. The present application achieves accurate acquisition of the target timeout time through the timeout prediction model.
[0082] In some examples, such as Figure 6 As shown, after determining the timeout period when the acquisition device acquires data from the device to be acquired, the method further includes:
[0083] S601, controlling the collection device to collect data from the collection device within the target timeout period;
[0084] S602: If a data collection timeout failure occurs when the collection device collects data from the other collection device within the timeout period, the target timeout period is increased according to a pre-set growth rule to obtain a new target timeout period.
[0085] It is understandable that the target timeout time predicted by the timeout prediction model may not match the status of the current device to be collected and the collection device, resulting in a data collection timeout failure when the collection device collects data from the device to be collected within the target timeout time. If a data collection timeout failure occurs when the collection device collects data from the device to be collected within the timeout time, this application will increase the target timeout time according to a pre-set growth rule to obtain a new target timeout time.
[0086] Continuing with the above example, after the target timeout period is increased, this application will control the collection device to collect data from the treatment collection device within the increased target timeout period. It can be understood that if the control of the collection device to collect data from the treatment collection device fails within the increased target timeout period, this application will increase the increased target timeout period again according to the increase rules.
[0087] According to the technical solution provided in the embodiment of the present application, the collection device is controlled to collect data from the device to be collected within the target timeout period; if a data collection timeout failure occurs when the collection device collects data from the device to be collected within the timeout period, the target timeout period is increased according to a predetermined growth rule to obtain a new target timeout period. The above steps of the present application implement the adjustment of the target timeout period output by the timeout prediction model, so that the adjusted target timeout period can better meet the actual status of the collection device and the device to be collected, avoiding the problem that the target timeout period output by the timeout prediction model has errors, resulting in a mismatch with the actual status of the collection device and the device to be collected, and the collection device continues to have errors when collecting data from the device to be collected. It also avoids the problem of network congestion caused by frequent retransmission of messages.
[0088] In some examples, such as Figure 7 As shown, after increasing the target timeout time according to the pre-set growth rule and obtaining a new target timeout time, the method further includes:
[0089] S701, controlling the collection device to collect data from the collection device within the new target timeout period;
[0090] S702: If a data collection timeout failure occurs when the collection device collects data from the target collection device within the new target timeout period, and the number of data collection timeout failures exceeds a preset failure threshold number, then obtain a model adjustment parameter when the collection device collects data from the target collection device within the target timeout period;
[0091] S703, adjusting the timeout prediction model according to the model adjustment parameters to obtain an adjusted timeout prediction model;
[0092] S704: reacquire the acquisition parameters of the acquisition device for data acquisition of the device to be collected, and input the reacquired acquisition parameters into the adjusted timeout prediction model to obtain a new target timeout time.
[0093] It can be understood that in order to avoid the problem of timeout problems that has always existed, the present application will determine whether a data collection timeout failure still exists when obtaining a new target timeout time and controlling the collection device to collect data from the collection device within the new target timeout time. If a data collection timeout failure exists when the collection device collects data from the collection device within the new target timeout time, and the number of data collection timeout failures exceeds a preset failure threshold number (for example, 3 times), then the model adjustment parameters of the collection device when collecting data from the collection device within the target timeout time are obtained. The model adjustment parameters are the number of devices to be collected and the business environment when the collection device collects data from the collection device within the target timeout time, so as to obtain the device performance of the collection device.
[0094] Then, the timeout prediction model is adjusted according to the model adjustment parameters (a retraining process) to obtain an adjusted timeout prediction model (in the process of adjusting the model, the old model is still used).
[0095] Finally, the present application reacquires the acquisition parameters of the acquisition device for data acquisition of the device to be collected, and inputs the reacquired acquisition parameters into the adjusted timeout prediction model, the new target timeout time, thereby improving the accuracy of the acquired target timeout time.
[0096] In order to better understand the present application, the present application provides a more specific example for illustration. In the process of controlling the collection device to collect data from the collection device according to the target timeout time determined by the timeout prediction model, if a data collection timeout failure is found, data collection is performed again, and the timeout time is doubled. If no reply packet is received after three retransmissions, it is regarded as a collection device failure and is set to a fault state. If a reply packet is received, data within a period of time is collected again (for example, the number of collections of the collection device to be collected, the business environment, and the device performance of the collection device when the collection device collects data from the collection device within the target timeout time) to fine-tune the model. When the accuracy of the timeout prediction model reaches a certain value, the adjusted timeout prediction model is used to predict the new target timeout time. If a data collection timeout failure still occurs within the new target timeout time output after adjusting the timeout prediction model, the collection setting to be collected is set to a fault state, and a fault report is generated.
[0097] According to the technical solution provided in the embodiment of the present application, the collection device is controlled to collect data from the to-be-collected device within a new target timeout period; if there is a data collection timeout failure when the collection device collects data from the to-be-collected device within the new target timeout period, and the number of data collection timeout failures exceeds a preset failure threshold number, then the model adjustment parameters of the collection device when collecting data from the to-be-collected device within the target timeout period are obtained; the timeout prediction model is adjusted according to the model adjustment parameters to obtain an adjusted timeout prediction model; the collection parameters of the collection device for collecting data from the to-be-collected device are re-obtained, and the re-obtained collection parameters are input into the adjusted timeout prediction model, and the new target timeout period is obtained. This method realizes the adjustment of the timeout prediction model, avoids the unlimited growth of the target timeout period, and improves the matching degree of the target timeout period with the collection device and the to-be-collected device.
[0098] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0099] The following is an embodiment of the method of the present application. For details not disclosed in the embodiment of the method of the present application, please refer to the above-mentioned system embodiment of the present application.
[0100] This embodiment also provides a timeout determination device, such as Figure 8 As shown, the device comprises:
[0101] The acquisition module 801 is used to acquire the collection quantity and business environment of the equipment to be collected, and acquire the equipment performance of the collection equipment;
[0102] Determination module 802, used to determine the target timeout determination strategy according to the number of collection devices to be collected, the business environment and the device performance of the collection device;
[0103] The determination module 802 is further configured to determine a strategy according to a target timeout period to determine a target timeout period when a collection device collects data from a device to be collected.
[0104] In some examples, the determination module 802 is also used to obtain multiple pre-set timeout determination strategies; match the collection quantity, business environment, and device performance of the collection device with each timeout determination strategy, and determine the target timeout determination strategy based on the matching results.
[0105] In some examples, the target timeout determination strategy is a first timeout determination strategy. According to the target timeout determination strategy, the determination module 802 is also used to control the acquisition device to perform multiple data acquisitions on the acquisition device, and obtain the data acquisition time when each data acquisition is successful; after the number of data collection times reaches a preset target collection number, the multiple data collection times are sorted; and the target timeout is determined according to the sorting result.
[0106] In some examples, the determination module 802 is also used to obtain a pre-set standard collection time, and control the collection device to collect data from the device to be collected within the standard collection time; if the collection device fails to collect data from the device to be collected within the standard collection time, the standard collection time is increased according to a pre-set growth rule; the collection device is controlled to collect data from the device to be collected within the increased standard collection time, and the data collection time when the collection device successfully collects data from the device to be collected is obtained.
[0107] In some examples, the target timeout determination strategy is the second timeout determination strategy, and the determination module 802 is also used to obtain the collection parameters of the collection device for collecting data from the collection device; the collection parameters are input into the pre-selected timeout prediction model to obtain the target timeout time output by the timeout prediction model.
[0108] In some examples, the determination module 802 is also used to control the collection device to collect data from the other collection device within the target timeout period; if there is a data collection timeout failure when the collection device collects data from the other collection device within the timeout period, the target timeout period is increased according to a predetermined growth rule to obtain a new target timeout period.
[0109] In some examples, the determination module 802 is also used to control the acquisition device to collect data from the target acquisition device within the new target timeout time; if there is a data collection timeout failure when the acquisition device collects data from the target acquisition device within the new target timeout time, and the number of data collection timeout failures exceeds the preset failure threshold number, then obtain the model adjustment parameters of the acquisition device when collecting data from the target acquisition device within the target timeout time; adjust the timeout prediction model according to the model adjustment parameters to obtain the adjusted timeout prediction model; re-acquire the acquisition parameters of the acquisition device for collecting data from the target acquisition device, and input the re-acquired acquisition parameters into the adjusted timeout prediction model, and the new target timeout time.
[0110] According to the technical solution provided in the embodiment of the present application, the device provided in the present embodiment obtains the equipment performance of the collection device by obtaining the collection quantity and business environment of the equipment to be collected; determines the target timeout determination strategy according to the collection quantity, business environment and equipment performance of the equipment to be collected; determines the target timeout time when the collection device collects data from the equipment to be collected according to the target timeout determination strategy. The present application realizes the dynamic determination of the target timeout determination strategy, so that the target timeout determination strategy can be more in line with the actual situation of the equipment to be collected and the collection device. Subsequently, the target timeout time is dynamically determined according to the target timeout determination strategy, so that the target timeout time can be more in line with the actual situation of the equipment to be collected and the collection device, so that the target timeout time can meet the data collection requirements of the equipment to be collected and the collection device, and avoids the problem of using a fixed timeout time and failing to meet the data collection requirements of the equipment.
[0111] Fig. 9 Schematic diagram of an electronic device 9 provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 9 of this embodiment includes: a processor 901, a memory 902, and a computer program 903 stored in the memory 902 and executable on the processor 901. When the processor 901 executes the computer program 903, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 901 executes the computer program 903, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0112] The electronic device 9 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 9 may include, but is not limited to, a processor 901 and a memory 902. Those skilled in the art will appreciate that Fig. 9 The electronic device 9 is merely an example and does not limit the electronic device 9 , and may include more or less components than those shown in the figure, or different components.
[0113] The processor 901 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0114] The memory 902 may be an internal storage unit of the electronic device 9, for example, a hard disk or memory of the electronic device 9. The memory 902 may also be an external storage device of the electronic device 9, for example, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 9. The memory 902 may also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 902 is used to store computer programs and other programs and data required by the electronic device.
[0115] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0116] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of regional requirements and patent practice. For example, in some areas, according to regional requirements and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0117] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for determining a timeout, characterized in that: The method comprises: Obtain the collection quantity and business environment of the equipment to be collected, and obtain the equipment performance of the collection equipment; Determine a target timeout determination strategy according to the collection quantity of the to-be-collected device, the business environment, and the device performance of the collection device; According to the target timeout determination strategy, a target timeout is determined when the acquisition device acquires data from the device to be acquired.
2. The method according to claim 1, characterized in that Determining a target timeout determination strategy according to the number of collections of the to-be-collected devices, the business environment, and the device performance of the collection devices includes: Get multiple preset timeout determination strategies; The collection quantity, the business environment, and the device performance of the collection device are matched with each of the timeout determination strategies, and the target timeout determination strategy is determined according to the matching result.
3. The method according to claim 1, characterized in that The target timeout determination strategy is a first timeout determination strategy, and according to the target timeout determination strategy, a target timeout when the acquisition device acquires data from the device to be acquired is determined, including: Control the acquisition device to perform multiple data acquisitions on the device to be acquired, and obtain the data acquisition time when each data acquisition is successful; After the number of data collection times reaches a preset target number of data collection times, the plurality of data collection times are sorted; The target timeout period is determined according to the sorting result.
4. The method according to claim 3, characterized in that Controlling the acquisition device to perform multiple data acquisitions on the device to be acquired, and obtaining the data acquisition time when each data acquisition is successful, including: Obtaining a preset standard collection time, and controlling the collection device to collect data from the device to be collected within the standard collection time; If the acquisition device fails to collect data from the device to be collected within the standard acquisition time, the standard acquisition time is increased according to a pre-set growth rule; The acquisition device is controlled to perform data acquisition on the device to be acquired within the increased standard acquisition time, and the data acquisition time when the acquisition device successfully acquires data from the device to be acquired is obtained.
5. The method according to claim 1, characterized in that The target timeout determination strategy is a second timeout determination strategy. According to the target timeout determination strategy, the target timeout when the acquisition device acquires data from the device to be acquired is determined, including: Acquiring acquisition parameters for the acquisition device to acquire data from the device to be acquired; The acquisition parameters are input into a preset timeout prediction model to obtain the target timeout time output by the timeout prediction model.
6. The method according to claim 5, characterized in that After determining the target timeout time when the acquisition device acquires data from the device to be acquired, the method further includes: Control the acquisition device to collect data from the device to be collected within the target timeout period; If a data collection timeout failure occurs when the collection device collects data from the device to be collected within the target timeout time, the target timeout time is increased according to a predetermined growth rule to obtain a new target timeout time.
7. The method according to claim 6, characterized in that After increasing the target timeout period according to a predetermined growth rule to obtain a new target timeout period, the method further includes: Control the acquisition device to collect data from the device to be collected within the new target timeout period; If a data collection timeout failure occurs when the collection device collects data from the device to be collected within the new target timeout period, and the number of data collection timeout failures exceeds a preset failure threshold number, then obtaining a model adjustment parameter when the collection device collects data from the device to be collected within the target timeout period; Adjust the timeout prediction model according to the model adjustment parameter to obtain an adjusted timeout prediction model; The acquisition parameters of the acquisition device for data acquisition on the device to be acquired are reacquired, and the reacquired acquisition parameters are input into the adjusted timeout prediction model to obtain a new target timeout time.
8. A timeout determination device, characterized in that: The device comprises: An acquisition module is used to obtain the collection quantity and business environment of the equipment to be collected, and obtain the equipment performance of the collection equipment; A determination module, configured to determine a target timeout determination strategy according to the collection quantity of the to-be-collected device, the business environment, and the device performance of the collection device; The determination module is further configured to determine a target timeout period when the acquisition device acquires data from the device to be acquired according to the target timeout period determination strategy.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.