Test method and electronic equipment
By generating test cases based on user portrait rules, and using the judgment expression to screen out the use case that only specifies the sub -strategy, combined with virtual test users and automatic verification, solve the problem of low test efficiency in existing technologies, achieve efficient efficiency Recommended strategy test.
Patent Information
- Application Number
- CN202411372638.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, the recommended strategy contains a large number of sub-strategies, resulting in a large number of arrangements and combinations of user portraits, and the workload of manual writing of test cases and debugging automated test templates is large, and the testing efficiency is low.
By obtaining scenario strategy information, based on user portrait rules to generate test cases, and based on the judgment expression of each sub -strategy, the life determination is performed to obtain a list of test cases with the corresponding sub -strategy. Based on this list to generate virtual test users, write user information to the recommendation strategy platform, access the platform to obtain the recommendation results, and check the results.
It realizes that no manual maintenance of test cases is required, and test cases can be automatically generated based on sub-strategies in recommended scenarios, reducing the probability of interference from other sub-strategies in recommended results, improving test efficiency, and automatically verifying recommended results.
Smart Images

Figure CN119357047A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of software testing, and in particular to a testing method and electronic equipment. Background Art
[0002] The recommendation strategy platform is used to analyze user data, identify user preferences, behavior patterns, and needs, and recommend highly personalized products and services to users based on the formulated recommendation strategy. Product operators can configure recommendation strategies for different user profiles on the recommendation strategy platform based on business requirements. Before the recommendation strategy platform is officially launched, the correctness of the platform's function of executing the recommendation strategy needs to be tested to verify whether the recommendation results generated by the recommendation strategy meet the expected goals.
[0003] At present, the test cases are usually written manually and input into the automated test template for testing. Specifically, the tester inputs the recommended strategy and the recommended interface response package into the automated test template, and writes the test cases according to the user portrait information configured by the recommended strategy, and uses these test cases to debug the automated test template one by one, and compares the obtained recommendation results with the recommended interface response package to determine whether the recommendation results meet the expected goals.
[0004] In the process of implementing this application, the inventors found that there are at least the following problems in the prior art: the more sub-strategies the recommendation strategy contains, the more permutations and combinations of user portraits there are, the greater the workload of manually writing test cases, debugging automated test templates, and determining whether the recommendation results meet the expected goals, and the testing efficiency is low. Summary of the invention
[0005] The embodiments of the present application provide a testing method and an electronic device to improve the testing efficiency of testing a recommendation strategy using test cases.
[0006] The embodiments of the present application provide the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a testing method, which is applied to a recommendation strategy platform, and the testing method includes:
[0008] Acquire scenario strategy information, wherein the scenario strategy information includes at least one sub-strategy under the recommendation scenario, and the sub-strategy includes user portrait rule data;
[0009] Generate test cases based on user profile rule data, where each test case corresponds to at least one sub-strategy;
[0010] Based on the judgment expression corresponding to each sub-strategy, hit judgment is performed on each test case in turn to obtain a test case list, wherein the hit judgment is used to determine whether the test case hits the corresponding sub-strategy, and the test case list includes only the test cases that hit the corresponding sub-strategy;
[0011] Generate a virtual test user based on the test case list, and write the user information corresponding to the virtual test user into the recommendation strategy platform;
[0012] Access the recommendation strategy platform to obtain recommendation results;
[0013] Verify the recommendation results to determine whether the recommended strategy platform executes the corresponding test cases normally.
[0014] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0015] at least one processor, and
[0016] a memory communicatively coupled to at least one processor, wherein:
[0017] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the testing method of the first aspect.
[0018] In a third aspect, an embodiment of the present application further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable an electronic device to execute the test method of the first aspect.
[0019] The beneficial effect of the implementation mode of the present application is: different from the prior art, the implementation mode of the present application provides a testing method, which is applied to a recommendation strategy platform, and the testing method includes: obtaining scenario strategy information, wherein the scenario strategy information includes at least one sub-strategy under the recommendation scenario, and the sub-strategy includes user portrait rule data; generating test cases based on the user portrait rule data, wherein each test case corresponds to at least one sub-strategy; based on the judgment expression corresponding to each sub-strategy, performing a hit judgment on each test case in turn to obtain a test case list, wherein the hit judgment is used to determine whether the test case hits the corresponding sub-strategy, and the test case list includes test cases that only hit the corresponding sub-strategy; generating a virtual test user based on the test case list, and writing the user information corresponding to the virtual test user into the recommendation strategy platform; accessing the recommendation strategy platform to obtain the recommendation result; verifying the recommendation result to determine whether the recommendation strategy platform executes the corresponding test case normally.
[0020] On the one hand, by generating test cases based on user portrait rule data, and based on the judgment expression corresponding to each sub-strategy, hit judgment is performed on each test case in turn to obtain a test case list. The present application can generate test cases based on the sub-strategies in the recommendation scenario without the need for manual maintenance of test cases, and can obtain test cases that only hit the corresponding sub-strategies through hit judgment, thereby reducing the probability of interference information from other sub-strategies appearing in the recommendation results and improving test efficiency;
[0021] On the other hand, by generating virtual test users based on the test case list, writing the user information corresponding to the virtual test users into the recommendation strategy platform, accessing the recommendation strategy platform to obtain the recommendation results, and verifying the recommendation results, the present application can perform batch intervention on the user portraits stored in the recommendation strategy platform to improve execution efficiency, and can automatically verify the recommendation results to determine whether the test cases are executed normally, thereby improving testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.
[0023] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
[0024] Figure 2 It is a flow chart of a testing method provided in an embodiment of the present application;
[0025] Figure 3 It is a detailed flow chart of generating a test case that hits only a single sub-strategy provided in an embodiment of the present application;
[0026] Figure 4 It is a flowchart of generating a test case that hits at least two sub-strategies at the same time, provided by an embodiment of the present application;
[0027] Figure 5 It is a detailed flow chart of generating a determination expression corresponding to a sub-strategy provided in an embodiment of the present application;
[0028] Figure 6 yes Figure 2 A detailed flow chart of step S203 in FIG.
[0029] Figure 7 yes Figure 2 A detailed flow chart of step S206 in FIG.
[0030] Figure 8 yes Figure 7A detailed flow chart of step S264 in FIG.
[0031] Fig. 9 is a structural schematic diagram of a testing device provided in an embodiment of the present application;
[0032] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0033] Description of Figure Numbers:
[0034] Label name Label name 100 Application Environment 10 Electronic devices 20 Recommended Strategy Platform 900 Test equipment 901 Initialization module 902 Use Case Generation Module 903 Execution Module 904 Verification module 101 processor 102 Memory DETAILED DESCRIPTION
[0035] In order to facilitate the understanding of the present application, the present application is described in more detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that when an element is described as "fixed to" another element, it can be directly on the other element, or there can be one or more centered elements therebetween. When an element is described as "connected to" another element, it can be directly connected to the other element, or there can be one or more centered elements therebetween. The terms "vertical", "horizontal", "left", "right" and similar expressions used in this specification are for illustrative purposes only.
[0036] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0037] Before explaining the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:
[0038] (1) Recommendation strategy platform, which is used to analyze user data, identify user preferences, behavior patterns, and needs, and recommend highly personalized products and services to users based on the formulated recommendation strategy. The recommendation strategy platform provides product operators with the ability to publish configurable recommendation strategies. Product operators can configure recommendation strategies for different user profiles on the recommendation strategy platform based on business requirements, set expected recall strategies and ranking strategies, and set matching backoff rules for different recommendation scenarios.
[0039] (2) Recommendation scenarios are specific situations in which the recommendation strategy platform provides personalized recommendations to users based on factors such as user behavior, preferences, and needs, such as product recommendations on e-commerce websites, content recommendations on news apps, or friend recommendations on social media. Product operators can create recommendation scenarios on the recommendation strategy platform and configure a series of recommendation strategies under the recommendation scenarios.
[0040] (3) Workflow is the execution process of the recommendation strategy, including identifying user profiles, executing recall strategies, executing ranking strategies, and generating recommendation results. Product operators configure workflows in the recommendation scenarios of the recommendation strategy platform, configure recommendation strategies in the workflows, and define user profiles.
[0041] (4) Recommendation strategy is a set of rules or algorithms used to determine how to recommend personalized content to users. Recommendation strategy includes two levels: parent strategy and child strategy. The parent strategy includes several child strategies of the same type, and the child strategy contains specific recommendation strategy rules. Product operators configure corresponding weight values for parent strategies and child strategies in the workflow. The weight values are used to determine the priority order of each child strategy contained in these recommendation strategies when the user profile hits multiple recommendation strategies at the same time. The recommendation strategy platform only matches the parent strategy and child strategy contained in the effective workflow, calculates whether the user profile satisfies the corresponding child strategy, and returns the corresponding recommendation result.
[0042] (5) User portrait is a detailed description of user characteristics and preferences, usually based on user behavior data, attributes, and historical interactions. It is used to personalize recommendations and better meet user needs.
[0043] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings:
[0044] The recommendation strategy platform provides powerful configuration functions, allowing product operators to quickly launch recommendation strategies. However, before the recommendation strategy platform officially launches the recommendation strategy, it is necessary to test the correctness of the platform's function of executing the recommendation strategy to verify whether the recommendation results generated by the recommendation strategy meet the expected goals. Product operators expect to complete the test verification quickly, so as to quickly launch the recommendation strategy, which puts forward requirements for test efficiency.
[0045] At present, the test cases are usually written manually and input into the automated test template for testing. Specifically, the tester inputs the recommendation strategy and the recommended interface response package into the automated test template, and writes the test cases according to the user profile information configured by the recommendation strategy, and uses these test cases to debug the automated test template one by one, and compares the obtained recommendation results with the recommended interface response package to determine whether the recommendation results meet the expected goals. Among them, the recommended interface response package is the correct result output by the recommendation strategy platform when executing the recommendation strategy, and the test case includes the user profile name and value.
[0046] Among them, the automated test template parses the input user portrait name and value, selects users dedicated to the test, and intervenes in them to become user portraits that meet the test requirements. It then simulates calling the interface of the recommendation strategy platform to obtain the recommendation results output by the recommendation strategy platform, and compares the recommendation results with the recommendation interface response package to determine whether the recommendation results meet the expected goals.
[0047] However, the more sub-strategies a recommendation strategy contains, the more permutations and combinations of user portraits there are, the greater the workload of manually writing test cases, debugging automated test templates, and determining whether the recommendation results meet the expected goals, and the testing efficiency is low.
[0048] For example, a recommendation strategy contains 264 sub-strategies. Each sub-strategy is configured with an average of 3 user profiles and each user profile has multiple values. If 3 test cases are designed for each sub-strategy, the total number of test cases that need to be designed to hit a single sub-strategy is 264*3=792. If test cases that hit 2 or more sub-strategies need to be designed at the same time, the complexity and number of combinations of the design will increase explosively, and the workload of manually writing and debugging test cases will increase sharply, reducing the test efficiency of the entire testing process.
[0049] Based on this, the embodiment of the present application provides a testing method. On the one hand, by generating test cases based on user portrait rule data, and performing hit determination on each test case in turn based on the determination expression corresponding to each sub-strategy to obtain a test case list, the present application can generate test cases based on the sub-strategies in the recommendation scenario without the need for manual maintenance of test cases, and can obtain test cases that only hit the corresponding sub-strategies through hit determination, thereby reducing the probability of interference information from other sub-strategies appearing in the recommendation results and improving test efficiency;
[0050] On the other hand, by generating virtual test users based on the test case list, writing the user information corresponding to the virtual test users into the recommendation strategy platform, accessing the recommendation strategy platform to obtain the recommendation results, and verifying the recommendation results, the present application can perform batch intervention on the user portraits stored in the recommendation strategy platform to improve execution efficiency, and can automatically verify the recommendation results to determine whether the test cases are executed normally, thereby improving testing efficiency.
[0051] See also Figure 1 , Figure 1 It is a schematic diagram of an application environment provided by an embodiment of the present application.
[0052] like Figure 1 As shown, the application environment 100 includes: an electronic device 10 and a recommendation strategy platform 20. The electronic device 10 is connected to the recommendation strategy platform 20 through a network communication, and the network includes a wired network and / or a wireless network. It can be understood that the network includes wireless networks such as 2G, 3G, 4G, 5G, wireless LAN, Bluetooth, etc., and may also include wired networks such as serial cables and network cables.
[0053] The electronic device 10 is communicatively connected to the recommendation strategy platform 20, and is used to execute the test method in any of the following embodiments to test the correctness of the function of the recommendation strategy platform 20 in executing the recommendation strategy. For example: generating test cases and virtual test users, and accessing the recommendation strategy platform 20 and verifying the obtained recommendation results, so that when the recommendation strategy platform 20 executes each test case normally, it is determined that the recommendation strategy platform 20 can correctly execute the recommendation strategy, and when the recommendation strategy platform 20 executes any test case abnormally, it is determined that the function of the recommendation strategy platform 20 is abnormal and the recommendation strategy is executed incorrectly. In the embodiment of the present application, the electronic device 10 includes but is not limited to: mobile electronic devices such as laptop computers, PDAs, and personal computer devices, and non-mobile electronic devices such as servers.
[0054] The recommendation strategy platform 20 is communicatively connected to the electronic device 10, and is used to respond to the access request of the electronic device 10, execute the recommendation strategy to generate the recommendation result, and send the recommendation result to the electronic device 10, so that the electronic device 10 verifies the recommendation result. In the embodiment of the present application, the recommendation strategy platform 20 includes but is not limited to a server or a terminal, wherein the server includes but is not limited to a tower server, a rack server, a blade server, a cloud server, etc., and the terminal includes but is not limited to a personal computer device or other electronic devices with computing functions.
[0055] The test method and device provided in the embodiments of the present application can be widely used in various industries and fields, for example, in the fields of e-commerce, financial services, social media, or insurance, etc. The following takes the insurance field as an example to illustrate the process of the test method. The test methods in other fields are similar to this and will not be repeated here.
[0056] See also Figure 2 , Figure 2 It is a flow chart of a testing method provided in an embodiment of the present application.
[0057] The test method is applied to a recommendation strategy platform, and the execution subject of the test method is an electronic device. Specifically, the execution subject of the test method is at least one processor of the electronic device.
[0058] like Figure 2 As shown, the test method includes steps S201 to S206:
[0059] Step S201: Acquire scenario strategy information.
[0060] The scenario strategy information is the information obtained from any recommendation scenario of the recommendation strategy platform. A recommendation scenario includes at least one workflow, each workflow includes at least one recommendation strategy, and each recommendation strategy includes two levels: parent strategy and child strategy. Each workflow includes at least one parent strategy and the weight value of each parent strategy. Each parent strategy includes several child strategies of the same type and the weight value of each child strategy. The weight value is a numerical value used to control the relative importance of different recommendation strategies.
[0061] Among them, the sub-strategy includes detailed information of the recommendation strategy, for example: the sub-strategy includes the population targeting strategy, the recall strategy and the sorting strategy. The population targeting strategy is used to determine the user group corresponding to each sub-strategy, so as to make personalized recommendations to the user group. The population targeting strategy divides the user group based on the user's basic attributes (such as age, gender, geographic location, etc.), behavioral characteristics (such as browsing history, purchase history, search habits, etc.) and channel characteristics (such as which channel the user enters the platform through). Among them, the user's basic attributes are the user portrait.
[0062] The recall strategy is used to generate a candidate recommendation material set, which includes several materials. The materials are products that match the user profile configured by product operators on the recommendation strategy platform, that is, the materials are recommended to users based on user needs and behavioral characteristics. For example: in the insurance industry, the recommendation strategy platform is used to provide personalized insurance product recommendations and services based on the user's specific insurance needs and behavioral characteristics. When the recommendation scenario is a personalized insurance product recommendation scenario, the materials are insurance products recommended to users based on their specific insurance needs and behavioral characteristics.
[0063] The sorting strategy is used to sort the materials in the candidate recommendation material set to obtain the recommendation results. The recommendation results include several materials, each of which corresponds to a weight value. In the recommendation results, the materials are arranged in descending order according to the corresponding weight values.
[0064] In an embodiment of the present application, the scenario policy information includes at least one sub-policy under the recommended scenario. The processor of the electronic device reads each workflow included in the recommended scenario from the recommended policy platform according to the identifier of the recommended scenario, reads the parent policy included in the workflow and the weight value of each parent policy from each workflow, and reads the sub-policies included in the parent policy and the weight value of each sub-policy from each parent policy.
[0065] Among them, the sub-strategy includes user portrait rule data. The user portrait rule data is a collection of all user portraits contained in a sub-strategy. The elements include user portrait name and user portrait value. One element includes at least one user portrait value. The user portrait name is the identifier or name of the user feature. It is a description of a specific attribute of the user and is used to classify and identify the user. For example, the user portrait name is age, gender, occupation, income level or educational background. The user portrait value is the specific numerical value or classification information corresponding to the user portrait name. It provides specific data of the user feature. For example, if the user portrait name is age, the user portrait value can be a specific number; if the user portrait name is "gender", the user portrait value can be male or female.
[0066] The user portrait rule data includes at least one element, which is a user portrait rule group or a single user portrait. A single user portrait includes a user portrait name and at least one user portrait value. A user portrait rule group includes at least two single user portraits.
[0067] In some embodiments, the user portrait rule data has a two-layer structure, that is, at least one element in the user portrait rule data is a user portrait rule group, and at least one element is a single user portrait. The user portrait rule group also includes an operation type, which is used to define the relationship between the single user portraits in the user portrait rule group. The operation type includes an or operation, or, and operation. The or operation means that as long as a single user portrait in the user portrait rule group is hit, the sub-strategy is hit. The and operation means that each single user portrait in the user portrait rule group is hit at the same time to hit the sub-strategy.
[0068] Step S202: Generate test cases based on user portrait rule data.
[0069] Specifically, based on the user profile rule data contained in each sub-strategy, a test case that hits the first number of sub-strategies is generated. The test case is used to verify whether the recommendation strategy of the recommendation strategy platform works as expected. The test case includes a user profile name and a user profile value. Each test case corresponds to at least one sub-strategy. The first number represents the number of sub-strategies corresponding to a test case, that is, the number of sub-strategies hit by a test case. Hitting means that the test case triggers and verifies the sub-strategy. The first number is greater than or equal to one, and the first number is a positive integer.
[0070] For example: based on the user profile rule data contained in each sub-strategy, generate a test case that only hits a single sub-strategy, or generate a test case that hits two sub-strategies at the same time, or generate a test case that hits any three or more sub-strategies at the same time.
[0071] In the embodiment of the present application, the test case includes a first test case, and the first test case is a test case that only hits a single sub-strategy. In step S202, the step of generating a test case that only hits a single sub-strategy includes steps S221-S225:
[0072] Step S221: combining the elements representing a single user portrait in the user portrait rule data to obtain a user portrait rule group.
[0073] Specifically, for each element in a user portrait rule data, when the element contains the first field, the element is determined to be a user portrait rule group; when the element does not contain the first field, the element is determined to be a single user portrait, and several elements representing single user portraits in the user portrait rule data are combined to obtain a user portrait rule group.
[0074] Among them, the operation type of the user portrait rule group is the operation type of the first layer element in the user portrait rule data, and the operation type of the first layer element is used to represent the relationship between the elements in the user portrait rule data. The first field is used to determine whether the element is a user portrait rule group or a single user portrait. In the embodiment of the present application, the first field can be set by those skilled in the art according to actual conditions and is not limited here.
[0075] For example: the content of the user portrait rule data is {“User portrait rule data”: {“Operation type of the first layer element”: “Or operation”, “First field”: [{“User portrait name”: “rt1”, “Operation field”: “And operation”, “User portrait value”: [“v11”, “v12”]}, {“Operation type”: “And operation”, “First field”: [{“User portrait name”: “rt2”, “Operation field”: “And operation”, “User portrait value”: [“v21”]}, {“User portrait name”: “rt3”, “Operation field”: “And operation”, “User portrait value”: [“v31”, “v32”]}]}, {“User portrait name”: “rt4”, “Operation field”: “And operation”, “User portrait value”: [“v41”]}]}}.
[0076] Among them, the operation field is used to define the relationship between the user portrait name and the user portrait value within a single user portrait. When the operation field is an and operation, it means that the specific values of the user portrait name and the user portrait value must be met at the same time to hit the single user portrait.
[0077] The user portrait rule data includes three elements: the first element is a single user portrait, the user portrait name is rt1, and the user portrait value is v11 or v12; the second element is a user portrait rule group, the operation type of the user portrait rule group is and operation, and the user portrait rule group includes two single user portraits, one of which is named rt2 and has a user portrait value of v21, and the other is named rt3 and has a user portrait value of v31 or v32; the third element is a single user portrait, the user portrait name is rt4 and has a user portrait value of v41.
[0078] In step S221, the first element and the third element in the user portrait rule data are combined to obtain a user portrait rule group, which includes two single user portraits, and the operation type between the two single user portraits is an OR operation, that is, the operation type of the user portrait rule group is an OR operation. The operation type between the user portrait rule group and the second element in the user portrait rule data is an OR operation, that is, the operation type between the two user portrait rule groups corresponding to the user portrait rule group is an OR operation.
[0079] Step S222: Based on the operation type of each user portrait rule group, a one-to-one corresponding default use case is generated for each single user portrait included in the user portrait rule group.
[0080] Among them, the default use case includes a first normal use case or an abnormal use case. The first normal use case is used to verify whether the recommendation strategy platform can normally execute the recommendation strategy under expected and standard operating conditions. The first normal use case includes valid data and expected output results. The abnormal use case is used to verify whether the recommendation strategy platform can properly handle erroneous input, abnormal situations or boundary values under non-standard or boundary conditions. The abnormal use case includes invalid data, for example: invalid data is an illegal value. The first normal use case and the abnormal use case both include the user portrait name and the user portrait value.
[0081] In the embodiment of the present application, step S222 includes steps S2221-S2223:
[0082] Step S2221: When the operation type of the user portrait rule group is and operation, any user portrait value contained in the single user portrait is used as the value of the first normal use case corresponding to the single user portrait.
[0083] Specifically, when the operation type of the user portrait rule group is and operation, the sub-strategy is hit only when every single user portrait in the user portrait rule group is hit at the same time. Therefore, for each single user portrait, any user portrait value contained in the single user portrait is used as the value of the first normal use case corresponding to the single user portrait.
[0084] For example: for the first user portrait rule group, the operation type of the first user portrait rule group is and operation, and the first user portrait rule group includes two single user portraits, one of which has a user portrait name of rt2 and a user portrait value of v21, and the other has a user portrait name of rt3 and a user portrait value of v31 or v32. The first normal use case corresponding to the single user portrait rt2 has a user portrait name of rt2 and a user portrait value of v21; the first normal use case corresponding to the single user portrait rt3 has a user portrait name of rt3 and a user portrait value of v31.
[0085] Step S2222: Set the value of the abnormal use case corresponding to any single user portrait to an illegal value, and set the values of the abnormal use cases corresponding to the remaining single user portraits to the values of the first normal use case corresponding to the single user portrait.
[0086] Specifically, when the operation type of the user portrait rule group is and operation, a single user portrait is selected from several single user portraits included in the user portrait rule group, the value of the abnormal use case corresponding to the single user portrait is set to an illegal value, and the values of the abnormal use cases corresponding to the remaining single user portraits are set to the value of the first normal use case corresponding to the single user portrait.
[0087] For example, for the first user portrait rule group, set the value of the abnormal use case corresponding to the single user portrait rt2 to an illegal value, and set the value of the abnormal use case corresponding to the single user portrait rt3 to the value of the first normal use case corresponding to the single user portrait rt3. That is, the abnormal use case corresponding to the single user portrait rt2 has a user portrait name of rt2 and an illegal value; the abnormal use case corresponding to the single user portrait rt3 has a user portrait name of rt3 and a user portrait value of v31.
[0088] Step S2223: When the operation type of the user portrait rule group is an OR operation, the values of the first normal use case and the abnormal use case corresponding to each single user portrait are set to illegal values.
[0089] Specifically, when the operation type of the user portrait rule group is an or operation, as long as a single user portrait in the user portrait rule group is hit, the sub-strategy is hit. Therefore, for each single user portrait, the values of the first normal use case and abnormal use case corresponding to the single user portrait are set to illegal values.
[0090] For example: for the second user portrait rule group, the operation type of the second user portrait rule group is an or operation, and the second user portrait rule group includes two single user portraits, one of which has a user portrait name of rt1 and a user portrait value of v11 or v12, and the other has a user portrait name of rt4 and a user portrait value of v41. For the first normal use case and abnormal use case corresponding to the single user portrait rt1, the user portrait name is rt1, and the user portrait value is an illegal value; for the first normal use case and abnormal use case corresponding to the single user portrait rt4, the user portrait name is rt4, and the user portrait value is an illegal value.
[0091] Step S223: Replace the default use case to generate a test set corresponding to each user portrait rule group.
[0092] Specifically, each element in the user portrait rule group is a single user portrait. Since each single user portrait is independent of each other, this application generates a full set of use cases in accordance with the single factor change principle, so that the full set of use cases contains each user portrait value of each single user portrait in the user portrait rule data. That is, the first normal use case corresponding to each single user portrait is replaced in turn, and the value of the first normal use case is replaced with the user portrait value corresponding to the single user portrait to obtain at least one second normal use case, and the second normal use case or abnormal use case is combined to obtain a full set of use cases, and several full use cases constitute the test set corresponding to the user portrait rule group.
[0093] The second normal use case is a normal use case obtained after replacing the first normal use case. The full use case includes each user portrait value of a single user portrait in the user portrait rule group. The test set includes several full use cases.
[0094] In the embodiment of the present application, step S223 includes step S2231-step S2232:
[0095] Step S2231: Based on at least one user portrait value contained in each single user portrait, the value of the first normal use case corresponding to the single user portrait is replaced with the corresponding user portrait value in sequence to obtain at least one second normal use case.
[0096] Specifically, for each single user portrait, the value of the first normal use case is replaced with any user portrait value of the single user portrait to obtain at least one second normal use case. The number of second normal use cases corresponding to each single user portrait is the same as the number of user portrait values of the single user portrait.
[0097] For example: for the first user portrait rule group, after the replacement operation is completed, the single user portrait rt2 corresponds to one second normal use case, whose user portrait name is rt2 and the user portrait value is v21; the single user portrait rt3 corresponds to two second normal use cases, one second normal use case has a user portrait name of rt3 and a user portrait value of v31, and the other second normal use case has a user portrait name of rt3 and a user portrait value of v32.
[0098] For example: for the second user portrait rule group, after the replacement operation is completed, the single user portrait rt1 corresponds to two second normal use cases, the user portrait name of one second normal use case is rt1, the user portrait value is v11, and the user portrait value of the other second normal use case is rt1, and the user portrait value is v12; the single user portrait rt4 corresponds to one second normal use case, its user portrait name is rt4, and the user portrait value is v41.
[0099] Step S2232: Combine the second normal use cases corresponding to different single user portraits in a user portrait rule group to obtain a number of full use cases corresponding to each user portrait rule group.
[0100] Specifically, when the operation type of the user portrait rule group is and operation, the second normal use cases corresponding to different single user portraits in the user portrait rule group are combined to obtain a number of full use cases corresponding to the user portrait rule group. At this time, a full use case includes the second normal use cases corresponding to all single user portraits with different user portrait names in the user portrait rule group.
[0101] For example: for the first user portrait rule group, a single user portrait rt2 corresponds to a second normal use case, whose user portrait name is rt2 and user portrait value is v21; a single user portrait rt3 corresponds to two second normal use cases, one of which has a user portrait name of rt3 and a user portrait value of v31, and the other has a user portrait name of rt3 and a user portrait value of v32.
[0102] The first user portrait rule group corresponds to two full use cases. The first full use case includes: single user portrait rt2 with a user portrait value of v21, and single user portrait rt3 with a user portrait value of v31; the second full use case includes: single user portrait rt2 with a user portrait value of v21, and single user portrait rt3 with a user portrait value of v32.
[0103] Alternatively, when the operation type of the user portrait rule group is an or operation, the second normal use case corresponding to any single user portrait in the user portrait rule group and the abnormal use cases corresponding to other single user portraits are combined to obtain a number of full use cases corresponding to the user portrait rule group. At this time, a full use case includes the second normal use case corresponding to any single user portrait in the user portrait rule group and the abnormal use cases corresponding to all other single user portraits in the user portrait rule group.
[0104] For example: for the second user portrait rule group, a single user portrait rt1 corresponds to two second normal use cases, one of which has a user portrait name of rt1 and a user portrait value of v11, and the other has a user portrait name of rt1 and a user portrait value of v12; a single user portrait rt4 corresponds to a second normal use case, whose user portrait name is rt4 and whose user portrait value is v41; the abnormal use case corresponding to the single user portrait rt1 has a user portrait name of rt1 and a user portrait value of an illegal value, and the abnormal use case corresponding to the single user portrait rt4 has a user portrait name of rt4 and a user portrait value of an illegal value.
[0105] The second user portrait rule group corresponds to three full use cases. The first full use case includes: single user portrait rt1 with user portrait value v11, and single user portrait rt4 with user portrait value as illegal value; the second full use case includes: single user portrait rt1 with user portrait value v12, and single user portrait rt4 with user portrait value as illegal value; the third full use case includes: single user portrait rt1 with user portrait value as illegal value, and single user portrait rt4 with user portrait value as v41.
[0106] Furthermore, two full use cases corresponding to the first user portrait rule group and three full use cases corresponding to the second user portrait rule group are stored in the corresponding test set to obtain a test set corresponding to a sub-strategy.
[0107] Step S224: Based on the operation type of the first-layer elements in the user portrait rule data, the default use cases corresponding to each user portrait rule group are merged to generate a sub-strategy use case.
[0108] The sub-strategy use case includes a first normal use case corresponding to each user portrait rule group, or an abnormal use case corresponding to each user portrait rule group. The sub-strategy use case includes each user portrait value of each single user portrait in the user portrait rule data.
[0109] In the embodiment of the present application, step S224 includes step S2241-step S2242:
[0110] Step S2241: When the operation type of the first-layer element is and operation, the first normal use case corresponding to each user portrait rule group is merged to generate a sub-strategy use case.
[0111] Specifically, when the operation type of the first-layer element in the user portrait rule data is and operation, the sub-strategy is hit only when every single user portrait in every user portrait rule group contained in the user portrait rule data is hit at the same time. Therefore, the first normal use case corresponding to each user portrait rule group in the user portrait rule data is merged to generate a sub-strategy use case.
[0112] Step S2242: When the operation type of the first-layer element is an OR operation, the abnormal use cases corresponding to each user portrait rule group are merged to generate a sub-strategy use case.
[0113] Specifically, when the operation type of the first-layer element in the user portrait rule data is an or operation, as long as a single user portrait in any user portrait rule group is hit, the sub-strategy is hit. Therefore, the abnormal use cases corresponding to each user portrait rule group in the user portrait rule data are merged to generate a sub-strategy use case.
[0114] For example: in the first user portrait rule group, the abnormal use case corresponding to the single user portrait rt2 has a user portrait name of rt2 and an illegal user portrait value; the abnormal use case corresponding to the single user portrait rt3 has a user portrait name of rt3 and a user portrait value of v31; in the second user portrait rule group, the abnormal use case corresponding to the single user portrait rt1 has a user portrait name of rt1 and an illegal user portrait value; the abnormal use case corresponding to the single user portrait rt4 has a user portrait name of rt4 and an illegal user portrait value; the operation type of the first-layer element in the user portrait rule data is or operation. The sub-strategy use cases include: single user portrait rt1 with an illegal user portrait value, single user portrait rt4 with an illegal user portrait value, single user portrait rt2 with an illegal user portrait value, and single user portrait rt3 with a user portrait value of v31.
[0115] Step S225: Merge each test set with the sub-strategy use case to generate a test case set corresponding to the sub-strategy.
[0116] Among them, the test case set includes several first test cases, the first test case contains each user portrait value of each single user portrait in the user portrait rule data, and the user portrait value corresponding to any user portrait name in the first test case is the same as the user portrait value corresponding to the user portrait name in the test set.
[0117] Specifically, for each test set corresponding to a user profile rule group, each full test case and sub-strategy test case contained in the test set is merged in turn to obtain at least one first test case, and the first test case is stored in the test case set corresponding to the sub-strategy, wherein, when the full test case and the sub-strategy test case contain the same user profile name, the user profile value corresponding to the user profile name in the first test case is set to the user profile value corresponding to the user profile name in the full test case. The above operation is performed for each sub-strategy to generate a test case set corresponding to each sub-strategy.
[0118] In some embodiments, when a test case that only hits a single sub-strategy is generated, the test cases in the test case set corresponding to each sub-strategy are stored in a test case set, and the test case set includes the test cases of all sub-strategies under the workflow.
[0119] Taking the test set consisting of the full set of use cases corresponding to the first user portrait rule group and the second user portrait rule group as an example, the test case set corresponding to the sub-strategy includes five first test cases. The first first test case includes: single user portrait rt1 with a user portrait value of v11, single user portrait rt4 with an illegal user portrait value, single user portrait rt2 with an illegal user portrait value, and single user portrait rt3 with a user portrait value of v31. The second first test case includes: single user portrait rt1 with a user portrait value of v12, single user portrait rt4 with an illegal user portrait value, single user portrait rt2 with an illegal user portrait value, and single user portrait rt3 with a user portrait value of v31.
[0120] The third first test case includes: single user portrait rt1 whose user portrait value is an illegal value, single user portrait rt4 whose user portrait value is v41, single user portrait rt2 whose user portrait value is an illegal value, and single user portrait rt3 whose user portrait value is v31. The fourth first test case includes: single user portrait rt1 whose user portrait value is an illegal value, single user portrait rt4 whose user portrait value is an illegal value, single user portrait rt2 whose user portrait value is v21, and single user portrait rt3 whose user portrait value is v31. The fifth first test case includes: single user portrait rt1 whose user portrait value is an illegal value, single user portrait rt4 whose user portrait value is an illegal value, single user portrait rt2 whose user portrait value is v21, and single user portrait rt3 whose user portrait value is v32.
[0121] In the embodiment of the present application, for each sub-strategy, steps S221 to S225 are executed to generate a test case that only hits the sub-strategy.
[0122] See also Figure 3 , Figure 3 It is a detailed flow chart of generating a test case that only hits a single sub-strategy provided in an embodiment of the present application.
[0123] like Figure 3 As shown in the figure, the detailed process of generating a test case that only hits a single sub-strategy includes:
[0124] Step S301: combining elements representing a single user portrait in the user portrait rule data to obtain a user portrait rule group.
[0125] Specifically, this step is the same as step S221 and will not be repeated here.
[0126] Step S302: Determine whether all user portrait rule groups have been processed.
[0127] Specifically, it is determined whether all user portrait rule groups corresponding to a sub-strategy have been processed, wherein all user portrait rule groups corresponding to a sub-strategy include the user portrait rule group generated in step S301 and the elements representing the user portrait rule group in the user portrait rule data included in the sub-strategy.
[0128] If all user portrait rule groups have been processed, the process proceeds to step S307 ; if not all user portrait rule groups have been processed, the process proceeds to step S303 to process the next user portrait rule group.
[0129] Step S303: Determine whether the operation type of the user portrait rule group is an and operation.
[0130] Specifically, if the operation type of the user portrait rule group is an AND operation, proceed to step S304; if the operation type of the user portrait rule group is not an AND operation, that is, the operation type of the user portrait rule group is an OR operation, proceed to step S305.
[0131] Step S304: Generate a first normal use case and an abnormal use case.
[0132] Specifically, any user portrait value contained in a single user portrait is used as the value of the first normal use case corresponding to the single user portrait, and the value of the abnormal use case corresponding to any single user portrait is set to an illegal value, and the values of the abnormal use cases corresponding to the remaining single user portraits are set to the values of the first normal use case corresponding to the single user portrait.
[0133] Step S305: setting the values of the first normal use case and abnormal use case corresponding to each single user portrait to illegal values.
[0134] Step S306: Generate a test set corresponding to each user portrait rule group.
[0135] Specifically, the default use case is replaced to generate a test set corresponding to each user portrait rule group. This step is the same as step S223 and will not be repeated here.
[0136] Step S307: Determine whether the operation type of the first-layer element in the user portrait rule data is an OR operation.
[0137] Specifically, if the operation type of the first-layer element in the user portrait rule data is an OR operation, then enter step S308; if the operation type of the first-layer element in the user portrait rule data is not an OR operation, that is, the operation type of the first-layer element in the user portrait rule data is an AND operation, then enter step S309.
[0138] Step S308: Merge the abnormal use cases corresponding to each user portrait rule group to generate a sub-strategy use case.
[0139] Step S309: Merge the first normal use cases corresponding to each user portrait rule group to generate a sub-strategy use case.
[0140] Step S310: Merge each test set with the sub-strategy case to generate a test case set corresponding to the sub-strategy.
[0141] Specifically, this step is the same as step S225 and will not be repeated here.
[0142] In some embodiments, the test case includes a second test case, each second test case corresponds to a preset number of sub-strategies, the second test case is a test case that hits at least two sub-strategies, and the scenario strategy information also includes the numbers of the at least two sub-strategies. Step S202 also includes generating a test case that hits at least two sub-strategies at the same time.
[0143] See also Figure 4 , Figure 4 It is a flowchart of generating a test case that simultaneously hits at least two sub-strategies provided in an embodiment of the present application.
[0144] like Figure 4 As shown, the process of generating a test case that hits at least two sub-strategies at the same time includes:
[0145] Step S401: Based on the serial number and preset quantity of each sub-strategy, a permutation function is called to generate a sub-strategy sequence set.
[0146] The preset number is the number of sub-strategies corresponding to the second test case, that is, the number of sub-strategies that the second test case needs to hit. The preset number can be set by those skilled in the art according to actual conditions and is not limited here. For example, the preset number is two.
[0147] Specifically, after generating the test case set corresponding to each sub-strategy in step S310, the numbers and preset numbers of sub-strategies that the second test case needs to hit are determined, and the arrangement function is called to generate a sub-strategy sequence set.
[0148] The permutation function is used to generate a permutation and combination sequence, and the permutation function includes but is not limited to a library function (iterative combinations) in a programming language (Python). The input parameters of the iterative combinations function are the ID and the preset number of sub-strategies that the second test case needs to hit, and the output result is a sub-strategy sequence set, which is an array structure, and each element in the sub-strategy sequence set is a sub-array containing the IDs of the preset number of sub-strategies.
[0149] Step S402: Determine the element currently being processed in the sub-strategy sequence set.
[0150] Specifically, each element in the sub-strategy sequence set is traversed, and steps S403 to S405 are executed for each element.
[0151] Step S403: Determine whether the same user profile name exists in several sub-policies corresponding to the element.
[0152] Specifically, it is determined whether there is an identical user portrait name in the preset number of sub-policies corresponding to the element, that is, whether there is an intersection among the single user portraits. If there is an identical user portrait name in the several sub-policies corresponding to the element, that is, there is an intersection among the single user portraits, then the process proceeds to step S404; if the user portrait names contained in the several sub-policies corresponding to the element are all different, that is, there is no intersection among the user portraits, then the process proceeds to step S405.
[0153] Step S404: determining whether the user portrait values corresponding to the same user portrait name are the same;
[0154] Specifically, if the same user portrait name exists in several sub-policies corresponding to the element, it is determined whether the user portrait values corresponding to the same user portrait name are the same.
[0155] If the user portrait values corresponding to the same user portrait name are the same, proceed to step S405; if for any user portrait name, the user portrait values corresponding to the same user portrait name are different, return to step S402, determine the next element to be processed in the sub-strategy sequence set, and execute steps S403-S405 on the next element to be processed.
[0156] Step S405: Select a first test case from each test case set corresponding to each sub-strategy and merge them to obtain a second test case.
[0157] Specifically, when the user profile names included in the several sub-strategies corresponding to the element are all different, a first test case is selected from the test case set corresponding to each sub-strategy and merged to obtain a second test case.
[0158] For example: when generating a test case that hits two sub-strategies at the same time, if the single user portraits contained in the two sub-strategies have no intersection, select a first test case from the test case sets corresponding to the two sub-strategies and combine them in pairs to generate a second test case that hits the two sub-strategies at the same time.
[0159] Alternatively, when the same user portrait name exists in several sub-strategies corresponding to the element, and the user portrait values corresponding to the same user portrait name are the same, a first test case is selected from the test case set corresponding to each sub-strategy and merged to obtain a second test case.
[0160] For example: when generating a test case that hits two sub-strategies at the same time, if the single user portraits contained in the two sub-strategies have an intersection, and the user portrait values corresponding to the same user portrait name are also the same, the test case can satisfy the simultaneous hitting of the two sub-strategies. Therefore, when the user portrait values corresponding to the same user portrait name in the two sub-strategies are the same, the first test cases corresponding to the two sub-strategies are merged; otherwise, the first test case is an invalid case and is directly eliminated.
[0161] Further, after obtaining the second test case corresponding to the currently processed element in the sub-strategy sequence set, the second test case is stored in the test case set, returning to step S402, determining the next element to be processed in the sub-strategy sequence set, and executing steps S403-S405 on the next element to be processed until steps S403-S405 are completed for all elements in the sub-strategy sequence set.
[0162] In the embodiment of the present application, a user portrait rule group is obtained by combining elements representing single user portraits in the user portrait rule data, and a one-to-one corresponding default use case is generated for each single user portrait included in the user portrait rule group based on the operation type of each user portrait rule group, and a replacement operation is performed on the default use case to generate a test set corresponding to each user portrait rule group, and based on the operation type of the first-layer element in the user portrait rule data, the default use case corresponding to each user portrait rule group is merged to generate a sub-strategy use case, and each test set is merged with the sub-strategy use case to generate a test case set corresponding to the sub-strategy;
[0163] On the one hand, compared with the existing solutions, the more sub-strategies the recommendation strategy contains, the greater the workload of manually writing and debugging test cases, and the lower the test efficiency. In order to balance the test efficiency, the written test cases only cover some user portraits, but this approach sacrifices the comprehensiveness of the test and will miss the verification of the recommendation strategy for certain specific user groups, resulting in potential quality risks, such as: deviations in recommendation results, inconsistent user experience, etc. This application can automatically generate test cases based on the latest content of the recommendation strategy, and make these test cases cover the user portraits contained in the full quantum strategy, so as to verify the effectiveness and accuracy of the recommendation strategy in different user scenarios;
[0164] On the other hand, compared with the existing solutions, product operators frequently modify recommended strategies based on business needs, which easily leads to the invalidation of historically maintained test cases and requires more manpower to maintain test cases. This application can maintain the consistency of test cases and sub-strategies, and does not require manual maintenance of historical test cases. It can improve test efficiency and reduce the failure rate of historically maintained test cases.
[0165] Step S203: Based on the determination expression corresponding to each sub-strategy, perform hit determination on each test case in turn to obtain a test case list.
[0166] Specifically, each sub-strategy corresponds to a determination expression, and the determination expression is used to perform hit determination on the test case. Hit determination refers to determining whether the test case hits the corresponding sub-strategy, that is, determining whether the test case generated for the specified sub-strategy hits other sub-strategies. Therefore, when any test case generated for the specified sub-strategy hits other sub-strategies, the test case is deleted. When any test case generated for the specified sub-strategy does not hit other sub-strategies and the test case hits the specified sub-strategy, the test case is stored in the test case list, so that the test case list includes only test cases that hit the corresponding sub-strategy. Among them, the number of specified sub-strategies is at least one.
[0167] For example, for two sub-strategies (sub-strategy A and sub-strategy B), three groups of test cases are generated, namely: test cases that only hit A but not B, test cases that only hit B but not A, and test cases that hit both A and B. However, in the actual production environment, the test cases generated for sub-strategy A may also hit sub-strategy B, and the recalled material information of sub-strategy B will appear in the recommendation results. Therefore, the hit judgment is used to determine whether the test cases generated for sub-strategy A will hit sub-strategy B. When any test case generated for sub-strategy A hits sub-strategy A and does not hit sub-strategy B, the test case is stored in the test case list.
[0168] Alternatively, the hit determination is used to determine whether the test case generated for sub-strategy B will hit sub-strategy A. Alternatively, the hit determination is used to determine whether the test case generated for sub-strategies A and B will hit sub-strategies A and B at the same time. When the test case generated for sub-strategies A and B hits sub-strategies A and B at the same time, the test case is stored in the test case list. When the test case generated for sub-strategies A and B does not hit sub-strategy A or sub-strategy B, the test case is deleted.
[0169] It can be understood that, through hit determination, the test cases generated for the specified sub-strategy can be controlled to only hit the specified sub-strategy and not hit other sub-strategies. Therefore, this determination method is also called exclusive determination.
[0170] In an embodiment of the present application, before performing a hit determination on the test case, the method further includes: processing each sub-strategy in turn, and generating a one-to-one determination expression for each sub-strategy based on the user portrait rule data contained in each sub-strategy.
[0171] Specifically, the step of generating a determination expression corresponding to each sub-strategy includes step S1 and step S2:
[0172] Step S1: traverse each element in the user portrait rule data and generate an expression string corresponding to each element.
[0173] Specifically, for a sub-strategy, traverse each element in the user portrait rule data contained in the sub-strategy, and when any element is a user portrait rule group, generate an expression string corresponding to the user portrait rule group based on the user portrait group processing function, and when any element is a single user portrait, generate an expression string corresponding to the single user portrait based on the single user portrait processing function. The expression string corresponding to each element includes at least one user portrait name and a user portrait value corresponding to the user portrait name.
[0174] Step S2: Based on the operation type of the first-layer elements in the user profile rule data, the expression character string is concatenated to obtain the judgment expression corresponding to each sub-strategy.
[0175] Specifically, when the operation type of the first-layer element in the user portrait rule data is an and operation, the expression string corresponding to each element is concatenated through the and semantics (and) to obtain the determination expression corresponding to the sub-strategy; when the operation type of the first-layer element in the user portrait rule data is an or operation, the expression string corresponding to each element is concatenated through the or semantics (or) to obtain the determination expression corresponding to the sub-strategy. The determination expression corresponding to the sub-strategy includes the user portrait name and user portrait value of all single user portraits in the sub-strategy, as well as the relationship between single user portraits.
[0176] Furthermore, step S1 and step S2 are executed for each sub-strategy to obtain a decision expression corresponding to each sub-strategy.
[0177] See also Figure 5 , Figure 5 It is a detailed flow chart of generating a determination expression corresponding to a sub-strategy provided in an embodiment of the present application.
[0178] like Figure 5 As shown in the figure, the detailed process of generating a decision expression corresponding to a sub-strategy includes:
[0179] Step S501: Initialize the first variable.
[0180] Specifically, the first variable is used to store a determination expression corresponding to a sub-strategy. The first variable is set to an empty string to initialize the first variable.
[0181] Step S502: Determine whether the user portrait rule data contains elements to be processed.
[0182] Specifically, the element to be processed is an element in the user portrait rule data included in a sub-strategy for which a corresponding expression string is not generated, that is, an element for which steps S503 to S506 are not performed.
[0183] If the user portrait rule data contains elements to be processed, the process proceeds to step S503 ; if the user portrait rule data does not contain elements to be processed, the process proceeds to step S507 .
[0184] Step S503: Determine whether the element currently being processed contains the first field.
[0185] Specifically, if the element currently being processed does not include the first field, the process proceeds to step S504; if the element currently being processed includes the first field, the process proceeds to step S505.
[0186] Step S504: Determine that the element is a single user portrait, and generate an expression string corresponding to the element based on the single user portrait processing function.
[0187] Specifically, when the element does not contain the first field, the element is determined to be a single user portrait, and an expression string corresponding to the element is generated based on a single user portrait processing function. The single user portrait processing function is used to process a single user portrait and generate an expression string corresponding to the single user portrait. The expression string corresponding to the single user portrait includes a user portrait name and a user portrait value of the single user portrait, wherein the user portrait name and the user portrait value are connected by an operator (in).
[0188] For example, one element in the user portrait rule data is a single user portrait. The user portrait name of the single user portrait is rt1, and the user portrait value is v11 or v12. The expression string corresponding to the single user portrait is 'rt1'i n['v11', 'v12'].
[0189] Step S505: Determine that the element is a user portrait rule group, and generate an expression string corresponding to the element based on the user portrait group processing function.
[0190] Specifically, when the element contains the first field, the element is determined to be a user portrait rule group; based on the user portrait group processing function, each single user portrait contained in the user portrait rule group is traversed to generate an expression string corresponding to each single user portrait; based on the operation type of the user portrait rule group, the expression string corresponding to each single user portrait is concatenated to obtain an expression string corresponding to the user portrait rule group.
[0191] Among them, the user portrait group processing function is used to process the user portrait rule group and generate an expression string corresponding to the user portrait rule group. Specifically, the user portrait group processing function traverses each single user portrait contained in the user portrait rule group, calls the single user portrait processing function to generate an expression string corresponding to each single user portrait, and then when the operation type of the user portrait rule group is an and operation, the expression string corresponding to each single user portrait is spliced through the and semantics (and) to obtain an expression string corresponding to the user portrait rule group, or, when the operation type of the user portrait rule group is an or operation, the expression string corresponding to each single user portrait is spliced through the or semantics (or) to obtain an expression string corresponding to the user portrait rule group. The expression string corresponding to a user portrait rule group includes the expression string corresponding to each single user portrait in the user portrait rule group.
[0192] For example, one element in the user portrait rule data is a user portrait rule group, the operation type of the user portrait rule group is and operation, and the user portrait rule group includes two single user portraits, one of which has a user portrait name of rt2 and a user portrait value of v21, and the other has a user portrait name of rt3 and a user portrait value of v31 or v32. Then the expression string corresponding to the user portrait rule group is 'rt2'i n['v21']and'rt3'i n['v31', 'v32'].
[0193] Step S506: Based on the expression character string, update the first variable.
[0194] Specifically, when the operation type of the first-layer element in the user portrait rule data is an and operation, the expression string generated in step S504 or step S505 is concatenated to the first variable through and semantics (and) to update the first variable.
[0195] Alternatively, when the operation type of the first-layer element in the user portrait rule data is an or operation, the expression string generated in step S504 or step S505 is concatenated to the first variable through the or semantics (or) to update the first variable.
[0196] Further, after step S506 is completed, return to step S502 to execute steps S503 to S506 for the next element in the user portrait rule data.
[0197] Step S507: Use the current first variable as the decision expression corresponding to the sub-strategy.
[0198] Specifically, if the user portrait rule data does not contain the element to be processed, each element in the user portrait rule data generates a corresponding expression string, and these expression strings are all spliced. At this time, the content stored in the current first variable is the judgment expression corresponding to the sub-strategy.
[0199] For example: for the content of the user portrait rule data contained in the sub-strategy exemplified in step S221, the judgment expression corresponding to the sub-strategy is 'rt1'i n['v11', 'v12']or'rt2'i n['v21']and'rt3'i n['v31', 'v32']or'rt4'i n['v41'].
[0200] In an embodiment of the present application, the scenario strategy information includes a workflow in a recommended scenario, and the workflow includes at least two sub-strategies.
[0201] See also Figure 6 , Figure 6 yes Figure 2 Detailed flowchart of step S203 in FIG.
[0202] like Figure 6 As shown, step S203 includes:
[0203] Step S231: Obtain a test case set and a first array.
[0204] Specifically, the numbers of the sub-strategies corresponding to all test cases in the test case set are stored in the first array. The test case set includes the test cases of all sub-strategies under the workflow, and the test case set is an array structure, each element of which is a test case. The first array is an array composed of the numbers of the sub-strategies corresponding to all test cases in the test case set.
[0205] Step S232: Determine the test case currently being processed.
[0206] Specifically, a hit determination is performed on each test case in the test case set in turn, that is, steps S233 to S243 are executed, and each time in step S232, the test case that needs to be hit determined this time is used as the test case currently being processed.
[0207] Step S233: Determine the sub-strategy currently being processed.
[0208] Specifically, for each test case, each sub-strategy under the workflow is traversed, and a judgment operation is performed on each sub-strategy to determine whether the currently processed test case hits the first sub-strategy. The first sub-strategy is any sub-strategy except the second sub-strategy in the sub-strategies included in the workflow, and the second sub-strategy is the sub-strategy corresponding to the currently processed test case. The judgment operation is used to determine whether the currently processed sub-strategy is the first sub-strategy, and to determine whether the currently processed test case hits the currently processed sub-strategy.
[0209] A determination operation is performed on each sub-strategy, that is, steps S234 to S242 are performed, and each time in step S233, the sub-strategy that needs to be determined is used as the sub-strategy currently being processed.
[0210] Step S234: Determine whether the first array contains the serial number of the sub-strategy.
[0211] Specifically, if the first array contains the number of the sub-strategy, it indicates that the sub-strategy is the second sub-strategy, and the test case is generated based on the second sub-strategy. The test case will definitely hit the second sub-strategy, so there is no need for subsequent judgment operations, and returns to step S233, and takes the next sub-strategy as the currently processed sub-strategy to perform a judgment operation on the next sub-strategy; if the first array does not contain the number of the sub-strategy, it means that the sub-strategy is the first sub-strategy, and enters step S235.
[0212] Step S235: setting the evaluation expression to the determination expression corresponding to the sub-strategy, and setting the feature sequence to the user tag name sequence included in the sub-strategy.
[0213] Specifically, when the number of the currently processed sub-strategy is not included in the first array, the evaluation expression is set to the determination expression corresponding to the sub-strategy, and the feature sequence is set to the user tag name sequence included in the sub-strategy.
[0214] Among them, the evaluation expression is a variable, and the evaluation expression is used to subsequently determine whether the test case currently being processed hits the first sub-strategy. The feature sequence includes the user tag name sequence contained in the sub-strategy currently being processed. The user tag name sequence includes several user tag names, and the user tag name includes a user portrait name and a user portrait value.
[0215] Step S236: Determine whether the evaluation expression contains a valid value, or the feature sequence contains a valid value.
[0216] Specifically, if the evaluation expression does not contain a valid value, or the feature sequence does not contain a valid value, that is, the evaluation expression or feature sequence is empty, this situation indicates that the product operator has not configured the user tag, and the currently processed test case defaults to hitting the currently processed sub-strategy. At this time, return to step S233 and perform a judgment operation on the next sub-strategy; if the evaluation expression contains a valid value and the feature sequence contains a valid value, go to step S237.
[0217] Step S237: Determine whether the test case currently being processed has the same user tag name as the feature sequence.
[0218] Specifically, when the evaluation expression contains a valid value and the feature sequence contains a valid value, it is determined whether the currently processed test case and the feature sequence have the same user tag name, that is, whether the user tag name contained in the currently processed test case has an intersection with the feature sequence.
[0219] If the test case currently being processed has the same user tag name as the feature sequence, that is, the user tag name contained in the test case currently being processed and the feature sequence have an intersection, then enter step S238; if the user tag name contained in the test case currently being processed and the user tag name contained in the feature sequence are different, that is, the user tag name contained in the test case currently being processed and the feature sequence do not have an intersection, then it is determined that the test case does not hit the currently processed sub-strategy, return to step S233, and perform a judgment operation on the next sub-strategy.
[0220] Step S238: Update the evaluation expression.
[0221] Specifically, when the currently processed test case and the feature sequence have the same user tag name, the string corresponding to the user tag name in the evaluation expression is replaced with the user portrait value corresponding to the same user tag name in the test case to update the evaluation expression.
[0222] Step S239: Evaluate the updated evaluation expression.
[0223] Specifically, the updated evaluation expression is evaluated by the expression evaluation function to obtain an evaluation result. The expression evaluation function is used to evaluate the updated evaluation expression. When the expression evaluation function determines that the updated evaluation expression is true, the evaluation result is true. When the expression evaluation function determines that the updated evaluation expression is false, the evaluation result is false. In the embodiment of the present application, the expression evaluation function includes but is not limited to the eva l function.
[0224] Step S240: Determine whether the evaluation result is true.
[0225] Specifically, if the evaluation result is true, it means that the test case currently being processed hits the sub-strategy currently being processed. Combined with step S234 and step S235, it is determined that the sub-strategy currently being processed is the first sub-strategy, that is, the test case currently being processed hits the first sub-strategy, then enters step S241; if the evaluation result is false, the test case currently being processed does not hit the sub-strategy currently being processed, then enters step S242.
[0226] Step S241: Record the number of the sub-strategy hit by the currently processed test case in the conflict information.
[0227] Specifically, when the evaluation result is true, it is determined that the currently processed test case hits the first sub-strategy. When the currently processed test case hits the first sub-strategy, the number of the first sub-strategy is recorded in the conflict information, and step S245 is entered to perform a hit determination on the next test case until the hit determination is completed for each test case. Among them, the conflict information is used to record the number of the first sub-strategy.
[0228] Step S242: Determine whether the sub-strategy currently being processed is the last sub-strategy in the workflow.
[0229] Specifically, if the currently processed sub-policy is the last sub-policy under the workflow, the exclusive determination of all sub-policies under the workflow is completed, and step S243 is entered; if the currently processed sub-policy is not the last sub-policy under the workflow, return to step S233 and perform the determination operation on the next sub-policy.
[0230] Step S243: Add the currently processed test case to the test case list.
[0231] Specifically, when the evaluation result is false and the sub-strategy currently being processed is the last sub-strategy under the workflow, it is determined that the test case currently being processed does not hit the first sub-strategy. When the test case currently being processed does not hit the first sub-strategy, the test case is added to the test case list, and step S244 is entered to perform a hit determination on the next test case until a hit determination is completed for each test case.
[0232] Step S244: Determine whether the number of test cases processed is equal to a preset number threshold.
[0233] The preset number threshold is the maximum number of test cases to be processed, and the preset number threshold can be set by those skilled in the art according to actual conditions, and is not limited here. The preset number threshold is greater than or equal to one, and the preset number threshold is a positive integer.
[0234] If the number of test cases processed is equal to the preset number threshold, proceed to step S245; if the number of test cases processed is less than the preset number threshold, return to step S232 to perform a hit determination on the next test case.
[0235] Step S245: Determine whether the hit determination is completed for each test case.
[0236] Specifically, if the hit determination is completed for each test case, the process proceeds to step S246; if the hit determination is not completed for any test case, the process returns to step S232 to perform a hit determination on the next test case.
[0237] Step S246: Output the test case list and conflict information.
[0238] In an embodiment of the present application, a hit judgment is performed on each test case in turn based on the judgment expression corresponding to each sub-strategy to obtain a test case list. Compared with the existing scheme, it is expected to control the test cases generated for the specified sub-strategy to only hit the specified sub-strategy and not hit other sub-strategies. However, since the user portrait name and user portrait value configured for different sub-strategies may be the same or different, the tester is required to globally review all recommended policy contents and calculate the test cases that meet the requirements. Since the calculation process is complicated and error-prone, the existing scheme does not perform exclusive judgment on the test cases. The present application can perform exclusive judgment on the test cases to obtain test cases that only hit the corresponding sub-strategy, thereby reducing the probability of interference information from other sub-strategies appearing in the recommendation results and improving test efficiency.
[0239] Step S204: Generate a virtual test user based on the test case list, and write user information corresponding to the virtual test user into the recommendation strategy platform.
[0240] The recommendation strategy platform includes a database, which is used to store recommendation strategies in various recommendation scenarios. For example, the database is used to store the user profile rule data contained in each sub-strategy. The virtual test user is a virtual test user, which is used to access the recommendation strategy platform to obtain the recommendation results. The user information includes the number of the virtual test user, the user profile name and user profile value of the user profile to be intervened corresponding to the virtual test user.
[0241] It is understandable that in a real production environment, the mini program interacts with the recommendation strategy platform, and the mini program accesses the recommendation strategy platform through real users. In this application, the application environment 100 is a test environment, and a virtual test user is generated by simulating the mini program to access the recommendation strategy platform to obtain the recommendation results.
[0242] In the embodiment of the present application, step S204 includes steps S247 to S249:
[0243] Step S247: Take each test case in the test case list as a user profile to be intervened.
[0244] The user portrait to be intervened is a user portrait used to test and verify the function of the recommendation strategy platform to execute the recommendation strategy. The user portrait includes a single user portrait or a user portrait rule group.
[0245] Step S248: Generate a one-to-one corresponding virtual test user for each user portrait to be intervened.
[0246] Specifically, the user center interface of the mini program is simulated, and the user center interface is scheduled to create a virtual test user that meets the recommended scenario for each user profile to be intervened. The user center interface is used to create test users.
[0247] In the embodiments of the present application, compared with the existing solution that uses existing real test users and easily pollutes the user portrait label, the present application generates virtual test users by simulation, which can reduce the occurrence of user portrait label pollution.
[0248] Step S249: Write the user information corresponding to each virtual test user into the database.
[0249] In an embodiment of the present application, the recommendation strategy platform also includes a user portrait intervention interface, which is used to write new user information to the database in batches, or to intervene in the user portraits stored in the database based on the input user information, for example: updating the user portrait value corresponding to the user portrait name.
[0250] Specifically, the user portrait intervention interface is called, and an array consisting of several pieces of user information is input, so that the user information corresponding to the virtual test users is batch written into the database, thereby realizing batch writing of new user information or updating of user portrait values.
[0251] In an embodiment of the present application, after a virtual test user is generated, the virtual test user can be intervened into a corresponding user portrait to be intervened on the recommendation strategy platform by writing user information in batches into a database.
[0252] Compared with the existing solutions, the user portrait intervention interface provided by the recommendation strategy platform only supports intervention on a single user portrait, and it takes a while to take effect after the intervention, and the intervention results need to be refreshed from the database to the memory before the latest intervention results can be read. When the test case needs to intervene in multiple single-user portraits, the user portrait intervention interface needs to be called cyclically and wait for a certain period of time before it takes effect, which reduces the test efficiency. This application writes user information into the database in batches, so that when the test case needs to intervene in multiple single-user portraits, the user portrait intervention interface only needs to be called once, and this intervention method can take effect immediately, reducing the interference of existing user portraits in the database, removing the test environment restrictions, and improving the test efficiency.
[0253] In some embodiments, step S204 also includes: when the user portrait to be intervened is a new user portrait, adding the new user portrait to a new user portrait label set, and setting the label of the new user portrait to an illegal value; when generating a virtual test user corresponding to the new user portrait, merging the new user portrait label set with the test case in the test case list, if the new user portrait label set and the test case list have the same user portrait name, then in the user information corresponding to the virtual test user, the user portrait value corresponding to the user portrait name is set to the user portrait value corresponding to the user portrait name in the test case list; calling the user portrait intervention interface, and writing the user information corresponding to the virtual test users into the database in batches to achieve unified intervention in user portraits.
[0254] Among them, the new user portrait is the user portrait of the user group that has newly registered or newly joined the recommendation strategy platform. The new user portrait label set is used to store the new user portrait. The label of each new user portrait in the new user portrait label set is an illegal value, and an illegal value indicates that the sub-strategy is not hit.
[0255] Compared with the existing solution that uses the new user portrait in the sub-strategy, the newly created test user will be assumed to hit the new user portrait, resulting in interference results of the new user portrait in the recommendation results. This application sets the label of the new user portrait to an illegal value. When the same user portrait name exists in the new user portrait label set and the test case list, the user information uses the user portrait value in the test case list. This can intervene in advance for labels that do not hit the new user portrait. The final recommendation result only includes the relevant user portrait results in the test case, and there will be no interference results of the new user portrait.
[0256] Step S205: Access the recommendation strategy platform to obtain recommendation results.
[0257] Among them, the recommendation strategy platform also includes a user portrait label interface, which is used to read the user portrait value after intervention from the database. The recommendation results include the materials included in the sub-strategy hit by the virtual test user.
[0258] In an embodiment of the present application, step S205 includes: sending the number of any virtual test user to the recommendation strategy platform, so that the recommendation strategy platform reads the user portrait name and user portrait value from the database based on the number to generate a corresponding recommendation result.
[0259] Specifically, the mini program is simulated to access the interface of the recommendation strategy platform, and the number of any virtual test user is sent to the recommendation strategy platform through the interface, so that the recommendation strategy platform queries the database with the number as the keyword, reads the hit user portrait name and user portrait value, determines the materials included in the hit sub-strategy according to the user portrait value, and generates the corresponding recommendation result.
[0260] In some embodiments, step S205 includes: sending the number and user portrait name of any virtual test user to the recommendation strategy platform, so that the recommendation strategy platform uses the number and user portrait name as keywords to query the database, read the hit user portrait value, and generate a corresponding recommendation result.
[0261] Compared with the existing solution of using real test users to access the recommendation strategy platform, when the real test users were intervened with user portraits that are not related to the current test case in historical tests, it is easy to cause deviations in the recommendation results of this test. The present application writes the user information corresponding to the virtual test users into a database in batches, and sends the number of any virtual test user to the recommendation strategy platform, so that the recommendation strategy platform reads the user portrait name and user portrait value from the database based on the number, and generates the corresponding recommendation results. This can reduce the situation where the test users are intervened with user portraits that are not related to the current test case, and improve the accuracy of the recommendation results.
[0262] Step S206: Verify the recommendation result to determine whether the recommendation strategy platform executes the corresponding test case normally.
[0263] Specifically, the recommendation results are verified to determine whether the recommendation strategy platform executes the corresponding test cases normally. When the recommendation strategy platform executes the test cases normally, it is determined that the recommendation strategy platform can correctly execute the recommended strategy. When the recommendation strategy platform executes the test cases abnormally, it is determined that the function of the recommendation strategy platform is abnormal, that is, the recommended strategy is executed incorrectly.
[0264] In an embodiment of the present application, the scenario strategy information also includes the weight value of each parent strategy contained in the workflow and the weight value of the sub-strategy contained in each parent strategy. Before verifying the recommendation results, the method also includes: calculating the global weight value corresponding to each parent strategy and the global weight value corresponding to each sub-strategy. Among them, the global weight value is used to determine the arrangement order of the sub-strategies in the recommendation results to determine whether the arrangement order of the sub-strategies meets expectations, that is, whether the weight values of the sub-strategies are satisfied in descending order.
[0265] Specifically, the global weight value corresponding to each parent policy is the weight value of the parent policy in the scenario policy information, and the global weight value corresponding to each parent policy is stored in the parent policy global weight value sequence. In the parent policy global weight value sequence, the global weight values corresponding to the parent policies are arranged in descending order.
[0266] The step of calculating the global weight value corresponding to each sub-strategy includes steps S3 to S6:
[0267] Step S3: Select a parent policy, determine the maximum weight value among the sub-policies contained in the parent policy, and add one to the number of digits of the maximum weight value as the number of digits of the parent policy weight coefficient. The maximum weight value is the maximum value among the weight values of the sub-policies.
[0268] Specifically, select a parent policy, calculate the number of digits of the maximum weight value through the l en(str(max(weight value of the child policy))) function, and add one to the number of digits of the maximum weight value as the number of digits of the parent policy weight coefficient. Among them, the max function means finding the maximum value among the weight values of several child policies, the str function means converting the maximum value returned by the max function into a string type, and the l en function is used to obtain the length of the string.
[0269] For example: the maximum weight value is 99, the number of digits in the maximum weight value is 2, and the number of digits in the parent policy weight coefficient is 3.
[0270] Step S4: Determine the parent strategy weight coefficient based on the number of bits.
[0271] Specifically, the parent policy weight coefficient consists of a first value and several second values, wherein the number of the second values is equal to the number of bits of the parent policy weight coefficient. Exemplarily, the first value is 1 and the second value is 0.
[0272] For example, the parent policy weight coefficient is calculated by the int (first value + second value * number of digits of the parent policy weight coefficient) function. The int function converts the input data into an integer by adding a number of second values after the first value. For example, when the first value is 1, the second value is 0, and the number of digits of the parent policy weight coefficient is 3, the parent policy weight coefficient is 1000.
[0273] Step S5: Multiply the weight value of the parent policy by the parent policy weight coefficient to obtain a first multiplication result.
[0274] The first multiplication result is the product of the weight value of the parent strategy and the weight coefficient of the parent strategy.
[0275] Step S6: Add the first multiplication result to the weight value of each sub-strategy included in the parent strategy to obtain a global weight value corresponding to each sub-strategy.
[0276] Specifically, the first multiplication result is added to the weight value of each sub-strategy contained in the parent strategy in the scenario strategy information to obtain the global weight value corresponding to each sub-strategy, and the global weight value corresponding to each sub-strategy is stored in the sub-strategy global weight value sequence. In the sub-strategy global weight value sequence, the global weight values corresponding to the sub-strategies are arranged in descending order.
[0277] In an embodiment of the present application, by multiplying the weight value of the parent policy by the parent policy weight coefficient, a first multiplication result is obtained, and the first multiplication result is added to the weight value of each sub-policy included in the parent policy to obtain a global weight value corresponding to each sub-policy. The present application can ensure that the weight value of the parent policy and the weight value of the sub-policy do not interfere with each other, and the two are superimposed and calculated at different positions, so that the global weight value corresponding to each sub-policy is globally unique.
[0278] Before verifying the recommendation results, the method also includes: based on the query language, reading the candidate material list and candidate material information from the sub-strategy. The query language is used to parse the data format of the sub-strategy contained in the scenario strategy information, for example: the query language is the jsonpath language, which is a query language used to parse the JSON data format. The candidate material list includes the material serial number and weight value corresponding to each material. In the candidate material list, the material serial number is arranged in descending order according to the weight value corresponding to each material, and the material serial number is the arrangement serial number of the material in the candidate material list. The candidate material information includes a first material number and a first configuration number. Each material corresponds to a first material number and a first configuration number. The first material number is the number of the material in the recommendation strategy platform, and the first configuration number is the number of a specific configuration or variant of the material in the recommendation strategy platform.
[0279] Specifically, based on the query language, the candidate material lists under the sub-strategies included in the scenario strategy information are filtered out, and the first material number and the first configuration number of each material corresponding to the candidate material list are obtained.
[0280] See also Figure 7 , Figure 7 yes Figure 2Detailed flowchart of step S206 in FIG.
[0281] like Figure 7 As shown, step S206 includes:
[0282] Step S261: Obtain recommendation results.
[0283] Specifically, the recommendation result also includes a sub-strategy number sequence and the number of materials included in each sub-strategy. The sub-strategy number sequence includes the sub-strategies hit by the virtual test user, and the number of materials is the number of materials included in a sub-strategy.
[0284] Step S262: Determine whether the sub-strategy number sequence includes the sub-strategy to be tested.
[0285] Specifically, the sub-strategy to be tested is the sub-strategy corresponding to the test case in the test case list. If the sub-strategy number sequence includes the sub-strategy to be tested, then proceed to step S263; if the sub-strategy number sequence does not include the sub-strategy to be tested, then proceed to step S268.
[0286] Step S263: Determine whether the arrangement order of several sub-strategies in the sub-strategy number sequence satisfies the first condition.
[0287] Specifically, when the sub-policy number sequence includes the sub-policy to be tested, it is determined whether the arrangement order of several sub-policies in the sub-policy number sequence meets the first condition. The first condition includes that the global weight value corresponding to each sub-policy is greater than or equal to the global weight value corresponding to the next sub-policy.
[0288] Specifically, starting from the 0th sub-strategy in the sub-strategy numbering sequence, execute steps S11 to S13 for each sub-strategy in sequence. Step S11: For the i-th sub-strategy, read the global weight values of the i-th sub-strategy and the i+1-th sub-strategy from the sub-strategy global weight value sequence, and determine whether the global weight value of the i-th sub-strategy is greater than or equal to the global weight value of the i+1-th sub-strategy. Wherein, i≥0, and i is less than the first quantity threshold, and the first quantity threshold is the number of sub-strategies in the sub-strategy numbering sequence minus two. If the global weight value of the i-th sub-strategy is greater than or equal to the global weight value of the i+1-th sub-strategy, proceed to step S12; if the global weight value of the i-th sub-strategy is less than the global weight value of the i+1-th sub-strategy, it is determined that the arrangement order of several sub-strategies in the sub-strategy numbering sequence does not meet the first condition.
[0289] Step S12: assign the value of i+1 to i to update i. Specifically, if the global weight value of the i-th sub-strategy is greater than or equal to the global weight value of the i+1-th sub-strategy, assign the value of i+1 to i to update i.
[0290] Step S13: Determine whether i is less than a first quantity threshold. If i is less than the first quantity threshold, return to step S11 to continue to execute steps S11 to S13 for the following sub-strategies until i is equal to the first quantity threshold. If i is equal to the first quantity threshold, determine that the arrangement order of the sub-strategies in the sub-strategy number sequence meets the first condition.
[0291] Furthermore, if the arrangement order of several sub-policies in the sub-policy number sequence meets the first condition, the process proceeds to step S264; if the arrangement order of the sub-policies does not meet the first condition, the process proceeds to step S268.
[0292] Step S264: Determine whether the material quantity is within the material range.
[0293] Specifically, when the arrangement order of the sub-strategies meets the first condition, it is determined whether the material quantity is within the material interval. The material interval includes a scene material interval or a sub-strategy material interval. A recommended scene corresponds to a scene material interval, and the scene material interval is the quantity range of the total number of preset materials corresponding to the recommended scene, and the total number of preset materials is the sum of the quantities of all materials contained in a recommended scene. A sub-strategy corresponds to a sub-strategy material interval, and the sub-strategy material interval is the quantity range of the preset number of materials corresponding to the sub-strategy, and the preset number of materials is the sum of the quantities of all materials contained in a sub-strategy.
[0294] See also Figure 8 , Figure 8 yes Figure 7 A detailed flowchart of step S264 in FIG.
[0295] like Figure 8 As shown, step S264 includes:
[0296] Step S2641: Calculate the sum of the material quantities to obtain the total number of materials.
[0297] Specifically, the number of materials included in each sub-strategy is added together to obtain the total number of materials. The total number of materials is the sum of the number of materials included in all sub-strategies in the recommendation results.
[0298] Step S2642: Determine whether the total number of materials is within the scene material range.
[0299] Specifically, if the total number of materials is within the scene material interval, proceed to step S2643; if the total number of materials is outside the scene material interval, proceed to step 2645.
[0300] Step S2643: Determine whether the material quantity included in each sub-strategy is within the corresponding sub-strategy material range.
[0301] Specifically, if the total number of materials is within the scene material interval, it is determined whether the number of materials included in each sub-strategy is within the corresponding sub-strategy material interval. If the number of materials included in each sub-strategy is within the corresponding sub-strategy material interval, the process proceeds to step S2644; if the number of materials included in any sub-strategy is outside the corresponding sub-strategy material interval, the process proceeds to step 2645.
[0302] Step S2644: Determine whether the material quantity is within the material range.
[0303] Specifically, if the material quantity included in each sub-strategy is within the corresponding sub-strategy material interval, it is determined that the material quantity is within the material interval.
[0304] Step S2645: Determine that the material quantity is outside the material range.
[0305] Specifically, if the total number of materials is outside the scene material interval, then the material quantity is determined to be outside the material interval. Alternatively, if the material quantity included in any sub-strategy is outside the corresponding sub-strategy material interval, then the material quantity is determined to be outside the material interval.
[0306] Further, if the material quantity is within the material interval, the process proceeds to step S265; if the material quantity is outside the material interval, the process proceeds to step S268.
[0307] Step S265: Determine whether the arrangement order of the materials included in each sub-strategy satisfies the second condition.
[0308] Specifically, when the material quantity is within the material interval, it is determined whether the arrangement order of the materials included in each sub-strategy meets the second condition. The second condition includes: the weight value corresponding to each material is greater than or equal to the weight value corresponding to the next material, and the arrangement sequence number of each material in the recommendation result is the same as the material sequence number of the material in the candidate material list.
[0309] If the arrangement order of the materials included in each sub-strategy meets the second condition, proceed to step S266; if the arrangement order of the materials included in any sub-strategy does not meet the second condition, proceed to step S268.
[0310] Step S266: Determine whether the material information of each material is the same as the corresponding candidate material information.
[0311] Among them, the recommendation result also includes the material information contained in each sub-strategy, and the material information includes a second material number and a second configuration number. The second material number is the number of the material in the recommendation result on the recommendation strategy platform, and the second configuration number is the number of a specific configuration or variant of the material in the recommendation result on the recommendation strategy platform.
[0312] Specifically, it is determined whether the second material number of each material is the same as the first material number corresponding to the material, and whether the second configuration number of the material is the same as the first configuration number corresponding to the material.
[0313] If the second material number of each material is the same as the first material number corresponding to the material, and the second configuration number of the material is the same as the first configuration number corresponding to the material, then the material information of each material is the same as the corresponding candidate material information, and the process goes to step S267; if the second material number of each material is different from the first material number corresponding to the material, or the second configuration number of the material is different from the first configuration number corresponding to the material, then the material information of the material is the same as the corresponding candidate material information, and the process goes to step S268.
[0314] In the embodiment of the present application, the specific process of executing step S265 and step S266 for each material included in the sub-strategy includes step S14-step S20:
[0315] Step S14: For material No. j, read the weight values of material No. j and material No. j+1 from the candidate material list, and determine whether the weight value of material No. j is greater than or equal to the weight value of material No. j+1. Wherein, j≥0, and j is less than the second quantity threshold, and the second quantity threshold is the number of materials included in a sub-strategy minus two. If the weight value of material No. j is greater than or equal to the weight value of material No. j+1, proceed to step S15; if the weight value of material No. j is less than the weight value of material No. j+1, it is determined that the arrangement order of the materials included in the sub-strategy does not meet the second condition.
[0316] Step S15: Determine whether the jth material is the material with material number j in the candidate material list. That is, determine whether the arrangement number of the material in the recommendation result is the same as the material number of the material in the candidate material list. If the jth material is the material with material number j in the candidate material list, proceed to step S16; if the jth material is not the material with material number j in the candidate material list, it is determined that the arrangement order of the materials included in the sub-strategy does not meet the second condition.
[0317] Step S16: Determine whether the material information of the jth material is the same as the corresponding candidate material information. If the material information of the jth material is the same as the corresponding candidate material information, proceed to step S17; if the material information of the jth material is different from the corresponding candidate material information, proceed to step S268.
[0318] Step S17: Assign the value of j+1 to j to update j.
[0319] Step S18: Determine whether j is less than the second quantity threshold. If j is less than the second quantity threshold, return to step S14 to continue to perform steps S14-S20 for the following materials until j is equal to the second quantity threshold. If j is equal to the second quantity threshold, enter step S19.
[0320] Step S19: Determine whether the material information of the j-1th material is the same as the corresponding candidate material information. If the material information of the j-1th material is the same as the corresponding candidate material information, proceed to step S20; if the material information of the j-1th material is different from the corresponding candidate material information, proceed to step S268.
[0321] Step S20: Determine whether the order of arrangement and the material information of each sub-strategy have been determined. If the order of arrangement and the material information of each sub-strategy have been determined, proceed to step S267.
[0322] Step S267: Determine whether the recommended strategy platform executes the test case normally.
[0323] Specifically, when the arrangement order of the materials included in each sub-strategy meets the second condition, and the material information of each material is the same as the corresponding candidate material information, it is determined that the recommendation strategy platform executes the test case normally.
[0324] Step S268: Determine the abnormal execution test case of the recommendation strategy platform.
[0325] Specifically, when the sub-strategy to be tested is not included in the sub-strategy number sequence, it is determined that the recommended strategy platform executes the test case abnormally.
[0326] Alternatively, when the arrangement order of the sub-strategies does not satisfy the first condition, it is determined that the recommended strategy platform executes the test case abnormally.
[0327] Alternatively, when the material quantity is outside the material range, determine that the recommended strategy platform executes the test case abnormally.
[0328] Alternatively, when the arrangement order of the materials included in any sub-strategy does not satisfy the second condition, it is determined that the recommendation strategy platform executes the test case abnormally.
[0329] Compared with the existing solutions that require obtaining the recommended interface response package in advance before testing and entering the recommended interface response package into the automated testing template, this application verifies the recommendation results based on the details of the recommended strategy of the recommendation strategy platform to determine whether the recommended strategy platform executes the corresponding test case normally, without the need to obtain the recommended interface response package in advance.
[0330] Compared with the existing solution, when the weights of recalled materials configured in the recommendation strategy platform are the same, the order of materials in the recommendation results is prone to change, that is, at different time points or under different user interaction situations, the position of the material in the recommendation list will change, which is easy to cause misjudgment when evaluating whether the recommendation results meet the expected goals. This application introduces more complex result judgment logic by judging whether the arrangement order of the sub-strategies meets the first condition, judging whether the material quantity is within the material range, judging whether the arrangement order of the materials included in each sub-strategy meets the second condition, and judging whether the material information of each material is the same as the corresponding candidate material information. This can improve the accuracy of determining whether the recommendation strategy platform executes test cases normally.
[0331] In an embodiment of the present application, by automatically generating test cases and automatically verifying the recommendation results, the present application can improve the testing efficiency, and when the product operation personnel adjust the recommendation strategy according to business needs to optimize the recommendation effect, it can cooperate with the test recommendation strategy platform to execute the function of the recommendation strategy, thereby improving the stability of the recommendation results generated by the unmodified recommendation strategy, and at the same time verifying whether the recommendation results generated by the modified recommendation strategy meet expectations.
[0332] In an embodiment of the present application, a testing method is provided, which is applied to a recommendation strategy platform, and the testing method includes: obtaining scenario strategy information, wherein the scenario strategy information includes at least one sub-strategy under the recommendation scenario, and the sub-strategy includes user portrait rule data; generating test cases based on the user portrait rule data, wherein each test case corresponds to at least one sub-strategy; based on the judgment expression corresponding to each sub-strategy, performing a hit judgment on each test case in turn to obtain a test case list, wherein the hit judgment is used to determine whether the test case hits the corresponding sub-strategy, and the test case list includes test cases that only hit the corresponding sub-strategy; generating a virtual test user based on the test case list, and writing the user information corresponding to the virtual test user into the recommendation strategy platform; accessing the recommendation strategy platform to obtain the recommendation result; and verifying the recommendation result to determine whether the recommendation strategy platform executes the corresponding test case normally.
[0333] On the one hand, by generating test cases based on user portrait rule data, and based on the judgment expression corresponding to each sub-strategy, hit judgment is performed on each test case in turn to obtain a test case list. The present application can generate test cases based on the sub-strategies in the recommendation scenario without the need for manual maintenance of test cases, and can obtain test cases that only hit the corresponding sub-strategies through hit judgment, thereby reducing the probability of interference information from other sub-strategies appearing in the recommendation results and improving test efficiency;
[0334] On the other hand, by generating virtual test users based on the test case list, writing the user information corresponding to the virtual test users into the recommendation strategy platform, accessing the recommendation strategy platform to obtain the recommendation results, and verifying the recommendation results, the present application can perform batch intervention on the user portraits stored in the recommendation strategy platform to improve execution efficiency, and can automatically verify the recommendation results to determine whether the test cases are executed normally, thereby improving testing efficiency.
[0335] See also Fig. 9 , Fig. 9 It is a structural schematic diagram of a testing device provided in an embodiment of the present application.
[0336] Among them, the testing device is applied to the recommendation strategy platform, and the testing device is configured in an electronic device.
[0337] like Fig. 9 As shown, the testing device 900 comprises:
[0338] Initialization module 901 is used to obtain scenario strategy information, wherein the scenario strategy information includes at least one sub-strategy under the recommendation scenario, and the sub-strategy includes user portrait rule data.
[0339] The use case generation module 902 is used to generate test cases based on user portrait rule data, wherein each test case corresponds to at least one sub-strategy.
[0340] The use case generation module 902 is also used to perform a hit judgment on each test case in turn based on the judgment expression corresponding to each sub-strategy to obtain a test case list, wherein the hit judgment is used to determine whether the test case hits the corresponding sub-strategy, and the test case list includes only test cases that hit the corresponding sub-strategy.
[0341] The execution module 903 is used to generate a virtual test user based on the test case list, and write the user information corresponding to the virtual test user into the recommendation strategy platform.
[0342] The execution module 903 is also used to access the recommendation strategy platform to obtain the recommendation results.
[0343] The verification module 904 is used to verify the recommendation result to determine whether the recommendation strategy platform executes the corresponding test case normally.
[0344] In some implementations of the present application, the initialization module 901 is further used to generate a one-to-one corresponding determination expression for each sub-strategy.
[0345] In some implementations of the present application, the initialization module 901 is further used to calculate a global weight value corresponding to each sub-strategy.
[0346] In some implementations of the present application, the initialization module 901 is further used to obtain a candidate material list and candidate material information.
[0347] It should be noted that the above-mentioned test device can execute the test method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the test device, please refer to the test method provided in the embodiment of the present application.
[0348] Please refer to Fig.10 , Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0349] like Fig.10 As shown, the electronic device 10 includes one or more processors 101 and a memory 102. Fig.10 A processor 101 is taken as an example.
[0350] The processor 101 and the memory 102 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.
[0351] The processor 101 is used to provide computing and control capabilities to control the electronic device 10 to perform corresponding tasks, for example, to control the electronic device 10 to perform the testing method in any of the above method embodiments.
[0352] On the one hand, by generating test cases based on user portrait rule data, and based on the judgment expression corresponding to each sub-strategy, hit judgment is performed on each test case in turn to obtain a test case list. The present application can generate test cases based on the sub-strategies in the recommendation scenario without the need for manual maintenance of test cases, and can obtain test cases that only hit the corresponding sub-strategies through hit judgment, thereby reducing the probability of interference information from other sub-strategies appearing in the recommendation results and improving test efficiency;
[0353] On the other hand, by generating virtual test users based on the test case list, writing the user information corresponding to the virtual test users into the recommendation strategy platform, accessing the recommendation strategy platform to obtain the recommendation results, and verifying the recommendation results, the present application can perform batch intervention on the user portraits stored in the recommendation strategy platform to improve execution efficiency, and can automatically verify the recommendation results to determine whether the test cases are executed normally, thereby improving testing efficiency.
[0354] The processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a general array logic (GAL) or any combination thereof.
[0355] The memory 102 is a non-transient computer-readable storage medium, which can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the test method in the embodiment of the present application. The processor 101 can implement the test method in any of the above method embodiments by running the non-transient software programs, instructions and modules stored in the memory 102. Specifically, the memory 102 may include a volatile memory (Volume Memory, VM), such as a random access memory (Random Access Memory, RAM); the memory 102 may also include a non-volatile memory (Non-Volume Memory, NVM), such as a read-only memory (Read-Only Memory, ROM), a flash memory (Flash memory), a hard disk (Hard Disk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD) or other non-transient solid-state storage devices; the memory 102 may also include a combination of the above-mentioned types of memory.
[0356] The memory 102 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 non-volatile solid-state storage device. In some embodiments, the memory 102 may optionally include a memory remotely arranged relative to the processor 101, and these remote memories may be connected to the processor 101 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0357] One or more modules are stored in the memory 102, and when executed by one or more processors 101, the test method in any of the above method embodiments is executed, for example, the test method described above is executed. Figure 2 The steps shown can also be implemented Fig. 9 The functions of each module or unit.
[0358] In the embodiment of the present application, the electronic device 10 may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The electronic device 10 may also include other components for realizing device functions, which will not be described in detail here.
[0359] The embodiment of the present application also provides a non-volatile computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the test method in the above embodiment. For example, the non-volatile computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CDROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0360] The present application also provides a computer program product, which includes one or more program codes, which are stored in a non-volatile computer-readable storage medium. The processor of the electronic device reads the program code from the non-volatile computer-readable storage medium, and the processor executes the program code to complete the method steps of the test method provided in the above embodiment.
[0361] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0362] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0363] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as mentioned above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A testing method, characterized in that: Applied to a recommendation strategy platform, the method comprises: Acquire scenario strategy information, wherein the scenario strategy information includes at least one sub-strategy under a recommendation scenario, and the sub-strategy includes user profile rule data; Generate test cases based on the user profile rule data, wherein each of the test cases corresponds to at least one sub-strategy; Based on the determination expression corresponding to each sub-strategy, hit determination is performed on each of the test cases in turn to obtain a test case list, wherein the hit determination is used to determine whether the test case hits the corresponding sub-strategy, and the test case list includes only test cases that hit the corresponding sub-strategy; Generate a virtual test user based on the test case list, and write user information corresponding to the virtual test user into the recommendation strategy platform; Access the recommendation strategy platform to obtain recommendation results; The recommendation result is verified to determine whether the recommendation strategy platform executes the corresponding test case normally.
2. The method according to claim 1, characterized in that The test case includes a first test case, the user portrait rule data includes at least one element, the element is a user portrait rule group or a single user portrait, and the element includes a user portrait name and a user portrait value; The generating of test cases based on the user portrait rule data includes: Combining elements representing a single user portrait in the user portrait rule data to obtain a user portrait rule group; Based on the operation type of each user portrait rule group, a one-to-one corresponding default use case is generated for each single user portrait included in the user portrait rule group; Perform a replacement operation on the default use case to generate a test set corresponding to each user portrait rule group; Based on the operation type of the first-layer element in the user portrait rule data, the default use case corresponding to each user portrait rule group is merged to generate a sub-strategy use case; A merge operation is performed on each of the test sets and the sub-strategy use cases to generate a test case set corresponding to the sub-strategy, wherein the test case set includes several first test cases, and the user portrait value corresponding to any user portrait name in the first test case is the same as the user portrait value corresponding to the user portrait name in the test set.
3. The method according to claim 2, characterized in that The default use case includes a first normal use case or an abnormal use case; The operation type based on each user portrait rule group generates a one-to-one corresponding default use case for each single user portrait included in the user portrait rule group, including: When the operation type of the user portrait rule group is and operation, any user portrait value included in the single user portrait is used as the value of the first normal use case corresponding to the single user portrait; The value of the abnormal use case corresponding to any of the single user portraits is set to an illegal value, and the values of the abnormal use cases corresponding to the remaining single user portraits are set to the values of the first normal use case corresponding to the single user portrait; When the operation type of the user portrait rule group is an OR operation, the values of the first normal use case and the abnormal use case corresponding to each single user portrait are set to illegal values.
4. The method according to claim 2, characterized in that: The default use case includes a first normal use case, and the test set includes a plurality of full use cases; The replacing operation on the default use case to generate a test set corresponding to each user portrait rule group includes: Based on at least one user portrait value included in each single user portrait, the value of the first normal use case corresponding to the single user portrait is replaced with the corresponding user portrait value in sequence to obtain at least one second normal use case; The second normal use cases corresponding to different single user portraits in a user portrait rule group are combined to obtain several full use cases corresponding to each user portrait rule group.
5. The method according to claim 2, characterized in that: The default use case includes a first normal use case or an abnormal use case; The operation type of the first layer element in the user portrait rule data is based on merging the default use cases corresponding to each user portrait rule group to generate a sub-strategy use case, including: When the operation type of the first-layer element is and operation, the first normal use case corresponding to each user portrait rule group is merged to generate a sub-strategy use case; When the operation type of the first-layer element is an OR operation, the abnormal use cases corresponding to each user portrait rule group are merged to generate a sub-strategy use case.
6. The method according to claim 2, characterized in that The test case includes a second test case, and the scenario strategy information further includes numbers of at least two sub-strategies; The generating of test cases based on the user portrait rule data also includes: Based on the number and preset number of each sub-strategy, calling the permutation function to generate a sub-strategy sequence set, wherein the preset number is the number of sub-strategies corresponding to the second test case; Traversing each element in the sub-strategy sequence set, when the user profile names contained in the several sub-strategies corresponding to the element are all different, selecting a first test case from the test case set corresponding to each sub-strategy to merge, so as to obtain a second test case, wherein each second test case corresponds to a preset number of sub-strategies; Alternatively, when the same user portrait name exists in several sub-strategies corresponding to the element, and the user portrait values corresponding to the same user portrait name are the same, a first test case is selected from the test case set corresponding to each sub-strategy and merged to obtain a second test case.
7. The method according to claim 1, characterized in that The user portrait rule data includes at least one element, the element is a user portrait rule group or a single user portrait, and the element includes a user portrait name and a user portrait value; Before performing hit determination on the test case, the method further includes: Traversing each element in the user portrait rule data, and generating an expression string corresponding to each element; Based on the operation type of the first-layer element in the user profile rule data, the expression character string is concatenated to obtain a determination expression corresponding to each sub-strategy; The traversing of each element in the user portrait rule data to generate an expression string corresponding to each element includes: When the element includes the first field, determining that the element is a user portrait rule group; Based on the user portrait group processing function, traverse each single user portrait included in the user portrait rule group to generate an expression string corresponding to each single user portrait; Based on the operation type of the user portrait rule group, concatenate the expression string corresponding to each single user portrait to obtain an expression string corresponding to the user portrait rule group; Alternatively, when the element does not include the first field, an expression string corresponding to the element is generated based on a single user portrait processing function.
8. The method according to claim 1, characterized in that: The scenario strategy information includes a workflow in a recommended scenario, and the workflow includes at least two sub-strategies; The determination expression corresponding to each sub-strategy is used to perform hit determination on each of the test cases in turn to obtain a test case list, including: Identify the test case currently being processed; Traversing each sub-strategy under the workflow, performing a determination operation on each sub-strategy to determine whether the test case currently being processed hits the first sub-strategy, wherein the first sub-strategy is any sub-strategy included in the workflow except the second sub-strategy, and the second sub-strategy is the sub-strategy corresponding to the test case currently being processed; When the currently processed test case does not hit the first sub-strategy, the test case is added to the test case list, and a hit determination is performed on the next test case until a hit determination is completed for each of the test cases; When the test case currently being processed hits the first sub-strategy, the number of the first sub-strategy is recorded in the conflict information, and a hit determination is performed on the next test case until a hit determination is completed for each of the test cases.
9. The method according to claim 8, characterized in that The performing of a determination operation on each sub-strategy to determine whether the currently processed test case hits the first sub-strategy includes: Determine the sub-strategy currently being processed, and when the number of the sub-strategy currently being processed is not included in the first array, set the evaluation expression to the determination expression corresponding to the sub-strategy, and set the feature sequence to the user tag name sequence included in the sub-strategy; When the evaluation expression contains a valid value and the feature sequence contains a valid value, determining whether the currently processed test case and the feature sequence have the same user tag name; When the test case currently being processed has the same user tag name as the feature sequence, the character string corresponding to the user tag name in the evaluation expression is replaced with the user portrait value corresponding to the same user tag name in the test case to update the evaluation expression; Evaluate the updated evaluation expression, and when the evaluation result is false and the sub-strategy currently being processed is the last sub-strategy under the workflow, determine that the test case currently being processed does not hit the first sub-strategy; Among them, the first array includes the number of the sub-strategy corresponding to each test case, the user tag name sequence includes several user tag names, and the user tag name includes a user portrait name and a user portrait value.
10. The method according to claim 9, characterized in that The performing of a determination operation on each sub-strategy to determine whether the currently processed test case hits the first sub-strategy also includes: When the number of the sub-strategy is included in the first array, a determination operation is performed on the next sub-strategy; Alternatively, when the user tag name included in the currently processed test case is different from the user tag name included in the feature sequence, a determination operation is performed on the next sub-strategy; Alternatively, when the evaluation result is true, it is determined that the test case currently being processed hits the first sub-strategy.
11. The method according to claim 1, characterized in that The recommendation strategy platform includes a database; The generating a virtual test user based on the test case list and writing user information corresponding to the virtual test user into the recommendation strategy platform includes: Taking each test case in the test case list as a user profile to be intervened; Generate a one-to-one corresponding virtual test user for each of the user portraits to be intervened; Writing user information corresponding to each of the virtual test users into the database, wherein the user information includes the number of the virtual test user, the user portrait name and the user portrait value of the user portrait to be intervened corresponding to the virtual test user; The accessing the recommendation strategy platform to obtain the recommendation result includes: The number of any virtual test user is sent to the recommendation strategy platform, so that the recommendation strategy platform reads the user portrait name and the user portrait value from the database based on the number to generate a corresponding recommendation result.
12. The method according to claim 1, characterized in that The recommendation result includes the sub-strategy number sequence and the quantity of materials included in each sub-strategy; The verifying of the recommendation result to determine whether the recommendation strategy platform executes the corresponding test case normally includes: When the sub-strategy to be tested is not included in the sub-strategy number sequence, determining that the recommended strategy platform abnormally executes the test case, wherein the sub-strategy to be tested is a sub-strategy corresponding to the test case in the test case list; When the sub-strategy number sequence includes the sub-strategy to be tested, determining whether the arrangement order of several sub-strategies in the sub-strategy number sequence meets the first condition; When the arrangement order of the sub-strategies does not satisfy the first condition, determining that the recommended strategy platform executes the test case abnormally; When the arrangement order of the sub-strategies meets the first condition, determining whether the material quantity is within the material interval; When the quantity of the material is outside the material range, determining that the recommendation strategy platform abnormally executes the test case; The first condition includes that the global weight value corresponding to each sub-strategy is greater than or equal to the global weight value corresponding to the next sub-strategy.
13. The method according to claim 12, characterized in that The material interval includes a scenario material interval or a sub-strategy material interval; The determining whether the material quantity is within the material range includes: Calculate the sum of the quantities of the materials to obtain the total number of materials; Determine whether the total number of materials is within the scene material interval, wherein the scene material interval is a quantity range of a preset total number of materials corresponding to the recommended scene; If the total number of materials is outside the scene material interval, determining that the number of materials is outside the material interval; If the total number of materials is within the scene material interval, determine whether the number of materials included in each sub-strategy is within the corresponding sub-strategy material interval, wherein the sub-strategy material interval is a quantity range of preset material quantities corresponding to the sub-strategy; If the material quantity included in each sub-strategy is within the corresponding sub-strategy material interval, then it is determined that the material quantity is within the material interval; If the material quantity included in any sub-strategy is outside the corresponding sub-strategy material interval, it is determined that the material quantity is outside the material interval.
14. The method according to claim 12, characterized in that The scenario strategy information also includes the weight value of each parent strategy included in the workflow and the weight value of the child strategy included in each parent strategy; Before verifying the recommendation result, the method further includes: Select a parent policy, determine the maximum weight value among the multiple sub-policies contained in the parent policy, and add one to the number of digits of the maximum weight value as the number of digits of the parent policy weight coefficient, wherein the maximum weight value is the maximum value among the weight values of the multiple sub-policies; Determining a parent policy weight coefficient based on the number of bits; Multiplying the weight value of the parent policy by the weight coefficient of the parent policy to obtain a first multiplication result; The first multiplication result is added to the weight value of each sub-strategy included in the parent strategy to obtain a global weight value corresponding to each sub-strategy.
15. The method according to claim 12, characterized in that The recommendation result also includes material information included in each sub-strategy; The verifying of the recommendation result to determine whether the recommendation strategy platform executes the corresponding test case normally also includes: When the material quantity is within the material interval, determining whether the arrangement order of the materials included in each sub-strategy satisfies the second condition; When the arrangement order of the materials included in any sub-strategy does not satisfy the second condition, determining that the recommendation strategy platform executes the test case abnormally; When the arrangement order of the materials included in each sub-strategy satisfies the second condition, and the material information of each material is the same as the corresponding candidate material information, it is determined that the recommendation strategy platform executes the test case normally; The second condition includes: the weight value corresponding to each material is greater than or equal to the weight value corresponding to the next material, and the sequence number of each material in the recommendation result is the same as the material sequence number of the material in the candidate material list; Before verifying the recommendation result, the method further includes: Based on the query language, read the candidate material list and candidate material information from the sub-strategy; The candidate material list includes a material serial number and a weight value corresponding to each material. In the candidate material list, the material serial numbers are arranged in descending order according to the weight value corresponding to each material.
16. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor, wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 15.