[go: up one dir, main page]

CN117687756A - Continuous integration method, device, equipment and computer-readable storage medium - Google Patents

Continuous integration method, device, equipment and computer-readable storage medium Download PDF

Info

Publication number
CN117687756A
CN117687756A CN202311705671.3A CN202311705671A CN117687756A CN 117687756 A CN117687756 A CN 117687756A CN 202311705671 A CN202311705671 A CN 202311705671A CN 117687756 A CN117687756 A CN 117687756A
Authority
CN
China
Prior art keywords
task
priority
processing
eigenvalue
continuous integration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311705671.3A
Other languages
Chinese (zh)
Inventor
赵悦含
刘会凯
付斌
牟雪榕
黄值仪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Voyah Automobile Technology Co Ltd
Original Assignee
Voyah Automobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Voyah Automobile Technology Co Ltd filed Critical Voyah Automobile Technology Co Ltd
Priority to CN202311705671.3A priority Critical patent/CN117687756A/en
Publication of CN117687756A publication Critical patent/CN117687756A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06316Sequencing of tasks or work
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Operations Research (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Security & Cryptography (AREA)
  • Educational Administration (AREA)
  • Development Economics (AREA)
  • Hardware Redundancy (AREA)

Abstract

一种持续集成方法、装置、设备及计算机可读存储介质。该方法包括:根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;按照优先级从高到低的顺序,确定任务处理顺序;基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。通过本申请,按照任务属性确定各个任务的优先级,从而确定各个任务的处理顺序,使得重要的任务能被及时处理。

A continuous integration method, device, equipment and computer-readable storage medium. The method includes: determining the priority of each task according to the task attributes, the task attributes include branch type, code change mode, trigger type and build type; determining the task processing order in order from high to low priority; based on task processing In order, each task is assigned to the processing node for processing according to the task pipeline. Through this application, the priority of each task is determined according to the task attributes, thereby determining the processing order of each task, so that important tasks can be processed in time.

Description

持续集成方法、装置、设备及计算机可读存储介质Continuous integration method, device, equipment and computer-readable storage medium

技术领域Technical field

本申请涉及软件开发技术领域,具体涉及一种持续集成方法、装置、设备及计算机可读存储介质。This application relates to the field of software development technology, and specifically to a continuous integration method, device, equipment and computer-readable storage medium.

背景技术Background technique

目前,在利用持续集成工具进行软件开发的过程中,不存在任务调度机制,任务仅按照任务的创建时间点依次执行,这就导致一些重要的任务无法被及时处理。Currently, in the process of software development using continuous integration tools, there is no task scheduling mechanism. Tasks are only executed sequentially according to the creation time point of the task, which results in some important tasks not being processed in time.

发明内容Contents of the invention

本申请提供一种持续集成方法、装置、设备及计算机可读存储介质,可以解决现有技术中存在的利用持续集成工具进行软件开发的过程中,重要任务无法被及时处理的技术问题。This application provides a continuous integration method, device, equipment and computer-readable storage medium, which can solve the technical problem in the existing technology that important tasks cannot be processed in time during the software development process using continuous integration tools.

第一方面,本申请实施例提供一种持续集成方法,所述持续集成方法包括:In a first aspect, embodiments of the present application provide a continuous integration method, which includes:

根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;Determine the priority of each task according to the task attributes, which include branch type, code change method, trigger type and build type;

按照优先级从高到低的顺序,确定任务处理顺序;Determine the order of task processing in order from high to low priority;

基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。Based on the task processing sequence, each task is assigned to the processing node for processing according to the task pipeline.

结合第一方面,在一种实施方式中,所述根据任务属性确定各个任务的优先级的步骤包括:In conjunction with the first aspect, in one implementation, the step of determining the priority of each task according to task attributes includes:

针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值;For each task, a first characteristic value is determined according to the branch type, a second characteristic value is determined according to the code change method, a third characteristic value is determined according to the trigger type, and a fourth characteristic value is determined according to the build type;

对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,得到优先级值;The first eigenvalue, the second eigenvalue, the third eigenvalue and the fourth eigenvalue are weighted and summed to obtain the priority value;

其中,优先级值越大,任务的优先级越高。Among them, the larger the priority value, the higher the priority of the task.

结合第一方面,在一种实施方式中,当任务的构建类型为首次构建或失败后构建时,在所述针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值的步骤之后,还包括:Combined with the first aspect, in one implementation, when the build type of the task is first build or build after failure, for each task, the first characteristic value is determined according to the branch type, and the second characteristic value is determined according to the code change mode. After the steps of determining the characteristic value, determining the third characteristic value according to the trigger type, and determining the fourth characteristic value according to the build type, it also includes:

将第一特征值g1、第二特征值g2、第三特征值g3以及第四特征值g4代入优先级值计算公式,得到优先级值p,加权公式为:Substitute the first eigenvalue g 1 , the second eigenvalue g 2 , the third eigenvalue g 3 and the fourth eigenvalue g 4 into the priority value calculation formula to obtain the priority value p. The weighting formula is:

p=w1*g1+w2*g2+w3*g3+(1+rate)*w4*g4 p=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+rate)*w 4 *g 4

其中,w1、w2、w3、w4为权重,rate为预设时长内任务处理失败的比例,优先级值越大,任务的优先级越高。Among them, w 1 , w 2 , w 3 , and w 4 are weights, and rate is the proportion of task processing failures within the preset time period. The larger the priority value, the higher the priority of the task.

结合第一方面,在一种实施方式中,在所述基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理的步骤之后,还包括:In conjunction with the first aspect, in one embodiment, after the step of sequentially allocating each task to a processing node for processing based on the task processing sequence according to the task pipeline, the method further includes:

获取处理节点反馈的各个任务的处理结果;Obtain the processing results of each task fed back by the processing node;

针对处理结果为失败的任务,将任务失败通知以及任务负责人联系方式发送至项目管理服务器;For tasks whose processing result is failed, the task failure notification and the contact information of the task leader are sent to the project management server;

接收项目管理服务器基于任务失败通知反馈的问题ID,并基于问题ID填写任务处理日志至项目管理服务器的评论区,以供项目管理服务器对所述任务处理日志进行语义失败确定问题类别,并基于所述任务负责人联系方式反馈问题ID以及问题类别。Receive the problem ID based on the task failure notification feedback from the project management server, and fill in the task processing log based on the problem ID to the comment area of the project management server, so that the project management server can perform semantic failure on the task processing log to determine the problem category, and based on the Please provide the contact information of the task leader to feedback the problem ID and problem category.

结合第一方面,在一种实施方式中,在所述获取处理节点反馈的各个任务的处理结果的步骤之后,还包括:In conjunction with the first aspect, in one embodiment, after the step of obtaining the processing results of each task fed back by the processing node, the method further includes:

针对处理结果为成功的任务,将任务对应的产物发送至产物管理服务器,产物包括测试报告以及编译生成的可执行文件,以供产物管理服务器对产物进行管理;For tasks whose processing results are successful, the products corresponding to the tasks are sent to the product management server. The products include test reports and compiled executable files for the product management server to manage the products;

接收产物管理服务器反馈的产物对应的管理信息;Receive the management information corresponding to the product fed back by the product management server;

基于所述任务负责人联系方式发送任务处理成功通知以及所述管理信息。Send a task processing success notification and the management information based on the contact information of the task leader.

第二方面,本申请实施例提供了一种持续集成装置,所述持续集成装置包括:In the second aspect, embodiments of the present application provide a continuous integration device, which includes:

优先级确定模块,用于根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;A priority determination module, used to determine the priority of each task based on task attributes, which include branch type, code change method, trigger type and build type;

处理顺序确定模块,用于按照优先级从高到低的顺序,确定任务处理顺序;The processing sequence determination module is used to determine the task processing sequence in order from high priority to low;

分配模块,用于基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。The allocation module is used to allocate each task to the processing node for processing in accordance with the task pipeline based on the task processing sequence.

结合第二方面,在一种实施方式中,所述优先级确定模块用于:Combined with the second aspect, in one implementation, the priority determination module is used to:

针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值;For each task, a first characteristic value is determined according to the branch type, a second characteristic value is determined according to the code change method, a third characteristic value is determined according to the trigger type, and a fourth characteristic value is determined according to the build type;

对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,得到优先级值;The first eigenvalue, the second eigenvalue, the third eigenvalue and the fourth eigenvalue are weighted and summed to obtain the priority value;

其中,优先级值越大,任务的优先级越高。Among them, the larger the priority value, the higher the priority of the task.

结合第二方面,在一种实施方式中,当任务的构建类型为首次构建或失败后构建时,所述优先级确定模块用于:Combined with the second aspect, in one implementation, when the build type of the task is first build or post-failure build, the priority determination module is used to:

将第一特征值g1、第二特征值g2、第三特征值g3以及第四特征值g4代入优先级值计算公式,得到优先级值p,加权公式为:Substitute the first eigenvalue g 1 , the second eigenvalue g 2 , the third eigenvalue g 3 and the fourth eigenvalue g 4 into the priority value calculation formula to obtain the priority value p. The weighting formula is:

p=w1*g1+w2*g2+w3*g3+(1+rate)*w4*g4 p=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+rate)*w 4 *g 4

其中,w1、w2、w3、w4为权重,rate为预设时长内任务处理失败的比例,优先级值越大,任务的优先级越高。Among them, w 1 , w 2 , w 3 , and w 4 are weights, and rate is the proportion of task processing failures within the preset time period. The larger the priority value, the higher the priority of the task.

第三方面,本申请实施例提供了一种持续集成设备,所述持续集成设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的持续集成程序,其中所述持续集成程序被所述处理器执行时,实现如第一方面所述的持续集成方法的步骤。In a third aspect, embodiments of the present application provide a continuous integration device. The continuous integration device includes a processor, a memory, and a continuous integration program stored on the memory and executable by the processor, wherein the When the continuous integration program is executed by the processor, the steps of the continuous integration method described in the first aspect are implemented.

第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有持续集成程序,其中所述持续集成程序被处理器执行时,实现如第一方面所述的持续集成方法的步骤。In the fourth aspect, embodiments of the present application provide a computer-readable storage medium. A continuous integration program is stored on the computer-readable storage medium. When the continuous integration program is executed by a processor, the implementation as described in the first aspect is implemented. The steps of the continuous integration method described above.

本申请实施例提供的技术方案带来的有益效果包括:The beneficial effects brought by the technical solutions provided by the embodiments of this application include:

本申请实施例中,根据任务属性确定各个任务的优先级;按照优先级从高到低的顺序,确定任务处理顺序;基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。通过本申请实施例,按照任务属性确定各个任务的优先级,从而确定各个任务的处理顺序,使得重要的任务能被及时处理。In the embodiment of this application, the priority of each task is determined according to the task attributes; the task processing order is determined in order from high to low priority; based on the task processing order, each task is sequentially assigned to the processing node according to the task pipeline for processing. Through the embodiments of the present application, the priority of each task is determined according to the task attributes, thereby determining the processing order of each task, so that important tasks can be processed in a timely manner.

附图说明Description of the drawings

图1为本申请持续集成方法一实施例的流程示意图;Figure 1 is a schematic flow chart of an embodiment of the continuous integration method of this application;

图2为一实施例中软件开发系统架构示意图;Figure 2 is a schematic diagram of the software development system architecture in an embodiment;

图3为本申请持续集成装置一实施例的功能模块示意图;Figure 3 is a functional module schematic diagram of an embodiment of the continuous integration device of the present application;

图4为本申请实施例方案中涉及的持续集成设备的硬件结构示意图。Figure 4 is a schematic diagram of the hardware structure of the continuous integration device involved in the embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those in the technical field to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only These are part of the embodiments of this application, but not all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

首先,对本申请中的部分技术术语进行解释说明,以便于本领域技术人员理解本申请。First, some technical terms in this application are explained to facilitate those skilled in the art to understand this application.

Jenkins是一个开源软件项目,是基于Java开发的一种持续集成工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台,使软件项目可以进行持续集成。Jenkins is an open source software project. It is a continuous integration tool developed based on Java. It is used to monitor continuous repetitive work. It aims to provide an open and easy-to-use software platform so that software projects can perform continuous integration.

JIRA是一个项目与事务跟踪工具,被广泛应用于缺陷跟踪、客户服务、需求收集、流程审批、任务跟踪、项目跟踪和敏捷管理等工作领域。JIRA is a project and issue tracking tool that is widely used in defect tracking, customer service, requirements collection, process approval, task tracking, project tracking and agile management.

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

第一方面,本申请实施例提供一种持续集成方法。In the first aspect, embodiments of the present application provide a continuous integration method.

一实施例中,参照图1,图1为本申请持续集成方法一实施例的流程示意图。如图1所示,持续集成方法包括:In one embodiment, refer to FIG. 1 , which is a schematic flow chart of an embodiment of the continuous integration method of the present application. As shown in Figure 1, continuous integration methods include:

步骤S10,根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;Step S10, determine the priority of each task according to the task attributes, which include branch type, code change method, trigger type and build type;

本实施例中,持续集成方法的执行主体为Jenkins服务器或Gitlab服务器或其他具备相同功能的服务器,下文中以Jenkins服务器为例进行说明。In this embodiment, the execution subject of the continuous integration method is a Jenkins server or a Gitlab server or other servers with the same functions. The following description takes the Jenkins server as an example.

参照图2,图2为一实施例中软件开发系统架构示意图。如图2所示,使用代码托管平台,实现变更点记录、代码版本管理等功能。其中,代码托管平台可以是Gitlab、Gitee等,可满足源代码管理、代码评审、变更点追溯、版本管理等功能。Referring to Figure 2, Figure 2 is a schematic diagram of the software development system architecture in an embodiment. As shown in Figure 2, the code hosting platform is used to implement functions such as change point recording and code version management. Among them, the code hosting platform can be Gitlab, Gitee, etc., which can meet functions such as source code management, code review, change point tracing, and version management.

以Gitlab为例,开发人员每次提交代码的变更点都将得到记录,包括提交人、代码变更点、代码变更描述(commit message)等,针对每一次提交动作,Gitlab将自动为其分配随机生成且不重复的commit ID,如果需要代码回退,可按照commit ID进行回滚操作。当某个版本的代码被正确集成且通过测试可进行发布时,即可按照团队定义的版本管理规范为该版本代码打上对应的tag,同时将要发布的代码推送至指定的分支(一般为master分支或者release分支,可根据团队规范自定义)。除了要发布的代码,研发过程中的代码也可以通过打tag的方式进行版本控制,为了便于在集成失败或者构建不通过时进行代码的回退,可以周期性的为代码打上tag,比如完成了某个功能某个模块的开发时。Taking Gitlab as an example, every time a developer submits a code change point, it will be recorded, including the submitter, code change point, code change description (commit message), etc. For each submission action, Gitlab will automatically assign a randomly generated If the commit ID is not repeated, if code rollback is required, the rollback operation can be performed according to the commit ID. When a certain version of the code is correctly integrated and can be released after passing the test, the corresponding code can be tagged according to the version management specifications defined by the team, and the code to be released can be pushed to the designated branch (usually the master branch) Or release branch, which can be customized according to team specifications). In addition to the code to be released, the code in the development process can also be version controlled through tagging. In order to facilitate the rollback of the code when the integration fails or the build fails, the code can be tagged periodically, such as completed When developing a certain function or module.

Jenkins服务器上的任务生成有两种方式:自动触发和定时触发。Jenkins服务器持续监听代码托管平台,通过webhook的方式,当代码托管平台上指定的代码仓库发生代码变更时,将触发Jenkins的任务;Jenkins服务器可以设置定时执行任务。There are two ways to generate tasks on the Jenkins server: automatic triggering and scheduled triggering. The Jenkins server continuously monitors the code hosting platform. Through webhook, when code changes occur in the code repository specified on the code hosting platform, the Jenkins task will be triggered; the Jenkins server can set up scheduled execution tasks.

容易理解的是,若Jenkins服务器上任务数量只有一个时,则没有必要进行优先级排序,因此,当Jenkins服务器上任务数量至少有两个时,根据各任务的任务属性确定Jenkins服务器上各个任务的优先级。It is easy to understand that if there is only one task on the Jenkins server, there is no need to prioritize. Therefore, when there are at least two tasks on the Jenkins server, determine the priority of each task on the Jenkins server based on the task attributes of each task. priority.

进一步地,一实施例中,步骤S10包括:Further, in one embodiment, step S10 includes:

步骤S101,针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值;Step S101, for each task, determine the first characteristic value according to the branch type, determine the second characteristic value according to the code change method, determine the third characteristic value according to the trigger type, and determine the fourth characteristic value according to the build type;

本实施例中,对一任务而言,其分支类型为hotfixes分支、release分支、develop分支、其他分支中一种;其代码变更方式为分支合并、普通提交中一种;其触发类型为自动触发、定时触发中一种;其构建类型为失败后构建、首次构建中一种。In this embodiment, for a task, its branch type is one of hotfixes branch, release branch, develop branch, and other branches; its code change method is one of branch merge and ordinary submission; its trigger type is automatic trigger , one of timing trigger; its build type is one of build after failure and first build.

其中,hotfixes分支对应的特征值为g11、release分支对应的特征值为g12、develop分支对应的特征值为g13、其他分支对应的特征值为g14,且g11>g12>g13>g14。Among them, the feature value corresponding to the hotfixes branch is g11, the feature value corresponding to the release branch is g12, the feature value corresponding to the develop branch is g13, and the feature value corresponding to other branches is g14, and g11>g12>g13>g14.

分支合并对应的特征值为g21、普通提交对应的特征值为g22,且g21>g22。The characteristic value corresponding to branch merging is g21, and the characteristic value corresponding to ordinary submission is g22, and g21>g22.

自动触发对应的特征值为g31、定时触发对应的特征值为g32,且g31>g32。The characteristic value corresponding to automatic triggering is g31, and the characteristic value corresponding to scheduled triggering is g32, and g31>g32.

失败后构建对应的特征值为g41、首次构建对应的特征值为g42,且g41>g42。The characteristic value corresponding to the failed build is g41, and the characteristic value corresponding to the first build is g42, and g41>g42.

若一任务,其分支类型为hotfixes分支、其代码变更方式为分支合并、其触发类型为自动触发、其构建类型为失败后构建,则其第一特征值为g11、第二特征值为g21、第三特征值为g31以及第四特征值为g41。If a task's branch type is hotfixes branch, its code change method is branch merge, its trigger type is automatic trigger, and its build type is build after failure, then its first characteristic value is g11, its second characteristic value is g21, The third eigenvalue is g31 and the fourth eigenvalue is g41.

步骤S102,对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,得到优先级值;Step S102, perform a weighted sum of the first eigenvalue, the second eigenvalue, the third eigenvalue and the fourth eigenvalue to obtain a priority value;

其中,优先级值越大,任务的优先级越高。Among them, the larger the priority value, the higher the priority of the task.

本实施例中,在确定一任务的第一特征值、第二特征值、第三特征值以及第四特征值后,即可按照第一特征值对应的权重w1、第二特征值对应的权重w2、第三特征值对应的权重w3以及第四特征值对应的权重w4对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,从而得到该任务的优先级值。其中,第一特征值对应的权重w1、第二特征值对应的权重w2、第三特征值对应的权重w3以及第四特征值对应的权重w4根据实际需要进行设置。In this embodiment, after determining the first feature value, the second feature value, the third feature value and the fourth feature value of a task, the weight w 1 corresponding to the first feature value and the weight w 1 corresponding to the second feature value can be determined. The weight w 2 , the weight w 3 corresponding to the third eigenvalue, and the weight w 4 corresponding to the fourth eigenvalue are the weighted sum of the first eigenvalue, the second eigenvalue, the third eigenvalue, and the fourth eigenvalue, thereby obtaining the The priority value of the task. Among them, the weight w 1 corresponding to the first eigenvalue, the weight w 2 corresponding to the second eigenvalue, the weight w 3 corresponding to the third eigenvalue and the weight w 4 corresponding to the fourth eigenvalue are set according to actual needs.

以此类推,即可得到各个任务的优先级值,且优先级值越大,任务的优先级越高。By analogy, the priority value of each task can be obtained, and the larger the priority value, the higher the priority of the task.

本实施例中,基于任务属性确定各个任务的优先级,可以让更重要的任务更先被处理。In this embodiment, the priority of each task is determined based on the task attributes, so that more important tasks can be processed first.

进一步地,一实施例中,当任务的构建类型为首次构建或失败后构建时,在步骤S101之后,还包括:Further, in one embodiment, when the construction type of the task is first build or build after failure, after step S101, it also includes:

将第一特征值g1、第二特征值g2、第三特征值g3以及第四特征值g4代入优先级值计算公式,得到优先级值p,加权公式为:Substitute the first eigenvalue g 1 , the second eigenvalue g 2 , the third eigenvalue g 3 and the fourth eigenvalue g 4 into the priority value calculation formula to obtain the priority value p. The weighting formula is:

p=w1*g1+w2*g2+w3*g3+(1+rate)*w4*g4 p=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+rate)*w 4 *g 4

其中,w1、w2、w3、w4为权重,rate为预设时长内任务处理失败的比例,优先级值越大,任务的优先级越高。Among them, w 1 , w 2 , w 3 , and w 4 are weights, and rate is the proportion of task processing failures within the preset time period. The larger the priority value, the higher the priority of the task.

本实施例中,例如,当任务A、B、C其他任务属性一致,仅构建类型不一致时,任务A为首次构建,此时任务处理失败的比例=0;任务B为失败后构建,此时任务处理失败的比例为1;任务C为失败后构建,此时任务处理失败的比例为0.3,则有:In this embodiment, for example, when the other task attributes of tasks A, B, and C are consistent but only the construction type is inconsistent, task A is built for the first time, and the proportion of task processing failure = 0 at this time; task B is built after failure, and at this time The proportion of task processing failure is 1; task C is built after failure. At this time, the proportion of task processing failure is 0.3, then there are:

任务A的优先级值p1=w1*g1+w2*g2+w3*g3+(1+0)*w4*g4The priority value p1 of task A=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+0)*w 4 *g 4 ;

任务B的优先级值为p2=w1*g1+w2*g2+w3*g3+(1+1)*w4*g4The priority value of task B is p2=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+1)*w 4 *g 4 ;

任务C的优先级值为p3=w1*g1+w2*g2+w3*g3+(1+0.3)*w4*g4The priority value of task C is p3=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+0.3)*w 4 *g 4 .

基于此,任务的处理顺序则为:先处理任务B,再处理任务C,最后处理任务A,即提高了失败后重建任务的优先级,从而更有可能被优先处理。Based on this, the order of task processing is: task B is processed first, then task C, and finally task A, which increases the priority of the task to be rebuilt after failure, making it more likely to be processed first.

本实施例中,结合预设时长内任务处理失败的比例,加大了构建类型对优先级的影响,可以使得最终确定的任务处理顺序更加符合实际情况。In this embodiment, combined with the proportion of task processing failures within the preset time period, the impact of the construction type on the priority is increased, which can make the final task processing order more consistent with the actual situation.

步骤S20,按照优先级从高到低的顺序,确定任务处理顺序;Step S20, determine the task processing order in order from high to low priority;

本实施例中,按照优先级从高到低的顺序,即可确定任务处理顺序。例如,任务1的优先级>任务2的优先级>任务3的优先级,则先处理任务1,再处理任务2,最后处理任务3。In this embodiment, the task processing order can be determined in order from high priority to low. For example, if the priority of task 1 > the priority of task 2 > the priority of task 3, then task 1 will be processed first, then task 2, and finally task 3.

步骤S30,基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。Step S30: Based on the task processing sequence, each task is sequentially assigned to the processing node for processing according to the task pipeline.

本实施例中,例如任务处理顺序为:先处理任务1,再处理任务2,最后处理任务3。则先将任务1按照任务流水线分配至处理节点进行处理,再将任务2按照任务流水线分配至处理节点进行处理,最后将任务3按照任务流水线分配至处理节点进行处理。In this embodiment, for example, the order of task processing is: task 1 is processed first, task 2 is processed next, and task 3 is processed last. Then task 1 is first assigned to the processing node for processing according to the task pipeline, then task 2 is assigned to the processing node for processing according to the task pipeline, and finally task 3 is assigned to the processing node for processing according to the task pipeline.

继续参照图2,处理节点包含静态扫描节点、编译节点、单元测试节点等,处理节点可以是一台实体的服务器,也可以是一个容器,其中,静态扫描节点、编译节点、单元测试节点、其他节点均可以是多台。配置Jenkins节点的优势在于实现了主从模式,Jenkins服务器作为master节点,只负责调度和优先级计算工作,将任务分配给处理节点执行,可以提高Jenkins构建任务执行的并发性;如果处理节点出现故障,可以切换其他节点执行任务,避免因为节点故障导致任务失败。图2中的镜像存储服务器也可指镜像仓库,存储所需的Docker镜像,以编译节点为例,如果持续集成系统需要兼备Windows编译环境和Linux编译环境,编译节点在执行编译任务时,可通过代码判断所需的编译环境,从镜像存储服务器中拉取所需的镜像资源。Continuing to refer to Figure 2, the processing nodes include static scanning nodes, compilation nodes, unit test nodes, etc. The processing node can be an entity server or a container. Among them, the static scanning node, compilation node, unit test node, etc. There can be multiple nodes. The advantage of configuring a Jenkins node is that it implements the master-slave mode. The Jenkins server, as the master node, is only responsible for scheduling and priority calculation. Allocating tasks to processing nodes for execution can improve the concurrency of Jenkins build task execution; if the processing node fails , you can switch other nodes to perform tasks to avoid task failure due to node failure. The image storage server in Figure 2 can also refer to the image warehouse, which stores the required Docker images. Taking the compilation node as an example, if the continuous integration system needs to have both a Windows compilation environment and a Linux compilation environment, the compilation node can perform compilation tasks through The code determines the required compilation environment and pulls the required image resources from the image storage server.

本申请实施例中,根据任务属性确定各个任务的优先级;按照优先级从高到低的顺序,确定任务处理顺序;基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。通过本申请实施例,按照任务属性确定各个任务的优先级,从而确定各个任务的处理顺序,使得重要的任务能被及时处理。In the embodiment of this application, the priority of each task is determined according to the task attributes; the task processing order is determined in order from high to low priority; based on the task processing order, each task is sequentially assigned to the processing node according to the task pipeline for processing. Through the embodiments of the present application, the priority of each task is determined according to the task attributes, thereby determining the processing order of each task, so that important tasks can be processed in a timely manner.

进一步地,一实施例中,在步骤S30之后,还包括:Further, in one embodiment, after step S30, it also includes:

获取处理节点反馈的各个任务的处理结果;针对处理结果为失败的任务,将任务失败通知以及任务负责人联系方式发送至项目管理服务器;接收项目管理服务器基于任务失败通知反馈的问题ID,并基于问题ID填写任务处理日志至项目管理服务器的评论区,以供项目管理服务器对所述任务处理日志进行语义失败确定问题类别,并基于所述任务负责人联系方式反馈问题ID以及问题类别。Obtain the processing results of each task fed back by the processing node; for tasks with a failed processing result, send the task failure notification and the contact information of the task leader to the project management server; receive the problem ID based on the task failure notification feedback from the project management server, and based on The problem ID is filled in the task processing log to the comment area of the project management server, so that the project management server can perform semantic failure on the task processing log to determine the problem category, and feedback the problem ID and problem category based on the contact information of the task leader.

本实施例中,Jenkins服务器依次将各个任务按照任务流水线分配至处理节点进行处理后,处理节点会反馈的各个任务的处理结果至Jenkins服务器。任务构建失败时(即处理结果为失败的任务),将会通知项目管理服务器构建失败,同时告知此次构建的相关责任人。其中,任务构建过程即按照任务流水线对任务进行处理的过程。例如,一任务流水线为静态扫描→编译→单元测试,则任务构建过程包括三个环节:1、将任务分配至静态扫描节点进行处理;2、将任务分配至编译节点进行处理;3、将任务分配至单元测试节点进行处理。其中,任一环节处理失败,都视作任务构建失败。需要说明的是,任务构建过程包括哪些环节是根据实际需求进行定义的,除了可以包括静态扫描、编译以及单元测试环节外,还可以包括打包发布环节,此处不作限制。In this embodiment, the Jenkins server sequentially allocates each task to the processing node for processing according to the task pipeline, and the processing node will feed back the processing results of each task to the Jenkins server. When the task build fails (that is, the processing result is a failed task), the project management server will be notified of the build failure and the relevant person responsible for the build will be notified. Among them, the task construction process is the process of processing tasks according to the task pipeline. For example, if a task pipeline is static scanning → compilation → unit testing, the task construction process includes three links: 1. Assign the task to the static scanning node for processing; 2. Assign the task to the compilation node for processing; 3. Assign the task to the compilation node for processing. Assigned to the unit test node for processing. Among them, any failure in processing will be regarded as a task construction failure. It should be noted that the tasks included in the task construction process are defined based on actual needs. In addition to static scanning, compilation, and unit testing, it can also include packaging and release, which is not limited here.

继续参照图2,项目管理服务器以Jira服务器为例,Jira服务器即安装了Jira软件的服务器为例。当然,项目管理服务器还可以是安装了其他项目管理软件的服务器,其他项目管理软件例如:PingCode、Worktile、Coding、Tapd等等。Continuing to refer to Figure 2, the project management server takes the Jira server as an example. The Jira server is a server with Jira software installed as an example. Of course, the project management server can also be a server with other project management software installed, such as PingCode, Worktile, Coding, Tapd, etc.

项目管理服务器接收到Jenkins服务器通知的信息后创建问题,并将问题的ID反馈给Jenkins服务器。Jenkins服务器依照问题ID回填构建日志和测试结果至项目管理服务器的评论区。之后,项目管理服务器根据获取到的日志信息提取失败原因,对问题进行归类。可以通过检测相关关键词判别构建失败的原因,例如编译未通过,单元测试成功率不达标等。通过合理的Jenkins脚本设置,对各个构建步骤的结果或者失败Log进行打印,可以帮助项目管理服务器更快速、准确的识别失败原因和分类。能够对项目管理提供一定的支持,也可以通过定期复盘降低相似问题的发生率,提高团队能力。项目管理服务器通过消息服务器以邮件等方式通知相关的责任人,通知内容包括问题ID、问题类别等。The project management server creates an issue after receiving the information notified by the Jenkins server, and feeds the issue ID back to the Jenkins server. The Jenkins server backfills the build log and test results according to the issue ID to the comment area of the project management server. Afterwards, the project management server extracts the failure reasons based on the obtained log information and categorizes the problem. The reasons for build failure can be determined by detecting relevant keywords, such as compilation failure, unit test success rate not up to standard, etc. Through reasonable Jenkins script settings, printing the results or failure logs of each build step can help the project management server identify and classify failure causes more quickly and accurately. It can provide certain support for project management, and can also reduce the incidence of similar problems through regular reviews and improve team capabilities. The project management server notifies the relevant responsible persons through the message server via email. The notification content includes the problem ID, problem category, etc.

以上,即完成Jira问题的创建,相关人员收到提醒进行问题修复后,提供再次构建成功的结果以及相应的测试报告,经过人工审核确认后可关闭问题。The above is to complete the creation of the Jira issue. After the relevant personnel receive the reminder to fix the issue, the result of successful re-construction and the corresponding test report are provided. The issue can be closed after manual review and confirmation.

进一步地,一实施例中,在所述获取处理节点反馈的各个任务的处理结果的步骤之后,还包括:Further, in one embodiment, after the step of obtaining the processing results of each task fed back by the processing node, the method further includes:

针对处理结果为成功的任务,将任务对应的产物发送至产物管理服务器,产物包括测试报告以及编译生成的可执行文件,以供产物管理服务器对产物进行管理;接收产物管理服务器反馈的产物对应的管理信息;基于所述任务负责人联系方式发送任务处理成功通知以及所述管理信息。For tasks with a successful processing result, the products corresponding to the tasks are sent to the product management server. The products include test reports and compiled executable files for the product management server to manage the products; receive feedback from the product management server corresponding to the products Management information: sending a task processing success notification and the management information based on the contact information of the task leader.

本实施例中,产物包括编译生成的可执行文件和测试报告。继续参照图2,只有当编译成功且测试结果符合质量门槛要求时(即处理结果为成功的任务),Jenkins服务器将任务对应的产物发送至产物管理服务器进行版本管理,版本的划定根据团队需求进行自定义,这样可以确保产物管理服务器中的产物是合格可用的。产物进入产物管理服务器加上版本号后,产物管理服务器向Jenkins反馈产物对应的管理信息,管理信息包括产物的版本号、存储位置等信息,最后,Jenkins将通过消息服务器通知此次构建的责任人,通知内容包括构建成功结果(即任务处理成功通知)以及管理信息,管理信息可以是测试报告或测试报告链接、编译后可执行文件的版本号以及其余产物在产物管理服务器中的存放位置或链接。In this embodiment, the product includes an executable file generated by compilation and a test report. Continuing to refer to Figure 2, only when the compilation is successful and the test results meet the quality threshold requirements (that is, the processing result is a successful task), the Jenkins server will send the product corresponding to the task to the product management server for version management. The version is defined according to the team's needs. Customize to ensure that the products in the product management server are qualified and available. After the product enters the product management server and adds the version number, the product management server feeds back the management information corresponding to the product to Jenkins. The management information includes the product's version number, storage location and other information. Finally, Jenkins will notify the person responsible for the build through the message server , the notification content includes the build success result (that is, the task processing success notification) and management information. The management information can be a test report or test report link, the version number of the compiled executable file, and the storage location or link of other products in the product management server. .

进一步的,参照图2,备份服务器提供实时备份和周期性备份两种备份机制。Further, referring to Figure 2, the backup server provides two backup mechanisms: real-time backup and periodic backup.

所述实时备份主要针对Jenkins服务器、代码托管平台和产物管理服务器,备份内容主要包括:Jenkins服务器的配置文件和设置,比如构建脚本、Jenkins任务等;代码托管平台的所有内容,包括源代码、代码变更记录等;产物管理服务器的所有内容等。所述实时备份在每次检测到变更时发生,例如建立了新的流水线、代码仓库变更、有新的产物进入产物管理服务器等都将触发实时备份。The real-time backup is mainly for the Jenkins server, code hosting platform and product management server. The backup content mainly includes: the configuration files and settings of the Jenkins server, such as build scripts, Jenkins tasks, etc.; all content of the code hosting platform, including source code, code Change records, etc.; all contents of the product management server, etc. The real-time backup occurs every time a change is detected. For example, the creation of a new pipeline, changes to the code warehouse, new products entering the product management server, etc. will trigger real-time backup.

所述周期性备份,备份内容主要包括:各个平台(系统)的用户信息,如账户信息、用户权限设置等;系统的运行日志,包括Jenkins服务器的流水线日志、Jenkins服务器一段时间之内的系统日志、Jenkins服务器所使用的插件等;处理节点上部署的自动化测试工具的运行日志和处理节点一段时间之内的系统日志,以及所使用的Docker镜像。备份周期可自定义。The periodic backup mainly includes: user information of each platform (system), such as account information, user permission settings, etc.; system operation logs, including the pipeline log of the Jenkins server and the system log of the Jenkins server within a period of time. , plug-ins used by the Jenkins server, etc.; the running logs of the automated testing tools deployed on the processing nodes and the system logs of the processing nodes within a period of time, as well as the Docker image used. The backup cycle can be customized.

第二方面,本申请实施例还提供一种持续集成装置。In a second aspect, embodiments of the present application also provide a continuous integration device.

一实施例中,参照图3,图3为本申请持续集成装置一实施例的功能模块示意图。如图3所示,持续集成装置包括:In one embodiment, refer to FIG. 3 , which is a functional module schematic diagram of an embodiment of the continuous integration device of the present application. As shown in Figure 3, the continuous integration device includes:

优先级确定模块10,用于根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;The priority determination module 10 is used to determine the priority of each task according to the task attributes, which include branch type, code change mode, trigger type and build type;

处理顺序确定模块20,用于按照优先级从高到低的顺序,确定任务处理顺序;The processing sequence determination module 20 is used to determine the task processing sequence in order from high to low priority;

分配模块30,用于基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。The allocation module 30 is used to sequentially allocate each task to the processing node for processing according to the task pipeline based on the task processing sequence.

进一步地,一实施例中,所述优先级确定模块10用于:Further, in one embodiment, the priority determination module 10 is used to:

针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值;For each task, a first characteristic value is determined according to the branch type, a second characteristic value is determined according to the code change method, a third characteristic value is determined according to the trigger type, and a fourth characteristic value is determined according to the build type;

对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,得到优先级值;The first eigenvalue, the second eigenvalue, the third eigenvalue and the fourth eigenvalue are weighted and summed to obtain the priority value;

其中,优先级值越大,任务的优先级越高。Among them, the larger the priority value, the higher the priority of the task.

进一步地,一实施例中,当任务的构建类型为首次构建或失败后构建时,所述优先级确定模块10用于:Further, in one embodiment, when the construction type of the task is first build or post-failure build, the priority determination module 10 is used to:

将第一特征值g1、第二特征值g2、第三特征值g3以及第四特征值g4代入优先级值计算公式,得到优先级值p,加权公式为:Substitute the first eigenvalue g 1 , the second eigenvalue g 2 , the third eigenvalue g 3 and the fourth eigenvalue g 4 into the priority value calculation formula to obtain the priority value p. The weighting formula is:

p=w1*g1+w2*g2+w3*g3+(1+rate)*w4*g4 p=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+rate)*w 4 *g 4

其中,w1、w2、w3、w4为权重,rate为预设时长内任务处理失败的比例,优先级值越大,任务的优先级越高。Among them, w 1 , w 2 , w 3 , and w 4 are weights, and rate is the proportion of task processing failures within the preset time period. The larger the priority value, the higher the priority of the task.

进一步地,一实施例中,持续集成装置还包括结果反馈模块,用于:Further, in one embodiment, the continuous integration device also includes a result feedback module, used for:

获取处理节点反馈的各个任务的处理结果;Obtain the processing results of each task fed back by the processing node;

针对处理结果为失败的任务,将任务失败通知以及任务负责人联系方式发送至项目管理服务器;For tasks whose processing result is failed, the task failure notification and the contact information of the task leader are sent to the project management server;

接收项目管理服务器基于任务失败通知反馈的问题ID,并基于问题ID填写任务处理日志至项目管理服务器的评论区,以供项目管理服务器对所述任务处理日志进行语义失败确定问题类别,并基于所述任务负责人联系方式反馈问题ID以及问题类别。Receive the problem ID based on the task failure notification feedback from the project management server, and fill in the task processing log based on the problem ID to the comment area of the project management server, so that the project management server can perform semantic failure on the task processing log to determine the problem category, and based on the Please provide the contact information of the task leader to feedback the problem ID and problem category.

进一步地,一实施例中,持续集成装置还包括产物反馈模块,用于:Further, in one embodiment, the continuous integration device also includes a product feedback module for:

针对处理结果为成功的任务,将任务对应的产物发送至产物管理服务器,产物包括测试报告以及编译生成的可执行文件,以供产物管理服务器对产物进行管理;For tasks whose processing results are successful, the products corresponding to the tasks are sent to the product management server. The products include test reports and compiled executable files for the product management server to manage the products;

接收产物管理服务器反馈的产物对应的管理信息;Receive the management information corresponding to the product fed back by the product management server;

基于所述任务负责人联系方式发送任务处理成功通知以及所述管理信息。Send a task processing success notification and the management information based on the contact information of the task leader.

其中,上述持续集成装置中各个模块的功能实现与上述持续集成方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。The functional implementation of each module in the above-mentioned continuous integration device corresponds to each step in the above-mentioned continuous integration method embodiment, and their functions and implementation processes will not be described in detail here.

第三方面,本申请实施例提供一种持续集成设备,持续集成设备可以是个人计算机(personal computer,PC)、笔记本电脑、服务器等具有数据处理功能的设备。In the third aspect, embodiments of the present application provide a continuous integration device. The continuous integration device may be a personal computer (PC), a notebook computer, a server, or other devices with data processing functions.

参照图4,图4为本申请实施例方案中涉及的持续集成设备的硬件结构示意图。本申请实施例中,持续集成设备可以包括处理器、存储器、通信接口以及通信总线。Referring to Figure 4, Figure 4 is a schematic diagram of the hardware structure of the continuous integration device involved in the embodiment of the present application. In this embodiment of the present application, the continuous integration device may include a processor, a memory, a communication interface, and a communication bus.

其中,通信总线可以是任何类型的,用于实现处理器、存储器以及通信接口互连。The communication bus can be of any type and is used to interconnect processors, memories and communication interfaces.

通信接口包括输入/输出(input/output,I/O)接口、物理接口和逻辑接口等用于实现持续集成设备内部的器件互连的接口,以及用于实现持续集成设备与其他设备(例如其他计算设备或用户设备)互连的接口。物理接口可以是以太网接口、光纤接口、ATM接口等;用户设备可以是显示屏(Display)、键盘(Keyboard)等。Communication interfaces include input/output (I/O) interfaces, physical interfaces, logical interfaces and other interfaces used to realize device interconnection within continuous integration equipment, as well as interfaces used to realize continuous integration equipment and other equipment (such as other Computing equipment or user equipment) interconnection interface. The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user equipment can be a display screen (Display), keyboard (Keyboard), etc.

存储器可以是各种类型的存储介质,例如随机存取存储器(randomaccessmemory,RAM)、只读存储器(read-only memory,ROM)、非易失性RAM(non-volatileRAM,NVRAM)、闪存、光存储器、硬盘、可编程ROM(programmable ROM,PROM)、可擦除PROM(erasable PROM,EPROM)、电可擦除PROM(electrically erasable PROM,EEPROM)等。Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical memory , hard disk, programmable ROM (PROM), erasable PROM (erasable PROM, EPROM), electrically erasable PROM (electrically erasable PROM, EEPROM), etc.

处理器可以是通用处理器,通用处理器可以调用存储器中存储的持续集成程序,并执行本申请实施例提供的持续集成方法。例如,通用处理器可以是中央处理器(centralprocessing unit,CPU)。其中,持续集成程序被调用时所执行的方法可参照本申请持续集成方法的各个实施例,此处不再赘述。The processor may be a general-purpose processor, and the general-purpose processor may call the continuous integration program stored in the memory and execute the continuous integration method provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). For the method executed when the continuous integration program is called, reference can be made to the various embodiments of the continuous integration method of this application, and will not be described again here.

本领域技术人员可以理解,图4中示出的硬件结构并不构成对本申请的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the hardware structure shown in Figure 4 does not limit the present application, and may include more or fewer components than shown, or combine certain components, or arrange different components.

第四方面,本申请实施例还提供一种计算机可读存储介质。In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium.

本申请计算机可读存储介质上存储有持续集成程序,其中所述持续集成程序被处理器执行时,实现如上述的持续集成方法的步骤。The computer-readable storage medium of the present application stores a continuous integration program. When the continuous integration program is executed by the processor, the steps of the continuous integration method as described above are implemented.

其中,持续集成程序被执行时所实现的方法可参照本申请持续集成方法的各个实施例,此处不再赘述。For the method implemented when the continuous integration program is executed, reference may be made to various embodiments of the continuous integration method of the present application, which will not be described again here.

需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。It should be noted that the above serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

本申请的说明书和权利要求书及上述附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。术语“第一”、“第二”和“第三”等描述,是用于区分不同的对象等,其不代表先后顺序,也不限定“第一”、“第二”和“第三”是不同的类型。The terms "including" and "having" and any variations thereof in the description and claims of this application and the above-described drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes Other steps or units inherent to such processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc. They do not represent a sequence, nor do they limit "first", "second" and "third" are different types.

在本申请实施例的描述中,“示例性的”、“例如”或者“举例来说”等用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”、“例如”或者“举例来说”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”、“例如”或者“举例来说”等词旨在以具体方式呈现相关概念。In the description of the embodiments of this application, "exemplary", "such as" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary," "such as," or "for example" in the embodiments of the present application is not to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary," "such as," or "for example" is intended to present the concepts in a concrete manner.

在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。In the description of the embodiments of this application, unless otherwise stated, "/" means or, for example, A/B can mean A or B; "and/or" in the text is just a way to describe the association of associated objects. Relationship means that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiment of this application, " "Plural" means two or more than two.

在本申请实施例描述的一些流程中,包含了按照特定顺序出现的多个操作或步骤,但是应该理解,这些操作或步骤可以不按照其在本申请实施例中出现的顺序来执行或并行执行,操作的序号仅用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作或步骤可以按顺序执行或并行执行,并且这些操作或步骤可以进行组合。Some of the processes described in the embodiments of this application include multiple operations or steps that appear in a specific order. However, it should be understood that these operations or steps may be performed out of the order in which they appear in the embodiments of this application or in parallel. , the sequence number of the operation is only used to distinguish different operations, the sequence number itself does not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations or steps may be performed sequentially or in parallel, and these operations or steps may be combined.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM) as mentioned above. , magnetic disk, optical disk), including several instructions to cause a terminal device to execute the methods described in various embodiments of the present application.

以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of the present application may be directly or indirectly used in other related technical fields. , are all equally included in the patent protection scope of this application.

Claims (10)

1.一种持续集成方法,其特征在于,所述持续集成方法包括:1. A continuous integration method, characterized in that the continuous integration method includes: 根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;Determine the priority of each task according to the task attributes, which include branch type, code change method, trigger type and build type; 按照优先级从高到低的顺序,确定任务处理顺序;Determine the order of task processing in order from high to low priority; 基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。Based on the task processing sequence, each task is assigned to the processing node for processing according to the task pipeline. 2.如权利要求1所述的持续集成方法,其特征在于,所述根据任务属性确定各个任务的优先级的步骤包括:2. The continuous integration method according to claim 1, wherein the step of determining the priority of each task according to task attributes includes: 针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值;For each task, a first characteristic value is determined according to the branch type, a second characteristic value is determined according to the code change method, a third characteristic value is determined according to the trigger type, and a fourth characteristic value is determined according to the build type; 对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,得到优先级值;The first eigenvalue, the second eigenvalue, the third eigenvalue and the fourth eigenvalue are weighted and summed to obtain the priority value; 其中,优先级值越大,任务的优先级越高。Among them, the larger the priority value, the higher the priority of the task. 3.如权利要求2所述的持续集成方法,其特征在于,当任务的构建类型为首次构建或失败后构建时,在所述针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值的步骤之后,还包括:3. The continuous integration method according to claim 2, characterized in that when the build type of the task is first build or build after failure, for each task, the first characteristic value is determined according to the branch type, and the first characteristic value is determined according to the code. After the steps of changing the method to determine the second characteristic value, determining the third characteristic value according to the trigger type, and determining the fourth characteristic value according to the construction type, it also includes: 将第一特征值g1、第二特征值g2、第三特征值g3以及第四特征值g4代入优先级值计算公式,得到优先级值p,加权公式为:Substitute the first eigenvalue g 1 , the second eigenvalue g 2 , the third eigenvalue g 3 and the fourth eigenvalue g 4 into the priority value calculation formula to obtain the priority value p. The weighting formula is: p=w1*g1+w2*g2+w3*g3+(1+rate)*w4*g4 p=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+rate)*w 4 *g 4 其中,w1、w2、w3、w4为权重,rate为预设时长内任务处理失败的比例,优先级值越大,任务的优先级越高。Among them, w 1 , w 2 , w 3 , and w 4 are weights, and rate is the proportion of task processing failures within the preset time period. The larger the priority value, the higher the priority of the task. 4.如权利要求1所述的持续集成方法,其特征在于,在所述基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理的步骤之后,还包括:4. The continuous integration method according to claim 1, characterized in that, after the step of sequentially allocating each task to a processing node for processing based on the task processing sequence according to the task pipeline, it also includes: 获取处理节点反馈的各个任务的处理结果;Obtain the processing results of each task fed back by the processing node; 针对处理结果为失败的任务,将任务失败通知以及任务负责人联系方式发送至项目管理服务器;For tasks whose processing result is failed, the task failure notification and the contact information of the task leader are sent to the project management server; 接收项目管理服务器基于任务失败通知反馈的问题ID,并基于问题ID填写任务处理日志至项目管理服务器的评论区,以供项目管理服务器对所述任务处理日志进行语义失败确定问题类别,并基于所述任务负责人联系方式反馈问题ID以及问题类别。Receive the problem ID based on the task failure notification feedback from the project management server, and fill in the task processing log based on the problem ID to the comment area of the project management server, so that the project management server can perform semantic failure on the task processing log to determine the problem category, and based on the Please provide the contact information of the task leader to feedback the problem ID and problem category. 5.如权利要求4所述的持续集成方法,其特征在于,在所述获取处理节点反馈的各个任务的处理结果的步骤之后,还包括:5. The continuous integration method according to claim 4, characterized in that, after the step of obtaining the processing results of each task fed back by the processing node, it further includes: 针对处理结果为成功的任务,将任务对应的产物发送至产物管理服务器,产物包括测试报告以及编译生成的可执行文件,以供产物管理服务器对产物进行管理;For tasks whose processing results are successful, the products corresponding to the tasks are sent to the product management server. The products include test reports and compiled executable files for the product management server to manage the products; 接收产物管理服务器反馈的产物对应的管理信息;Receive the management information corresponding to the product fed back by the product management server; 基于所述任务负责人联系方式发送任务处理成功通知以及所述管理信息。Send a task processing success notification and the management information based on the contact information of the task leader. 6.一种持续集成装置,其特征在于,所述持续集成装置包括:6. A continuous integration device, characterized in that the continuous integration device includes: 优先级确定模块,用于根据任务属性确定各个任务的优先级,所述任务属性包括分支类型、代码变更方式、触发类型以及构建类型;A priority determination module, used to determine the priority of each task based on task attributes, which include branch type, code change method, trigger type and build type; 处理顺序确定模块,用于按照优先级从高到低的顺序,确定任务处理顺序;The processing sequence determination module is used to determine the task processing sequence in order from high priority to low; 分配模块,用于基于任务处理顺序,依次将各个任务按照任务流水线分配至处理节点进行处理。The allocation module is used to allocate each task to the processing node for processing in accordance with the task pipeline based on the task processing sequence. 7.如权利要求6所述的持续集成装置,其特征在于,所述优先级确定模块用于:7. The continuous integration device according to claim 6, wherein the priority determination module is used for: 针对每个任务,根据分支类型确定第一特征值、根据代码变更方式确定第二特征值、根据触发类型确定第三特征值以及根据构建类型确定第四特征值;For each task, a first characteristic value is determined according to the branch type, a second characteristic value is determined according to the code change method, a third characteristic value is determined according to the trigger type, and a fourth characteristic value is determined according to the build type; 对第一特征值、第二特征值、第三特征值以及第四特征值加权求和,得到优先级值;The first eigenvalue, the second eigenvalue, the third eigenvalue and the fourth eigenvalue are weighted and summed to obtain the priority value; 其中,优先级值越大,任务的优先级越高。Among them, the larger the priority value, the higher the priority of the task. 8.如权利要求7所述的持续集成装置,其特征在于,当任务的构建类型为首次构建或失败后构建时,所述优先级确定模块用于:8. The continuous integration device according to claim 7, wherein when the build type of the task is first build or build after failure, the priority determination module is used to: 将第一特征值g1、第二特征值g2、第三特征值g3以及第四特征值g4代入优先级值计算公式,得到优先级值p,加权公式为:Substitute the first eigenvalue g 1 , the second eigenvalue g 2 , the third eigenvalue g 3 and the fourth eigenvalue g 4 into the priority value calculation formula to obtain the priority value p. The weighting formula is: p=w1*g1+w2*g2+w3*g3+(1+rate)*w4*g4 p=w 1 *g 1 +w 2 *g 2 +w 3 *g 3 +(1+rate)*w 4 *g 4 其中,w1、w2、w3、w4为权重,rate为预设时长内任务处理失败的比例,优先级值越大,任务的优先级越高。Among them, w 1 , w 2 , w 3 , and w 4 are weights, and rate is the proportion of task processing failures within the preset time period. The larger the priority value, the higher the priority of the task. 9.一种持续集成设备,其特征在于,所述持续集成设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的持续集成程序,其中所述持续集成程序被所述处理器执行时,实现如权利要求1至5中任一项所述的持续集成方法的步骤。9. A continuous integration device, characterized in that the continuous integration device includes a processor, a memory, and a continuous integration program stored on the memory and executable by the processor, wherein the continuous integration program is When the processor is executed, the steps of the continuous integration method according to any one of claims 1 to 5 are implemented. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有持续集成程序,其中所述持续集成程序被处理器执行时,实现如权利要求1至5中任一项所述的持续集成方法的步骤。10. A computer-readable storage medium, characterized in that a continuous integration program is stored on the computer-readable storage medium, wherein when the continuous integration program is executed by a processor, any one of claims 1 to 5 is implemented. The steps of the continuous integration approach described in Item.
CN202311705671.3A 2023-12-11 2023-12-11 Continuous integration method, device, equipment and computer-readable storage medium Pending CN117687756A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311705671.3A CN117687756A (en) 2023-12-11 2023-12-11 Continuous integration method, device, equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311705671.3A CN117687756A (en) 2023-12-11 2023-12-11 Continuous integration method, device, equipment and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN117687756A true CN117687756A (en) 2024-03-12

Family

ID=90126011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311705671.3A Pending CN117687756A (en) 2023-12-11 2023-12-11 Continuous integration method, device, equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN117687756A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113553187A (en) * 2021-07-30 2021-10-26 咪咕文化科技有限公司 Method and device for concurrently constructing revops and computing equipment
CN114416315A (en) * 2022-01-18 2022-04-29 上海金融期货信息技术有限公司 Dynamic task scheduling method and system in continuous integrated system
CN116775297A (en) * 2023-06-30 2023-09-19 平安银行股份有限公司 Method, device, system and medium for dynamic sequencing of construction task priorities
CN117076150A (en) * 2023-07-18 2023-11-17 上海哔哩哔哩科技有限公司 Task queue management method and device, electronic equipment and computer readable medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113553187A (en) * 2021-07-30 2021-10-26 咪咕文化科技有限公司 Method and device for concurrently constructing revops and computing equipment
CN114416315A (en) * 2022-01-18 2022-04-29 上海金融期货信息技术有限公司 Dynamic task scheduling method and system in continuous integrated system
CN116775297A (en) * 2023-06-30 2023-09-19 平安银行股份有限公司 Method, device, system and medium for dynamic sequencing of construction task priorities
CN117076150A (en) * 2023-07-18 2023-11-17 上海哔哩哔哩科技有限公司 Task queue management method and device, electronic equipment and computer readable medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丹·奥尔森作: "《精益产品开发手册 产品创新六步法》", vol. 1, 30 June 2023, 中国广播影视出版社, pages: 240 *

Similar Documents

Publication Publication Date Title
US10783065B2 (en) Unified test automation system
US8473893B2 (en) Integration of external software analysis processes with software configuration management applications
US8209669B2 (en) System and method for supporting software
US11392469B2 (en) Framework for testing machine learning workflows
US8161323B2 (en) Health monitor
US8365185B2 (en) Preventing execution of processes responsive to changes in the environment
US7788540B2 (en) Tracking down elusive intermittent failures
US9183124B2 (en) Automation controller for next generation testing system
US8584079B2 (en) Quality on submit process
US8677174B2 (en) Management of runtime events in a computer environment using a containment region
US8108878B1 (en) Method and apparatus for detecting indeterminate dependencies in a distributed computing environment
US20080127089A1 (en) Method For Managing Software Lifecycle
WO2022031338A1 (en) Concurrent edit detection
CN111949546A (en) An operating system testing method, apparatus, device and readable storage medium
US11327723B1 (en) Development environment integrated with failure detection system
US8539512B2 (en) Transactional environments for event and data binding handlers
CN117687756A (en) Continuous integration method, device, equipment and computer-readable storage medium
CN118034887A (en) Big data platform task management method and system
US20220398185A1 (en) Self-optimizing analysis system for core dumps
Ray et al. Prioritizing Program elements: A pretesting effort to improve software quality
Ohira et al. A case study on the misclassification of software performance issues in an issue tracking system
Nicolaescu et al. On Adequate Behavior-based Architecture Conformance Checks
CN115658380A (en) Distributed flow reverse rollback method and system
CN117008945A (en) Multi-platform data association system and method
Orlando Software aging analysis of off the shelf software items

Legal Events

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