Joint debugging environment automatic construction method and device, electronic equipment and storage medium
By automatically responding to code commit events on development branches, extracting network identification information of microservices, generating deployment strategies for the joint debugging environment, and realizing automated communication and interconnection between microservices, the problem of low efficiency of manual operation in existing technologies is solved, and the joint debugging efficiency and communication reliability of distributed systems are improved.
Patent Information
- Application Number
- CN202511084455.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, the setup of the integration testing environment relies entirely on manual operation, which is inefficient and makes it difficult to cope with the challenges of distributed integration testing of microservices under multi-cloud deployment and hybrid cloud architecture.
By automatically responding to code commit events on development branches, extracting network identification information of microservices, generating deployment strategies for the integration testing environment, and realizing communication interconnection between microservice sets, including automated configuration of single-domain integration testing and multi-domain integration testing environments and the establishment of cross-domain service call channels.
It has achieved fully automated construction of the joint debugging environment, significantly improving development efficiency, ensuring the accuracy and reliability of communication between microservices, and avoiding errors introduced by manual operation.
Smart Images

Figure CN120973654A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of environment building, and particularly relates to a method and device for automatically building a joint debugging environment, an electronic device and a storage medium. BACKGROUND
[0002] In modern microservice architecture, joint debugging environment building is a key link of software development. With the adoption of multi-cloud deployment and hybrid cloud architecture by enterprises, microservices are usually scattered in different network domains for running, for example, an order service may be deployed in the order.example.com domain of a private cloud, and a payment service is deployed in the pay.api.com domain of a public cloud. Although this distributed architecture improves system flexibility, it brings great challenges to joint debugging testing in the development stage.
[0003] The current mainstream joint debugging environment building scheme mainly relies on manual operation: developers need to manually create a Kubernetes deployment template, and realize cross-domain service access by modifying the Hosts file or configuring the Domain Name System (DNS) resolution. The typical process includes: (1) manually selecting the services to be joint debuged according to the code branch, (2) querying the service registry center to obtain the network location of each instance, (3) writing Ingress routing rules to realize service interconnection. For example, when the feature / payment branch is modified, the developer needs to manually record the Internet Protocol (IP) addresses of the order-service and pay-service, and update the gateway configuration of all related test environments.
[0004] However, the joint debugging environment building in the prior art completely relies on manual operation, which is low in efficiency. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a joint debugging environment automatic building method and device, an electronic device and a storage medium, to solve the problem of low efficiency of joint debugging environment building relying completely on manual operation in the prior art. The specific technical solutions are as follows:
[0006] In a first aspect, the present application provides a joint debugging environment automatic building method, comprising:
[0007] In response to a code commit event of a development branch, extracting a microservice set associated with the development branch and network identification information of each microservice;
[0008] Generating a joint debugging environment deployment strategy according to the network identification information;
[0009] Creating a joint debugging environment instance based on the joint debugging environment deployment strategy, and realizing communication interconnection between the microservice set.
[0010] In a possible implementation, the generating a joint debugging environment deployment strategy according to the network identification information comprises:
[0011] extracting a registration domain name of each microservice from the network identification information;
[0012] generating a single joint debugging environment deployment strategy when the registration domain names of all microservices belong to the same domain name level;
[0013] generating a cross-domain joint debugging environment deployment strategy and a cross-domain communication scheme comprising gateway routing rules and domain name resolution mapping when the registration domain names of microservices belong to different domain name levels.
[0014] In a possible implementation, the creating a joint debugging environment instance based on the joint debugging environment deployment strategy and realizing communication interconnection among the set of microservices comprises:
[0015] creating a unified namespace in a container orchestration platform according to the single joint debugging environment deployment strategy;
[0016] deploying all microservices in the set of microservices to the namespace;
[0017] configuring a service discovery mechanism to enable each microservice to directly communicate through an internal domain name.
[0018] In a possible implementation, the creating a joint debugging environment instance based on the joint debugging environment deployment strategy and realizing communication interconnection among the set of microservices comprises:
[0019] creating a virtual network environment with a dedicated network identification for each registration domain name according to the cross-domain joint debugging environment deployment strategy;
[0020] deploying a microservice instance corresponding to the registration domain name in the virtual network environment;
[0021] determining an access address of each microservice through the dedicated network identification, and configuring a domain name routing mapping rule in a gateway according to the access address;
[0022] establishing a cross-domain service calling channel according to the routing mapping rule.
[0023] In a possible implementation, the establishing a cross-domain service calling channel according to the routing mapping rule comprises:
[0024] generating configuration data based on the routing mapping rule;
[0025] transmit the configuration data to an associated development terminal through an encrypted communication link, control the development terminal to perform an automated configuration loading according to the configuration data and feed back an execution result;
[0026] establish a cross-domain service calling channel according to the execution result.
[0027] In one possible implementation, the method further includes:
[0028] listening to a code change event of the development branch;
[0029] when the code change event is listened to, determining a microservice change feature corresponding to the code change event;
[0030] generating a corresponding environment update operation sequence according to the microservice change feature;
[0031] performing the environment update operation sequence in a service dependency order.
[0032] In one possible implementation, the method further includes:
[0033] obtaining a complete submission identifier of the development branch from a code repository;
[0034] persistently storing the complete submission identifier and a name of the development branch to a test environment metadata database;
[0035] when all microservice containers of the test environment instance are started, injecting an environment variable containing the complete submission identifier;
[0036] configuring an application performance monitoring system, and taking the complete submission identifier as a label field of all running indexes.
[0037] In a second aspect, the application provides a test environment automated construction device, including:
[0038] an extraction module configured to extract a microservice set associated with a development branch and network identification information of each microservice in response to a code submission event of the development branch;
[0039] a generation module configured to generate a test environment deployment strategy according to the network identification information;
[0040] a creation module configured to create a test environment instance based on the test environment deployment strategy and realize communication interconnection between the microservice set.
[0041] In one possible implementation, the generation module is specifically configured to:
[0042] extract a registration domain name of each microservice from the network identification information;
[0043] When the registration domain names of all microservices belong to the same domain level, a single joint debugging environment deployment strategy is generated;
[0044] When the registration domain names of microservices belong to different domain levels, a sub-domain joint debugging environment deployment strategy and a cross-domain communication scheme including gateway routing rules and domain name resolution mapping are generated.
[0045] In one possible implementation, the creating module is specifically configured to:
[0046] According to the single joint debugging environment deployment strategy, a unified namespace is created in a container orchestration platform;
[0047] All microservices in the microservice set are deployed to the namespace;
[0048] A service discovery mechanism is configured to enable each microservice to directly communicate through an internal domain name.
[0049] In one possible implementation, the creating module is further configured to:
[0050] According to the sub-domain joint debugging environment deployment strategy, for each registration domain name, a virtual network environment with a dedicated network identifier is created for the registration domain name;
[0051] The microservice instance corresponding to the registration domain name is deployed in the virtual network environment;
[0052] The access address of each microservice is determined through the dedicated network identifier, and domain name routing mapping rules are configured in the gateway according to the access address;
[0053] According to the routing mapping rules, a cross-domain service calling channel is established.
[0054] In one possible implementation, the creating module is further configured to:
[0055] Based on the routing mapping rules, configuration data is generated;
[0056] The configuration data is transmitted to an associated development terminal through an encrypted communication link, the development terminal is controlled to perform automatic configuration loading according to the configuration data, and an execution result is fed back;
[0057] According to the execution result, a cross-domain service calling channel is established.
[0058] In one possible implementation, the apparatus further includes a listening module configured to:
[0059] Listen to a code change event of the development branch;
[0060] determine a microservice change feature corresponding to the code change event when the code change event is monitored;
[0061] generate a corresponding environment update operation sequence according to the microservice change feature;
[0062] execute the environment update operation sequence in a service dependency order.
[0063] In one possible implementation, the apparatus further comprises a configuration module configured to:
[0064] obtain a complete commit identifier of the development branch from a code repository;
[0065] persist the complete commit identifier and a name of the development branch to a test environment metadata database;
[0066] inject an environment variable containing the complete commit identifier when all microservice containers of the test environment instance are started;
[0067] configure an application performance monitoring system to take the complete commit identifier as a label field of all running indexes.
[0068] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
[0069] The memory is configured to store a computer program.
[0070] The processor is configured to execute the program stored on the memory to implement the method steps of any one of the first aspect.
[0071] In a fourth aspect, a computer readable storage medium is provided, characterized in that the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps of any one of the first aspect.
[0072] In a fifth aspect, a computer program product containing instructions is provided, which, when executed on a computer, causes the computer to execute the test environment automatic construction method of any one of the above aspects.
[0073] The embodiments of the present application have the following beneficial effects:
[0074] The embodiment of the present application provides a kind of to be linked to the automatic construction method, device, electronic equipment and storage medium of environment, in the present application, by responding to the code submission event of development branch, the intelligent triggering of the construction of linked environment is realized;By extracting the network identification information of each microservice, the association between services is automatically obtained;By intelligently generating deployment strategy based on network identification information and automatically creating linked environment instance, the automatic configuration of inter-service communication is realized.The whole process automation construction of linked environment is realized by the above technical solution: on the one hand, the development efficiency is significantly improved;On the other hand, through the standardized automatic processing process, the accuracy and reliability of communication configuration between different microservices can be effectively guaranteed, and errors that may be introduced by manual operation are avoided.
[0075] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS
[0076] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.
[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0078] One or more embodiments are exemplified by pictures in corresponding drawings, which do not constitute limitation to the embodiments, and elements with the same reference numerals in the drawings represent similar elements, unless otherwise specified, and the drawings do not constitute proportional limitation.
[0079] Figure 1 A flow chart of a linked environment automatic construction method provided by an embodiment of the present application is provided;
[0080] Figure 2 A flow chart of another linked environment automatic construction method provided by an embodiment of the present application is provided;
[0081] Figure 3 A flow chart of another linked environment automatic construction method provided by an embodiment of the present application is provided;
[0082] Figure 4 A structure schematic diagram of a linked environment automatic construction device provided by an embodiment of the present application is provided;
[0083] Figure 5 A structure schematic diagram of an electronic device provided by an embodiment of the present application is provided. Detailed Implementation
[0084] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0085] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0086] Figure 1 This is a flowchart illustrating an automated construction method for a joint debugging environment provided in an embodiment of this application. This method can be applied to one or more electronic devices such as smartphones, laptops, desktop computers, portable computers, and servers. Furthermore, the execution entity of this method can be hardware or software. When the execution entity is hardware, it can be one or more of the aforementioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the execution entity is software, this method can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are imposed here.
[0087] like Figure 1 As shown, the method specifically includes:
[0088] S101. In response to the code commit event of the development branch, extract the set of microservices associated with the development branch and the network identification information of each microservice.
[0089] A development branch is a separate code branch created in a version control system (such as Git) for the development of a specific feature, which contains a complete history of code modifications.
[0090] A code commit event refers to the action of a developer uploading local code changes to a central code repository.
[0091] A collection of microservices refers to multiple functionally independent service components that require collaborative debugging. These components are loosely coupled in architecture but need to be debugged together.
[0092] The network identification information refers to the access identification of each microservice registered in the service registration center, and at least includes a service domain name (such as order.example.com), a network protocol type (such as HTTP (Hypertext Transfer Protocol) / gRPC (Google Remote Procedure Call)), and a port number and the like connection parameters.
[0093] In the embodiment of the application, the commit operation of the development branch is automatically captured by listening to the webhook event of the code version control system; the service dependency declaration file (such as pom.xml or go.mod) in the commit content is parsed to determine the scope of the microservices that need to be integrated; and the complete network access identification of each microservice is obtained by querying the service registration center.
[0094] S102, generating an integrated test environment deployment strategy according to the network identification information.
[0095] The integrated test environment deployment strategy refers to a resource configuration and network connection scheme formulated for building an integrated test environment.
[0096] In the embodiment of the application, S102 can include the following steps: extracting the registration domain name of each microservice from the network identification information; when the registration domain names of all microservices belong to the same domain name level, generating a single integrated test environment deployment strategy; and when the registration domain names of microservices belong to different domain name levels, generating a multi-domain integrated test environment deployment strategy and a cross-domain communication scheme including gateway routing rules and domain name resolution mapping.
[0097] The registration domain name refers to the network access address identification of the microservice registered in the service registration center; the domain name level refers to the hierarchical division in the DNS (Domain Name System) structure, such as the top-level domain, the second-level domain, and the like; the single integrated test environment deployment strategy refers to a scheme in which all microservices are deployed in the same network domain; the multi-domain integrated test environment deployment strategy refers to a deployment scheme when microservices are distributed in multiple network domains; the gateway routing rule is a strategy configuration for guiding traffic forwarding; and the domain name resolution mapping refers to the corresponding relationship configuration of the domain name and the network address.
[0098] In specific implementation, first, the registration domain name level relationship of the microservice is parsed; when all microservices belong to the same domain name level (such as *.example.com), a unified namespace deployment strategy is generated; when the microservices belong to different domain name levels (such as order.example.com and pay.api.com), a multi-domain deployment strategy and the corresponding cross-domain communication scheme are generated, including configuring the domain name-based routing rule in the application gateway, and establishing the mapping record of the domain name resolution service.
[0099] The scheme automatically generates an optimal deployment strategy through intelligent analysis of domain name topology, solves the problem of low efficiency of manual configuration in the prior art, and ensures the reliability of service calling through a standardized cross-domain communication scheme.
[0100] S103, creating a joint debugging environment instance based on the joint debugging environment deployment strategy, and realizing communication interconnection between the microservice set.
[0101] The joint debugging environment instance refers to an independent runtime environment created for a specific development branch, which includes complete microservice deployment and network configuration.
[0102] Communication interconnection refers to a network channel established between microservices.
[0103] In an embodiment, S103 can include the following steps: creating a unified namespace in a container orchestration platform according to the single joint debugging environment deployment strategy; deploying all microservices in the microservice set to the namespace; and configuring a service discovery mechanism to enable each microservice to communicate directly through an internal domain name.
[0104] The container orchestration platform refers to a system for automatically deploying, managing, and extending containerized applications; the unified namespace refers to an isolated resource grouping created for the joint debugging environment; and the service discovery mechanism refers to a technical scheme for mutual positioning and communication between microservices.
[0105] In the scheme, first, a dedicated namespace is created in a container orchestration platform according to a single joint debugging environment deployment strategy; then, all associated microservices are uniformly deployed to the namespace; and finally, a service communication mechanism based on an internal domain name is established by configuring a service discovery component. Through the automatic configuration of the namespace isolation and the service discovery mechanism, the scheme not only simplifies the joint debugging environment building process, but also ensures the efficiency and reliability of communication between microservices in the same domain, effectively solving the technical problems of complicated and error-prone manual configuration in traditional schemes.
[0106] In another embodiment, S103 can include the following steps: according to the sub-domain joint debugging environment deployment strategy, for each registered domain name, creating a virtual network environment with a dedicated network identifier for the registered domain name; deploying the microservice instance corresponding to the registered domain name in the virtual network environment; determining the access address of each microservice through the dedicated network identifier, and configuring domain name routing mapping rules in the gateway according to the access address; and establishing a cross-domain service calling channel according to the routing mapping rules.
[0107] The exclusive network identifier refers to a unique network identifier allocated for each virtual network environment, including an IP address segment, subnet division, and security group configuration. The virtual network environment refers to an isolated network space created through software-defined network technology. The domain name routing mapping rule refers to a configuration strategy for mapping service domain names to specific network addresses.
[0108] In this scheme, first, an independent virtual network environment is created for each registered domain name and an exclusive network identifier is configured. Then, microservice instances are deployed in the corresponding network environment. Next, service access addresses are obtained by resolving the network identifier, and domain name routing rules are configured on the API gateway. Finally, a secure communication channel between cross-domain services is established. This scheme, through automated network isolation and intelligent routing configuration, not only solves the technical difficulties of complex cross-domain debugging environment setup in traditional schemes, but also ensures the security and reliability of microservice communication between different network domains, significantly improving the debugging efficiency of distributed systems.
[0109] Among them, establishing a cross-domain service calling channel according to the routing mapping rule can include the following steps: generating configuration data based on the routing mapping rule; transmitting the configuration data to the associated development terminal through an encrypted communication link, controlling the development terminal to perform automatic configuration loading according to the configuration data and feeding back the execution result; and establishing a cross-domain service calling channel according to the execution result.
[0110] The configuration data contains the correspondence between the debugging environment domain name and the gateway IP address. The encrypted communication link refers to a data transmission channel using encryption technologies such as TLS (Transport Layer Security). The automatic configuration loading refers to the process of automatically modifying local resolution configuration through scripts.
[0111] In the scheme, the joint debugging control system first analyzes the routing mapping rule to generate standardized configuration data, pushes the configuration data to the development terminal through a secure channel, and after the development terminal receives the configuration data, the following operations are automatically executed through the pre-installed agent program (Agent): (1) verifying the digital signature of the configuration data; (2) backing up the existing local analysis configuration (such as the Hosts file); (3) atomically writing new domain name-address mapping records; (4) refreshing the local DNS cache; (5) returning a feedback message containing the execution status code (success / failure) and detailed logs to the joint debugging control system. After the joint debugging control system receives successful feedback from all associated terminals, the following operations are performed: (1) activating the pre-configured routing rules at the API gateway; (2) injecting cross-domain access policies into the service mesh; (3) sending test requests to verify channel connectivity; (4) marking the channel status as "ready" in the metadata database. In this way, the cross-domain channel is established. This scheme not only solves the security risks of manually modifying the Hosts file through encrypted transmission and automated configuration, but also realizes the minute-level rapid construction of the cross-domain joint debugging environment. The manual operation that takes several hours in the traditional scheme is converted into a standardized process, significantly improving the joint debugging efficiency of distributed systems.
[0112] In the embodiments of the present application, the intelligent triggering of the joint debugging environment construction is realized by automatically responding to the code submission events of the development branch; the association relationship between services is automatically obtained by extracting the network identification information of each microservice; and the automatic configuration of inter-service communication is realized by intelligently generating deployment strategies based on network identification information and automatically creating joint debugging environment instances. The present application realizes the full-process automatic construction of the joint debugging environment through the above technical solutions: on the one hand, the development efficiency is significantly improved; on the other hand, through the standardized automatic processing process, the accuracy and reliability of the communication configuration between different microservices can be effectively guaranteed, and errors introduced by manual operation can be avoided.
[0113] Referring to Figure 2 , an embodiment flowchart of another joint debugging environment automatic construction method provided by the embodiments of the present application is shown. As Figure 2 indicated, the flowchart can include the following steps:
[0114] S201, listen to the code change event of the development branch.
[0115] The code change event refers to the operation of triggering the version control system state change, such as code submission (Commit) and merging (Merge) in the development branch.
[0116] In the embodiments of the present application, the code repository Webhook notification or the change log of the version control system is listened to, and the code update behavior of the development branch is captured in real time to provide a triggering condition for subsequent automatic update.
[0117] S202, when the code change event is listened to, determine the microservice change characteristics corresponding to the code change event.
[0118] The microservice change characteristics refer to the service components affected by the code change and their modification attributes, including interface definition change, dependent library update, configuration file modification, etc.
[0119] In the embodiment of the application, by analyzing the submission difference (Diff), the modified microservice code directory is identified, the change type and its influence range are analyzed, and the mapping relationship between the change and the service component is established.
[0120] S203, generating a corresponding environment update operation sequence according to the microservice change characteristics.
[0121] The environment update operation sequence refers to a set of environment adjustment instructions generated to adapt to the code change.
[0122] In the embodiment of the application, based on the change characteristic analysis result, an execution sequence containing service restart, configuration hot loading, dependency synchronization and the like is dynamically generated, and the dependency relationship between operations is labeled.
[0123] S204, executing the environment update operation sequence according to the service dependency order.
[0124] The service dependency order refers to the topological sorting result of the calling relationship between microservices.
[0125] In the embodiment of the application, by querying the dependency graph of the service registration center, the execution order of the update operation is determined, the dependent service is updated first, and the failure of joint debugging caused by the broken calling chain is avoided.
[0126] Figure 2 As shown in the flow, through the automatic monitoring and intelligent analysis of the code change, the traditional manual change identification and manual update joint debugging environment process is converted into a standardized operation sequence, not only realizing the function of automatically updating the environment after the code is submitted, but also solving the "service calling chain broken" problem in the microservice joint debugging scene through the dependency perception sorting execution mechanism, so that the joint debugging environment always maintains consistency with the code version, improves the development efficiency, and guarantees the system stability.
[0127] Referring to Figure 3 Another embodiment of the embodiment flow chart of the joint debugging environment automatic construction method provided by the embodiment of the application. As Figure 3 As shown in the flow, the flow can include the following steps:
[0128] S301, obtaining the complete submission identifier of the development branch from the code repository.
[0129] The complete commit identifier refers to a unique hash value (such as a 40-bit SHA-1 value of Git) generated by a version control system for each code commit.
[0130] In the embodiments of the present application, the complete commit identifier of the latest commit of the development branch is obtained by calling the application program interface (API) of the code repository, so as to ensure accurate tracing of the code version.
[0131] In S302, the complete commit identifier and the name of the development branch are persistently stored in the integration environment metadata database.
[0132] The integration environment metadata database is a special database used for storing the association relationship between the environment configuration and the code version.
[0133] In the embodiments of the present application, the complete commit identifier and the branch name are persistently stored as metadata, and a bidirectional index relationship of "code-environment" is established.
[0134] In S303, when all microservice containers of the integration environment instance are started, an environment variable containing the complete commit identifier is injected.
[0135] The environment variable injection refers to writing a specified parameter into a runtime environment during the startup phase of a container.
[0136] In the embodiments of the present application, the commit identifier is injected into a preset variable (such as GIT_COMMIT_SHA) of all microservice containers through template configuration of a container orchestration platform, so as to realize runtime search of version information.
[0137] In S304, an application performance monitoring system is configured, and the complete commit identifier is used as a label field of all running indicators.
[0138] The label field of the running indicator refers to a dimension identifier used for classification in monitoring data.
[0139] In the embodiments of the present application, the commit identifier is configured as a unified label in the application performance monitoring (APM) system, so that all performance indicators (such as delay and error rate) are automatically associated with a specific code version.
[0140] Figure 3 The illustrated process ensures that the integration environment and the code version are strictly consistent through the persistent storage and runtime injection of the commit identifier, and the cause-and-effect relationship between code changes and system performance is quickly located with the help of the version label of the monitoring indicator, so as to improve the problem troubleshooting efficiency, provide reliable basis for version rollback and fault reproduction in the continuous integration scenario, and significantly reduce the operation and maintenance complexity in the integration process.
[0141] In addition, in another embodiment, the method can further include an environment recycling step: listening to state change events of the development branch; when detecting branch merging or deletion, performing: archiving the running log and configuration parameters of the integration environment instance; releasing the computing resources occupied by the integration environment instance; cleaning up the network configuration associated with the integration environment instance.
[0142] The state change event refers to the life cycle state change of the development branch in the version control system, including branch merging (Merge) or deletion (Delete) operations; the computing resource includes the processor, memory and storage resources allocated for the integration environment; the network configuration involves virtual network, load balancing rules and domain name resolution records and other infrastructures.
[0143] In this scheme, the recycling process is triggered by listening to the hook event of the version control system. First, the running log and configuration parameters are compressed and archived to an object storage service (such as AWS S3), then the container orchestration platform interface is called to release the container instance and the associated persistent volume, and finally the routing rules in the service mesh and the DNS resolution records are cleaned up. This scheme converts the traditional manual intervention environment cleaning work into a standardized process through an intelligent resource recycling mechanism, not only avoiding the cost waste caused by resource leakage, but also providing complete data support for historical problem tracing through configuration archiving, and comprehensively improving the standardization and reliability of integration environment management.
[0144] Based on the same technical concept, the embodiments of the present application also provide an integration environment automatic construction device, as shown in Figure 4 The device comprises:
[0145] The extraction module 41 is configured to extract a microservice set associated with the development branch and network identification information of each microservice in response to a code submission event of the development branch.
[0146] The generation module 42 is configured to generate an integration environment deployment strategy according to the network identification information.
[0147] The creation module 43 is configured to create an integration environment instance based on the integration environment deployment strategy and realize communication interconnection between the microservice set.
[0148] In one possible implementation, the generation module is specifically configured to:
[0149] extract the registration domain name of each microservice from the network identification information;
[0150] when the registration domain names of all microservices belong to the same domain level, generate a single integration environment deployment strategy;
[0151] When microservices have registered domains belonging to different domain hierarchy levels, a domain-based joint debugging environment deployment strategy and a cross-domain communication scheme including gateway routing rules and domain name resolution mapping are generated.
[0152] In one possible implementation, the creation module is specifically used for:
[0153] Based on the single-unit debugging environment deployment strategy, a unified namespace is created in the container orchestration platform;
[0154] Deploy all microservices in the microservice set to the namespace;
[0155] The configuration service discovery mechanism enables microservices to communicate directly through internal domain names.
[0156] In one possible implementation, the creation module is further configured to:
[0157] According to the domain-based joint debugging environment deployment strategy, for each registered domain name, a virtual network environment with a unique network identifier is created for the registered domain name;
[0158] Deploy the microservice instance corresponding to the registered domain name in the virtual network environment;
[0159] The access address of each microservice is determined by the exclusive network identifier, and domain name routing mapping rules are configured on the gateway according to the access address;
[0160] Establish a cross-domain service call channel based on the routing mapping rules.
[0161] In one possible implementation, the creation module is further configured to:
[0162] Generate configuration data based on the routing mapping rules;
[0163] The configuration data is transmitted to the associated development terminal via an encrypted communication link, and the development terminal is controlled to perform automated configuration loading based on the configuration data and then feedback the execution result.
[0164] Establish a cross-domain service call channel based on the execution results.
[0165] In one possible implementation, the device further includes a listening module for:
[0166] Listen for code change events on the development branch;
[0167] When a code change event is detected, the microservice change characteristics corresponding to the code change event are determined;
[0168] Generate a corresponding environment update operation sequence based on the microservice change characteristics;
[0169] The environment update operation sequence is executed in the order of service dependencies.
[0170] In one possible implementation, the device further includes a configuration module for:
[0171] Obtain the complete commit identifier of the development branch from the code repository;
[0172] The complete commit identifier and the name of the development branch are persistently stored in the joint debugging environment meta database;
[0173] When all microservice containers of the aforementioned integration testing environment instance start up, an environment variable containing the complete commit identifier is injected.
[0174] Configure the application performance monitoring system and use the complete submission identifier as the label field for all runtime metrics.
[0175] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 5 As shown, it includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0176] Memory 113 is used to store computer programs;
[0177] When processor 111 executes a program stored in memory 113, it performs the following steps:
[0178] In response to code commit events on the development branch, extract the set of microservices associated with the development branch and the network identification information of each microservice;
[0179] A joint debugging environment deployment strategy is generated based on the network identification information;
[0180] Based on the aforementioned deployment strategy for the joint debugging environment, an instance of the joint debugging environment is created, and communication interconnection between the microservice sets is achieved.
[0181] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0182] The communication interface is configured to communicate between the electronic device and other devices.
[0183] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0184] The aforementioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0185] In another embodiment provided in the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above-mentioned joint debugging environment automatic construction methods.
[0186] In another embodiment provided in the present application, a computer program product containing instructions is provided, and when the computer program product is executed on a computer, the computer is caused to execute any of the joint debugging environment automatic construction methods in the above-mentioned embodiments.
[0187] The apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the modules can be selected to achieve the purpose of the embodiment scheme.
[0188] Those skilled in the art can clearly understand the implementation of the embodiments by the description of the above embodiments. The embodiments can be implemented by means of software plus a general hardware platform, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, and the computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0189] It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises", "comprising", "includes", "including" and "has" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order in which they are described unless specifically indicated as such. It is also to be understood that additional or alternative steps can be employed.
[0190] The above description is merely that of specific embodiments of the present application, and thus is not intended to limit the present application. From the above description, one skilled in the art can clearly understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the generic principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the application. Accordingly, the present application is not to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for automatically constructing a joint debugging environment, characterized in that, The method includes: In response to code commit events on the development branch, extract the set of microservices associated with the development branch and the network identification information of each microservice; A joint debugging environment deployment strategy is generated based on the network identification information; Based on the aforementioned deployment strategy for the joint debugging environment, an instance of the joint debugging environment is created, and communication interconnection between the microservice sets is achieved.
2. The method according to claim 1, characterized in that, The step of generating a joint debugging environment deployment strategy based on the network identification information includes: Extract the registered domain names of each microservice from the network identification information; When all microservices' registered domain names belong to the same domain level, a single-connection debugging environment deployment strategy is generated. When microservices have registered domains belonging to different domain hierarchy levels, a domain-based joint debugging environment deployment strategy and a cross-domain communication scheme including gateway routing rules and domain name resolution mapping are generated.
3. The method according to claim 2, characterized in that, The step of creating a joint debugging environment instance based on the joint debugging environment deployment strategy and realizing communication interconnection between the microservice sets includes: Based on the single-unit debugging environment deployment strategy, a unified namespace is created in the container orchestration platform; Deploy all microservices in the microservice set to the namespace; The configuration service discovery mechanism enables microservices to communicate directly through internal domain names.
4. The method according to claim 2, characterized in that, The step of creating a joint debugging environment instance based on the joint debugging environment deployment strategy and realizing communication interconnection between the microservice sets includes: According to the domain-based joint debugging environment deployment strategy, for each registered domain name, a virtual network environment with a unique network identifier is created for the registered domain name; Deploy the microservice instance corresponding to the registered domain name in the virtual network environment; The access address of each microservice is determined by the exclusive network identifier, and domain name routing mapping rules are configured on the gateway according to the access address; Establish a cross-domain service call channel based on the routing mapping rules.
5. The method according to claim 4, characterized in that, The step of establishing a cross-domain service call channel according to the routing mapping rules includes: Generate configuration data based on the routing mapping rules; The configuration data is transmitted to the associated development terminal via an encrypted communication link, and the development terminal is controlled to perform automated configuration loading based on the configuration data and then feedback the execution result. Establish a cross-domain service call channel based on the execution results.
6. The method according to claim 1, characterized in that, The method further includes: Listen for code change events on the development branch; When a code change event is detected, the microservice change characteristics corresponding to the code change event are determined; Generate a corresponding environment update operation sequence based on the microservice change characteristics; The environment update operation sequence is executed in the order of service dependencies.
7. The method according to claim 1, characterized in that, The method further includes: Obtain the complete commit identifier of the development branch from the code repository; The complete commit identifier and the name of the development branch are persistently stored in the joint debugging environment meta database; When all microservice containers of the aforementioned integration testing environment instance start up, an environment variable containing the complete commit identifier is injected. Configure the application performance monitoring system and use the complete submission identifier as the label field for all runtime metrics.
8. An automated construction device for a joint debugging environment, characterized in that, The device includes: The extraction module is used to extract the set of microservices associated with the development branch and the network identification information of each microservice in response to the code commit event of the development branch; The generation module is used to generate a joint debugging environment deployment strategy based on the network identification information; A creation module is used to create a joint debugging environment instance based on the joint debugging environment deployment strategy and to realize communication interconnection between the microservice sets.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the automated construction method for the joint debugging environment as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the automated construction method for the joint debugging environment as described in any one of claims 1-7.