Defrosting algorithm automatic testing method and system based on jenkins
By building automated test CI JOB tasks on the Jenkins platform and storing defrost algorithm scripts using MySQL database, automated testing of defrost algorithms is realized, solving the problems of low manual testing efficiency and waste of resources in the existing technology, and improving the testing efficiency and resource utilization.
Patent Information
- Application Number
- CN202411100175.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-08
AI Technical Summary
The existing defrost algorithm testing methods rely on manual testing, resulting in large amounts of data, strong personnel collaboration, large workload, low efficiency, and waste of human and material resources.
Using the Jenkins-based defrost algorithm automated testing method, we use data use case tables, call algorithms to execute data use case tables, extract key values, and build automated test CI JOB tasks on the Jenkins platform, and use MySQL database to store and execute defrost algorithm scripts. , realize automated testing.
The automated testing of the defrost algorithm is realized, which saves human and material resources, improves testing efficiency, and solves the problems of low efficiency and resource waste of manual testing.
Smart Images

Figure CN118916289A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of defrost algorithm testing, and more specifically to a Jenkins-based defrost algorithm automated testing method and system. Background Art
[0002] With the deepening of intelligent home appliances, people are pursuing intelligence while refrigerator users have higher and higher requirements for energy efficiency. In order to improve the energy efficiency of refrigerator use, the real data of the refrigerator's historical operating status is used as the basis for the refrigerator defrosting algorithm. By developing a complete solution of difference extraction algorithm, performance auxiliary judgment algorithm, decision algorithm and configuration analysis module, the defrosting heating time interval is dynamically adjusted to achieve "thousands of changes" in intelligent defrosting according to the user environment, so that the refrigerator's performance in energy saving, preservation, noise reduction and other aspects is improved.
[0003] The existing defrosting algorithm test mainly adopts the manual testing method, and the tester cooperates with the developer to test the data. That is, the tester first designs the relevant data use cases according to the algorithm rules and stores them in an Excel table. Each use case is an Excel table. The number of data use case tables based on the defrosting rules is more than 200. Then, during the test, the tester sends the data table of the corresponding use case to the developer. The developer locally uses the algorithm code to execute the corresponding data table and analyzes it, and extracts data values such as standard cycle difference, delay cycle difference, standard cycle fluctuation value, delay cycle fluctuation value, abnormal error, etc. according to the use case; at the same time, the tester locally checks the result values of the standard cycle difference, delay cycle difference, standard cycle fluctuation value, delay cycle fluctuation value, etc. corresponding to each data use case table, and compares them with the values executed by the developer's algorithm code. If the key values calculated by the two (key values: such as the number of differences, the size of the difference, the size of the fluctuation value, the size of the average value, the number of revolutions, the ambient temperature, etc.) correspond to each other, the test passes. Since there are more than 200 data use case tables involved in the algorithm rules, and new use case data may be added and the test data use cases may be re-regressed during the testing process, this manual testing method will waste a lot of manpower and material resources, and is time-consuming and inefficient.
[0004] In view of the defects of the currently commonly used defrost algorithm testing method, a Jenkins-based defrost algorithm automated testing method is proposed here to solve the above shortcomings. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention proposes a Jenkins-based defrosting algorithm automatic testing method and system.
[0006] A defrosting algorithm automated testing method based on Jenkins, comprising:
[0007] Construct data use case table;
[0008] Call the algorithm to execute the data use case table and extract the key values;
[0009] Extract key values locally;
[0010] The data results are compared, and the test passes if the preset conditions are met.
[0011] In some embodiments, the construction of the data use case table includes designing relevant data use cases according to algorithm rules in advance and storing them in a data use case table excel-n (n=1, 2, ..., N), each use case is an excel-n table, and all data use case tables based on defrosting rules are stored in a MySQL database.
[0012] In some embodiments, the calling algorithm executes the data use case table to extract the key value includes:
[0013] Build CI JOB tasks for automated testing on the central Jenkins;
[0014] Select the use case algorithm data table as the CI JOB execution parameter;
[0015] By running the defrost algorithm test script, the corresponding use case algorithm data table can be retrieved from the MySQL database; the required key values can be extracted according to different data use case tables.
[0016] In some embodiments, the key values include: the number of differences, the size of the differences, the size of the fluctuation value, the size of the average value, the number of revolutions, and the ambient temperature.
[0017] In some embodiments, the local extraction of key values includes: locally extracting key values required by the data use case table based on data in the data table excel-n (n=1, 2, ..., N).
[0018] In some embodiments, the data result comparison, if meeting preset conditions, means the test passes, including: comparing the key values extracted by executing the defrost algorithm script with the key values extracted by the local use case, if the key values extracted by the two correspond to each other, the test passes.
[0019] This embodiment also provides a defrosting algorithm automatic testing system based on Jenkins, including:
[0020] Central Jenkins module, used to establish CI JOB tasks;
[0021] CI JOB build module is used to perform build compilation. When the build compilation is called, the use case data table in the MySQL database is used as the CI JOB parameter.
[0022] The algorithm module is used to execute the algorithm script to realize the automated testing of the defrost algorithm.
[0023] The beneficial effects of the present invention are:
[0024] A significant advantage of the present invention is that it provides an automated testing method for a defrost algorithm based on Jenkins. The technical solution provided by the invention is easy to implement in the existing defrost algorithm testing solution, with small investment and quick return, and solves the problems of large amount of data, strong personnel collaboration and heavy workload in manual testing, saves human and material resources, and improves testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:
[0026] Figure 1 This is a flow chart of the automated testing method for the defrosting algorithm based on Jenkins;
[0027] Figure 2 : Flowchart of automated testing method for defrosting algorithm;
[0028] Figure 3 : Algorithm execution principle flow chart;
[0029] Figure 4 : System framework diagram. DETAILED DESCRIPTION
[0030] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0031] It should be understood that the "system", "device", "unit" and / or "module" used in this specification is a method for distinguishing different components, elements, parts, parts or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0032] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0033] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0034] See also Figure 1 , a defrost algorithm automated testing method based on Jenkins, comprising:
[0035] Construct a data use case table; that is, design relevant data use cases according to the algorithm rules in advance and store them in the data use case table excel-n (n=1,2,…,N,), each use case is an excel-n table, and store all data use case tables based on defrosting rules in the MySQL database. That is, store data use case tables excel-1, excel-2, excel-3,…, excel-N in the MySQL database.
[0036] The key values corresponding to each data table analyzed locally (key values: such as the number of differences, the size of the difference, the size of the fluctuation value, the size of the average value, the number of revolutions, the ambient temperature, etc.) are stored in an Excel table;
[0037] Call the algorithm to execute the data use case table and extract the key values; build the CIJOB task of automated testing on the central Jenkins;
[0038] Select the use case algorithm data table as the CI JOB execution parameter;
[0039] By running the defrost algorithm test script, the corresponding use case algorithm data table excel-n (n=1,2,…,N,) is retrieved from the MySQL database, and the required key values are extracted according to different data use case tables. The execution is repeated in sequence; that is, the defrost algorithm use case test is performed from n=1,…,N in sequence until n=N, and the current CI task is automatically terminated.
[0040] The key values include: number of differences, size of differences, size of fluctuations, size of average values, number of revolutions, ambient temperature, etc.
[0041] For the specific automated testing method of defrosting algorithm, see Figure 2 , depicting the CI JOB task of building automated testing on the central Jenkins described in the present invention. The method automatically executes the test cases of the defrosting algorithm by establishing a CI JOB on the Jenkins continuous integration platform, that is, using the data table excel-n (n=1,2,…,N,) in the database as the execution parameter of the CI JOB, and by building the CI JOB, all the use cases of the use case data tables excel-1, excel-2, excel-3,…,excel-N are executed, thereby realizing the automated testing of the defrosting algorithm. Of course, other algorithms can also be executed.
[0042] Extract key values locally; based on the data in the data table excel-n (n=1,2,…,N,), extract the key values required by the data use case table locally.
[0043] The data results are compared. If the preset conditions are met, the test passes. The key values extracted by the defrosting algorithm script are compared with the key values extracted by the local use case. If the key values extracted by the two correspond to each other, the test passes.
[0044] See also Figure 3 , Figure 3 The execution principle of the defrost algorithm is described. Through the CI JOB parameters in the central Jenkins, the use case data tables excel-1, excel-2, excel-3, ..., excel-N are selected as CI JOB execution parameters, and then the CI JOB is built and compiled, and the relevant compilation scripts are automatically executed. That is, by running the defrost algorithm test script, the data table excel-n (n=1,2,...,N) of the corresponding use case is retrieved from the MySQL database, and the execution is looped in sequence. The key values extracted after each execution are compared with the data stored locally in the Excel table. If the key values extracted from the two (key values: such as the number of differences, the size of the difference, the size of the fluctuation value, the size of the average value, the number of revolutions, the ambient temperature, etc.) correspond to each other, the test passes; that is, the defrost algorithm use case test is performed from n=1,...,N in sequence until n=N, and the current CI task is automatically terminated.
[0045] See also Figure 4 , depicts the system block diagram of the defrost algorithm principle, an automated testing system for the defrost algorithm based on Jenkins, including: establishing a CI JOB through the central Jenkins module, and then executing the build compilation through the CI JOB build module. When the build compilation is called, the use case data table in the MySQL database is used as the CI JOB parameter, and the algorithm script is executed to realize the automated testing of the defrost algorithm.
[0046] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.
Claims
1. A defrosting algorithm automated testing method based on Jenkins, characterized in that: include: Construct data use case table; Call the algorithm to execute the data use case table and extract the key values; Extract key values locally; The data results are compared, and the test passes if the preset conditions are met.
2. The automated testing method for defrosting algorithm based on Jenkins according to claim 1, characterized in that: The construction of the data use case table includes designing relevant data use cases according to algorithm rules in advance and storing them in a data use case table excel-n (n=1,2,…,N,), each use case is an excel-n table, and all data use case tables based on defrosting rules are stored in a MySQL database.
3. The automated testing method for defrosting algorithm based on Jenkins according to claim 1, characterized in that: The calling algorithm executes the data use case table and extracts the key values including: Build CI JOB tasks for automated testing on the central Jenkins; Select the use case algorithm data table as the CI JOB execution parameter; By running the defrost algorithm test script, the corresponding use case algorithm data table can be retrieved from the MySQL database; the required key values can be extracted according to different data use case tables.
4. The automated testing method for defrosting algorithm based on Jenkins according to claim 3, characterized in that: The key values include: number of differences, size of differences, size of fluctuations, size of average values, number of revolutions, and ambient temperature.
5. The automated testing method for defrosting algorithm based on Jenkins according to claim 3, characterized in that: The locally extracting key values includes: locally extracting key values required by the data use case table according to data in the data table excel-n (n=1, 2, ..., N).
6. The automated testing method for defrosting algorithm based on Jenkins according to claim 5, characterized in that: The data result comparison, if meeting the preset conditions, the test passes, including: comparing the key values extracted by executing the defrost algorithm script with the key values extracted by the local use case, if the key values extracted by the two correspond to each other, the test passes.
7. A defrosting algorithm automatic testing system based on Jenkins, characterized in that: The method for implementing any one of claims 1 to 6 comprises: Central Jenkins module, used to establish CI JOB tasks; CI JOB build module is used to perform build compilation. When the build compilation is called, the use case data table in the MySQL database is used as the CI JOB parameter. The algorithm module is used to execute the algorithm script to realize the automated testing of the defrost algorithm.
