Premium calculation model testing method, system, device and storage medium
By using a premium calculation model testing method based on multi-threaded calls and a preset error model scoring comparison relationship, the problem of low testing efficiency in complex scenarios is solved, and efficient and accurate premium calculation model testing is achieved.
Patent Information
- Application Number
- CN202210709736.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2042-06-22
AI Technical Summary
Existing premium calculation model testing methods are inefficient in complex scenarios, making it difficult to meet the needs of rapid market response. They also have high labor costs and cannot adapt to the diverse needs of different insurance companies and business scenarios.
The test interface of the target premium calculation model is called in a multi-threaded manner. By obtaining and combining preset model test parameters and dependent parameters, and combining them with preset error model scoring comparison relationship, the premium calculation model is tested automatically.
It has achieved automated testing, improved testing efficiency, reduced labor costs, and enhanced testing efficiency and accuracy, while supporting verification of multi-dimensional testing scenarios.
Smart Images

Figure CN114971926B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular, to a premium calculation model testing method, system, device and storage medium. BACKGROUND
[0002] With the development of the insurance industry and the technology industry, the premium calculation model of the vehicle insurance business has become more intelligent, and the calculation process has become more complex. The premium calculation models corresponding to different insurance companies and different business scenarios are different, and the testing work of the premium calculation model is very important. The current mainstream automatic testing methods include page automation and interface automation. Page automation is biased towards page function coverage, has poor stability and takes a long time. The commonly used tools of interface automation currently rely on manual assembly of test input parameters and expected results of interfaces. In complex calculation scenarios, a large amount of insurance policy data is usually used to test the premium calculation model. For complex calculation scenarios, manual assembly of single input parameters requires a large amount of human cost investment. This testing method cannot meet the requirements and cannot adapt to the goal of rapid market response.
[0003] Therefore, there is an urgent need for a premium calculation model batch testing method that can automatically test the premium calculation model in complex scenarios. SUMMARY
[0004] The present application provides a premium calculation model testing method, system, device and storage medium, which mainly aims to automatically test the premium calculation model in complex scenarios and effectively improve the testing efficiency of the premium calculation model.
[0005] In a first aspect, the present application provides a premium calculation model testing method, comprising: obtaining preset model test parameters corresponding to insurance policy test data, preset model dependency parameters corresponding to insurance policy dependency data, and a theoretical premium value corresponding to the insurance policy test data;
[0006] According to the preset model configuration parameters, effective model test parameters are extracted from the preset model test parameters, and effective model dependency parameters are extracted from the preset model dependency parameters, to obtain an input parameter combination;
[0007] The input parameter combination is used as an input parameter of a preset test program, and the preset test program is executed to obtain a test result. The preset test program calls a test interface corresponding to a target premium calculation model in a multi-threaded manner, and the test result is calculated by the test interface and returned to the preset test program;
[0008] extract an actual premium value corresponding to the policy test data from the test result, and obtain a test score of the target premium calculation model according to the actual premium value and the theoretical premium value and in combination with a preset error model score reference relationship.
[0009] Preferably, the extracting of the actual premium value corresponding to the policy test data from the test result comprises:
[0010] According to a preset field position, a corresponding field position in the test result is located, and according to the preset field name, the actual premium value is filtered out from the corresponding field position.
[0011] Preferably, the theoretical premium value comprises an intermediate theoretical result value and a final theoretical premium value, the actual premium value comprises an intermediate test result value and a final test premium value, and the obtaining of the test score of the target premium calculation model according to the actual premium value and the theoretical premium value and in combination with a preset error model score reference relationship comprises:
[0012] The intermediate test result and the intermediate theoretical result are compared, if an error between the intermediate test result and the intermediate theoretical result is outside a preset intermediate error range, the test score is set to be the lowest, otherwise, the final test premium value and the final theoretical premium value are continuously compared;
[0013] If an error between the final test premium value and the final theoretical premium value is outside a preset final error range, the test score is set to be the lowest, otherwise, the test score is obtained according to the error between the final test premium value and the final theoretical premium value and in reference to the preset error model score reference relationship.
[0014] Preferably, the comparing of the intermediate test result and the intermediate theoretical result, if the error between the intermediate test result and the intermediate theoretical result is outside the preset intermediate error range, the test score is set to be the lowest, and then further comprising:
[0015] A target intermediate test result is obtained from the intermediate test result, and an error between the target intermediate test result and the intermediate theoretical result is outside the preset intermediate error range;
[0016] A calculation step corresponding to the target intermediate test result in the target premium calculation model is obtained, and a position where a calculation error exists in the target premium calculation model is determined according to the calculation step.
[0017] Preferably, the preset model configuration parameters comprise test input parameters and dependent input parameters, the effective model test parameters are extracted from the preset model test parameters according to the preset model configuration parameters, the effective model dependent parameters are extracted from the preset model dependent parameters according to the preset model configuration parameters, and the input parameter combination is obtained, comprising:
[0018] The effective model test parameters are extracted from the preset model test parameters according to the test input parameters;
[0019] The effective model dependent parameters are extracted from the preset model dependent parameters according to the dependent input parameters;
[0020] The input parameter combination is determined by combining the attribute values corresponding to the effective model test parameters and the attribute values corresponding to the effective model dependent parameters under various conditions.
[0021] Preferably, the input parameter combination comprises at least one attribute value corresponding to the effective model dependent parameters.
[0022] Preferably, the target premium calculation model is a car insurance calculation model, the policy test data at least comprises running data of an insured vehicle, and the policy dependent data comprises a price of the insured vehicle, a type of car insurance, and historical insurance situations.
[0023] In a second aspect, an embodiment of the present application provides a premium calculation model test system, comprising:
[0024] A parameter acquisition module is configured to acquire preset model test parameters corresponding to policy test data, preset model dependent parameters corresponding to policy dependent data, and a theoretical premium value corresponding to the policy test data.
[0025] A parameter combination module is configured to extract effective model test parameters from the preset model test parameters according to preset model configuration parameters, extract effective model dependent parameters from the preset model dependent parameters according to the preset model configuration parameters, and obtain an input parameter combination.
[0026] A result calculation module is configured to take the input parameter combination as an input parameter of a preset test program, execute the preset test program, obtain a test result, and call a test interface corresponding to a target premium calculation model in a multi-threaded manner according to the preset test program.
[0027] A test score module is configured to extract an actual premium value corresponding to the policy test data from the test result, and obtain a test score of the target premium calculation model according to the actual premium value, the theoretical premium value, and a preset error model score reference relationship.
[0028] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the premium calculation model testing method when executing the computer program.
[0029] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program, and the computer program implements the steps of the premium calculation model testing method when executed by a processor.
[0030] The premium calculation model testing method, system, device and storage medium provided by the embodiment of the present application first acquire preset model testing parameters corresponding to the policy testing data and preset model dependent parameters corresponding to the policy dependent data. The policy testing data and the policy dependent data are generally data in a regular life. In order to enable the data to be recognized and used by the preset testing program, the data needs to be converted into preset model testing parameters and preset model dependent parameters matched with the preset testing program. Then, since not all preset model testing parameters and preset model dependent parameters are required by the preset testing program, the effective model testing parameters and the effective model dependent parameters are extracted from the preset model testing parameters and the preset model dependent parameters according to preset model configuration parameters, and an input parameter combination is obtained. Next, the input parameter combination is input into the preset testing program. The preset testing program calls a test interface corresponding to the target premium calculation model in a multi-threaded manner. Since the test interface is called in a multi-threaded manner, the input parameter combination corresponding to the policy testing data and the policy dependent data in multiple different scenarios can be simultaneously input into the preset testing program. The test interface is called in a multi-threaded manner, and the test of the target premium calculation model in multiple scenarios is simultaneously completed. The embodiment of the present application supports the test personnel to flexibly define preset model configuration parameters, preset error model scoring comparison relationships and other data. Through the multi-threaded parameter assembly manner, the difference between the actual premium value and the theoretical premium value is quickly compared and counted. The target premium model can be simultaneously verified by using data samples in different scenarios without manual assistance. The test labor input is greatly reduced, and the test efficiency and the test quality are improved. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 A scene schematic diagram of the premium calculation model testing method provided by the embodiment of the present application is shown in FIG. 1.
[0032] Figure 2 A flowchart of the premium calculation model testing method provided by the embodiment of the present application is shown in FIG. 2.
[0033] Figure 3 A structure schematic diagram of the premium calculation model testing system provided by the embodiment of the present application is shown in FIG. 3.
[0034] Figure 4 Fig. 1 is a structural schematic diagram of a computer device provided in an embodiment of the present application.
[0035] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0036] It should be understood that the specific embodiments described herein merely set forth preferred combinations of components and / or other features, and that persons of ordinary skill in the art will be able to make various changes and modifications to the embodiments described herein without departing from the spirit and scope of the present application.
[0037] Figure 1 Fig. 4 is a scene schematic diagram of a premium calculation model test method provided in an embodiment of the present application, as shown in the figure, a user inputs policy test data, policy dependent data and theoretical premium value corresponding to the policy test data on a client, and sends the policy test data and the policy dependent data to a server, after the server receives the policy test data and the policy dependent data, the server executes the premium calculation model test method to test a target premium calculation model. Figure 1
[0038] It should be noted that the server can be implemented by an independent server or a server cluster composed of multiple servers. The client can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto. The client and the server can be connected through Bluetooth, a USB (Universal Serial Bus) or other communication connection manners, and the embodiments of the present application do not limit the connection manners.
[0039] Figure 2 Fig. 5 is a flowchart of a premium calculation model test method provided in an embodiment of the present application, as shown in the figure, the method comprises the following steps. Figure 2
[0040] The embodiment of the present application provides a kind of to target premium calculation model is tested method, premium calculation model can be regarded as a kind of mathematical calculation model, its input is the parameter related to insured object, output is the insurance premium that needs to be paid and other related information, such as, when the premium calculation model is medical insurance calculation model, its input parameter is the gender of insured person, age, occupation, insurance limit, whether to pay staff medical insurance or resident medical insurance, history disease etc., output parameter is the insurance premium that is paid per year under the condition of paying per year, the insurance premium that is paid per month under the condition of paying per month;When the premium calculation model is car insurance calculation model, input parameter is the model, price, service life etc.of insured vehicle, output parameter is " the insurance premium that needs to be paid every year when the insurance limit is A " " the insurance premium that needs to be paid every year when the insurance limit is B " etc., A and B indicate different size of insurance limit.It can be seen that the premium calculation model corresponding to different scene different insurance company is not the same, and the specific calculation formula of premium calculation model can be determined according to actual conditions.The insurance premium that insured person should pay can be obtained by inputting relevant parameters into premium calculation model, and premium calculation model is generally developed by professional personnel, and professional personnel develops after, in order to verify its accuracy, premium calculation model usually needs to be tested.Target premium calculation model is the premium calculation model that needs to be tested.
[0041] S210, obtain the preset model test parameter corresponding to the policy test data, the preset model dependent parameter corresponding to the policy dependent data and the theoretical premium value corresponding to the policy test data;
[0042] In order to test target premium calculation model, a certain number of policies need to be obtained from relevant insurance company, and the policy test data and the policy dependent data of each insured object are usually recorded in the policy, the policy test data refers to the parameter that has direct influence on target premium calculation model, such as when target premium calculation model is car insurance premium calculation model, it is easy to understand that the higher the price of the insured vehicle, the higher the premium, these parameters are basically linearly related with premium, so the price of the insured vehicle can be regarded as policy test data;And the policy dependent data is the level that determines the premium, such as the historical number of insured times of the insured vehicle, if the historical number of insured times of the vehicle owner of the insured vehicle is more, then under other equal conditions, the premium of the vehicle owner with less number of insured times will be lower, so the historical number of insured times of the vehicle owner of the insured vehicle can be regarded as dependent parameter.Policy dependent parameter can determine the range interval of insurance premium, such as between 2000 and 3000, or between 3000 and 4000, and policy test data can determine the specific value of premium in the range interval.Generally, for specific target premium calculation model, specific premium test data, premium dependent data and theoretical premium value are agreed in advance.
[0043] The preset model test parameters corresponding to the premium test data are obtained, the premium test data is extracted from the insurance policy, generally, parameters such as age, gender and occupation, the record of the premium test data is age: 28, gender: male, occupation: doctor, the target premium calculation model is realized by programming in the specific implementation, and for the convenience of expression in the programming, the Chinese parameters are generally not directly expressed, but the corresponding English parameters are taken for each Chinese parameter, and the preset model prediction parameter is a parameter that can be recognized and used by the target premium calculation model, for example, age corresponds to age, gender corresponds to sex, and occupation corresponds to occupation, and the preset model prediction parameter corresponding to "age: 28" is "age = 28", the preset model prediction parameter corresponding to "gender: male" is "sex = female", and the preset model prediction parameter corresponding to "occupation: doctor" is "occupation = doctor". The theoretical premium value corresponding to the premium test data refers to the theoretical premium value calculated by the premium calculation formula under the current condition, which can be manually calculated according to the theoretical calculation rule of the target premium calculation model, or can be calculated according to the calculation formula of the target premium calculation model, and is determined according to the actual situation, and the embodiment of the present application is not limited herein.
[0044] In S220, according to the preset model configuration parameter, the effective model test parameter is extracted from the preset model test parameter, and the effective model dependent parameter is extracted from the preset model dependent parameter, and the input parameter combination is obtained.
[0045] According to the preset model configuration parameter, the effective model test parameter is filtered from the preset model test parameter, and the effective model dependent parameter is extracted from the preset model dependent parameter, and the input parameter combination is obtained. The preset model configuration parameter is a parameter that needs to be input into the preset test program in advance, the preset model test parameter only extracts all parameters related to the insurance premium, but not all preset model test parameters need to be input into the preset test program; the preset model dependent parameter is also a dependent parameter related to the target premium calculation model in advance, but not all preset model dependent parameters need to be input into the preset test program, therefore, according to the preset model configuration parameter, the effective model dependent parameter is extracted from the preset model dependent parameter, the attribute value corresponding to the effective model test parameter and the attribute value corresponding to the effective model dependent parameter are combined to obtain the input parameter combination. For example, there are two payment methods of annual payment and monthly payment, in order to test the accuracy of the target premium calculation model under different payment methods, the target premium calculation model needs to be tested under the two payment methods, therefore, the premium payment method is taken as the effective model dependent parameter, and the annual payment and the monthly payment are taken as the attribute values, at least two groups of input parameter combinations can be obtained.
[0046] The conventional method usually only considers the test result in a single dimension when testing the target premium calculation model, and cannot consider the test situation in multiple dimensions. The test method cannot comprehensively consider various test dimensions. In the embodiment of the present application, the attribute values corresponding to the effective model test parameters and the effective model dependent parameters are combined to obtain input parameter combinations under different conditions, so as to test and verify the accuracy of the target premium calculation model under different combination conditions. The accuracy of the test method can be further improved.
[0047] S230, the input parameter combination is used as an input parameter of a preset test program, and the preset test program is executed to obtain a test result. The preset test program calls a test interface corresponding to the target premium calculation model in a multi-threaded manner. The test result is calculated by the test interface and returned to the preset test program;
[0048] Each input parameter combination is used as an input parameter of a preset test program. The preset test program can be regarded as a main function, which belongs to the main body of the test method. In the execution process, a function corresponding to the target premium calculation model is called. In the execution process of the preset test program, a test interface corresponding to the target premium calculation model is called. The target premium calculation model is encapsulated into the appearance of the test interface. Different test interfaces corresponding to different target premium calculation models are different. The test interface calculates the test result according to the input parameter combination, and returns the test result to the preset test program. The preset test program accepts the test result returned by the test interface. The specific content contained in the test result is also determined according to actual needs. The test result can only include the final insurance premium, or can include the intermediate result obtained in each step and the final insurance premium. The specific content is determined according to actual conditions, and the embodiment of the present application does not make specific limitation.
[0049] S240, the actual premium value corresponding to the policy test data is extracted from the test result, and the test score of the target premium calculation model is obtained according to the actual premium value, the theoretical premium value, and a preset error model score comparison relationship.
[0050] Then, actual premium values corresponding to the premium test data are extracted from the test result, which can contain other information besides the premium values, so the test result needs to be data-extracted to extract the actual premium values corresponding to the premium test data from the test result. For example, the test result includes two intermediate results and one final result, and the data structure of the test result is "temp1=a1, temp2=a2, final=b", where temp1 represents the first intermediate result, temp2 represents the second intermediate result, and final represents the final result. In the embodiment of the present application, only the final result needs to be extracted, so the actual value b corresponding to the final parameter is extracted in a pre-agreed manner, and the obtained b is the corresponding actual premium value. After obtaining the actual premium value, the actual premium value and the theoretical premium value are compared. In the embodiment of the present application, comparing the actual premium value and the theoretical premium value means calculating the error between the actual premium value and the theoretical premium value, and then combining a preset error model score comparison relationship. The preset error model score comparison relationship is also set in advance, and the comparison relationship represents the comparison relationship between the error size and the model performance. The model performance can be represented by three levels of "high", "medium" and "low". When the error is within a first range, the model performance corresponds to high; when the error is within a second range, the model performance corresponds to medium; and when the error is within a third range, the model performance is low. The first range, the second range and the third range can be determined according to the actual situation. The model performance can also be represented by scoring, such as 90 points when the error is within a fourth range and 80 points when the error is within a fifth range. The fourth range and the fifth range can be determined according to the actual situation. According to the actual error and the preset error model score comparison relationship, a test score of the target premium calculation model is obtained.
[0051] The test method of the premium calculation model provided in the embodiment of the present application firstly acquires preset model test parameters corresponding to the test data of the insurance policy, and acquires preset model dependency parameters corresponding to the dependency data of the insurance policy. Generally, the test data of the insurance policy and the dependency data of the insurance policy are data in the routine life. In order to enable the data to be recognized and used by the preset test program, the data needs to be converted into preset model test parameters and preset model dependency parameters matched with the preset test program. Then, since not all of the preset model test parameters and the preset model dependency parameters are required by the preset test program, the effective model test parameters and the effective model dependency parameters are extracted from the preset model test parameters and the preset model dependency parameters according to preset model configuration parameters, so as to obtain an input parameter combination. Next, the input parameter combination is input into the preset test program. The preset test program calls a test interface corresponding to the target premium calculation model in a multi-threaded manner. Since the test interface is called in the multi-threaded manner, the input parameter combination corresponding to the test data of the insurance policy and the dependency data of the insurance policy in multiple different scenarios can be simultaneously input into the preset test program, and the test of the target premium calculation model in multiple different scenarios is simultaneously completed through the multi-threaded calling of the test interface.
[0052] The embodiment of the present application supports the test personnel to flexibly define preset model configuration parameters, preset error model score comparison relationships and other data. Through the multi-threaded assembly of parameters, the differences between the actual premium value and the theoretical premium value are quickly compared and counted. The target premium model can be simultaneously verified by using data samples in different scenarios without manual assistance, which greatly reduces the investment of test labor, improves the test efficiency and the test accuracy. In addition, in the traditional method, only the test result in a single situation is considered when the target premium calculation model is tested, and multiple-dimensional test situations cannot be considered. In the embodiment of the present application, the attribute values corresponding to the effective test parameters and the effective model dependency parameters are combined to obtain input parameter combinations under different conditions, so that the accuracy of the target premium calculation model under different combination conditions is tested and verified, and the accuracy of the test method can be further improved.
[0053] Preferably, the extracting of the actual premium value corresponding to the test data of the insurance policy from the test result comprises:
[0054] According to the preset field position, the corresponding field position in the test result is located, and according to the preset field name, the actual premium value is filtered from the corresponding field position.
[0055] The embodiment of the present application extracts the policy test data from the test result, the data structure of the test result is fixed, for example, if the data structure of the test result is "temp1=a1, temp2=a2, final=b", since the data structure is fixed, and the embodiment of the present application extracts "final" which is the preset field, the field position and the field name corresponding to "final" are fixed and known, thus the required data can be quickly found through the preset field position, when the data structure corresponding to the test result is complex and large, firstly, the position of the "final" field is located through the preset field position, the searching speed is accelerated, and the searching efficiency is improved; in addition, in order to further confirm that the extracted field is correct, the located field position is compared with the preset field name, if both are the same, the attribute value corresponding to the field is extracted, if not, it is indicated that there is an error, and the program is exited.
[0056] In the embodiment of the present application, the required field in the test result is located through the preset field position, the program searching process can be accelerated, and the searching efficiency is improved; then, the located position is confirmed to be correct through the preset field name, and the accuracy of the test result can be ensured.
[0057] On the basis of the above embodiment, preferably, the theoretical premium value includes an intermediate theoretical result value and a final theoretical premium value, the actual premium value includes an intermediate test result value and a final test premium value, and the test score of the target premium calculation model is obtained according to the actual premium value and the theoretical premium value in combination with a preset error model score-contrast relationship, including:
[0058] The intermediate test result and the intermediate theoretical result are compared, if the error between the intermediate test result and the intermediate theoretical result is outside a preset intermediate error range, the test score is set to be the lowest, otherwise, the final test premium value and the final theoretical premium value are continuously compared;
[0059] If the error between the final test premium value and the final theoretical premium value is outside a preset final error range, the test score is set to be the lowest, otherwise, the test score is obtained according to the error between the final test premium value and the final theoretical premium value, with reference to the preset error model score-contrast relationship.
[0060] Specifically, the theoretical premium value in the embodiment of the present application includes intermediate theoretical result values and a final theoretical premium value, the intermediate result theoretical values refer to intermediate values output by each calculation step of the target premium calculation model, and the final theoretical premium value refers to a final output value of the target premium calculation model in theory. For example, the target premium calculation model is composed of five steps, and the intermediate results corresponding to each step are m1, m2, m3, and m4, and the final output value is m1+m2+m3+m4=m5, so the intermediate theoretical results included in the theoretical premium value are m1, m2, m3, and m4, and the final theoretical premium value is m5. Similarly, the actual premium value also includes intermediate test results and a final test premium value, the intermediate test results are intermediate values output by each intermediate step in the test process, and are m1', m2', m3', and m4', and the final test premium value is m5'. In the embodiment of the present application, when comparing the error between the actual premium value and the theoretical premium value, not only the error between the final theoretical premium value and the final test premium value is compared, but also the error between each intermediate theoretical result and intermediate test result is compared, so that not only the final test result output by the target premium calculation model is ensured to be correct, but also each intermediate calculation step of the target premium calculation model is ensured to be correct, and the accuracy of the test result is ensured to the greatest extent.
[0061] The specific test steps are as follows: first, the error between the intermediate test result and the intermediate theoretical result is compared, when there are multiple intermediate test results and intermediate theoretical results, the error between each intermediate test result and each intermediate theoretical result is compared, for example, the error of m1 and m1', m2 and m2', m3 and m3', and m4 and m4' is compared, if the error of the four items is within the preset intermediate error range, it is indicated that each intermediate result output by the target premium calculation model is correct, and the preset intermediate error range is determined according to the actual situation, which is not specifically limited in the embodiment of the present application. Then, the error between the final theoretical premium value and the final test premium value is compared, and the score of the target premium calculation model is obtained according to the comparison of the error and the preset error model scoring relationship. Specifically, if the error between the final theoretical premium value and the final test premium value is within the preset final error range, the target premium calculation model is scored according to the specific range of the error, if the error between the final theoretical premium value and the final test premium value is outside the preset final error, it is indicated that the difference between the output result of the target premium calculation model and the final theoretical premium value is large, and the output result of the target premium calculation model is incorrect, so the target premium calculation model is directly given the lowest score, indicating that the test result of the target premium calculation model is failed.
[0062] In addition, if the error of any one of the intermediate test result and the intermediate theoretical result is outside the preset intermediate error range, that is, the error of any one of m1 and m1', m2 and m2', m3 and m3', and m4 and m4' is outside the preset intermediate error range, it indicates that the calculation of a step in the calculation process of the target premium calculation model is completely wrong. In this case, no matter how large the error between the final test premium value and the final theoretical premium value is, it is not necessary to compare the final test premium value and the final theoretical premium value, and the score of the target premium calculation model is directly set to the lowest, indicating that the test result of the target premium calculation model is failed.
[0063] In the embodiment of the present application, when comparing the theoretical premium value and the actual premium value, the intermediate test result value and the intermediate theoretical result value are compared first. When the error between the intermediate test result value and the theoretical test result value is outside the preset intermediate error range, the score of the target premium calculation model is directly determined as the lowest score without comparing the final test result value and the final theoretical result value. In this way, the scoring process can be accelerated and the test efficiency can be improved. Only when the errors of the intermediate test result value and the intermediate theoretical result value are within the preset intermediate error range, the final test result value and the final theoretical result value are compared. Not only is it ensured that the error between the final test result value and the final theoretical result value is within the preset final error range, but also it is ensured that each intermediate calculation process of the target premium calculation model is correct, which can further improve the accuracy of the test result.
[0064] On the basis of the above-mentioned embodiment, preferably, the comparison of the intermediate test result and the intermediate theoretical result, if the error between the intermediate test result and the intermediate theoretical result is outside the preset intermediate error range, the test score is set to the lowest, and then further comprising:
[0065] obtaining a target intermediate test result from the intermediate test result, the error between the target intermediate test result and the intermediate theoretical result being outside the preset intermediate error range;
[0066] obtaining a calculation step corresponding to the target intermediate test result in the target premium calculation model, and determining the position of the calculation error in the target premium calculation model according to the calculation step.
[0067] When the target premium calculation model is determined as not passing, first, compare which intermediate test result value produces the error, for example, the error between m4 and m4' is outside the preset intermediate error range, while the errors between m1 and m1', m2 and m2', and m3 and m3' are all within the preset intermediate error range, m4 is the target intermediate test result, and the calculation step corresponding to m4 is the calculation step that needs to be found, which indicates that the fourth step of the target premium calculation model has an error, and the fourth step of the target premium calculation model can be located to find the problem; if the errors between m3 and m3' and m4 and m4' are both outside the preset intermediate error range, while the errors between m1 and m1' and m2 and m2' are both within the preset intermediate error range, m3 and m4 are the target intermediate test results, and the calculation step corresponding to m3 and m4 is the calculation step that needs to be found, then it can be determined that the third step of the target premium calculation model has an error, and whether the fourth step has an error needs to be determined according to the specific situation, which can first find the error in the third step, and then determine whether the fourth step has an error.
[0068] When the target premium calculation model is determined as not passing, since the intermediate test result value is calculated in the embodiment of the application, which intermediate test result value is wrong can be determined to locate where the error in the target premium calculation model occurs, which can assist the test personnel to quickly locate the problem.
[0069] On the basis of the above embodiment, preferably, the preset model configuration parameters include test input parameters and dependent input parameters, the effective model test parameters are extracted from the preset model test parameters according to the preset model configuration parameters, the effective model dependent parameters are extracted from the preset model dependent parameters according to the preset model configuration parameters, and the input parameter combination is obtained, including:
[0070] The effective model test parameters are extracted from the preset model test parameters according to the test input parameters;
[0071] The effective model dependent parameters are extracted from the preset model dependent parameters according to the dependent input parameters;
[0072] The input parameter combination under various conditions is determined by combining the attribute values corresponding to the effective model test parameters and the attribute values corresponding to the effective model dependent parameters.
[0073] In the embodiment of the present application, the preset model configuration parameters include test input parameters and dependent input parameters, the test input parameters refer to input parameters required by the target premium calculation model, and the dependent input parameters refer to dependent parameters required by the target premium calculation model. Since not all data in the preset model test parameters are useful, the effective model test parameters are extracted from the preset model test parameters according to the test input parameters, and the effective model dependent parameters are extracted from the preset model dependent parameters according to the dependent input parameters. Then, the attribute values corresponding to the effective model test parameters and the attribute values corresponding to the effective model dependent parameters are combined to obtain input parameter combinations in different scenarios. In the embodiment of the present application, the input parameter combinations are obtained by combining the attribute values corresponding to the effective model test parameters and the attribute values corresponding to the effective model dependent parameters. The input parameter combinations at least include the attribute values corresponding to the effective model dependent parameters, and the effective model dependent parameters can be used as a restriction condition.
[0074] According to the embodiment of the present application, the attribute values corresponding to the effective model test parameters and the attribute values corresponding to the effective model dependent parameters are combined, and the input parameter combinations of the target premium calculation model in different scenarios can be obtained, so that the multi-dimensional test of the target premium calculation model is realized.
[0075] On the basis of the above-mentioned embodiment, preferably, the target premium calculation model is a vehicle insurance calculation model, the policy test data at least includes running data of the insured vehicle, and the policy dependent data includes the price of the insured vehicle, the type of vehicle insurance, and the historical insurance situation.
[0076] Specifically, when the target premium calculation model is a vehicle insurance calculation model, the policy test data at least includes running data of the insured vehicle, and the running data includes driving mileage, etc. The policy dependent data includes the price of the insured vehicle, the type of vehicle insurance, and the historical insurance situation, etc.
[0077] Figure 3 A structure diagram of a premium calculation model test system provided by the embodiment of the present application is shown in FIG. 3. Figure 3 As shown in FIG. 3, the system includes a parameter acquisition module 310, a parameter combination module 320, a result calculation module 330, and a test scoring module 340, wherein:
[0078] The parameter acquisition module 310 is configured to acquire preset model test parameters corresponding to policy test data, preset model dependent parameters corresponding to policy dependent data, and a theoretical premium value corresponding to the policy test data.
[0079] The parameter combination module 320 is configured to extract effective model test parameters from the preset model test parameters and extract effective model dependent parameters from the preset model dependent parameters according to preset model configuration parameters, and acquire input parameter combinations.
[0080] The result calculation module 330 is configured to combine the input parameters as input parameters of a preset test procedure, execute the preset test procedure, obtain a test result, and the preset test procedure calls a test interface corresponding to the target premium calculation model in a multi-threaded manner, and the test result is calculated by the test interface and returned to the preset test procedure.
[0081] The test score module 340 is configured to extract an actual premium value corresponding to the policy test data from the test result, and obtain a test score of the target premium calculation model according to the actual premium value and the theoretical premium value and a preset error model score reference relationship.
[0082] The embodiment is a system embodiment corresponding to the above method, and details are referred to the above method embodiment, which will not be described here.
[0083] On the basis of the above embodiment, preferably, the test score module comprises a positioning and screening unit, wherein:
[0084] The positioning and screening unit is configured to locate a corresponding field position in the test result according to a preset field position, and screen the actual premium value from the corresponding field position according to the preset field name.
[0085] On the basis of the above embodiment, preferably, the result calculation module comprises a comparison unit and a scoring unit, wherein:
[0086] The comparison unit is configured to compare the intermediate test result and the intermediate theoretical result, if an error between the intermediate test result and the intermediate theoretical result is outside a preset intermediate error range, set the test score to the lowest, otherwise, continue to compare the final test premium value and the final theoretical premium value.
[0087] The scoring unit is configured to if an error between the final test premium value and the final theoretical premium value is outside a preset final error range, set the test score to the lowest, otherwise, according to the error between the final test premium value and the final theoretical premium value, refer to the preset error model score reference relationship to obtain the test score.
[0088] On the basis of the above embodiment, preferably, the result calculation module further comprises a first positioning module and a second positioning module, wherein:
[0089] The first positioning module is configured to obtain a target intermediate test result from the intermediate test result, and an error between the target intermediate test result and the intermediate theoretical result is outside the preset intermediate error range.
[0090] The second positioning module is configured to acquire a calculation step corresponding to the target intermediate test result in the target premium calculation model, and determine a position of a calculation error in the target premium calculation model according to the calculation step.
[0091] On the basis of the above-mentioned embodiments, preferably, the parameter combination module comprises a test input parameter unit, a dependent input parameter unit and a combination unit, wherein:
[0092] The test input parameter unit is configured to extract effective model test parameters from the preset model test parameters according to the test input parameters;
[0093] The dependent input parameter unit is configured to extract effective model dependent parameters from the preset model dependent parameters according to the dependent input parameters;
[0094] The combination unit is configured to combine attribute values corresponding to the effective model test parameters and attribute values corresponding to the effective model dependent parameters to determine the input parameter combination under various conditions.
[0095] On the basis of the above-mentioned embodiments, preferably, the input parameter combination comprises at least one attribute value corresponding to an effective model dependent parameter.
[0096] On the basis of the above-mentioned embodiments, preferably, the target premium calculation model is a vehicle insurance calculation model, the policy test data at least comprises running data of an insured vehicle, and the policy dependent data comprises a price of the insured vehicle, a type of vehicle insurance and historical insurance situations.
[0097] The above-mentioned various modules in the premium calculation model test system can be realized by software, hardware and combinations thereof in whole or in part. The above-mentioned various modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the above-mentioned various modules.
[0098] Figure 4 A structural schematic diagram of a computer device provided in the embodiments of the present application is shown in FIG. 1, which can be a server, and an internal structural diagram thereof can be as shown in FIG. 2. Figure 4The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the computer storage medium. The database of the computer device is configured to store data generated or acquired in the process of executing the premium calculation model testing method, such as preset model testing parameters and preset model dependency parameters. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the premium calculation model testing method.
[0099] In one embodiment, a computer device is provided, which includes a memory, a processor and a computer program stored in the memory and executable on the processor. The processor implements the steps of the premium calculation model testing method in the above embodiments when executing the computer program. Alternatively, the processor implements the functions of the modules / units in the premium calculation model testing system in this embodiment when executing the computer program.
[0100] In one embodiment, a computer storage medium is provided, which stores a computer program. The computer program is executed by the processor to implement the steps of the premium calculation model testing method in the above embodiments. Alternatively, the computer program is executed by the processor to implement the functions of the modules / units in the premium calculation model testing system in this embodiment.
[0101] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0102] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above-described functions.
[0103] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method of testing a premium calculation model, characterized by, The method comprises the following steps: acquiring preset model test parameters corresponding to policy test data, preset model dependency parameters corresponding to policy dependency data, and a theoretical premium value corresponding to the policy test data, wherein the policy dependency data comprises vehicle price, vehicle insurance type, and historical insurance situation; extracting effective model test parameters from the preset model test parameters and effective model dependency parameters from the preset model dependency parameters according to preset model configuration parameters to obtain an input parameter combination; taking the input parameter combination as an input parameter of a preset test program and executing the preset test program to obtain a test result, wherein the preset test program calls a test interface corresponding to a target premium calculation model in a multi-threaded manner, and the test result is calculated by the test interface and returned to the preset test program; extracting an actual premium value corresponding to the policy test data from the test result, and acquiring a test score of the target premium calculation model according to the actual premium value and the theoretical premium value in combination with a preset error model score comparison relationship; the theoretical premium value comprises an intermediate theoretical result value and a final theoretical premium value, the actual premium value comprises an intermediate test result value and a final test premium value, and the test score of the target premium calculation model is acquired according to the actual premium value and the theoretical premium value in combination with a preset error model score comparison relationship, which comprises comparing the intermediate test result and the intermediate theoretical result, if the error between the intermediate test result and the intermediate theoretical result is outside a preset intermediate error range, setting the test score to the lowest, otherwise, continuing to compare the final test premium value and the final theoretical premium value, if the error between the final test premium value and the final theoretical premium value is outside a preset final error range, setting the test score to the lowest, otherwise, acquiring the test score according to the error between the final test premium value and the final theoretical premium value and referring to the preset error model score comparison relationship.
2. The method of claim 1, wherein, the actual premium value corresponding to the policy test data is extracted from the test result, which comprises: positioning to a corresponding field position in the test result according to a preset field position, and screening the actual premium value from the corresponding field position according to a preset field name.
3. The method of claim 1, wherein: the comparison between the intermediate test result and the intermediate theoretical result, if the error between the intermediate test result and the intermediate theoretical result is outside a preset intermediate error range, setting the test score to the lowest, and then further comprising: acquiring a target intermediate test result from the intermediate test result, wherein the error between the target intermediate test result and the intermediate theoretical result is outside the preset intermediate error range; acquiring a calculation step corresponding to the target intermediate test result in the target premium calculation model, and determining a position where a calculation error exists in the target premium calculation model according to the calculation step.
4. The method of claim 1, wherein, The preset model configuration parameters include test input parameters and dependent input parameters, the effective model test parameters are extracted from the preset model test parameters according to the preset model configuration parameters, the effective model dependent parameters are extracted from the preset model dependent parameters, and the input parameter combination is obtained, including: extracting effective model test parameters from the preset model test parameters according to the test input parameters; extracting effective model dependent parameters from the preset model dependent parameters according to the dependent input parameters; combining the attribute values corresponding to the effective model test parameters and the attribute values corresponding to the effective model dependent parameters to determine the input parameter combination under various conditions.
5. The method of claim 4, wherein: The input parameter combination includes at least one attribute value corresponding to an effective model dependent parameter.
6. The method of claim 1 to 5, wherein, The target premium calculation model is a car insurance calculation model, and the policy test data at least includes running data of an insured vehicle.
7. A premium calculation model testing system, characterized by, including: a parameter acquisition module configured to acquire preset model test parameters corresponding to policy test data, preset model dependent parameters corresponding to policy dependent data, and a theoretical premium value corresponding to the policy test data, wherein the policy dependent data includes the price of the insured vehicle, the type of car insurance, and the historical insurance situation; a parameter combination module configured to extract effective model test parameters from the preset model test parameters according to preset model configuration parameters, and extract effective model dependent parameters from the preset model dependent parameters, and obtain an input parameter combination; a result calculation module configured to take the input parameter combination as an input parameter of a preset test program and execute the preset test program, obtain a test result, the preset test program calls a test interface corresponding to a target premium calculation model in a multi-threaded manner, and the test result is calculated by the test interface and returned to the preset test program; a test scoring module configured to extract an actual premium value corresponding to the policy test data from the test result, and according to the actual premium value and the theoretical premium value, combined with a preset error model scoring reference relationship, obtain a test score of the target premium calculation model, wherein the theoretical premium value includes an intermediate theoretical result value and a final theoretical premium value, and the actual premium value includes an intermediate test result value and a final test premium value; the result calculation module includes a comparison unit and a scoring unit, wherein the comparison unit is configured to compare the intermediate test result and the intermediate theoretical result, if the error between the intermediate test result and the intermediate theoretical result is outside a preset intermediate error range, the test score is set to the lowest, otherwise, the final test premium value and the final theoretical premium value are compared; the scoring unit is configured to if the error between the final test premium value and the final theoretical premium value is outside a preset final error range, the test score is set to the lowest, otherwise, according to the error between the final test premium value and the final theoretical premium value, the test score is obtained by referring to the preset error model scoring reference relationship.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the premium calculation model testing method according to any one of claims 1 to 6.
9. A computer storage medium storing a computer program, the computer program comprising instructions, which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 8. The computer program is executed by the processor to implement the steps of the premium calculation model testing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Interface test method and device, computer equipment and storage medium
CN109597753A
Data model automatic test method and device and electronic equipment
CN114003494A