CN118694668A - Fault task injection method, device, communication equipment, storage medium and program product - Google Patents
Fault task injection method, device, communication equipment, storage medium and program product Download PDFInfo
- Publication number
- CN118694668A CN118694668A CN202410952677.9A CN202410952677A CN118694668A CN 118694668 A CN118694668 A CN 118694668A CN 202410952677 A CN202410952677 A CN 202410952677A CN 118694668 A CN118694668 A CN 118694668A
- Authority
- CN
- China
- Prior art keywords
- task
- fault
- target
- candidate
- injection condition
- 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
Links
- 238000002347 injection Methods 0.000 title claims abstract description 219
- 239000007924 injection Substances 0.000 title claims abstract description 219
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000004891 communication Methods 0.000 title claims abstract description 23
- 238000004590 computer program Methods 0.000 claims description 43
- 230000007257 malfunction Effects 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 3
- 238000012545 processing Methods 0.000 description 23
- 230000006870 function Effects 0.000 description 14
- 230000008569 process Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 7
- 238000002474 experimental method Methods 0.000 description 7
- 238000011084 recovery Methods 0.000 description 6
- 239000000243 solution Substances 0.000 description 6
- 230000001419 dependent effect Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000007635 classification algorithm Methods 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 235000019580 granularity Nutrition 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000000739 chaotic effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000036961 partial effect Effects 0.000 description 1
- 230000002829 reductive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/50—Queue scheduling
- H04L47/62—Queue scheduling characterised by scheduling criteria
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Retry When Errors Occur (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及通信技术领域,特别是涉及一种故障任务注入方法、装置、通信设备、存储介质和程序产品。The present application relates to the field of communication technology, and in particular to a fault task injection method, apparatus, communication equipment, storage medium and program product.
背景技术Background Art
随着计算机网络的不断发展,基于云计算和分布式等新技术所构建的互联网业务系统应运而生,以期提高业务处理效率以及保证系统的可扩展性等。一个具有高可用性的互联网业务系统非常依赖其自身的健壮性,因此,对业务系统的性能测试至关重要。With the continuous development of computer networks, Internet business systems based on new technologies such as cloud computing and distributed computing have emerged in order to improve business processing efficiency and ensure system scalability. A highly available Internet business system is highly dependent on its own robustness, so performance testing of the business system is crucial.
混沌工程可以支持在分布式系统上进行由经验指导控制的实验,来观察系统行为并发现系统缺陷,从而建立对系统在意外条件下引发混乱的场景模拟。然而,传统的混沌工程依赖人工经验进行故障任务注入,相对机械。Chaos engineering can support experiments guided by experience on distributed systems to observe system behavior and discover system defects, thereby simulating scenarios in which the system may become chaotic under unexpected conditions. However, traditional chaos engineering relies on manual experience to inject faulty tasks, which is relatively mechanical.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种能够提高灵活性和多样性的故障任务注入方法、装置、通信设备、存储介质和程序产品。Based on this, it is necessary to provide a fault task injection method, apparatus, communication equipment, storage medium and program product that can improve flexibility and diversity in response to the above technical problems.
第一方面,本申请提供了一种故障任务注入方法,包括:In a first aspect, the present application provides a fault task injection method, comprising:
确定与业务系统的当前业务流量相匹配的目标注入条件;Determine the target injection conditions that match the current business traffic of the business system;
从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;Selecting a target fault task from at least one candidate fault task corresponding to the target injection condition;
向所述业务系统注入所述目标故障任务。Inject the target fault task into the business system.
在其中一个实施例中,所述从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务,包括:根据所述目标注入条件所对应的各候选故障任务的选取顺序,从所述至少一个候选故障任务中,选取所述目标故障任务。In one of the embodiments, selecting the target fault task from at least one candidate fault task corresponding to the target injection condition includes: selecting the target fault task from the at least one candidate fault task according to the selection order of the candidate fault tasks corresponding to the target injection condition.
在其中一个实施例中,所述根据所述目标注入条件所对应的各候选故障任务的选取顺序,从所述至少一个候选故障任务中,选取所述目标故障任务,包括:根据所述目标注入条件所对应的各候选故障任务的选取顺序,从所述至少一个候选故障任务中,轮询选取所述目标故障任务;或者,根据所述目标注入条件所对应的各候选故障任务的选取顺序,从所述至少一个候选故障任务中,随机选取所述目标故障任务。In one of the embodiments, selecting the target fault task from the at least one candidate fault task according to the selection order of the candidate fault tasks corresponding to the target injection condition includes: polling and selecting the target fault task from the at least one candidate fault task according to the selection order of the candidate fault tasks corresponding to the target injection condition; or randomly selecting the target fault task from the at least one candidate fault task according to the selection order of the candidate fault tasks corresponding to the target injection condition.
在其中一个实施例中,所述选取顺序采用以下方式确定:确定各所述候选故障任务与所述目标注入条件之间的相关度数据;根据各所述候选故障任务的相关度数据,确定各所述候选故障任务的选取顺序。In one of the embodiments, the selection order is determined in the following manner: determining the correlation data between each of the candidate fault tasks and the target injection condition; and determining the selection order of each of the candidate fault tasks based on the correlation data of each of the candidate fault tasks.
在其中一个实施例中,所述根据各所述候选故障任务的相关度数据,确定各所述候选故障任务的选取顺序,包括:根据每一候选故障任务的相关度数据,生成相应候选故障任务的任务标识;其中,所述候选故障任务的任务标识的数量,随着相应相关度数据单调递增;根据各所述候选故障任务的任务标识的数量,按照各候选故障任务的预设顺序进行排列,得到所述选取顺序。In one of the embodiments, the selection order of each candidate fault task is determined based on the relevance data of each candidate fault task, including: generating a task identifier of the corresponding candidate fault task based on the relevance data of each candidate fault task; wherein the number of task identifiers of the candidate fault tasks increases monotonically with the corresponding relevance data; and arranging the candidate fault tasks in a preset order based on the number of task identifiers of each candidate fault task to obtain the selection order.
在其中一个实施例中,所述根据所述目标注入条件所对应的各候选故障任务的选取顺序,从所述至少一个候选故障任务中,随机选取所述目标故障任务,包括:根据所述选取顺序中所包含任务标识的数量,生成选取随机数;将目标任务标识对应的候选故障任务,作为所述目标故障任务;其中,所述目标任务标识为所述选取顺序下排列次序与所述选取随机数相同的任务标识。In one of the embodiments, the target fault task is randomly selected from the at least one candidate fault task according to the selection order of the candidate fault tasks corresponding to the target injection condition, including: generating a selection random number according to the number of task identifiers included in the selection order; taking the candidate fault task corresponding to the target task identifier as the target fault task; wherein the target task identifier is a task identifier whose arrangement order in the selection order is the same as that of the selection random number.
在其中一个实施例中,所述确定各所述候选故障任务与所述目标注入条件之间的相关度数据,包括:获取各所述候选故障任务在所述目标注入条件下引发故障的历史故障频次;根据各所述候选故障任务对应的历史故障频次,确定相应候选故障任务与所述目标注入条件之间的相关度数据。In one of the embodiments, determining the correlation data between each of the candidate fault tasks and the target injection condition includes: obtaining the historical failure frequency of each of the candidate fault tasks causing failures under the target injection condition; and determining the correlation data between the corresponding candidate fault task and the target injection condition based on the historical failure frequency corresponding to each of the candidate fault tasks.
在其中一个实施例中,在所述从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务之后,所述方法还包括:根据与所述目标故障任务具备绑定关系的候选故障任务,更新所述目标故障任务。In one of the embodiments, after selecting a target fault task from at least one candidate fault task corresponding to the target injection condition, the method further includes: updating the target fault task according to a candidate fault task having a binding relationship with the target fault task.
在其中一个实施例中,所述绑定关系采用以下方式确定:对所述至少一个候选故障任务进行分类;建立类别相同的至少两个候选故障任务之间的绑定关系。In one of the embodiments, the binding relationship is determined in the following manner: classifying the at least one candidate fault task; and establishing a binding relationship between at least two candidate fault tasks of the same category.
在其中一个实施例中,所述确定与业务系统的当前业务流量相匹配的目标注入条件,包括:获取所述业务系统的当前业务流量的业务属性数据;从至少一个候选注入条件中,选取与所述业务属性数据相匹配的目标注入条件;其中,所述业务属性数据包括业务类型、业务操作和协议类型中的至少一种。In one of the embodiments, determining the target injection condition that matches the current business traffic of the business system includes: obtaining business attribute data of the current business traffic of the business system; selecting a target injection condition that matches the business attribute data from at least one candidate injection condition; wherein the business attribute data includes at least one of a business type, a business operation, and a protocol type.
第二方面,本申请提供了一种故障任务注入装置,包括:In a second aspect, the present application provides a fault task injection device, comprising:
第一确定模块,用于确定与业务系统的当前业务流量相匹配的目标注入条件;A first determination module is used to determine a target injection condition that matches the current business flow of the business system;
选取模块,用于从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;A selection module, used to select a target fault task from at least one candidate fault task corresponding to the target injection condition;
注入模块,用于向所述业务系统注入所述目标故障任务。An injection module is used to inject the target fault task into the business system.
第三方面,本申请还提供了一种通信设备,所述通信设备包括存储器、收发器和处理器,所述存储器存储有计算机程序,所述收发器用于在所述处理器的控制下接收数据或发送数据,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, the present application further provides a communication device, the communication device comprising a memory, a transceiver and a processor, the memory storing a computer program, the transceiver being used to receive data or send data under the control of the processor, and the processor implementing the following steps when executing the computer program:
确定与业务系统的当前业务流量相匹配的目标注入条件;Determine the target injection conditions that match the current business traffic of the business system;
从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;Selecting a target fault task from at least one candidate fault task corresponding to the target injection condition;
向所述业务系统注入所述目标故障任务。Inject the target fault task into the business system.
第四方面,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
确定与业务系统的当前业务流量相匹配的目标注入条件;Determine the target injection conditions that match the current business traffic of the business system;
从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;Selecting a target fault task from at least one candidate fault task corresponding to the target injection condition;
向所述业务系统注入所述目标故障任务。Inject the target fault task into the business system.
第五方面,本申请还提供了一种计算机程序产品,所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which implements the following steps when executed by a processor:
确定与业务系统的当前业务流量相匹配的目标注入条件;Determine the target injection conditions that match the current business traffic of the business system;
从所述目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;Selecting a target fault task from at least one candidate fault task corresponding to the target injection condition;
向所述业务系统注入所述目标故障任务。Inject the target fault task into the business system.
上述故障任务注入方法、装置、通信设备、存储介质和程序产品,通过确定与业务系统的当前业务流量相匹配的目标注入条件,使得目标注入条件能够与业务系统的当前业务流量相匹配,保证了后续所注入故障任务与当前业务流量的匹配度。进一步地,从目标注入条件所对应的至少一个候选故障任务中,选取后续注入业务系统的目标故障任务,替代直接将目标注入条件对应的故障任务注入到业务系统中,避免了向业务系统中进行目标注入条件下全量故障任务的机械注入,提高了在业务系统中进行故障任务注入的灵活性和多样性。另外,通过候选注入条件的灵活设置,能够根据候选注入条件的不同粒度,灵活可控地进行业务故障的注入,例如可以精细到针对某个应用或某一对IP(Internet Protocol,网际互连协议)地址之间流量的故障注入,进一步提高了在业务系统中进行故障任务注入的灵活性和可控性。The above-mentioned fault task injection method, device, communication equipment, storage medium and program product, by determining the target injection condition that matches the current business flow of the business system, make the target injection condition match the current business flow of the business system, and ensure the matching degree of the subsequently injected fault task with the current business flow. Further, from at least one candidate fault task corresponding to the target injection condition, the target fault task to be subsequently injected into the business system is selected, instead of directly injecting the fault task corresponding to the target injection condition into the business system, avoiding the mechanical injection of all fault tasks under the target injection condition into the business system, and improving the flexibility and diversity of fault task injection in the business system. In addition, through the flexible setting of the candidate injection condition, the injection of business faults can be flexibly and controllably performed according to the different granularities of the candidate injection condition, for example, it can be refined to the fault injection for a certain application or a certain pair of IP (Internet Protocol) addresses. The flow between the address further improves the flexibility and controllability of fault task injection in the business system.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为一个实施例中故障任务注入方法的应用场景示意图;FIG1 is a schematic diagram of an application scenario of a fault task injection method according to an embodiment;
图2为一个实施例中故障任务注入方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a fault task injection method in one embodiment;
图3为一个实施例中目标故障任务的选取步骤的流程示意图;FIG3 is a schematic flow chart of the steps of selecting a target fault task in one embodiment;
图4为一个实施例中目标故障任务的更新步骤的流程示意图;FIG4 is a flow chart of the updating steps of the target fault task in one embodiment;
图5为另一个实施例中故障任务注入方法的流程示意图;FIG5 is a schematic diagram of a flow chart of a fault task injection method in another embodiment;
图6为一个实施例中故障任务注入装置的结构框图;FIG6 is a structural block diagram of a fault task injection device in one embodiment;
图7为一个实施例中通信设备的内部结构图。FIG. 7 is a diagram showing the internal structure of a communication device in one embodiment.
具体实施方式DETAILED DESCRIPTION
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
本申请实施例所提供的故障任务注入方法,可以应用于图1所示的应用环境中。其中,DPI(Deep Packet Inspection,深度包检测)系统110从网络端获取业务流量,并对业务流量进行解析,得到流量解析结果;控制端120根据流量解析结果,匹配目标注入条件,并从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;控制端120将目标故障任务注入到业务系统130中。The fault task injection method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. In which, the DPI (Deep Packet Inspection) system 110 obtains business traffic from the network end, and parses the business traffic to obtain a traffic parsing result; the control end 120 matches the target injection condition according to the traffic parsing result, and selects the target fault task from at least one candidate fault task corresponding to the target injection condition; the control end 120 injects the target fault task into the business system 130.
需要说明的是,控制端120可以与DPI系统110集成设置,以减少硬件部署成本;或者可选地,控制端120与DPI系统110分别独立设置,从而实现不同设备之间的解耦,便于进行不同设备的维护。It should be noted that the control terminal 120 can be integrated with the DPI system 110 to reduce hardware deployment costs; or optionally, the control terminal 120 and the DPI system 110 are independently configured to achieve decoupling between different devices and facilitate maintenance of different devices.
在一个可选实施例中,如图2所示,提供了一种故障任务注入方法,可应用于图1所示的DPI系统110,还可以应用于控制端120,或者通过DPI系统110与控制端120交互实现。本实施例中,该方法包括以下步骤:In an optional embodiment, as shown in FIG2 , a fault task injection method is provided, which can be applied to the DPI system 110 shown in FIG1 , and can also be applied to the control end 120, or implemented through the interaction between the DPI system 110 and the control end 120. In this embodiment, the method includes the following steps:
S210,确定与业务系统的当前业务流量相匹配的目标注入条件。S210, determining a target injection condition that matches the current service flow of the service system.
其中,业务系统即为待进行故障任务注入的系统。其中,当前业务流量可以包括网络流入流量,也即流入业务系统的流量,或者可以包括网络流出流量,也即流出业务系统的流量,本申请对此不作任何限定。The business system is the system to be injected with fault tasks. The current business traffic may include network inflow traffic, that is, traffic flowing into the business system, or may include network outflow traffic, that is, traffic flowing out of the business system, and this application does not impose any limitation on this.
其中,注入条件可以理解为故障注入所需满足的触发条件。示例性的,注入条件可以基于基础业务信息和业务质量指标等中的至少一种构建得到。其中,基础业务信息可以包括应用名称和业务类型等基础属性中的至少一种。其中,业务质量指标可以包括时延指标、抖动指标、丢包指标和业务标识指标等中的至少一种。可选地,时延指标可以包括RTT(Round-Trip Time,往返时延)、首屏打开时延、TCP(Transmission Control Protocol,传输控制协议)建链时延和TCP首包时延等中的至少一种;抖动指标可以包括包间隔和包抖动等中的至少一种;丢包指标可以包括重传次数和重传大小等中的至少一种;业务标识指标可以包括HTTP(Hypertext Transfer Protocol,超文本传输协议)操作、结束标识和Flag(标志位)等中的至少一种。Among them, the injection condition can be understood as the trigger condition that needs to be met for fault injection. Exemplarily, the injection condition can be constructed based on at least one of basic business information and business quality indicators. Among them, the basic business information can include at least one of the basic attributes such as application name and business type. Among them, the business quality indicator can include at least one of the delay indicator, jitter indicator, packet loss indicator and business identification indicator. Optionally, the delay indicator can include at least one of RTT (Round-Trip Time), first screen opening delay, TCP (Transmission Control Protocol) link establishment delay and TCP first packet delay; jitter indicators can include at least one of packet interval and packet jitter; packet loss indicators can include at least one of retransmission times and retransmission size; business identification indicators can include at least one of HTTP (Hypertext Transfer Protocol) operation, end mark and Flag.
在一个可选实施例中,可以获取业务系统的当前业务流量的业务属性数据;从至少一个候选注入条件中,选取与业务属性数据相匹配的目标注入条件。其中,业务属性数据从至少一个属性维度对当前业务流量进行描述。其中,业务属性数据可以包括业务类型、业务操作和协议类型等中的至少一种。In an optional embodiment, the service attribute data of the current service flow of the service system may be obtained; and a target injection condition matching the service attribute data is selected from at least one candidate injection condition. The service attribute data describes the current service flow from at least one attribute dimension. The service attribute data may include at least one of a service type, a service operation, and a protocol type.
示例性的,可以对业务系统的当前业务流量进行解析,得到当前业务流量的业务属性数据;将各业务属性数据与至少一个候选注入条件进行关键字匹配;将匹配成功的候选注入条件,作为目标注入条件。需要说明的是,上述解析操作,可以采用传统解析操作中的至少一种加以实现,本申请对此不作任何限定。Exemplarily, the current business traffic of the business system can be parsed to obtain business attribute data of the current business traffic; each business attribute data is matched with at least one candidate injection condition by keyword; and the successfully matched candidate injection condition is used as the target injection condition. It should be noted that the above parsing operation can be implemented by using at least one of the traditional parsing operations, and this application does not impose any limitation on this.
举例说明,若存在候选注入条件定义如下:业务类型为A类型、业务操作为HTTP操作下的“POST”(发送)操作、所采用L4协议为TCP协议,在当前业务流量解析所得的业务属性数据与上述候选注入条件相匹配的情况下,将上述候选注入条件作为目标注入条件。For example, if there is a candidate injection condition defined as follows: the business type is type A, the business operation is the "POST" (send) operation under the HTTP operation, and the L4 protocol used is the TCP protocol, when the business attribute data obtained by parsing the current business traffic matches the above candidate injection condition, the above candidate injection condition will be used as the target injection condition.
可以理解的是,上述技术方案通过引入当前业务流量的业务类型、业务操作和协议类型等中的至少一种业务属性数据,作为选取依据,从至少一个候选注入条件中选取目标注入条件,使得所选取的目标注入条件能够与业务系统的当前业务流量相匹配,从而提高了所注入故障任务与业务系统的流量匹配性。It can be understood that the above technical solution introduces at least one business attribute data such as the business type, business operation and protocol type of the current business traffic as a selection basis, and selects a target injection condition from at least one candidate injection condition, so that the selected target injection condition can match the current business traffic of the business system, thereby improving the traffic matching between the injected fault task and the business system.
值得注意的是,不同业务系统对应的候选注入条件可以相同或不同,本申请对此不作任何限定。可选地,可以根据业务系统的系统类别,差异化设置候选注入条件。其中,不同系统类别所对应的候选注入条件可以由技术人员根据需要或经验进行设定或调整,或通过大量试验确定,本申请对此不作任何限定。It is worth noting that the candidate injection conditions corresponding to different business systems may be the same or different, and this application does not impose any limitation on this. Optionally, the candidate injection conditions may be set differently according to the system category of the business system. Among them, the candidate injection conditions corresponding to different system categories may be set or adjusted by technicians according to needs or experience, or determined through a large number of experiments, and this application does not impose any limitation on this.
S220,从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务。S220: Select a target fault task from at least one candidate fault task corresponding to the target injection condition.
示例性的,可以预先设置至少一个候选注入条件与至少一个候选故障任务之间的对应关系;在从至少一个候选注入条件中选取出目标注入条件的情况下,根据上述对应关系,确定目标注入条件所对应的至少一个候选故障任务,并从上述候选故障任务中,选取目标故障任务。Exemplarily, a correspondence between at least one candidate injection condition and at least one candidate fault task can be pre-set; when a target injection condition is selected from at least one candidate injection condition, at least one candidate fault task corresponding to the target injection condition is determined based on the above correspondence, and the target fault task is selected from the above candidate fault tasks.
其中,至少一个候选注入条件与至少一个候选故障任务之间的对应关系,可以由技术人员根据需要或经验进行设定,或通过大量试验确定,本申请对此不作任何限定。Among them, the corresponding relationship between at least one candidate injection condition and at least one candidate fault task can be set by technical personnel according to needs or experience, or determined through a large number of experiments, and this application does not impose any limitation on this.
需要说明的是,候选注入条件与候选故障任务可以是一对一关系、多对一关系、一对多关系或多对多关系等,本申请对此不作任何限定。It should be noted that the candidate injection conditions and the candidate fault tasks may be in a one-to-one relationship, a many-to-one relationship, a one-to-many relationship, or a many-to-many relationship, and this application does not impose any limitation on this.
在一个具体实现方式中,可以预先构建一个故障信息表,在该故障信息表中存储有不同候选注入条件与相应候选故障任务之间的对应关系。In a specific implementation, a fault information table may be pre-constructed, in which the corresponding relationships between different candidate injection conditions and corresponding candidate fault tasks are stored.
在一个可选实施例中,可以通过随机选取或轮询选取的方式,从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务。值得注意的是,不同情况下所选取的目标故障任务可以相同或至少部分不同,且所选取的目标故障任务对应的数量为至少一个,本申请对此不作任何限定。In an optional embodiment, the target fault task can be selected from at least one candidate fault task corresponding to the target injection condition by random selection or polling selection. It is worth noting that the target fault tasks selected in different situations can be the same or at least partially different, and the number of the selected target fault tasks is at least one, and this application does not impose any limitation on this.
在一个具体实现方式中,可以根据目标注入条件与各候选故障任务之间的匹配情况,从至少一个候选故障任务中,选取目标故障任务。示例性的,匹配情况可以通过语义相似度、条件与故障之间的关联程度等不同维度加以呈现,本申请对此不作任何限定。In a specific implementation, a target fault task can be selected from at least one candidate fault task according to the matching between the target injection condition and each candidate fault task. For example, the matching can be presented in different dimensions such as semantic similarity, the degree of association between the condition and the fault, and this application does not make any limitation on this.
需要说明的是,若未确定出目标注入条件,也即目标注入条件确定失败,或所确定的目标注入条件数量为0,则不再执行S220中的目标故障任务选取操作。举例说明,若当前业务流量为B类型业务,但预先设定的候选注入条件均为针对A类型业务的注入条件,则不会确定出与B类型业务相匹配的目标注入条件。It should be noted that if the target injection condition is not determined, that is, the target injection condition determination fails, or the number of determined target injection conditions is 0, the target fault task selection operation in S220 is no longer performed. For example, if the current service flow is type B service, but the pre-set candidate injection conditions are all injection conditions for type A service, then the target injection condition matching type B service will not be determined.
S230,向业务系统注入目标故障任务。S230, injecting a target fault task into the business system.
可选地,可以通过调用预设的故障注入程序,向业务系统中注入目标故障任务。其中,故障注入程序可以由技术人员根据需要或经验进行设置或调整,或通过大量试验反复确定,本申请对此不作任何限定。Optionally, a target fault task can be injected into the business system by calling a preset fault injection program, wherein the fault injection program can be set or adjusted by a technician according to needs or experience, or repeatedly determined through a large number of experiments, and this application does not impose any limitation on this.
或者可选地,向业务系统发送故障注入指令;业务系统响应于故障注入指令,在本系统中注入目标故障任务。Or optionally, a fault injection instruction is sent to the business system; the business system responds to the fault injection instruction and injects a target fault task into the system.
需要说明的是,若未选取出目标故障任务,也即选取出的目标故障任务为0,或目标故障任务选取失败,则不再执行S230的故障任务注入操作。It should be noted that if the target fault task is not selected, that is, the selected target fault task is 0, or the target fault task selection fails, the fault task injection operation of S230 is no longer performed.
本申请实施例通过确定与业务系统的当前业务流量相匹配的目标注入条件,使得目标注入条件能够与业务系统的当前业务流量相匹配,保证了后续所注入故障任务与当前业务流量的匹配度。进一步地,从目标注入条件所对应的至少一个候选故障任务中,选取后续注入业务系统的目标故障任务,替代直接将目标注入条件对应的故障任务注入到业务系统中,避免了向业务系统中进行目标注入条件下全量故障任务的机械注入,提高了在业务系统中进行故障任务注入的灵活性和多样性。另外,通过候选注入条件的灵活设置,能够根据候选注入条件的不同粒度,灵活可控地进行业务故障的注入,例如可以精细到针对某个应用或某一对IP地址之间流量的故障注入,进一步提高了在业务系统中进行故障任务注入的灵活性和可控性。The embodiment of the present application determines a target injection condition that matches the current business traffic of the business system, so that the target injection condition can match the current business traffic of the business system, thereby ensuring the matching degree of the fault task subsequently injected with the current business traffic. Furthermore, from at least one candidate fault task corresponding to the target injection condition, a target fault task subsequently injected into the business system is selected, instead of directly injecting the fault task corresponding to the target injection condition into the business system, thereby avoiding the mechanical injection of all fault tasks under the target injection condition into the business system, and improving the flexibility and diversity of fault task injection in the business system. In addition, through the flexible setting of the candidate injection conditions, the injection of business faults can be flexibly and controllably performed according to the different granularities of the candidate injection conditions, for example, it can be refined to the fault injection for a certain application or a certain pair of IP addresses. The flexibility and controllability of fault task injection in the business system is further improved.
在上述各实施例的技术方案的基础上,本申请还提供了一个可选实施例,在该可选实施例中,对目标故障任务的选取步骤进行了细化。Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment, in which the steps for selecting the target fault task are refined.
参见图3所示的目标故障任务的选取步骤,包括:Referring to FIG. 3 , the steps for selecting the target fault task include:
S310,根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,选取目标故障任务。S310 , selecting a target faulty task from at least one candidate faulty task according to a selection order of each candidate faulty task corresponding to a target injection condition.
其中,目标注入条件所对应的各候选故障任务的选取顺序,可以由技术人员根据需要或经验进行设定或调整,或通过大量试验进行设置,本申请对此不作任何限定。选取顺序可以通过生成包括至少一个候选故障任务的任务标识的序列,并通过序列中的元素排列顺序加以呈现。其中,序列中的至少两个任务标识可以相同或不同,本申请对此不作任何限定。The selection order of each candidate fault task corresponding to the target injection condition can be set or adjusted by the technician according to the needs or experience, or set through a large number of experiments, and this application does not impose any restrictions on this. The selection order can be generated by generating a sequence of task identifiers including at least one candidate fault task, and presented by the order of arrangement of elements in the sequence. At least two task identifiers in the sequence can be the same or different, and this application does not impose any restrictions on this.
在一个可选实施例中,还可以引入目标注入条件与自身所对应的各候选故障任务之间的关联程度,并根据该关联程度的大小情况,确定目标注入条件所对应的各候选故障任务的选取顺序。示例性的,可以将关联程度较大的候选故障任务的选取顺序设置的相对靠前,以及将关联程度较小的候选故障任务的选取顺序设置的相对靠后。其中,关联程度可以是定性描述数据或定量描述数据,本申请对此不作任何限定。In an optional embodiment, the degree of correlation between the target injection condition and each candidate fault task corresponding to the target injection condition can also be introduced, and the selection order of each candidate fault task corresponding to the target injection condition can be determined according to the magnitude of the correlation degree. Exemplarily, the selection order of the candidate fault tasks with a greater degree of correlation can be set relatively forward, and the selection order of the candidate fault tasks with a smaller degree of correlation can be set relatively backward. Among them, the degree of correlation can be qualitative description data or quantitative description data, and this application does not impose any limitation on this.
需要说明的是,当相同关联程度的候选故障任务为至少两个时,可以人为指定或随机设置上述至少两个候选故障任务之间的选取顺序。It should be noted that, when there are at least two candidate fault tasks with the same correlation degree, the selection order between the at least two candidate fault tasks may be manually specified or randomly set.
示例性的,可以确定各候选故障任务与目标注入条件之间的相关度数据;根据各候选故障任务的相关度数据,确定各候选故障任务的选取顺序。其中,相关度数据用于对候选故障任务与目标注入条件之间的关联程度进行定量描述。候选故障任务的相关度数据越高,表明该候选故障任务与目标注入条件之间的关联程度越大。Exemplarily, the correlation data between each candidate fault task and the target injection condition can be determined; and the selection order of each candidate fault task is determined according to the correlation data of each candidate fault task. The correlation data is used to quantitatively describe the degree of correlation between the candidate fault task and the target injection condition. The higher the correlation data of the candidate fault task, the greater the degree of correlation between the candidate fault task and the target injection condition.
值得注意的是,由于与目标注入条件关联程度较大的候选故障任务,在注入本申请中的业务系统或其他业务系统(例如相同业务类型的业务系统)的情况下,所引发故障的故障频次相对较多;与目标注入条件关联程度较小的候选故障任务,在注入本申请中的业务系统或其他业务系统的情况下,所引发故障的故障频次相对较少。因此,可以通过引入故障频次,来衡量候选故障任务与目标注入条件之间的相关度数据。It is worth noting that, since the candidate fault tasks with a greater degree of correlation with the target injection condition will cause a relatively high frequency of faults when injected into the business system in this application or other business systems (e.g., business systems of the same business type), the candidate fault tasks with a lesser degree of correlation with the target injection condition will cause a relatively low frequency of faults when injected into the business system in this application or other business systems. Therefore, the correlation data between the candidate fault tasks and the target injection condition can be measured by introducing the fault frequency.
可选地,可以获取各候选故障任务在目标注入条件下引发故障的历史故障频次;根据各候选故障任务对应的历史故障频次,确定相应候选故障任务与目标注入条件之间的相关度数据。Optionally, the historical fault frequency of each candidate fault task causing a fault under the target injection condition may be obtained; and the correlation data between the corresponding candidate fault task and the target injection condition may be determined according to the historical fault frequency corresponding to each candidate fault task.
上述可选实施例中,在基于对不同业务系统进行故障任务注入之后,可以根据所注入故障任务引发的故障次数进行统计,并适应性更新不同故障任务在相应注入条件下的故障频次。相应的,在进行相关度数据确定时,查找获取各候选故障任务在目标注入条件下引发故障的历史故障频次,并基于预设的相关度确定函数,根据每一候选故障任务在目标注入条件下的故障频次,确定相应候选故障任务与目标注入条件之间的相关度数据。其中,相关度确定函数是历史故障频次的单调函数。In the above optional embodiment, after faulty tasks are injected into different business systems, statistics can be collected based on the number of faults caused by the injected faulty tasks, and the fault frequencies of different faulty tasks under the corresponding injection conditions can be adaptively updated. Accordingly, when determining the correlation data, the historical fault frequencies of each candidate faulty task under the target injection conditions are searched and obtained, and based on the preset correlation determination function, the correlation data between the corresponding candidate faulty task and the target injection condition is determined based on the fault frequency of each candidate faulty task under the target injection condition. Among them, the correlation determination function is a monotonic function of the historical fault frequencies.
具体的,若相关度确定函数为单调递增函数,则历史故障频次越高,对应的相关度数据也越高,相应候选故障任务的选取顺序就越靠前;历史故障频次越低,对应的相关度数据也越低,相应候选故障任务的选取顺序就越靠后。若相关度确定函数为单调递减函数,则历史故障频次越高,对应的相关度数据越低,相应候选故障任务的选取顺序就越靠后;历史故障频次越低,对应的相关度数据也越高,相应候选故障任务的选取顺序就越靠前。通常情况下,为了便于理解,相关度确定函数会采用单调递增函数。Specifically, if the correlation determination function is a monotonically increasing function, the higher the historical fault frequency, the higher the corresponding correlation data, and the earlier the selection order of the corresponding candidate fault task; the lower the historical fault frequency, the lower the corresponding correlation data, and the later the selection order of the corresponding candidate fault task. If the correlation determination function is a monotonically decreasing function, the higher the historical fault frequency, the lower the corresponding correlation data, and the later the selection order of the corresponding candidate fault task; the lower the historical fault frequency, the higher the corresponding correlation data, and the earlier the selection order of the corresponding candidate fault task. Usually, for ease of understanding, the correlation determination function will use a monotonically increasing function.
可以理解的是,通过上述方式所确定的选取顺序中,最大次序与目标注入条件下的候选故障任务的总数量相同,也即,若目标注入条件下的候选故障任务包括任务a、任务b和任务c,且任务a、任务b和任务c与目标注入条件的相关度数据逐渐降低,那么,可以通过[a, b, c]这一选取顺序序列,表征任务a、任务b和任务c之间的选取顺序。It can be understood that, in the selection order determined by the above method, the maximum order is the same as the total number of candidate fault tasks under the target injection condition, that is, if the candidate fault tasks under the target injection condition include task a, task b and task c, and the correlation data of task a, task b and task c with the target injection condition gradually decreases, then the selection order sequence [a, b, c] can be used to characterize the selection order between task a, task b and task c.
采用上述方式所确定的选取顺序,最大选取顺序与候选故障任务的数量相对应。在一个可选实施例中,还可以通过相关度数据影响排序的候选故障任务的数量的方式,进行选取顺序的确定,从而提高相关度数据较高的候选故障任务在业务系统的注入概率,以及降低相关度数据较低的候选故障任务在业务系统的注入概率。The selection order determined by the above method has a maximum selection order corresponding to the number of candidate fault tasks. In an optional embodiment, the selection order can also be determined by the number of candidate fault tasks that are sorted by the influence of the correlation data, thereby increasing the probability of candidate fault tasks with higher correlation data being injected into the business system and reducing the probability of candidate fault tasks with lower correlation data being injected into the business system.
示例性的,可以根据每一候选故障任务的相关度数据,生成相应候选故障任务的任务标识;其中,候选故障任务的任务标识的数量,随着相应相关度数据单调递增;根据各候选故障任务的任务标识的数量,按照各候选故障任务的预设顺序进行排列,得到选取顺序。Exemplarily, a task identifier of the corresponding candidate fault task can be generated based on the relevance data of each candidate fault task; wherein the number of task identifiers of the candidate fault tasks increases monotonically with the corresponding relevance data; and according to the number of task identifiers of each candidate fault task, each candidate fault task is arranged in a preset order to obtain a selection order.
可选地,可以预先以相关度数据为自变量,以任务标识的数量为因变量,构建数量确定函数;相应的,针对每一候选故障任务,将该候选故障任务的相关度数据,输入至数量确定函数中,得到该候选故障任务的任务标识的数量;根据各候选故障任务的任务标识的数量,按照各候选故障任务的预设顺序进行排列,得到存在重复任务标识的各个候选故障任务的选取顺序。Optionally, a quantity determination function can be constructed in advance with relevance data as the independent variable and the number of task identifiers as the dependent variable; accordingly, for each candidate fault task, the relevance data of the candidate fault task is input into the quantity determination function to obtain the number of task identifiers of the candidate fault task; according to the number of task identifiers of each candidate fault task, the candidate fault tasks are arranged in a preset order to obtain the selection order of each candidate fault task with repeated task identifiers.
举例说明,若目标注入条件下的候选故障任务包括顺序排列的任务a、任务b和任务c,且任务a、任务b和任务c与目标注入条件的相关度数据对应的任务标识的数量分别为1、2和4,则可以通过[a, b, b, c, c, c, c]这一选取顺序序列,表征任务a、任务b和任务c之间的选取顺序。For example, if the candidate fault tasks under the target injection condition include tasks a, b, and c arranged in sequence, and the numbers of task identifiers corresponding to the correlation data of tasks a, b, and c and the target injection condition are 1, 2, and 4 respectively, then the selection order between tasks a, b, c, c, c, c can be represented by the selection order sequence [a, b, b, c, c, c, c].
需要说明的是,进行选取顺序确定的执行设备,与本申请中执行故障任务注入方法的执行设备,两者可以相同或不同,本申请对此不作任何限定。It should be noted that the execution device for determining the selection order and the execution device for executing the fault task injection method in this application may be the same as or different, and this application does not impose any limitation on this.
可以理解的是,通过引入历史故障频次进行相关度数据的确定,使得相关度数据确定过程更加方便快捷,数据运算量小。并且,历史故障频次能够相对直观的反映出候选故障任务与目标注入条件之间的关联程度,从而提高了相关度数据确定结果的准确度,进而提高了选取顺序确定结果的合理性和准确性。It can be understood that by introducing the historical fault frequency to determine the correlation data, the correlation data determination process is more convenient and quick, and the amount of data calculation is small. In addition, the historical fault frequency can relatively intuitively reflect the degree of association between the candidate fault task and the target injection condition, thereby improving the accuracy of the correlation data determination result, and then improving the rationality and accuracy of the selection order determination result.
在一个可选实施例中,可以根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,轮询选取目标故障任务。这样做的好处在于,选取过程操作方便快捷,且能够在对业务系统的整个故障任务注入周期中,相对均匀的进行不同故障任务的注入,保证了故障任务注入的全面性。In an optional embodiment, the target fault task can be selected from at least one candidate fault task by polling according to the selection order of each candidate fault task corresponding to the target injection condition. The advantage of this is that the selection process is convenient and fast, and different fault tasks can be injected relatively evenly during the entire fault task injection cycle of the business system, ensuring the comprehensiveness of the fault task injection.
在另一可选实施例中,可以根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,随机选取目标故障任务。In another optional embodiment, the target fault task may be randomly selected from at least one candidate fault task according to the selection order of the candidate fault tasks corresponding to the target injection condition.
可选地,可以根据至少一个候选故障任务的任务数量,生成选取随机数,并根据选取顺序,将选取次序与选取随机数相同的候选故障任务,作为目标故障任务。Optionally, a selection random number may be generated according to the task quantity of at least one candidate faulty task, and according to the selection order, the candidate faulty tasks having the same selection order as the selection random number may be used as target faulty tasks.
或者可选地,可以根据前述选取顺序中所包含任务标识的数量,生成选取随机数;将目标任务标识对应的候选故障任务,作为目标故障任务;其中,目标任务标识为选取顺序下排列次序与选取随机数相同的任务标识。Or optionally, a selection random number can be generated according to the number of task identifiers included in the aforementioned selection order; the candidate fault task corresponding to the target task identifier is used as the target fault task; wherein the target task identifier is a task identifier whose arrangement order in the selection order is the same as the selection random number.
在一个具体示例中,若选取顺序对应包含不同候选故障任务的任务标识的任务序列的元素顺序,则可以将任务序列中的元素数量,作为选取顺序中所包含任务标识的数量。In a specific example, if the selection order corresponds to the order of elements of a task sequence containing task identifiers of different candidate fault tasks, the number of elements in the task sequence may be used as the number of task identifiers contained in the selection order.
可选地,可以将任务数量或任务标识的数量,作为选取随机数的生成上限;将默认数值,例如0,作为选取随机数的生成下限;在生成上限与生成下限之间,随机选取任一整数,作为选取随机数。Optionally, the number of tasks or the number of task identifiers can be used as the upper limit of the random number generation; the default value, such as 0, can be used as the lower limit of the random number generation; and any integer between the upper limit and the lower limit can be randomly selected as the random number.
上述技术方案通过引入选取随机数进行目标故障任务的选取,选取过程操作方便快捷,且能够在确定目标故障任务过程中引入一定的随机性,从而提高了故障任务注入的灵活性和多样性。The above technical solution introduces the selection of random numbers to select the target fault task. The selection process is convenient and quick to operate, and a certain degree of randomness can be introduced in the process of determining the target fault task, thereby improving the flexibility and diversity of fault task injection.
本申请实施例通过引入目标注入条件所对应的各候选故障任务的选取顺序,有序从至少一个候选故障任务中选取目标故障任务,从而在进行目标故障任务选取过程中,保证了不同候选故障任务被选取为目标故障任务的可控性,便于进行故障任务注入过程的管理和维护,同时保证了所选取目标故障任务的全面性和灵活性。The embodiment of the present application introduces the selection order of each candidate fault task corresponding to the target injection condition, and selects the target fault task from at least one candidate fault task in an orderly manner, thereby ensuring the controllability of different candidate fault tasks being selected as target fault tasks during the target fault task selection process, facilitating the management and maintenance of the fault task injection process, and ensuring the comprehensiveness and flexibility of the selected target fault tasks.
在上述各实施例的技术方案的基础上,本申请还提供了一个可选实施例,在该可选实施例中,在选取目标故障任务之后,还引入了对目标故障任务的更新机制,以丰富目标故障任务的多样性。Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, after selecting the target fault task, an update mechanism for the target fault task is introduced to enrich the diversity of the target fault task.
参见图4所示的目标故障任务的更新步骤,包括:Referring to FIG. 4 , the updating steps of the target fault task include:
S410,根据与目标故障任务具备绑定关系的候选故障任务,更新目标故障任务。S410: Update the target fault task according to the candidate fault tasks that have a binding relationship with the target fault task.
其中,绑定关系可以是兼容关系或互斥关系。其中,存在兼容关系的候选故障任务可以在同一业务系统中同时存在;存在互斥关系的候选故障任务禁止在同一业务系统中同时存在。其中,绑定关系可以由技术人员根据需要或经验值进行设置或调整,或通过大量试验确定,本申请对此不作任何限定。The binding relationship may be a compatible relationship or a mutually exclusive relationship. Candidate fault tasks with a compatible relationship may exist simultaneously in the same business system; candidate fault tasks with a mutually exclusive relationship are prohibited from existing simultaneously in the same business system. The binding relationship may be set or adjusted by a technician according to needs or experience, or determined through a large number of tests, and this application does not impose any limitation on this.
示例性的,若绑定关系为兼容关系,则可以将与目标故障任务具备绑定关系的候选故障任务,添加至已有的目标故障任务中,以更新目标故障任务;若绑定关系为互斥关系,则可以将与任一目标故障任务具备绑定关系其他目标故障任务,从已有的目标故障任务中进行剔除。需要说明的是,将存在互斥关系的目标故障任务中的哪个或哪些进行剔除,或者将存在互斥关系的目标故障任务中的哪一目标故障任务进行保留,可以随机确定或轮询确定,本申请对此不作任何限定。Exemplarily, if the binding relationship is a compatible relationship, the candidate fault tasks that have a binding relationship with the target fault task can be added to the existing target fault tasks to update the target fault tasks; if the binding relationship is a mutually exclusive relationship, other target fault tasks that have a binding relationship with any target fault task can be removed from the existing target fault tasks. It should be noted that which one or more of the target fault tasks with a mutually exclusive relationship are to be removed, or which one of the target fault tasks with a mutually exclusive relationship is to be retained, can be determined randomly or by polling, and this application does not impose any limitation on this.
可以理解的是,为了提高绑定关系确定过程的便捷性和确定效率,同时降低人为主观因素带来的干扰,在一个可选实施例中,还可以基于不同候选故障任务之间的关联情况,在不同候选故障任务之间自动建立绑定关系。It is understandable that in order to improve the convenience and efficiency of the binding relationship determination process and reduce the interference caused by human subjective factors, in an optional embodiment, a binding relationship can be automatically established between different candidate fault tasks based on the association between different candidate fault tasks.
示例性的,可以对至少一个候选故障任务进行分类;建立类别相同的至少两个候选故障任务之间的绑定关系。这样做的好处在于,提高了绑定关系建立的便捷性和建立效率,同时减少了人为主观因素的影响,提高了绑定关系建立结果的准确度。Exemplarily, at least one candidate fault task may be classified; and a binding relationship may be established between at least two candidate fault tasks of the same category. The advantage of this is that the convenience and efficiency of establishing the binding relationship are improved, while the influence of human subjective factors is reduced, and the accuracy of the binding relationship establishment result is improved.
其中,可以采用传统的至少一种分类方式对至少一个候选故障任务进行分类处理,本申请对此不作任何限定。Among them, at least one traditional classification method can be used to classify at least one candidate fault task, and this application does not impose any limitation on this.
在一个具体实现方式中,可以获取至少一个候选故障任务的任务属性数据;对各任务属性数据进行特征编码,得到任务属性特征;基于预设分类算法,根据各候选故障任务的任务属性特征,对各候选故障任务进行分类。其中,特征编码方式可以采用传统的至少一种编码方式加以实现,本申请对此不作任何限定,例如独热编码等;预设分类算法可以是K-means(K均值)算法。In a specific implementation, task attribute data of at least one candidate fault task can be obtained; feature encoding is performed on each task attribute data to obtain task attribute features; and based on a preset classification algorithm, each candidate fault task is classified according to the task attribute features of each candidate fault task. Among them, the feature encoding method can be implemented using at least one traditional encoding method, which is not limited in this application, such as one-hot encoding, etc.; the preset classification algorithm can be a K-means algorithm.
其中,任务属性数据可以包括相关度数据、故障类别、影响程度数据、恢复能力数据和持续时间数据等中的至少一种。其中,相关度数据可以参见前述实施例的相关表述,在此不再赘述。其中,故障类别可以包括网络类别、服务器硬件类别、服务器软件类别和故障操作类别等中的至少一种,本申请对此不作任何限定。其中,影响程度数据用于表征该候选故障任务对业务系统的影响大小,可以基于业务影响范围、业务影响时间和设备影响占比等中的至少一种加以确定。例如,影响程度数据可以包括无影响、轻微影响、中等影响、严重影响和服务不可用等中的至少一种。其中,恢复能力数据用于表征该候选故障任务的恢复难度,可以基于恢复时间(Recovery Time Objective,RTO)确定。持续时间数据用于表征该候选故障任务的持续时长,可以基于故障持续时间(Recovery Point Objective,RPO)或持续类型加以确定。其中,持续类型可以包括持续、瞬时和间隙等中的至少一种。其中,持续类型可以由技术人员根据需要或经验进行设置或调整,或通过预设分类算法加以实现,本申请对此不作任何限定。The task attribute data may include at least one of relevance data, fault category, impact data, recovery capability data and duration data. For the relevance data, please refer to the relevant description of the above-mentioned embodiment, which will not be repeated here. The fault category may include at least one of network category, server hardware category, server software category and fault operation category, etc., and the present application does not make any limitation on this. The impact data is used to characterize the impact of the candidate fault task on the business system, which can be determined based on at least one of the business impact scope, business impact time and equipment impact ratio. For example, the impact data may include at least one of no impact, slight impact, medium impact, severe impact and service unavailability. The recovery capability data is used to characterize the recovery difficulty of the candidate fault task, which can be determined based on the recovery time (Recovery Time Objective, RTO). The duration data is used to characterize the duration of the candidate fault task, which can be determined based on the fault duration (Recovery Point Objective, RPO) or the duration type. The duration type may include at least one of continuous, instantaneous and intermittent. The duration type may be set or adjusted by the technician according to the needs or experience, or implemented by a preset classification algorithm, and the present application does not make any limitation on this.
具体的,从至少一个候选故障任务中,随机选取K个作为聚类簇的中心点的中心点任务;针对至少一个候选故障任务中的每一非中心点任务,确定该非中心点任务的任务属性特征,与各中心点任务的任务属性特征之间的差异数据;将该非中心点任务,添加至差异数据最小值对应的中心点任务所在聚类簇中。在全部非中心点任务聚类完毕后,重新确定各聚类簇的中心点,作为新的中心点任务,并重新确定至少一个候选故障任务中的非中心点任务;返回执行针对每一非中心点任务的差异数据确定步骤,直至满足聚类终止条件;将相同聚类簇中的各候选故障任务划分为相同类别;将不同聚类簇中的各候选故障任务划分为不同类别。其中,K为大于1的正数;差异数据可以是空间距离,例如可以是欧式距离,本申请对此不作任何限定。Specifically, from at least one candidate fault task, randomly select K center point tasks as the center points of the clustering clusters; for each non-center point task in at least one candidate fault task, determine the task attribute characteristics of the non-center point task and the difference data between the task attribute characteristics of each center point task; add the non-center point task to the clustering cluster where the center point task corresponding to the minimum value of the difference data is located. After all non-center point tasks are clustered, redetermine the center point of each clustering cluster as a new center point task, and redetermine the non-center point task in at least one candidate fault task; return to execute the difference data determination step for each non-center point task until the clustering termination condition is met; divide each candidate fault task in the same clustering cluster into the same category; divide each candidate fault task in different clustering clusters into different categories. Wherein, K is a positive number greater than 1; the difference data can be a spatial distance, for example, it can be a Euclidean distance, and this application does not impose any limitation on this.
可选地,针对相同类别的候选故障任务,建立各候选故障任务之间的兼容关系。Optionally, for candidate fault tasks of the same category, a compatibility relationship is established between the candidate fault tasks.
或者可选地,针对不同类别的候选故障任务,若所属聚类簇中存在无法在同一业务系统中同时存在的候选故障任务,则建立不同聚类簇中各候选故障任务之间的互斥关系。Or optionally, for different categories of candidate faulty tasks, if there are candidate faulty tasks in the corresponding clusters that cannot exist simultaneously in the same service system, a mutually exclusive relationship is established between the candidate faulty tasks in different clusters.
本申请实施例通过引入绑定关系,对目标故障任务进行更新,作为所选取目标故障任务的补充或二次筛选,保证了目标故障任务的准确性和合理性,从而提高了对业务系统的混沌工程的合理性和普适性。The embodiment of the present application introduces a binding relationship to update the target fault task as a supplement or secondary screening of the selected target fault task, thereby ensuring the accuracy and rationality of the target fault task, thereby improving the rationality and universality of chaos engineering for the business system.
在上述各实施例的技术方案的基础上,本申请还提供了一个可选实施例,在该可选实施例中,在图1所示的应用场景的基础上,对故障任务注入过程进行了详细说明。On the basis of the technical solutions of the above-mentioned embodiments, the present application also provides an optional embodiment. In this optional embodiment, based on the application scenario shown in FIG. 1 , the fault task injection process is described in detail.
参见图5所示的故障任务注入方法,包括:Referring to the fault task injection method shown in FIG5 , the method includes:
S510,DPI系统对业务系统的当前业务流程进行解析,得到业务属性数据。S510, the DPI system analyzes the current business process of the business system to obtain business attribute data.
其中,业务属性数据包括业务类型、业务操作和协议类型等中的至少一种。The service attribute data includes at least one of service type, service operation and protocol type.
S520,DPI系统将业务属性数据发送至控制端。S520, the DPI system sends the service attribute data to the control end.
S530,控制端从预先建立的故障信息表中,查找与业务属性数据相匹配的候选注入条件,作为目标注入条件。S530, the control end searches for a candidate injection condition that matches the service attribute data from a pre-established fault information table as a target injection condition.
其中,故障信息表可以参见下表所示:The fault information table can be found in the following table:
需要说明的是,上述故障信息表中不同任务属性数据对应的数值,可以采用前述实施例的确定方式计算得到,在本实施例中不再赘述。其中,x、y均为预设数值,可以由技术人员根据需要或经验值进行设置或调整,或通过大量试验反复确定,本申请对此不作任何限定。It should be noted that the values corresponding to the different task attribute data in the above fault information table can be calculated using the determination method of the above embodiment, which will not be repeated in this embodiment. Among them, x and y are both preset values, which can be set or adjusted by technicians according to needs or experience, or repeatedly determined through a large number of experiments, and this application does not make any limitation on this.
S540,控制端从目标注入条件对应的各候选故障任务中,选取目标故障任务。S540, the control end selects a target fault task from the candidate fault tasks corresponding to the target injection condition.
在一个可选实施例中,可以按照预设顺序,轮流在目标注入条件对应的各候选故障任务中,选取预设数量的目标故障任务。其中,预设数量可以由技术人员根据需要或经验进行设定或调整,或通过大量试验确定,本申请对此不作任何限定。In an optional embodiment, a preset number of target fault tasks may be selected from the candidate fault tasks corresponding to the target injection condition in turn according to a preset order. The preset number may be set or adjusted by a technician according to needs or experience, or determined through a large number of experiments, and this application does not impose any limitation on this.
在另一可选实施例中,可以获取目标注入条件对应的各候选故障任务与目标注入条件之间的相关度数据;基于以相关度数据为自变量,以任务标识的数量为因变量,单调递增的数量确定函数,将每一候选故障任务的相关度数据分别作为输入数据,确定相应候选故障任务的任务标识的数量;按照各候选故障任务的预设顺序,将各候选故障任务的任务标识进行排列,得到各候选故障任务的选取顺序;按照前述选取顺序,轮流在目标注入条件对应的各候选故障任务中,选取预设数量的目标故障任务。In another optional embodiment, the correlation data between each candidate fault task corresponding to the target injection condition and the target injection condition can be obtained; based on a monotonically increasing quantity determination function with the correlation data as the independent variable and the number of task identifiers as the dependent variable, the correlation data of each candidate fault task is used as input data to determine the number of task identifiers of the corresponding candidate fault tasks; the task identifiers of each candidate fault task are arranged according to a preset order of each candidate fault task to obtain a selection order of each candidate fault task; and a preset number of target fault tasks are selected in turn from each candidate fault task corresponding to the target injection condition according to the aforementioned selection order.
举例说明,若目标注入条件下的候选故障任务包括顺序排列的任务a、任务b和任务c。其中,任务a与目标注入条件的相关度数据为1,任务b与目标注入条件的相关度数据为2,任务c与目标注入条件的相关度数据为4,也即a_weight=1,b_weight=2,c_weight=4,则构建以下选取顺序序列[a, b, b, c, c, c, c]。相应的,按照选取顺序序列中的排列顺序,轮流进行目标故障任务的选取。For example, if the candidate fault tasks under the target injection condition include sequentially arranged tasks a, b, and c. Among them, the correlation data between task a and the target injection condition is 1, the correlation data between task b and the target injection condition is 2, and the correlation data between task c and the target injection condition is 4, that is, a_weight=1, b_weight=2, c_weight=4, then the following selection order sequence [a, b, b, c, c, c, c] is constructed. Accordingly, the target fault tasks are selected in turn according to the arrangement order in the selection order sequence.
在又一可选实施例中,可以通过随机函数,生成0~N之间的任一整数作为选取随机数,其中,N为目标注入条件对应的各候选故障任务的任务数量;按照预设顺序,将排列次序为选取随机数的候选故障任务,作为目标故障任务。In another optional embodiment, a random function can be used to generate any integer between 0 and N as a selected random number, where N is the number of tasks of each candidate fault task corresponding to the target injection condition; and in a preset order, the candidate fault tasks arranged in the order of the selected random number are used as target fault tasks.
在再一可选实施例中,可以获取目标注入条件对应的各候选故障任务与目标注入条件之间的相关度数据;基于以相关度数据为自变量,以任务标识的数量为因变量,单调递增的数量确定函数,将每一候选故障任务的相关度数据分别作为输入数据,确定相应候选故障任务的任务标识的数量;按照各候选故障任务的预设顺序,将各候选故障任务的任务标识进行排列,得到各候选故障任务的选取顺序;按照前序选取顺序,将排列次序为选取随机数的候选故障任务,作为目标故障任务。In another optional embodiment, the correlation data between each candidate fault task corresponding to the target injection condition and the target injection condition can be obtained; based on a monotonically increasing quantity determination function with the correlation data as the independent variable and the number of task identifiers as the dependent variable, the correlation data of each candidate fault task is used as input data to determine the number of task identifiers of the corresponding candidate fault tasks; the task identifiers of each candidate fault task are arranged according to the preset order of each candidate fault task to obtain the selection order of each candidate fault task; according to the pre-order selection order, the candidate fault task whose arrangement order is a selected random number is used as the target fault task.
举例说明,若目标注入条件下的候选故障任务包括顺序排列的任务a、任务b和任务c。其中,任务a与目标注入条件的相关度数据为1,任务b与目标注入条件的相关度数据为2,任务c与目标注入条件的相关度数据为4,也即a_weight=1,b_weight=2,c_weight=4,则构建以下选取顺序序列[a, b, b, c, c, c, c]。相应的,生成小于7的整数随机数,并将该随机数作为索引,从选取顺序序列中选取相应索引下的目标故障任务。For example, if the candidate fault tasks under the target injection condition include sequentially arranged tasks a, b, and c. Among them, the correlation data between task a and the target injection condition is 1, the correlation data between task b and the target injection condition is 2, and the correlation data between task c and the target injection condition is 4, that is, a_weight=1, b_weight=2, c_weight=4, then the following selection order sequence [a, b, b, c, c, c, c] is constructed. Accordingly, an integer random number less than 7 is generated, and the random number is used as an index to select the target fault task under the corresponding index from the selection order sequence.
S550,控制端将故障信息表中,与目标故障任务具备绑定关系的候选故障任务,添加至目标故障任务中。S550, the control end adds the candidate fault tasks in the fault information table that have a binding relationship with the target fault task to the target fault task.
S560,控制端调用故障注入程序,以将目标故障任务注入至业务系统中。S560, the control end calls the fault injection program to inject the target fault task into the business system.
应该理解的是,虽然如上的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的故障任务注入方法的故障任务注入装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个故障任务注入装置实施例中的具体限定可以参见上文中对于故障任务注入方法的限定,在此不再赘述。Based on the same inventive concept, the embodiment of the present application also provides a fault task injection device for implementing the fault task injection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more fault task injection device embodiments provided below can refer to the limitations of the fault task injection method above, and will not be repeated here.
在一个实施例中,如图6所示,提供了一种故障任务注入装置,包括:第一确定模块610、选取模块620和注入模块630。其中,In one embodiment, as shown in FIG6 , a fault task injection device is provided, including: a first determination module 610, a selection module 620 and an injection module 630.
第一确定模块610,用于确定与业务系统的当前业务流量相匹配的目标注入条件;A first determination module 610 is used to determine a target injection condition that matches the current service flow of the service system;
选取模块620,用于从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;A selection module 620, configured to select a target fault task from at least one candidate fault task corresponding to the target injection condition;
注入模块630,用于向业务系统注入目标故障任务。The injection module 630 is used to inject a target fault task into the business system.
在其中一个实施例中,选取模块620,具体用于:根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,选取目标故障任务。In one embodiment, the selection module 620 is specifically configured to select a target fault task from at least one candidate fault task according to a selection order of each candidate fault task corresponding to the target injection condition.
在其中一个实施例中,选取模块620,包括:轮询选取单元,用于根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,轮询选取目标故障任务;随机选取单元,用于根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,随机选取目标故障任务。In one embodiment, the selection module 620 includes: a polling selection unit, which is used to poll and select a target fault task from at least one candidate fault task according to the selection order of each candidate fault task corresponding to the target injection condition; and a random selection unit, which is used to randomly select a target fault task from at least one candidate fault task according to the selection order of each candidate fault task corresponding to the target injection condition.
在其中一个实施例中,该装置还包括:第二确定模块,用于确定各候选故障任务与目标注入条件之间的相关度数据;第三确定模块,用于根据各候选故障任务的相关度数据,确定各候选故障任务的选取顺序。In one of the embodiments, the device further includes: a second determination module for determining correlation data between each candidate fault task and the target injection condition; and a third determination module for determining a selection order of each candidate fault task based on the correlation data of each candidate fault task.
在其中一个实施例中,第三确定模块,包括:第一生成单元,用于根据每一候选故障任务的相关度数据,生成相应候选故障任务的任务标识;其中,候选故障任务的任务标识的数量,随着相应相关度数据单调递增;排列单元,用于根据各候选故障任务的任务标识的数量,按照各候选故障任务的预设顺序进行排列,得到选取顺序。In one embodiment, the third determination module includes: a first generation unit, used to generate a task identifier of the corresponding candidate fault task based on the relevance data of each candidate fault task; wherein the number of task identifiers of the candidate fault tasks increases monotonically with the corresponding relevance data; and an arrangement unit, used to arrange the candidate fault tasks in a preset order according to the number of task identifiers of each candidate fault task to obtain a selection order.
在其中一个实施例中,随机选取单元,包括:第二生成单元,用于根据选取顺序中所包含任务标识的数量,生成选取随机数;第一确定单元,用于将目标任务标识对应的候选故障任务,作为目标故障任务;其中,目标任务标识为选取顺序下排列次序与选取随机数相同的任务标识。In one embodiment, the random selection unit includes: a second generation unit, used to generate a selection random number according to the number of task identifiers included in the selection order; a first determination unit, used to use the candidate fault task corresponding to the target task identifier as the target fault task; wherein the target task identifier is a task identifier whose arrangement order in the selection order is the same as the selection random number.
在其中一个实施例中,第二确定模块,包括:第二获取单元,用于获取各候选故障任务在目标注入条件下引发故障的历史故障频次;第二确定单元,用于根据各候选故障任务对应的历史故障频次,确定相应候选故障任务与目标注入条件之间的相关度数据。In one of the embodiments, the second determination module includes: a second acquisition unit, used to obtain the historical failure frequency of each candidate failure task causing failure under the target injection condition; a second determination unit, used to determine the correlation data between the corresponding candidate failure task and the target injection condition based on the historical failure frequency corresponding to each candidate failure task.
在其中一个实施例中,该装置还包括更新模块,用于在从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务之后,根据与目标故障任务具备绑定关系的候选故障任务,更新目标故障任务。In one of the embodiments, the device further includes an updating module for updating the target fault task according to the candidate fault tasks having a binding relationship with the target fault task after selecting the target fault task from at least one candidate fault task corresponding to the target injection condition.
在其中一个实施例中,该装置还包括分类模块,用于对至少一个候选故障任务进行分类;建立模块,用于建立类别相同的至少两个候选故障任务之间的绑定关系。In one of the embodiments, the device further includes a classification module for classifying at least one candidate fault task; and an establishment module for establishing a binding relationship between at least two candidate fault tasks of the same category.
在其中一个实施例中,第一确定模块,包括:第二获取单元,用于获取业务系统的当前业务流量的业务属性数据;条件选取单元,用于从至少一个候选注入条件中,选取与业务属性数据相匹配的目标注入条件;其中,业务属性数据包括业务类型、业务操作和协议类型中的至少一种。In one of the embodiments, the first determination module includes: a second acquisition unit, used to obtain business attribute data of the current business traffic of the business system; a condition selection unit, used to select a target injection condition that matches the business attribute data from at least one candidate injection condition; wherein the business attribute data includes at least one of a business type, a business operation and a protocol type.
上述故障任务注入装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于通信设备中的处理器中,也可以以软件形式存储于通信设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned fault task injection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the communication device in the form of hardware, or can be stored in the memory in the communication device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
在一个实施例中,提供了一种通信设备,该通信设备可以是服务器,其内部结构图可以如图7所示。该通信设备包括通过系统总线连接的处理器、存储器、网络接口和收发器。其中,该通信设备的处理器用于提供计算和控制能力。该通信设备的存储器包括非易失性存储介质和内存储器。该通信设备的收发器用于在处理器的控制下执行接收数据或发送数据的操作。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该通信设备的数据库用于存储上行短信和下行短信等数据。该通信设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种故障任务注入方法。In one embodiment, a communication device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The communication device includes a processor, a memory, a network interface, and a transceiver connected via a system bus. Among them, the processor of the communication device is used to provide computing and control capabilities. The memory of the communication device includes a non-volatile storage medium and an internal memory. The transceiver of the communication device is used to perform operations of receiving data or sending data under the control of the processor. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the communication device is used to store data such as uplink text messages and downlink text messages. The network interface of the communication device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a fault task injection method is implemented.
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的通信设备的限定,具体的通信设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the communication device to which the scheme of the present application is applied. The specific communication device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种通信设备,包括存储器和处理器,存储器中存储有计算机程序该处理器执行计算机程序中的处理逻辑时实现以下步骤:In one embodiment, a communication device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the processing logic in the computer program, the following steps are implemented:
确定与业务系统的当前业务流量相匹配的目标注入条件;Determine the target injection conditions that match the current business traffic of the business system;
从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;Selecting a target fault task from at least one candidate fault task corresponding to the target injection condition;
向业务系统注入目标故障任务。Inject target fault tasks into the business system.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,选取目标故障任务。In one embodiment, when the processor executes the processing logic in the computer program, the processor further implements the following steps: selecting a target fault task from at least one candidate fault task according to the selection order of each candidate fault task corresponding to the target injection condition.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,轮询选取目标故障任务;或者,根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,随机选取目标故障任务。In one embodiment, when the processor executes the processing logic in the computer program, the following steps are also implemented: according to the selection order of each candidate fault task corresponding to the target injection condition, the target fault task is selected from at least one candidate fault task by polling; or, according to the selection order of each candidate fault task corresponding to the target injection condition, the target fault task is randomly selected from at least one candidate fault task.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:确定各候选故障任务与目标注入条件之间的相关度数据;根据各候选故障任务的相关度数据,确定各候选故障任务的选取顺序。In one embodiment, when the processor executes the processing logic in the computer program, the following steps are also implemented: determining the correlation data between each candidate fault task and the target injection condition; and determining the selection order of each candidate fault task according to the correlation data of each candidate fault task.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:根据每一候选故障任务的相关度数据,生成相应候选故障任务的任务标识;其中,候选故障任务的任务标识的数量,随着相应相关度数据单调递增;根据各候选故障任务的任务标识的数量,按照各候选故障任务的预设顺序进行排列,得到选取顺序。In one embodiment, when the processor executes the processing logic in the computer program, the following steps are also implemented: based on the relevance data of each candidate fault task, a task identifier of the corresponding candidate fault task is generated; wherein the number of task identifiers of the candidate fault tasks increases monotonically with the corresponding relevance data; and based on the number of task identifiers of each candidate fault task, the candidate fault tasks are arranged in a preset order to obtain a selection order.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:根据选取顺序中所包含任务标识的数量,生成选取随机数;将目标任务标识对应的候选故障任务,作为目标故障任务;其中,目标任务标识为选取顺序下排列次序与选取随机数相同的任务标识。In one embodiment, when the processor executes the processing logic in the computer program, it also implements the following steps: generating a selection random number based on the number of task identifiers included in the selection order; taking the candidate fault task corresponding to the target task identifier as the target fault task; wherein the target task identifier is a task identifier whose arrangement order in the selection order is the same as the selection random number.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:获取各候选故障任务在目标注入条件下引发故障的历史故障频次;根据各候选故障任务对应的历史故障频次,确定相应候选故障任务与目标注入条件之间的相关度数据。In one embodiment, when the processor executes the processing logic in the computer program, the following steps are also implemented: obtaining the historical failure frequency of each candidate failure task causing failure under the target injection condition; and determining the correlation data between the corresponding candidate failure task and the target injection condition based on the historical failure frequency corresponding to each candidate failure task.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:根据与目标故障任务具备绑定关系的候选故障任务,更新目标故障任务。In one embodiment, when the processor executes the processing logic in the computer program, the processor further implements the following steps: updating the target fault task according to the candidate fault tasks that have a binding relationship with the target fault task.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:对至少一个候选故障任务进行分类;建立类别相同的至少两个候选故障任务之间的绑定关系。In one embodiment, when the processor executes the processing logic in the computer program, the processor further implements the following steps: classifying at least one candidate fault task; and establishing a binding relationship between at least two candidate fault tasks of the same category.
在一个实施例中,处理器执行计算机程序中的处理逻辑时还实现以下步骤:获取业务系统的当前业务流量的业务属性数据;从至少一个候选注入条件中,选取与业务属性数据相匹配的目标注入条件;其中,业务属性数据包括业务类型、业务操作和协议类型中的至少一种。In one embodiment, when the processor executes the processing logic in the computer program, it also implements the following steps: obtaining business attribute data of the current business traffic of the business system; selecting a target injection condition that matches the business attribute data from at least one candidate injection condition; wherein the business attribute data includes at least one of a business type, a business operation, and a protocol type.
在一个实施例中,提供了一种计算机可读存储介质或计算机程序产品,其上存储有计算机程序,计算机程序中的处理逻辑被处理器执行时实现以下步骤:In one embodiment, a computer readable storage medium or a computer program product is provided, on which a computer program is stored, and when the processing logic in the computer program is executed by a processor, the following steps are implemented:
确定与业务系统的当前业务流量相匹配的目标注入条件;Determine the target injection conditions that match the current business traffic of the business system;
从目标注入条件所对应的至少一个候选故障任务中,选取目标故障任务;Selecting a target fault task from at least one candidate fault task corresponding to the target injection condition;
向业务系统注入目标故障任务。Inject target fault tasks into the business system.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,选取目标故障任务。In one embodiment, when the processing logic in the computer program is executed by the processor, the following steps are further implemented: selecting a target fault task from at least one candidate fault task according to the selection order of each candidate fault task corresponding to the target injection condition.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,轮询选取目标故障任务;或者,根据目标注入条件所对应的各候选故障任务的选取顺序,从至少一个候选故障任务中,随机选取目标故障任务。In one embodiment, when the processing logic in the computer program is executed by the processor, the following steps are also implemented: according to the selection order of each candidate fault task corresponding to the target injection condition, polling and selecting the target fault task from at least one candidate fault task; or, according to the selection order of each candidate fault task corresponding to the target injection condition, randomly selecting the target fault task from at least one candidate fault task.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:确定各候选故障任务与目标注入条件之间的相关度数据;根据各候选故障任务的相关度数据,确定各候选故障任务的选取顺序。In one embodiment, when the processing logic in the computer program is executed by the processor, the following steps are also implemented: determining the correlation data between each candidate fault task and the target injection condition; and determining the selection order of each candidate fault task based on the correlation data of each candidate fault task.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:根据每一候选故障任务的相关度数据,生成相应候选故障任务的任务标识;其中,候选故障任务的任务标识的数量,随着相应相关度数据单调递增;根据各候选故障任务的任务标识的数量,按照各候选故障任务的预设顺序进行排列,得到选取顺序。In one embodiment, the processing logic in the computer program also implements the following steps when executed by the processor: generating a task identifier of the corresponding candidate fault task based on the relevance data of each candidate fault task; wherein the number of task identifiers of the candidate fault tasks increases monotonically with the corresponding relevance data; and arranging the candidate fault tasks in a preset order based on the number of task identifiers of each candidate fault task to obtain a selection order.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:根据选取顺序中所包含任务标识的数量,生成选取随机数;将目标任务标识对应的候选故障任务,作为目标故障任务;其中,目标任务标识为选取顺序下排列次序与选取随机数相同的任务标识。In one embodiment, the processing logic in the computer program also implements the following steps when executed by the processor: generating a selection random number based on the number of task identifiers included in the selection order; taking the candidate fault task corresponding to the target task identifier as the target fault task; wherein the target task identifier is a task identifier whose arrangement order in the selection order is the same as the selection random number.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:获取各候选故障任务在目标注入条件下引发故障的历史故障频次;根据各候选故障任务对应的历史故障频次,确定相应候选故障任务与目标注入条件之间的相关度数据。In one embodiment, when the processing logic in the computer program is executed by the processor, the following steps are also implemented: obtaining the historical failure frequency of each candidate failure task causing failure under the target injection condition; and determining the correlation data between the corresponding candidate failure task and the target injection condition based on the historical failure frequency corresponding to each candidate failure task.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:根据与目标故障任务具备绑定关系的候选故障任务,更新目标故障任务。In one embodiment, when the processing logic in the computer program is executed by the processor, the following steps are further implemented: updating the target fault task according to the candidate fault tasks that have a binding relationship with the target fault task.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:对至少一个候选故障任务进行分类;建立类别相同的至少两个候选故障任务之间的绑定关系。In one embodiment, when the processing logic in the computer program is executed by the processor, the following steps are further implemented: classifying at least one candidate fault task; and establishing a binding relationship between at least two candidate fault tasks of the same category.
在一个实施例中,计算机程序中的处理逻辑被处理器执行时还实现以下步骤:获取业务系统的当前业务流量的业务属性数据;从至少一个候选注入条件中,选取与业务属性数据相匹配的目标注入条件;其中,业务属性数据包括业务类型、业务操作和协议类型中的至少一种。In one embodiment, the processing logic in the computer program also implements the following steps when executed by the processor: obtaining business attribute data of the current business traffic of the business system; selecting a target injection condition that matches the business attribute data from at least one candidate injection condition; wherein the business attribute data includes at least one of a business type, a business operation, and a protocol type.
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410952677.9A CN118694668A (en) | 2024-07-16 | 2024-07-16 | Fault task injection method, device, communication equipment, storage medium and program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410952677.9A CN118694668A (en) | 2024-07-16 | 2024-07-16 | Fault task injection method, device, communication equipment, storage medium and program product |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118694668A true CN118694668A (en) | 2024-09-24 |
Family
ID=92771553
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410952677.9A Pending CN118694668A (en) | 2024-07-16 | 2024-07-16 | Fault task injection method, device, communication equipment, storage medium and program product |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118694668A (en) |
-
2024
- 2024-07-16 CN CN202410952677.9A patent/CN118694668A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11792291B1 (en) | Proxying hypertext transfer protocol (HTTP) requests for microservices | |
| US11853303B1 (en) | Data stream generation based on sourcetypes associated with messages | |
| US11924021B1 (en) | Actionable event responder architecture | |
| US11836148B1 (en) | Data source correlation user interface | |
| CN112714047B (en) | Industrial control protocol flow based test method, device, equipment and storage medium | |
| US11663219B1 (en) | Determining a set of parameter values for a processing pipeline | |
| US11347577B1 (en) | Monitoring features of components of a distributed computing system | |
| US12079175B2 (en) | Streaming synthesis of distributed traces from machine logs | |
| CN111181801B (en) | Node cluster testing method and device, electronic equipment and storage medium | |
| US11669551B2 (en) | Rule-based data stream processing | |
| US11238012B1 (en) | Log data extraction from data chunks of an isolated execution environment | |
| US11755531B1 (en) | System and method for storage of data utilizing a persistent queue | |
| US11675473B1 (en) | User interface for summarizing data to generate previews of metric data | |
| US11875275B1 (en) | Custom time series models in computer analytics systems | |
| US11714823B1 (en) | Generating metric data from log data using metricization rules | |
| US11663172B2 (en) | Cascading payload replication | |
| CN109669795A (en) | Crash info processing method and processing device | |
| US11824729B2 (en) | Generating a three-dimensional cityscape including a cluster of nodes | |
| CN108228432A (en) | A kind of distributed link tracking, analysis method and server, global scheduler | |
| CN118694668A (en) | Fault task injection method, device, communication equipment, storage medium and program product | |
| CN110839061B (en) | Data distribution method, device and storage medium | |
| US11113301B1 (en) | Generating metadata for events based on parsed location information of data chunks of an isolated execution environment | |
| CN112598323B (en) | Cross-business-domain process monitoring method and device, computer equipment and storage medium | |
| US11934256B1 (en) | Determining ingestion latency of data intake and query system instances | |
| CN116401161A (en) | Interface test method, apparatus, computer device, storage medium, and program product |
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 |