Production variable verification method, apparatus, device, and computer-readable storage medium
By packaging and concurrently verifying the logic code of production variables, the problem of time-consuming production variable verification was solved, enabling rapid deployment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEBANK (CHINA)
- Filing Date
- 2023-11-28
- Publication Date
- 2026-06-26
AI Technical Summary
In the current production variable verification process, each production variable needs to be verified independently in sequence, which increases the verification time when there are a large number of variables, affecting the timeliness of deployment.
By packaging the processing logic code of multiple production variables into a variable code package, and calling the code package with the verification data as input parameters, the processing result and verification result are generated. If they match, the verification passes, thus realizing the concurrent verification of multiple production variables.
This reduces the time spent validating production variables and improves the overall timeliness of production variables from validation to deployment.
Smart Images

Figure CN117632719B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis technology, and in particular to a method, apparatus, device, and computer-readable storage medium for verifying production variables. Background Technology
[0002] During data processing and analysis, developers create new production variables based on business needs. These new variables allow for a more comprehensive, accurate, and in-depth understanding and analysis of the data, thereby improving the quality of data analysis and providing a reference for business decisions. Before a new variable goes live, it needs to be validated to ensure its reliability and accuracy. Currently, production variable validation primarily involves placing the newly developed variable in a test environment, using test data as input parameters, and then obtaining the validation results by comparing the output results with the expected results.
[0003] However, in the above production variable verification process, each production variable needs to be verified independently in sequence. This leads to a linear increase in the workload of production variable verification on the test side when there are a large number of production variables, and the time spent on production variable verification increases, which affects the timeliness of production variable deployment. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, device, and computer-readable storage medium for verifying production variables, aiming to reduce the time consumption of production variable verification and thereby improve the timeliness of production variable deployment.
[0005] To achieve the above objectives, this application provides a method for validating production variables, the method comprising the following steps:
[0006] The processing logic code for each production variable is packaged to obtain a variable code package;
[0007] Obtain verification data, and use the verification data as input parameters to call the variable code package to obtain the processing results of each of the production variables;
[0008] Based on the processing logic code of each production variable and the verification data, generate the verification result for each production variable.
[0009] For any target production variable among the various production variables, if the processing result of the target production variable is consistent with the verification result of the target production variable, then the target production variable is determined to have passed verification.
[0010] Optionally, the step of packaging the processing logic code of each production variable into a variable code package includes:
[0011] The production variables are divided into multiple production variable groups according to preset rules;
[0012] The processing logic code for each of the production variable groups is packaged to obtain the variable code package corresponding to each production variable group.
[0013] Optionally, the step of calling the variable code package using the verification data as input parameters to obtain the processing results of each of the production variables includes:
[0014] For any target variable group in each of the production variable groups, determine the target data corresponding to the target variable group from the verification data;
[0015] Using the target data as input parameters, the variable code package corresponding to the target variable group is called to obtain the processing results of each production variable in the target variable group.
[0016] Optionally, the step of obtaining verification data includes:
[0017] Production data from the big data analytics platform is used as verification data, wherein the production data is the data returned by the platform data source when the business system calls the platform data source of the big data analytics platform.
[0018] Optionally, the production variable verification method further includes:
[0019] If the processing result of the target production variable is inconsistent with the verification result of the target production variable, then the requirement logic code of the target production variable is obtained;
[0020] Based on the demand logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable, the verification error generated during the verification process of the target production variable is determined, and the processing logic code of the target production variable is adjusted based on the verification error.
[0021] Optionally, the step of adjusting the processing logic code of the target production variable based on the verification error includes:
[0022] Determine the error type of the verification error, wherein the error type includes at least verification data error and logic code error;
[0023] If the error type is the verification data error, then after adjusting the verification data, return to the step of calling the variable code package with the verification data as input parameter to obtain the processing results of each of the production variables;
[0024] If the error type is the logic code error, then the error code is determined in the processing logic code of the target production variable, so that the developers can adjust the processing logic code of the target production variable based on the error code.
[0025] Optionally, the production variable validation method further includes:
[0026] Acquire test data, and when a test instruction is triggered, perform regression testing based on the variable code package, the processing logic code of each of the production variables, and the test data.
[0027] To achieve the above objectives, this application also provides a production variable verification device, the production variable verification device comprising:
[0028] The packaging module is used to package the processing logic code of each production variable into a variable code package;
[0029] The module is used to obtain verification data and call the variable code package with the verification data as input parameters to obtain the processing results of each of the production variables.
[0030] The result generation module is used to generate the verification result of each of the production variables based on the processing logic code of each production variable and the verification data.
[0031] The verification module determines that the target production variable has passed verification if the processing result of the target production variable among the various production variables is consistent with the verification result of the target production variable.
[0032] To achieve the above objectives, this application also provides a production variable verification device, which includes: a memory, a processor, and a production variable verification program stored in the memory and executable on the processor. When the production variable verification program is executed by the processor, it implements the steps of the production variable verification method described above.
[0033] In addition, to achieve the above objectives, this application also proposes a computer-readable storage medium storing a production variable verification program, which, when executed by a processor, implements the steps of the production variable verification method as described above.
[0034] In this application, a variable code package is obtained by packaging the processing logic code of each production variable; verification data is obtained, and the variable code package is called with the verification data as input parameters to obtain the processing result of each production variable; based on the processing logic code of each production variable and the verification data, a verification result of each production variable is generated; for any target production variable among the production variables, if the processing result of the target production variable is consistent with the verification result of the target production variable, then the target production variable is determined to have passed verification.
[0035] This application packages the processing logic code of multiple production variables into a variable code package. When verifying production variables, calling the variable code package can simultaneously input parameters to multiple production variables, thereby achieving concurrent verification of multiple production variables. Compared with the method of verifying a single production variable, this application can reduce the verification time of production variables, thereby shortening the total time from verification to deployment of production variables and improving the timeliness of production variable deployment. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the hardware operating environment involved in the embodiments of this application;
[0037] Figure 2 This is a flowchart illustrating the first embodiment of the variable verification method of this application;
[0038] Figure 3 This is a schematic diagram illustrating the process from development to deployment of production variables involved in the embodiments of this application;
[0039] Figure 4 This is a schematic diagram of the process for verifying production variables involved in an embodiment of this application;
[0040] Figure 5 This is a schematic diagram of the functional modules of a preferred embodiment of the variable verification device of this application.
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0042] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0043] like Figure 1 As shown, Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0044] It should be noted that the production variable verification device in this application embodiment can be a device such as an earphone, a smartphone, a personal computer, or a server, and no specific limitation is made here.
[0045] like Figure 1 As shown, the production variable verification device may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0046] Those skilled in the art will understand that Figure 1 The equipment structure shown does not constitute a limitation on the production variable verification equipment, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0047] like Figure 1 As shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a production variable verification program. The operating system is a program that manages and controls the device's hardware and software resources, supporting the operation of the production variable verification program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the production variable verification program stored in the memory 1005 and perform the following operations:
[0048] The processing logic code for each production variable is packaged to obtain a variable code package;
[0049] Obtain verification data, and use the verification data as input parameters to call the variable code package to obtain the processing results of each of the production variables;
[0050] Based on the processing logic code of each production variable and the verification data, generate the verification result for each production variable.
[0051] For any target production variable among the various production variables, if the processing result of the target production variable is consistent with the verification result of the target production variable, then the target production variable is determined to have passed verification.
[0052] Furthermore, the step of packaging the processing logic code of each production variable into a variable code package includes:
[0053] The production variables are divided into multiple production variable groups according to preset rules;
[0054] The processing logic code for each of the production variable groups is packaged to obtain the variable code package corresponding to each production variable group.
[0055] Further, the step of calling the variable code package using the verification data as input parameters to obtain the processing results of each of the production variables includes:
[0056] For any target variable group in each of the production variable groups, determine the target data corresponding to the target variable group from the verification data;
[0057] Using the target data as input parameters, the variable code package corresponding to the target variable group is called to obtain the processing results of each production variable in the target variable group.
[0058] Furthermore, the step of obtaining verification data includes:
[0059] Production data from the big data analytics platform is used as verification data, wherein the production data is the data returned by the platform data source when the business system calls the platform data source of the big data analytics platform.
[0060] Furthermore, the production variable verification method also includes:
[0061] If the processing result of the target production variable is inconsistent with the verification result of the target production variable, then the requirement logic code of the target production variable is obtained;
[0062] Based on the demand logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable, the verification error generated during the verification process of the target production variable is determined, and the processing logic code of the target production variable is adjusted based on the verification error.
[0063] Further, the step of adjusting the processing logic code of the target production variable based on the verification error includes:
[0064] The error type of the verification error is determined, wherein the error type includes at least verification data error and logic code error;
[0065] If the error type is the verification data error, then after adjusting the verification data, return to the step of calling the variable code package with the verification data as input parameter to obtain the processing results of each of the production variables;
[0066] If the error type is the logic code error, then the error code is determined in the processing logic code of the target production variable, so that the developers can adjust the processing logic code of the target production variable based on the error code.
[0067] Furthermore, the production variable verification method also includes:
[0068] Acquire test data, and when a test instruction is triggered, perform regression testing based on the variable code package, the processing logic code of each of the production variables, and the test data.
[0069] Based on the above structure, various embodiments of the production variable verification method are proposed.
[0070] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the variable verification method of this application.
[0071] This application provides an embodiment of a production variable verification method. It should be noted that although the flowchart shows a logical order, in some cases, the steps shown or described may be executed in a different order. In this embodiment, the executing entity of the production variable verification method can be a personal computer, personal terminal, server, cloud platform, or other devices. No limitation is made in this embodiment. For ease of description, the executing entity of the production variable verification method will be referred to as the test terminal in the following description of each embodiment. In this embodiment, the production variable verification method includes steps S10-S40.
[0072] Step S10: Package the processing logic code of each production variable to obtain a variable code package.
[0073] Production variables are new numerical variables generated through calculation, transformation, or processing of existing data. They can be derived variables obtained by manipulating the original data, or new variables obtained through combination, calculation, aggregation, and other methods. In data analysis, variables can provide more information and insights, helping analysts and decision-makers make more accurate judgments and decisions. For example, in the field of risk control, production variables can be various indicators and data used to assess and quantify risk, assisting financial institutions in risk control.
[0074] The processing logic of production variables refers to the process of processing and analyzing raw data to generate useful variables or indicators to support decision-making and analysis.
[0075] Reference Figure 3 The current process for developing and validating production variables mainly involves: the business submits a requirement for production variables, the technical development team develops new variables, the newly developed production variables are placed in a test environment, test data is used to test the variables, and then the output results of the variables are tested and verified based on the differences between the output results and the expected results. If the verification result is successful, the new variable is launched; if the verification result is unsuccessful, the technical development team will locate and fix the problem.
[0076] However, in the above production variable verification process, each production variable needs to be verified independently in sequence. This leads to a linear increase in the workload of production variable verification on the test side when there are a large number of production variables, and the time spent on production variable verification increases, which affects the timeliness of production variable deployment.
[0077] This embodiment proposes a method for batch verification of production variables. When there is a large amount of production variable data, the verification time of production variables is reduced, thereby reducing the time from development to deployment of production variables and improving the deployment timeliness of production variables.
[0078] Specifically, in this embodiment, developers on the development side develop processing logic code for the production variables based on the business requirements corresponding to the production variables. The testing side obtains the processing logic code for each production variable and packages it into a package. For ease of description, the resulting data package will be referred to as the variable code package.
[0079] This embodiment does not limit the tools used for data packaging. It can be done through an SDK (Software Development Kit) or by using tools such as InstallShield. Further, in one feasible implementation, the testing end can package all production variables into a single variable code package to batch-verify all production variables simultaneously, thereby improving the efficiency of production variable verification, reducing the verification time, and shortening the total time from verification to deployment, thus improving the timeliness of production variable deployment. In another feasible implementation, the testing end can also divide multiple production variables into multiple batches, obtaining multiple production variable groups. The testing end verifies each production variable group separately to reduce the workload of verifying each batch of production variables, thereby accelerating the verification speed, reducing the verification time, and shortening the total time from verification to deployment, thus improving the timeliness of production variable deployment.
[0080] Step S20: Obtain verification data, and use the verification data as input parameters to call the variable code package to obtain the processing results of each of the production variables.
[0081] In this embodiment, the data used to verify production variables is referred to as verification data. Verification data can be real production data, program-generated data, or manually anonymized data; the specific method can be set according to actual needs and is not limited here. For example, in one feasible implementation, verification data can be real production data. Compared to manually anonymized data, this implementation avoids the problem of inaccurate production variable verification results due to discrepancies between the processing results of production variables in the test environment and expectations caused by data anonymization. Compared to program-generated data, this implementation avoids the problem of verification data not being real business data and verification data not covering the entire scenario, leading to inaccurate production variable verification results.
[0082] In this embodiment, the test terminal calls the variable code package to verify the production variables. The test terminal initiates the call using verification data as input parameters; that is, it calls the variable code package with verification data as input parameters. The specific process from input parameters to output parameters is recorded, and the output parameter results are used as the processing results for each production variable. In specific implementations, the recording format of the processing results is not limited; for example, it can be in the form of a data table or a document record. There are no restrictions here.
[0083] Step S30: Generate the verification result for each of the production variables based on the processing logic code of each production variable and the verification data.
[0084] In this embodiment, the testing end also generates the verification results for each production variable based on the processing logic code and verification data of each production variable. By comparing the verification results with the processing results, the verification of the production variables can be completed.
[0085] Multiple systems can be set up in the test terminal, each system is used to perform different functions. For example, three systems can be set up in the test terminal, each system is used to generate processing results, generate verification results and package variable code packages respectively; or there can be only one system in the test terminal, which is used to package variable code packages, generate processing results and generate verification results. The specific settings can be set according to actual needs, and there are no restrictions here.
[0086] Step S40: For any target production variable among the production variables, if the processing result of the target production variable is consistent with the verification result of the target production variable, then the target production variable is determined to have passed verification.
[0087] Since the processing result and the verification result are obtained by using the same processing logic code and verification data, theoretically the processing result and verification result of any target production variable among all production variables should be the same. Therefore, in this embodiment, if the processing result of the target production variable is consistent with the verification result of the target production variable, it is determined that the processing logic code of the target production variable can run and the running logic is correct. At this time, it can be determined that the target production variable has passed the verification.
[0088] Furthermore, in one feasible implementation, if the processing result of the target production variable is inconsistent with the verification result of the target production variable, the test terminal can output a verification failure message so that the developers can locate and fix the problem in the target production variable.
[0089] Furthermore, in one feasible implementation, after the production variables are validated, document management can be performed to save documents involved in the validation process, such as ledgers, so as to realize regression testing of production variables and standardized management of the production variable validation process based on the document management function. In this implementation, in order to enable the testing end to perform regression testing, the saved documents should at least include the processing logic code and validation data of the production variables. Specifically, the subject performing document management can be the testing end, a local device, or other cloud devices, without limitation.
[0090] For example, in one feasible implementation, the documents managed by the document management system may also include:
[0091] SDK package ledger document: Registration date + Registered personnel + SDK package name + Packaging technical personnel;
[0092] SDK package input parameter interface documentation: Registration date + Registered personnel + SDK package name + Model + Type + Variable code + Field list + Variable developer.
[0093] SDK package output parameter interface documentation: Registration date + Registered personnel + SDK package name + Model + Type + Variable code + Map (mapping).
[0094] Test data ledger: Registration date + test data date range.
[0095] Processing Result Set A Ledger: Registration Date + Test Data + Data Source + Variable Name + Variable Value.
[0096] Verification result set B ledger: Registration date + Test data + SDK package name + Data source + Variable name + Variable value.
[0097] Furthermore, in one feasible implementation, the production variable verification method further includes step S50.
[0098] Step S50: Obtain test data, and when a test instruction is triggered, perform regression testing based on the variable code package, the processing logic code of each of the production variables, and the test data.
[0099] In this embodiment, the test terminal obtains test data for regression testing. The test data can be validation data or newly added data. The newly added data can be newly added production data or data newly generated by the program, and there are no restrictions here.
[0100] Upon reaching the preset testing period or receiving an instruction from the developers to perform regression testing, the testing end determines to trigger the test instruction. When the test instruction is triggered, regression testing is performed based on the variable code package, the processing logic code for each production variable, and the test data. The specific testing process can be referred to steps S10 to S40, and will not be elaborated here.
[0101] In this embodiment, a variable code package is obtained by packaging the processing logic code of each production variable; verification data is obtained, and the variable code package is called with the verification data as input parameters to obtain the processing results of each production variable; based on the processing logic code and verification data of each production variable, the verification results of each production variable are generated; for any target production variable among the production variables, if the processing result of the target production variable is consistent with the verification result of the target production variable, the target production variable is determined to have passed the verification.
[0102] This embodiment packages the processing logic code of multiple production variables into a variable code package. When verifying production variables, calling the variable code package can simultaneously input parameters to multiple production variables, thereby achieving concurrent verification of multiple production variables. Compared with the method of verifying a single production variable, this embodiment can reduce the verification time of production variables, thereby shortening the total time from verification to deployment of production variables and improving the timeliness of production variable deployment.
[0103] Furthermore, based on the first embodiment described above, a second embodiment of the production variable verification method of this application is proposed. In this embodiment, step S10: package the processing logic code of each production variable to obtain a variable code package, including steps S101-S102.
[0104] Step S101: Divide each production variable into multiple production variable groups according to preset rules.
[0105] In this embodiment, before packaging the processing logic code of the production variables, the test end divides each production variable into multiple batches, and each batch of production variables is called a production variable group.
[0106] In this embodiment, rules for classifying production variables are pre-set in the test terminal. These are referred to as preset rules for distinction. The specific content of the preset rules can be set according to actual needs. For example, in one feasible implementation, the preset rules can be classification rules, such as classification rules for data source type, business type of production variables, variable type, etc., as preset rules. In another feasible implementation, the preset rules can also be threshold rules, such as the number of batches, the number of production variables in each batch, etc., as preset rules.
[0107] Step S102: Package the processing logic code of each of the production variable groups to obtain the variable code package corresponding to each of the production variable groups.
[0108] The test server packages the processing logic code of all production variables in a production variable group into the same data packet to obtain the variable code packet of the production variable group. The above packaging operation is performed on each production variable group to obtain the variable code packet corresponding to each production variable group.
[0109] In this embodiment, if the preset rule is a classification rule, then during the process of calling the variable code package, different variable code package categories will lead to different input parameter data. At this time, data that matches the variable code package category can be determined from the verification data according to the type of the variable code package for use as input parameters. For example, in a feasible implementation, when multiple production variable groups are obtained by classifying each production variable according to the data source type, the input parameter data corresponding to different variable code packages should come from different data sources. Therefore, in this embodiment, data that matches the data source type corresponding to the variable code package is determined from the verification data for use as input parameters.
[0110] If the preset rule is a threshold rule, then during the process of calling the variable code package, the grouping of the variable code package has no effect on the input parameter data. Therefore, for any variable code package, all the data of the validation data can be used as the input parameter.
[0111] Furthermore, in one feasible implementation, each production variable group can be verified concurrently to improve the verification efficiency of production variables, reduce the verification time of production variables, thereby shortening the total time from verification to deployment of production variables and improving the timeliness of production variable deployment.
[0112] Further, in a feasible implementation, step S20: using the verification data as input parameters to call the variable code package to obtain the processing results of each of the production variables, including steps S201-S202.
[0113] Step S201: For any target variable group in each of the production variable groups, determine the target data corresponding to the target variable group from the verification data.
[0114] In this embodiment, the preset rule is a classification rule, meaning that different variable code package categories will result in different input parameter data during the invocation of variable code packages. Therefore, in this embodiment, data matching the variable code package category is determined from the validation data according to the variable code package type and used as input parameters.
[0115] Specifically, for any target variable group in each production variable group, the test end determines the target data corresponding to the target variable group from the verification data.
[0116] Step S202: Using the target data as input parameters, call the variable code package corresponding to the target variable group to obtain the processing results of each production variable in the target variable group.
[0117] The test end takes the target data as input parameters, calls the variable code package corresponding to the target variable group with the target data, obtains the output parameters of each production variable in each target variable group, and uses the output parameters of each production variable in each target variable group as the processing result of each production variable.
[0118] Furthermore, in one feasible implementation, step S20: obtaining verification data includes step S203.
[0119] Step S203: Use production data from the big data analytics platform as verification data, wherein the production data is the data returned by the platform data source when the business system calls the platform data source of the big data analytics platform.
[0120] In this implementation, real production data from the big data analytics platform is used as verification data. When the business system calls the platform's data source, the report data returned by the platform's data source is the actual production data.
[0121] This implementation does not limit the big data analytics platform. For example, it can be a data analytics platform such as DBAP (Big Data Analytics Platform) or GCP (Google Cloud Platform). The specific setup depends on the actual needs.
[0122] In this embodiment, each production variable is divided into multiple production variable groups according to preset rules; the processing logic code of each production variable group is packaged to obtain the variable code package corresponding to each production variable group. The test end can also divide multiple production variables into multiple batches to obtain multiple production variable groups. The test end verifies each production variable group to reduce the workload of verifying each batch of production variables, thereby speeding up the verification of production variables, reducing the verification time of production variables, and shortening the total time from verification to online deployment of production variables, thus improving the timeliness of production variable deployment.
[0123] Furthermore, based on the first and / or second embodiments described above, a third embodiment of the production variable verification method of this application is proposed. In this embodiment, the production verification method further includes steps S60-S70.
[0124] Step S60: If the processing result of the target production variable is inconsistent with the verification result of the target production variable, then obtain the requirement logic code of the target production variable.
[0125] Due to errors in the processing logic code, differences in verification data, the influence of tools used in batch calls, and different data processing orders, the processing result of the target production variable may be inconsistent with the verification result of the target production variable. In this embodiment, if the processing result of the target production variable is inconsistent with the verification result of the target production variable, error analysis is performed on the target production variable to reduce the time spent by developers in repairing the logic code and reduce the verification time of the production variable, thereby shortening the total time from verification to deployment of the production variable and improving the timeliness of production variable deployment.
[0126] Specifically, the requirement logic code for the target production variable is obtained, and error analysis is performed based on the requirement logic code.
[0127] Step S70: Based on the demand logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable, determine the verification error generated during the verification process of the target production variable, and adjust the processing logic code of the target production variable based on the verification error.
[0128] The testing end determines the error (hereinafter referred to as verification error) generated during the verification process of the target production variable based on the requirement logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable. In this embodiment, the processing logic code of the target production variable is adjusted based on the verification error, and the specific adjustment process is not limited here.
[0129] In this embodiment, the process of determining the verification error generated during the verification of the target production variable can be as follows: The requirement logic code describes the process of extracting, transforming, or calculating the target production variable from the data source. Therefore, the requirement logic code is reviewed to understand the expected calculation or processing logic of the target production variable; the requirement logic code and the processing logic code are checked for consistency; if the requirement logic code and the processing logic code are inconsistent, it is determined that the processing logic code has a verification error; if the requirement logic code and the processing logic code are consistent, it is determined that each intermediate step of the verification data calculated using the requirement logic code yields intermediate data (hereinafter referred to as the first intermediate data for distinction), and each intermediate step of the verification data calculated using the processing logic code yields intermediate data (hereinafter referred to as the second intermediate data for distinction), and the first intermediate data and the second intermediate data corresponding to the same intermediate step are checked for consistency; if the first intermediate data and the second intermediate data corresponding to the same intermediate step are inconsistent, it is determined that the code corresponding to that intermediate step in the processing logic code has a verification error, which may be due to an incorrect code order.
[0130] Furthermore, in one feasible implementation, step S70: adjusting the processing logic code of the target production variable based on the verification error, includes steps S701-S703.
[0131] Step S701: Determine the error type of the verification error, wherein the error type includes at least verification data error and logic code error.
[0132] Different error causes correspond to different types. For example, errors in processing logic code correspond to code errors, while differences in verification data correspond to data errors. In this embodiment, the error types are set to include at least verification data errors and logic code errors. The testing end determines the error type of the verification error and performs error correction based on the verification error.
[0133] Step S702: If the error type is the verification data error, then after adjusting the verification data, return to the step of calling the variable code package with the verification data as input parameter to obtain the processing results of each of the production variables.
[0134] If the error type is verification data error, then after adjusting the verification data, return to the step of calling the variable code package with the verification data as input parameter to obtain the processing results of each production variable.
[0135] Step S703: If the error type is the logic code error, then determine the error code in the processing logic code of the target production variable so that the developers can adjust the processing logic code of the target production variable based on the error code.
[0136] If the error type is a logic code error, then the error code is determined in the processing logic code of the target production variable, so that developers can adjust the processing logic code of the target production variable based on the error code.
[0137] In this embodiment, if the processing result of the target production variable is inconsistent with the verification result of the target production variable, the requirement logic code of the target production variable is obtained. Based on the requirement logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable, the verification error generated during the verification process of the target production variable is determined, and the processing logic code of the target production variable is adjusted based on the verification error. This embodiment reduces the time spent by developers in repairing logic code and reduces the verification time of production variables, thereby shortening the total time from verification to deployment of production variables and improving the timeliness of production variable deployment.
[0138] Furthermore, in a feasible implementation, the test end uses an SDK for packaging and BDAP's real production data as verification data. In this implementation, the production variable verification process can be as follows: the technology side categorizes the production variable processing logic according to data sources and packages it into an SDK package. After receiving the SDK package, the marketplace calls the SDK package through a batch automation tool. During the call, the production data (raw messages) in BDAP is used as input parameters to run the variable results, which is the technology development processing result set A. Simultaneously, based on the production variable processing logic and using the production data, the variable results are run in BDAP, which is the verification result set B. Finally, result set A and result set B are compared; if the results are consistent, the verification passes.
[0139] Specifically, refer to Figure 4 The specific steps for verifying production variables in this implementation method can be as follows:
[0140] S1: Generate batch automation tools:
[0141] Because the technology development environment differs from the BDAP environment, the technology side primarily uses Java to develop production variables. Therefore, a tool based on BDAP is needed to load the production variable code SDK package processed in the technology development environment into the big data analytics platform. During loading, parameters need to be passed in, and after the call is complete, the results should be returned.
[0142] S2: Obtain verification data:
[0143] The solution for generating variables in this patent uses real production data from BDAP for verification, solving many problems caused by test data in existing verification methods. Since BDAP stores the most original messages from when the business system calls various data sources, and all data since the start of the business is stored in BDAP, this massive amount of production data can be used for variable verification, improving the coverage of the verification.
[0144] S3: SDK call (that is, calling the variable code package with the verification data as input parameters to obtain the processing results of each of the production variables):
[0145] Once the technology team has completed the development of all production variables for a specific data source, the code for all production variables of that data source can be packaged separately for independent verification.
[0146] When calling the production variable SDK package, the input parameters are massive production data from BDAP, all of which are raw messages. The call is initiated by combining input parameters such as variable name and data source name, and the processing result set A of all variables is output in batches.
[0147] S4: Data Development (i.e., generating the verification results for each of the production variables based on the processing logic code and the verification data):
[0148] Once the production variable requirements and processing logic are confirmed, BDAP can be developed directly and a verification result set B can be generated. This process does not depend on technological development progress and can be carried out simultaneously with technological development. Moreover, BDAP development also uses massive amounts of production data, and after the processing logic is developed, the verification result set B is generated in batches.
[0149] S5: Data Validation
[0150] The verification result set B is compared with the processing result set A. Since both result sets are processed from the same original message, the comparison results are more reliable. If the comparison matches, the verification is confirmed to be successful (that is, for any target production variable among the various production variables, if the processing result of the target production variable matches the verification result of the target production variable, the target production variable is confirmed to be verified successfully). If the comparison does not match, feedback can be quickly provided to the technical development personnel. Since the development of result set B is also based on the requirement logic of the production variables, the verification personnel are very clear about the variable processing logic and can assist the technical team in quickly locating and fixing the problem.
[0151] S6: Document Management
[0152] Since the verification of this solution can be largely completed within BDAP, the entire verification process can be managed and standardized under BDAP, and regression testing can be performed very conveniently. The main documents in this implementation plan include:
[0153] SDK package ledger document: Registration date + Registered personnel + SDK package name + Packaging technical personnel.
[0154] SDK package input parameter interface documentation: Registration date + Registered personnel + SDK package name + Model + Type + Variable code + Field list + Variable developer.
[0155] SDK package output parameter interface documentation: Registration date + Registered personnel + SDK package name + Model + Type + Variable code + Map.
[0156] Test data ledger: Registration date + test data date range.
[0157] Processing Result Set A Ledger: Registration Date + Test Data + Data Source + Variable Name + Variable Value.
[0158] Verification result set B ledger: Registration date + Test data + SDK package name + Data source + Variable name + Variable value.
[0159] S7: Regression testing (i.e., regression testing based on the variable code package, the processing logic code of each of the production variables, and the test data):
[0160] With the rapid increase in production data and the diversification of business scenarios, production variables also require regular regression testing. Under this solution, regression testing is characterized by code reusability and a high degree of automation. Since both the SDK package and the BDAP verification code are documented and managed within BDAP, the code can be reused. Using the scheduling management tool in BDAP, daily or monthly new data can be used as test and verification data, loaded periodically, and the processing result set A and verification result set B can be generated, outputting the verification conclusions.
[0161] Furthermore, this application also proposes a production variable verification device, referring to... Figure 5 The production variable verification device includes:
[0162] Packaging module 10 is used to package the processing logic code of each production variable to obtain a variable code package;
[0163] Module 20 is called to obtain verification data and use the verification data as input parameters to call the variable code package to obtain the processing results of each of the production variables.
[0164] The result generation module 30 is used to generate the verification result of each of the production variables based on the processing logic code of each production variable and the verification data.
[0165] If the processing result of the target production variable among the various production variables is consistent with the verification result of the target production variable, then the verification of the target production variable is determined to be successful.
[0166] Furthermore, the packaging module 10 is also used for:
[0167] The production variables are divided into multiple production variable groups according to preset rules;
[0168] The processing logic code for each of the production variable groups is packaged to obtain the variable code package corresponding to each production variable group.
[0169] Furthermore, the calling module 20 is also used for:
[0170] For any target variable group in each of the production variable groups, determine the target data corresponding to the target variable group from the verification data;
[0171] Using the target data as input parameters, the variable code package corresponding to the target variable group is called to obtain the processing results of each production variable in the target variable group.
[0172] Furthermore, the calling module 20 is also used for:
[0173] Production data from the big data analytics platform is used as verification data, wherein the production data is the data returned by the platform data source when the business system calls the platform data source of the big data analytics platform.
[0174] Furthermore, the production variable verification device also includes an error analysis module, used for:
[0175] If the processing result of the target production variable is inconsistent with the verification result of the target production variable, then the requirement logic code of the target production variable is obtained;
[0176] Based on the demand logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable, the verification error generated during the verification process of the target production variable is determined, and the processing logic code of the target production variable is adjusted based on the verification error.
[0177] Furthermore, the error analysis module is also used for:
[0178] Determine the error type of the verification error, wherein the error type includes at least verification data error and logic code error;
[0179] If the error type is the verification data error, then after adjusting the verification data, return to the step of calling the variable code package with the verification data as input parameter to obtain the processing results of each of the production variables;
[0180] If the error type is the logic code error, then the error code is determined in the processing logic code of the target production variable, so that the developers can adjust the processing logic code of the target production variable based on the error code.
[0181] Furthermore, the production variable validation device also includes a regression testing module, used for:
[0182] Acquire test data, and when a test instruction is triggered, perform regression testing based on the variable code package, the processing logic code of each of the production variables, and the test data.
[0183] The embodiments of the production variable verification device of this application can be referred to the embodiments of the production variable verification method of this application, and will not be repeated here.
[0184] Furthermore, embodiments of this application also propose a computer-readable storage medium storing a production variable verification program, which, when executed by a processor, implements the steps of the production variable verification method described below.
[0185] The embodiments of the production variable verification device and computer-readable storage medium of this application can be referred to the embodiments of the production variable verification method of this application, and will not be repeated here.
[0186] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0187] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0188] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0189] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for validating production variables, characterized in that, The production variable validation method includes the following steps: The processing logic code for each production variable is packaged to obtain a variable code package; Obtain verification data, and use the verification data as input parameters to call the variable code package to obtain the processing results of each of the production variables; Based on the processing logic code of each production variable and the verification data, generate the verification result for each production variable. For any target production variable among the various production variables, if the processing result of the target production variable is consistent with the verification result of the target production variable, then the target production variable is determined to have passed verification. The step of packaging the processing logic code of each production variable into a variable code package includes: The production variables are divided into multiple production variable groups according to preset rules; The processing logic code of each production variable group is packaged to obtain the variable code package corresponding to each production variable group. The step of calling the variable code package using the verification data as input parameters to obtain the processing results of each of the production variables includes: For any target variable group in each of the production variable groups, determine the target data corresponding to the target variable group from the verification data; Using the target data as input parameters, the variable code package corresponding to the target variable group is called to obtain the processing results of each production variable in the target variable group; The step of obtaining verification data includes: Production data from the big data analytics platform is used as verification data, wherein the production data is the data returned by the platform data source when the business system calls the platform data source of the big data analytics platform.
2. The production variable verification method as described in claim 1, characterized in that, The production variable validation method further includes: If the processing result of the target production variable is inconsistent with the verification result of the target production variable, then the requirement logic code of the target production variable is obtained; Based on the demand logic code, the processing logic code of the target production variable, the processing result of the target production variable, and the verification result of the target production variable, the verification error generated during the verification process of the target production variable is determined, and the processing logic code of the target production variable is adjusted based on the verification error.
3. The production variable verification method as described in claim 2, characterized in that, The step of adjusting the processing logic code of the target production variable based on the verification error includes: Determine the error type of the verification error, wherein the error type includes at least verification data error and logic code error; If the error type is the verification data error, then after adjusting the verification data, return to the step of calling the variable code package with the verification data as input parameter to obtain the processing results of each of the production variables; If the error type is the logic code error, then the error code is determined in the processing logic code of the target production variable, so that the developers can adjust the processing logic code of the target production variable based on the error code.
4. The production variable verification method according to any one of claims 1 to 3, characterized in that, The production variable validation method further includes: Acquire test data, and when a test instruction is triggered, perform regression testing based on the variable code package, the processing logic code of each of the production variables, and the test data.
5. A production variable verification device, characterized in that, The production variable verification device includes: The packaging module is used to package the processing logic code of each production variable into a variable code package; The module is used to obtain verification data and call the variable code package with the verification data as input parameters to obtain the processing results of each of the production variables. The result generation module is used to generate the verification result of each of the production variables based on the processing logic code of each production variable and the verification data. The verification module determines that the target production variable has passed verification if the processing result of the target production variable among the various production variables is consistent with the verification result of the target production variable. The packaging module is further configured to divide each production variable into multiple production variable groups according to preset rules; and to package the processing logic code of each production variable group to obtain the variable code package corresponding to each production variable group. The calling module is further configured to, for any target variable group in each of the production variable groups, determine the target data corresponding to the target variable group from the verification data; and call the variable code package corresponding to the target variable group with the target data as input parameters to obtain the processing results of each production variable in the target variable group. The calling module is further configured to use production data from the big data analytics platform as verification data, wherein the production data is the data returned by the platform data source when the business system calls the platform data source of the big data analytics platform.
6. A production variable verification device, characterized in that, The production variable verification device includes: a memory, a processor, and a production variable verification program stored in the memory and executable on the processor. When the production variable verification program is executed by the processor, it implements the steps of the production variable verification method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a production variable verification program, which, when executed by a processor, implements the steps of the production variable verification method as described in any one of claims 1 to 4.