Construction method, device, storage medium, electronic device and storage medium
By introducing a mechanism for filtering duplicate requests and generating target construction tasks in the software package construction method, the problem of waste of resources and low construction efficiency in the existing technology is solved, and a more efficient resource utilization and construction process is achieved.
Patent Information
- Application Number
- CN202411706758.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In the prior art, software package construction methods have problems such as waste of resources and low construction efficiency, mainly due to the inability to identify duplicate requests and the need to separate out some threads to answer poll requests.
By introducing the first node to filter the repeated construction request, and determining the response node according to the predetermined rules, generating a target construction task, issuing it to the third node, and outputting it when the target progress is received.
Reduce resource consumption caused by repeated execution of build operations, improve build efficiency, and avoid inefficiency caused by polling requests to separate out some threads.
Smart Images

Figure CN119225800B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a construction method, an apparatus, a storage medium, an electronic device, and a storage medium. Background Art
[0002] In the related art, the building operation of the software package is generally implemented based on a continuous integration platform. Since the continuous integration platform usually directly performs the building operation based on the received software package building request, and while processing the building workflow, it allocates some threads to answer polling requests for querying the software package building progress, there will be a problem of resource waste due to the inability to identify repeated requests, and a problem of low building efficiency due to the need to allocate some threads to answer polling requests. Summary of the invention
[0003] The embodiments of the present application provide a construction method, an apparatus, a storage medium, an electronic device and a storage medium to at least solve the problems of resource waste and low construction efficiency in the software package construction method in the related art.
[0004] According to an embodiment of the present application, a construction method is provided, comprising: receiving a target construction request sent by a first node for requesting to build a target software package, wherein the first node is used to filter the repeatedly received first construction requests to obtain a second construction request, and determine a second node for responding to the second construction request according to a predetermined rule, and forward the second construction request to the second node, the second node including the target node; generating a target construction task for instructing a third node to build the target software package according to the target construction information of the target software package carried in the target construction request, wherein the target construction task carries indication information for instructing the third node to report the target progress of the target construction task; issuing the target construction task to the third node, and, upon receiving the target progress reported by the third node, outputting the target progress.
[0005] In an exemplary embodiment, outputting the target progress includes: outputting the target progress to a fourth node, wherein the fourth node is used to store the target progress and feedback the target progress when receiving a request message for querying the target progress.
[0006] In an exemplary embodiment, the first node is deployed in a gateway, the second node is deployed in a target server, the third node is deployed in a first server, and the fourth node is deployed in a distributed state machine. The gateway is connected to the target server via a switch, the target server is connected to the first server via a first interface, and the target server is connected to the distributed state machine via a second interface.
[0007] In an exemplary embodiment, the front end of the distributed state machine is located in the gateway, and the method further includes: upon receiving the request message forwarded by the front end, the fourth node feeds back the target progress to the front end.
[0008] In an exemplary embodiment, after the target construction task is sent to the third node, the method further includes: upon receiving the target progress, updating the state of the target construction task recorded in the target file based on the target progress.
[0009] In an exemplary embodiment, before updating the status of the target build task recorded in the target file based on the target progress, the method further includes: creating the target file in a target database, wherein the target file is used to record the status of the target build task, and at least one of the following: information of the target software package, information of the target build task.
[0010] In an exemplary embodiment, after the target construction task is sent to the third node, the method further includes: creating a target thread for receiving the target progress and outputting the target progress to the fourth node; and sending information to the fourth node for instructing the fourth node to create a first thread for receiving and storing the target progress.
[0011] In an exemplary embodiment, after generating a target build task for instructing a third node to build the target software package based on the build information of the target software package carried in the target build request, the method further includes: the third node receiving the target build task and sending the target build task to a build cluster for performing the build operation; the third node obtaining the target progress of the target build task from the build cluster and sending the target progress to the target node.
[0012] In an exemplary embodiment, before receiving a target build request sent by a first node for requesting to build a target software package, the method further includes: the first node determines the target node according to the type of the target build request, the number of the second nodes deployed in the target server, the network topology of the target server, the load of the second node, and the task execution priority of the second node.
[0013] In an exemplary embodiment, before receiving a target build request sent by a first node for requesting to build a target software package, the method further includes: the first node determines whether the first build request is received repeatedly based on first build information carried in the first build request, wherein the first build information includes the target build information; and the first node filters out the first build request if it is determined that the first build request is received repeatedly and the time interval from the last time the first build request was forwarded to the second node is less than a threshold.
[0014] In an exemplary embodiment, the first build information includes at least one of the following: an identifier, a version, a source code address, and a source code version of a first software package requested to be built by the first build request, wherein the first software package includes the target software package.
[0015] According to another embodiment of the present application, a construction device is provided, which is applied to a target node, and the device includes: a first receiving module, which is used to receive a target construction request sent by a first node for requesting to build a target software package, wherein the first node is used to filter the repeatedly received first construction requests to obtain a second construction request, and determine a second node for responding to the second construction request according to a predetermined rule, and forward the second construction request to the second node, the second node including the target node; a generating module, which is used to generate a target construction task for instructing a third node to build the target software package according to the target construction information of the target software package carried in the target construction request, wherein the target construction task carries indication information for instructing the third node to report the target progress of the target construction task; a sending module, which is used to send the target construction task to the third node, and, when receiving the target progress reported by the third node, output the target progress.
[0016] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0017] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0018] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0019] In the present application, repeated build requests are filtered through the first node, thereby reducing resource consumption caused by repeated execution of build operations, solving the problem of resource waste caused by the inability to identify repeated build requests in the related art, saving resources, and outputting the target progress reported by the third node, so that when a polling request is received, the target progress can be directly output, solving the problem of low build efficiency in the related art caused by the need to separate some threads to answer polling requests, thereby improving the build efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a hardware structure block diagram of a server device according to the construction method of an embodiment of the present application;
[0021] Figure 2 is a flowchart of a construction method according to an embodiment of the present application;
[0022] Figure 3 The structure of the construction system according to the embodiment of the present application Figure 1 ;
[0023] Figure 4 The structure of the construction system according to the embodiment of the present application Figure 2 ;
[0024] Figure 5 is a schematic diagram of a construction method according to an embodiment of the present application;
[0025] Figure 6 It is a structural block diagram of a construction device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0028] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 is a hardware structure block diagram of a server device according to the construction method of an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the construction method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0031] In this embodiment, a construction method is provided. Figure 2 is a flowchart of a construction method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0032] Step S202, receiving a target build request sent by a first node for requesting to build a target software package, wherein the first node is used to filter the first build requests received repeatedly to obtain a second build request, and determine a second node for responding to the second build request according to a predetermined rule, and forward the second build request to the second node, wherein the second node includes the target node;
[0033] Step S204: generating a target construction task for instructing a third node to construct the target software package according to the target construction information of the target software package carried in the target construction request, wherein the target construction task carries instruction information for instructing the third node to report the target progress of the target construction task;
[0034] Step S206: Send the target construction task to the third node, and output the target progress when receiving the target progress reported by the third node.
[0035] In the above steps, the target progress includes the start of the target build task, the completion of the target build task, etc. Exemplarily, sending the target build task to the third node includes but is not limited to: the target node sends the target build task to the third node based on the hypertext transfer protocol HTTP, wherein the target build task carries a network hook generated by a network hook interceptor included in the target node according to target rules based on target build information to instruct the third node to report the target progress, the network hook interceptor is used to monitor and respond to callback requests for key stages of the build task issued by the third node, the callback request is but is not limited to HTTP requests, and the third node is but is not limited to a continuous integration platform for sending build tasks to the software package build cluster and obtaining the build progress of the build task for reporting.
[0036] In the above steps, repeated build requests are filtered through the first node, thereby reducing resource consumption caused by repeated execution of build operations, solving the problem of resource waste caused by the inability to identify repeated build requests in the related art, saving resources, and outputting the target progress reported by the third node, so that when a polling request is received, the target progress can be directly output, solving the problem of low build efficiency in the related art caused by the need to separate some threads to answer polling requests, thereby improving the build efficiency.
[0037] The execution subject of the above steps may be a node in a server, etc., but is not limited thereto.
[0038] In an optional embodiment, outputting the target progress includes: outputting the target progress to a fourth node, wherein the fourth node is used to store the target progress and feedback the target progress when receiving a request message for querying the target progress.
[0039] In the above steps, by outputting the target progress to the fourth node, when a polling request for querying the target progress is received, the fourth node can directly feedback the target progress, thereby improving the response speed of the polling request. At the same time, it avoids the problem of low construction efficiency in the related technology caused by the execution node of the construction task dividing some threads for feedback of the target progress, thereby improving the construction efficiency.
[0040] In an optional embodiment, the first node is deployed in a gateway, the second node is deployed in a target server, the third node is deployed in a first server, and the fourth node is deployed in a distributed state machine. The gateway is connected to the target server via a switch, the target server is connected to the first server via a first interface, and the target server is connected to the distributed state machine via a second interface.
[0041] In the above steps, illustratively, Figure 3 The structure of the construction system according to the embodiment of the present application Figure 1 ,like Figure 3 The first node shown includes a filter and a diverter. The front end of the distributed state machine is deployed in the gateway. The third node in the target server is deployed with a build system cluster, which includes a network hook interceptor. The first server is deployed with a continuous integration platform (for example, Jenkins shown in the figure) and a build machine cluster.
[0042] In the above steps, illustratively, Figure 4 The structure of the construction system according to the embodiment of the present application Figure 2 ,like Figure 4 As shown, the solution in the present application includes a high-concurrency software package continuous construction system, including: a filtering and diversion module (including the aforementioned filter and diverter), a state machine module (corresponding to the aforementioned distributed state machine), a software package construction module (i.e., the aforementioned construction system cluster), a network hook interceptor module and a construction machine module (including the aforementioned continuous integration platform and construction machine cluster).
[0043] In an optional embodiment, the front end of the distributed state machine is located in the gateway, and the method further includes: upon receiving the request message forwarded by the front end, the fourth node feeds back the target progress to the front end.
[0044] In the above steps, since the target progress is stored in the distributed state machine, when a polling request is received, the target progress can be queried in the distributed state machine for feedback, thereby improving the response speed of the polling request. At the same time, it avoids the problem of low construction efficiency in the related technology caused by the execution node of the construction task dividing some threads for feedback of the target progress, thereby improving the construction efficiency.
[0045] In an optional embodiment, after sending the target construction task to the third node, the method further includes: upon receiving the target progress, updating the status of the target construction task recorded in the target file based on the target progress.
[0046] In the above steps, illustratively, the target file includes but is not limited to: a record in a database for recording detailed information and status of a target build task, a file in a file system, an entry in a key-value store for recording the target status of a target build task, etc. The update process of the target file includes but is not limited to: the target node parses the target progress to obtain target information (e.g., progress information, error status) according to the target progress received by the target thread in the network hook interceptor, and updates the information recorded in the target file according to the target information (e.g., performing an UPDATE operation, writing a file, or modifying a memory data structure, etc.).
[0047] In the above steps, by recording the target progress, the target thread can be released when the target build execution operation is completed, thereby improving resource utilization.
[0048] In an optional embodiment, before updating the status of the target build task recorded in the target file based on the target progress, the method further includes: creating the target file in a target database, wherein the target file is used to record the status of the target build task, and at least one of the following: information about the target software package, information about the target build task.
[0049] In the above steps, illustratively, the target database includes but is not limited to: a relational database, a non-relational database, a key-value storage database (e.g., Redis), a document storage database, a columnar database, etc. The target file includes but is not limited to recording the following information: a task identifier of the target construction task used to distinguish it from other construction tasks, target progress, the start time and end time of the target construction task, fault information of the construction task, resources or tasks that the target construction task depends on, parameters and configurations for executing the target construction task, resources consumed by the target construction task (e.g., CPU computing resources, memory and disk space, etc.), etc.
[0050] In the above steps, by creating a target file in the target database to record the status of the target build task, the systematization and standardization of build task management are achieved, which is convenient for unified management and query; by recording the task identifier, it is helpful to distinguish different build tasks and realize accurate tracking and management of tasks; by recording the target progress, it is more intuitive and convenient to monitor the progress of the build task, which is helpful to adjust the project plan and resource allocation in time; by recording the start time and end time, it is helpful to analyze the time consumption of the build task, optimize the build process and improve efficiency; by recording the fault information, it is helpful to quickly locate the problem, accelerate fault response and repair, and reduce system downtime; by recording the dependent resources or tasks, it is helpful to understand the dependency relationship between tasks and optimize task scheduling and execution order; by recording the parameters and configurations used to execute the build task, it is helpful to reproduce the build process, which is convenient for debugging and documentation; by recording resource consumption, it is helpful to monitor and optimize resource usage and reduce costs. By analyzing the resource consumption data, bottlenecks can be identified and performance optimization can be performed.
[0051] In an optional embodiment, after sending the target construction task to the third node, the method further includes: creating a target thread for receiving the target progress and outputting the target progress to the fourth node; and sending information to the target thread of the fourth node to instruct the fourth node to create a first thread for receiving and storing the target progress.
[0052] In the above steps, illustratively, Figure 5 is a schematic diagram of a construction method according to an embodiment of the present application, such as Figure 5 As shown, when the distributed state machine receives the indication information sent by the target thread in the network hook interceptor, it creates a first thread and records the target progress of the target construction task as ready in the first thread. After the second thread subsequently receives the target progress sent by the target thread, it updates the recorded target progress of the target construction task (for example, updates the target to start, end (success, failure), etc.).
[0053] In the above steps, by receiving and storing the target progress, when a polling request is received, the target progress can be queried for feedback, thereby improving the response speed of the polling request. At the same time, the problem of low construction efficiency in the related art caused by the execution node of the construction task dividing some threads for feedback of the target progress is avoided, thereby improving the construction efficiency.
[0054] In an optional embodiment, after generating a target build task for instructing a third node to build the target software package based on the build information of the target software package carried in the target build request, the method further includes: the third node receiving the target build task and sending the target build task to a build cluster used to perform the build operation; the third node obtaining the target progress of the target build task from the build cluster and sending the target progress to the target node.
[0055] In the above steps, delivering the target build task to a build cluster for executing a build operation includes but is not limited to: the continuous integration platform delivers the target build task to the build cluster based on the secure shell protocol SSH.
[0056] In the above steps, by adopting a multi-node distributed processing method, the construction progress is monitored by a third node respectively, and the construction operation is executed by building a cluster. In this way, when some nodes fail, the normal operation of other nodes is not affected, thereby improving the stability of the construction operation.
[0057] In an optional embodiment, before receiving a target build request sent by a first node for requesting to build a target software package, the method further includes: the first node determining the target node based on the type of the target build request, the number of the second nodes deployed in the target server, the network topology of the target server, the load condition of the second node, and the task execution priority of the second node.
[0058] In the above steps, the task execution priority of the second node includes but is not limited to being determined by factors such as historical performance data, fault recovery capability, processing speed, stability, etc. of the second node.
[0059] In the above steps, by comprehensively considering the type of target build request and the above factors of the second node, the task can be assigned to the node with the best performance, ensuring that resources are effectively utilized, while shortening the build time and improving the efficiency of the overall build process.
[0060] In an optional embodiment, before receiving a target build request sent by a first node for requesting to build a target software package, the method further includes: the first node determines whether the first build request is received repeatedly based on first build information carried in the first build request, wherein the first build information includes the target build information; and the first node filters out the first build request if it determines that the first build request is received repeatedly and the time interval from the most recent forwarding of the first build request to the second node is less than a threshold.
[0061] In the above steps, the threshold includes but is not limited to: 1 hour, 2 hours, 3 hours, etc. The threshold can be pre-set, and the threshold can be adjusted according to the type of the first software package built by the first build request. In the above steps, by filtering repeated build requests, resource consumption caused by repeated execution of build operations is reduced, and the problem of resource waste caused by the inability to identify repeated build requests in related technologies is solved, thereby saving resources.
[0062] In an optional embodiment, the first build information includes at least one of the following: an identifier, a version, a source code address, and a source code version of a first software package requested to be built by the first build request, wherein the first software package includes the target software package.
[0063] In the above-mentioned embodiments of the present application, a method for continuous building of software packages under high concurrency is proposed. By introducing a gateway, request filtering and load balancing are realized, and a cached build status query service can be provided, so that good performance can be achieved even in high concurrency scenarios. In this application, since the status polling request will not be transmitted to the continuous integration platform, the network bandwidth consumed by answering the status polling request is greatly reduced. At the same time, a distributed state machine is used to answer the status polling request, thereby improving the polling performance. In this application, by introducing the network hook technology and designing a network hook interceptor, the polling status interaction is replaced by a network callback request, which reduces the resource occupation caused by synchronous waiting, and at the same time deconstructs the construction process to improve the overall scalability.
[0064] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0065] In the present embodiment, a construction device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0066] Figure 6is a structural block diagram of a construction device according to an embodiment of the present application, which is applied to a target node, such as Figure 6 As shown, the device includes: a first receiving module 62, which is used to receive a target build request sent by a first node for requesting to build a target software package, wherein the first node is used to filter the first build request received repeatedly to obtain a second build request, and determine a second node for responding to the second build request according to a predetermined rule, and forward the second build request to the second node, the second node including the target node; a generating module 64, which is used to generate a target build task for instructing a third node to build the target software package according to the target build information of the target software package carried in the target build request, wherein the target build task carries instruction information for instructing the third node to report the target progress of the target build task; a sending module 66, which is used to send the target build task to the third node, and, when receiving the target progress reported by the third node, output the target progress.
[0067] In an optional embodiment, the sending module 66 includes: an output unit, used to output the target progress to a fourth node, wherein the fourth node is used to store the target progress and feedback the target progress when receiving a request message requesting to query the target progress.
[0068] In an optional embodiment, the first node is deployed in a gateway, the second node is deployed in a target server, the third node is deployed in a first server, and the fourth node is deployed in a distributed state machine. The gateway is connected to the target server via a switch, the target server is connected to the first server via a first interface, and the target server is connected to the distributed state machine via a second interface.
[0069] In an optional embodiment, the device further includes: a feedback module, wherein the front end of the distributed state machine is located in the gateway, and the fourth node feeds back the target progress to the front end when receiving the request message forwarded by the front end.
[0070] In an optional embodiment, the device further includes: an updating module for updating the status of the target construction task recorded in the target file based on the target progress after sending the target construction task to the third node and upon receiving the target progress.
[0071] In an optional embodiment, the device also includes: a first creation module, used to create the target file in the target database before updating the status of the target build task recorded in the target file based on the target progress, wherein the target file is used to record the status of the target build task, and at least one of the following: information about the target software package, information about the target build task.
[0072] In an optional embodiment, the device also includes: a second creation module, which is used to create a target thread for receiving the target progress and outputting the target progress to the fourth node after the target construction task is sent to the third node; and a sending module, which is used to send information to the fourth node to instruct the fourth node to create a first thread for receiving and storing the target progress.
[0073] In an optional embodiment, the third node includes: a second receiving module, which is used to receive the target construction task after generating a target construction task for instructing the third node to build the target software package based on the construction information of the target software package carried in the target construction request, and send the target construction task to a construction cluster used to perform the construction operation; an acquisition module, which is used to obtain the target progress of the target construction task from the construction cluster and send the target progress to the target node.
[0074] In an optional embodiment, the first node also includes: a first determination module, which is used to determine the target node according to the type of the target build request, the number of the second nodes deployed in the target server, the network topology of the target server, the load of the second node, and the task execution priority of the second node before receiving the target build request sent by the first node for requesting to build a target software package.
[0075] In an optional embodiment, the first node also includes: a second determination module, used for, before receiving a target build request sent by the first node for requesting to build a target software package, the first node determines whether the first build request is received repeatedly based on first build information carried in the first build request, wherein the first build information includes the target build information; and a filtering module, used for the first node to filter out the first build request when it is determined that the first build request is received repeatedly and the time interval from the most recent forwarding of the first build request to the second node is less than a threshold.
[0076] In an optional embodiment, the first build information includes at least one of the following: an identifier, a version, a source code address, and a source code version of a first software package requested to be built by the first build request, wherein the first software package includes the target software package.
[0077] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0078] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0079] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0080] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0081] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0082] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0083] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0084] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0085] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A construction method, characterized in that: Applied to the target node, The method includes: receiving a target building request for requesting to build a target software package sent by a first node, wherein the first node is used to filter the first building requests received repeatedly to obtain a second building request, and determine a second node for responding to the second building request according to a predetermined rule, wherein the second node includes the target node; Generate, according to the target construction information of the target software package carried in the target construction request, a target construction task for instructing the third node to construct the target software package, wherein the target construction task carries instruction information for instructing the third node to report the target progress of the target construction task; The target construction task is sent to the third node, and when the target progress reported by the third node is received, the target progress is output.
2. The method according to claim 1, characterized in that Outputting the target progress includes: outputting the target progress to a fourth node, wherein the fourth node is used to store the target progress and feed back the target progress when receiving a request message for querying the target progress.
3. The method according to claim 2, characterized in that The first node is deployed in the gateway, the second node is deployed in the target server, the third node is deployed in the first server, and the fourth node is deployed in the distributed state machine. The gateway is connected to the target server through a switch, the target server is connected to the first server through a first interface, and the target server is connected to the distributed state machine through a second interface.
4. The method according to claim 3, characterized in that The front end of the distributed state machine is located in the gateway, and the method further includes: when the fourth node receives the request message forwarded by the front end, feeding back the target progress to the front end.
5. The method according to claim 1, characterized in that After sending the target construction task to the third node, the method further includes: When the target progress is received, the state of the target construction task recorded in the target file is updated based on the target progress.
6. The method according to claim 5, characterized in that Before updating the status of the target construction task recorded in the target file based on the target progress, the method further includes: The target file is created in a target database, wherein the target file is used to record the status of the target build task and at least one of the following: information of the target software package and information of the target build task.
7. The method according to claim 2, characterized in that After sending the target construction task to the third node, the method further includes: Creating a target thread for receiving the target progress and outputting the target progress to the fourth node; Information for instructing the fourth node to create a first thread for receiving and storing the target progress is sent to the fourth node.
8. The method according to claim 1, characterized in that After generating a target construction task for instructing a third node to construct the target software package according to the construction information of the target software package carried in the target construction request, the method further includes: The third node receives the target construction task, and sends the target construction task to a construction cluster for executing a construction operation; The third node obtains the target progress of the target construction task from the construction cluster, and sends the target progress to the target node.
9. The method according to claim 1, characterized in that: Before receiving the target building request sent by the first node for requesting to build the target software package, the method further includes: The first node determines the target node according to the type of the target build request, the number of the second nodes deployed in the target server, the network topology of the target server, the load of the second node, and the task execution priority of the second node.
10. The method according to claim 1, characterized in that Before receiving the target building request sent by the first node for requesting to build the target software package, the method further includes: The first node determines, according to first construction information carried in the first construction request, whether the first construction request is received repeatedly, wherein the first construction information includes the target construction information; The first node filters out the first construction request if it is determined that the first construction request is received repeatedly and the time interval from the last time the first construction request was forwarded to the second node is less than a threshold.
11. The method according to claim 10, characterized in that The first building information includes at least one of the following: an identifier, a version, a source code address, and a source code version of a first software package requested to be built by the first building request, wherein the first software package includes the target software package.
12. A construction device, characterized in that: Applied to the target node, The device includes: A first receiving module is configured to receive a target building request sent by a first node for requesting to build a target software package, wherein the first node is configured to filter the first building requests that are repeatedly received to obtain a second building request, and determine a second node for responding to the second building request according to a predetermined rule, wherein the second node includes the target node; a generating module, configured to generate, according to the target building information of the target software package carried in the target building request, a target building task for instructing a third node to build the target software package, wherein the target building task carries instruction information for instructing the third node to report a target progress of the target building task; The sending module is used to send the target construction task to the third node, and output the target progress when receiving the target progress reported by the third node.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Application deployment method and device, equipment and medium
CN110855627A
Application deployment method and device, storage medium and electronic device
CN115357258A