CN114070734B - Cloud platform adaptation frame, method, equipment and storage medium - Google Patents

Cloud platform adaptation frame, method, equipment and storage medium Download PDF

Info

Publication number
CN114070734B
CN114070734B CN202111354206.0A CN202111354206A CN114070734B CN 114070734 B CN114070734 B CN 114070734B CN 202111354206 A CN202111354206 A CN 202111354206A CN 114070734 B CN114070734 B CN 114070734B
Authority
CN
China
Prior art keywords
configuration
cloud platform
adaptation
current
environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111354206.0A
Other languages
Chinese (zh)
Other versions
CN114070734A (en
Inventor
施建安
林斌
庄一波
邵飞
孙志伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yilianzhong Yihui Technology Co ltd
Original Assignee
Xiamen Yilianzhong Yihui Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Yilianzhong Yihui Technology Co ltd filed Critical Xiamen Yilianzhong Yihui Technology Co ltd
Priority to CN202111354206.0A priority Critical patent/CN114070734B/en
Publication of CN114070734A publication Critical patent/CN114070734A/en
Application granted granted Critical
Publication of CN114070734B publication Critical patent/CN114070734B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a cloud platform adaptation frame, a cloud platform adaptation method, cloud platform adaptation equipment and a storage medium, and relates to the technical field of research and development management. The cloud platform adaptation framework comprises an identification module, an exclusion module, an execution module and at least two adaptation configurations of the cloud platform. The identification module is used for acquiring the environment identification of the current cloud platform. The exclusion module is used for excluding the adaptive configuration of the non-current cloud platform according to the environmental identifier based on the starter mode of SpringCloud. The execution module is used for automatically configuring the adaptation configuration corresponding to the environment identifier. The framework automatically adapts to the local environment and the cloud environment, and provides the same top-level capability interface upwards, so that project codes are smoothly migrated from the local environment to the cloud environment without modification.

Description

Cloud platform adaptation frame, method, equipment and storage medium
Technical Field
The invention relates to the technical field of research and development management, in particular to a cloud platform adaptation method, a cloud platform adaptation device, cloud platform adaptation equipment and a storage medium.
Background
Many current business developments are based on the SpringCloud framework, which uses the architecture of micro services. SpringCloud itself provides a range of out-of-box infrastructure environments, such as a registry, a simple configuration center, and so forth. In development, developers typically use these off-the-shelf infrastructure directly.
More and more projects are now running in cloud environments, where cloud service generation no longer merely provides a virtual machine environment, and more would provide an infrastructure environment with its own features. For example, hua Cheng provides a one-stop development service solution, hua Cheng provides a micro-service development framework CSE based on SpringCloud modification and enhancement; tencel also provides a componentized micro-service development framework TSF and corresponding Tencel micro-service cloud.
When the business development is finished and the project is required to be on line, the project is often required to be transformed and adapted to be smoothly on the cloud due to different infrastructures of a local development environment and a cloud environment. Furthermore, there is sometimes a need to move forward from one cloud environment to another due to uncertainty in business development. If the service codes are required to be modified and adapted next time, potential problem hidden danger and unnecessary time waste can be caused.
Disclosure of Invention
The invention provides a cloud platform adaptation method, a cloud platform adaptation device, cloud platform adaptation equipment and a storage medium, so as to improve the technical problems.
A first aspect,
The embodiment of the invention provides a cloud platform adaptation frame which comprises an identification module, an exclusion module, an execution module and at least two adaptation configurations of cloud platforms.
And the identification module is used for acquiring the environment identification of the current cloud platform.
The excluding module is used for excluding the adaptive configuration of the non-current cloud platform according to the environmental identifier based on the starter mode of SpringCloud.
And the execution module is used for automatically configuring the adaptation configuration corresponding to the environment identifier.
In an alternative embodiment, the adaptation configuration includes a configuration of native functions and a configuration of distinctive functions.
And the exclusion module is used for excluding the original function configuration of the non-current cloud platform according to the environment identification and introducing the configuration of the characteristic function of the current cloud platform according to the environment identification.
And the execution module is used for automatically configuring the native function configuration of the current cloud platform corresponding to the environment identifier and automatically configuring the configuration of the feature function of the current cloud platform introduced.
In an alternative embodiment, the adaptation configuration comprises a public configuration and a proprietary configuration to which at least two cloud platforms respectively correspond.
In an alternative embodiment, the proprietary configuration includes a service center and an interface configuration of the configuration center.
And the excluding module is used for excluding interface configuration of the service center and the configuration center of the non-current cloud platform according to the environment identification.
And the execution module is used for automatically configuring the service center of the current cloud platform corresponding to the environment identifier and the interface configuration of the configuration center.
In an alternative embodiment, the common configuration includes an authentication interface and a current limit interface. The proprietary configuration includes an authentication configuration and a current limit configuration.
The cloud platform adaptation frame further comprises an interception module and a current limiting module.
And the interception module is used for intercepting the request according to the authentication interface.
And the current limiting module is used for establishing connection according to the current limiting interface.
The elimination module is also used for introducing the corresponding authentication configuration and current limiting configuration of the current cloud platform according to the environment identification.
And the execution module is also used for authenticating the request and limiting the connection according to the authentication configuration and the current limiting configuration of the current cloud platform.
In an alternative embodiment, the proprietary configuration further includes a routed interface configuration.
And the exclusion module is used for excluding the interface configuration of the route of the non-current cloud platform according to the environment identification.
And the execution module is used for automatically configuring the interface configuration of the route of the current cloud platform corresponding to the environment identifier.
A second aspect,
The embodiment of the invention provides a cloud platform adaptation method, which comprises the following steps:
s1, acquiring an environment identifier of a current cloud platform.
S2, eliminating the adaptive configuration of the non-current cloud platform according to the starter mode based on SpringCloud and the environment identifier.
S3, automatically configuring the adaptation configuration corresponding to the environment identifier.
In an alternative embodiment, the adaptation configuration includes a native function configuration and a feature function configuration.
In an alternative embodiment, step S2 specifically includes:
and excluding the original function configuration of the non-current cloud platform according to the environment identification, and introducing the configuration of the characteristic function of the current cloud platform according to the environment identification.
In an alternative embodiment, step S3 specifically includes:
the automatic configuration environment identifies the corresponding native function configuration of the current cloud platform and the configuration of the feature functions of the current cloud platform introduced by the automatic configuration.
A third aspect,
The embodiment of the invention provides cloud platform adapting equipment, which comprises a processor, a memory and a computer program stored in the memory. The computer program is executable by a processor to implement the cloud platform adaptation method as described in the second aspect.
A fourth aspect,
An embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, and when the computer program runs, controls a device where the computer readable storage medium is located to execute the cloud platform adaptation method as described in the second aspect.
By adopting the technical scheme, the invention can obtain the following technical effects:
according to the embodiment of the invention, the starter mode of the SpringBoot is adopted, all dependence of a plurality of cloud platforms is introduced, and when the system is started, the current cloud environment is identified through the environment identification, so that starter dependence of the non-current cloud environment is automatically eliminated. Each cloud platform has a SpringCloud-defined interface capability implemented based on a starter mode. After the current environment is identified through the environment identification, the dependence of the non-current environment is eliminated, so that the conflict of different implementations of the same interface in the multi-cloud environment can be avoided, and only one dependence of the cloud environment is reserved at the moment.
The method and the system have the advantages that local project is migrated to a micro service environment on the cloud of the Internet, such as a CSE environment which is a Chinese character, and project codes do not need to be modified when the TSF environment is a Chinese character, the framework is automatically adapted to the local environment and the cloud environment, the same top-level capacity interface is provided upwards, and the project codes do not need to be modified, so that the project codes are smoothly migrated from the local environment to the cloud environment.
When a cloud environment service provider needs to be changed, such as switching from a TSF of vacation to a CSE of hua, project codes do not need to be changed. The framework will automatically adapt to the underlying facilities of different cloud environments, providing the same top-level capabilities to the project. The framework can automatically adapt to the capability provided by the bottom cloud environment and is integrated into a unified upward capability interface.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a cloud platform adapting frame according to a first embodiment of the present invention.
Fig. 2 is a layered architecture diagram of a cloud platform adaptation framework according to a first embodiment of the present invention.
Fig. 3 is a component architecture diagram of a cloud platform adaptation frame according to a first embodiment of the present invention.
Fig. 4 is a schematic flow chart of a cloud platform adaptation method according to a second embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Embodiment one:
referring to fig. 1 to 3, a first embodiment of the present invention provides a cloud platform adaptation framework (hereinafter referred to as a platform SDK, a micro service framework SDK or a SDK) that may be executed by a server of a cloud platform, and in particular, by one or more processors in the server.
The cloud platform adaptation framework comprises an identification module 1, an exclusion module 2, an execution module 3 and at least two adaptation configurations of the cloud platform. The identification module 1 is used for acquiring the environment identification of the current cloud platform. The exclusion module 2 is configured to exclude an adaptation configuration of a non-current cloud platform according to an environment identifier based on a starter mode of SpringCloud. The execution module 3 is used for automatically configuring the adaptation configuration corresponding to the environment identifier.
It should be noted that the same function is provided between different cloud platforms. But the interfaces, rules for these functions are not the same on different platforms. Therefore, the program designed locally needs to be run on each cloud platform, and needs to be optimized for each cloud platform to call/access the interface of each cloud platform so as to run.
It can be understood that, in this embodiment, the starter mode of SpringBoot is adopted, and by introducing all the dependencies of multiple cloud platforms, when the system is started, the current cloud environment is identified through the environment identifier, so that the starter dependency of the non-current cloud environment is automatically eliminated. Each cloud platform has a SpringCloud-defined interface capability implemented based on a starter mode. After the current environment is identified through the environment identification, the dependence of the non-current environment is eliminated, so that the conflict of different implementations of the same interface in the multi-cloud environment can be avoided, and only one dependence of the cloud environment is reserved at the moment.
Through the cloud platform adaptation framework provided by the embodiment of the invention, local project is migrated to the cloud micro-service environment of the Internet, such as the CSE environment, the project code is not required to be modified when in the TSF environment of messenger, the framework is automatically adapted to the local environment and the cloud environment, and the same top-layer capability interface is provided upwards, so that the project code is not required to be modified, and is smoothly migrated from the local environment to the cloud environment. When a cloud environment service provider needs to be changed, such as switching from a TSF of vacation to a CSE of hua, project codes do not need to be changed. The framework will automatically adapt to the underlying facilities of different cloud environments, providing the same top-level capabilities to the project. The framework can automatically adapt to the capability provided by the bottom cloud environment and is integrated into a unified upward capability interface.
Based on the above embodiments, in an alternative embodiment of the present invention, the adaptation configuration includes a configuration of a native function and a configuration of a distinctive function.
And the exclusion module 2 is used for excluding the original function configuration of the non-current cloud platform according to the environment identification and introducing the configuration of the characteristic function of the current cloud platform according to the environment identification.
And the execution module 3 is used for automatically configuring the native function configuration of the current cloud platform corresponding to the environment identifier and automatically configuring the configuration of the feature function of the introduced current cloud platform.
It should be noted that many cloud platform service development is currently performed by adopting a micro-service architecture based on a SpringCloud framework. SpringCloud itself provides a range of out-of-box infrastructure environments. Wherein service registration, discovery and configuration acquisition are functions that are supported by SpringCloud as they are, springCloud itself has defined relevant interfaces and specifications, such as service discovery interface discovery client and annotation @ Value for configuration information acquisition. The user only needs to introduce spring-closed-starter-Eureka or spring-closed-control and open through @ EnableDisoveryClient according to whether Eureka or Consul is used in the pore.
The cloud (TSF) and the Cloud (CSE) provide corresponding starters according to the service center and the configuration center component, if the cloud is used independently, the spring-closed-TSF-control-discover and the like are introduced under the cloud, and the spring-boot-starter-discover and the like are introduced under the cloud environment.
However, if the service developer is to realize the switching of the corresponding functions through the switching environment identifier, the TSF and the CSE are required to be compatible, and the solution is as follows:
1. and simultaneously introducing service discovery, service registration and configuration acquisition function starters corresponding to two clouds such as spring-closed-tsf-control-discover and the like and spring-boot-starter-discover and the like into the pore.
2. TSF and CSE adaptive configuration files auto-configuration-adapter. Yaml are defined, the content of which is an auto-configuration class that implements specific function introduction under two environments.
3. According to the principle of class loading sequence of the same full-definite name of Java, the method of 'org. Spring-framework. Context. Analysis. Configuration ClassParser# configuration ClassParser' in the spring-context-4.3.21.RELEASE. Jar packet is rewritten. And adding related codes which exclude the automatic configuration classes introduced under other environments according to the environment identification.
In addition, each cloud environment is provided with some special service management functions such as authentication, current limiting and the like, and the SpringCloud which is native to the functions does not provide out-of-box implementation or define a unified standard interface, so that each cloud manufacturer provides the functions according to the implementation designed by itself. To avoid migration changes, the platform is required to provide a unified standard interface. The specific implementation concept can be briefly summarized as
1. The platform defines service governance function abstractions such as authentication, flow limiting and the like as individual interfaces.
2. Specific adaptation implementation of different cloud platforms is provided. And in the adaptation implementation, the implementation provided by the native SDK of the cloud platform is directly integrated.
3. And (5) customizing the @ conditional OnXXXEnable annotation, and judging whether the corresponding function is started in the configuration file.
4. Specific adaptation implementations are introduced using SpringFactoryImportSelecterSelectImorts, depending on the context identification.
It can be understood that the service personnel do not need to care about the specific application environment of the project by using the platform SDK to develop the service, and do not need to select and match the SpringCloud version. These are all already provided in the platform SDK. Service personnel only need to develop the application like using the native SpringCloud, so that seamless migration of the application in a cloudy environment can be realized.
Business personnel use a platform SDK to develop a micro-service architecture, and only 2 steps are needed:
platform SDK dependency is introduced in pom files.
2. And customizing a configuration file and configuring information required by the platform. Specifically, a specific adapter is introduced in a specific environment. For example, adapter-cse is used when the project is sublimated into a cloud.
Based on the foregoing embodiments, in an optional embodiment of the present invention, the adaptation configuration includes a public configuration and a proprietary configuration corresponding to at least two cloud platforms, respectively. Specifically, the boss-enclosed-service-adapter contains the following four engineering configurations:
adapter-common co-engineering,
adapter-cse is used for realizing engineering for cloud cse adaptation,
adapting the adapter-tsf to make a message to the cloud tsf to realize engineering,
adapt-dependency SDK pore engineering.
Based on the above embodiments, in an alternative embodiment of the present invention, the proprietary configuration includes a service center and an interface configuration of the configuration center.
And the excluding module 2 is used for excluding interface configuration of the service center and the configuration center of the non-current cloud platform according to the environment identification.
And the execution module 3 is used for automatically configuring the service center of the current cloud platform corresponding to the environment identifier and the interface configuration of the configuration center.
Specifically, the service discovery, registration and configuration center clients of cse and tsf are implemented respectively based on the interfaces defined by SpringCloud, so that the corresponding automatic configuration is only required to be started in cse or tsf environments.
SpringCloud auto-configuration for the center client is newly added cse and tsf service discovery, registration and configuration under the adaptive-cse and adaptive-tsf resources/META-INF/auto-configuration-adapter. Yaml files, respectively.
If cse and tsf related jar exist simultaneously, conflict is caused or corresponding functions are started simultaneously, so that the method of "org. Spring-context-4.3.21.Release. Jar" in the spring-context.
Logic for judging whether or not to perform automatic configuration by boss.svcmgt.cloueenv=tsf| cse and auto-configuration-adapter.yaml is newly added thereto.
Cloudenvclassoheteroentry # shausladp determines whether to automatically configure logic according to the configuration in boss.svcmgt.cloudeenv and auto-configurable adapter.yaml. The corresponding auto configuration class list of cse in auto configuration-adapter. Yaml is excluded if boss.svcmgt.cloudenv=tsf.
Based on the above embodiments, in an alternative embodiment of the present invention, the common configuration includes an authentication interface and a current limiting interface. The proprietary configuration includes an authentication configuration and a current limit configuration.
The cloud platform adaptation frame further comprises an interception module and a current limiting module.
And the interception module is used for intercepting the request according to the authentication interface.
And the current limiting module is used for establishing connection according to the current limiting interface.
The exclusion module 2 is further configured to introduce an authentication configuration and a current limiting configuration of the corresponding current cloud platform according to the environment identifier.
And the execution module 3 is also used for authenticating the request and limiting the connection according to the authentication configuration and the current limiting configuration of the current cloud platform.
In particular, the method comprises the steps of,
the authentication configuration is invoked, an authentication internitor is introduced through the automatic configuration of SpringCloud, requests are intercepted uniformly, and the requests are entrusted to Access controller interfaces of different environments which are introduced through the boss.svcmgt.cldEnv and boss.svcmgt.auth.controller ClassName attributes. Such as the implementation of authentication in cseacesscontroller class cse environment and the implementation of authentication in TsfAccessController class tsf environment.
The SpringBoot automatic configuration of the authentication function comprises the following steps:
the automatic configuration of the authentication interstor is configured under the resources/META-INF/spring. Industries of the adapter-common co-engineering.
Adding in the conditional OnAuthEnable:
automatic configuration of authentication according to boss.svcmgt.auth.enabled=true
Adding in an Access ControllerImportSelect:
the AccessController interface is introduced according to the boss.svcmgt.cloueenv and boss.svcmgt.auth.controlClassName attributes, and the differences are introduced according to the configuration.
The cloud environment is identified using annotation @ CloudEnv (name = "xxx") so that the authentication interface is implemented for cloud, messenger cloud integration.
In particular, the method comprises the steps of,
the flow restriction is implemented by introducing a flow restriction filter through the automatic configuration of Spring Cloud, and by matching with the properties of the boss.svcmgt.clroudEnv and the boss.svcmgt.auth.controller ClassName, the flow restriction control and the filtering of the requests are implemented by introducing QpsController interfaces of different environments. Such as the implementation of current limiting in CseQpsController class cse environments and the implementation of current limiting in TsfQpsController class tsf environments.
Automatic configuration of the configuration flow limit is first required:
automatic configuration of the flow limiting filters under adaptive-common co-engineering resources/META-INF/spring. Industries
Adding in the conditional OnQpsEnabled:
automatic configuration of current limit according to boss.svcmgt.qps.enabled=true on
Implementation according to configuration importation
In QpsControllerImportSelector:
according to the properties of the boss.svcmgt.cloueenv and the boss.svcmgt.qps.controller ClassName, the QpsController interfaces are introduced, and the introduction according to the configuration is realized.
Cloud environments are identified using annotation @ CloudEnv (name = "xxx") such that the flow restriction interface is implemented for cloud, messenger cloud integration.
Based on the above embodiments, in an alternative embodiment of the present invention, the proprietary configuration includes a monitoring configuration.
And the exclusion module 2 is also used for introducing the corresponding monitoring configuration of the current cloud platform according to the environment identifier.
And the execution module 3 is also used for automatically configuring the monitoring configuration of the current cloud platform.
Specifically, the call of the monitoring configuration:
the monitoring function of tsf is realized based on Spring Cloud, and the original InvitroAutoconfiguration of tsf is only required to be eliminated, and the automatic configuration of @ ConditionalOnTsfEnabled and @ ConditionalOnMonitorEnabled are newly added by self definition;
the monitoring of cse does not support the SpringCloud reference implementation was modified to Spring CloudStarter. cse modified starters introduce datafactor by cse monitor automation configuration.java auto configuration in which the open timing task uploads hystrixcommand metrics data to the cse platform interface.
In the case of the process of the tsf,
the configuration excluding the tsf monitoring function is newly added in the resources/META-INF/auto-configuration-adapter. Yaml of adapter-tsf.
New monitored auto-configuration is configured under adaptive-tsf engineering resources/META-INF/spring. The difference between the new configuration and the tsf original automatic configuration is that two notes of @ conditional OnTsfEnable and @ conditional OnMonitorEnable are added.
In the process of cse,
automatic configuration of configuration monitoring under the resources/META-INF/spring. Industries of adapter-cse engineering.
It will be appreciated that the monitoring function can be implemented:
starting a timing task, collecting HystrixCommand metrics data every 10 seconds by default, and sending monitoring information to a cse platform through a/v 2/default/csemonitor/metaservice=xxx interface.
Based on the above embodiments, in an alternative embodiment of the present invention, the proprietary configuration further includes a routed interface configuration.
And the exclusion module 2 is used for excluding the interface configuration of the route of the non-current cloud platform according to the environment identification.
And the execution module 3 is used for automatically configuring the interface configuration of the route of the current cloud platform corresponding to the environment identifier.
In particular, the functions of routing (gray distribution) and the like are basically a specific and more refined load strategy based on the rib. Different implementations may be introduced in different environments to accomplish the adaptation to the environment. While the way the adaptation of other environments is excluded is similar to the way the automatic registration class is excluded as mentioned in service center and configuration center adaptations.
Whether the TSF environment or the CSE environment provides a corresponding implementation of the routing function, a specific interface is implemented based on the rib. The platform introduces specific implementation classes by formulating custom configuration classes so as to adapt specific functions in the cloud environment.
It should be noted that:
the realization of the self-carried route and gray release of the messenger cloud is realized by covering a default IRule interface of a Ribbon; the routing function of the Hua is incompatible with Spring Cloud realized by servicecombs, and the routing (gray release) function of the integration realization cse which can achieve minimum change through the ILoadBalancer interface covering Ribbon by default is realized by checking the source code. Essentially, it is. The functions achieved are provided on the interface provided by the rib.
First, automatic configuration of configuration route is needed: in order to enable the functions of tsf, cse and the like to be managed, flexible adaptive switching control can be configured according to the conditions of boss.svcmgt.cloueenv=tsf| cse, automatic configuration of the functions of tsf and the like is required to be eliminated, and the functions are modified into automatic configuration which can be loaded according to configuration switching. Wherein @ ConditionalOnCseEnable and @ ConditionalOnTsfEnable conditional auto-configuration notes are to be matched together. In particular, the method comprises the steps of,
in tsf:
configuration in auto-configuration-adapter. Yaml file under adapter-tsf resources/META-INF excludes configuration of tsf routing functions.
Automatic configuration of routes is configured under adaptive-tsf engineering resources/META-INF/spring.
In cse:
the automatic configuration of newly adapted routes under adaptive-cse engineering resources/META-INF/spring.
It can be understood that the routing implementation of the bloom cloud is specifically: the DarklaunchladBalaner implements the routing function by inheriting the Ribbon default ZoneAware loadBalaner and rewriting the getAlServer and getReachbleServer methods.
In addition to those functions provided by the cloud service platform mentioned above. Other features are provided too much in some cloud platforms. For example: contract function adaptation of cloud, dynamic load balancing function adaptation of cloud, fault tolerance function adaptation of cloud retry, and cloud degradation and fusing function adaptation (based on feign).
Contract function adaptation of Hua as cloud:
the contract function of cse is the basis of the level control of the functional methods such as degradation, fusing and the like, the SDK of SpringCloud provided by Cloud does not support the function of contract, the service eCommb SDK of cse is checked to find out, the contract function is realized by reading the file of a local swagger or automatically generating the swagger according to class to register to a service center before project starting, so that the contract function can be realized by expanding the Spring-boot-starter-registry-XXX of the Spring Cloud SDK of cse.
Specifically, add existing auto-configuration-adapter. Yaml file under adapter-cse resources/META-INF; new monitored auto-configuration is configured under the resources/META-INF/spring. Industries of adapter-cse engineering.
The contract function can be realized: if there is a configuration resource\microservices < service name > < contract name >. Yaml file can register the contract offline, the contract can be automatically generated according to the RestController class in the SDK.
The cloud dynamic load balancing function is adapted:
CSE is that the load balancing function can dynamically change the load rule according to the configuration of the cloud CSE platform, and the SpringCloud is native and does not support dynamic modification. By looking at the source code, the dynamic load balancing function can be realized through the default implementation of IRule interface covering Ribbon. The automatic configuration of the custom RibbonCseAutoConfiguration.java is implemented with the default IRule of the overlay Ribbon of the custom ServiceCommbDynamicRule. And reading dynamic configuration in the ServiceCommbDynamicRule, and dynamically selecting a load rule according to the configuration to realize.
The cloud retry fault tolerance function adaptation:
CSE is based on the dynamic retry fault tolerance function that the Cloud CSE platform configuration rules can be dynamically changed, and the Spring Cloud native does not support dynamic modification. By looking at the source code, the dynamic retry fault tolerance function can be realized by covering the default implementation of the retryHandler.
The method is cloud degradation and fusing function adaptation (based on feign):
the dynamic degradation and fusing function of CSE can be dynamically changed according to the configuration rule of Cloud CSE platform, and the Spring Cloud does not support dynamic modification. By looking at the source code, the dynamic degradation and fusing functions can be realized by covering HystroxFeign and HystroxInvationHandler. The default HystroxFegn under the Hystrix environment is automatically configured by the custom CseHystroxFeignAcutoConfiguration. Java's feign to cover the feign. Custom CseHystrixFeign, cseHystrixInvocationHandler and HystrixPriceStrategEx implement dynamic degradation and fuse functions.
It will be appreciated that:
in the embodiment, a starter mode of SpringBoot is adopted, all dependence of a plurality of cloud platforms is introduced, and when a system is started, the current cloud environment is identified through the environment identification, so that starter dependence of a non-current cloud environment is automatically eliminated. Each cloud platform has a SpringCloud-defined interface capability implemented based on a starter mode. After the current environment is identified through the environment identification, the dependence of the non-current environment is eliminated, so that the conflict of different implementations of the same interface in the multi-cloud environment can be avoided, and only one dependence of the cloud environment is reserved at the moment.
Through the cloud platform adaptation framework provided by the embodiment of the invention, local project is migrated to the cloud micro-service environment of the Internet, such as the CSE environment, the project code is not required to be modified when in the TSF environment of messenger, the framework is automatically adapted to the local environment and the cloud environment, and the same top-layer capability interface is provided upwards, so that the project code is not required to be modified, and is smoothly migrated from the local environment to the cloud environment. When a cloud environment service provider needs to be changed, such as switching from a TSF of vacation to a CSE of hua, project codes do not need to be changed. The framework will automatically adapt to the underlying facilities of different cloud environments, providing the same top-level capabilities to the project. The framework can automatically adapt to the capability provided by the bottom cloud environment and is integrated into a unified upward capability interface.
A second aspect,
Referring to fig. 4, an embodiment of the present invention provides a cloud platform adaptation method, which includes the following steps:
s1, acquiring an environment identifier of a current cloud platform.
S2, eliminating the adaptive configuration of the non-current cloud platform according to the starter mode based on SpringCloud and the environment identifier.
S3, automatically configuring the adaptation configuration corresponding to the environment identifier.
In an alternative embodiment, the adaptation configuration includes a native function configuration and a feature function configuration.
In an alternative embodiment, step S2 specifically includes:
and excluding the original function configuration of the non-current cloud platform according to the environment identification, and introducing the configuration of the characteristic function of the current cloud platform according to the environment identification.
In an alternative embodiment, step S3 specifically includes:
the automatic configuration environment identifies the corresponding native function configuration of the current cloud platform and the configuration of the feature functions of the current cloud platform introduced by the automatic configuration.
In an alternative embodiment, the adaptation configuration comprises a public configuration and a proprietary configuration to which at least two cloud platforms respectively correspond.
In an alternative embodiment, the proprietary configuration includes a service center and an interface configuration of the configuration center.
The step S2 specifically comprises the following steps: and excluding interface configuration of the service center and the configuration center of the non-current cloud platform according to the environment identification.
The step S3 specifically comprises the following steps: and automatically configuring interface configuration of a service center and a configuration center of the current cloud platform corresponding to the environment identifier.
In an alternative embodiment, the common configuration includes an authentication interface and a current limit interface. The proprietary configuration includes an authentication configuration and a current limit configuration.
Before the step S2, the method further comprises:
and intercepting the request according to the authentication interface.
And establishing connection according to the current limiting interface.
The step S2 includes:
and introducing the corresponding authentication configuration and current limiting configuration of the current cloud platform according to the environment identification.
The step S3 comprises the following steps:
and authenticating the request and limiting the connection according to the authentication configuration and the current limiting configuration of the current cloud platform.
In an alternative embodiment, the proprietary configuration further includes a routed interface configuration.
The step S2 comprises the following steps: and excluding the interface configuration of the route of the non-current cloud platform according to the environment identification.
The step S3 comprises the following steps: and automatically configuring the interface configuration of the route of the current cloud platform corresponding to the environment identifier.
Third embodiment,
The embodiment of the invention provides cloud platform adapting equipment, which comprises a processor, a memory and a computer program stored in the memory. The computer program is executable by a processor to implement the cloud platform adaptation method as described in the second aspect.
Fourth embodiment,
An embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium includes a stored computer program, and when the computer program runs, controls a device where the computer readable storage medium is located to execute the cloud platform adaptation method as described in the second aspect.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus and method embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. The cloud platform adaptation framework is characterized by comprising an identification module, an exclusion module, an execution module and at least two adaptation configurations of the cloud platform;
the identification module is used for acquiring the environment identification of the current cloud platform;
the elimination module is used for eliminating the adaptive configuration of the non-current cloud platform according to the environmental identifier based on the starter mode of SpringCloud;
the execution module is used for automatically configuring the adaptation configuration corresponding to the environment identifier;
the adaptation configuration comprises a configuration of a native function and a configuration of a distinctive function;
the excluding module is used for excluding the original function configuration of the non-current cloud platform according to the environment identifier and introducing the configuration of the characteristic function of the current cloud platform according to the environment identifier;
the execution module is used for automatically configuring the native function configuration of the current cloud platform corresponding to the environment identifier and automatically configuring the configuration of the feature function of the current cloud platform introduced.
2. The cloud platform adaptation framework of claim 1, wherein the adaptation configuration comprises a public configuration and a proprietary configuration to which the at least two cloud platforms respectively correspond.
3. The cloud platform adaptation framework of claim 2, wherein said proprietary configuration comprises an interface configuration of a service center and a configuration center;
the excluding module is used for excluding interface configuration of the service center and the configuration center of the non-current cloud platform according to the environment identifier;
the execution module is used for automatically configuring the service center of the current cloud platform corresponding to the environment identifier and the interface configuration of the configuration center.
4. The cloud platform adaptation framework of claim 2, wherein said common configuration comprises an authentication interface and a current limiting interface; the proprietary configuration includes an authentication configuration and a current limiting configuration;
the cloud platform adaptation frame further comprises an interception module and a current limiting module;
the interception module is used for intercepting a request according to the authentication interface;
the current limiting module is used for establishing connection according to the current limiting interface;
the elimination module is also used for introducing corresponding authentication configuration and current limiting configuration of the current cloud platform according to the environment identifier;
the execution module is further configured to authenticate the request and limit the connection according to the authentication configuration and the current limit configuration of the current cloud platform.
5. The cloud platform adaptation framework of any of claims 2 to 4, wherein said proprietary configuration further comprises a routed interface configuration;
the excluding module is used for excluding the interface configuration of the route of the non-current cloud platform according to the environment identifier;
and the execution module is used for automatically configuring the interface configuration of the route of the current cloud platform corresponding to the environment identifier.
6. A cloud platform adaptation method, comprising:
acquiring an environment identifier of a current cloud platform;
based on the starter mode of SpringCloud, according to the environment identification, excluding the adaptive configuration of the non-current cloud platform;
automatically configuring the adaptation configuration corresponding to the environment identifier;
the adaptation configuration comprises a native function configuration and a feature function configuration;
the starter mode based on SpringCloud excludes the adaptive configuration of the non-current cloud platform according to the environment identifier, and specifically comprises the following steps:
excluding the original function configuration of the non-current cloud platform according to the environment identifier, and introducing the configuration of the characteristic function of the current cloud platform according to the environment identifier;
the automatic configuration of the adaptation configuration corresponding to the environment identifier specifically comprises the following steps:
and automatically configuring the native function configuration of the current cloud platform corresponding to the environment identifier and automatically configuring the configuration of the feature function of the current cloud platform introduced.
7. A cloud platform adaptation device, comprising a processor, a memory, and a computer program stored in the memory; the computer program is executable by the processor to implement the cloud platform adaptation method of claim 6.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program when run controls a device in which the computer readable storage medium is located to execute the cloud platform adaptation method according to claim 6.
CN202111354206.0A 2021-11-15 2021-11-15 Cloud platform adaptation frame, method, equipment and storage medium Active CN114070734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111354206.0A CN114070734B (en) 2021-11-15 2021-11-15 Cloud platform adaptation frame, method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111354206.0A CN114070734B (en) 2021-11-15 2021-11-15 Cloud platform adaptation frame, method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114070734A CN114070734A (en) 2022-02-18
CN114070734B true CN114070734B (en) 2023-06-20

Family

ID=80272520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111354206.0A Active CN114070734B (en) 2021-11-15 2021-11-15 Cloud platform adaptation frame, method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114070734B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118595B (en) * 2022-06-28 2024-03-19 平安银行股份有限公司 Hybrid cloud deployment method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015024371A1 (en) * 2013-08-21 2015-02-26 华为技术有限公司 Adaptation method for cloud platform user interface, and adapter
CN105100200A (en) * 2015-06-02 2015-11-25 北京京东尚科信息技术有限公司 Method and system for distributed deployment, unified configuration and automatic adaptation
CN106302590A (en) * 2015-05-28 2017-01-04 上海汽车集团股份有限公司 Cloud platform
CN109660392A (en) * 2018-12-14 2019-04-19 武汉烽火信息集成技术有限公司 Hardware unitizes adaptive management dispositions method and system under a kind of linux system
CN110417593A (en) * 2019-07-26 2019-11-05 新华三技术有限公司成都分公司 A kind of device management method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9710292B2 (en) * 2013-08-02 2017-07-18 International Business Machines Corporation Allowing management of a virtual machine by multiple cloud providers

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015024371A1 (en) * 2013-08-21 2015-02-26 华为技术有限公司 Adaptation method for cloud platform user interface, and adapter
CN106302590A (en) * 2015-05-28 2017-01-04 上海汽车集团股份有限公司 Cloud platform
CN105100200A (en) * 2015-06-02 2015-11-25 北京京东尚科信息技术有限公司 Method and system for distributed deployment, unified configuration and automatic adaptation
CN109660392A (en) * 2018-12-14 2019-04-19 武汉烽火信息集成技术有限公司 Hardware unitizes adaptive management dispositions method and system under a kind of linux system
CN110417593A (en) * 2019-07-26 2019-11-05 新华三技术有限公司成都分公司 A kind of device management method and device

Also Published As

Publication number Publication date
CN114070734A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
US9338067B2 (en) Network resource deployment for cloud-based services
CN111431740B (en) Data transmission method, device, equipment and computer readable storage medium
US10452372B2 (en) Method and deployment module for managing a container to be deployed on a software platform
CN112506617B (en) Mirror image updating method and device for side car containers in Kubernetes cluster
WO2018098445A1 (en) Managing messaging protocol communications
CN110352401B (en) Local device coordinator with on-demand code execution capability
CN112311786B (en) Service request processing method and device, storage medium and computing equipment
CN110784409B (en) Spring Cloud-based micro-service gray level publishing method
CN110990047A (en) Fusion method and device for multiple microservice architectures
CN111277481B (en) Method, device, equipment and storage medium for establishing VPN tunnel
CN113301116A (en) Cross-network communication method, device, system and equipment for microservice application
CN114168179B (en) Micro-service management method, micro-service management device, computer equipment and storage medium
CN114070734B (en) Cloud platform adaptation frame, method, equipment and storage medium
CN113220484A (en) Micro-service calling method and device, electronic equipment and storage medium
CN112035122B (en) Interface deployment method, system and storage medium
CN115248692A (en) Device and method for supporting cloud deployment of multiple deep learning framework models
CN113468552B (en) Data processing method and device
CN111245634A (en) Virtualization management method and device
CN111930626A (en) Automatic testing method and device based on PaaS cloud service
CN114637553B (en) Method, system, equipment and storage medium for configuring comprehensive treatment platform of cell
US11936530B1 (en) System, method, and computer program for AWS autoscaling of Tuxedo systems
CN117785228B (en) Application deployment method and device
CN116932251B (en) System integration method and system based on micro front end
CN116582581B (en) Network service providing method, device, equipment and storage medium
CN118012443A (en) K8 s-based Hadoop cluster self-adaptive deployment method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant