Test method and device based on test scene, computer device and storage medium

By receiving geocoding and using a preset grid algorithm to generate latitude and longitude combinations, constructing test scenarios and comparing interface response data, the problem of low testing efficiency of the branch query function is solved, and efficient and accurate automated testing is achieved.

CN115269423BActive Publication Date: 2026-07-31CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA PING AN PROPERTY INSURANCE CO LTD
Filing Date
2022-08-03
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The existing testing scheme for the branch query function requires a lot of manpower and time, resulting in low testing efficiency and an inability to guarantee testing accuracy.

Method used

By receiving the geocode input by the user, the system uses a preset grid algorithm to reverse-engineer and generate a combination of latitude and longitude, constructs a test scenario, calls the interface to execute the test scenario, and compares the interface response data with the expected result data to generate the test result.

Benefits of technology

It enables batch generation of test data required for the branch office query function, ensuring the accuracy and randomness of the test data, saving testing manpower and time costs, improving testing efficiency and accuracy, and realizing automated functional testing of the branch office query function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269423B_ABST
    Figure CN115269423B_ABST
Patent Text Reader

Abstract

This application belongs to the field of data processing and relates to a testing method based on a test scenario. The method includes: receiving a test request input by a user; obtaining a geocode from the test request; performing reverse derivation processing on the geocode based on a preset grid algorithm to generate a corresponding latitude and longitude combination; constructing a test scenario corresponding to the latitude and longitude combination; calling an interface corresponding to the test scenario to execute the test scenario; obtaining interface response data generated after the interface call; obtaining expected result data corresponding to the interface; comparing the interface response data with the expected result data to obtain a comparison result; and generating a test result corresponding to the test scenario based on the comparison result. This application also provides a testing device, computer equipment, and storage medium based on a test scenario. Furthermore, this application relates to blockchain technology, and the test results can be stored in the blockchain. This application achieves automated functional testing of branch query, improving testing efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to testing methods, apparatus, computer equipment and storage media based on testing scenarios. Background Technology

[0002] Finding nearby service points using the user's current location latitude and longitude is a common solution for service point search. By using a grid algorithm to process the user's current location latitude and longitude, a list of nearby service points can be found and displayed, along with distance calculations and the time required to drive to the station for the user's reference.

[0003] Currently, in the existing testing solutions for the aforementioned service point query function, testers need to manually switch locations to simulate location changes to test the display of the service point list. The accuracy of grid algorithm testing requires a large amount of test data, but processing the latitude and longitude obtained by manually switching locations is labor-intensive and time-consuming, resulting in low testing efficiency and unreliable accuracy. Summary of the Invention

[0004] The purpose of this application is to propose a testing method, apparatus, computer equipment, and storage medium based on a testing scenario, in order to solve the technical problem that the existing testing schemes for the branch query function require a lot of manpower and time, resulting in low testing efficiency and the inability to guarantee testing accuracy.

[0005] To address the aforementioned technical problems, this application provides a testing method based on a testing scenario, employing the following technical solution:

[0006] Receive a test request input by the user; wherein the test request carries a geocode;

[0007] The geocode is obtained from the test request, and the geocode is reverse-derived based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations;

[0008] Construct a test scenario corresponding to the given latitude and longitude combination;

[0009] Call the interface corresponding to the test scenario to execute the test scenario;

[0010] Obtain the interface response data generated after the interface call, and obtain the expected result data corresponding to the interface;

[0011] The interface response data is compared with the expected result data according to the preset rules to obtain the comparison result, and a test result corresponding to the test scenario is generated based on the comparison result.

[0012] Furthermore, the step of constructing a test scenario corresponding to the latitude and longitude combination specifically includes:

[0013] Display a preset scene creation page corresponding to the latitude and longitude combination;

[0014] Receive the component selection instruction input by the user on the scene creation page;

[0015] Add a test function component corresponding to the component selection instruction;

[0016] The test function components are associated according to the order of the input component selection instructions to generate a test scenario corresponding to the latitude and longitude combination.

[0017] Furthermore, the step of comparing the interface response data with the expected result data according to preset rules to obtain a comparison result, and generating a test result corresponding to the test scenario based on the comparison result, specifically includes:

[0018] The first grid corresponding to the latitude and longitude combination is determined from the interface response data, and the second grid corresponding to the latitude and longitude combination is determined from the expected result data;

[0019] Determine whether the first grid and the second grid are the same grid;

[0020] If it is the same grid, obtain the number of first grid points and the information of the first grid points corresponding to the first number of first latitude and longitude within the grid from the interface response data, and obtain the number of second grid points and the information of the second grid points corresponding to the first latitude and longitude from the expected result data;

[0021] Determine whether the number of the first outlet is the same as the number of the second outlet, and whether the information of the first outlet is the same as the information of the second outlet;

[0022] If the number of the first network points is the same as the number of the second network points, and the information of the first network points is the same as the information of the second network points, then a first test result indicating that the test scenario has been successfully tested is generated; otherwise, a second test result indicating that the test scenario has failed is generated.

[0023] Furthermore, the test request also carries the user's user information. The step of obtaining the geocode from the test request and performing reverse derivation processing on the geocode based on a preset grid algorithm to generate the latitude and longitude combination corresponding to the geocode specifically includes:

[0024] Obtain the user information from the test request;

[0025] Obtain the user's facial information;

[0026] The user is authenticated based on the user information, the facial information, and a preset facial image database;

[0027] If the authentication is successful, the steps of obtaining the geocode from the test request and performing reverse derivation processing on the geocode based on the preset grid algorithm to generate the latitude and longitude combination corresponding to the geocode are executed.

[0028] Furthermore, the step of authenticating the user based on the user information, the facial information, and a preset facial image database specifically includes:

[0029] The face image database is invoked to determine whether the face image database stores the same specified user information as the user information;

[0030] If specified user information that is identical to the specified user information is stored, retrieve the specified face image corresponding to the specified user information from the face image database;

[0031] Calculate the first similarity between the first pupil color contained in the facial information and the second pupil color in the specified facial image;

[0032] Calculate the second similarity between the first interpupillary distance information contained in the face information and the second interpupillary distance information in the specified face image;

[0033] A comprehensive similarity score is generated based on the first similarity score and the second similarity score.

[0034] Determine whether the overall similarity is greater than a preset similarity threshold;

[0035] If the similarity is greater than the threshold, the identity verification is considered successful; otherwise, the identity verification is considered unsuccessful.

[0036] Furthermore, after the step of constructing the test scenario corresponding to the latitude and longitude combination, the method further includes:

[0037] Determine whether the user input debugging instructions for the test scenario have been received;

[0038] If so, the test scenario is debugged to obtain the processed test scenario;

[0039] Store the processed test scenario.

[0040] Furthermore, after the step of generating test results corresponding to the test scenario based on the comparison results, the method further includes:

[0041] Determine whether the test result indicates a test failure in the test scenario;

[0042] If so, generate a corresponding test report based on the test results;

[0043] Obtain the target user's communication address information;

[0044] The test report is sent to the communication address corresponding to the communication address information.

[0045] To address the aforementioned technical problems, this application also provides a testing device based on a testing scenario, employing the following technical solution:

[0046] A receiving module is used to receive test requests input by the user; wherein the test request carries a geocode;

[0047] The first generation module is used to obtain the geocode from the test request, and perform reverse derivation processing on the geocode based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations;

[0048] The construction module is used to construct the test scenario corresponding to the latitude and longitude combination;

[0049] The execution module is used to call the interface corresponding to the test scenario to execute the test scenario;

[0050] The first acquisition module is used to acquire the interface response data generated after the interface is called, and to acquire the expected result data corresponding to the interface.

[0051] The second generation module is used to compare the interface response data with the expected result data according to preset rules to obtain a comparison result, and generate a test result corresponding to the test scenario based on the comparison result.

[0052] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:

[0053] Receive a test request input by the user; wherein the test request carries a geocode;

[0054] The geocode is obtained from the test request, and the geocode is reverse-derived based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations;

[0055] Construct a test scenario corresponding to the given latitude and longitude combination;

[0056] Call the interface corresponding to the test scenario to execute the test scenario;

[0057] Obtain the interface response data generated after the interface call, and obtain the expected result data corresponding to the interface;

[0058] The interface response data is compared with the expected result data according to the preset rules to obtain the comparison result, and a test result corresponding to the test scenario is generated based on the comparison result.

[0059] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:

[0060] Receive a test request input by the user; wherein the test request carries a geocode;

[0061] The geocode is obtained from the test request, and the geocode is reverse-derived based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations;

[0062] Construct a test scenario corresponding to the given latitude and longitude combination;

[0063] Call the interface corresponding to the test scenario to execute the test scenario;

[0064] Obtain the interface response data generated after the interface call, and obtain the expected result data corresponding to the interface;

[0065] The interface response data is compared with the expected result data according to the preset rules to obtain the comparison result, and a test result corresponding to the test scenario is generated based on the comparison result.

[0066] Compared with the prior art, the embodiments of this application have the following main advantages:

[0067] This application embodiment, upon receiving a user-input test request, first obtains the geocode from the request and performs reverse derivation processing on the geocode based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode. Then, it constructs a test scenario corresponding to the latitude and longitude combination. Next, it calls the interface corresponding to the test scenario to execute the test scenario, subsequently obtaining the interface response data generated after the interface call, as well as the expected result data corresponding to the interface. Finally, it compares the interface response data with the expected result data according to preset rules to obtain the comparison result, and generates the test result corresponding to the test scenario based on the comparison result. This application uses a preset grid algorithm to perform reverse derivation processing on the geocode to generate a latitude and longitude combination corresponding to the geocode, thereby achieving batch generation of a large amount of test data required for the branch query function test. This ensures the accuracy and randomness of the test data, greatly saving testing manpower and time costs. It allows subsequent construction of test scenarios based on the obtained latitude and longitude combinations, and then calls relevant interfaces to execute the test scenario to quickly and accurately generate the corresponding test results, thus completing the automated functional testing of the branch query function, improving testing efficiency and accuracy, and enhancing the processing experience for testers during the testing process. Attached Figure Description

[0068] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0069] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;

[0070] Figure 2 A flowchart of an embodiment of the test scenario-based testing method according to this application;

[0071] Figure 3 This is a schematic diagram of the structure of an embodiment of the test scenario-based test apparatus according to this application;

[0072] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation

[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0074] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0075] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0076] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0077] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0078] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.

[0079] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.

[0080] It should be noted that the test scenario-based testing method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the test scenario-based testing device is generally set in the server / terminal device.

[0081] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0082] Continue to refer to Figure 2 The diagram illustrates a flowchart of an embodiment of a test scenario-based testing method according to this application. The test scenario-based testing method includes the following steps:

[0083] Step S201: Receive a test request input by the user; wherein the test request carries a geocode.

[0084] In this embodiment, the test method based on the test scenario runs on the electronic device (e.g., Figure 1 (The server / terminal device shown). It should be noted that the above wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other currently known or future wireless connection methods.

[0085] In this embodiment, the aforementioned test request is a user-triggered request to generate test data based on the input geocode and to perform functional tests related to branch location queries based on the test data. The geocode is coded data used for the test process, and can be data based on the user's test operation input. Specifically, the geocode can be GeoCode.

[0086] Step S202: Obtain the geocode from the test request, and perform reverse derivation processing on the geocode based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations.

[0087] In this embodiment, the aforementioned preset grid algorithm is specifically the Geo grid algorithm, or GeoHash algorithm. GeoHash is a fixed algorithm used to convert latitude and longitude information into a string of characters in the Base32 code table. Specifically, the GeoHash algorithm processing logic is as follows: (1) Calculate the target latitude and longitude according to the longitude range [-180°, 180°] and the latitude range [-90°, 90°]; divide the longitude and latitude ranges into two, and determine the longitude and latitude respectively. If it is in the right set, it is 1, and if it is in the left set, it is 0; repeat this calculation. (2) Concatenate the obtained latitude and longitude results of 1 and 0, with the longitude in even positions (calculated from position 0) and the latitude in odd positions. The 5-bit binary results are grouped together, converted into decimal numbers, and then converted into the corresponding numbers in the Base32 code table to obtain the corresponding GeoHash value. For example, if the geocode entered by the user is ws10hzcw, after using the GeoHash algorithm to reverse-derive the geocode ws10hzcw, the corresponding latitude and longitude combination [(114.117363,22.543658)(114.117365,22.543653)] can be generated.

[0088] The latitude and longitude combinations derived by using the GeoHash algorithm to inversely derive geocodes can accurately cover values ​​within, outside, and at the edges of the grid, preventing significant deviations between the input latitude and longitude and the user's expectations. This embodiment uses a preset grid algorithm to inversely derive geocodes, generating latitude and longitude combinations corresponding to the geocodes. This enables the batch generation of large amounts of test data required for the network point query function test, ensuring the accuracy and randomness of the test data. This significantly saves testing manpower and time costs, and testers can perform automated testing and regression analysis with a single click using electronic devices, improving the tester's experience.

[0089] Step S203: Construct a test scenario corresponding to the latitude and longitude combination.

[0090] In this embodiment, after obtaining the latitude and longitude combination, test scenarios within the latitude and longitude combination and test scenarios outside the latitude and longitude combination can be generated based on the latitude and longitude combination, thereby obtaining multiple test scenarios.

[0091] Step S204: Call the interface corresponding to the test scenario to execute the test scenario.

[0092] In this embodiment, for each test scenario, a corresponding interface is pre-set for users to perform the test workflow for that test scenario.

[0093] Step S205: Obtain the interface response data generated after the interface call, and obtain the expected result data corresponding to the interface.

[0094] In this embodiment, expected result data is pre-set for each interface in each test scenario. If the test result output by the interface after executing the test scenario is inconsistent with the expected result data of the interface, the interface can be determined as an abnormal interface so that the abnormal interface can be located and maintained in the future.

[0095] Step S206: Compare the interface response data with the expected result data according to preset rules to obtain a comparison result, and generate a test result corresponding to the test scenario based on the comparison result.

[0096] In this embodiment, the specific implementation process of comparing the interface response data with the expected result data according to preset rules to obtain the comparison result, and generating the test result corresponding to the test scenario based on the comparison result, will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.

[0097] This application, upon receiving a user-input test request, first obtains the geocode from the request and then performs reverse processing on the geocode using a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode. Next, it constructs a test scenario corresponding to the latitude and longitude combination, and then calls the corresponding interface to execute the test scenario, subsequently obtaining the interface response data generated after the interface call, as well as the expected result data corresponding to the interface. Finally, it compares the interface response data with the expected result data according to preset rules to obtain the comparison result, and generates the test result corresponding to the test scenario based on the comparison result. This application uses a preset grid algorithm to perform reverse processing on the geocode to generate a latitude and longitude combination corresponding to the geocode, thereby achieving batch generation of a large amount of test data required for the branch query function test. This ensures the accuracy and randomness of the test data, greatly saving testing manpower and time costs. It allows subsequent construction of test scenarios based on the obtained latitude and longitude combinations, and then calls relevant interfaces to execute the test scenario to quickly and accurately generate the corresponding test results, thus completing the automated functional testing of the branch query function, improving testing efficiency and accuracy, and enhancing the processing experience for testers.

[0098] In some alternative implementations, step S203 includes the following steps:

[0099] Display a preset scene creation page corresponding to the given latitude and longitude combination.

[0100] In this embodiment, a corresponding scene creation page will be set up for different combinations of latitude and longitude.

[0101] Receive the component selection instruction entered by the user on the scene creation page.

[0102] In this embodiment, the scene creation page includes a functional component area. Users can input component selection commands in this area to obtain test functional components. When multiple component selection commands are input to obtain multiple test functional components, these components can be constructed into a test scene in a specific order. A test scene can be understood as a scenario where a process is controlled by event triggering.

[0103] Add a test function component that corresponds to the component selection instruction.

[0104] In this embodiment, the aforementioned test function component includes at least one interface component, which simulates the input interface of a business function in the test scenario. Upon receiving a component selection instruction, the test function component corresponding to the instruction can be added to the scene design area within the scene creation page. Furthermore, the triggering method for the component selection instruction is not limited; it can be a single-click or double-click mouse operation, or a drag-and-drop operation of the selected component, etc.

[0105] The test function components are associated according to the order of the input component selection instructions to generate a test scenario corresponding to the latitude and longitude combination.

[0106] Upon receiving a component selection instruction from a user on a preset scene creation page corresponding to a latitude and longitude combination, this application quickly generates corresponding test scenarios based on the order of the business function components specified in the instruction. This facilitates subsequent testing based on these scenarios, improving testing efficiency and optimizing the user experience during testing. Furthermore, this application generates corresponding latitude and longitude combinations by using a preset grid algorithm to reverse-engineer geocoding. This enables the batch generation of large amounts of test data required for the network point query function, ensuring the accuracy and randomness of the test data. This significantly reduces testing manpower and time costs, allowing testers to perform automated testing and regression analysis with a single click using electronic devices.

[0107] In some optional implementations of this embodiment, step S206 includes the following steps:

[0108] The first grid corresponding to the latitude and longitude combination is determined from the interface response data, and the second grid corresponding to the latitude and longitude combination is determined from the expected result data.

[0109] In this embodiment, a combination of latitude and longitude corresponds to only one grid.

[0110] Determine whether the first grid and the second grid are the same grid.

[0111] If it is the same grid, obtain the number of first grid points and the information of the first grid points corresponding to the first number of first latitude and longitude within the grid from the interface response data, and obtain the number of second grid points and the information of the second grid points corresponding to the first latitude and longitude from the expected result data.

[0112] In this embodiment, the value of the preset quantity is not limited and can be determined according to actual business needs. Preferably, the preset quantity is 5, and the first latitude and longitude includes the latitude and longitude of the upper left endpoint, the upper right endpoint, the lower left endpoint, the lower right endpoint, and the center point within the grid. The network point information can refer to the network point name. For example, if the network point refers to a gas station, then the network point information refers to the name of the gas station.

[0113] Determine whether the number of the first outlet is the same as the number of the second outlet, and whether the information of the first outlet is the same as the information of the second outlet.

[0114] If the number of the first network points is the same as the number of the second network points, and the information of the first network points is the same as the information of the second network points, then a first test result indicating that the test scenario has been successfully tested is generated; otherwise, a second test result indicating that the test scenario has failed is generated.

[0115] This application obtains a comparison result by comparing the interface response data with the expected result data, and then can quickly and accurately generate test results corresponding to the test scenario based on the obtained comparison result. In addition, by selecting only a preset number of latitude and longitude coordinates from the latitude and longitude combinations, and comparing the corresponding data in the expected result data based on the number and information of the network points corresponding to those latitude and longitude coordinates, the comparison result is generated. This eliminates the need to obtain all latitude and longitude coordinates in the latitude and longitude combinations for comparison processing, effectively reducing the amount of data processing during the testing process and improving the testing efficiency and intelligence.

[0116] In some optional implementations, the test request also carries the user's user information, and step S202 includes the following steps:

[0117] Obtain the user information from the test request.

[0118] In this embodiment, the user information may include the user's name information or the user's ID information.

[0119] Obtain the user's facial information.

[0120] In this embodiment, the aforementioned facial information may be facial information within a user's facial image captured by a camera on an electronic device.

[0121] The user is authenticated based on the user information, the facial information, and a preset facial image database.

[0122] In this embodiment, the specific implementation process of authenticating the user based on the user information, the facial information, and the preset facial image database will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.

[0123] If the authentication is successful, the steps of obtaining the geocode from the test request and performing reverse derivation processing on the geocode based on the preset grid algorithm to generate the latitude and longitude combination corresponding to the geocode are executed.

[0124] Upon receiving a test request from a user, this application first authenticates the user. Only after successful authentication will the application respond to the test request and retrieve the geocode from the test request to execute subsequent test processing procedures. This effectively avoids adverse consequences caused by responding to test requests from unauthorized users, effectively ensuring the security and standardization of the test request processing process and improving the intelligence of test request processing.

[0125] In some optional implementations, the above-mentioned user authentication based on the user information, the facial information, and a preset facial image database includes the following steps:

[0126] The face image database is invoked to determine whether the face image database stores the same specified user information as the user information.

[0127] In this embodiment, the aforementioned face image database is a pre-created database that records user information of each legitimate user and their corresponding face images.

[0128] If specified user information that is identical to the specified user information is stored, retrieve the specified face image corresponding to the specified user information from the face image database.

[0129] Calculate the first similarity between the first pupil color contained in the face information and the second pupil color in the specified face image.

[0130] Calculate the second similarity between the first interpupillary distance information contained in the face information and the second interpupillary distance information in the specified face image.

[0131] In this embodiment, the calculation method for the first similarity and the second similarity is not specifically limited, and can be set according to actual usage requirements, such as using cosine similarity, Euclidean distance, Manhattan distance, etc.

[0132] A comprehensive similarity score is generated based on the first similarity score and the second similarity score.

[0133] In this embodiment, a first weight corresponding to the first similarity and a second weight corresponding to the second similarity can be preset. Then, the first similarity and the second similarity are weighted and summed based on the first weight and the second weight to generate the above-mentioned comprehensive similarity. The values ​​of the first weight and the second weight are not specifically limited and can be set according to actual usage requirements. Preferably, the sum of the first weight and the second weight is equal to 1.

[0134] Determine whether the overall similarity is greater than a preset similarity threshold.

[0135] In this embodiment, the specific value of the similarity threshold is not limited and can be set according to actual usage requirements.

[0136] If the similarity is greater than the threshold, the identity verification is considered successful; otherwise, the identity verification is considered unsuccessful.

[0137] This application employs a multi-factor authentication method, which combines user information matching, pupil color information comparison in facial images, and interpupillary distance information comparison, to achieve accurate user authentication. This improves the reliability and accuracy of authentication, effectively preventing adverse consequences caused by responding to test requests from unauthorized users, and effectively ensuring the security and standardization of the test request processing process.

[0138] In some optional implementations of this embodiment, after step S203, the electronic device may further perform the following steps:

[0139] Determine whether the user input debugging instructions for the test scenario have been received.

[0140] In this embodiment, after the test scenario is created, it needs to be debugged so that it can be used by other users simultaneously and provide real-time prompts for other users regarding interface operations on the test scenario. The aforementioned debugging command is a user-triggered command used to debug the generated test scenario.

[0141] If so, the test scenario is debugged to obtain the processed test scenario.

[0142] In this embodiment, the debugging parameters input by the user can be obtained first, and then the test scenario can be debugged based on the debugging input by the user to obtain the processed test scenario.

[0143] Store the processed test scenario.

[0144] In this embodiment, users can save the constructed test scenario to the database in the form of multi-layered JSON strings by clicking the save button, where each layer of JSON string corresponds to a test function component.

[0145] After constructing and generating a test scenario corresponding to the latitude and longitude combination, this application can also debug the test scenario based on the debugging command triggered by the user, so as to regenerate the required test scenario that can be used normally, thereby improving the user experience.

[0146] In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:

[0147] Determine whether the test result indicates a test failure in the test scenario.

[0148] In this embodiment, the test result includes whether the test scenario was successful or failed.

[0149] If so, generate a corresponding test report based on the test results.

[0150] In this embodiment, the test results can be filled into a preset report template to generate the aforementioned test report. The aforementioned report template is pre-created based on actual business needs.

[0151] Obtain the target user's communication address information.

[0152] In this embodiment, the target user can be a developer involved in the testing process. The communication address information may include phone numbers, email addresses, etc.

[0153] The test report is sent to the communication address corresponding to the communication address information.

[0154] If a test fails after testing the test scenario using the interface, this application will generate a corresponding test report based on the test results and send the test report to the relevant developers. This allows the developers to make timely adjustments to the test work based on the received test report, which improves the testers' experience during the testing process.

[0155] It should be emphasized that, to further ensure the privacy and security of the above test results, the test results can also be stored in a blockchain node.

[0156] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0157] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0158] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0159] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0160] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0161] Further reference Figure 3 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of a test device based on a test scenario, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0162] like Figure 3 As shown, the test scenario-based testing device 300 described in this embodiment includes: a receiving module 301, a first generation module 302, a construction module 303, an execution module 304, a first acquisition module 305, and a second generation module 306. Wherein:

[0163] The receiving module 301 is used to receive a test request input by a user; wherein the test request carries a geocode;

[0164] The first generation module 302 is used to obtain the geocode from the test request, and perform reverse derivation processing on the geocode based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations;

[0165] Construction module 303 is used to construct a test scenario corresponding to the latitude and longitude combination;

[0166] Execution module 304 is used to call the interface corresponding to the test scenario to execute the test scenario;

[0167] The first acquisition module 305 is used to acquire the interface response data generated after the interface is called, and to acquire the expected result data corresponding to the interface.

[0168] The second generation module 306 is used to compare the interface response data with the expected result data according to a preset rule to obtain a comparison result, and generate a test result corresponding to the test scenario based on the comparison result.

[0169] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0170] In some optional implementations of this embodiment, the construction module 303 includes:

[0171] The display submodule is used to display a preset scene creation page corresponding to the latitude and longitude combination;

[0172] The receiving submodule is used to receive the component selection instructions entered by the user on the scene creation page;

[0173] Add a submodule to add test function components corresponding to the component selection instructions;

[0174] A generation submodule is used to establish associations between the test function components according to the order of the input component selection instructions, and generate a test scenario corresponding to the latitude and longitude combination.

[0175] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0176] In some optional implementations of this embodiment, the second generation module 306 includes:

[0177] A determination submodule is used to determine the first grid corresponding to the latitude and longitude combination from the interface response data, and to determine the second grid corresponding to the latitude and longitude combination from the expected result data;

[0178] The first judgment submodule is used to determine whether the first grid and the second grid are the same grid;

[0179] The first acquisition submodule is used to, if it is the same grid, acquire the number of first grid points and the information of first grid points corresponding to a preset number of first latitude and longitude within the grid from the interface response data, and acquire the number of second grid points and the information of second grid points corresponding to the first latitude and longitude from the expected result data;

[0180] The second judgment submodule is used to determine whether the number of the first network outlets is the same as the number of the second network outlets, and whether the information of the first network outlets is the same as the information of the second network outlets;

[0181] The second generation submodule is used to generate a first test result indicating that the test scenario test was successful if the number of the first network points is the same as the number of the second network points and the information of the first network points is the same as the information of the second network points; otherwise, it generates a second test result indicating that the test scenario test failed.

[0182] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0183] In some optional implementations of this embodiment, the test request also carries the user's user information, and the first generation module 302 includes:

[0184] The second acquisition submodule is used to acquire the user information from the test request;

[0185] The third acquisition submodule is used to acquire the user's facial information;

[0186] The verification submodule is used to authenticate the user based on the user information, the facial information, and a preset facial image database;

[0187] The execution submodule is used to, if the authentication is successful, perform the steps of obtaining the geocode from the test request, and performing reverse derivation processing on the geocode based on a preset grid algorithm to generate the latitude and longitude combination corresponding to the geocode.

[0188] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0189] In some optional implementations of this embodiment, the verification submodule includes:

[0190] The first judgment unit is used to call the face image database to determine whether the face image database stores the same specified user information as the user information;

[0191] The acquisition unit is used to acquire a specified face image corresponding to the specified user information from the face image database if specified user information identical to the specified user information is stored.

[0192] The first calculation unit is used to calculate the first similarity between the first pupil color contained in the face information and the second pupil color in the specified face image;

[0193] The second calculation unit is used to calculate the second similarity between the first pupil distance information contained in the face information and the second pupil distance information in the specified face image;

[0194] A generation unit is used to generate a comprehensive similarity based on the first similarity and the second similarity;

[0195] The second judgment unit is used to determine whether the overall similarity is greater than a preset similarity threshold;

[0196] The determination unit is used to determine that the identity verification is successful if the similarity is greater than the similarity threshold, and otherwise determine that the identity verification is unsuccessful.

[0197] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0198] In some optional implementations of this embodiment, the test device based on the test scenario further includes:

[0199] The first judgment module is used to determine whether the user inputs a debugging instruction for the test scenario;

[0200] The debugging module is used to debug the test scenario if necessary, to obtain the processed test scenario.

[0201] The storage module is used to store the processed test scenario.

[0202] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0203] In some optional implementations of this embodiment, the test device based on the test scenario further includes:

[0204] The second judgment module is used to determine whether the test result indicates a test failure in the test scenario.

[0205] The third generation module is used to generate a corresponding test report based on the test results if the test results are true.

[0206] The second acquisition module is used to acquire the target user's communication address information;

[0207] The sending module is used to send the test report to the communication address corresponding to the communication address information.

[0208] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the test scenario-based test method in the aforementioned implementation method, and will not be repeated here.

[0209] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0210] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0211] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0212] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may also include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for test methods based on test scenarios. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.

[0213] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions of the test method based on the test scenario.

[0214] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.

[0215] Compared with the prior art, the embodiments of this application have the following main advantages:

[0216] In this embodiment, after receiving a user-inputted test request, the geocode is first obtained from the request. Then, a pre-defined grid algorithm is used to reverse-engineer the geocode, generating a latitude and longitude combination corresponding to it. Next, a test scenario corresponding to the latitude and longitude combination is constructed. Then, the interface corresponding to the test scenario is called to execute the test scenario, subsequently obtaining the interface response data generated after the interface call, as well as the expected result data corresponding to the interface. Finally, the interface response data and the expected result data are compared according to pre-defined rules to obtain the comparison result, and test results corresponding to the test scenario are generated based on the comparison result. This application uses a pre-defined grid algorithm to reverse-engineer the geocode, generating a latitude and longitude combination corresponding to it. This enables the batch generation of a large amount of test data required for the branch query function test, ensuring the accuracy and randomness of the test data, greatly saving test manpower and time costs. It allows subsequent construction of test scenarios based on the obtained latitude and longitude combinations, followed by calling relevant interfaces to execute the test scenario to quickly and accurately generate the corresponding test results. This completes the automated functional testing of the branch query function, improving testing efficiency and accuracy, and enhancing the testing experience for testers.

[0217] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the test scenario-based test method described above.

[0218] Compared with the prior art, the embodiments of this application have the following main advantages:

[0219] In this embodiment, after receiving a user-inputted test request, the geocode is first obtained from the request. Then, a pre-defined grid algorithm is used to reverse-engineer the geocode, generating a latitude and longitude combination corresponding to it. Next, a test scenario corresponding to the latitude and longitude combination is constructed. Then, the interface corresponding to the test scenario is called to execute the test scenario, subsequently obtaining the interface response data generated after the interface call, as well as the expected result data corresponding to the interface. Finally, the interface response data and the expected result data are compared according to pre-defined rules to obtain the comparison result, and test results corresponding to the test scenario are generated based on the comparison result. This application uses a pre-defined grid algorithm to reverse-engineer the geocode, generating a latitude and longitude combination corresponding to it. This enables the batch generation of a large amount of test data required for the branch query function test, ensuring the accuracy and randomness of the test data, greatly saving test manpower and time costs. It allows subsequent construction of test scenarios based on the obtained latitude and longitude combinations, followed by calling relevant interfaces to execute the test scenario to quickly and accurately generate the corresponding test results. This completes the automated functional testing of the branch query function, improving testing efficiency and accuracy, and enhancing the testing experience for testers.

[0220] 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.

[0221] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A test method based on a test scenario, characterized by, Includes the following steps: Receive a test request input by the user; wherein the test request carries a geocode; The geocode is obtained from the test request, and the geocode is reverse-derived based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations; Construct a test scenario corresponding to the given latitude and longitude combination; Call the interface corresponding to the test scenario to execute the test scenario; Obtain the interface response data generated after the interface call, and obtain the expected result data corresponding to the interface; The interface response data is compared with the expected result data according to the preset rules to obtain the comparison result, and a test result corresponding to the test scenario is generated based on the comparison result. The step of constructing a test scenario corresponding to the latitude and longitude combination specifically includes: Display a preset scene creation page corresponding to the latitude and longitude combination; Receive the component selection instruction input by the user on the scene creation page; Add a test function component corresponding to the component selection instruction; The test function components are associated according to the order of the input component selection instructions to generate a test scenario corresponding to the latitude and longitude combination; The step of comparing the interface response data with the expected result data according to a preset rule to obtain a comparison result, and generating a test result corresponding to the test scenario based on the comparison result, specifically includes: The first grid corresponding to the latitude and longitude combination is determined from the interface response data, and the second grid corresponding to the latitude and longitude combination is determined from the expected result data; Determine whether the first grid and the second grid are the same grid; If it is the same grid, obtain the number of first grid points and the information of the first grid points corresponding to the first number of first latitude and longitude within the grid from the interface response data, and obtain the number of second grid points and the information of the second grid points corresponding to the first latitude and longitude from the expected result data; Determine whether the number of the first outlet is the same as the number of the second outlet, and whether the information of the first outlet is the same as the information of the second outlet; If the number of the first network points is the same as the number of the second network points, and the information of the first network points is the same as the information of the second network points, then a first test result indicating that the test scenario has been successfully tested is generated; otherwise, a second test result indicating that the test scenario has failed is generated.

2. The test method based on test scenario according to claim 1, characterized in that, The test request also carries the user's user information. The step of obtaining the geocode from the test request and performing reverse derivation processing on the geocode based on a preset grid algorithm to generate the latitude and longitude combination corresponding to the geocode specifically includes: Obtain the user information from the test request; Obtain the user's facial information; The user is authenticated based on the user information, the facial information, and a preset facial image database; If the authentication is successful, the steps of obtaining the geocode from the test request and performing reverse derivation processing on the geocode based on the preset grid algorithm to generate the latitude and longitude combination corresponding to the geocode are executed.

3. The test method based on test scenario according to claim 2, characterized in that, The step of authenticating the user based on the user information, the facial information, and a preset facial image database specifically includes: The face image database is invoked to determine whether the face image database stores the same specified user information as the user information; If specified user information that is identical to the specified user information is stored, retrieve the specified face image corresponding to the specified user information from the face image database; Calculate the first similarity between the first pupil color contained in the facial information and the second pupil color in the specified facial image; Calculate the second similarity between the first interpupillary distance information contained in the face information and the second interpupillary distance information in the specified face image; A comprehensive similarity score is generated based on the first similarity score and the second similarity score. Determine whether the overall similarity is greater than a preset similarity threshold; If the similarity is greater than the threshold, the identity verification is considered successful; otherwise, the identity verification is considered unsuccessful.

4. The test method based on test scenario according to claim 1, characterized in that, Following the step of constructing a test scenario corresponding to the latitude and longitude combination, the method further includes: Determine whether the user input debugging instructions for the test scenario have been received; If so, the test scenario is debugged to obtain the processed test scenario; Store the processed test scenario.

5. The test scenario based testing method of claim 1, wherein, After the step of generating test results corresponding to the test scenario based on the comparison results, the method further includes: Determine whether the test result indicates a test failure in the test scenario; If so, generate a corresponding test report based on the test results; Obtain the target user's communication address information; The test report is sent to the communication address corresponding to the communication address information.

6. A test apparatus based on a test scenario, characterized by, include: A receiving module is used to receive test requests input by the user; wherein the test request carries a geocode; The first generation module is used to obtain the geocode from the test request, and perform reverse derivation processing on the geocode based on a preset grid algorithm to generate a latitude and longitude combination corresponding to the geocode; wherein, the number of latitude and longitude combinations includes multiple combinations; The construction module is used to construct the test scenario corresponding to the latitude and longitude combination; The execution module is used to call the interface corresponding to the test scenario to execute the test scenario; The first acquisition module is used to acquire the interface response data generated after the interface is called, and to acquire the expected result data corresponding to the interface. The second generation module is used to compare the interface response data with the expected result data according to preset rules to obtain a comparison result, and generate a test result corresponding to the test scenario based on the comparison result; The building modules include: The display submodule is used to display a preset scene creation page corresponding to the latitude and longitude combination; The receiving submodule is used to receive the component selection instructions entered by the user on the scene creation page; Add a submodule to add test function components corresponding to the component selection instructions; A generation submodule is used to establish associations between the test function components according to the order of the input component selection instructions, and generate a test scenario corresponding to the latitude and longitude combination; The second generation module includes: A determination submodule is used to determine the first grid corresponding to the latitude and longitude combination from the interface response data, and to determine the second grid corresponding to the latitude and longitude combination from the expected result data; The first judgment submodule is used to determine whether the first grid and the second grid are the same grid; The first acquisition submodule is used to, if it is the same grid, acquire the number of first grid points and the information of first grid points corresponding to a preset number of first latitude and longitude within the grid from the interface response data, and acquire the number of second grid points and the information of second grid points corresponding to the first latitude and longitude from the expected result data; The second judgment submodule is used to determine whether the number of the first network outlets is the same as the number of the second network outlets, and whether the information of the first network outlets is the same as the information of the second network outlets; The second generation submodule is used to generate a first test result indicating that the test scenario test was successful if the number of the first network points is the same as the number of the second network points and the information of the first network points is the same as the information of the second network points; otherwise, it generates a second test result indicating that the test scenario test failed.

7. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor, when executing the computer-readable instructions, implements the steps of the test scenario-based test method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the test scenario-based test method as described in any one of claims 1 to 5.