A Method and System for Multi-Environment Adaptation of Data Services
By obtaining target environment information and dynamically adjusting the configuration of data services using machine learning algorithms, the problem of inefficient and poor stability of the data service system when deploying cross-environment is solved, and efficient and stable cross-environment adaptation is achieved.
Patent Information
- Application Number
- CN202510239360.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-03
AI Technical Summary
The existing data service systems lack intelligent adaptability during cross-environment deployment and operation, resulting in low adaptation efficiency and poor stability, making it difficult to cope with complex and changing environmental changes.
By obtaining the operating system, hardware configuration and network conditions information of the target environment, using machine learning algorithms to select the most suitable policy from the adaptation policy library, dynamically adjust the configuration parameters of the data service, and monitor performance indicators in real time to optimize the adaptation solution.
Improve the adaptability and stability of data services in different environments, reduce compatibility issues caused by environmental differences, and achieve efficient cross-environment deployment and operation.
Smart Images

Figure CN119743383B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and particularly to a method and system for multi-environment adaptation of data services. Background Art
[0002] With the rapid development of information technology, data services are increasingly widely used in various fields. The requirements and limitations of data services in different environments vary. However, traditional data service systems are often designed based on a single environment and are difficult to effectively cope with the changing requirements of multi-environments and multi-scenarios, which leads to many challenges in cross-environment deployment and operation of data services.
[0003] Most existing adaptation solutions for data services rely on manual configuration and static rules, lacking intelligent self-adaptive capabilities. When facing complex and changing environments, these adaptation solutions often fail to achieve ideal adaptation effects, and may even lead to problems such as unstable operation and low efficiency of data services. Summary of the Invention
[0004] To overcome the problems in the related art, the present disclosure provides a method and system for multi-environment adaptation of data services. The technical solutions of the present disclosure are as follows:
[0005] According to the first aspect of the embodiments of the present disclosure, a method for multi-environment adaptation of data services is provided, including:
[0006] Obtaining environment information of a target environment; the environment information includes operating system information, hardware configuration information, and network condition information;
[0007] Determining a target adaptation scheme according to the environment information;
[0008] Deploying and running a data service in the target environment according to the target adaptation scheme;
[0009] Wherein, after deploying and running the data service in the target environment, adjusting the target adaptation scheme according to the real-time performance metrics of the data service.
[0010] Optionally, adjusting the target adaptation scheme according to the real-time performance metrics of the data service includes:
[0011] Real-time collecting the performance metrics of the data service under the target adaptation scheme;
[0012] Analyzing the change trend of the performance metrics to determine the execution effect of the target adaptation scheme;
[0013] Adjusting and optimizing the target adaptation scheme according to the execution effect to obtain an adjusted and optimized target adaptation scheme;
[0014] Deploying and running the data service in the target environment according to the target adaptation solution includes:
[0015] Executing the deployment and running of the data service in the target environment according to the adjusted and optimized target adaptation solution.
[0016] Optionally, obtaining the environment information of the target environment, including:
[0017] Obtaining the operating system information by reading system files or calling system interfaces;
[0018] Obtaining the hardware configuration information by reading hardware information files or calling hardware interfaces; the hardware configuration information characterizes the specific parameters or configurations of the hardware;
[0019] Determining the network conditions of the target environment by sending test data packets and measuring metrics such as round-trip time and packet loss rate.
[0020] Optionally, determining the target adaptation solution according to the environment information, including:
[0021] According to the environment information, using a machine learning algorithm to obtain a target adaptation strategy from an adaptation strategy library; the adaptation strategy library includes rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies;
[0022] According to the environment information, determining adjustment information for adjusting the configuration information of the data service;
[0023] Evaluating the adjustment information and the target adaptation strategy to determine the target adaptation solution.
[0024] Optionally, evaluating the adjustment information and the target adaptation strategy to determine the target adaptation solution, including:
[0025] Determining adjustment sub-information for adjusting each configuration item by the adjustment information;
[0026] Determining adaptation sub-strategies for adapting each configuration item in the target adaptation strategy;
[0027] Matching the adjustment sub-information and the adaptation sub-strategies for the same adaptation item;
[0028] Based on the environment information, evaluating the adjustment sub-information and the adaptation sub-strategies corresponding to the same adaptation item to determine the target adaptation strategy for the configuration item;
[0029] Determining the target adaptation strategy as the adaptation sub-solution of the target adaptation solution for the configuration item.
[0030] Optionally, determining the adjustment information according to the following steps:
[0031] Determine the operating system configuration parameters of the data service according to the operating system information included in the environment information;
[0032] Determine the first performance tuning parameters of the data service according to the hardware configuration information included in the environment information; the first performance tuning parameters of the data service at least include the concurrency number and cache size of the data service;
[0033] Determine the second performance tuning parameters of the data service according to the network condition information included in the environment information; the second performance tuning parameters of the data service at least include the data transmission rate and retransmission strategy;
[0034] Determine the adjustment information of the data service according to the operating system configuration parameters, the first performance tuning parameters, and the second performance tuning parameters.
[0035] Optionally, deploying and running the data service in the target environment according to the target adaptation solution includes:
[0036] Generate a corresponding deployment file according to the target adaptation solution; the deployment file is a deployment script or a configuration file;
[0037] Deploy the deployment file to the target environment;
[0038] Start the data service based on the deployment file.
[0039] According to a second aspect of the embodiments of the present disclosure, there is provided a multi-environment adaptation system for a data service, including:
[0040] An environment perception module, configured to obtain the environment information of the target environment; the environment information includes operating system information, hardware configuration information, and network condition information;
[0041] An intelligent decision-making module, configured to determine a target adaptation solution according to the environment information;
[0042] A service execution module, configured to deploy and run the data service in the target environment according to the target adaptation solution;
[0043] Wherein, after deploying and running the data service in the target environment, adjust the target adaptation solution according to the real-time performance metrics of the data service.
[0044] Optionally, it further includes:
[0045] A performance monitoring and feedback module, configured to collect in real time the performance metrics of the data service under the target adaptation solution; and feedback the performance metrics to the intelligent decision-making module, so that the intelligent decision-making module adjusts and optimizes the target adaptation solution based on the performance metrics.
[0046] Optionally, it further includes:
[0047] A data service configuration module, configured to determine adjustment information for adjusting the configuration information of the data service according to the environment information;
[0048] An adaptation database, configured to store multiple adaptation strategies, so that the intelligent decision-making module obtains a target adaptation strategy from the adaptation strategy library by using a machine learning algorithm; the multiple adaptation strategies include rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies.
[0049] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: 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, the steps of the data service multi-environment adaptation method described in the first aspect are implemented.
[0050] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, where when the computer program is executed by a processor, the steps of the data service multi-environment adaptation method described in the first aspect are implemented.
[0051] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, where when the computer program is executed by a processor, the steps of the data service multi-environment adaptation method described in the first aspect are implemented.
[0052] By obtaining the environment information of the target environment, the present disclosure can fully understand the characteristics of the target environment and determine the most suitable adaptation solution for this environment, thereby ensuring that the data service can run stably in this environment and reducing compatibility problems caused by environmental differences. The present disclosure obtains environment information and determines the adaptation solution in an automated manner, simplifies the deployment process of the data service, and when the target environment changes, the environment information can be re-obtained and the adaptation solution can be quickly adjusted to meet the new environmental requirements. Since the adaptation method is automatically determined based on the environment information, the data service can be more easily migrated and deployed between different environments, improving the portability of the data service. Description of the Drawings
[0053] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following will briefly introduce the drawings required for the description of the embodiments of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0054] Figure 1 It is a schematic diagram of the steps of a data service multi-environment adaptation method shown in the embodiments of the present disclosure;
[0055] Figure 2 It is a schematic diagram of a data service multi-environment adaptation system shown in the embodiments of the present disclosure;
[0056] Figure 3 It is a schematic diagram of the working process of a data service multi-environment adaptation system shown in the embodiments of the present disclosure;
[0057] Figure 4 It is a schematic diagram of an electronic device shown in the embodiments of the present disclosure. Detailed implementation manners
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present disclosure.
[0059] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects before and after.
[0060] In the prior art, although there are already some data service adaptation solutions, most of them have problems such as low adaptation efficiency, poor adaptability, and high maintenance costs. For example, some data service adaptation solutions achieve data service adaptation through manual configuration, which is not only time-consuming and laborious but also error-prone; some other data service adaptation solutions use hard coding, which improves the adaptation efficiency to a certain extent but lacks flexibility and is difficult to adapt to changing application scenarios.
[0061] To solve the problems existing in the related art, the present disclosure proposes a method for adapting data services to multiple environments. The method can adapt data services based on environment information.
[0062] Figure 1 It is a schematic diagram of the steps of a method for adapting data services to multiple environments shown in an embodiment of the present disclosure. As Figure 1 shown, the method may specifically include the following steps:
[0063] Step S11: Obtain the environment information of the target environment; the environment information includes operating system information, hardware configuration information, and network condition information.
[0064] The operating system information can represent the type, version information, etc. of the operating system. The types of operating systems include Windows, Linux, macOS, etc.
[0065] The hardware configuration information is information related to hardware. For example, for the CPU (Central Processing Unit), the type, quantity, and speed of the CPU can be determined. For the memory, information such as the size of the memory can be determined. For the storage device, the type and capacity of the storage device can be checked.
[0066] The network condition information is information related to network performance. For example, through testing, the bandwidth and latency of the network can be determined.
[0067] Step S12: Determine the target adaptation plan according to the environment information.
[0068] Comprehensively analyze the collected operating system, hardware configuration, and network condition information. Identify any potential problems that may affect the deployment and operation of the data service. According to the analysis results, determine the best deployment method of the data service in the target environment.
[0069] Step S13: Deploy and run the data service in the target environment according to the target adaptation plan.
[0070] Install the data service into the target environment. Start the data service and verify its normal operation, and implement a monitoring mechanism to track the performance and stability of the data service.
[0071] Step S14: Among them, after deploying and running the data service in the target environment, adjust the target adaptation plan according to the real-time performance indicators of the data service.
[0072] When deploying and running a data service in the target environment according to the target adaptation solution, real-time performance metrics of the data service will be obtained. The real-time performance metrics of the data service will have a certain impact on the target adaptation solution, which will cause the target adaptation solution to be adjusted to obtain an adjusted target adaptation solution. After obtaining the adjusted target adaptation solution, the data service will be redeployed and run in the target environment based on the adjusted target adaptation solution.
[0073] By adopting the embodiments of the present disclosure, through accurately perceiving environmental characteristics, it is possible to formulate more appropriate and efficient adaptation solutions for the unique requirements and limitations of different environments, thereby significantly improving the adaptability and stability of data services in various environments. According to the obtained environmental information, it is possible to intelligently select the configuration parameters and resource allocation strategies most suitable for the current environment. Through in-depth analysis of the environmental information, potential performance bottlenecks and fault points can be identified, so as to take preventive measures in advance and reduce the probability of faults occurring.
[0074] Among them, in an optional embodiment, adjusting the target adaptation solution according to the real-time performance metrics of the data service includes: collecting in real time the performance metrics of the data service under the target adaptation solution; analyzing the change trend of the performance metrics to determine the execution effect of the target adaptation solution; adjusting and optimizing the target adaptation solution according to the execution effect to obtain an adjusted and optimized target adaptation solution; and deploying and running the data service in the target environment according to the target adaptation solution includes: deploying and running the data service in the target environment according to the adjusted and optimized target adaptation solution.
[0075] A performance monitoring tool can be deployed or integrated in the target environment, so as to be able to collect performance metric data in real time and accurately. The performance metrics to be monitored can be determined according to the characteristics of the data service and business requirements, such as response time, throughput, error rate, resource utilization rate, etc. The collection frequency of performance metrics can be set according to the sensitivity of performance changes and monitoring requirements, so as to balance the real-time nature of monitoring and system overhead.
[0076] After collecting the performance metrics, the performance metrics can be preprocessed first to ensure the reliability of the performance metrics.
[0077] Based on the change trend of the performance metrics and the threshold setting, evaluate the execution effect of the target adaptation solution to determine whether the expected performance goals and business requirements are met. If the execution effect is not good, the performance bottleneck or the root cause of the problem can be located by in-depth analysis of the performance metric data and system logs. According to the problem location result, formulate an adjustment and optimization strategy, and apply the adjustment and optimization strategy to the target adaptation solution to obtain an adjusted and optimized target adaptation solution.
[0078] According to the adjusted and optimized target adaptation plan, perform the deployment and operation of the data service in the target environment. After deployment, continue to collect performance metrics in real time, enter the next round of performance monitoring, effect evaluation, and adjustment and optimization cycle, and form a closed-loop continuous optimization process.
[0079] By adopting the embodiments of the present disclosure, by collecting the performance metrics of the data service under the target adaptation plan in real time, the running state of the service can be continuously monitored, which helps to timely discover performance bottlenecks or abnormal fluctuations, and thus take corresponding measures for optimization to ensure that the data service always maintains the best running state. The real-time performance monitoring and adjustment and optimization mechanism helps to ensure that the data service always provides stable and efficient service quality.
[0080] Among them, in an optional embodiment, obtain the environmental information of the target environment, including: obtain the operating system information by reading system files or calling system interfaces; obtain the hardware configuration information by reading hardware information files or calling hardware interfaces; the hardware configuration information represents the specific parameters or configurations of the hardware; determine the network conditions of the target environment by sending test data packets and measuring metrics such as round-trip time and packet loss rate.
[0081] The operating system usually stores its version information at specific locations, and the type of the operating system can be identified by reading these system files. For example, for the Windows system, the version and version number of the operating system can be obtained by reading the registry or the winver command.
[0082] Different operating systems provide corresponding API (Application Programming Interface) interfaces to directly query the type and version of the operating system, and the system information can be obtained by calling these APIs. For example, for the Windows system, the GetVersionEx function or the SystemInfo API can be used to obtain the version and other relevant information of the operating system.
[0083] The hardware configuration information may include CPU information, memory information, hard disk information, etc. The CPU model, number of cores, frequency, etc. can be obtained through the interface. The memory information includes the total amount and available memory of the system memory, and the memory size and type will affect the performance of the data service. The hard disk information may include the storage capacity, type, and available space of the disk, and the disk type includes HDD (Hard Disk Drive, mechanical hard disk) or SSD (Solid State Disk or Solid StateDrive, solid state drive).
[0084] The network conditions can be determined by measuring key metrics such as network bandwidth, latency, packet loss rate, etc. Based on the performance metrics corresponding to the network test, the network condition information is determined.
[0085] By adopting the embodiments of the present disclosure, by comprehensively understanding various parameters of the target environment, including the operating system, hardware configuration, and network conditions, it is possible to accurately grasp the data service requirements and limiting conditions under different operating environments. By obtaining environmental information such as the operating system, hardware configuration, and network conditions, it is possible to dynamically adjust the configuration of the data service according to the characteristics of the environment to improve the adaptability of the system. By obtaining and analyzing various parameters of the target environment in real time, it is possible to improve the performance and operating stability of the data service and reduce the negative impacts brought about by environmental changes.
[0086] Among them, in an optional embodiment, according to the environmental information, a target adaptation scheme is determined, including: according to the environmental information, a target adaptation strategy is obtained from an adaptation strategy library by using a machine learning algorithm; the adaptation strategy library includes rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies; according to the environmental information, adjustment information for adjusting the configuration information of the data service is determined; the adjustment information and the target adaptation strategy are evaluated to determine the target adaptation scheme.
[0087] According to the collected environmental information, a machine learning algorithm is used to select the most suitable strategy for the current environment from a predefined adaptation strategy library. According to the current environmental information, a suitable machine learning algorithm is selected, and the environmental information is used as input to predict the best adaptation strategy, and this adaptation strategy is selected from the adaptation strategy library.
[0088] The adaptation strategies included in the adaptation strategy library are preset. The adaptation strategies include rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies.
[0089] The rule-based adaptation strategy is applicable to environments with clear rule constraints. For example, the operating system type, hardware configuration, network bandwidth, etc. can be mapped to specific rules.
[0090] The machine learning-based adaptation strategy is applicable to scenarios that require prediction and self-optimization based on historical data, especially applicable to complex and variable environments, and the machine learning model automatically adjusts the strategy according to historical data.
[0091] The genetic algorithm-based adaptation strategy is applicable to selecting the optimal adaptation strategy from multiple alternative solutions through an optimization search method, especially applicable to complex adaptation scenarios that cannot be described by simple rules.
[0092] Determine the configuration information of the data service according to the environmental information. The adjustment information affects the operating parameters of the data service to ensure that the service can operate efficiently in the target environment.
[0093] After selecting the target adaptation strategy and determining the adjustment information, it is necessary to evaluate the adjustment information and the target adaptation strategy to ensure that these adjustments can optimize the operation of the data service without causing negative impacts. The evaluation can include performance evaluation, stability evaluation, and resource consumption evaluation. Performance evaluation can analyze whether the adjusted configuration can improve the performance of the data service, which can be specifically manifested as whether it can improve key performance indicators such as throughput and reduce response time. Stability evaluation can assess whether the adjusted configuration will introduce system instability, such as memory overflow, CPU overload, etc. Resource consumption evaluation can analyze whether the adjustment reasonably utilizes the hardware resources of the target environment and whether there is resource waste or bottlenecks.
[0094] Finally, determine the target adaptation plan based on the evaluation results.
[0095] Adopting the embodiments of the present disclosure, using machine learning algorithms, and intelligently selecting the target adaptation strategy from the adaptation strategy library according to the current environmental information can ensure that the most suitable adaptation strategy for the current situation is selected under different environmental conditions, thereby improving the adaptability and flexibility of the system. According to the environmental information, the adjustment information for adjusting the configuration information of the data service can be determined to ensure that the configuration of the data service can meet the current requirements to the greatest extent and improve the performance and efficiency of the service. After obtaining the target adaptation strategy and the adjustment information, the method will also comprehensively evaluate these two parts of information to determine the final target adaptation plan, which can ensure that the selected plan is optimal as a whole, meets the requirements of the current environment, and can maximize the potential of the data service.
[0096] Among them, in an optional embodiment, evaluating the adjustment information and the target adaptation strategy to determine the target adaptation plan includes: determining the adjustment sub-information for adjusting each configuration item in the adjustment information; determining the adaptation sub-strategy for adapting each configuration item in the target adaptation strategy; matching the adjustment sub-information and the adaptation sub-strategy for the same adaptation item; evaluating the adjustment sub-information and the adaptation sub-strategy corresponding to the same adaptation item based on the environmental information to determine the target adaptation strategy for the configuration item; and determining the target adaptation strategy as the adaptation sub-plan of the target adaptation plan for the configuration item.
[0097] The adjustment information is the system's modification suggestions for the data service configuration, which involves multiple configuration items, such as the number of concurrency, cache size, transmission rate, etc. The adjustment sub-information refines the specific adjustment requirements and ranges for each configuration item.
[0098] Parse the adjustment information determined from the environmental information. Determine the configuration items in the data service that need to be adjusted, as well as the possible adjustment ranges or values of these configuration items. The adjustment content is refined into adjustment sub-information, and each sub-information targets a specific configuration item. For example, at the operating system level, specific system resource allocation policies may need to be adjusted according to different versions of the operating system.
[0099] Extract the adaptation sub-policies corresponding to each configuration item from the target adaptation policy. The adaptation sub-policies are specific components of the target adaptation policy. Each sub-policy targets a specific configuration item and provides a specific method for applying the adaptation policy to that configuration item.
[0100] Match each adjustment sub-information with the corresponding adaptation sub-policy, ensuring that the adjustment sub-information for each configuration item is consistent with the adaptation sub-policy, thus avoiding configuration conflicts or inconsistencies.
[0101] After the matching is completed, evaluate the adjustment sub-information and adaptation sub-policy for each adaptation item based on the current environmental information. According to the evaluation results, the target adaptation policy for each configuration item can be determined. After determining the target adaptation policies corresponding to each configuration item, integrate the target adaptation policies of all configuration items to form a complete target adaptation plan.
[0102] Adopting the embodiments of the present disclosure, by determining the adjustment sub-information in the adjustment information and the adaptation sub-policies in the target adaptation policy, accurate matching of the same adaptation items is achieved, ensuring a close association between the adjustment measures and the adaptation policy, thereby improving the accuracy and effectiveness of adaptation. Evaluating the adjustment sub-information and adaptation sub-policy corresponding to the same adaptation item based on the current environmental information fully considers the changes in environmental factors to ensure that the selected adaptation policy is optimal in the current environment.
[0103] Among them, in an optional embodiment, the adjustment information is determined according to the following steps: Determine the operating system configuration parameters of the data service according to the operating system information included in the environmental information; Determine the first performance tuning parameters of the data service according to the hardware configuration information included in the environmental information; The first performance tuning parameters of the data service at least include the concurrency number and cache size of the data service; Determine the second performance tuning parameters of the data service according to the network condition information included in the environmental information; The second performance tuning parameters of the data service at least include the data transmission rate and retransmission policy; Determine the adjustment information of the data service according to the operating system configuration parameters, the first performance tuning parameters, and the second performance tuning parameters.
[0104] Different operating systems have different mechanisms and optimization methods in aspects such as system resource management, thread scheduling, and memory management. Therefore, determine the corresponding configuration files or adjust parameters of the data service according to the type of the target operating system. For example, for the Windows system, specific memory cache settings and optimization parameters related to thread pool configuration may need to be configured. Adjust the configurations related to the operating system to ensure that the data service can make the most of the characteristics of the operating system.
[0105] Hardware configuration directly affects the concurrent processing ability, cache management, and resource allocation of the data service. Adjust the first performance tuning parameters corresponding to the hardware configuration to ensure that the data service can operate efficiently under the constraints of hardware resources. For example, for the hardware configuration information of the CPU, the number of CPU cores can be determined according to the hardware configuration information of the CPU. The number of CPU cores can affect concurrent threads or processes. More cores can support more concurrent threads or processes. Therefore, the concurrency of the data service can be adjusted according to the number of CPU cores. For the hardware configuration information of the memory, the cache size of the data service can be adjusted according to the total memory and available memory. A machine with a larger memory can be configured with a larger cache to improve the speed of data reading and writing.
[0106] Network condition information directly affects the transmission efficiency, reliability, and stability of the data service. Therefore, the second performance tuning parameters can be dynamically adjusted according to the network condition information. The second performance tuning parameters include transmission rate, retransmission strategy, etc. to cope with different network conditions. In specific implementation, when the bandwidth is relatively high, the data transmission rate in the data service can be set relatively high to accelerate data transmission. When it is determined according to the network condition information that the packet loss rate of the current network is relatively high, the retransmission mechanism can be enhanced to ensure data reliability. For example, the number of retransmissions can be adjusted or a suitable retransmission mechanism can be selected according to the level of the packet loss rate.
[0107] After adjusting the various parameters of the data service according to the operating system, hardware configuration, and network condition, integrate the various parameters of the data service to determine the adjustment information.
[0108] Adopting the embodiments of the present disclosure to intelligently adjust the various parameters of the data service based on different operating systems, hardware configurations, and network conditions can ensure that the data service can operate efficiently and stably under different operating systems, hardware configurations, and network conditions, thereby improving the overall performance and adaptability of the system and eliminating the compatibility problems of traditional systems when running across platforms and environments. The data service configuration module can automatically adjust the configuration according to the environment information provided by the environment perception module, reducing the need for manual configuration, not only improving the automation level, but also greatly reducing the management cost during the deployment, operation, and maintenance of the data service.
[0109] Among them, in an optional embodiment, deploying and running a data service in the target environment according to the target adaptation solution includes: generating a corresponding deployment file according to the target adaptation solution; the deployment file is a deployment script or a configuration file; deploying the deployment file into the target environment; and starting the data service based on the deployment file.
[0110] After determining the target adaptation solution, generate a configuration file corresponding to the current target environment. The configuration file can be in the form of a deployment script or a configuration file.
[0111] If it is in the form of a deployment script, then according to the differences in the target environment, the deployment script has corresponding types. For example, for a Windows environment, a PowerShell script needs to be generated. According to the configuration parameters determined in the adaptation solution, these parameters are automatically inserted into the deployment script to ensure that the deployment script contains the required operating system configuration parameters, the first performance tuning parameters, and the second performance tuning parameters, etc.
[0112] If it is in the form of a configuration file, then a configuration file specific to the target environment can also be generated according to the target adaptation solution.
[0113] After generating the deployment script or the configuration file, it is necessary to detect the deployment script or the configuration file to ensure that the deployment will not fail due to incorrect configurations. For example, check whether the file path, permission settings, environment variables, etc. are correct.
[0114] After obtaining the deployment script or the configuration file, deploy the deployment script or the configuration file into the target environment. Based on the deployment script or the configuration file, start the data service.
[0115] By adopting the embodiment of the present disclosure, through generating a deployment file, the automation of data service deployment can be achieved, reducing the complexity of manual configuration and deployment, and improving the accuracy and efficiency of deployment. Using the deployment file for deployment can ensure that each deployment is repeatable, that is, each deployment will follow the same steps and configurations, thus producing consistent results, which helps to maintain consistency among the development, testing, and production environments.
[0116] Based on the same technical concept, the present disclosure provides a data service multi-environment adaptation system, and the data service multi-environment adaptation method provided by the present disclosure is implemented through the system. Figure 2 It is a schematic diagram of a data service multi-environment adaptation system shown in the embodiment of the present disclosure. According to Figure 2 as shown, the system includes:
[0117] An environment perception module, configured to obtain the environment information of the target environment; the environment information includes operating system information, hardware configuration information, and network condition information;
[0118] An intelligent decision-making module, configured to determine a target adaptation solution according to the environmental information;
[0119] A service execution module, configured to deploy and run a data service in the target environment according to the target adaptation solution;
[0120] Wherein, after the data service is deployed and run in the target environment, the target adaptation solution is adjusted according to the real-time performance metrics of the data service.
[0121] The system further includes:
[0122] A performance monitoring and feedback module, configured to collect in real time the performance metrics of the data service under the target adaptation solution; and feedback the performance metrics to the intelligent decision-making module, so that the intelligent decision-making module adjusts and optimizes the target adaptation solution based on the performance metrics.
[0123] The system further includes:
[0124] A data service configuration module, configured to determine adjustment information for adjusting the configuration information of the data service according to the environmental information;
[0125] An adaptation database, configured to store multiple adaptation strategies, so that the intelligent decision-making module obtains a target adaptation strategy from the adaptation strategy library by using a machine learning algorithm; the multiple adaptation strategies include rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies.
[0126] By using the data service multi-environment adaptation system of the present disclosure, through automated adaptation and deployment, the deployment speed can be significantly improved, especially in a large-scale environment, reducing the long time period that may be required for traditional manual configuration. Through the intelligent decision-making module, the system can make optimal adaptation decisions when facing different operating systems, hardware platforms, and network environments. The intelligent decision-making module can dynamically adjust the adaptation solution according to the feedback information of the performance monitoring and feedback module, and the system can timely discover and solve performance bottlenecks during operation to continuously optimize the performance of the service.
[0127] In order to explain in detail the working process of the data service multi-environment adaptation system, the present disclosure provides the following embodiments. This embodiment is described in conjunction with the present disclosure Figure 3 for illustration. Figure 3 It is a schematic diagram of the working process of a data service multi-environment adaptation system shown in an embodiment of the present disclosure.
[0128] Step 1: The environment perception module obtains the environmental information of the target environment by reading system files, calling system APIs, reading hardware information files, calling hardware interfaces, and sending test data packets. The environmental information includes operating system information, hardware configuration information, and network condition information.
[0129] Step 2: The data service configuration module intelligently generates or adjusts the configuration information of the data service according to the environmental information obtained by the environment perception module to obtain the adjustment information. Specifically, it can determine the operating system configuration parameters of the data service according to the operating system information; determine the first performance tuning parameters of the data service according to the hardware configuration information, and the first performance tuning parameters include the concurrency number and cache size of the data service; determine the second performance tuning parameters of the data service according to the network condition information, and the second performance tuning parameters include data transmission rate and retransmission strategy.
[0130] Step 3: The intelligent decision-making module screens and sorts the adaptation strategies in the adaptation strategy library through machine learning algorithms to determine the target adaptation strategy. The intelligent decision-making module receives the adjustment information determined by the data service configuration module, and further evaluates and compares the target adaptation strategy through the adjustment information to obtain the target adaptation plan.
[0131] The adaptation strategy library stores various adaptation strategies, including rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies, etc., and corresponding adaptation strategies can be selected and used according to different application scenarios and requirements.
[0132] Step 4: The service execution module generates corresponding deployment scripts or configuration files according to the target adaptation plan determined by the intelligent decision-making module, deploys the deployment scripts or configuration files to the target environment, and starts the data service.
[0133] Step 5: After starting the data service, the performance monitoring and feedback module monitors the execution effect of the data service in real time and adjusts and optimizes the adaptation plan according to the execution effect. It can collect the performance indicators of the data service in real time, such as response time, throughput, etc. Based on the collected performance indicators, analyze the change trend of the performance indicators to determine the execution effect of the data service. When it is judged that there are potential problems currently through the change trend of the performance indicators, the monitoring and feedback module feeds back the performance indicators of the current data service to the intelligent decision-making module so that the intelligent decision-making module can adjust and optimize the target adaptation plan based on the performance indicators of the data service.
[0134] The embodiment of the present disclosure also provides an electronic device. Refer to Figure 4 , Figure 4 is a schematic diagram of an electronic device shown in the embodiment of the present disclosure. As Figure 4As shown in the figure, the electronic device 400 includes: a memory 410 and a processor 420. The memory 410 and the processor 420 are communicatively connected via a bus. A computer program is stored in the memory 410, and the computer program can run on the processor 420, thereby implementing the steps in the data service multi-environment adaptation method disclosed in the embodiments of the present disclosure.
[0135] The embodiments of the present disclosure also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps in the data service multi-environment adaptation method disclosed in the embodiments of the present disclosure are implemented.
[0136] The embodiments of the present disclosure also provide a computer program product, including a computer program. When the computer program is executed by a processor, the steps in the data service multi-environment adaptation method disclosed in the embodiments of the present disclosure are implemented.
[0137] The various embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.
[0138] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as a method, apparatus, or computer program product. Therefore, the embodiments of the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0139] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0140] These computer program instructions can also be stored in a computer-readable memory capable of guiding a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks.
[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process. Thus, the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks.
[0142] Although some embodiments of the present disclosure have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present disclosure.
[0143] The above has introduced in detail a data service multi-environment adaptation method and system provided by the present disclosure. Specific examples are used herein to elaborate on the principles and implementation manners of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of the present disclosure; at the same time, for those of ordinary skill in the art, according to the idea of the present disclosure, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present disclosure.
Claims
1. A method for adapting data services to multiple environments, characterized in that It includes: Obtain the environmental information of the target environment; The environmental information includes operating system information, hardware configuration information, and network condition information; Determine the target adaptation plan according to the environmental information; Deploy and run the data service in the target environment according to the target adaptation plan; The determining the target adaptation plan according to the environmental information includes: According to the environmental information, use a machine learning algorithm to obtain a target adaptation strategy from an adaptation strategy library; the adaptation strategy library includes rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies; According to the environmental information, determine adjustment information for adjusting the configuration information of the data service; Evaluate the target adaptation strategy through the adjustment information to determine the target adaptation plan, and the evaluation includes performance evaluation, stability evaluation, and resource consumption evaluation.
2. The method according to claim 1, characterized in that After deploying and running the data service in the target environment according to the target adaptation plan, it further includes: Real-time collect the performance metrics of the data service under the target adaptation plan; Analyze the change trend of the performance metrics to determine the execution effect of the target adaptation plan; Adjust and optimize the target adaptation plan according to the execution effect to obtain an adjusted and optimized target adaptation plan; The deploying and running the data service in the target environment according to the target adaptation plan includes: Execute the deployment and running of the data service in the target environment according to the adjusted and optimized target adaptation plan.
3. The method according to claim 1, wherein Obtain the environmental information of the target environment, including: Obtain the operating system information by reading system files or calling system interfaces; Obtain the hardware configuration information by reading hardware information files or calling hardware interfaces; the hardware configuration information represents the specific parameters or configurations of the hardware; Determine the network conditions of the target environment by sending test data packets and measuring round-trip time and packet loss rate metrics.
4. The method according to claim 1, wherein Evaluating the target adaptation strategy through the adjustment information to determine the target adaptation plan includes: Determine adjustment sub-information for adjusting each configuration item by the adjustment information; Determine adaptation sub-strategies for adapting each configuration item in the target adaptation strategy; Match the adjustment sub-information and the adaptation sub-strategies for the same adaptation item; Based on the environmental information, evaluate the adjustment sub-information and the adaptation sub-strategies corresponding to the same adaptation item to determine the target adaptation strategy for the configuration item; Determine the target adaptation strategy as the adaptation sub-plan of the target adaptation plan for the configuration item.
5. The method according to claim 4, wherein Determine the adjustment information according to the following steps: Determine the operating system configuration parameters of the data service according to the operating system information included in the environmental information; Determine the first performance tuning parameters of the data service according to the hardware configuration information included in the environmental information; the first performance tuning parameters of the data service at least include the concurrency number and cache size of the data service; Determine the second performance tuning parameters of the data service according to the network condition information included in the environmental information; the second performance tuning parameters of the data service at least include the data transmission rate and retransmission strategy; Determine the adjustment information of the data service according to the operating system configuration parameters, the first performance tuning parameter, and the second performance tuning parameter.
6. The method according to claim 1, characterized in that, Deploy and run the data service in the target environment according to the target adaptation solution, including: Generate a corresponding deployment file according to the target adaptation solution; the deployment file is a deployment script or a configuration file; Deploy the deployment file to the target environment; Start the data service based on the deployment file.
7. A multi-environment adaptation system for data services, characterized in that, Including: An environment perception module for obtaining the environment information of the target environment; The environment information includes operating system information, hardware configuration information, and network condition information; A data service configuration module for determining adjustment information for adjusting the configuration information of the data service according to the environment information; An intelligent decision-making module for determining a target adaptation solution according to the environment information; including: for obtaining a target adaptation strategy from an adaptation policy library using a machine learning algorithm according to the environment information; the intelligent decision-making module receives the adjustment information determined by the data service configuration module, evaluates the target adaptation strategy through the adjustment information, and determines a target adaptation solution, and the evaluation includes performance evaluation, stability evaluation, and resource consumption evaluation; The intelligent decision-making module further includes: An adaptation database for storing multiple adaptation strategies, and the multiple adaptation strategies include rule-based adaptation strategies, machine learning-based adaptation strategies, and genetic algorithm-based adaptation strategies; A service execution module for deploying and running the data service in the target environment according to the target adaptation solution.
8. The system according to claim 7, wherein Further including: A performance monitoring and feedback module for real-time collecting the performance metrics of the data service under the target adaptation solution; feeding back the performance metrics to the intelligent decision-making module so that the intelligent decision-making module adjusts and optimizes the target adaptation solution based on the performance metrics.
Citation Information
Patent Citations
Edge data service construction method and language model training method
CN118585340A