WO2018188538A1 - Rule verification method, terminal, and storage medium - Google Patents

Rule verification method, terminal, and storage medium Download PDF

Info

Publication number
WO2018188538A1
WO2018188538A1 PCT/CN2018/082228 CN2018082228W WO2018188538A1 WO 2018188538 A1 WO2018188538 A1 WO 2018188538A1 CN 2018082228 W CN2018082228 W CN 2018082228W WO 2018188538 A1 WO2018188538 A1 WO 2018188538A1
Authority
WO
WIPO (PCT)
Prior art keywords
threads
case
task
thread
configuration file
Prior art date
Application number
PCT/CN2018/082228
Other languages
French (fr)
Chinese (zh)
Inventor
曹辉荣
黄宇
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2018188538A1 publication Critical patent/WO2018188538A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to a rule verification method, a terminal, and a storage medium.
  • Developers can't guarantee 100% correct changes to the rules involved in the development process (including modifying rules, adding rules, such as the maximum age of 65 can be a rule) and developing code, and find that a rule is problematic.
  • the present application provides a rule verification method, a terminal, and a storage medium, which can use a case set to compare the results obtained by executing all the rules in the new project and the old project, so that the relevant personnel pay attention to the rules with different comparison results, and improve the rule.
  • the efficiency of rule validation is a rule verification method, a terminal, and a storage medium, which can use a case set to compare the results obtained by executing all the rules in the new project and the old project, so that the relevant personnel pay attention to the rules with different comparison results, and improve the rule.
  • the application provides a rule verification method, the method comprising:
  • the thread extracts the case state into an unexecuted case from the case set and modifies the case state of the case to be executed;
  • the thread uses the case to execute all rules in the new project to obtain the first result
  • the thread uses the case to execute all rules in the old project to obtain a second result
  • the first result is compared to the second result to obtain a comparison result.
  • the application provides a terminal, where the terminal includes:
  • a task establishing unit configured to perform a task of performing rule verification on a new item according to the case set
  • a configuration unit configured to configure a thread for performing the task
  • An extracting unit configured to extract an unexecuted case from the thread to the case set and modify a case state of the case to be executed
  • a first result unit configured by the thread to execute all rules in the new project to obtain a first result
  • a second result unit configured by the thread to execute all rules in the old project to obtain a second result
  • a comparison unit for comparing the first result with the second result to obtain a comparison result.
  • the present application further provides a terminal, the terminal comprising: a memory, and a processor connected to the memory; the memory is configured to store program data; and the processor is configured to run the stored in the memory Program data to perform the method described in the first aspect above.
  • the application further provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors To achieve the method described in the first aspect above.
  • the method and the terminal provided by the embodiments of the present application compare the results obtained by executing all the rules in the new project and the old project by using the case set, so as to verify the rules developed in the new project, so that the relevant personnel pay attention to the difference in the comparison results. Rules improve the efficiency of rule validation in new projects.
  • FIG. 1 is a schematic flowchart of a rule verification method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a sub-flow of a rule verification method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a sub-flow of a rule verification method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a rule verification method according to another embodiment of the present application.
  • FIG. 5 is a schematic diagram of a sub-flow of a rule verification method according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a terminal according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic block diagram of a configuration unit provided by an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of an adjustment unit provided by an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of a terminal according to another embodiment of the present disclosure.
  • FIG. 10 is a schematic block diagram of a thread number obtaining unit according to an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a terminal according to another embodiment of the present disclosure.
  • FIG. 1 is a schematic flowchart diagram of a rule verification method according to an embodiment of the present application. The method includes S101 to S108.
  • a case set includes multiple cases.
  • a case corresponds to a policy
  • a policy includes all information about the insured, such as height, weight, and historical insurance information.
  • S102 Perform a task of performing rule verification on the new item according to the case set. After the new task is created, the task is executed.
  • S103-S108 is the content of the task.
  • S103 Configure a thread for performing the task.
  • the number of threads of the task is saved in the preset configuration file.
  • the initial value of the task is the default value.
  • S103 includes S201-S202.
  • S201. Obtain a thread number in a preset configuration file. Get the number of threads in the preset configuration file by obtaining the value of the corresponding configuration item in the preset configuration file.
  • S202 Adjust the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file. Understandably, the current number of threads of the task is zero when the task begins execution.
  • S202 includes S301-303.
  • S301 Determine whether the number of threads in the preset configuration file is greater than the current number of threads in the task. If the number of threads in the preset configuration file is greater than the current number of threads in the task, S302 is performed; if the number of threads in the preset configuration file is less than the current number of threads in the task, S303 is performed. S302. Create a new thread, where the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task. S303. Close the thread after the thread execution case ends, where the number of closed threads is the difference between the current number of threads of the task and the number of threads in the preset configuration file. Closing a thread sets the state of the thread to false.
  • the thread to the case set extracts a case state that is not executed and modifies the case state of the case to be executed.
  • the thread of the task goes to the case set to extract the case state as unexecuted.
  • the case state is unexecuted in a preset order in the case set. If the case status is unexecuted according to the number order of the cases in the case set or other suitable order. For example, if the task is configured with 10 threads, then the 10 threads will extract the cases from the case set, and extract them according to the number sequence of the case set cases.
  • a thread extracts the case status as an unexecuted case, the case of the case is immediately taken.
  • the state is modified to execute to prevent other threads from fetching the same case. At the same time, multiple threads execute in parallel, which improves the efficiency of rule verification. After each thread extracts the case, the case state of the case is modified to execute, and the efficiency and accuracy are improved.
  • the thread uses the case to execute all the rules in the new project to obtain the first result. After a thread extracts the case, it uses the case to execute all the rules in the new project to get the first result.
  • new projects and old projects refer to projects that can solve different periods of at least one of the same basic problems, and can also refer to new and old versions of a project.
  • the case state of the case is modified to an exception, and then returns to the thread to the case set to extract the case state as unexecuted case. And modify the case status of the case as the step of execution.
  • the abnormal case of timeout can be excluded, and the execution of the task will not be stopped due to the abnormal case, that is, the thread then executes other cases whose status is unexecuted, further improving the efficiency of the rule verification.
  • the situation when an interrupt occurs is saved, such as when the interrupt occurs.
  • the thread When the task is executed again, the thread will then execute from the case when the interrupt occurs, that is, the case saved by the thread extraction interrupt will modify the case state of the case to execution, and the thread uses the case to the new project and the old project respectively. Execute all the rules to get the first result and the second result, and compare the first result with the second result to obtain the comparison result until there is no case case of the unexecuted case, and improve the efficiency of the rule verification again to avoid the interruption
  • the impact of task execution For example, because the test environment often needs to restart the environment due to the deployment operation, after the restart, the unfinished tasks will not be interrupted and will continue to be executed. For example: a task has 1000 cases. When the execution reaches 500, the server restarts. After restarting, the program will continue to execute the remaining 500 cases until it is completed.
  • FIG. 4 is a schematic flowchart diagram of a rule verification method according to another embodiment of the present application.
  • the method includes S401 to S409.
  • the difference from the embodiment of Fig. 1 is that steps S408-S409 are added.
  • a case set includes multiple cases.
  • S402 Perform a task of performing rule verification on the new item according to the case set. After the new task is created, the task is executed.
  • S403-S409 is the content of the task performed.
  • S403 includes S201-S202.
  • S201 Obtain a thread number in a preset configuration file. Get the number of threads in the preset configuration file by obtaining the value of the corresponding configuration item in the preset configuration file.
  • S202 Adjust the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file. Understandably, the current number of threads of the task is zero when the task begins execution.
  • S202 includes S301-303. For details, refer to the content described in the embodiment of FIG. 3.
  • the thread to the case set extracts a case state that is not executed, and modifies the case state of the case to be executed.
  • the thread of the task goes to the case set to extract the case state as unexecuted.
  • the case state is extracted to the unexecuted case in order. For example, if the task has 10 threads configured, then the 10 threads will extract the cases from the case set, and extract them according to the order in which the cases are concentrated.
  • a thread extracts the case status as an unexecuted case, the case of the case is immediately taken.
  • the state is modified to execute to prevent other threads from fetching the same case.
  • multiple threads execute in parallel, which improves the efficiency of rule verification. After each thread extracts the case, the case state of the case is modified to execute, and the efficiency and accuracy are improved.
  • the thread uses the case to execute all rules in a new project to obtain a first result.
  • new projects and old projects refer to projects that can solve different periods of at least one of the same basic problems, and can also refer to new and old versions of a project.
  • S409 determining whether the preset time is reached.
  • the preset time is 5 minutes. If the preset time is reached, S403 is performed; if the preset time is not reached, S404 is executed. It can be understood that, when the task starts executing, configuring a thread for the user to execute the task; in the process of executing the subsequent task, performing the step of configuring the thread for executing the task by the user every preset time, that is, executing in the subsequent task.
  • the number of threads in the preset configuration file is obtained every preset time, and the current number of threads of the task is adjusted so that the number of threads is equal to the number of threads in the preset configuration file.
  • This embodiment can dynamically adjust the number of threads of the task to better utilize terminal resources and improve the efficiency of rule verification.
  • this embodiment can also eliminate the abnormal case of timeout, and the execution of the task will not stop due to the abnormal case; in this embodiment, when the task is interrupted, the situation when the interrupt occurs will be saved, for example, when the interruption occurs. When the task is executed again, the thread of the task will then execute from the case when the interrupt occurred.
  • the setting of the number of threads in the preset configuration file is related to the current time.
  • S201 includes S401-S402.
  • S401 obtaining the current time.
  • S402. Obtain a number of threads corresponding to the current time set in the preset configuration file. For example, during 9:00-19:00 during the daytime, the number of corresponding threads set in the preset configuration file is one. At other times, the number of corresponding threads set in the preset configuration file is 10.
  • the number of threads set is small, and there is no need to occupy too much memory resources of the terminal; at night, during non-working hours, the terminal is almost useless, and the number of threads is set, and the resources of the terminal are fully utilized to improve the rule verification. effectiveness.
  • FIG. 6 is a schematic block diagram of a terminal according to an embodiment of the present application.
  • the terminal 60 includes an obtaining unit 601, a task establishing unit 602, a configuration unit 603, an extracting unit 604, a first result unit 605, a second result unit 606, and a comparing unit 607.
  • the obtaining unit 601 is configured to acquire a case set.
  • a case set includes multiple cases.
  • a case corresponds to a policy
  • a policy includes all information about the insured, such as height, weight, and historical insurance information.
  • the task establishing unit 602 is configured to newly create a task for performing rule verification on the new item according to the case set.
  • the configuration unit 603 is configured to configure a thread for performing the task.
  • the number of threads of the task is saved in the preset configuration file, and the number of threads of the task can be modified by modifying the corresponding configuration item in the preset configuration file.
  • the configuration unit 603 includes a thread number acquisition unit 701 and an adjustment unit 702.
  • the thread number obtaining unit 701 is configured to obtain the number of threads in the preset configuration file. Get the number of threads in the preset configuration file by obtaining the value of the corresponding configuration item in the preset configuration file.
  • the adjusting unit 702 is configured to adjust the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file.
  • the adjustment unit 702 includes a thread number determination unit 801, a thread establishment unit 802, and a thread closure unit 803.
  • the thread number determining unit 801 is configured to determine whether the number of threads in the preset configuration file is greater than the current number of threads of the task.
  • the thread close unit 803 if the number of threads in the preset configuration file is less than the current number of threads of the task, the thread is closed after the thread execution case ends, wherein the number of closed threads is the current number of threads of the task and the preset configuration file. The difference in the number of threads. Closing a thread sets the state of the thread to false.
  • the extracting unit 604 is configured to extract an unexecuted case from the thread to the case set and modify a case state of the case to be executed.
  • the thread of the task goes to the case set to extract the case state as unexecuted.
  • the case state is unexecuted in a preset order in the case set. If the case status is unexecuted according to the number order of the cases in the case set or other suitable order. For example, if the task has 10 threads configured, then the 10 threads will extract the cases from the case set, and extract them according to the number sequence of the case set cases. After a thread extracts the case status as an unexecuted case, the case is immediately taken.
  • the case status is modified to execute to prevent other threads from fetching the same case. At the same time, multiple threads execute in parallel, which improves the efficiency of rule verification. After each thread extracts the case, the case state of the case is modified to execute, and the efficiency and accuracy are improved.
  • the first result unit 605 is configured to obtain, by the thread, the first result by using the case to execute all rules in the new item. After a thread extracts the case, it uses the case to execute all the rules in the new project to get the first result.
  • the second result unit 606 is configured to obtain a second result by the thread using the case to execute all rules in the old item.
  • new projects and old projects refer to projects that can solve different periods of at least one of the same basic problems, and can also refer to new and old versions of a project.
  • the comparing unit 607 is configured to compare the first result with the second result to obtain a comparison result, so that the developer pays attention to the rule of the difference in the comparison result.
  • the case state of the case is modified to an exception, and then returns to the thread to the case set to extract the case state as unexecuted case. And modify the case status of the case as the step of execution.
  • the abnormal case of timeout can be excluded, and the execution of the task will not be stopped due to the abnormal case, that is, the thread then executes the case where the other case status is not executed, further improving the efficiency of the rule verification.
  • the situation when an interrupt occurs is saved, such as when the interrupt occurs.
  • the thread When the task is executed again, the thread will then execute from the case when the interrupt occurs, that is, the case saved by the thread extraction interrupt will modify the case state of the case to execution, and the thread uses the case to the new project and the old project respectively. Execute all the rules to get the first result and the second result, and compare the first result with the second result to obtain the comparison result until there is no case case of the unexecuted case, and improve the efficiency of the rule verification again to avoid the interruption
  • the impact of task execution For example, because the test environment often needs to restart the environment due to the deployment operation, after the restart, the unfinished tasks will not be interrupted and will continue to be executed. For example: a task has 1000 cases. When the execution reaches 500, the server restarts. After restarting, the program will continue to execute the remaining 500 cases until it is completed.
  • FIG. 9 is a schematic block diagram of a terminal according to another embodiment of the present application.
  • the terminal 90 includes an obtaining unit 901, a task establishing unit 902, a configuration unit 903, an extracting unit 904, a first result unit 905, a second result unit 906, a comparing unit 907, and a determining unit 908.
  • the terminal 90 differs from the terminal 60 in a determination unit 908.
  • the determining unit 908 is configured to determine whether there is a case in the case set that is not executed.
  • the determining unit 908 is further configured to determine whether the preset time is reached if there is a case in which the case status is not executed. If the preset time is reached, the content of the configuration unit is executed; if the preset time is not reached, the extraction unit is triggered. Preferably, the preset time is 5 minutes. It can be understood that, when the task starts executing, configuring a thread for the user to execute the task; in the process of executing the subsequent task, performing the step of configuring the thread for executing the task by the user every preset time, that is, executing in the subsequent task.
  • the number of threads in the preset configuration file is obtained every preset time, and the current number of threads of the task is adjusted so that the number of threads is equal to the number of threads in the preset configuration file.
  • This embodiment can dynamically adjust the number of threads of the task to better utilize terminal resources and improve the efficiency of rule verification.
  • the setting of the number of threads in the preset configuration file is related to the current time.
  • the thread number acquisition unit 701 includes a time acquisition unit 101 and a file thread number acquisition unit 102.
  • the time obtaining unit 101 is configured to acquire a current time.
  • the file thread number obtaining unit 102 is configured to obtain the number of threads corresponding to the current time set in the preset configuration file. For example, during 9:00-19:00 during the daytime, the number of corresponding threads set in the preset configuration file is one. At other times, the number of corresponding threads set in the preset configuration file is 10.
  • the number of threads set is small, and there is no need to occupy too much memory resources of the terminal; at night, during non-working hours, the terminal is almost useless, and the number of threads is set, and the resources of the terminal are fully utilized to improve the rule verification. effectiveness.
  • the above terminal can be implemented in the form of a computer program data which can be run on a terminal as shown in FIG.
  • FIG. 11 is a schematic block diagram of a terminal according to a fourth embodiment of the present application.
  • the terminal 110 includes a memory 111 and a processor 112, and the memory 111 and the processor 112 are connected by a bus 113. among them:
  • the memory 111 is for storing program data with various functions.
  • the data stored in the memory 111 in the embodiment of the present application includes a case set, a preset configuration file, a first result, a second result, a comparison result, and the like, and other program data that can be called and run.
  • the memory 111 of the embodiment of the present application may be a system memory, such as a non-volatile (such as a ROM, a flash memory, etc.), or a combination of the two.
  • the memory 111 of the embodiment of the present application may also be an external memory outside the system, such as a magnetic disk, an optical disk, a magnetic tape, or the like.
  • the memory 111 provides an environment for the execution of program data that, when executed by the processor 112, causes the processor 112 to perform the above-described rule verification method.
  • the processor 112 is configured to run program data stored in the memory 111 and perform the following operations:
  • the state is execution; the thread uses the case to execute all rules in the new project to obtain a first result; the thread uses the case to execute all rules in the old project to obtain a second result; the first result is The second results are compared for comparison results.
  • the thread extracts the case state into an unexecuted case in the order of the case and modifies the case state of the case as execution.
  • the processor 112 also performs the following operations:
  • the processor 112 also performs the following operations:
  • the processor 112 also performs the following operations:
  • the processor 112 also performs the following operations:
  • the application further provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors, when All of the embodiments of the above rule verification method can be implemented when one or more program data is executed by one or more processors.
  • the computer readable storage medium may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal.
  • the computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk equipped with the terminal, a smart memory card (SMC), a Secure Digital (SD) card, or the like. Further, the computer readable storage medium may also include both an internal storage unit of the terminal and an external storage device.
  • the disclosed terminal and method may be implemented in other manners.
  • the terminal embodiment described above is only illustrative.
  • the division of the unit is only a logical function division, and the actual implementation may have another division manner.
  • the foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any equivalents can be easily conceived by those skilled in the art within the technical scope disclosed in the present application. Modifications or substitutions are intended to be included within the scope of the present application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Abstract

Provided by the present application are a rule verification method, terminal, and a storage medium. Said method comprises: acquiring a case set; according to the case set, creating a new task for performing rule verification on a new item; configuring a thread used to execute said task; said thread extracting cases having a case status of non-implemented from said case set and altering the case status of said cases to implemented; said thread respectively implementing all rules by using said cases in the new item and an old item to obtain both a first result and a second result; comparing said first result with the second result to obtain a comparison result.

Description

规则验证方法、终端及存储介质Rule verification method, terminal and storage medium
本申请要求于2017年4月10日提交中国专利局、申请号为201710228800.2、发明名称为“一种规则验证方法及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on Apr. 10, 2017, the number of which is hereby incorporated by reference. .
技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及一种规则验证方法、终端及存储介质。The present application relates to the field of data processing technologies, and in particular, to a rule verification method, a terminal, and a storage medium.
背景技术Background technique
开发人员对于在开发过程中涉及的规则的变更(包括修改规则,新增规则,如年龄最大不能超过65即为一条规则)以及开发的代码等不能保证百分之百的正确,发现某条规则有问题的时间越长(可能是规则本身问题,也可能是开发代码的问题),潜在的损失就越大。因此亟需一个提高规则验证的方法以及时发现开发中有问题的规则。Developers can't guarantee 100% correct changes to the rules involved in the development process (including modifying rules, adding rules, such as the maximum age of 65 can be a rule) and developing code, and find that a rule is problematic. The longer the time (either the problem itself or the problem of developing code), the greater the potential loss. Therefore, there is a need for a method to improve the verification of rules and to find out the rules that are problematic in development.
发明内容Summary of the invention
本申请提供了一种规则验证方法、终端及存储介质,可以利用案例集,将新项目和旧项目中执行所有规则得到的结果进行对比,以使相关人员关注对比结果有差异的规则,提高了规则验证的效率。The present application provides a rule verification method, a terminal, and a storage medium, which can use a case set to compare the results obtained by executing all the rules in the new project and the old project, so that the relevant personnel pay attention to the rules with different comparison results, and improve the rule. The efficiency of rule validation.
第一方面,本申请提供了一种规则验证方法,该方法包括:In a first aspect, the application provides a rule verification method, the method comprising:
获取案例集;Get the case set;
根据案例集新建对新项目进行规则验证的任务;Newly perform the task of verifying rules for new projects based on the case set;
配置用于执行所述任务的线程;Configuring a thread for performing the task;
所述线程到所述案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行;The thread extracts the case state into an unexecuted case from the case set and modifies the case state of the case to be executed;
所述线程利用所述案例到新项目中执行所有规则得到第一结果;The thread uses the case to execute all rules in the new project to obtain the first result;
所述线程利用所述案例到旧项目中执行所有规则得到第二结果;The thread uses the case to execute all rules in the old project to obtain a second result;
将所述第一结果与所述第二结果进行对比以得到对比结果。The first result is compared to the second result to obtain a comparison result.
第二方面,本申请提供了一种终端,该终端包括:In a second aspect, the application provides a terminal, where the terminal includes:
获取单元,用于获取案例集;An acquisition unit for obtaining a case set;
任务建立单元,用于根据案例集新建对新项目进行规则验证的任务;a task establishing unit, configured to perform a task of performing rule verification on a new item according to the case set;
配置单元,用于配置用于执行所述任务的线程;a configuration unit configured to configure a thread for performing the task;
提取单元,用于由所述线程到所述案例集中提取未执行的案例并修改所述案例的案例状态为执行;An extracting unit, configured to extract an unexecuted case from the thread to the case set and modify a case state of the case to be executed;
第一结果单元,用于由所述线程利用所述案例到新项目中执行所有规则得到第一结果;a first result unit, configured by the thread to execute all rules in the new project to obtain a first result;
第二结果单元,用于由所述线程利用所述案例到旧项目中执行所有规则得到第二结果;a second result unit, configured by the thread to execute all rules in the old project to obtain a second result;
对比单元,用于将所述第一结果与所述第二结果进行对比以得到对比结果。a comparison unit for comparing the first result with the second result to obtain a comparison result.
第三方面,本申请还提供了一种终端,该终端包括:存储器,以及与所述存储器相连的处理器;所述存储器用于存储程序数据;所述处理器用于运行所述存储器中存储的程序数据,以执行上述第一方面所述的方法。In a third aspect, the present application further provides a terminal, the terminal comprising: a memory, and a processor connected to the memory; the memory is configured to store program data; and the processor is configured to run the stored in the memory Program data to perform the method described in the first aspect above.
第四方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现上述第一方面所述的方法。In a fourth aspect, the application further provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors To achieve the method described in the first aspect above.
本申请实施例提供的方法和终端,利用案例集,将新项目和旧项目中执行所有规则得到的结果进行对比,以对新项目中开发的规则进行验证,使相关人员关注对比结果有差异的规则,提高了新项目中规则验证的效率。The method and the terminal provided by the embodiments of the present application compare the results obtained by executing all the rules in the new project and the old project by using the case set, so as to verify the rules developed in the new project, so that the relevant personnel pay attention to the difference in the comparison results. Rules improve the efficiency of rule validation in new projects.
附图说明DRAWINGS
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are some embodiments of the present application, For the ordinary technicians, other drawings can be obtained based on these drawings without any creative work.
图1是本申请实施例提供的一种规则验证方法的流程示意图;1 is a schematic flowchart of a rule verification method provided by an embodiment of the present application;
图2是本申请实施例提供的一种规则验证方法的子流程示意图;2 is a schematic diagram of a sub-flow of a rule verification method according to an embodiment of the present application;
图3是本申请实施例提供的一种规则验证方法的子流程示意图;3 is a schematic diagram of a sub-flow of a rule verification method according to an embodiment of the present application;
图4是本申请另一实施例提供的一种规则验证方法的流程示意图;4 is a schematic flowchart of a rule verification method according to another embodiment of the present application;
图5是本申请实施例提供的一种规则验证方法的子流程示意图;FIG. 5 is a schematic diagram of a sub-flow of a rule verification method according to an embodiment of the present application;
图6是本申请实施例提供的一种终端的示意性框图;FIG. 6 is a schematic block diagram of a terminal according to an embodiment of the present disclosure;
图7是本申请实施例提供的配置单元的示意性框图;FIG. 7 is a schematic block diagram of a configuration unit provided by an embodiment of the present application;
图8是本申请实施例提供的调整单元的示意性框图;8 is a schematic block diagram of an adjustment unit provided by an embodiment of the present application;
图9是本申请另一实施例提供的一种终端的示意性框图;FIG. 9 is a schematic block diagram of a terminal according to another embodiment of the present disclosure;
图10是本申请实施例提供的线程数获取单元的示意性框图;FIG. 10 is a schematic block diagram of a thread number obtaining unit according to an embodiment of the present application;
图11是本申请又一实施例提供的一种终端的示意性框图。FIG. 11 is a schematic block diagram of a terminal according to another embodiment of the present disclosure.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。The use of the terms "comprising", "comprising", "","," The presence or addition of a plurality of other features, integers, steps, operations, elements, components, and/or collections thereof. It is also to be understood that the term "and/or" used in the specification and the appended claims are intended to mean any combination and all possible combinations of one or more of the associated listed items.
图1为本申请实施例提供的一种规则验证方法的流程示意图。该方法包括S101~S108。FIG. 1 is a schematic flowchart diagram of a rule verification method according to an embodiment of the present application. The method includes S101 to S108.
S101,获取案例集。一个案例集包括多个案例。如在保险行业中,一个案例对应一份保单,一份保单包括了投保人所有的信息,如身高、体重、历史投保信息等。S101, obtaining a case set. A case set includes multiple cases. For example, in the insurance industry, a case corresponds to a policy, and a policy includes all information about the insured, such as height, weight, and historical insurance information.
S102,根据案例集新建对新项目进行规则验证的任务。新建任务后,就执行该任务。S103-S108为执行任务的内容。S102: Perform a task of performing rule verification on the new item according to the case set. After the new task is created, the task is executed. S103-S108 is the content of the task.
S103,配置用于执行该任务的线程。该任务的线程数保存在预设配置文件中,该任务的线程数初始值为预设值,可以通过修改预设配置文件中相应的配置项来修改该任务的线程数。具体地,如图2所示,S103包括S201-S202。S201,获取预设配置文件中的线程数。通过获取预设配置文件中相应的配置项的值来获取预设配置文件中的线程数。S202,调整该任务当前的线程数使该线程数等 于预设配置文件中的线程数。可以理解地,在任务开始执行时,任务当前的线程数为零。具体地,如图3所示,S202包括S301-303。S301,判断预设配置文件中的线程数是否大于任务当前的线程数。若预设配置文件中的线程数大于任务当前的线程数,执行S302;若预设配置文件中的线程数小于任务当前的线程数,执行S303。S302,新建线程,其中,新建线程的数量为配置文件中的线程数与任务当前的线程数的差值。S303,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为该任务当前的线程数与预设配置文件中的线程数的差值。关闭线程可以将该线程的状态设置为false。S103. Configure a thread for performing the task. The number of threads of the task is saved in the preset configuration file. The initial value of the task is the default value. You can modify the number of threads of the task by modifying the corresponding configuration item in the preset configuration file. Specifically, as shown in FIG. 2, S103 includes S201-S202. S201. Obtain a thread number in a preset configuration file. Get the number of threads in the preset configuration file by obtaining the value of the corresponding configuration item in the preset configuration file. S202. Adjust the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file. Understandably, the current number of threads of the task is zero when the task begins execution. Specifically, as shown in FIG. 3, S202 includes S301-303. S301. Determine whether the number of threads in the preset configuration file is greater than the current number of threads in the task. If the number of threads in the preset configuration file is greater than the current number of threads in the task, S302 is performed; if the number of threads in the preset configuration file is less than the current number of threads in the task, S303 is performed. S302. Create a new thread, where the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task. S303. Close the thread after the thread execution case ends, where the number of closed threads is the difference between the current number of threads of the task and the number of threads in the preset configuration file. Closing a thread sets the state of the thread to false.
S104,所述线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行。该任务的线程到案例集中提取案例状态为未执行的案例,优选地,到案例集中按预设顺序提取案例状态为未执行的案例。如按照案例集中案例的编号顺序或者其他合适的顺序来提取案例状态为未执行的案例。例如,若该任务配置有10个线程,那么该10个线程都到案例集中提取案例,按照案例集中案例的编号顺序提取,一个线程提取案例状态为未执行的案例后就马上把该案例的案例状态修改为执行,以防止其他的线程取到同一条案例。同时多个线程并行执行,提高了规则验证的效率,每个线程提取案例后把案例的案例状态修改为执行,同时提高了效率和准确性。S104. The thread to the case set extracts a case state that is not executed and modifies the case state of the case to be executed. The thread of the task goes to the case set to extract the case state as unexecuted. Preferably, the case state is unexecuted in a preset order in the case set. If the case status is unexecuted according to the number order of the cases in the case set or other suitable order. For example, if the task is configured with 10 threads, then the 10 threads will extract the cases from the case set, and extract them according to the number sequence of the case set cases. When a thread extracts the case status as an unexecuted case, the case of the case is immediately taken. The state is modified to execute to prevent other threads from fetching the same case. At the same time, multiple threads execute in parallel, which improves the efficiency of rule verification. After each thread extracts the case, the case state of the case is modified to execute, and the efficiency and accuracy are improved.
S105,所述线程利用所述案例到新项目中执行所有规则得到第一结果。一个线程提取到案例后,就利用该案例到新项目中执行所有规则得到第一结果。S105. The thread uses the case to execute all the rules in the new project to obtain the first result. After a thread extracts the case, it uses the case to execute all the rules in the new project to get the first result.
S106,所述线程利用所述案例到旧项目中执行所有规则得到第二结果。其中,新项目和旧项目指的是能解决至少有一个相同基本问题的不同时期的项目,也可以指一个项目中的新版本和旧版本。S106. The thread uses the case to execute all rules in the old project to obtain a second result. Among them, new projects and old projects refer to projects that can solve different periods of at least one of the same basic problems, and can also refer to new and old versions of a project.
S107,将所述第一结果与所述第二结果进行对比以得到对比结果。该线程将在新项目和就项目中执行所有规则的第一结果和第二结果进行对比,得到对比结果,以使开发人员关注对比结果中差异的规则。S107. Compare the first result with the second result to obtain a comparison result. The thread compares the first and second results of the new project and the execution of all the rules in the project, and compares the results so that the developer pays attention to the rules of the differences in the comparison results.
另外,在执行任务的过程中,若某个线程执行一个案例的时间超过预设时间,那么将该案例的案例状态修改为异常,接着返回到该线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行的步骤。可以排除超时的异常案例,任务的执行不会因异常的案例而停止,即线程接着执行其他 案例状态为未执行的案例,进一步提高规则验证的效率。此外,当任务出现中断时,会保存出现中断时的情况,如保存出现中断时的案例。当任务再次执行时,线程会接着从出现中断时的案例开始执行,即线程提取中断时保存的案例将该案例的案例状态修改为执行,以及该线程利用该案例到新项目和旧项目中分别执行所有规则以得到第一结果和第二结果,并将第一结果与第二结果进行对比以得到对比结果,直到没有案例状态为未执行的案例,再次提高规则验证的效率,以避免中断对任务执行的影响。如因为测试环境经常因部署操作而需重启环境,重启后,未完成的任务不会中断,会继续执行。例如:一个任务有1000个案例,执行到500时,服务器重启,重启后,程序会继续执行剩下的500个案例,直到完成为止。In addition, in the process of executing a task, if a thread executes a case for more than a preset time, the case state of the case is modified to an exception, and then returns to the thread to the case set to extract the case state as unexecuted case. And modify the case status of the case as the step of execution. The abnormal case of timeout can be excluded, and the execution of the task will not be stopped due to the abnormal case, that is, the thread then executes other cases whose status is unexecuted, further improving the efficiency of the rule verification. In addition, when a task is interrupted, the situation when an interrupt occurs is saved, such as when the interrupt occurs. When the task is executed again, the thread will then execute from the case when the interrupt occurs, that is, the case saved by the thread extraction interrupt will modify the case state of the case to execution, and the thread uses the case to the new project and the old project respectively. Execute all the rules to get the first result and the second result, and compare the first result with the second result to obtain the comparison result until there is no case case of the unexecuted case, and improve the efficiency of the rule verification again to avoid the interruption The impact of task execution. For example, because the test environment often needs to restart the environment due to the deployment operation, after the restart, the unfinished tasks will not be interrupted and will continue to be executed. For example: a task has 1000 cases. When the execution reaches 500, the server restarts. After restarting, the program will continue to execute the remaining 500 cases until it is completed.
图4为本申请另一实施例提供的一种规则验证方法的流程示意图。该方法包括S401~S409。与图1实施例的区别在于:增加了步骤S408-S409。FIG. 4 is a schematic flowchart diagram of a rule verification method according to another embodiment of the present application. The method includes S401 to S409. The difference from the embodiment of Fig. 1 is that steps S408-S409 are added.
S401,获取案例集。一个案例集包括多个案例。S401, obtaining a case set. A case set includes multiple cases.
S402,根据案例集新建对新项目进行规则验证的任务。新建任务后,就执行该任务。S403-S409为执行任务的内容。S402: Perform a task of performing rule verification on the new item according to the case set. After the new task is created, the task is executed. S403-S409 is the content of the task performed.
S403,配置用于执行该任务的线程。该任务的线程数保存在预设配置文件中,该任务的线程数初始值为预设值,可以通过修改预设配置文件中相应的配置项来修改该任务的线程数。具体地,如图2所示,S403包括S201-S202。S201,获取预设配置文件中的线程数。通过获取预设配置文件中相应的配置项的值来获取预设配置文件中的线程数。S202,调整该任务当前的线程数使该线程数等于预设配置文件中的线程数。可以理解地,在任务开始执行时,任务当前的线程数为零。如图3所示,S202包括S301-303,具体请参看图3实施例描述的内容。S403. Configure a thread for performing the task. The number of threads of the task is saved in the preset configuration file. The initial value of the task is the default value. You can modify the number of threads of the task by modifying the corresponding configuration item in the preset configuration file. Specifically, as shown in FIG. 2, S403 includes S201-S202. S201. Obtain a thread number in a preset configuration file. Get the number of threads in the preset configuration file by obtaining the value of the corresponding configuration item in the preset configuration file. S202. Adjust the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file. Understandably, the current number of threads of the task is zero when the task begins execution. As shown in FIG. 3, S202 includes S301-303. For details, refer to the content described in the embodiment of FIG. 3.
S404,所述线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行。该任务的线程到案例集中提取案例状态为未执行的案例,优选地,到案例集中按顺序提取案例状态为未执行的案例。例如,若该任务有配置有10个线程,那么该10个线程都到案例集中提取案例,按照案例集中排列的顺序提取,一个线程提取案例状态为未执行的案例后就马上把该案例的案例状态修改为执行,以防止其他的线程取到同一条案例。同时多个线程并行执 行,提高了规则验证的效率,每个线程提取案例后把案例的案例状态修改为执行,同时提高了效率和准确性。S404. The thread to the case set extracts a case state that is not executed, and modifies the case state of the case to be executed. The thread of the task goes to the case set to extract the case state as unexecuted. Preferably, the case state is extracted to the unexecuted case in order. For example, if the task has 10 threads configured, then the 10 threads will extract the cases from the case set, and extract them according to the order in which the cases are concentrated. When a thread extracts the case status as an unexecuted case, the case of the case is immediately taken. The state is modified to execute to prevent other threads from fetching the same case. At the same time, multiple threads execute in parallel, which improves the efficiency of rule verification. After each thread extracts the case, the case state of the case is modified to execute, and the efficiency and accuracy are improved.
S405,所述线程利用所述案例到新项目中执行所有规则得到第一结果。S405. The thread uses the case to execute all rules in a new project to obtain a first result.
S406,所述线程利用所述案例到旧项目中执行所有规则得到第二结果。其中,新项目和旧项目指的是能解决至少有一个相同基本问题的不同时期的项目,也可以指一个项目中的新版本和旧版本。S406. The thread uses the case to execute all rules in the old project to obtain a second result. Among them, new projects and old projects refer to projects that can solve different periods of at least one of the same basic problems, and can also refer to new and old versions of a project.
S407,将所述第一结果与所述第二结果进行对比以得到对比结果。该线程将在新项目和就项目中执行所有规则的第一结果和第二结果进行对比,得到对比结果,以使开发人员关注对比结果中差异的规则,提高规则验证的效率。S407. Compare the first result with the second result to obtain a comparison result. The thread compares the first and second results of the new project and the execution of all the rules in the project, and obtains the comparison results, so that the developer can pay attention to the rules of the differences in the comparison results and improve the efficiency of the rule verification.
S408,判断案例集中是否有案例状态为未执行的案例。如果有案例状态为未执行的案例,执行S409;若没有案例状态为未执行的案例,结束。S408. Determine whether there is a case in which the case status is unexecuted in the case set. If there is a case with an unexecuted case, execute S409; if there is no case with an unexecuted case, end.
S409,判断是否达到预设时间。优选地,预设时间为5分钟。若达到预设时间,执行S403;若没有达到预设时间,执行S404。可以理解地,该任务开始执行时,配置用户执行该任务的线程;在后续任务执行的过程中,每隔预设时间就再执行配置用户执行该任务的线程的步骤,即在后续任务执行的过程中,每隔预设时间就获取预设配置文件中的线程数,调整该任务当前的线程数使该线程数等于预设配置文件中的线程数。该实施例可以动态的调整该任务的线程数,以更好的利用终端资源,提高规则验证的效率。S409, determining whether the preset time is reached. Preferably, the preset time is 5 minutes. If the preset time is reached, S403 is performed; if the preset time is not reached, S404 is executed. It can be understood that, when the task starts executing, configuring a thread for the user to execute the task; in the process of executing the subsequent task, performing the step of configuring the thread for executing the task by the user every preset time, that is, executing in the subsequent task. During the process, the number of threads in the preset configuration file is obtained every preset time, and the current number of threads of the task is adjusted so that the number of threads is equal to the number of threads in the preset configuration file. This embodiment can dynamically adjust the number of threads of the task to better utilize terminal resources and improve the efficiency of rule verification.
此外,该实施例同样可以排除超时的异常案例,任务的执行不会因异常的案例而停止;该实施例同样当任务出现中断时,会保存出现中断时的情况,如保存出现中断时的案例,当任务再次执行时,任务的线程会接着从出现中断时的案例开始执行。In addition, this embodiment can also eliminate the abnormal case of timeout, and the execution of the task will not stop due to the abnormal case; in this embodiment, when the task is interrupted, the situation when the interrupt occurs will be saved, for example, when the interruption occurs. When the task is executed again, the thread of the task will then execute from the case when the interrupt occurred.
在其他的实施例中,预设配置文件中的线程数的设置与当前时间有关。具体地,如图5所示,S201包括S401-S402。S401,获取当前时间。S402,获取预设配置文件中设置的当前时间对应的线程数。如白天9:00-19:00,预设配置文件中设置的对应的线程数为1个,其他时间,预设配置文件中设置的对应的线程数为10个。可以理解地,白天工作的时间,设置的线程数少,不用占用终端过多的内存资源;晚上非工作时间,终端几乎没人用,设置的线程多,充分利用终端的资源,提高规则验证的效率。In other embodiments, the setting of the number of threads in the preset configuration file is related to the current time. Specifically, as shown in FIG. 5, S201 includes S401-S402. S401, obtaining the current time. S402. Obtain a number of threads corresponding to the current time set in the preset configuration file. For example, during 9:00-19:00 during the daytime, the number of corresponding threads set in the preset configuration file is one. At other times, the number of corresponding threads set in the preset configuration file is 10. Understandably, during the daytime work, the number of threads set is small, and there is no need to occupy too much memory resources of the terminal; at night, during non-working hours, the terminal is almost useless, and the number of threads is set, and the resources of the terminal are fully utilized to improve the rule verification. effectiveness.
图6为本申请实施例提供的一种终端的示意性框图。该终端60包括获取单元601、任务建立单元602、配置单元603、提取单元604、第一结果单元605、第二结果单元606、对比单元607。FIG. 6 is a schematic block diagram of a terminal according to an embodiment of the present application. The terminal 60 includes an obtaining unit 601, a task establishing unit 602, a configuration unit 603, an extracting unit 604, a first result unit 605, a second result unit 606, and a comparing unit 607.
获取单元601,用于获取案例集。一个案例集包括多个案例。如在保险行业中,一个案例对应一份保单,一份保单包括了投保人所有的信息,如身高、体重、历史投保信息等。The obtaining unit 601 is configured to acquire a case set. A case set includes multiple cases. For example, in the insurance industry, a case corresponds to a policy, and a policy includes all information about the insured, such as height, weight, and historical insurance information.
任务建立单元602,用于根据案例集新建对新项目进行规则验证的任务。The task establishing unit 602 is configured to newly create a task for performing rule verification on the new item according to the case set.
配置单元603,用于配置用于执行所述任务的线程。该任务的线程数保存在预设配置文件中,可以通过修改预设配置文件中相应的配置项来修改该任务的线程数。具体地,如图7所示,配置单元603包括线程数获取单元701、调整单元702。线程数获取单元701,用于获取预设配置文件中的线程数。通过获取预设配置文件中相应的配置项的值来获取预设配置文件中的线程数。调整单元702,用于调整该任务当前的线程数使该线程数等于预设配置文件中的线程数。可以理解地,在任务开始执行时,任务当前的线程数为零。具体地,如图8所示,调整单元702包括线程数判断单元801、线程建立单元802、线程关闭单元803。线程数判断单元801,用于判断预设配置文件中的线程数是否大于任务当前的线程数。线程建立单元802,若预设配置文件中的线程数大于任务当前的线程数,新建线程,其中,新建线程的数量为配置文件中的线程数与任务当前的线程数的差值。线程关闭单元803,若预设配置文件中的线程数小于任务当前的线程数,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为该任务当前的线程数与预设配置文件中的线程数的差值。关闭线程可以将该线程的状态设置为false。The configuration unit 603 is configured to configure a thread for performing the task. The number of threads of the task is saved in the preset configuration file, and the number of threads of the task can be modified by modifying the corresponding configuration item in the preset configuration file. Specifically, as shown in FIG. 7, the configuration unit 603 includes a thread number acquisition unit 701 and an adjustment unit 702. The thread number obtaining unit 701 is configured to obtain the number of threads in the preset configuration file. Get the number of threads in the preset configuration file by obtaining the value of the corresponding configuration item in the preset configuration file. The adjusting unit 702 is configured to adjust the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file. Understandably, the current number of threads of the task is zero when the task begins execution. Specifically, as shown in FIG. 8, the adjustment unit 702 includes a thread number determination unit 801, a thread establishment unit 802, and a thread closure unit 803. The thread number determining unit 801 is configured to determine whether the number of threads in the preset configuration file is greater than the current number of threads of the task. The thread establishing unit 802, if the number of threads in the preset configuration file is greater than the current number of threads of the task, creates a new thread, wherein the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task. The thread close unit 803, if the number of threads in the preset configuration file is less than the current number of threads of the task, the thread is closed after the thread execution case ends, wherein the number of closed threads is the current number of threads of the task and the preset configuration file. The difference in the number of threads. Closing a thread sets the state of the thread to false.
提取单元604,用于由所述线程到所述案例集中提取未执行的案例并修改所述案例的案例状态为执行。该任务的线程到案例集中提取案例状态为未执行的案例,优选地,到案例集中按预设顺序提取案例状态为未执行的案例。如按照案例集中案例的编号顺序或者其他合适的顺序来提取案例状态为未执行的案例。例如,若该任务有配置有10个线程,那么该10个线程都到案例集中提取案例,按照案例集中案例的编号顺序提取,一个线程提取案例状态为未执行的案例后就马上把该案例的案例状态修改为执行,以防止其他的线程取到同一条 案例。同时多个线程并行执行,提高了规则验证的效率,每个线程提取案例后把案例的案例状态修改为执行,同时提高了效率和准确性。The extracting unit 604 is configured to extract an unexecuted case from the thread to the case set and modify a case state of the case to be executed. The thread of the task goes to the case set to extract the case state as unexecuted. Preferably, the case state is unexecuted in a preset order in the case set. If the case status is unexecuted according to the number order of the cases in the case set or other suitable order. For example, if the task has 10 threads configured, then the 10 threads will extract the cases from the case set, and extract them according to the number sequence of the case set cases. After a thread extracts the case status as an unexecuted case, the case is immediately taken. The case status is modified to execute to prevent other threads from fetching the same case. At the same time, multiple threads execute in parallel, which improves the efficiency of rule verification. After each thread extracts the case, the case state of the case is modified to execute, and the efficiency and accuracy are improved.
第一结果单元605,用于由所述线程利用所述案例到新项目中执行所有规则得到第一结果。一个线程提取到案例后,就利用该案例到新项目中执行所有规则得到第一结果。The first result unit 605 is configured to obtain, by the thread, the first result by using the case to execute all rules in the new item. After a thread extracts the case, it uses the case to execute all the rules in the new project to get the first result.
第二结果单元606,用于由所述线程利用所述案例到旧项目中执行所有规则得到第二结果。其中,新项目和旧项目指的是能解决至少有一个相同基本问题的不同时期的项目,也可以指一个项目中的新版本和旧版本。The second result unit 606 is configured to obtain a second result by the thread using the case to execute all rules in the old item. Among them, new projects and old projects refer to projects that can solve different periods of at least one of the same basic problems, and can also refer to new and old versions of a project.
对比单元607,用于将所述第一结果与所述第二结果进行对比以得到对比结果,以使开发人员关注对比结果中差异的规则。The comparing unit 607 is configured to compare the first result with the second result to obtain a comparison result, so that the developer pays attention to the rule of the difference in the comparison result.
另外,在执行任务的过程中,若某个线程执行一个案例的时间超过预设时间,那么将该案例的案例状态修改为异常,接着返回到该线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行的步骤。可以排除超时的异常案例,任务的执行不会因异常的案例而停止,即线程接着执行其他案例状态为未执行的案例,进一步提高规则验证的效率。此外,当任务出现中断时,会保存出现中断时的情况,如保存出现中断时的案例。当任务再次执行时,线程会接着从出现中断时的案例开始执行,即线程提取中断时保存的案例将该案例的案例状态修改为执行,以及该线程利用该案例到新项目和旧项目中分别执行所有规则以得到第一结果和第二结果,并将第一结果与第二结果进行对比以得到对比结果,直到没有案例状态为未执行的案例,再次提高规则验证的效率,以避免中断对任务执行的影响。如因为测试环境经常因部署操作而需重启环境,重启后,未完成的任务不会中断,会继续执行。例如:一个任务有1000个案例,执行到500时,服务器重启,重启后,程序会继续执行剩下的500个案例,直到完成为止。In addition, in the process of executing a task, if a thread executes a case for more than a preset time, the case state of the case is modified to an exception, and then returns to the thread to the case set to extract the case state as unexecuted case. And modify the case status of the case as the step of execution. The abnormal case of timeout can be excluded, and the execution of the task will not be stopped due to the abnormal case, that is, the thread then executes the case where the other case status is not executed, further improving the efficiency of the rule verification. In addition, when a task is interrupted, the situation when an interrupt occurs is saved, such as when the interrupt occurs. When the task is executed again, the thread will then execute from the case when the interrupt occurs, that is, the case saved by the thread extraction interrupt will modify the case state of the case to execution, and the thread uses the case to the new project and the old project respectively. Execute all the rules to get the first result and the second result, and compare the first result with the second result to obtain the comparison result until there is no case case of the unexecuted case, and improve the efficiency of the rule verification again to avoid the interruption The impact of task execution. For example, because the test environment often needs to restart the environment due to the deployment operation, after the restart, the unfinished tasks will not be interrupted and will continue to be executed. For example: a task has 1000 cases. When the execution reaches 500, the server restarts. After restarting, the program will continue to execute the remaining 500 cases until it is completed.
图9为本申请另一实施例提供的一种终端的示意性框图。该终端90包括获取单元901、任务建立单元902、配置单元903、提取单元904、第一结果单元905、第二结果单元906、对比单元907、判断单元908。该终端90与终端60的区别在于:判断单元908。FIG. 9 is a schematic block diagram of a terminal according to another embodiment of the present application. The terminal 90 includes an obtaining unit 901, a task establishing unit 902, a configuration unit 903, an extracting unit 904, a first result unit 905, a second result unit 906, a comparing unit 907, and a determining unit 908. The terminal 90 differs from the terminal 60 in a determination unit 908.
判断单元908,用于判断案例集中是否有案例状态为未执行的案例。判断 单元908还用于若有案例状态为未执行的案例,判断是否达到预设时间。若达到预设时间,执行配置单元的内容;若没有达到预设时间,触发提取单元。优选地,预设时间为5分钟。可以理解地,该任务开始执行时,配置用户执行该任务的线程;在后续任务执行的过程中,每隔预设时间就再执行配置用户执行该任务的线程的步骤,即在后续任务执行的过程中,每隔预设时间就获取预设配置文件中的线程数,调整该任务当前的线程数使该线程数等于预设配置文件中的线程数。该实施例可以动态的调整该任务的线程数,以更好的利用终端资源,提高规则验证的效率。The determining unit 908 is configured to determine whether there is a case in the case set that is not executed. The determining unit 908 is further configured to determine whether the preset time is reached if there is a case in which the case status is not executed. If the preset time is reached, the content of the configuration unit is executed; if the preset time is not reached, the extraction unit is triggered. Preferably, the preset time is 5 minutes. It can be understood that, when the task starts executing, configuring a thread for the user to execute the task; in the process of executing the subsequent task, performing the step of configuring the thread for executing the task by the user every preset time, that is, executing in the subsequent task. During the process, the number of threads in the preset configuration file is obtained every preset time, and the current number of threads of the task is adjusted so that the number of threads is equal to the number of threads in the preset configuration file. This embodiment can dynamically adjust the number of threads of the task to better utilize terminal resources and improve the efficiency of rule verification.
在其他的实施例中,预设配置文件中的线程数的设置与当前时间有关。具体地,如图10所示,线程数获取单元701包括时间获取单元101、文件线程数获取单元102。时间获取单元101,用于获取当前时间。文件线程数获取单元102,用于获取预设配置文件中设置的当前时间对应的线程数。如白天9:00-19:00,预设配置文件中设置的对应的线程数为1个,其他时间,预设配置文件中设置的对应的线程数为10个。可以理解地,白天工作的时间,设置的线程数少,不用占用终端过多的内存资源;晚上非工作时间,终端几乎没人用,设置的线程多,充分利用终端的资源,提高规则验证的效率。In other embodiments, the setting of the number of threads in the preset configuration file is related to the current time. Specifically, as shown in FIG. 10, the thread number acquisition unit 701 includes a time acquisition unit 101 and a file thread number acquisition unit 102. The time obtaining unit 101 is configured to acquire a current time. The file thread number obtaining unit 102 is configured to obtain the number of threads corresponding to the current time set in the preset configuration file. For example, during 9:00-19:00 during the daytime, the number of corresponding threads set in the preset configuration file is one. At other times, the number of corresponding threads set in the preset configuration file is 10. Understandably, during the daytime work, the number of threads set is small, and there is no need to occupy too much memory resources of the terminal; at night, during non-working hours, the terminal is almost useless, and the number of threads is set, and the resources of the terminal are fully utilized to improve the rule verification. effectiveness.
上述终端可以实现为一种计算机程序数据的形式,该程序数据可以在如图11所示的终端上运行。The above terminal can be implemented in the form of a computer program data which can be run on a terminal as shown in FIG.
图11为本申请第四实施例提供的一种终端的示意性框图。该终端110包括存储器111以及处理器112,上述存储器111以及处理器112通过总线113连接。其中:FIG. 11 is a schematic block diagram of a terminal according to a fourth embodiment of the present application. The terminal 110 includes a memory 111 and a processor 112, and the memory 111 and the processor 112 are connected by a bus 113. among them:
存储器111,用于存储带有各种功能的程序数据。本申请实施例中存储器111存储的数据包括案例集、预设配置文件、第一结果、第二结果、对比结果等,以及其他可调用并运行的程序数据。具体实现中,本申请实施例的存储器111可以是系统存储器,比如非易失性的(诸如ROM,闪存等),或者两者的结合。具体实现中,本申请实施例的存储器111还可以是系统之外的外部存储器,比如,磁盘、光盘、磁带等。该存储器111为程序数据的运行提供环境,该程序数据被处理器112执行时,可使得处理器112执行上述规则验证方法。The memory 111 is for storing program data with various functions. The data stored in the memory 111 in the embodiment of the present application includes a case set, a preset configuration file, a first result, a second result, a comparison result, and the like, and other program data that can be called and run. In a specific implementation, the memory 111 of the embodiment of the present application may be a system memory, such as a non-volatile (such as a ROM, a flash memory, etc.), or a combination of the two. In a specific implementation, the memory 111 of the embodiment of the present application may also be an external memory outside the system, such as a magnetic disk, an optical disk, a magnetic tape, or the like. The memory 111 provides an environment for the execution of program data that, when executed by the processor 112, causes the processor 112 to perform the above-described rule verification method.
处理器112,用于运行存储器111中存储的程序数据,并执行如下操作:The processor 112 is configured to run program data stored in the memory 111 and perform the following operations:
获取案例集;根据案例集新建对新项目进行规则验证的任务;配置用于执行所述任务的线程;所述线程到所述案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行;所述线程利用所述案例到新项目中执行所有规则得到第一结果;所述线程利用所述案例到旧项目中执行所有规则得到第二结果;将所述第一结果与所述第二结果进行对比以得到对比结果。其中,所述线程到所述案例集中按顺序提取案例状态为未执行的案例并修改所述案例的案例状态为执行。Obtaining a case set; creating a task for performing rule verification on the new item according to the case set; configuring a thread for executing the task; and the thread extracting a case in which the case status is not executed and modifying the case of the case to the case set The state is execution; the thread uses the case to execute all rules in the new project to obtain a first result; the thread uses the case to execute all rules in the old project to obtain a second result; the first result is The second results are compared for comparison results. The thread extracts the case state into an unexecuted case in the order of the case and modifies the case state of the case as execution.
处理器112,还执行如下操作:The processor 112 also performs the following operations:
判断案例集中是否有案例状态为未执行的案例;若有,返回所述线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行的步骤。Determine whether there is a case in which the case status is unexecuted; if yes, return the thread to the case set to extract the case status as unexecuted case and modify the case status of the case as the execution step.
处理器112,还执行如下操作:The processor 112 also performs the following operations:
获取预设配置文件中的线程数;调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数。Obtaining the number of threads in the preset configuration file; adjusting the current number of threads of the task so that the number of threads is equal to the number of threads in the preset configuration file.
处理器112,还执行如下操作:The processor 112 also performs the following operations:
判断预设配置文件中的线程数是否大于所述任务当前的线程数;若大于所述任务当前的线程数,新建线程,其中,新建线程的数量为配置文件中的线程数与任务当前的线程数的差值;若小于所述任务当前的线程数,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为所述任务当前的线程数与预设配置文件中的线程数的差值。Determining whether the number of threads in the preset configuration file is greater than the current number of threads of the task; if the number of threads in the current task is greater than the current number of threads of the task, creating a new thread, wherein the number of newly created threads is the number of threads in the configuration file and the current thread of the task If the number of threads is less than the current number of threads of the task, the thread is closed after the thread execution case ends, wherein the number of closed threads is the difference between the current number of threads of the task and the number of threads in the preset configuration file. value.
处理器112,还执行如下操作:The processor 112 also performs the following operations:
获取当前时间;获取预设配置文件中设置的当前时间对应的线程数。Get the current time; get the number of threads corresponding to the current time set in the preset configuration file.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,当所述一个或者一个以上程序数据被一个或者一个以上的处理器执行时,可实现上述规则验证方法的所有实施例。The application further provides a computer readable storage medium storing one or more program data, the one or more program data being executable by one or more processors, when All of the embodiments of the above rule verification method can be implemented when one or more program data is executed by one or more processors.
所述计算机可读存储介质可以是终端的内部存储单元,例如终端的硬盘或内存。所述计算机可读存储介质也可以是终端的外部存储设备,例如所述终端上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure  Digital,SD)卡等。进一步地,所述计算机可读存储介质还可以既包括所述终端的内部存储单元也包括外部存储设备。The computer readable storage medium may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk equipped with the terminal, a smart memory card (SMC), a Secure Digital (SD) card, or the like. Further, the computer readable storage medium may also include both an internal storage unit of the terminal and an external storage device.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的终端和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the terminal and the unit described above can be referred to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。例如,以上所描述的终端实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。In the several embodiments provided by the present application, it should be understood that the disclosed terminal and method may be implemented in other manners. For example, the terminal embodiment described above is only illustrative. For example, the division of the unit is only a logical function division, and the actual implementation may have another division manner. The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any equivalents can be easily conceived by those skilled in the art within the technical scope disclosed in the present application. Modifications or substitutions are intended to be included within the scope of the present application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

Claims (20)

  1. 一种规则验证方法,其特征在于,所述方法包括:A rule verification method, the method comprising:
    获取案例集;Get the case set;
    根据案例集新建对新项目进行规则验证的任务;Newly perform the task of verifying rules for new projects based on the case set;
    配置用于执行所述任务的线程;Configuring a thread for performing the task;
    所述线程到所述案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行;The thread extracts the case state into an unexecuted case from the case set and modifies the case state of the case to be executed;
    所述线程利用所述案例到新项目中执行所有规则得到第一结果;The thread uses the case to execute all rules in the new project to obtain the first result;
    所述线程利用所述案例到旧项目中执行所有规则得到第二结果;The thread uses the case to execute all rules in the old project to obtain a second result;
    将所述第一结果与所述第二结果进行对比以得到对比结果。The first result is compared to the second result to obtain a comparison result.
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 wherein the method further comprises:
    判断案例集中是否有案例状态为未执行的案例;Determine whether there is a case in which the case status is unexecuted;
    若有案例状态为未执行的案例,判断是否达到预设时间;If there is a case in which the case status is unexecuted, it is judged whether the preset time is reached;
    若达到预设时间,返回配置用于执行所述任务的线程的步骤;若没有达到预设时间,返回所述线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行的步骤。If the preset time is reached, returning to the step of configuring a thread for executing the task; if the preset time is not reached, returning the thread to the case set to extract the case state as an unexecuted case and modifying the case state of the case is The steps performed.
  3. 如权利要求1所述的方法,其特征在于,配置用于执行所述任务的线程,包括:The method of claim 1 wherein configuring a thread for performing the task comprises:
    获取预设配置文件中的线程数;Get the number of threads in the default configuration file;
    调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数。The current number of threads of the task is adjusted such that the number of threads is equal to the number of threads in the preset configuration file.
  4. 如权利要求3所述的方法,其特征在于,调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数,包括:The method of claim 3, wherein the current number of threads of the task is adjusted such that the number of threads is equal to the number of threads in the preset configuration file, including:
    判断预设配置文件中的线程数是否大于所述任务当前的线程数;Determining whether the number of threads in the preset configuration file is greater than the current number of threads of the task;
    若大于所述任务当前的线程数,新建线程,其中,新建线程的数量为配置文件中的线程数与任务当前的线程数的差值;If it is greater than the current number of threads of the task, create a new thread, wherein the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task;
    若小于所述任务当前的线程数,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为所述任务当前的线程数与预设配置文件中的线程数的差值。If the number of threads of the task is less than the current number of threads of the task, the thread is closed after the thread execution case ends, wherein the number of closed threads is the difference between the current number of threads of the task and the number of threads in the preset configuration file.
  5. 如权利要求3所述的方法,其特征在于,所述预设配置文件中的线程数的设置与当前时间有关,获取预设配置文件中的线程数,包括:The method of claim 3, wherein the setting of the number of threads in the preset configuration file is related to the current time, and the number of threads in the preset configuration file is obtained, including:
    获取当前时间;Get the current time;
    获取预设配置文件中设置的当前时间对应的线程数。Gets the number of threads corresponding to the current time set in the default configuration file.
  6. 一种终端,其特征在于,所述终端包括:A terminal, wherein the terminal comprises:
    获取单元,用于获取案例集;An acquisition unit for obtaining a case set;
    任务建立单元,用于根据案例集新建对新项目进行规则验证的任务;a task establishing unit, configured to perform a task of performing rule verification on a new item according to the case set;
    配置单元,用于配置用于执行所述任务的线程;a configuration unit configured to configure a thread for performing the task;
    提取单元,用于由所述线程到所述案例集中提取未执行的案例并修改所述案例的案例状态为执行;An extracting unit, configured to extract an unexecuted case from the thread to the case set and modify a case state of the case to be executed;
    第一结果单元,用于由所述线程利用所述案例到新项目中执行所有规则得到第一结果;a first result unit, configured by the thread to execute all rules in the new project to obtain a first result;
    第二结果单元,用于由所述线程利用所述案例到旧项目中执行所有规则得到第二结果;a second result unit, configured by the thread to execute all rules in the old project to obtain a second result;
    对比单元,用于将所述第一结果与所述第二结果进行对比以得到对比结果。a comparison unit for comparing the first result with the second result to obtain a comparison result.
  7. 如权利要求6所述的终端,其特征在于,所述终端还包括判断单元,所述判断单元用于判断案例集中是否有案例状态为未执行的案例;若案例集中有案例状态为未执行的案例,还用于判断是否达到预设时间;若达到预设时间,则触发配置单元,若没有达到预设时间,则触发提取单元。The terminal according to claim 6, wherein the terminal further comprises a judging unit, wherein the judging unit is configured to determine whether the case status is an unexecuted case in the case set; if the case status is unexecuted in the case set The case is also used to determine whether the preset time is reached; if the preset time is reached, the configuration unit is triggered, and if the preset time is not reached, the extraction unit is triggered.
  8. 如权利要求6所述的终端,其特征在于,所述配置单元包括线程数获取单元、调整单元;其中,The terminal according to claim 6, wherein the configuration unit comprises a thread number acquisition unit and an adjustment unit;
    所述线程数获取单元,用于获取预设配置文件中的线程数;The thread number obtaining unit is configured to obtain the number of threads in the preset configuration file;
    所述调整单元,用于调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数。The adjusting unit is configured to adjust a current thread number of the task such that the number of threads is equal to the number of threads in the preset configuration file.
  9. 如权利要求8所述的终端,其特征在于,所述调整单元包括线程数判断单元、线程建立单元、线程关闭单元;其中,The terminal according to claim 8, wherein the adjustment unit comprises a thread number determination unit, a thread establishment unit, and a thread closure unit;
    所述线程数判断单元,用于判断预设配置文件中的线程数是否大于任务当前的线程数;The thread number determining unit is configured to determine whether the number of threads in the preset configuration file is greater than the current number of threads of the task;
    所述线程建立单元,用于若预设配置文件中的线程数大于任务当前的线程数,新建线程,其中,新建线程的数量为配置文件中的线程数与任务当前的线程数的差值;The thread establishing unit is configured to: if the number of threads in the preset configuration file is greater than the current number of threads of the task, create a new thread, wherein the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task;
    所述线程关闭单元,用于若预设配置文件中的线程数小于任务当前的线程数,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为所述任务当前的线程数与预设配置文件中的线程数的差值。The thread closing unit is configured to: if the number of threads in the preset configuration file is less than the current number of threads of the task, close the thread after the thread execution case ends, wherein the number of closed threads is the current number of threads and the pre-task of the task Set the difference in the number of threads in the configuration file.
  10. 如权利要求8所述的终端,其特征在于,所述预设配置文件中的线程 数与当前时间有关,所述线程数获取单元包括时间获取单元、文件线程数获取单元;The terminal according to claim 8, wherein the number of threads in the preset configuration file is related to a current time, and the thread number obtaining unit includes a time acquiring unit and a file thread number acquiring unit;
    所述时间获取单元,用于获取当前时间;The time acquiring unit is configured to acquire a current time;
    所述文件线程数获取单元,用于获取预设配置文件中设置的当前时间对应的线程数。The file thread number obtaining unit is configured to obtain the number of threads corresponding to the current time set in the preset configuration file.
  11. 一种终端,其特征在于,所述终端包括存储器,以及与所述存储器相连的处理器;所述存储器用于存储程序数据;所述处理器用于运行所述存储器中存储的程序数据,以执行如下步骤:A terminal, comprising: a memory, and a processor connected to the memory; the memory is configured to store program data; the processor is configured to execute program data stored in the memory to execute The following steps:
    获取案例集;Get the case set;
    根据案例集新建对新项目进行规则验证的任务;Newly perform the task of verifying rules for new projects based on the case set;
    配置用于执行所述任务的线程;Configuring a thread for performing the task;
    所述线程到所述案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行;The thread extracts the case state into an unexecuted case from the case set and modifies the case state of the case to be executed;
    所述线程利用所述案例到新项目中执行所有规则得到第一结果;The thread uses the case to execute all rules in the new project to obtain the first result;
    所述线程利用所述案例到旧项目中执行所有规则得到第二结果;The thread uses the case to execute all rules in the old project to obtain a second result;
    将所述第一结果与所述第二结果进行对比以得到对比结果。The first result is compared to the second result to obtain a comparison result.
  12. 如权利要求11所述的终端,其特征在于,所述处理器还执行如下步骤:The terminal according to claim 11, wherein said processor further performs the following steps:
    判断案例集中是否有案例状态为未执行的案例;Determine whether there is a case in which the case status is unexecuted;
    若有案例状态为未执行的案例,判断是否达到预设时间;If there is a case in which the case status is unexecuted, it is judged whether the preset time is reached;
    若达到预设时间,返回配置用于执行所述任务的线程的步骤;若没有达到预设时间,返回所述线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行的步骤。If the preset time is reached, returning to the step of configuring a thread for executing the task; if the preset time is not reached, returning the thread to the case set to extract the case state as an unexecuted case and modifying the case state of the case is The steps performed.
  13. 如权利要求11所述的终端,其特征在于,所述处理器在执行所述配置用于执行所述任务的线程时,具体执行如下步骤:The terminal according to claim 11, wherein the processor performs the following steps when executing the thread configured to execute the task:
    获取预设配置文件中的线程数;Get the number of threads in the default configuration file;
    调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数。The current number of threads of the task is adjusted such that the number of threads is equal to the number of threads in the preset configuration file.
  14. 如权利要求13所述的终端,其特征在于,所述处理器在执行所述调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数时,具体执行如下步骤:The terminal according to claim 13, wherein the processor performs the following steps when performing the adjustment of the current number of threads of the task such that the number of threads is equal to the number of threads in the preset configuration file. :
    判断预设配置文件中的线程数是否大于所述任务当前的线程数;Determining whether the number of threads in the preset configuration file is greater than the current number of threads of the task;
    若大于所述任务当前的线程数,新建线程,其中,新建线程的数量为配置 文件中的线程数与任务当前的线程数的差值;If the number of threads of the task is greater than the current number of threads of the task, a new thread is created, wherein the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task;
    若小于所述任务当前的线程数,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为所述任务当前的线程数与预设配置文件中的线程数的差值。If the number of threads of the task is less than the current number of threads of the task, the thread is closed after the thread execution case ends, wherein the number of closed threads is the difference between the current number of threads of the task and the number of threads in the preset configuration file.
  15. 如权利要求13所述的终端,其特征在于,所述预设配置文件中的线程数的设置与当前时间有关,所述处理器在执行所述获取预设配置文件中的线程数时,具体执行如下步骤:The terminal according to claim 13, wherein the setting of the number of threads in the preset configuration file is related to a current time, and when the processor executes the acquiring the number of threads in the preset configuration file, the specific Perform the following steps:
    获取当前时间;Get the current time;
    获取预设配置文件中设置的当前时间对应的线程数。Gets the number of threads corresponding to the current time set in the default configuration file.
  16. 一种计算机可读存储介质,其特征在于,计算机可读存储介质存储有一个或者一个以上程序数据,所述一个或者一个以上程序数据可被一个或者一个以上的处理器执行,以实现以下步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores one or more program data, the one or more program data being executable by one or more processors to implement the following steps:
    获取案例集;Get the case set;
    根据案例集新建对新项目进行规则验证的任务;Newly perform the task of verifying rules for new projects based on the case set;
    配置用于执行所述任务的线程;Configuring a thread for performing the task;
    所述线程到所述案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行;The thread extracts the case state into an unexecuted case from the case set and modifies the case state of the case to be executed;
    所述线程利用所述案例到新项目中执行所有规则得到第一结果;The thread uses the case to execute all rules in the new project to obtain the first result;
    所述线程利用所述案例到旧项目中执行所有规则得到第二结果;The thread uses the case to execute all rules in the old project to obtain a second result;
    将所述第一结果与所述第二结果进行对比以得到对比结果。The first result is compared to the second result to obtain a comparison result.
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述步骤还包括:The computer readable storage medium of claim 16 wherein said step further comprises:
    判断案例集中是否有案例状态为未执行的案例;Determine whether there is a case in which the case status is unexecuted;
    若有案例状态为未执行的案例,判断是否达到预设时间;If there is a case in which the case status is unexecuted, it is judged whether the preset time is reached;
    若达到预设时间,返回配置用于执行所述任务的线程的步骤;若没有达到预设时间,返回所述线程到案例集中提取案例状态为未执行的案例并修改所述案例的案例状态为执行的步骤。If the preset time is reached, returning to the step of configuring a thread for executing the task; if the preset time is not reached, returning the thread to the case set to extract the case state as an unexecuted case and modifying the case state of the case is The steps performed.
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述处理器在执行所述配置用于执行所述任务的线程时,具体实现如下步骤:The computer readable storage medium according to claim 16, wherein the processor specifically implements the following steps when executing the thread configured to perform the task:
    获取预设配置文件中的线程数;Get the number of threads in the default configuration file;
    调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数。The current number of threads of the task is adjusted such that the number of threads is equal to the number of threads in the preset configuration file.
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述处理器在执行所述调整所述任务当前的线程数使该线程数等于所述预设配置文件中的线程数时,具体实现如下步骤:The computer readable storage medium of claim 18, wherein the processor is performing the adjusting the current number of threads of the task such that the number of threads is equal to the number of threads in the preset configuration file, The specific steps are as follows:
    判断预设配置文件中的线程数是否大于所述任务当前的线程数;Determining whether the number of threads in the preset configuration file is greater than the current number of threads of the task;
    若大于所述任务当前的线程数,新建线程,其中,新建线程的数量为配置文件中的线程数与任务当前的线程数的差值;If it is greater than the current number of threads of the task, create a new thread, wherein the number of newly created threads is the difference between the number of threads in the configuration file and the current number of threads of the task;
    若小于所述任务当前的线程数,在线程执行案例结束后关闭所述线程,其中关闭线程的数量为所述任务当前的线程数与预设配置文件中的线程数的差值。If the number of threads of the task is less than the current number of threads of the task, the thread is closed after the thread execution case ends, wherein the number of closed threads is the difference between the current number of threads of the task and the number of threads in the preset configuration file.
  20. 如权利要求18所述的计算机可读存储介质,其特征在于,所述预设配置文件中的线程数的设置与当前时间有关,所述处理器在执行所述获取预设配置文件中的线程数时,具体实现如下步骤:The computer readable storage medium according to claim 18, wherein the setting of the number of threads in the preset configuration file is related to a current time, and the processor is executing the thread in the acquiring a preset configuration file When the number is counted, the specific steps are as follows:
    获取当前时间;Get the current time;
    获取预设配置文件中设置的当前时间对应的线程数。Gets the number of threads corresponding to the current time set in the default configuration file.
PCT/CN2018/082228 2017-04-10 2018-04-09 Rule verification method, terminal, and storage medium WO2018188538A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710228800.2A CN108415823B (en) 2017-04-10 2017-04-10 Rule verification method and terminal
CN201710228800.2 2017-04-10

Publications (1)

Publication Number Publication Date
WO2018188538A1 true WO2018188538A1 (en) 2018-10-18

Family

ID=63125312

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/082228 WO2018188538A1 (en) 2017-04-10 2018-04-09 Rule verification method, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN108415823B (en)
WO (1) WO2018188538A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309184A (en) * 2008-05-28 2008-11-19 华为技术有限公司 Method and apparatus detecting failure of micro-engine
CN101599048A (en) * 2009-07-01 2009-12-09 福建星网锐捷网络有限公司 A kind of method and apparatus of internal memory monitoring
CN102508742A (en) * 2011-11-03 2012-06-20 中国人民解放军国防科学技术大学 Kernel code soft fault tolerance method for hardware unrecoverable memory faults
US20140032976A1 (en) * 2012-07-24 2014-01-30 Samsung Electronics Co., Ltd. Apparatus and method for detecting error
CN106326109A (en) * 2016-08-09 2017-01-11 北京金山安全软件有限公司 New application testing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040215579A1 (en) * 2003-04-24 2004-10-28 George Redenbaugh Supplemental address verification

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309184A (en) * 2008-05-28 2008-11-19 华为技术有限公司 Method and apparatus detecting failure of micro-engine
CN101599048A (en) * 2009-07-01 2009-12-09 福建星网锐捷网络有限公司 A kind of method and apparatus of internal memory monitoring
CN102508742A (en) * 2011-11-03 2012-06-20 中国人民解放军国防科学技术大学 Kernel code soft fault tolerance method for hardware unrecoverable memory faults
US20140032976A1 (en) * 2012-07-24 2014-01-30 Samsung Electronics Co., Ltd. Apparatus and method for detecting error
CN106326109A (en) * 2016-08-09 2017-01-11 北京金山安全软件有限公司 New application testing method and device

Also Published As

Publication number Publication date
CN108415823B (en) 2020-06-02
CN108415823A (en) 2018-08-17

Similar Documents

Publication Publication Date Title
KR102421672B1 (en) System and method for resource isolation and consumption in a multitenant application server environment
US9471353B1 (en) Isolating tenants executing in multi-tenant software containers
JP5861228B2 (en) System, apparatus, program and method for monitoring a virtual partition
US10467048B2 (en) Techniques for virtual machine migration
US9274798B2 (en) Multi-threaded logging
US9703611B1 (en) Isolating resources for utilization by tenants executing in multi-tenant software containers
US9513911B2 (en) Method of detecting stack overflows and processor for implementing such a method
US9754122B1 (en) Isolating tenants executing in multi-tenant software containers
CN104217139B (en) Processing system
CN107783829B (en) Task processing method and device, storage medium and computer equipment
US20200257460A1 (en) Securing a Memory Drive
TWI678615B (en) Debugging in a data processing apparatus
CN104484224B (en) A kind of server processes control method, apparatus and system
WO2019194873A1 (en) Method and system for kernel routine callbacks
US20130326528A1 (en) Resource starvation management in a computer system
US8930318B1 (en) Systems and methods for handling interruptions while updating of an electronic device
US9519528B2 (en) Checking undoability of an API-controlled computing system
WO2018188538A1 (en) Rule verification method, terminal, and storage medium
US20150052603A1 (en) Anti-tamper system with self-adjusting guards
CN109408265B (en) IOS abnormal operation protection method and device, terminal equipment and storage medium
US9430196B2 (en) Message inlining
US20230088318A1 (en) Remotely healing crashed processes
US20190278644A1 (en) Managing node failures in a computing environment
US20180260563A1 (en) Computer system for executing analysis program, and method of monitoring execution of analysis program
KR20140061470A (en) Secure key self-generation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18783857

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17/01/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18783857

Country of ref document: EP

Kind code of ref document: A1