Offline transaction control method, state prediction model training method and device
By obtaining and integrating historical log data of the online operating environment, and dynamically adjusting offline transaction status using the state prediction model, the problems of low efficiency and poor stability of traditional offline transaction management are solved, and intelligent management and environmental stability are improved.
Patent Information
- Application Number
- CN202510771546.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-10
AI Technical Summary
Traditional offline transaction management relies on static rules and manual adjustments, resulting in low efficiency and easy human errors, slow processing speed when the machine load is high, low interface success rate, and easy interruption of data transmission, affecting the smooth progress of the plan.
By obtaining the historical log of the online operating environment, extracting transaction status and device resource data, performing data integration and formatting, inputting it into the pre-trained state prediction model, obtaining intervention strategies to dynamically adjust offline transaction status to avoid conflicts.
It realizes intelligent management of offline transactions, reduces manual intervention costs, improves the stability and efficiency of the online operating environment, and ensures the efficient operation of online transactions.
Smart Images

Figure CN120295719A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular, to an offline transaction control method, a state prediction model training method, and an apparatus. Background Art
[0002] Traditional offline transaction management relies on static rules and manual adjustment. Static rules mean that the set plan management criteria lack flexibility and are difficult to update in real time according to changes in the actual situation. Manual adjustment overly relies on manual operations, with low efficiency and prone to human errors. In the scenario of batch plan operation, when the machine load is high, it will lead to a slow processing speed and an increased risk of failures; when the interface success rate is low, data transmission is prone to interruption, affecting the smooth progress of the entire plan. Summary of the Invention
[0003] This specification provides an offline transaction control method, a state prediction model training method, and an apparatus, aiming to optimize the control process of offline transactions and thus enhance the user experience. The technical solutions are as follows: In a first aspect, an embodiment of this specification provides an offline transaction control method, which includes: If an offline transaction in an online operating environment is in a running state, obtain the online operation logs corresponding to the online operating environment within a preset historical duration before the current moment; Extract transaction status data and device resource data from the online log data, and perform data integration on the transaction status data and the device resource data to obtain a formatted operation log; Input the formatted operation log into a pre-trained state prediction model to obtain a prediction result of the impact of the offline transaction on the environmental state of the online operating environment; Obtain a state intervention strategy corresponding to the prediction result, and adjust the running state of the offline transaction based on the state intervention strategy.
[0004] In a second aspect, an embodiment of this specification provides a state prediction model training method, which includes: Obtain preset training samples and test samples, where the training samples are the actual running states corresponding to the online operating environment under different transaction status data and device resource data, and the test samples are composed of multiple different transaction status data and device resource data; Input the training samples into the state prediction model to obtain a predicted running state, and call the mean square error loss function to calculate the state error between the predicted running state and the actual running state; Call the backpropagation algorithm to adjust the model parameters of the state prediction model based on the state error so that the mean square error loss function reaches a convergent state; Test the state prediction model based on test samples to determine the training state of the state prediction model.
[0005] In a third aspect, an embodiment of this specification provides a control device for offline transactions, including: A log acquisition unit: configured to, if an offline transaction in an online operating environment is in a running state, acquire the online operating logs corresponding to the online operating environment within a preset historical duration before the current moment; A data processing unit: configured to extract transaction state data and device resource data from the online log data, and perform data integration on the transaction state data and the device resource data to obtain a formatted operating log; A result prediction unit: configured to input the formatted operating log into a pre-trained state prediction model to obtain a prediction result of the impact of the offline transaction on the environmental state of the online operating environment; A state adjustment unit: configured to acquire a state intervention strategy corresponding to the prediction result, and adjust the running state of the offline transaction based on the state intervention strategy.
[0006] In a fourth aspect, an embodiment of this specification provides a training device for a state prediction model, including: A sample acquisition unit, configured to acquire preset training samples and test samples, where the training samples are the true running states corresponding to the online operating environment under different transaction state data and device resource data, and the test samples are composed of multiple different transaction state data and device resource data; A sample processing unit, configured to input the training samples into the state prediction model to obtain a predicted running state, and call a mean square error loss function to calculate the state error between the predicted running state and the true running state; A parameter adjustment unit, configured to call a backpropagation algorithm to adjust the model parameters of the state prediction model based on the state error so that the mean square error loss function reaches a convergence state; A state determination unit, configured to test the state prediction model based on the test samples to determine the training state of the state prediction model.
[0007] In a fifth aspect, an embodiment of this specification provides an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the computer program is executed by the processor, it implements any one of the above methods.
[0008] In a fourth aspect, an embodiment of this specification provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, it implements any one of the above methods.
[0009] In the above technical solution, by obtaining the online operation logs within a preset historical duration, the operation status and historical trends of the online environment can be comprehensively understood, providing a data basis for subsequent analysis. Secondly, by extracting and integrating the transaction status data and device resource data from the logs, formatted operation logs can be generated, ensuring the structuring and analyzability of the data. Then, by inputting the formatted logs into a pre-trained status prediction model, the impact of offline transactions on the online environment status can be accurately predicted, thereby identifying potential problems in advance. Finally, by obtaining the corresponding status intervention strategies based on the prediction results, the operation status of offline transactions can be dynamically adjusted, avoiding transaction conflicts and ensuring the stable operation of the online operation environment. This process not only realizes the intelligent management of offline transactions but also significantly reduces the cost of manual intervention and improves the environmental stability of the online operation environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of this specification. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0011] Figure 1 is a system architecture diagram of an offline transaction control method provided by an embodiment of this specification; Figure 2 is a flowchart of an offline transaction control method provided by an embodiment of this specification; Figure 3 is a flowchart of an offline transaction control method provided by an embodiment of this specification; Figure 4 is a flowchart of an offline transaction control method provided by an embodiment of this specification; Figure 5 is a flowchart of a state prediction model training method provided by an embodiment of this specification; Figure 6 is a flowchart of a state prediction model training method provided by an embodiment of this specification; Figure 7 is a structural diagram of a control device for an offline transaction provided by an embodiment of this specification; Figure 8 is a structural diagram of a training device for a state prediction model provided by an embodiment of this specification; Figure 9 is a structural diagram of an electronic device provided by an embodiment of this specification. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] To make the features and advantages of this specification more obvious and understandable, the following will describe the technical solutions in the embodiments of this specification clearly and completely in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope protected by this specification.
[0013] The following will describe the technical solutions in this specification clearly and in detail in conjunction with the accompanying drawings. Among them, in the description of the embodiments of this specification, unless otherwise specified, " / " means "or". For example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this specification, "a plurality" means two or more than two.
[0014] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.
[0015] To improve the control efficiency of offline transactions, an embodiment of this specification provides an offline transaction control method. The execution subject of this offline transaction control method is the control device of the offline transaction. This execution device can specifically be a server. The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0016] Please refer to Figure 1 , Figure 1 which is the system architecture diagram to which the offline transaction control method provided by the embodiment of this specification is applied. This system architecture includes a server 110, a gateway 120, the Internet 130, a terminal device 140, etc.
[0017] The terminal device 140 includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, etc. The embodiments of this specification can be applied to various scenarios, including, but not limited to, cloud technology, artificial intelligence, etc. In addition, it can be a single device or a collection of multiple devices combined. For example, multiple desktop computers are connected to each other through a local area network and share a display, etc. to work collaboratively, jointly constituting a terminal device 140. The terminal device 140 can communicate with the Internet 130 in a wired or wireless manner to exchange data.
[0018] Server 110 refers to a computer system that can provide certain services to terminal device 140. Compared with ordinary terminal devices 140, servers 110 have higher requirements in terms of stability, security, performance, etc. Server 110 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0019] The gateway 120 is also known as an internetwork connector and protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. Between two systems that use different communication protocols, data formats, or languages, or even have completely different architectures, the gateway is a translator. At the same time, the gateway can also provide filtering and security functions. Messages sent from terminal device 140 to server 110 need to be sent to the corresponding server 110 through gateway 120. Messages sent from server 110 to terminal device 140 also need to be sent to the corresponding terminal device 140 through gateway 120.
[0020] In the embodiments of this specification, a transaction processing platform pre-loaded by developers runs in server 110. This transaction processing platform is used to provide an online operating environment for transactions. The online operating environment can be used to run offline transactions and online transactions. Among them, an online transaction is a transaction generated by a transaction request initiated by a user in real time through terminal device 140, and an offline transaction is a non-real-time task triggered by an offline transaction platform. A trained state prediction model is loaded and runs in server 110. This state prediction model is used to predict the environmental operating state of the online operating environment based on the online daily data of the online operating environment, and adjust the operating state of the offline transactions in the online operating environment according to the prediction results.
[0021] In the embodiments of this specification, server 110 monitors the transactions in the online operating environment in real time. If it is detected that there is an offline transaction in the running state, an online operating log within a preset historical duration closest to the current moment is obtained from the log database. This online operating log corresponds to the state data generated during the running of each transaction in the online operating environment and the usage data of the hardware resources generated during the running.
[0022] Further, transaction status data and device resource data are extracted from the online log data, where the transaction status data reflects the execution status of each transaction in the online operating environment, and the device resource data records the usage data of the hardware resources of each transaction during operation. Then, each piece of device resource data is traversed one by one to check for missing values, and the missing parts are filled by a preset missing value compensation algorithm. The filled device resource data is compared with a preset threshold. If the data value exceeds the threshold, normalization processing is performed to scale the data to a unified range. The transaction status data and the device resource data are integrated according to the data acquisition timestamps and converted into a formatted operation log.
[0023] The formatted operation log is used as the input of the state prediction model to obtain a prediction result for predicting the impact of offline transactions on the online operating environment. According to the prediction result, the corresponding state intervention strategy is obtained. The state intervention strategy includes a first state intervention strategy and a second state intervention strategy: the first state intervention strategy is used to control the offline transaction to switch from the running state to the stopped state, which is applicable to the situation where the prediction result shows that the offline transaction has a significant negative impact on the online environment; the second state intervention strategy is used to control the offline transaction to maintain the running state, which is applicable to the situation where the prediction result shows that the offline transaction has a small or acceptable impact on the online environment. Based on the selected strategy, the running state of the offline transaction is dynamically adjusted, so as to optimize the execution efficiency of the offline transaction while ensuring the efficient operation of the online transactions in the online operating environment, and to ensure the overall stability of the online operating environment and the optimization of the utilization of hardware resources.
[0024] Based on Figure 1 the system architecture diagram shown below, the following will introduce in detail an offline transaction control method provided in an embodiment of this specification in combination with Figures 2 - 4 .
[0025] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of an offline transaction control method provided in an embodiment of this specification. As Figure 2 shown, the method of the embodiment of this specification may include the following steps S101 - S104.
[0026] It should be noted that in the online operating environment, offline transactions and online transactions can be run simultaneously. An online transaction is a transaction request initiated by a user in real time through a terminal device 140, such as order submission, data query, etc. Its characteristics are high real-time performance and instant response to user operations. Therefore, in the online operating environment, it is necessary to prioritize ensuring the stability and performance of online transactions to meet the real-time needs of users. In contrast, an offline transaction is a non-real-time task triggered by an offline transaction platform, usually executed in a batch processing manner within a specific time period, such as data statistics, report generation, etc. Its operation will occupy hardware resources and have a certain impact on the online operating environment. Therefore, during execution, it is necessary to ensure that the execution of offline transactions does not interfere with the stability of online transactions, and at the same time, through monitoring and optimization means, minimize the negative impact of offline transactions on the online operating environment, thereby ensuring the efficiency and reliability of the online operating environment.
[0027] S101, if the offline transaction in the online operating environment is in a running state, obtain the online operating log corresponding to the online operating environment within a preset historical duration before the current moment.
[0028] In the embodiments of this specification, the online operating environment refers to an environment for real-time online transaction processing. The online operating log records the operations, events, or status information that occur during the operation of each transaction in the online operating environment. An offline transaction refers to a batch processing task triggered by an offline platform in the online operating environment rather than actively initiated by a user through a terminal device 140. Its operation mode is usually in the form of batch processing, that is, a large amount of data is centrally processed or specific operations are executed within a specific time period.
[0029] It should be noted that the offline transaction in the online operating environment can be an offline transaction that is currently in a running state or a to-be-run offline transaction that will meet the preset running conditions.
[0030] Specifically, detect the running state of each offline transaction; if it is detected that there is an offline transaction in a running state, further extract the online operating log of the preset historical duration from the log database of the online operating environment, where the preset historical duration is the most recent historical period from the current moment, and the preset historical duration can be adjusted according to the actual scenario and will not be specifically limited here.
[0031] S102, extract the transaction status data and device resource data from the online log data, and perform data integration on the transaction status data and device resource data to obtain a formatted operating log.
[0032] Specifically, transaction status data and device resource data are extracted from the online log data. Among them, the transaction status data reflects the execution status of the transaction, while the device resource data records the usage data of the offline transactions and / or online transactions in the online operating environment on the hardware resources during operation.
[0033] Further, each piece of device resource data is traversed one by one to check whether there are missing values in each piece of device resource data; if device resource data with missing data is found, a preset missing compensation algorithm will be called to fill in the missing part of the device resource data to ensure the integrity and continuity of the device resource data.
[0034] Obtain the specific data values of the filled device resource data and compare them with the preset data threshold; if the data value exceeds the threshold, it indicates that there is an anomaly or the magnitude is too large. At this time, the data value of the device resource data will be normalized, that is, the data value will be scaled proportionally to a unified range to eliminate the dimension difference and improve the comparability and analyzability of the data.
[0035] Data integration is performed on the extracted transaction status data and device resource data, that is, through operations such as association, matching, and aggregation, the transaction status data and device resource data are uniformly processed according to the timestamp to form a structured data set. Finally, the integrated data is converted into a formatted operation log, that is, the data is organized according to the predefined format and standard to make it convenient for storage, query, and analysis. The core purpose of this process is to generate a structured operation log through in-depth processing of the online operation log, providing data support for environmental monitoring, performance optimization, fault troubleshooting, and post-event auditing, while improving the readability and usability of the online operation log.
[0036] S103, input the formatted operation log into the pre-trained state prediction model to obtain the prediction result of the impact of the offline transaction on the environmental state of the online operating environment.
[0037] Specifically, the formatted operation log is used as the input of the state prediction model. Among them, the formatted operation log refers to the log data that has been structured, and its characteristics are that the data is standardized, easy to parse and analyze; the formatted operation log is input into the pre-trained state prediction model. Among them, the state prediction model is a machine learning or deep learning model trained based on historical data, which can predict the impact of offline transactions on the online operating environment according to the input data; the state prediction model analyzes the key features (such as resource occupancy rate, transaction execution time, error rate, etc.) in the formatted operation log data and outputs the prediction result of the impact of the offline transaction operation on the environmental state of the online operating environment. The core purpose of this process is to predict in advance whether the impact of the offline transaction on the online operating environment will interfere with the running stability and performance of the online transaction through the formatted operation log prediction.
[0038] S104. Obtain the status intervention strategy corresponding to the prediction result, and adjust the running status of the offline transaction based on the status intervention strategy.
[0039] Specifically, according to the prediction result output by the status prediction model, obtain the corresponding status intervention strategy. The status intervention strategy refers to an adjustment plan formulated for the impact of the offline transaction on the online running environment, aiming to ensure the stability of the online transaction and the reasonable allocation of hardware resources. The status intervention strategy includes the first status intervention strategy and the second status intervention strategy. The first status intervention strategy is used to control the offline transaction to switch from the running state to the stopped state, which is applicable to the situation where the prediction result shows that the offline transaction has a significant negative impact on the online environment. The second status intervention strategy is used to control the offline transaction to maintain the running state, which is applicable to the situation where the prediction result shows that the impact of the offline transaction on the online environment is small or acceptable.
[0040] Based on the selected status intervention strategy, dynamically adjust the running status of the offline transaction, such as pausing or continuing to execute the offline transaction, so as to optimize the execution efficiency of the offline transaction while ensuring the efficient operation of the online transaction, thereby ensuring the overall stability of the online running environment and the optimization of the utilization of hardware resources.
[0041] As can be seen from the above, by obtaining the online operation logs within the preset historical duration, the running status and historical trends of the online environment can be comprehensively understood, providing a data basis for subsequent analysis. Secondly, by extracting and integrating the transaction status data and device resource data from the logs, formatted operation logs can be generated to ensure the structuring and analyzability of the data. Then, by inputting the formatted logs into the pre-trained status prediction model, the impact of the offline transaction on the online environment status can be accurately predicted, thereby identifying potential problems in advance. Finally, based on the prediction result, obtaining the corresponding status intervention strategy can dynamically adjust the running status of the offline transaction, avoid transaction conflicts, and ensure the stable operation of the online running environment. This process not only realizes the intelligent management of offline transactions, but also significantly reduces the cost of manual intervention and improves the environmental stability of the online running environment.
[0042] Since the amount of data to be obtained is large, if the data is disorderly during subsequent data analysis, it will extend the duration of data analysis. Please refer to Figure 3 , Figure 3 which is a schematic flowchart of an offline transaction control method provided by an embodiment of this specification. As Figure 3 shown, the method of the embodiment of this specification may include the following steps S201 - S205.
[0043] S201. Obtain the first timestamp corresponding to the transaction status data and the second timestamp corresponding to the device resource data.
[0044] S202. Arrange and integrate the transaction status data and device resource data based on the chronological order of the first timestamp and the second timestamp to generate a formatted operation log.
[0045] Specifically, in S201 - S202, record the acquisition time of the transaction status data as the first timestamp, and record the acquisition time of the device resource data as the second timestamp. Arrange and integrate the transaction status data and device resource data according to the chronological order of the first timestamp and the second timestamp to generate formatted operation data.
[0046] Exemplarily, in the transaction status data, the transaction with transaction ID 001 starts execution at 2023 - 10 - 01 10:00 and is completed at 2023 - 10 - 01 10:05. Meanwhile, in the device resource data, the device with device ID A001 has a processor utilization rate of 80% and a memory utilization rate of 60% at 2023 - 10 - 01 10:02, and a processor utilization rate of 85% and a memory utilization rate of 65% at 2023 - 10 - 01 10:04. Based on the timestamps of these data (2023 - 10 - 01 10:00, 2023 - 10 - 01 10:02, 2023 - 10 - 01 10:04, 2023 - 10 - 01 10:05), after arranging and integrating the transaction status data and device resource data in chronological order, the generated formatted operation log is as follows: 2023 - 10 - 01 10:00 - Transaction 001 starts; 2023 - 10 - 01 10:02 - Device A001 processor utilization rate 80%, memory utilization rate 60%; 2023 - 10 - 01 10:04 - Device A001 processor utilization rate 85%, memory utilization rate 65%; 2023 - 10 - 01 10:05 - Transaction 001 is completed.
[0047] S203. Traverse the device resource data. If there is missing data in the device resource data, call a preset missing compensation algorithm to fill in the missing data in the device resource data.
[0048] Specifically, during the processing of device resource data, first traverse the device resource data to check for data missing. For example, in the device resource data, it is recorded that the processor utilization rate of device A001 at 10:02 on October 1, 2023 is 80%, but the data at 10:03 on October 1, 2023 is missing. At this time, call the preset missing compensation algorithm, such as interpolation based on time series. According to the data at the previous and subsequent time points, such as 80% at 10:02 on October 1, 2023 and 85% at 10:04 on October 1, 2023, calculate that the processor utilization rate at 10:03 on October 1, 2023 is 82.5%, so as to fill in the missing data and ensure the integrity of the device resource data.
[0049] S204. Obtain the data value of the device resource data after data filling.
[0050] S205. If the data value is greater than the preset data threshold, perform data normalization processing on the device resource data.
[0051] Specifically, in S204 - S205, after completing data filling, the specific value of the filled device resource data will be obtained and the filled device resource data value will be compared with the preset data threshold to perform data normalization processing on the device resource data to ensure that each data point of the device resource data is within the preset range. Among them, the data value of the device resource data can specifically be the utilization rate of the processor.
[0052] Exemplarily, if the data threshold is 80% and the data value of the device resource data of device A001 is 70%, it is normalized to 0. If the data value of the device resource data of device A002 is 90%, the device resource data of device A002 is normalized to 1.
[0053] As can be seen from the above, arranging and integrating data based on timestamps to generate structured operation logs is convenient for subsequent analysis and traceability; secondly, by data traversal and missing compensation algorithms, missing values in device resource data are filled to avoid errors caused by incomplete data; finally, through data trimming and normalization processing, the device resource data is controlled within the preset range, unifying the data scale, and improving the processability and interpretability of the data. It not only optimizes the data quality, but also provides reliable data support for the monitoring of the running state of the operating environment, fault troubleshooting, and performance optimization, significantly improving the stability of the operating environment and the accuracy of decision-making.
[0054] Since online transactions are real-time transactions initiated by users actively, when the prediction result is that an offline transaction will affect the online operating environment and thus affect the running state of the online transaction, it is necessary to adopt an intervention strategy in a timely manner to ensure the environmental stability of the online operating environment. Please refer to Figure 4, Figure 4 is a schematic flowchart of an offline transaction control method provided by an embodiment of this specification. As Figure 4 shown, the method of the embodiment of this specification may include the following steps S301 - S303.
[0055] S301, obtain a status intervention strategy corresponding to a prediction result, and adjust the running status of the offline transaction based on the status intervention strategy.
[0056] Specifically, for the specific execution process of S301, please refer to the above S103, which will not be elaborated here.
[0057] S302, if the status intervention strategy is the first status intervention strategy, then control the offline transaction to switch from the running state to the stopped state.
[0058] S303, if the status intervention strategy is the second status intervention strategy, then control the offline transaction to maintain the running state.
[0059] Specifically, in S302 - S303, the first status intervention strategy is used to control the offline transaction to switch from the running state to the stopped state, which is applicable to the situation where the prediction result shows that the offline transaction has a significant negative impact on the online environment. The second status intervention strategy is used to control the offline transaction to maintain the running state, which is applicable to the situation where the prediction result shows that the offline transaction has a small or acceptable impact on the online environment.
[0060] Exemplarily, the offline transaction A is running to process a batch of data. When the prediction result is that the online running environment is abnormal, the first status intervention strategy is triggered. At this time, the offline transaction A is immediately switched from the running state to the stopped state to release resources and avoid resource overload. On the contrary, if the prediction result is that the online running environment is normal, the second status intervention strategy will be adopted to keep the offline transaction A running continuously to ensure the smooth completion of the data processing task.
[0061] As can be seen from the above, by invoking the first status intervention strategy or the second status intervention strategy according to the prediction result of the status prediction model, the status of the offline transaction can be dynamically adjusted according to the actual running environment and resource conditions, thereby optimizing resource utilization and enhancing the running stability of the online running environment.
[0062] Based on Figure 1 the system architecture diagram shown below, a method for training a status prediction model provided by an embodiment of this specification will be introduced in detail. Figures 5 - 6 Please refer to
[0063] See Figure 5 , Figure 5 is a schematic flowchart of a method for training a status prediction model provided by an embodiment of this specification. As Figure 5As shown in the figure, the method of the embodiments of this specification may include the following steps S401 - S404.
[0064] S401, obtain preset training samples and test samples.
[0065] Specifically, first extract transaction status data and device resource data from the historical operation logs. The transaction status data refers to various status information during the execution of transactions, such as start time, end time, execution result, etc. The device resource data refers to the usage of hardware resources during operation, such as processors, memory, disks, etc. Subsequently, perform data cleaning and preprocessing on these data, including removing noise (i.e., deleting outliers or invalid data), filling missing values (i.e., reasonably filling the blank parts in the data), normalizing (i.e., scaling the data to a unified range, such as between 0 and 1), etc., to ensure data quality.
[0066] Divide the data set into training samples and test samples. The training samples are used for training the state prediction model, and the test samples are used for evaluating the performance of the state prediction model. In this specification, usually the cross - validation method (i.e., dividing the data set into multiple subsets and taking turns as the training set and the test set) or the chronological division method (i.e., dividing the data in chronological order to avoid future data leakage into the training set) is adopted to ensure that the distributions of the training samples and the test samples are consistent and there is no data leakage. At the same time, extract key features from the original data according to business requirements, such as transaction execution time, resource occupancy rate, concurrency, etc., and perform feature selection (i.e., selecting the features most useful for model prediction) or dimensionality reduction (i.e., reducing the number of features to reduce computational complexity) to improve the training efficiency of the state prediction model.
[0067] S402, input the training samples into the state prediction model to obtain the predicted running state, and call the mean squared error loss function to calculate the state error between the predicted running state and the actual running state.
[0068] Specifically, input the feature data of the training samples into the state prediction model. The state prediction model can be a machine - learning - based model or a deep - learning model. For example, LSTM (Long Short - Term Memory) is a deep - learning model suitable for time - series data that can capture long - term dependencies in the data, and Transformer is a deep - learning model based on self - attention mechanism suitable for processing complex sequence data. The model generates the predicted running state according to the input features, such as resource occupancy rate, transaction success rate, etc. Then, call the mean squared error loss function to calculate the error between the predicted running state and the actual running state. The mean squared error loss function is a commonly used regression model evaluation metric and will not be elaborated here.
[0069] In S403, the backpropagation algorithm is called to adjust the model parameters of the state prediction model based on the state error, so that the mean squared error loss function reaches a converged state.
[0070] Specifically, the backpropagation algorithm is an optimization algorithm for training neural networks. It calculates the gradient of the loss function with respect to the state prediction model parameters by backpropagating the error layer by layer from the output layer using the chain rule. Subsequently, optimization algorithms such as SGD (Stochastic Gradient Descent) and Adam (Adaptive Moment Estimation) are used to update the model parameters based on the gradient. Stochastic Gradient Descent is a method of iteratively updating parameters to minimize the loss function, and Adam is an optimization algorithm that combines momentum and adaptive learning rate and can accelerate model convergence.
[0071] Repeat the above process until the mean squared error loss function reaches a converged state (i.e., the loss value tends to be stable or reaches a preset threshold), thereby completing the training process of the state prediction model.
[0072] In S404, the state prediction model is tested based on the test samples to determine the training status of the state prediction model.
[0073] Specifically, the test samples are input into the trained state prediction model to generate the predicted operating state, calculate the error between the prediction result and the true state, and use evaluation metrics such as mean squared error, mean absolute error, R², etc. to quantify the performance of the state prediction model. The mean squared error and mean absolute error are used to measure the deviation between the predicted value and the true value, and R² is used to measure the model's ability to explain the data. If the model performance does not meet the expectations, then return to the above S401 to re-adjust the sample division, feature engineering, or model structure. If the performance meets the standard, then save the state prediction model and deploy it to the actual environment to provide support for the state prediction of the online operating environment for offline transactions.
[0074] As can be seen from the above, through high-quality sample data preparation and feature engineering, the state prediction model can capture the key operating rules and provide a reliable basis for subsequent predictions. Secondly, through iterative training of the loss function and optimization algorithm, the state prediction model can gradually reduce the prediction error and improve the prediction accuracy. Finally, the performance evaluation based on the test samples ensures the generalization ability and reliability of the state prediction model, enabling it to adapt to complex changes in the actual environment. This process not only realizes the accurate prediction of the impact of offline transactions but also provides a scientific basis for resource scheduling, thereby improving the overall operating efficiency and stability and reducing the risk of resource conflicts and performance degradation.
[0075] To further improve the prediction accuracy of the state prediction model, please refer toFigure 6 , Figure 6 is a schematic flowchart of a method for training a state prediction model provided by an embodiment of this specification. As Figure 6 shown, the method of the embodiment of this specification may include the following steps S501 - S503.
[0076] S501: Input a test sample into the state prediction model to obtain a predicted operating state. The test sample consists of multiple different transaction state data and device resource data.
[0077] Specifically, input the test sample into the state prediction model. The test sample consists of multiple different transaction state data and device resource data. Among them, the transaction state data refers to various state information during the execution of a transaction, such as start time, end time, execution result, etc. The device resource data refers to the usage of hardware resources, such as processors, memory, disks, etc. in the online operating environment during operation; the state prediction model is an algorithm model that predicts future operating states by learning the laws of historical data and can be a model based on machine learning or deep learning; generate a predicted operating state according to the feature data of the test sample, such as resource occupancy rate, transaction success rate, etc., to provide a data basis for subsequent performance evaluation.
[0078] S502: Based on the actual operating state and the predicted operating state, determine the state prediction accuracy rate of the state prediction model.
[0079] Specifically, determine the state prediction accuracy rate of the state prediction model based on the actual operating state and the predicted operating state. The actual operating state refers to the actual recorded transaction and device resource states in the test sample, and the predicted operating state refers to the prediction result generated by the state prediction model according to the test sample; the state prediction accuracy rate is the core index to measure the prediction performance of the state prediction model and is usually determined by calculating the matching degree between the predicted value and the true value. For example, use classification accuracy (for classification tasks) or error rate (for regression tasks); by comparing the actual state and the predicted state, quantify the prediction ability of the state prediction model and provide an objective basis for the performance evaluation of the state prediction model.
[0080] Exemplarily, the prediction result of the state prediction model for the test sample is: the execution success rate of offline transaction A is 95%, and the resource occupancy rate caused by offline transaction B is 80%. While the actual operating state shows that the execution success rate of offline transaction A is 96%, and the resource occupancy rate caused by offline transaction B is 78%; determine the state prediction accuracy rate by calculating the error between the predicted value and the true value, such as using mean square error or absolute error. For example, the calculated accuracy rate is 92%, indicating that the prediction result of the state prediction model has a high matching degree with the actual state.
[0081] S503. If the state prediction accuracy rate is greater than or equal to a preset accuracy rate threshold, determine that the training state is the training completion state.
[0082] Specifically, compare the state prediction accuracy rate with the preset accuracy rate threshold. The accuracy rate threshold is the lowest acceptable standard set according to business requirements and state prediction model performance requirements. If the state prediction accuracy rate is greater than or equal to the preset accuracy rate threshold, determine that the training state is the training completion state, indicating that the state prediction model has reached the expected performance and can be deployed to the actual environment. If the state prediction accuracy rate is lower than the threshold, it is necessary to return to the training stage of the state prediction model, readjust the state prediction model parameters, optimize the feature engineering, or increase the training data until the performance requirements are met.
[0083] Exemplarily, the preset accuracy rate threshold is 90%. Since the state prediction accuracy rate (92%) of the state prediction model is greater than the threshold, determine that the training state is the training completion state, indicating that the state prediction model performance meets the standard and can be deployed to the actual environment. If the accuracy rate is lower than 90%, it is necessary to retrain the state prediction model or optimize the data until the performance requirements are met. Through this process, it is possible to ensure that the prediction ability of the state prediction model meets the actual needs.
[0084] As can be seen from the above, by inputting the test samples into the state prediction model and generating the predicted running state, it is possible to verify the processing ability of the state prediction model for complex transactions and resource data, providing a data basis for performance evaluation. Secondly, by comparing the real running state and the predicted running state, it is possible to quantify the prediction accuracy rate of the state prediction model and objectively measure its prediction ability. Finally, by comparing with the preset accuracy rate threshold, it is possible to determine whether the state prediction model has reached the expected performance, thereby deciding whether to deploy or further optimize. This process not only ensures the prediction accuracy and stability of the state prediction model, but also provides a scientific basis for resource scheduling and optimization in the actual environment, reducing the risk of transaction conflicts caused by prediction errors and improving the overall operation efficiency and intelligent level.
[0085] Based on Figure 1 the system architecture, the control device for offline transactions provided in the embodiments of this specification will be introduced in detail below in combination with Figure 7 , It should be noted that Figure 7 the control device for offline transactions in Figures 2 - 4 is used to execute the method of the embodiments shown in this specification. For the sake of convenience of description, only the parts related to the embodiments of this specification are shown. For the specific technical details not disclosed, please refer to the embodiments shown in this specification Figures 2 - 4 The control device 600 for offline transactions may include a log acquisition unit 601, a data processing unit 602, a result prediction unit 603, and a state adjustment unit 604, as follows: Log acquisition unit 601: If the offline transaction in the online operating environment is in a running state, it is used to acquire the online operating logs corresponding to the online operating environment within a preset historical duration before the current moment; Data processing unit 602: It is used to extract transaction status data and device resource data from the online log data, integrate the transaction status data and device resource data, and obtain the formatted operating logs; Result prediction unit 603: It is used to input the formatted operating logs into a pre-trained status prediction model to obtain the prediction results generated by the offline transaction on the environmental status of the online operating environment; Status adjustment unit 604: It is used to obtain the status intervention strategy corresponding to the prediction result and adjust the running state of the offline transaction based on the status intervention strategy.
[0086] In some embodiments, the data processing unit 602 further includes a timestamp acquisition unit and a log generation unit.
[0087] Timestamp acquisition unit: It is used to acquire the first timestamp corresponding to the transaction status data and the second timestamp corresponding to the device resource data; Log generation unit: It is used to arrange and integrate the transaction status data and device resource data based on the chronological order of the first timestamp and the second timestamp, and generate the formatted operating logs.
[0088] In some embodiments, the data processing unit 602 further includes a data traversal unit.
[0089] Data traversal unit: It is used to traverse the device resource data. If there is data missing in the device resource data, it calls a preset missing compensation algorithm to fill in the missing data of the device resource data.
[0090] In some embodiments, the data processing unit 602 further includes a data value acquisition unit and a numerical comparison unit.
[0091] Data value acquisition unit: It is used to acquire the data value of the device resource data after data filling; Numerical comparison unit: If the data value is greater than a preset data threshold, it is used to perform data normalization processing on the device resource data.
[0092] In some embodiments, the data processing unit 602 further includes a first determination unit and a second determination unit.
[0093] First determination unit: If the status intervention strategy is the first status intervention strategy, it is used to control the offline transaction to switch from the running state to the stopped state; Second determination unit: If the status intervention strategy is the second status intervention strategy, it is used to control the offline transaction to maintain the running state.
[0094] In the embodiments of this specification, by obtaining the online operation logs within a preset historical duration, the operation status and historical trends of the online environment can be comprehensively understood, providing a data basis for subsequent analysis. Secondly, by extracting the transaction status data and device resource data from the logs and integrating them, a formatted operation log can be generated to ensure the structuring and analyzability of the data. Then, by inputting the formatted log into a pre-trained status prediction model, the impact of offline transactions on the online environment status can be accurately predicted, thereby identifying potential problems in advance. Finally, based on the prediction results, the corresponding status intervention strategies are obtained, enabling the dynamic adjustment of the operation status of offline transactions, avoiding transaction conflicts, and ensuring the stable operation of the online operation environment. This process not only realizes the intelligent management of offline transactions but also significantly reduces the cost of manual intervention and improves the environmental stability of the online operation environment.
[0095] Based on Figure 1 the system architecture, the training device of the status prediction model provided in the embodiments of this specification will be introduced in detail below in conjunction with Figure 8 . It should be noted that Figure 8 the training device of the status prediction model in Figures 5 - 6 is used to execute the method of the embodiments shown in this specification. For the sake of convenience of description, only the parts related to the embodiments of this specification are shown. For the specific technical details not disclosed, please refer to the embodiments shown in this specification Figures 5 - 6 . Among them, the training device 700 of the status prediction model may include a sample acquisition unit 701, a sample processing unit 702, a parameter adjustment unit 703, and a status determination unit 704, which are specifically as follows: The sample acquisition unit 701 is used to obtain preset training samples and test samples. The training samples are the true operation statuses corresponding to the online operation environment under different transaction status data and device resource data, and the test samples are composed of multiple different transaction status data and device resource data; The sample processing unit 702 is used to input the training samples into the status prediction model to obtain the predicted operation status, and call the mean square error loss function to calculate the status error between the predicted operation status and the true operation status; The parameter adjustment unit 703 is used to call the backpropagation algorithm to adjust the model parameters of the status prediction model based on the status error so that the mean square error loss function reaches a convergent state; The status determination unit 704 is used to test the status prediction model based on the test samples to determine the training status of the status prediction model.
[0096] In some embodiments, the status determination unit 704 further includes a predicted status acquisition unit, a prediction accuracy acquisition unit, and a status determination unit.
[0097] A prediction status acquisition unit, configured to input a test sample into a status prediction model to obtain a predicted operating status, where the test sample is composed of a plurality of different transaction status data and device resource data; A prediction accuracy acquisition unit, configured to determine the status prediction accuracy of the status prediction model based on the actual operating status and the predicted operating status; A status determination unit, configured to determine that the training status is a training completion status if the status prediction accuracy is greater than or equal to a preset accuracy threshold.
[0098] In addition, the control device for offline transactions provided in the above embodiment, the embodiment of the offline transaction control method, the training device for the status prediction model, and the method for training the status prediction model belong to the same concept. The implementation process is shown in detail in the method embodiment and will not be elaborated here.
[0099] The serial numbers of the embodiments in this specification are only for description and do not represent the superiority or inferiority of the embodiments. In some cases, the actions or steps recited in the claims may be executed in a different order from those in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0100] Please refer to Figure 9 , which is a schematic structural diagram of an electronic device provided by an embodiment of this specification. As Figure 9 shown, the electronic device 800 includes a processor 801 and a memory 802. Among them, the processor 801 is electrically connected to the memory 802.
[0101] The processor 801 is the control center of the electronic device 800 and may include one or more processing cores. The processor 801 connects various parts of the entire electronic device through various interfaces and lines. By running or calling the computer programs stored in the memory 802 and calling the data stored in the memory 802, it executes various functions of the electronic device and processes data, thereby exercising overall control over the electronic device. Optionally, the processor 801 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), or programmable logic array (PLA). The processor 801 may integrate a combination of one or several of a processor, a graphics processing unit (GPU), and a modem, etc. Among them, the processor mainly processes the operating system, user interfaces, and application programs, etc.; the GPU is responsible for rendering and drawing the displayed content; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 801 and may be implemented separately through a communication chip.
[0102] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and controls offline transactions by running the computer programs and modules stored in the memory 802. The memory 802 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, computer programs required for at least one function, etc.; the data storage area can store data created according to the use of the electronic device.
[0103] In addition, the memory 802 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. Correspondingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0104] In the embodiments of this specification, the processor 801 in the electronic device 800 loads the instructions corresponding to the processes of one or more computer programs into the memory 802 according to the following steps, and the processor 801 runs the computer programs stored in the memory 802 to implement various functions as follows: If the offline transaction in the online operating environment is in a running state, obtain the online operation logs corresponding to the online operating environment within a preset historical duration before the current moment; extract the transaction status data and device resource data from the online log data, perform data integration on the transaction status data and device resource data to obtain a formatted operation log; input the formatted operation log into a pre-trained state prediction model to obtain a prediction result of the impact of the offline transaction on the environmental state of the online operating environment; obtain the state intervention strategy corresponding to the prediction result, and adjust the running state of the offline transaction based on the state intervention strategy.
[0105] Optionally, when the processor 801 performs data integration on the transaction status data and device resource data to obtain a formatted operation log, it specifically performs: obtaining a first timestamp corresponding to the transaction status data and a second timestamp corresponding to the device resource data; arranging and integrating the transaction status data and device resource data based on the time sequence of the first timestamp and the second timestamp to generate a formatted operation log.
[0106] Optionally, after the processor 801 obtains the first timestamp corresponding to the transaction status data and the second timestamp corresponding to the device resource data, it specifically performs: traversing the device resource data, and if there is data missing in the device resource data, calling a preset missing compensation algorithm to fill in the missing data in the device resource data.
[0107] Optionally, after the processor 801 calls a preset missing compensation algorithm to fill in the missing data in the device resource data to obtain the target device resource data, it specifically performs: obtaining the data value of the device resource data after data filling; if the data value is greater than a preset data threshold, performing data normalization processing on the device resource data.
[0108] Optionally, when the processor 801 obtains the state intervention strategy corresponding to the prediction result and adjusts the running state of the offline transaction based on the state intervention strategy, it specifically performs: if the state intervention strategy is the first state intervention strategy, controlling the offline transaction to switch from the running state to the stopped state; if the state intervention strategy is the second state intervention strategy, controlling the offline transaction to maintain the running state.
[0109] In the embodiments of this specification, by obtaining the online operation logs within a preset historical duration, the operation status and historical trends of the online environment can be comprehensively understood, providing a data basis for subsequent analysis. Secondly, by extracting and integrating the transaction status data and device resource data from the logs, formatted operation logs can be generated, ensuring the structuring and analyzability of the data. Then, by inputting the formatted logs into a pre-trained status prediction model, the impact of offline transactions on the online environment status can be accurately predicted, thereby identifying potential problems in advance. Finally, by obtaining the corresponding status intervention strategy based on the prediction results, the operation status of offline transactions can be dynamically adjusted, avoiding transaction conflicts and ensuring the stable operation of the online operation environment. This process not only realizes the intelligent management of offline transactions, but also significantly reduces the cost of manual intervention and improves the environmental stability of the online operation environment.
[0110] In the embodiments of this specification, the processor 801 in the electronic device 800 will also load the instructions corresponding to the processes of one or more computer programs into the memory 802 according to the following steps, and the processor 801 will run the computer programs stored in the memory 802 to implement various functions as follows: Obtain preset training samples and test samples. The training samples are the true operation statuses corresponding to the online operation environment under different transaction status data and device resource data, and the test samples are composed of multiple different transaction status data and device resource data; input the training samples into the status prediction model to obtain the predicted operation status, and call the mean squared error loss function to calculate the status error between the predicted operation status and the true operation status; call the backpropagation algorithm to adjust the model parameters of the status prediction model based on the status error to make the mean squared error loss function reach a convergent state; test the status prediction model based on the test samples to determine the training status of the status prediction model.
[0111] Optionally, when the processor 801 executes the test on the status prediction model based on the test samples to determine the training status of the status prediction model, it specifically executes: input the test samples into the status prediction model to obtain the predicted operation status, and the test samples are composed of multiple different transaction status data and device resource data; determine the status prediction accuracy rate of the status prediction model based on the true operation status and the predicted operation status; if the status prediction accuracy rate is greater than or equal to the preset accuracy rate threshold, determine that the training status is the training completed status.
[0112] In addition, the device provided in the embodiments of this specification may specifically be a chip, a component or a module. The chip may include a connected processor and a memory; wherein, the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute an offline transaction control method and a status prediction model training method provided in the above embodiments.
[0113] An embodiment of this specification also provides a computer-readable storage medium. Computer program code is stored in the computer-readable storage medium. When the computer program code runs on a computer, the computer is caused to execute the above-related method steps to implement an offline transaction control method and a state prediction model training method provided in the above embodiment.
[0114] This specification also provides a computer program product. The computer program product stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above Figures 2 - 4 for the offline transaction control method of the embodiment shown and the above Figures 5 - 6 for the state prediction model training method of the embodiment shown. The specific execution process can refer to Figures 2 - 6 the specific description of the embodiment shown and will not be elaborated here.
[0115] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of this specification are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be elaborated here.
[0116] Through the description of the above embodiments, those skilled in the art can understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0117] In the embodiments provided in this specification, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the displayed or discussed direct coupling or communication connection between relevant ones can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0118] The above content is only the specific implementation manner of this specification, but the protection scope of this specification is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this specification and should be covered by the protection scope of this specification. Therefore, the protection scope of this specification should be subject to the protection scope of the claims.
Claims
1. An offline transaction control method, the method comprising: If the offline transaction in the online operating environment is in a running state, obtain the online operation logs corresponding to the online operating environment within a preset historical duration before the current moment; Extract transaction status data and device resource data from the online log data, and perform data integration on the transaction status data and the device resource data to obtain a formatted operation log; Input the formatted operation log into a pre-trained state prediction model to obtain a prediction result of the impact of the offline transaction on the environmental state of the online operating environment; Obtain a state intervention strategy corresponding to the prediction result, and adjust the running state of the offline transaction based on the state intervention strategy.
2. The method according to claim 1, wherein the performing data integration on the transaction status data and the device resource data to obtain a formatted operation log comprises: Obtain a first timestamp corresponding to the transaction status data and a second timestamp corresponding to the device resource data; Arrange and integrate the transaction status data and the device resource data based on the time order of the first timestamp and the second timestamp to generate the formatted operation log.
3. The method according to claim 2, after obtaining the first timestamp corresponding to the transaction status data and the second timestamp corresponding to the device resource data, the method further comprises: Traverse the device resource data, and if there is missing data in the device resource data, call a preset missing compensation algorithm to fill in the missing data in the device resource data.
4. The method according to claim 3, after calling the preset missing compensation algorithm to fill in the missing data in the device resource data to obtain target device resource data, the method further comprises: Obtain the data value of the device resource data after data filling; If the data value is greater than a preset data threshold, perform data normalization processing on the device resource data.
5. The method according to claim 1, wherein the obtaining a state intervention strategy corresponding to the prediction result and adjusting the running state of the offline transaction based on the state intervention strategy comprises: If the state intervention strategy is a first state intervention strategy, control the offline transaction to switch from the running state to the stopped state; If the state intervention strategy is a second state intervention strategy, control the offline transaction to maintain the running state.
6. A state prediction model training method, the method comprising: Obtain preset training samples and test samples, where the training samples are the true running states corresponding to the online operating environment under different transaction status data and device resource data, and the test samples are composed of multiple different transaction status data and the device resource data; Input the training samples into a state prediction model to obtain a predicted running state, and call a mean square error loss function to calculate the state error between the predicted running state and the true running state; Invoke the backpropagation algorithm to adjust the model parameters of the state prediction model based on the state error, so that the mean square error loss function reaches a converged state; Test the state prediction model based on the test samples to determine the training state of the state prediction model.
7. The method according to claim 6, wherein the testing the state prediction model based on the test samples to determine the training state of the state prediction model comprises: Input the test samples into the state prediction model to obtain a predicted operating state, where the test samples are composed of a plurality of different transaction state data and device resource data; Determine the state prediction accuracy rate of the state prediction model based on the true operating state and the predicted operating state; If the state prediction accuracy rate is greater than or equal to a preset accuracy rate threshold, determine that the training state is a training completed state.
8. An offline transaction control device, comprising: A log acquisition unit: configured to acquire the online operation log corresponding to the online operation environment within a preset historical duration before the current moment if an offline transaction in the online operation environment is in an operating state; A data processing unit: configured to extract transaction state data and device resource data from the online log data, and perform data integration on the transaction state data and the device resource data to obtain a formatted operation log; A result prediction unit: configured to input the formatted operation log into a pre-trained state prediction model to obtain a prediction result of the impact of the offline transaction on the environmental state of the online operation environment; A state adjustment unit: configured to obtain a state intervention strategy corresponding to the prediction result, and adjust the operating state of the offline transaction based on the state intervention strategy.
9. A training device for a state prediction model, comprising: A sample acquisition unit, configured to acquire preset training samples and test samples, where the training samples are the true operating states corresponding to the online operation environment under different transaction state data and device resource data, and the test samples are composed of a plurality of different transaction state data and the device resource data; A sample processing unit, configured to input the training samples into the state prediction model to obtain a predicted operating state, and invoke the mean square error loss function to calculate the state error between the predicted operating state and the true operating state; A parameter adjustment unit, configured to invoke the backpropagation algorithm to adjust the model parameters of the state prediction model based on the state error, so that the mean square error loss function reaches a converged state; A state determination unit, configured to test the state prediction model based on the test samples to determine the training state of the state prediction model.
10. An electronic device, the electronic device comprising: A memory, configured to store executable program code; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
11. A computer-readable storage medium storing a computer program which, when executed, implements the method according to any one of claims 1 to 7.
12. A computer program product having at least one instruction stored thereon, the at least one instruction, when executed by a processor, implementing the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Offline operation aging early warning method and device, electronic equipment and storage medium
CN115599960A
Log pre-analysis and transaction management method for relieving lock conflict
CN116755847A
Transaction management method and device, storage medium and equipment
CN116777518A
Cited By
Dual-mode self-healing method of automatic test system based on virtualization hierarchical monitoring
CN120578561A
Dual-mode self-healing method of automated test system based on virtualization hierarchical monitoring
CN120578561B