Multi-cloud continuous integration system and method supporting inter-cloud disaster transfer and medium
Through multi-cloud continuous integration system and automatic master selection and load balancing strategies, the system interruption caused by single cloud platform failure is solved, disaster transfer between the cloud is realized, system availability and stability is improved, and cost and business pause time is reduced.
Patent Information
- Application Number
- CN202410959297.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-05
AI Technical Summary
The existing continuous integration system relies on a single cloud platform, resulting in system interruption in the event of failure and lack of disaster recovery mechanisms, resulting in business pauses and serious losses.
The multi-cloud continuous integration system is adopted to realize disaster transfer between the cloud through automatic master selection and load balancing strategies, ensuring automatic transfer and load balancing of tasks between multiple cloud service platforms.
Improves system availability and stability, reduces business interruption risk, shortens failure recovery time, reduces costs, and provides greater flexibility and flexibility.
Smart Images

Figure CN118897762A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and specifically provides a multi-cloud continuous integration system, method and medium that support inter-cloud disaster transfer. Background Art
[0002] In the field of cloud computing, the continuous integration system is a key tool for automating the building, testing, and deployment of software. Continuous integration (CI) is a software development practice that aims to improve the efficiency of team collaboration and software delivery. It integrates code into the mainline development branch frequently and uses automated build tools to verify the correctness of the code to ensure that the code of team members can be integrated together quickly and effectively, reducing integration problems and the risk of software delivery.
[0003] In traditional continuous integration, tasks are usually executed and run on a single cloud platform or a single IDC (computer room). The existing technology has the following technical defects:
[0004] Single cloud platform dependency: Existing continuous integration systems usually rely on a single cloud platform / single IDC (computer room) to execute and run tasks. This dependency makes the system very sensitive to the failure or unavailability of a single cloud vendor. Once a failure occurs, the entire continuous integration process will be interrupted.
[0005] No disaster recovery mechanism: The existing system lacks a disaster recovery mechanism, that is, when a cloud platform fails, there is no ability to automatically transfer tasks to other available underlying resources. This leads to interruptions in continuous integration and business suspension, causing serious losses to the enterprise.
[0006] In view of this, the present invention patent is proposed. Summary of the invention
[0007] In view of the above technical problems, the present invention proposes a multi-cloud continuous integration system, method and medium supporting inter-cloud disaster transfer, so as to realize inter-cloud disaster transfer and support continuous integration in a multi-cloud environment. Specifically, the following technical solutions are adopted:
[0008] In a first aspect, the present invention provides a multi-cloud continuous integration method supporting inter-cloud disaster transfer, comprising:
[0009] Submit continuous integration task requests through the continuous integration client;
[0010] The continuous integration task request is sent to multiple cloud service platforms at the same time, and the continuous integration task request is stored in the database at the same time;
[0011] The master nodes in multiple cloud service platforms obtain the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and select the target working node to send the continuous integration task request for execution;
[0012] When the cloud service platform where the master node is deployed fails, a master node in another cloud service platform is elected as a new master node, and the new master node periodically queries the continuous integration task request from the database and sends it.
[0013] As an optional implementation manner of the present invention, in a multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention, master nodes in multiple cloud service platforms are selected through a master selection process, and the master selection process includes:
[0014] In the initial state or when the master node fails, all control nodes in the cloud service platform are in the candidate state and become master node candidates;
[0015] Each master node candidate sends a request-vote message to other master node candidates. The request-vote message includes the candidate's term number and the candidate's ID. The initial value of each candidate's term number is the same.
[0016] The master node candidate that receives the request-vote message determines whether to vote based on its own voting status and the candidate's term number in the request-vote message;
[0017] After the election timeout expires, the votes obtained by each master node candidate are counted, and the master node candidate with the most votes is selected to become the master node. The other master node candidates are changed from candidate status to initial status.
[0018] As an optional implementation manner of the present invention, in a multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention, the master node candidate receiving the voting request message determines whether to vote according to its own voting status and the term number of the candidate in the voting message, including:
[0019] When the current master node candidate receives the voting request message and does not vote for other master node candidates, it is further determined whether the term number of the master node candidate that sent the voting request message is greater than or equal to the term number of the current master node candidate;
[0020] If the judgment result is yes, the current master node candidate votes for the master node candidate that sent the message requesting a vote. If the judgment result is no, the current master node candidate does not vote.
[0021] As an optional implementation manner of the present invention, in a multi-cloud continuous integration method of the present invention that supports inter-cloud disaster transfer, after the election time expires, the votes obtained by each master node candidate are counted. If the master node candidate with the most votes is not selected, a new round of master election process is re-initiated, and each master node candidate increases its own term number.
[0022] As an optional implementation manner of the present invention, a multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention includes:
[0023] The master node sends a heartbeat signal to other control nodes, and other control nodes receive the heartbeat signal of the master node and reset the election timeout;
[0024] If other control nodes do not receive the heartbeat signal from the master node within the election timeout period, they will automatically change to the candidate state and start a new round of master election process.
[0025] As an optional implementation of the present invention, in a multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention, the master node in the multiple cloud service platforms obtains the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and selects the target working node to issue the continuous integration task request for execution, including:
[0026] The working nodes of each cloud service platform register their IP information with the master node and expose their machine load status;
[0027] The master node in the multiple cloud service platforms obtains the load status of each working node according to the received continuous integration task request, selects the working node with the lowest current load as the target working node, and issues the continuous integration task request for execution.
[0028] As an optional implementation manner of the present invention, a multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention includes:
[0029] After receiving the task sent by the master node, the target working node creates a temporary directory to execute the continuous integration task, pulls the code at the corresponding address in this directory, and executes the integration task according to the script configured by the continuous integration task;
[0030] After the target working node has finished running, it notifies the master node that the continuous integration task has been completed, and the master node updates the completion status of the continuous integration task request in the database.
[0031] In a second aspect, the present invention provides a multi-cloud continuous integration system supporting inter-cloud disaster transfer, comprising:
[0032] Continuous integration client, used to submit continuous integration task requests;
[0033] Multiple cloud service platforms communicate with continuous integration clients respectively, and the continuous integration clients send continuous integration task requests to multiple cloud service platforms simultaneously;
[0034] Database, used to store continuous integration task requests;
[0035] The master nodes in multiple cloud service platforms obtain the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and select the target working node to send the continuous integration task request for execution;
[0036] When the cloud service platform where the master node is deployed fails, a master node in another cloud service platform is elected as a new master node, and the new master node periodically queries the continuous integration task request from the database and sends it.
[0037] In a third aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory is used to store a computer executable program, and when the computer program is executed by the processor, the processor executes the multi-cloud continuous integration method that supports inter-cloud disaster transfer.
[0038] In a fourth aspect, the present invention provides a computer-readable recording medium storing a computer-executable program, which, when executed, implements the multi-cloud continuous integration method supporting inter-cloud disaster transfer.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The multi-cloud continuous integration method of the present invention supports inter-cloud disaster transfer, applies the multi-cloud architecture to the continuous integration system, supports disaster transfer by automatically selecting the master, and improves the stability and availability of the continuous integration system. Specifically, it has the following technical effects:
[0041] High availability and stability: The multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention realizes a multi-cloud architecture and a disaster transfer mechanism. When a cloud service platform fails, the system can automatically transfer tasks to other available cloud service platforms to ensure a continuous continuous integration process. This improves the availability and stability of the system and reduces the risk of business interruption.
[0042] Full utilization of resources: A multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention introduces a load balancing strategy to evenly distribute tasks on different cloud service platforms according to the actual load conditions. This strategy can make the task load of each cloud service platform relatively balanced, fully utilize resources, and improve the overall performance of the system.
[0043] Fast fault recovery: Since the multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention supports disaster transfer, the system can quickly switch tasks to other available cloud service platforms without manual intervention when a fault occurs. This shortens the fault recovery time and greatly reduces the business downtime.
[0044] Elasticity and flexibility: The multi-cloud continuous integration method supporting inter-cloud disaster transfer of the present invention adopts a multi-cloud architecture, allowing different cloud service platforms to be selected for continuous integration according to actual needs, and has higher elasticity and flexibility. No longer relying on a single cloud service platform, enterprises can select the most suitable cloud service platform for continuous integration according to their needs.
[0045] Reduce costs and increase efficiency: The multi-cloud continuous integration method of the present invention supports disaster transfer between clouds. By introducing a multi-cloud architecture and a load balancing strategy, resources can be more fully utilized. At the same time, since there are multiple cloud vendors to choose from, bargaining power can be improved while having more choices and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of a multi-cloud continuous integration method supporting inter-cloud disaster transfer according to an embodiment of the present invention;
[0047] Figure 2 A flowchart of a master selection process in a multi-cloud continuous integration method supporting inter-cloud disaster transfer according to an embodiment of the present invention;
[0048] Figure 3 A framework diagram of a multi-cloud continuous integration system supporting inter-cloud disaster transfer according to an embodiment of the present invention;
[0049] Figure 4 A multi-cloud architecture diagram of a multi-cloud continuous integration system supporting inter-cloud disaster transfer according to an embodiment of the present invention;
[0050] Figure 5 A schematic structural diagram of an electronic device according to an embodiment of the present invention;
[0051] Figure 6 Schematic diagram of a computer-readable recording medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.
[0053] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention claimed for protection, but merely represents some embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.
[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0056] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the invention product is usually placed when in use, or the orientation or positional relationship commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0057] Embodiment 1
[0058] See also Figure 1 As shown, a multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment includes:
[0059] Submit continuous integration task requests through the continuous integration client;
[0060] The continuous integration task request is sent to multiple cloud service platforms at the same time, and the continuous integration task request is stored in the database at the same time;
[0061] The master nodes in multiple cloud service platforms obtain the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and select the target working node to send the continuous integration task request for execution;
[0062] When the cloud service platform where the master node is deployed fails, a master node in another cloud service platform is elected as a new master node, and the new master node periodically queries the continuous integration task request from the database and sends it.
[0063] The multi-cloud continuous integration method of this embodiment supports inter-cloud disaster transfer, applies the multi-cloud architecture to the continuous integration system, supports disaster transfer by automatically selecting the master, and improves the stability and availability of the continuous integration system. The specific technical effects are as follows:
[0064] High availability and stability: A multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment implements a multi-cloud architecture and disaster transfer mechanism. When a cloud service platform fails, the system can automatically transfer tasks to other available cloud service platforms to ensure a continuous continuous integration process. This improves the availability and stability of the system and reduces the risk of business interruption.
[0065] Full utilization of resources: A multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment introduces a load balancing strategy to evenly distribute tasks on different cloud service platforms according to the actual load situation. This strategy can make the task load of each cloud service platform relatively balanced, fully utilize resources, and improve the overall performance of the system.
[0066] Fast fault recovery: Since the multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment supports disaster transfer, the system can quickly switch tasks to other available cloud service platforms without manual intervention when a fault occurs. This shortens the fault recovery time and greatly reduces the business downtime.
[0067] Elasticity and flexibility: The multi-cloud continuous integration method of this embodiment that supports inter-cloud disaster transfer adopts a multi-cloud architecture, allowing different cloud service platforms to be selected for continuous integration according to actual needs, and has higher elasticity and flexibility. No longer relying on a single cloud service platform, enterprises can select the most suitable cloud service platform for continuous integration according to their needs.
[0068] Reduce costs and increase efficiency: This embodiment provides a multi-cloud continuous integration method that supports disaster transfer between clouds. By introducing a multi-cloud architecture and a load balancing strategy, resources can be more fully utilized. At the same time, since there are multiple cloud vendors to choose from, bargaining power can be improved while having more choices, thereby reducing costs.
[0069] As an optional implementation of this embodiment, in a multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment, the master nodes in multiple cloud service platforms are selected through a master selection process, see Figure 2 As shown, the master selection process includes:
[0070] In the initial state or when the master node fails, all control nodes in the cloud service platform are in the candidate state and become master node candidates;
[0071] Each master node candidate sends a request-vote message to other master node candidates. The request-vote message includes the candidate's term number and the candidate's ID. The initial value of each candidate's term number is the same.
[0072] The master node candidate that receives the request-vote message determines whether to vote based on its own voting status and the candidate's term number in the request-vote message;
[0073] After the election timeout expires, the votes obtained by each master node candidate are counted, and the master node candidate with the most votes is selected to become the master node. The other master node candidates are changed from candidate status to initial status.
[0074] A multi-cloud continuous integration method that supports inter-cloud disaster transfer in this embodiment automatically triggers the master selection process to select the master node when the system is in the initial state of startup or when the master node fails. When the cloud service platform deployed by the master node sends a fault, a new master node can be selected to ensure a continuous continuous integration process.
[0075] In this embodiment, the term numbers of the master node candidates are the same in the initial state. At this time, voting is mainly performed based on the order in which the master node candidates send voting request messages to select the master node candidate with the strongest working performance as the master node. At the beginning of each master election process, each control node is transformed into a master node candidate and the term number is incremented at the same time.
[0076] Further, in a multi-cloud continuous integration method supporting inter-cloud disaster transfer of this embodiment, the master node candidate receiving the voting request message determines whether to vote according to its own voting status and the term number of the candidate in the voting message, including:
[0077] When the current master node candidate receives the voting request message and does not vote for other master node candidates, it is further determined whether the term number of the master node candidate that sent the voting request message is greater than or equal to the term number of the current master node candidate;
[0078] If the judgment result is yes, the current master node candidate votes for the master node candidate that sent the message requesting a vote. If the judgment result is no, the current master node candidate does not vote.
[0079] In a multi-cloud continuous integration method that supports inter-cloud disaster transfer in this embodiment, after the election time expires, the votes obtained by each master node candidate are counted. If the master node candidate with the most votes is not selected, a new round of master election process is re-initiated, and each master node candidate increases its own term number.
[0080] Furthermore, a multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment includes:
[0081] The master node sends a heartbeat signal to other control nodes, and other control nodes receive the heartbeat signal of the master node and reset the election timeout;
[0082] If other control nodes do not receive the heartbeat signal from the master node within the election timeout period, they will automatically change to the candidate state and start a new round of master election process.
[0083] As an optional implementation of this embodiment, a specific example of selecting a main process in a multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment is as follows:
[0084] 1) Initialization: When the program starts or a master node failure occurs, the master election process begins. In the initial state of program startup, all nodes are in the candidate state.
[0085] 2) Election timeout: Each control node will periodically set an election timeout. If no heartbeat signal is received from the master node during this period, it is considered that there is no master node at present.
[0086] 3) Becoming a candidate: When the election timeout of a control node is reached, it will switch itself to the candidate state and start the election. The master node candidate will increase its term number and request other nodes to vote for it.
[0087] 4) Request a vote: The master node candidate sends a message to other nodes requesting a vote, including the candidate's term number and the candidate's ID. If the node that receives the request has not voted for other master node candidates and believes that the master node candidate's term number is greater than its own, it will vote for the master node candidate.
[0088] 5) Obtaining the majority of votes: A masternode candidate needs to obtain the majority of votes to become a masternode. If all masternode candidates still do not obtain the majority of votes after the election timeout, a new round of elections will be initiated, and their term number will be increased and the above steps will be repeated.
[0089] 6) Becoming a master node: Once a master node candidate obtains a majority of votes, it becomes the new master node and starts sending heartbeat signals to other control nodes to maintain its master node status. Other control nodes will receive the heartbeat signal from the master node and reset the election timeout.
[0090] 7) Heartbeat signal: The master node periodically sends heartbeat signals to other control nodes to indicate that it is still active. If other control nodes do not receive the heartbeat signal from the master node within a certain period of time, they will change to candidate state and start a new round of elections.
[0091] In a multi-cloud continuous integration method supporting inter-cloud disaster transfer of this embodiment, the master node in the multiple cloud service platforms obtains the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and selects the target working node to issue the continuous integration task request for execution, including:
[0092] The working nodes of each cloud service platform register their IP information with the master node and expose their machine load (including CPU and memory usage);
[0093] The master node in the multiple cloud service platforms obtains the load status of each working node based on the received continuous integration task request, selects the working node with the lowest current load as the target working node, and issues the continuous integration task request for execution, thereby ensuring that the resources of each working node are used close to the average.
[0094] A multi-cloud continuous integration method supporting inter-cloud disaster transfer in this embodiment includes:
[0095] After receiving the task sent by the master node, the target working node creates a temporary directory to execute the continuous integration task, pulls the code at the corresponding address in this directory, and executes the integration task according to the script configured by the continuous integration task;
[0096] After the target working node has finished running, it notifies the master node that the continuous integration task has been completed, and the master node updates the completion status of the continuous integration task request in the database.
[0097] Specifically, this embodiment provides a continuous integration client, assuming that the code version management system used in the enterprise is git (other processing methods are completely consistent), allowing users to configure their own git project address and how to run continuous integration tasks, which is usually a shell script executed on the machine.
[0098] In this embodiment, the master node receives and issues continuous integration tasks, and all control nodes start the http service, receive continuous integration task requests, and store them in the database. The master node periodically obtains pending continuous integration tasks from the database, and selects the work node with the lowest current load to issue the current task for execution based on the load of each work node, ensuring that the resources of each work node are used nearly evenly.
[0099] After receiving the task sent by the master node, the working node of this embodiment creates a temporary directory to execute the task, pulls the code on the corresponding git address in this directory, and executes the integration task according to the shell script configured by the task. After the execution is completed, it notifies the master node that the task has been completed.
[0100] Assume that there are two cloud service platforms A and B. When a single cloud service platform A fails, all nodes in the cloud of cloud service platform A fail. When the time exceeds the election timeout, the control node in the intact cloud service platform B re-triggers the master election process and automatically elects a new master node. This master node then starts to query tasks from the database regularly and issue them to ensure that the entire system can still operate normally, completing the disaster transfer.
[0101] See also Figure 3 As shown, this embodiment also provides a multi-cloud continuous integration system that supports inter-cloud disaster transfer, including:
[0102] Continuous integration client, used to submit continuous integration task requests;
[0103] Multiple cloud service platforms communicate with continuous integration clients respectively, and the continuous integration clients send continuous integration task requests to multiple cloud service platforms simultaneously;
[0104] Database, used to store continuous integration task requests;
[0105] The master nodes in multiple cloud service platforms obtain the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and select the target working node to send the continuous integration task request for execution;
[0106] When the cloud service platform where the master node is deployed fails, a master node in another cloud service platform is elected as a new master node, and the new master node periodically queries the continuous integration task request from the database and sends it.
[0107] The multi-cloud continuous integration system of this embodiment supports inter-cloud disaster transfer, applies the multi-cloud architecture to the continuous integration system, supports disaster transfer by automatically selecting the master, and improves the stability and availability of the continuous integration system. The specific technical effects are as follows:
[0108] High availability and stability: A multi-cloud continuous integration system supporting inter-cloud disaster transfer in this embodiment implements a multi-cloud architecture and disaster transfer mechanism. When a cloud service platform fails, the system can automatically transfer tasks to other available cloud service platforms to ensure a continuous continuous integration process. This improves the availability and stability of the system and reduces the risk of business interruption.
[0109] Full utilization of resources: A multi-cloud continuous integration system supporting inter-cloud disaster transfer in this embodiment introduces a load balancing strategy to evenly distribute tasks on different cloud service platforms according to the actual load situation. This strategy can make the task load of each cloud service platform relatively balanced, fully utilize resources, and improve the overall performance of the system.
[0110] Fast fault recovery: Since the multi-cloud continuous integration system supporting inter-cloud disaster transfer in this embodiment supports disaster transfer, the system can quickly switch tasks to other available cloud service platforms without manual intervention when a fault occurs. This shortens the fault recovery time and greatly reduces the business downtime.
[0111] Elasticity and flexibility: The multi-cloud continuous integration system supporting inter-cloud disaster transfer in this embodiment adopts a multi-cloud architecture, allowing different cloud service platforms to be selected for continuous integration according to actual needs, and has higher elasticity and flexibility. No longer relying on a single cloud service platform, enterprises can select the most suitable cloud service platform for continuous integration according to their needs.
[0112] Reduce costs and increase efficiency: In this embodiment, a multi-cloud continuous integration system that supports disaster transfer between clouds makes better use of resources through the introduction of multi-cloud architecture and load balancing strategies. At the same time, since there are multiple cloud vendors to choose from, bargaining power can be improved while having more choices and reducing costs.
[0113] See also Figure 4 As shown, in this embodiment, a multi-cloud continuous integration system that supports inter-cloud disaster transfer, the working nodes of each cloud service platform register their own IP information with the master node and expose their own machine load conditions; the master nodes in the multiple cloud service platforms obtain the load conditions of each working node based on the received continuous integration task requests, select the working node with the lowest current load as the target working node, and issue the continuous integration task request for execution.
[0114] Embodiment 2
[0115] The following describes an electronic device embodiment of the present invention, which can be regarded as a specific physical implementation of the method and device embodiments of the present invention. The details described in the electronic device embodiment of the present invention should be regarded as a supplement to the above method or device embodiments; details not disclosed in the electronic device embodiment of the present invention can be implemented with reference to the above method or device embodiments.
[0116] Figure 5 It is a structural diagram of an electronic device of an embodiment of the present invention, which includes a processor and a memory, wherein the memory is used to store a computer executable program, and when the computer program is executed by the processor, the processor executes a multi-cloud continuous integration method supporting inter-cloud disaster transfer according to embodiment one.
[0117] like Figure 5As shown, the electronic device is presented in the form of a general computing device. The processor may be one or more and work in coordination. The present invention does not exclude distributed processing, that is, the processor may be dispersed in different physical devices. The electronic device of the present invention is not limited to a single entity, but may also be the sum of multiple physical devices.
[0118] The memory stores a computer executable program, which is usually a machine-readable code. The computer-readable program can be executed by the processor to enable the electronic device to perform the method of the present invention, or at least part of the steps in the method.
[0119] The memory includes a volatile memory, such as a random access memory unit (RAM) and / or a cache memory unit, and may also be a non-volatile memory, such as a read-only memory unit (ROM).
[0120] Optionally, in this embodiment, the electronic device further includes an I / O interface, which is used for the electronic device to exchange data with an external device. The I / O interface can represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of a variety of bus structures.
[0121] It should be understood that Figure 5 The electronic device shown is only an example of the present invention, and the electronic device of the present invention may also include elements or components not shown in the above examples. For example, some electronic devices also include display units such as display screens, and some electronic devices also include human-computer interaction elements such as buttons, keyboards, etc. As long as the electronic device can execute the computer-readable program in the memory to implement the method of the present invention or at least part of the steps of the method, it can be considered as an electronic device covered by the present invention.
[0122] Figure 6 Schematic diagram of a computer readable recording medium according to an embodiment of the present invention. Figure 6As shown, a computer executable program is stored in a computer-readable recording medium, and when the computer executable program is executed, a multi-cloud continuous integration method supporting inter-cloud disaster transfer according to the first embodiment of the present invention is implemented. The computer-readable recording medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable recording medium may also be any readable medium other than a readable recording medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the readable recording medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0123] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0124] Through the above description of the implementation mode, it is easy for those skilled in the art to understand that the present invention can be implemented by hardware capable of executing a specific computer program, such as the system of the present invention, and the electronic processing unit, server, client, mobile phone, control unit, processor, etc. contained in the system. The present invention can also be implemented by computer software that executes the method of the present invention, such as control software executed by a microprocessor, an electronic control unit, a client, a server, etc. However, it should be noted that the computer software that executes the method of the present invention is not limited to being executed by one or a specific hardware entity, and it can also be implemented in a distributed manner by unspecified specific hardware. For computer software, the software product can be stored in a computer-readable recording medium (which can be a CD-ROM, a USB flash drive, a mobile disk, etc.), and can also be distributed and stored on the network, as long as it enables the electronic device to execute the method according to the present invention.
[0125] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although the present invention has been described in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.
Claims
1. A multi-cloud continuous integration method supporting inter-cloud disaster transfer, characterized in that: include: Submit continuous integration task requests through the continuous integration client; The continuous integration task request is sent to multiple cloud service platforms at the same time, and the continuous integration task request is stored in the database at the same time; The master nodes in multiple cloud service platforms obtain the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and select the target working node to send the continuous integration task request for execution; When the cloud service platform where the master node is deployed fails, a master node in another cloud service platform is elected as a new master node, and the new master node periodically queries the continuous integration task request from the database and sends it.
2. A multi-cloud continuous integration method supporting inter-cloud disaster transfer according to claim 1, characterized in that: The master nodes in multiple cloud service platforms are selected through a master selection process, which includes: In the initial state or when the master node fails, all control nodes in the cloud service platform are in the candidate state and become master node candidates; Each master node candidate sends a request-vote message to other master node candidates. The request-vote message includes the candidate's term number and the candidate's ID. The initial value of each candidate's term number is the same. The master node candidate that receives the request-vote message determines whether to vote based on its own voting status and the candidate's term number in the request-vote message; After the election timeout expires, the votes obtained by each master node candidate are counted, and the master node candidate with the most votes is selected to become the master node. The other master node candidates are changed from candidate status to initial status.
3. A multi-cloud continuous integration method supporting inter-cloud disaster transfer according to claim 2, characterized in that: The master node candidate receiving the voting request message determines whether to vote according to its own voting status and the term number of the candidate in the voting message, including: When the current master node candidate receives the voting request message and does not vote for other master node candidates, it is further determined whether the term number of the master node candidate that sent the voting request message is greater than or equal to the term number of the current master node candidate; If the judgment result is yes, the current master node candidate votes for the master node candidate that sent the message requesting a vote. If the judgment result is no, the current master node candidate does not vote.
4. The multi-cloud continuous integration method supporting inter-cloud disaster transfer according to claim 2, characterized in that: After the election time expires, the votes obtained by each master node candidate are counted. If the master node candidate with the most votes is not selected, a new round of master node election process is initiated again, and each master node candidate increases its term number.
5. The multi-cloud continuous integration method supporting inter-cloud disaster transfer according to claim 2, characterized in that: include: The master node sends a heartbeat signal to other control nodes, and other control nodes receive the heartbeat signal of the master node and reset the election timeout; If other control nodes do not receive the heartbeat signal from the master node within the election timeout period, they will automatically change to the candidate state and start a new round of master election process.
6. The multi-cloud continuous integration method supporting inter-cloud disaster transfer according to claim 1, characterized in that: The master node in the multiple cloud service platforms obtains the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and selects the target working node to send the continuous integration task request for execution, including: The working nodes of each cloud service platform register their IP information with the master node and expose their machine load status; The master node in the multiple cloud service platforms obtains the load status of each working node according to the received continuous integration task request, selects the working node with the lowest current load as the target working node, and issues the continuous integration task request for execution.
7. A multi-cloud continuous integration method supporting inter-cloud disaster transfer according to claim 6, characterized in that: include: After receiving the task sent by the master node, the target working node creates a temporary directory to execute the continuous integration task, pulls the code at the corresponding address in this directory, and executes the integration task according to the script configured by the continuous integration task; After the target working node has finished running, it notifies the master node that the continuous integration task has been completed, and the master node updates the completion status of the continuous integration task request in the database.
8. A multi-cloud continuous integration system supporting inter-cloud disaster transfer, characterized in that: include: Continuous integration client, used to submit continuous integration task requests; Multiple cloud service platforms communicate with continuous integration clients respectively, and the continuous integration clients send continuous integration task requests to multiple cloud service platforms simultaneously; Database, used to store continuous integration task requests; The master nodes in multiple cloud service platforms obtain the load status of the working nodes registered under the master node of each cloud service platform according to the received continuous integration task request, and select the target working node to send the continuous integration task request for execution; When the cloud service platform where the master node is deployed fails, a master node in another cloud service platform is elected as a new master node, and the new master node periodically queries the continuous integration task request from the database and sends it.
9. An electronic device comprising a processor and a memory, characterized in that The memory is used to store a computer executable program. When the computer program is executed by the processor, the processor executes a multi-cloud continuous integration method supporting inter-cloud disaster transfer as described in any one of claims 1 to 7.
10. A computer-readable recording medium storing a computer-executable program, characterized in that: When the computer executable program is executed, a multi-cloud continuous integration method supporting inter-cloud disaster transfer as described in any one of claims 1 to 7 is implemented.
