Service data processing method and related equipment
By screening and verifying the interaction data in the test case and using preset rules to correct the expected test results, the problem of inaccurate test result correction in the existing technology is solved and higher accuracy is achieved.
Patent Information
- Application Number
- CN202410288818.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2025-09-16
AI Technical Summary
The existing query and verification logic is difficult to cover all test data, especially difficult to detect abnormal data, resulting in inaccurate correction of test results.
By obtaining the interaction data set of the target application under the test case, using the use case tag information to filter the target interaction data, verifying it according to the preset verification rule set, and correcting it when the expected test result does not match the verification result, the corrected test result is output.
The accuracy of the correction of the expected test results of the test cases is improved, and the reliability of the test results after correction is ensured.
Smart Images

Figure CN120653541A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and specifically to a business data processing method and related equipment. The related equipment includes a business data processing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Once the application is developed, it is tested using test cases to generate test data. Once the test data is generated, it is verified using query and validation logic to calibrate the expected test results of the test cases.
[0003] However, due to the limitations of current query and verification logic, it is difficult to cover all test data, especially difficult to find abnormal data in the test data, which makes it difficult to verify the test data, making it difficult to correct the expected test results, and thus resulting in inaccurate corrected test results.
[0004] In summary, there is currently a problem of insufficient accuracy in correcting the expected test results of test cases. Summary of the Invention
[0005] The embodiments of the present application provide a business data processing method and related equipment, which can improve the accuracy of correcting the expected test results of test cases.
[0006] A business data processing method, comprising:
[0007] Obtaining an interaction data set generated by a target application under at least one test case test, where the interaction data set includes multiple interaction data corresponding to each test case, and both the test case and its corresponding interaction data carry use case tag information of the test case;
[0008] Determine a target test case to be processed in the test case, and extract multiple target interaction data corresponding to the target test case from the interaction data set based on target test case tag information carried by the target test case;
[0009] According to the target interaction data, the verification rule data corresponding to the target interaction data is screened out from the preset verification rule set, and the multiple target interaction data are verified based on the verification rule data to obtain the verification result;
[0010] Based on the target use case tag information, the expected test results for the target interaction data are extracted from the target test case;
[0011] When the expected test result does not match the verification result, the expected test result is corrected to obtain and output the corrected test result.
[0012] Accordingly, an embodiment of the present application provides a service data processing device, including:
[0013] An acquisition unit may be configured to acquire an interaction data set generated by a target application under at least one test case test, wherein the interaction data set includes a plurality of interaction data corresponding to each test case, and both the test case and its corresponding interaction data carry use case tag information of the test case;
[0014] The determination unit may be used to determine a target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target test case tag information carried by the target test case;
[0015] The screening unit can be used to screen out verification rule data corresponding to the target interaction data from a preset verification rule set according to the target interaction data, and verify the multiple target interaction data based on the verification rule data to obtain a verification result;
[0016] An extraction unit may be used to extract expected test results for target interaction data in a target test case based on target use case tag information;
[0017] The correction unit can be used to correct the expected test result when the expected test result does not match the verification result, and obtain and output the corrected test result.
[0018] Optionally, in some embodiments, the screening unit can be specifically used to analyze the target interaction data to obtain the data interaction type of the target application tested by the test case; based on the data interaction type, the verification rule data corresponding to the target application is screened out from the preset verification rule set.
[0019] Optionally, in some embodiments, the screening unit can be specifically used to extract corresponding target attribute data from each target interaction data, and compare the target attribute data of different target interaction data to obtain a comparison result; based on the comparison result, determine the data interaction type of the test case test target application.
[0020] Optionally, in some embodiments, the screening unit can be specifically used to obtain a preset verification tool corresponding to the target interaction data, and merge the verification rule data with the preset verification tool to obtain a target verification tool; through the target verification tool, multiple target interaction data are verified to obtain verification results.
[0021] Optionally, in some embodiments, the screening unit can be specifically used to pair a variety of target interaction data through a target verification tool to obtain paired interaction data; based on the verification rules included in the target verification tool, the paired interaction data is verified to obtain a verification result.
[0022] Optionally, in some embodiments, the screening unit can also be used to display a verification processing page of the target application, the verification processing page including a verification time designation control; and determine the verification time of the target interaction data in response to a specified operation on the verification time designation control.
[0023] Accordingly, the screening unit may be specifically configured to verify the various target interaction data based on the verification rule data when the verification time arrives to obtain a verification result.
[0024] Optionally, in some embodiments, the acquisition unit can also be used to send a test request carrying use case tag information to the target server of the target application based on the test case, so that the target server generates candidate interaction data carrying the use case tag information based on the test request.
[0025] Correspondingly, the acquisition unit can be specifically used to send a data acquisition request carrying the data storage address of the target application to the target server, so that the target server queries and returns the interaction data of the target application carrying the use case tag information in the database corresponding to the data storage address; receives the interaction data returned by the target server, and generates an interaction data set generated by the target application under the test case test based on the interaction data.
[0026] In addition, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is configured to run the application program in the memory to implement a business data processing method provided by an embodiment of the present invention.
[0027] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for loading by a processor to execute any business data processing method provided in the embodiment of the present application.
[0028] In addition, an embodiment of the present application also provides a computer program product, including a computer program, which implements any business data processing method provided in the embodiment of the present application when the computer program is executed by a processor.
[0029] The present application can obtain an interaction data set generated by a target application under at least one test case test, the interaction data set including a plurality of interaction data corresponding to each test case, and the test case and its corresponding interaction data both carry the use case marking information of the test case; determine the target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target use case marking information carried by the target test case; according to the target interaction data, filter out the verification rule data corresponding to the target interaction data from the preset verification rule set, and verify the plurality of target interaction data based on the verification rule data to obtain the verification result; based on the target use case marking information, extract the expected test result for the target interaction data from the target test case; when the expected test result does not match the verification result, correct the expected test result to obtain and output the corrected test result. Since the present application can filter out multiple target interaction data of the target test case in the interaction data set of the target application based on the target use case marking information, and filter out verification rule data suitable for the target interaction data in the preset verification rule set, it can cover the verification of the target interaction data of any target test case, so that when the verification result obtained by any verification does not match the expected test result, the corresponding expected test result can be corrected to improve the accuracy of the corrected test result. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 This is a scenario diagram of the business data processing method provided in an embodiment of the present application;
[0032] Figure 2 This is a flowchart of a method for processing business data provided by an embodiment of the present application;
[0033] Figure 3 FIG2 is a flow chart illustrating a method for processing business data provided in an embodiment of the present application;
[0034] Figure 4 is a schematic diagram of a test system provided in an embodiment of the present application;
[0035] Figure 5 This is a schematic diagram of marking information for a marking use case provided by an embodiment of the present application;
[0036] Figure 6 A schematic diagram of pairing interaction data provided in an embodiment of the present application;
[0037] Figure 7 A schematic diagram of the configuration of left and right source data provided in an embodiment of the present application;
[0038] Figure 8 A schematic diagram of expected test results in a query target test case provided in an embodiment of the present application;
[0039] Figure 9 This is a schematic diagram of the structure of the service data processing device provided in an embodiment of the present application;
[0040] Figure 10 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0042] The embodiments of the present application provide a method, apparatus, electronic device, and computer-readable storage medium for processing business data. The business data processing apparatus can be integrated into an electronic device, which can be a server, a terminal, or other device.
[0043] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, car terminal, etc., but is not limited to these. The terminal and the server can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.
[0044] For example, see Figure 1Taking the integration of a business data processing device in an electronic device as an example, the electronic device can obtain an interaction data set generated by a target application under at least one test case test, where the interaction data set includes a plurality of interaction data corresponding to each test case, and both the test case and its corresponding interaction data carry the test case marking information of the test case; determine the target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target case marking information carried by the target test case; according to the target interaction data, filter out the verification rule data corresponding to the target interaction data from the preset verification rule set, and verify the plurality of target interaction data based on the verification rule data to obtain a verification result; extract the expected test result for the target interaction data from the target test case based on the target case marking information; when the expected test result does not match the verification result, correct the expected test result to obtain and output the corrected test result.
[0045] Among them, the electronic device can filter out verification rule data that is suitable for the target interaction data from the preset verification rule set, so that it can cover the verification of the target interaction data of any target test case, so that when the verification result obtained by any verification does not match the expected test result, the corresponding expected test result can be corrected to improve the accuracy of the corrected test result.
[0046] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0047] This embodiment will be described from the perspective of a business data processing device, which can be specifically integrated into an electronic device, which can be a server or a terminal; wherein the terminal can include a tablet computer, a laptop computer, a personal computer (PC), a wearable device, a virtual reality device or other smart device that can obtain data.
[0048] like Figure 2 As shown, the specific process of the business data processing method is as follows S201 to S205:
[0049] S201: Obtain an interaction data set generated by a target application under at least one test case test.
[0050] The interaction data set includes a variety of interaction data corresponding to each test case, and both the test case and its corresponding interaction data carry the test case tag information.
[0051] So-called test cases are typically used to simulate various conditions to verify whether the target application behaves as expected under different conditions.
[0052] The so-called interaction data may refer to the data generated when the test case tests the interactive function of the target application; when a test case tests the target application, multiple interaction data will be generated. For example, when the target application is an interactive application used for transaction activities between merchants and buyers, the test case can simulate the buyer's transaction operations through the target application. Accordingly, the target application will generate bills for both the merchant and the buyer through the target server. It can be understood here that the buyer's bill and the merchant's bill can be regarded as different types of interaction data for the same test case.
[0053] The so-called use case tag information may be information used to identify a test case. For example, the use case identification information may be a unique identifier.
[0054] For interaction data and test cases, use case tag information can be used for coloring. Specifically, the coloring method can be: based on the test case, a test request carrying use case tag information is sent to the target server of the target application, so that the target server generates candidate interaction data carrying use case tag information based on the test request.
[0055] After the target server generates candidate interaction data carrying use case tag information based on the test request, it can store the candidate interaction data carrying the use case tag information in a database corresponding to the target server. The database corresponding to the target server can be a database located internally within the target server, or it can be a database located externally to the target server and geographically distant from the target server, for example, a database located between the target server and the electronic device of the present application.
[0056] Accordingly, the method for "obtaining the interaction data set generated by the target application under the test case" can be: sending a data acquisition request carrying the target application's data storage address to the target server, so that the target server queries and returns the target application's interaction data carrying the use case tag information in the database corresponding to the data storage address; receiving the interaction data returned by the target server, and generating the interaction data set generated by the target application under the test case based on the interaction data. The interaction data is considered candidate interaction data.
[0057] It can be understood here that this application sends a test request to the target server of the target application through a test request carrying use case marking information. In this way, the use case marking information carried in the test request marks the entire business process, and both the interaction data and the corresponding test case carry the use case marking information.
[0058] S202: Determine a target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on target test case tag information carried by the target test case.
[0059] Regarding step S202, "determining the target test case to be processed from the test cases" may be performed by obtaining the test sequence number of the test case for the target application; and determining the target test case to be processed from the test cases according to the test sequence number. There may be at least one target test case to be processed. If there are multiple target test cases, the multiple target test cases may be verified in parallel.
[0060] Alternatively, for a target test case, the present application may obtain the test case type of the test case; based on the test case type, determine the target test case to be processed in the test case. The test case type may correspond one-to-one to the interactive function tested by the test case for the target application.
[0061] Then, after determining the target test case to be processed, the target interaction data can be obtained. Specifically, based on the target case tag information carried by the target test case, multiple initial interaction data corresponding to the target test case are extracted from the interaction data set; the interaction information included in different initial interaction data is checked; when the interaction information is checked, the initial interaction data is used as the target interaction data.
[0062] The interaction information may refer to information generated based on the target application and used to identify whether the initial interaction data belongs to the same target test case.
[0063] S203 : Filter out verification rule data corresponding to the target interaction data from a preset verification rule set according to the target interaction data, and verify the various target interaction data based on the verification rule data to obtain a verification result.
[0064] The preset verification rule set may include a plurality of preset verification rule data, and the verification rule data belongs to the preset verification rule data. The so-called preset verification rule data may refer to rule data used to verify the interactive data.
[0065] Regarding step S203, the method of "filtering out verification rule data corresponding to the target interaction data from the preset verification rule set according to the target interaction data" can be as shown in steps S2031 to S2032:
[0066] S2031. Analyze the target interaction data to obtain the data interaction type of the target application tested by the test case.
[0067] The data interaction type can refer to the functional type of the target application's data interaction function. For example, when the target application is an interactive application and the test case simulates a buyer's transaction operation through the target application, the data interaction type can include data identity type, calculation type, and agreement type.
[0068] The so-called data consistency type refers to the consistency of the data on the merchant and buyer's invoices. For example, in a test case simulating a buyer purchasing goods from a merchant, the target server generates an order. After the simulated buyer pays the merchant, the target server generates invoices for both the buyer and the merchant as transaction data. Specifically, the data consistency type can be the same as the payment amount, buyer name, merchant name, and transaction status on the merchant and buyer's invoices. The transaction status can be successful.
[0069] The calculation type refers to the type of data on both the merchant and buyer's invoices that requires calculation using a calculation strategy. For example, if the test case simulates a buyer purchasing goods from a merchant, the target server will generate both the buyer's and merchant's invoices as transaction data. Specifically, the same data type can mean that both the merchant and buyer's invoices have the same payment amount, buyer name, merchant name, and transaction status. The transaction status can be success.
[0070] The so-called agreed type refers to the data on the invoices of both the merchant and the buyer falling within the agreed-upon range. For example, a test case simulates a buyer purchasing goods from a merchant. Accordingly, the target server generates invoices for both the buyer and the merchant as transaction data. Specifically, if the buyer's interaction status, such as the billing status, is Failed, and the merchant's interaction status, such as the billing status, is also Failed or Closed, this situation can be considered an agreed type.
[0071] Regarding step S2031, specifically, the present application can extract corresponding target attribute data from each target interaction data, and compare the target attribute data of different target interaction data to obtain a comparison result; based on the comparison result, determine the data interaction type of the test case test target application.
[0072] The target attribute data may refer to data representing attributes of the target interaction data, such as payment amount, buyer name, merchant name, interaction status, and the like.
[0073] Specifically, the present application can extract corresponding target attribute data from each target interaction data based on the attribute identifier, wherein the attribute identifier can refer to a unique identifier of the target attribute data.
[0074] When the comparison result shows that the target attribute data are identical, an attribute category is identified in the target attribute data; and based on the attribute category, a data interaction type of the target application to be tested by the test case is determined.
[0075] For example, when the attribute category is interaction status, the data interaction type of the target application tested by the test case is determined to be the agreed type; when the attribute category includes at least two sub-attribute categories, such as payment amount, buyer name, merchant name, and interaction status, at least two of them, the data interaction type of the target application tested by the test case is determined to be the data identical type.
[0076] When the comparison result is that the target attribute data are different, it is determined that the data interaction type of the test target application of the test case is a calculation type.
[0077] S2032: Filter out verification rule data corresponding to the target application from the preset verification rule set according to the data interaction type.
[0078] The preset verification rule set includes at least one preset verification rule data, and the preset verification rule data can be used to verify rule data of target interaction data.
[0079] For step 2032, the present application can obtain a mapping relationship set, which includes a mapping relationship between a preset data interaction type and a preset verification rule data; based on the mapping relationship and the data interaction type, the verification rule data corresponding to the data interaction type is filtered out in the preset verification rule set, and the verification rule data corresponding to the data interaction type is used as the verification rule data corresponding to the target application.
[0080] After obtaining the verification rule data, the present application can use the verification rule data to verify the target interaction data, specifically as shown in steps S2041 to S2042:
[0081] S2041. Obtain a preset verification tool corresponding to the target interaction data, and merge the verification rule data with the preset verification tool to obtain the target verification tool.
[0082] The preset verification tool may be a preset tool for verifying target interaction data, and may be configured with data pairing relationships required for verifying target interaction data, execution processes for verification tasks at multiple granularities, and the like.
[0083] After obtaining the preset verification tool, the present application can integrate the verification rule data corresponding to the target interaction data into the preset verification tool, so that the target verification tool can have the verification rules for verifying the target interaction data.
[0084] Regarding step S2041, specifically, the present application can obtain the data configuration path corresponding to the preset verification tool; based on the data configuration path, the target interaction data is configured into the file corresponding to the data configuration path to obtain the target verification tool.
[0085] S2042. Verify the various target interaction data using a target verification tool to obtain verification results.
[0086] After obtaining the target verification tool, the present application can verify the target interaction data. Specifically, it can be: through the target verification tool, multiple target interaction data are paired to obtain paired interaction data; based on the verification rules contained in the target verification tool, the paired interaction data is verified to obtain the verification results.
[0087] Specifically, for paired interaction data, the target verification tool can be used to determine the data source identifier of each target interaction data and establish a pairing relationship between the data source identifiers of different target interaction data; based on the pairing relationship and the target interaction data, the paired interaction data is generated.
[0088] When the pairing interaction data meets the verification rules, the verification result of the pairing interaction data is verification passed; when the pairing interaction does not meet the verification rules, the verification result of the pairing interaction data is verification failed.
[0089] Verification rules can include data identity rules, calculation rules, and agreement rules. This example uses an interactive application as the target application, a test case simulating a buyer purchasing goods from a merchant, and target interaction data including invoices from both the buyer and the merchant.
[0090] The so-called data identity rule may be a corresponding verification rule for data of the same type; the data identity rule may be configured as follows: Order.PaymentAmount == Receipt.ReceiptAmount && Order.Buyer == Receipt.Payer && Order.Seller == Receipt.Payer && Order.Status == Success && Receipt.Status == Success.
[0091] It should be understood that, for the data identity rule, when the buyer's order, the transaction number based on both the buyer and the merchant, the payment amount on the buyer's order and the merchant's receipt, the buyer's name, and the merchant's name are all consistent, and the interaction status is successful, the verification result of the paired data is verified as passed. When the buyer's order, the transaction number based on both the buyer and the merchant, the payment amount on the buyer's order and the merchant's receipt, the buyer's name, and the merchant's name are different, and / or the interaction status is failed, the verification result of the paired data is verified as failed.
[0092] Calculation rules can be validation rules corresponding to calculation types. For example, during a transaction between a buyer and a merchant, if a merchant collects a fee, this fee can be calculated using the fee ratio. The calculation rule can be configured as follows: Total amount collected × Fee ratio = Fee amount. Another example: During a transaction between a buyer and a merchant, if a buyer's order is partially refunded, the payment amount = Refund amount + Remaining amount. Another example: When a buyer and a merchant settle multiple transactions into a single summary document, the transaction document 1. Amount + transaction document 2. Amount + ... = Settlement document amount.
[0093] It can be understood here that when the pairing interaction data meets the calculation rules, the verification result of the pairing interaction data is verification passed; when the pairing interaction data does not meet the calculation rules, the verification result of the pairing interaction data is verification failed.
[0094] A contract rule can refer to the validation rule corresponding to the contract type. A contract rule can be configured as follows: when order.status == failed then receipt.status in (failed, closed). In other words, when the order between the buyer and the merchant fails, the merchant's receipt status will be failed or closed.
[0095] It can be understood here that, for example, when the order between the buyer and the merchant is in a failed state, if the merchant's receipt status is successful, then the verification result of the pairing interaction data is verification failure; when the order between the buyer and the merchant is in a successful state, if the merchant's receipt status is failed or closed, then the verification result of the pairing interaction data is verification passed.
[0096] For step S203, before the step of "verifying multiple target interaction data based on verification rule data to obtain verification results", the time for verifying the target interaction data can be specified. Specifically, the verification processing page of the target application is displayed, and the verification processing page includes a verification time designation control; in response to the specified operation of the verification time designation control, the verification time of the target interaction data is determined.
[0097] The verification time specification control may be a control for specifying the verification time of the target interactive data; specifically, the verification time specification control may be a selection control or an input control. When the verification time specification control is a selection control, the specifying operation may be a selection operation; when the verification time specification control is an input control, the specifying operation may be an input operation. The verification time may be the current time, or a time that is a preset time interval from the current time.
[0098] Accordingly, when the verification time arrives, the various target interaction data are verified based on the verification rule data to obtain a verification result.
[0099] It can be understood here that this application can be flexibly configured to meet the testing requirements of different test cases, and can specify the test time interval to initiate verification in real time.
[0100] S204: Extracting expected test results for target interaction data from the target test case based on the target use case tag information.
[0101] The expected test result may refer to the expected result that can be achieved after testing the target application using the target test case, such as "success" or "failure".
[0102] With respect to step S204, the present application may query the target test case for the expected test result based on the target use case tag information; when the expected test result exists, the expected test result for the target interaction data is extracted.
[0103] It is understood that the expected test result may refer to a prediction of the result that should be obtained after the test case is tested. The expected test result may be included in the target test case.
[0104] S205: When the expected test result does not match the verification result, the expected test result is corrected to obtain and output a corrected test result.
[0105] When the verification result is that the paired interaction data passes the verification, the actual test result of the target interaction data is determined to be a test success; when the verification result is that the paired interaction data fails the verification, the actual test result of the target interaction data is determined to be a test failure.
[0106] Before step S205, the expected test result can be matched with the verification result; when the expected test result is successful and the verification result is that the verification of the paired interaction data is passed, it is determined that the expected test result matches the verification result; when the expected test result is failed and the verification result is that the verification of the paired interaction data is not passed, it is determined that the expected test result matches the verification result; when the expected test result is successful and the verification result is that the verification of the paired interaction data is not passed, it is determined that the expected test result does not match the verification result; when the expected test result is failed and the verification result is that the verification of the paired interaction data is passed, it is determined that the expected test result does not match the verification result.
[0107] For step S205, the step of "correcting the expected test result, obtaining and outputting the corrected test result" can be: obtaining the actual test result corresponding to the verification result; replacing the expected test result with the actual test result, and obtaining and outputting the corrected test result.
[0108] The present application can obtain an interaction data set generated by a target application under at least one test case test, the interaction data set including a plurality of interaction data corresponding to each test case, and the test case and its corresponding interaction data both carry the use case marking information of the test case; determine the target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target use case marking information carried by the target test case; according to the target interaction data, filter out the verification rule data corresponding to the target interaction data from the preset verification rule set, and verify the plurality of target interaction data based on the verification rule data to obtain the verification result; based on the target use case marking information, extract the expected test result for the target interaction data from the target test case; when the expected test result does not match the verification result, correct the expected test result to obtain and output the corrected test result. Since the present application can filter out multiple target interaction data of the target test case in the interaction data set of the target application based on the target use case marking information, and filter out verification rule data suitable for the target interaction data in the preset verification rule set, it can cover the verification of the target interaction data of any target test case, so that when the verification result obtained by any verification does not match the expected test result, the corresponding expected test result can be corrected to improve the accuracy of the corrected test result.
[0109] The method described in the above embodiment will be further described in detail below with examples.
[0110] In this embodiment, the business data processing device is specifically integrated into an electronic device, and the electronic device is a server.
[0111] like Figure 3 As shown, a business data processing method, the specific process is shown in steps S501 to S507:
[0112] S501. The electronic device obtains a test case and sends a test request carrying the test case tag information to a target server of a target application based on the test case, so that the target server generates candidate interaction data carrying the test case tag information based on the test request.
[0113] S502: The electronic device sends a data acquisition request carrying the data storage address of the target application to the target server, so that the target server searches the database corresponding to the data storage address and returns the interaction data of the target application carrying the use case tag information.
[0114] S503: The electronic device receives the interaction data returned by the target server, and generates an interaction data set generated by the target application under the test case test based on the interaction data.
[0115] The interaction data set includes a variety of interaction data corresponding to each test case, and both the test case and its corresponding interaction data carry the test case tag information.
[0116] Regarding steps S501 to S503, a specific example is used to illustrate. Figure 4 As shown, the present application can provide a test system that can be deployed on an electronic device, where the electronic device can be a single electronic device or a device cluster. Specifically, the test system can include a use case execution module, a verification management module, a verification execution module, and a correction module. When the electronic device is a device cluster, the use case execution module, verification management module, verification execution module, and correction module can be deployed on different devices.
[0117] The so-called use case execution module can be used to test the target application using test cases. The so-called verification management module can be used to manage the data required for verifying the target interactive data, such as data sources and pre-set verification tools. The data source can include the data storage address, library table name, unique key, and optional data preprocessing script of the target application's interactive data; the data source can be used to query the interactive data from the database.
[0118] The so-called verification execution module can be used to verify the target interaction data; the so-called correction module can be used to correct the expected test results.
[0119] Specifically, this application can test use cases to test the target application, such as Figure 4 As shown, the electronic device can use the use case execution module to send a test request carrying use case tag information to the target server of the target application based on the test case, so that the target server can generate candidate interaction data carrying the use case tag information based on the test request. The target server can store the generated candidate interaction data carrying the use case tag information in a database corresponding to the data storage address.
[0120] Then, the electronic device can obtain the data storage address through the verification management module, and then send a data acquisition request carrying the data storage address of the target application to the target server through the verification execution module, so that the target server can query and return the interaction data of the target application carrying the use case marking information in the database corresponding to the data storage address; receive the interaction data returned by the target server, and generate an interaction data set generated by the target application under the test case test based on the interaction data.
[0121] For use case tag information, specifically, Figure 5As shown, the present application can execute test cases using a use case execution tool through a use case execution module to test the target application. During this process, the use case marking information marks the test process of the entire test case, and the candidate interaction data stored in the database will also carry the use case marking information. During this process, the target server of the target application will report the marking log of the use case marking information to the use case execution module. Among them, the marking log includes the mapping relationship between the use case marking information and the candidate interaction data. Based on this, the use case execution module can associate the use case marking information with the test case based on the mapping relationship, which can facilitate the subsequent correction of the expected test results of the test case.
[0122] S504: The electronic device determines a target test case to be processed in the test case, and extracts a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target test case tag information carried by the target test case.
[0123] Specifically, for the target test case, the electronic device may obtain a test serial number of the test case for the target application; and determine the target test case to be processed in the test case according to the test serial number.
[0124] Regarding the target interaction data, specifically, the electronic device can extract multiple initial interaction data corresponding to the target test case from the interaction data set based on the target use case tag information carried by the target test case; verify the interaction information included in different initial interaction data; when the interaction information is verified, the initial interaction data is used as the target interaction data.
[0125] S505: The electronic device selects verification rule data corresponding to the target interaction data from a preset verification rule set according to the target interaction data, and verifies the multiple target interaction data based on the verification rule data to obtain a verification result.
[0126] For the verification rule data, the electronic device can analyze the target interaction data to obtain the data interaction type of the target application tested by the test case; according to the data interaction type, the verification rule data corresponding to the target application is filtered out from the preset verification rule set.
[0127] After obtaining the verification rule data, the present application can verify the target interaction data. Specifically, the electronic device can obtain the preset verification tool corresponding to the target interaction data, and merge the verification rule data with the preset verification tool to obtain the target verification tool; through the target verification tool, multiple target interaction data can be verified to obtain the verification results.
[0128] Specifically, if Figure 4As shown, the present application can obtain preset verification rule data through the verification management module and store the preset verification rule data in a preset verification rule set.
[0129] Among them, a rule data input page can be displayed, which includes a rule data input control; in response to an input operation on the rule data input control, preset verification rule data is generated, and the preset verification rule data is stored in a preset verification rule set through a verification management module.
[0130] like Figure 4 As shown, the electronic device can use the verification execution module to perform verification at a specified verification time. When the verification time arrives, the electronic device can obtain the preset verification tool corresponding to the target interaction data through the verification execution module, and merge the verification rule data with the preset verification tool to obtain the target verification tool. Then, the verification execution module uses the target verification tool to pair the multiple target interaction data to obtain paired interaction data. Based on the verification rules contained in the target verification tool, the paired interaction data is verified to obtain a verification result.
[0131] For example, when the target application is an interactive application and the test case is to simulate a buyer purchasing goods from a merchant, the target verification tool can be used to first find the buyer's target interaction data among multiple target interaction data, then find the merchant's target interaction data, and then match the target interaction data.
[0132] If the target interaction data cannot be paired successfully, it is determined that there is a problem with the target interaction data. For example, the target interaction data includes left source data and right source data. The left source data and the right source data can refer to the data of the two interaction ends of the target application. For example, the left source data is the target interaction data generated by the test case to simulate the buyer, and correspondingly, the right source data is the target interaction data of the merchant. The successfully paired interaction data can be as follows Figure 6 The left source data is labeled ① and the right source data is labeled ⑥, or the left source data is labeled ② and the right source data is labeled ⑦.
[0133] Specifically, if the buyer's target interaction data is exactly the same as the merchant's target interaction data, the target interaction data is a duplicate account. If the left source data and the right source data are exactly the same, the target interaction data is a duplicate account. Figure 6 The data marked with number ③ are shown below.
[0134] If the paired interaction data does not meet the data verification rules, the target interaction data is an error. Figure 6 The left source data is marked as ④ and the right source data is marked as ⑥.
[0135] If the target interaction data of the merchant corresponding to the buyer's target interaction data cannot be found, or the target interaction data of the merchant corresponding to the buyer's target interaction data does not match, it is determined that the target interaction data is pending. Figure 6 The left source data is marked as ⑤ and the right source data is marked as ⑨.
[0136] Among them, for the verification of paired interaction data, such as Figure 7 As shown, Data Source 1 is configured as the left source data, and Data Source 2 is configured as the right source data. The left and right source data serve as paired interaction data. The pairing relationship between the left and right source data can be expressed as the left source data name paired with the right source data name. Once the right and left source data and the pairing relationship are configured, verification rule 1 can be used for verification.
[0137] S506: The electronic device extracts expected test results for the target interaction data from the target test case based on the target use case tag information.
[0138] Specifically, the electronic device can query the target test case for the expected test result based on the target use case tag information; when the expected test result exists, the electronic device can extract the expected test result for the target interaction data.
[0139] S507: When the expected test result does not match the verification result, the electronic device corrects the expected test result, obtains and outputs a corrected test result.
[0140] With respect to step S506 and step S507, the electronic device can record the use case identification information of the test case and the business log of the business writing data of the entire test process of the test case through the use case execution module. Figure 8 As shown, the electronic device can query the target use case tag information in the service log of the service write data based on the unique key of the target interaction data through the use case execution module. Then, based on the target use case identification information, it queries the expected test result in the target test case. If the expected test result does not match the verification result, the expected test result is corrected and a corrected test result is obtained and output.
[0141] For the corrected test result, if the test case is a normal case and the expected test result is success, the corrected test result should be failure.
[0142] In addition, for example, if the test case is an abnormal case, it can also be analyzed in combination with the expectation of constructing the abnormality. If the test case does not tamper with the business database, it can be considered a test abnormality, and the test result after correction should be a failure.
[0143] Furthermore, if the expected test results for the target interaction data cannot be extracted in the target test case, there may be several reasons: the business does not record the log of writing data, the business coloring information does not run through the entire business process, the task is not written for this use case, there is a system bug in the use case execution module, etc.
[0144] In summary, this application verifies the interactive data of the business by establishing a general test system running in a test environment, supplementing the missing verification for the test case, making the test case more comprehensive in checking the business data and able to discover business problems. Not only that, this application also supports flexible configuration of the reconciliation system to meet the reconciliation needs of different businesses. It can specify the time interval of the test to initiate the verification in real time, and associate the verification results with the test case, so that it can be corrected in combination with the expected test results of the test case.
[0145] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0146] The present application can obtain an interaction data set generated by a target application under at least one test case test, the interaction data set including a plurality of interaction data corresponding to each test case, and the test case and its corresponding interaction data both carry the use case marking information of the test case; determine the target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target use case marking information carried by the target test case; according to the target interaction data, filter out the verification rule data corresponding to the target interaction data from the preset verification rule set, and verify the plurality of target interaction data based on the verification rule data to obtain the verification result; based on the target use case marking information, extract the expected test result for the target interaction data from the target test case; when the expected test result does not match the verification result, correct the expected test result to obtain and output the corrected test result. Since the present application can filter out multiple target interaction data of the target test case in the interaction data set of the target application based on the target use case marking information, and filter out verification rule data suitable for the target interaction data in the preset verification rule set, it can cover the verification of the target interaction data of any target test case, so that when the verification result obtained by any verification does not match the expected test result, the corresponding expected test result can be corrected to improve the accuracy of the corrected test result.
[0147] In order to better implement the above method, an embodiment of the present application also provides a business data processing device, which can be integrated into an electronic device, such as a server or terminal, and the terminal may include a tablet computer, a laptop computer and / or a personal computer, etc.
[0148] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0149] For example, Figure 9 As shown, the business data processing device may include an acquisition unit 301, a determination unit 302, a screening unit 303, an extraction unit 304, and a correction unit 305, as follows:
[0150] (1) Acquisition unit 301;
[0151] The acquisition unit 301 can be used to obtain an interaction data set generated by the target application under at least one test case test. The interaction data set includes multiple interaction data corresponding to each test case. The test case and its corresponding interaction data both carry the test case tag information.
[0152] For example, the acquisition unit 301 can be used to send a test request carrying use case tag information to the target server of the target application based on the test case, so that the target server generates candidate interaction data carrying the use case tag information based on the test request; send a data acquisition request carrying the data storage address of the target application to the target server, so that the target server queries and returns the interaction data of the target application carrying the use case tag information in the database corresponding to the data storage address; receive the interaction data returned by the target server, and generate an interaction data set generated by the target application under the test case test based on the interaction data.
[0153] (2) determining unit 302;
[0154] The determining unit 302 may be configured to determine a target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on the target test case tag information carried by the target test case.
[0155] (3) screening unit 303;
[0156] The screening unit 303 may be configured to screen out verification rule data corresponding to the target interaction data from a preset verification rule set according to the target interaction data, and verify the various target interaction data based on the verification rule data to obtain a verification result.
[0157] For example, the screening unit 303 can be used to analyze the target interaction data to obtain the data interaction type of the target application tested by the test case; and screen out the verification rule data corresponding to the target application from the preset verification rule set according to the data interaction type.
[0158] For another example, the screening unit 303 can be used to display a verification processing page of the target application, which includes a verification time designation control; in response to a specified operation on the verification time designation control, the verification time of the target interaction data is determined; when the verification time is reached, the various target interaction data are verified based on the verification rule data to obtain a verification result.
[0159] (4) Extraction unit 304;
[0160] The extraction unit 304 may be configured to extract expected test results for target interaction data from the target test case based on the target use case tag information.
[0161] (5) Correction unit 305;
[0162] The correction unit 305 may be configured to correct the expected test result when the expected test result does not match the verification result, and obtain and output a corrected test result.
[0163] As can be seen from the above, the acquisition unit 301 of the present application can be used to obtain an interaction data set generated by a target application under at least one test case test, and the interaction data set includes multiple interaction data corresponding to each test case, and the test case and its corresponding interaction data both carry the use case marking information of the test case; the determination unit 302 can be used to determine the target test case to be processed in the test case, and based on the target use case marking information carried by the target test case, extract the multiple target interaction data corresponding to the target test case in the interaction data set; the screening unit 303 can be used to screen out the verification rule data corresponding to the target interaction data in the preset verification rule set according to the target interaction data, and verify the multiple target interaction data based on the verification rule data to obtain the verification result; the extraction unit 304 can be used to extract the expected test result for the target interaction data in the target test case based on the target use case marking information; the correction unit 305 can be used to correct the expected test result when the expected test result does not match the verification result, and obtain and output the corrected test result. Since the present application can filter out multiple target interaction data of the target test case in the interaction data set of the target application based on the target use case marking information, and filter out verification rule data suitable for the target interaction data in the preset verification rule set, it can cover the verification of the target interaction data of any target test case, so that when the verification result obtained by any verification does not match the expected test result, the corresponding expected test result can be corrected to improve the accuracy of the corrected test result.
[0164] The present application also provides an electronic device, such as Figure 10 , which shows a schematic structural diagram of an electronic device involved in an embodiment of the present invention, specifically:
[0165] The electronic device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will understand that Figure 10 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0166] Processor 401 is the control center of the electronic device. It connects all parts of the electronic device using various interfaces and circuits. It performs various functions of the electronic device and processes data by running or executing software programs and / or modules stored in memory 402 and accessing data stored in memory 402. Optionally, processor 401 may include one or more processing cores. Preferably, processor 401 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 401.
[0167] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and business data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0168] The electronic device also includes a power supply 403 for supplying power to various components. Preferably, the power supply 403 can be logically connected to the processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 403 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0169] The electronic device may further include an input unit 404, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0170] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402 to implement various functions as follows:
[0171] Obtain an interaction data set generated by a target application under at least one test case test, the interaction data set including a plurality of interaction data corresponding to each test case, and both the test case and its corresponding interaction data carry the use case marking information of the test case; determine the target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case in the interaction data set based on the target use case marking information carried by the target test case; according to the target interaction data, filter out verification rule data corresponding to the target interaction data in a preset verification rule set, and verify the plurality of target interaction data based on the verification rule data to obtain a verification result; based on the target use case marking information, extract the expected test result for the target interaction data in the target test case; when the expected test result does not match the verification result, correct the expected test result to obtain and output the corrected test result.
[0172] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0173] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0174] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be loaded by a processor to execute any business data processing method provided in the embodiment of the present application.
[0175] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0176] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0177] Since the instructions stored in the computer-readable storage medium can execute the steps in any business data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any business data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0178] According to one aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations provided in the above embodiments.
[0179] The above is a detailed introduction to a business data processing method and related equipment provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A business data processing method, characterized in that: include: Obtaining an interaction data set generated by a target application under at least one test case test, the interaction data set including a plurality of interaction data corresponding to each of the test cases, wherein the test case and its corresponding interaction data both carry case tag information of the test case; Determining a target test case to be processed in the test case, and extracting a plurality of target interaction data corresponding to the target test case from the interaction data set based on target test case tag information carried by the target test case; According to the target interaction data, screening out verification rule data corresponding to the target interaction data from a preset verification rule set, and verifying a plurality of the target interaction data based on the verification rule data to obtain a verification result; Extracting, from the target test case, an expected test result for the target interaction data based on the target use case tag information; When the expected test result does not match the verification result, the expected test result is corrected to obtain and output a corrected test result.
2. The business data processing method according to claim 1, characterized in that: The step of filtering out verification rule data corresponding to the target interaction data from a preset verification rule set according to the target interaction data includes: Analyze the target interaction data to obtain the data interaction type of the target application tested by the test case; According to the data interaction type, the verification rule data corresponding to the target application is filtered out from the preset verification rule set.
3. The business data processing method according to claim 2, characterized in that: The analyzing the target interaction data to obtain the data interaction type of the target application tested by the test case includes: Extracting corresponding target attribute data from each target interaction data, and comparing target attribute data of different target interaction data to obtain a comparison result; Based on the comparison result, it is determined that the test case tests the data interaction type of the target application.
4. The business data processing method according to claim 1, characterized in that: The verifying of the target interaction data based on the verification rule data to obtain a verification result includes: Obtaining a preset verification tool corresponding to the target interaction data, and fusing the verification rule data with the preset verification tool to obtain a target verification tool; The target verification tool is used to verify the target interaction data to obtain verification results.
5. The business data processing method according to claim 4, characterized in that: The target verification tool verifies the target interaction data to obtain verification results, including: Pairing the target interaction data of the plurality of targets by using the target verification tool to obtain paired interaction data; Based on the verification rules included in the target verification tool, the pairing interaction data is verified to obtain a verification result.
6. The business data processing method according to claim 1, characterized in that: Before verifying the target interaction data based on the verification rule data and obtaining the verification result, the method further includes: Displaying a verification processing page for the target application, wherein the verification processing page includes a verification time designation control; In response to a designated operation on the check time designation control, determining a check time for the target interaction data; The verifying the multiple target interaction data based on the verification rule data to obtain the verification result includes: when the verification time arrives, verifying the multiple target interaction data based on the verification rule data to obtain the verification result.
7. The business data processing method according to claim 1, characterized in that: Before obtaining the interaction data set generated by the target application under at least one test case test, the method further includes: Based on the test case, sending a test request carrying the use case tag information to a target server of the target application, so that the target server generates candidate interaction data carrying the use case tag information based on the test request; The acquiring of the interaction data set generated by the target application under the test case test comprises: sending a data acquisition request carrying the data storage address of the target application to the target server, so that the target server queries and returns the interaction data of the target application carrying the use case tag information in the database corresponding to the data storage address; Receive the interaction data returned by the target server, and generate an interaction data set generated by the target application under the test case test based on the interaction data.
8. A business data processing device, characterized in that: include: an acquisition unit, configured to acquire an interaction data set generated by a target application under at least one test case test, wherein the interaction data set includes a plurality of interaction data corresponding to each of the test cases, and the test case and its corresponding interaction data both carry use case tag information of the test case; a determination unit, configured to determine a target test case to be processed in the test case, and extract a plurality of target interaction data corresponding to the target test case from the interaction data set based on target case tag information carried by the target test case; a screening unit, configured to screen out verification rule data corresponding to the target interaction data from a preset verification rule set according to the target interaction data, and verify the target interaction data based on the verification rule data to obtain a verification result; An extraction unit, configured to extract an expected test result for the target interaction data from the target test case based on the target use case tag information; The correction unit is used to correct the expected test result when the expected test result does not match the verification result, and obtain and output the corrected test result.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the business data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the business data processing method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product stores a computer program, and the computer program is suitable for being loaded by a processor to execute the business data processing method according to any one of claims 1 to 7.