A product selection method, device, equipment and medium
By pre-verifying the combination of selected and unselected products during the product selection process, the problem of repeated execution of constraint rules and data rollback is solved, the efficiency and accuracy of product selection are improved, and resource consumption and response are reduced time.
Patent Information
- Application Number
- CN202410933006.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-07-12
AI Technical Summary
During the product selection process, constraint rules carried by historically selected products may lead to repeated execution of constraint rules and data rollback, resulting in inefficiency, waste of resources, and delayed response time.
After the product selection is completed, the pre-selected product combinations of selected and unselected products are determined, the set of constraint rules is pre-verified, the pre-verification results are generated, and the pre-verification results are processed when the user selects to avoid Constraint rules conflict, directly execute or refuse to execute the rules.
It improves product selection efficiency, reduces rule verification and execution time, reduces resource consumption and response delays, and ensures the comprehensiveness and accuracy of rule verification.
Smart Images

Figure CN118467798B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a product selection method, device, equipment and medium. Background Art
[0002] When selecting products, there are usually relationships between products that allow them to be compatible for assembly or not, and there may be linkages or conflicts between the constraints brought about by these different relationships.
[0003] After a user makes a selection, most of the time, the selection status of all products before this selection will be copied first, and then all the constraint rules associated with the currently selected product will be loaded, and each constraint rule will be executed one by one. If the constraint rules carried by the historically selected product have been executed, it may cause the constraint rules to be executed repeatedly during the current rule execution process. In addition, when executing one of the constraint rules, if it is found that there is a contradiction with the previously executed constraint rule, it is necessary to roll back the data based on the pre-copied product selection status, and restore all products to the product selection status before this selection, resulting in low product selection efficiency. In addition, since data must be copied for each selection, data rollback must be performed each time the execution fails, resulting in a large waste of resources and delayed response time. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a product selection method, device, equipment and medium.
[0005] The present disclosure provides a product selection method, the method comprising:
[0006] In response to the completion of product selection, determining selected products carrying constraint rules and unselected products carrying constraint rules from a plurality of preset products;
[0007] For each of the unselected products, the unselected products are combined with the selected products to obtain a pre-selected product combination; and for each pre-selected product combination, a plurality of constraint rules carried by each pre-selected product in the pre-selected product combination are combined to obtain a constraint rule set; the constraint rules are used to indicate an association relationship between the pre-selected product and other products, and the association relationship includes a dependency relationship and / or a mutually exclusive relationship;
[0008] Pre-verify the constraint rule set to determine whether there is a conflict between the dependency relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set, and generate a pre-verification result for the pre-selected product combination; the pre-verification result includes a pre-verification failure result and a rule pre-execution result; if any constraint rule in the constraint rule set conflicts with other constraint rules, the pre-verification failure result is generated; if all constraint rules in the constraint rule set do not conflict, the rule pre-execution result is generated;
[0009] In response to a selection operation of the user, a target product carrying a constraint rule is determined from a plurality of preset products, wherein the target product includes the product selected in the current selection operation and the product selected in the historical selection operation;
[0010] In the case where the target product matches any of the pre-selected product combinations, execution is performed according to the pre-verification result of the target pre-selected product combination that matches the target product; in the case where the pre-verification result includes the pre-verification failure result, the pre-verification failure result is fed back to the user, and any constraint rule is refused to be executed; in the case where the pre-verification result includes the rule pre-execution result, product selection for this selection operation is performed according to the rule pre-execution result, and the product selection result is fed back to the user.
[0011] In an optional implementation manner, when the constraint rule indicates that the association relationship between the pre-selected product and other products is the dependent relationship, the other products associated with the pre-selected product are dependent products; when the constraint rule indicates that the association relationship between the pre-selected product and other products is the mutually exclusive relationship, the other products associated with the pre-selected product are mutually exclusive products;
[0012] The pre-checking of the constraint rule set, determining whether the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set conflict with each other, and generating a pre-checking result for the pre-selected product combination, includes:
[0013] Determine, in the constraint rule set, a first constraint rule indicating a dependency relationship and a second constraint rule indicating a mutually exclusive relationship;
[0014] Combining the dependent products corresponding to the first constraint rule to obtain various dependent product combinations, and combining the mutually exclusive products corresponding to the second constraint rule to obtain various mutually exclusive product combinations;
[0015] In the case that there are no identical products between the dependent product combination and the mutually exclusive product combination, determining that the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set do not conflict with each other, and generating the rule pre-execution result;
[0016] In the case that the same product exists between the dependent product combination and the mutually exclusive product combination, a conflict between the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set is determined, and the pre-check failure result is generated.
[0017] In an optional implementation manner, generating the rule pre-execution result includes:
[0018] Based on the constraint rule set and the historical execution rule set, at least one target constraint rule is screened out from the constraint rule set; the historical execution rules in the historical execution rule set are constraint rules that have been executed before the next selection operation, and the target constraint rule refers to a constraint rule that has not been executed before the next selection operation and corresponds to the next selection operation;
[0019] The rule pre-execution result is generated according to the at least one target constraint rule.
[0020] In an optional implementation manner, generating the rule pre-execution result according to the at least one target constraint rule includes:
[0021] For each target constraint rule, according to the dependency relationship indicated by the target constraint rule, determine that the dependent product corresponding to the target constraint rule is selected, or, according to the mutually exclusive relationship indicated by the target constraint rule, determine that the mutually exclusive product corresponding to the target constraint rule is prohibited from selection;
[0022] The rule pre-execution result is determined based on the selected dependent products and the disabled mutually exclusive products.
[0023] In an optional implementation manner, after performing product matching for this selection operation according to the rule pre-execution result, the method further includes:
[0024] The target constraint rule is added to the historical execution rule set.
[0025] In an optional implementation manner, the method further includes:
[0026] In the case where the product characteristic of the pre-selected product indicates that the pre-selected product does not co-exist with the dependent product corresponding to the target constraint rule, the dependent product is not selected.
[0027] In an optional implementation manner, the method further includes:
[0028] In the case where a dependent product corresponding to a constraint rule in the constraint rule set carries a constraint rule, the dependent product is used as the pre-selected product to redefine the constraint rule set.
[0029] In an optional implementation manner, generating the pre-verification failure result includes:
[0030] Determine conflicting products in the constraint rule set and constraint rules associated with the conflicting products, wherein the conflicting products are other products that have the dependency relationship with the first pre-selected product in the constraint rule set and the mutually exclusive relationship with the second pre-selected product in the constraint rule set;
[0031] The pre-verification failure result is determined based on the conflicting product and the constraint rules associated with the conflicting product.
[0032] In an optional implementation manner, the feeding back the pre-verification failure result to the user includes:
[0033] A verification failure interface is displayed, wherein the verification failure interface displays the conflicting product, the constraint rules associated with the conflicting product, and prompt information, wherein the prompt information is used to prompt the user to reselect the target product.
[0034] In an optional implementation manner, the feeding back the product selection result to the user includes:
[0035] An execution result interface is displayed, wherein the execution result interface displays the products selected and the products prohibited in this selection operation.
[0036] The present disclosure also provides a product selection device, the device comprising:
[0037] A product determination module, configured to determine, in response to the completion of product selection, selected products carrying constraint rules and unselected products carrying constraint rules from a plurality of preset products;
[0038] A rule combination module is used to combine the unselected product with the selected product for each of the unselected products to obtain a pre-selected product combination; and for each pre-selected product combination, combine multiple constraint rules carried by each pre-selected product in the pre-selected product combination to obtain a constraint rule set; the constraint rule is used to indicate the association relationship between the pre-selected product and other products, and the association relationship includes a dependency relationship and / or a mutually exclusive relationship;
[0039] A rule pre-verification module is used to pre-verify the constraint rule set, determine whether there is a conflict between the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set, and generate a pre-verification result for the pre-selected product combination; the pre-verification result includes a pre-verification failure result and a rule pre-execution result; if any constraint rule in the constraint rule set conflicts with other constraint rules, the pre-verification failure result is generated; if all constraint rules in the constraint rule set do not conflict, the rule pre-execution result is generated;
[0040] A product selection module, configured to determine, in response to a user's selection operation, a target product carrying a constraint rule from a plurality of preset products, wherein the target product includes the product selected in the current selection operation and the product selected in the historical selection operation;
[0041] A result feedback module is used to execute according to the pre-verification result of the target pre-selected product combination matching the target product when the target product matches any of the pre-selected product combinations; to feedback the pre-verification failure result to the user and refuse to execute any constraint rule when the pre-verification result includes the pre-verification failure result; and to perform product selection for this selection operation according to the pre-rule execution result when the pre-verification result includes the rule pre-execution result, and to feedback the product selection result to the user.
[0042] In an optional implementation manner, when the constraint rule indicates that the association relationship between the pre-selected product and other products is the dependent relationship, the other products associated with the pre-selected product are dependent products; when the constraint rule indicates that the association relationship between the pre-selected product and other products is the mutually exclusive relationship, the other products associated with the pre-selected product are mutually exclusive products;
[0043] The rule pre-checking module is specifically used for:
[0044] Determine, in the constraint rule set, a first constraint rule indicating a dependency relationship and a second constraint rule indicating a mutually exclusive relationship;
[0045] Combining the dependent products corresponding to the first constraint rule to obtain various dependent product combinations, and combining the mutually exclusive products corresponding to the second constraint rule to obtain various mutually exclusive product combinations;
[0046] In the case that there are no identical products between the dependent product combination and the mutually exclusive product combination, determining that the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set do not conflict with each other, and generating the rule pre-execution result;
[0047] In the case that the same product exists between the dependent product combination and the mutually exclusive product combination, a conflict between the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set is determined, and the pre-check failure result is generated.
[0048] In an optional implementation manner, the rule pre-verification module, when used to generate the rule pre-execution result, is specifically used to:
[0049] Based on the constraint rule set and the historical execution rule set, at least one target constraint rule is screened out from the constraint rule set; the historical execution rules in the historical execution rule set are constraint rules that have been executed before the next selection operation, and the target constraint rule refers to a constraint rule that has not been executed before the next selection operation and corresponds to the next selection operation;
[0050] The rule pre-execution result is generated according to the at least one target constraint rule.
[0051] In an optional implementation manner, when the rule pre-verification module is used to generate the rule pre-execution result according to the at least one target constraint rule, it is specifically used to:
[0052] For each target constraint rule, according to the dependency relationship indicated by the target constraint rule, determine that the dependent product corresponding to the target constraint rule is selected, or, according to the mutually exclusive relationship indicated by the target constraint rule, determine that the mutually exclusive product corresponding to the target constraint rule is prohibited from selection;
[0053] The rule pre-execution result is determined based on the selected dependent products and the disabled mutually exclusive products.
[0054] In an optional implementation manner, the result feedback module is further used to:
[0055] The target constraint rule is added to the historical execution rule set.
[0056] In an optional implementation manner, the rule pre-checking module is further used to:
[0057] In the case where the product characteristic of the pre-selected product indicates that the pre-selected product does not co-exist with the dependent product corresponding to the target constraint rule, the dependent product is not selected.
[0058] In an optional implementation manner, the rule combination module is further used to:
[0059] In the case where a dependent product corresponding to a constraint rule in the constraint rule set carries a constraint rule, the dependent product is used as the pre-selected product to redefine the constraint rule set.
[0060] In an optional implementation manner, the rule pre-verification module, when used to generate the pre-verification failure result, is specifically used to:
[0061] Determine conflicting products in the constraint rule set and constraint rules associated with the conflicting products, wherein the conflicting products are other products that have the dependency relationship with the first target product in the constraint rule set and the mutually exclusive relationship with the second target product in the constraint rule set;
[0062] The pre-verification failure result is determined based on the conflicting product and the constraint rules associated with the conflicting product.
[0063] In an optional implementation manner, when the result feedback module is used to feed back the pre-verification failure result to the user, it is specifically used to:
[0064] A verification failure interface is displayed, wherein the verification failure interface displays the conflicting product, the constraint rules associated with the conflicting product, and prompt information, wherein the prompt information is used to prompt the user to reselect the target product.
[0065] In an optional implementation manner, when the result feedback module is used to feed back the product selection result to the user, it is specifically used to:
[0066] An execution result interface is displayed, wherein the execution result interface displays the products selected and the products prohibited in this selection operation.
[0067] An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps in any possible implementation of the above-mentioned product selection method are performed.
[0068] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in any possible implementation of the above-mentioned product selection method are executed.
[0069] The product selection method, device, equipment and medium provided by the embodiments of the present disclosure determine the selected products with constraint rules and the unselected products with constraint rules after each product selection is completed; combine the unselected products with the selected products to obtain a pre-selected product combination; for each pre-selected product combination, based on multiple constraint rules carried by each pre-selected product, construct a constraint rule set; pre-check the constraint rule set to determine whether there is a conflict between the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set, and generate a pre-check result for the pre-selected product combination. When any constraint rule in the constraint rule set conflicts with other constraint rules, a pre-verification failure result is generated. When all constraint rules in the constraint rule set do not conflict, a rule pre-execution result is generated. After the user makes a selection, for the currently selected target product with constraint rules, when the target product matches any pre-selected combination, execution is performed according to the pre-verification result of the target pre-selected product combination that matches the target product. Feedback the pre-verification failure result to the user and refuse to execute any constraint rule. Alternatively, according to the rule pre-execution result, perform product matching for this selection operation and feedback the product matching result to the user.
[0070] In this way, after the product selection is completed, the pre-selected product combination will be determined according to the selected products and the unselected products, and the constraint rule set will be pre-checked to obtain the pre-check result. That is, before the user makes a selection, the products that the user may select are pre-checked, so that after the user makes a selection operation, the corresponding processing can be directly performed according to the pre-check result. When the pre-check fails (any constraint rule in the constraint rule set conflicts with other constraint rules), no constraint rule will be executed. When the check passes (that is, all constraint rules in the constraint rule set do not conflict), the product selection of this selection operation will be performed according to the rule pre-execution result. Compared with the traditional direct execution of each constraint rule carried by the target product one by one, there will be no situation where a contradiction is found with the previously executed rule when executing one of the constraint rules. In this way, there is no need to roll back the data based on the pre-copied product selection state, avoiding invalid rule execution. At the same time, the pre-check is performed before the user selects, and the pre-check result can be executed after the user selects, saving the time of rule verification and collection of rule execution results, reducing resource consumption and occupation, and reducing the delay of response time, thereby helping to improve the efficiency of product selection.
[0071] In addition, each constraint rule in the constraint rule set is verified, so that it can be verified whether there are conflicts between the constraint rules carried by unselected products, and whether there are conflicts between the constraint rules carried by unselected products and the constraint rules carried by selected products, which helps to ensure the comprehensiveness and accuracy of rule verification.
[0072] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure.
[0073] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0075] Figure 1 A flow chart of a product selection method provided by an embodiment of the present disclosure is shown;
[0076] Figure 2 A schematic diagram of a product selection interface provided by an embodiment of the present disclosure is shown;
[0077] Figure 3 A flowchart of a specific method for rule pre-checking provided by an embodiment of the present disclosure is shown;
[0078] Figure 4 A schematic diagram of a verification failure interface provided by an embodiment of the present disclosure is shown;
[0079] Figure 5 A schematic diagram showing an execution result interface provided by an embodiment of the present disclosure is shown;
[0080] Figure 6 A schematic diagram showing a product selection process provided by an embodiment of the present disclosure;
[0081] Figure 7 A schematic diagram of a product selection device provided by an embodiment of the present disclosure is shown;
[0082] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0084] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0085] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0086] According to research, after a user makes a selection, they will first copy the selection status of all products before the current selection, then load all the constraint rules associated with the currently selected product, and execute each constraint rule one by one. However, if the constraint rules carried by the historically selected product have been executed, it may lead to repeated execution of the constraint rules during the current rule execution process. And when executing one of the constraint rules, if it is found that there is a contradiction with the previously executed constraint rule, it is necessary to roll back the data based on the pre-copied product selection status and restore all products to the product selection status before the current selection.
[0087] For example, the user selects product A for the first time. At this time, product A is selected and carries 6 constraint rules. Each of the 6 constraint rules is executed one by one and all are executed successfully. The user selects product B for the second time. At this time, product A and product B are selected and carry 4 constraint rules. Product A and product B carry 10 constraint rules in total. At this time, the selection status of all products stored before the user selects product B will be copied first, and then each of the 10 constraint rules will be executed one by one. Because there are constraint rules in these 10 constraint rules that are repeated in the 6 constraint rules that have been executed previously, in the process of executing these 10 constraint rules, there is a duplication of constraint rules relative to the constraint rules that have been executed previously.
[0088] In this way, since the constraint rules repeated in the 6 constraint rules executed previously will be executed again, the rules will be executed repeatedly, which will greatly affect the efficiency of product selection and bring unnecessary resource consumption and time occupation.
[0089] If, when executing the eighth constraint rule, it is found that there is a conflict with the previously executed constraint rule, it is necessary to roll back the data based on the pre-copied product selection status and restore all products to the product selection status before the user selects product B.
[0090] In this way, the invalid execution of these 8 constraint rules consumes a lot of resources and affects the efficiency of product selection. In addition, since data must be copied for each selection, data must be rolled back each time the execution fails, resulting in a large waste of resources and delayed response time.
[0091] Based on the above research, the present disclosure provides a product selection method. After the product selection is completed, a pre-selected product combination is determined based on the selected products and the unselected products, and the constraint rule set is pre-checked to obtain a pre-check result. That is, before the user makes a selection, the products that the user may select are pre-checked, so that after the user makes a selection operation, corresponding processing can be directly performed according to the pre-check result. When the pre-check fails (any constraint rule in the constraint rule set conflicts with other constraint rules), no constraint rule will be executed. When the check passes (that is, all constraint rules in the constraint rule set do not conflict), The product selection for this selection operation will be executed according to the pre-execution result of the rules. Compared with the traditional method of directly executing each constraint rule carried by the target product one by one, there will be no situation where a certain constraint rule is executed and a conflict with the previously executed rule occurs. In this way, there is no need to roll back the data based on the pre-copied product selection status to avoid invalid rule execution. At the same time, pre-verification is performed before the user selects, and after the user selects, it can be executed according to the pre-verification result, saving the time for rule verification and collection of rule execution results, reducing resource consumption and occupancy, and reducing response time delays, thereby helping to improve product selection efficiency.
[0092] To facilitate understanding of this embodiment, a product selection method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the product selection method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities. In this embodiment, the electronic device can be a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data and artificial intelligence platforms.
[0093] In other implementations, the electronic device may also be a terminal device or other processing device, and the terminal device may be a mobile device, a terminal, a computing device, etc. Other processing devices may be devices including a processor and a memory, which are not limited here. In some possible implementations, the product selection method may be implemented by a processor calling a computer-readable instruction stored in a memory.
[0094] A product selection method provided by an embodiment of the present disclosure is described below in conjunction with the accompanying drawings.
[0095] See also Figure 1 As shown, it is a flow chart of a product selection method provided by an embodiment of the present disclosure, such as Figure 1 As shown in , the product selection method provided by the embodiment of the present disclosure includes steps S101 to S105, wherein:
[0096] S101: In response to the completion of product selection, a selected product carrying a constraint rule and an unselected product carrying a constraint rule are determined from a plurality of preset products.
[0097] Here, the preset products may be processing parts, and the selected processing parts may be assembled and used later.
[0098] Among the multiple preset products, some preset products carry constraint rules, and some preset products do not carry preset rules.
[0099] For example, if there are 8 preset products, namely product A, product B, product C, product D, product E, product F, product G and product H, there are 4 preset products with constraint rules, namely product A, product B, product D and product E. Product A carries 2 constraint rules, namely constraint rule 1: "selecting product A requires selecting product B" and constraint rule 2: "selecting product A does not allow selecting product H"; product B carries a constraint rule, specifically constraint rule 3: "selecting product B requires selecting product C"; product A and product E carry a constraint rule together, specifically constraint rule 4: "selecting product A and product E requires selecting product F at the same time"; product D and product E carry a constraint rule together, specifically constraint rule 5: "selecting product D and product E does not allow selecting product F and product G at the same time". After the product selection is completed, the selected product with constraint rules is product A, and the unselected products with constraint rules include product B, product D and product E.
[0100] For example, see also Figure 2 , Figure 2 Schematic diagram of a product selection interface provided by an embodiment of the present disclosure. Figure 2 As shown in the figure, taking the check selection method as an example, 8 preset products are displayed in the product selection interface 200, namely product A, product B, product C, product D, product E, product F, product G and product H. After the product selection is completed, product A is selected.
[0101] In the disclosed embodiment, the webworker function of the browser can be used to start an independent thread for pre-verification in response to the completion of product selection. Specifically, the selected product and the unselected product can be distinguished, the subsequent pre-selected product combination and the constraint rule set can be determined in the other thread, and the constraint rule set can be pre-verified to generate a pre-verification result for the pre-selected product combination. In this way, the two tasks of pre-verification and providing product selection for users can be executed in different threads, so that pre-verification can be performed in advance without affecting the user's product selection, which helps to ensure the smooth execution of the user's product selection and improve the user's product selection experience.
[0102] Accordingly, it is possible to first determine whether the browser supports the webworker function. If the browser does not support the webworker function due to reasons such as a low browser version, pre-verification may not be performed. Instead, in response to the user's selection operation, the multiple constraint rules carried by the target product may be verified and executed based on the verification results.
[0103] S102: For each of the unselected products, combine the unselected products with the selected products to obtain a pre-selected product combination; and for each pre-selected product combination, combine multiple constraint rules carried by each pre-selected product in the pre-selected product combination to obtain a constraint rule set; the constraint rules are used to indicate the association relationship between the pre-selected product and other products, and the association relationship includes a dependency relationship and / or a mutually exclusive relationship.
[0104] In this step, each of the unselected products may be combined with the selected product in sequence to obtain a pre-selected product combination including the unselected product.
[0105] Continuing with the above example, the selected product is product A, and the unselected products include product B, product D and product E. At this time, three pre-selected product combinations can be obtained, namely pre-selected product combination 1, pre-selected product combination 2 and pre-selected product combination 3, among which pre-selected product combination 1 includes product A and product B, pre-selected product combination 2 includes product A and product D, and pre-selected product combination 3 includes product A and product E.
[0106] Optionally, if only a check needs to be performed on a product carrying a constraint rule, the pre-selected product combination only includes this product, and there is no need to determine the unselected products.
[0107] Then, for each of the pre-selected product combinations, multiple constraint rules carried by each pre-selected product in the pre-selected product combination are combined to obtain a constraint rule set.
[0108] Here, the other products in the constraint rule refer to other preset products among the multiple preset products that are associated with the preset product carrying the constraint rule.
[0109] Wherein, when the constraint rule indicates that the association relationship between the pre-selected product and other products is the dependent relationship, the other products associated with the pre-selected product are dependent products; when the constraint rule indicates that the association relationship between the pre-selected product and other products is the mutually exclusive relationship, the other products associated with the pre-selected product are mutually exclusive products;
[0110] It can be understood that when the constraint rule indicates a dependency relationship, it means that the pre-selected product and the dependent product need to be selected at the same time, and when the constraint rule indicates a mutually exclusive relationship, it means that the pre-selected product and the mutually exclusive product cannot be selected at the same time.
[0111] Exemplarily, when the pre-selected product is a processed component, the pre-selected product and the dependent product need to be assembled in combination, and the pre-selected product and the mutually exclusive product cannot be assembled in combination.
[0112] For example, take product A as an example. Product A carries two constraint rules, namely constraint rule 1: "If you choose product A, you must choose product B" and constraint rule 2: "If you choose product A, you are not allowed to choose product H". For product A, the constraint rule "If you choose product A, you must choose product B" indicates a dependency relationship, and product B is the corresponding dependent product. The constraint rule "If you choose product A, you are not allowed to choose product H" indicates a mutually exclusive relationship, and product H is the corresponding mutually exclusive product.
[0113] In some possible implementations, the method further includes:
[0114] In the case where a dependent product corresponding to a constraint rule in the constraint rule set carries a constraint rule, the dependent product is used as the pre-selected product to redefine the constraint rule set.
[0115] Exemplarily, the constraint rules include rule 1: "Selecting product A requires selecting product B", and rule 2: "Selecting product A does not allow selecting product H", therefore, product B is a dependent product corresponding to the constraint rule. If product B carries constraint rule 3: "Selecting product B requires selecting product C", then product B is also used as a pre-selected product, and constraint rule 3: "Selecting product B requires selecting product C" is also added to the constraint rule set. If product C is a dependent product corresponding to the constraint rule, and product C also carries constraint rules, the constraint rules carried by product C are also added to the constraint rule set, until all constraint rules carried by all dependent products corresponding to the constraint rules that carry constraint rules are added to the constraint rule set.
[0116] In this way, for a dependent product corresponding to a constraint rule, if the dependent product carries a constraint rule, the constraint rule is added to the constraint rule set, which helps to ensure the comprehensiveness and accuracy of the constraint rule set.
[0117] In some possible implementations, the method further includes:
[0118] In the case that the product characteristics of the target product indicate that the target product does not coexist with the dependent product corresponding to the constraint rule carried by the dependent product, the dependent product is not used as the target product.
[0119] Continuing with the above example, the constraint rules include Rule 1: "Selecting Product A requires selecting Product B", and Rule 2: "Selecting Product A does not allow selecting Product H". Therefore, Product B is the dependent product corresponding to the constraint rule. If Product B carries Constraint Rule 3: "Selecting Product B requires selecting Product C", and the product characteristics of Product A indicate that Product A and Product C cannot coexist, then Product B cannot be selected as a pre-selected product, and Constraint Rule 3: "Selecting Product B requires selecting Product C" cannot be added to the constraint rule set.
[0120] In this way, the priority of setting product characteristics is higher than the priority of constraint rules. When product characteristics and constraint rules indicate different product selection methods, the constraint rule set is determined according to the product characteristics to ensure that the subsequent product selection results are consistent with the product characteristics, which helps to improve the accuracy of product selection.
[0121] S103: Pre-verify the constraint rule set to determine whether there is a conflict between the dependency and mutual exclusion relationships indicated by each constraint rule in the constraint rule set, and generate a pre-verification result for the pre-selected product combination; the pre-verification result includes a pre-verification failure result and a rule pre-execution result; if any constraint rule in the constraint rule set conflicts with other constraint rules, the pre-verification failure result is generated; if all constraint rules in the constraint rule set do not conflict, the rule pre-execution result is generated.
[0122] In this step, the constraint rule set includes the constraint rules carried by each pre-selected product in the pre-selected product combination, that is, the constraint rule set includes the constraint rules carried by unselected products and the constraint rules carried by selected products. It is checked whether the dependency relationships and mutually exclusive relationships indicated by each constraint rule in the constraint rule set conflict with each other. In this way, it can be checked whether there are conflicts between the constraint rules carried by the unselected products, and whether there are conflicts between the constraint rules carried by the unselected products and the constraint rules carried by the selected products, which helps to ensure the comprehensiveness and accuracy of the rule verification.
[0123] For details, see Figure 3 , which is a flowchart of a specific method for rule pre-checking provided by an embodiment of the present disclosure, such as Figure 3 As shown in , it includes steps S1031 to S1034, wherein:
[0124] S1031: Determine, in the constraint rule set, a first constraint rule indicating a dependency relationship and a second constraint rule indicating a mutually exclusive relationship.
[0125] Here, according to the association relationship indicated by the constraint rules, the multiple constraint rules included in the constraint rule set are divided into first constraint rules indicating dependency relationships and second constraint rules indicating mutually exclusive relationships.
[0126] S1032: Combining the dependent products corresponding to the first constraint rule to obtain dependent product combinations, and combining the mutually exclusive products corresponding to the second constraint rule to obtain mutually exclusive product combinations.
[0127] Here, for each of the first constraint rules, the dependent products corresponding to the first constraint rule are combined to obtain a dependent product combination, and for each of the second constraint rules, the mutually exclusive products corresponding to the second constraint rule are combined to obtain a mutually exclusive product combination.
[0128] S1033: When there are no identical products between the dependent product combination and the mutually exclusive product combination, determine that the dependency relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set do not conflict with each other, and generate the rule pre-execution result.
[0129] Among them, in the case where there are no identical products between the dependent product combination and the mutually exclusive product combination, there will not be a situation where another product has both the dependency relationship with the first pre-selected product and the mutual exclusion relationship with the second pre-selected product, so that it can be determined that there is no conflict between the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set.
[0130] The rule pre-execution result is generated only when all constraint rules in the conflict check set do not conflict, thereby avoiding invalid rule execution and helping to improve product selection efficiency.
[0131] In some possible implementations, generating the rule pre-execution result includes:
[0132] Based on the constraint rule set and the historical execution rule set, at least one target constraint rule is screened out from the constraint rule set; the historical execution rules in the historical execution rule set are constraint rules that have been executed before the next selection operation, and the target constraint rule refers to a constraint rule that has not been executed before the next selection operation and corresponds to the next selection operation;
[0133] The rule pre-execution result is generated according to the at least one target constraint rule.
[0134] Specifically, by comparing the constraint rule set with the historical execution rule set, the constraint rules in the constraint rule set are divided into target constraint rules and repeated constraint rules. The target constraint rules refer to the constraint rules corresponding to the next selection operation that have not been executed before the next selection operation. The repeated constraint rules refer to the constraint rules corresponding to the next selection operation that have been executed before the next selection operation because the target product determined by the next selection operation is the same as the product selected in the historical selection operation. Then, the rule pre-execution results are generated only according to the target constraint rules, the change rules are accurately executed, and repeated execution of rules is avoided, which helps to improve product selection efficiency.
[0135] For example, the historical selection operation selects product A, and the constraint rules carried by product A are executed. If the unselected product in the preset product combination is product B, then for the next selection operation, the constraint rules carried by product B are the target constraint rules, and the constraint rules carried by product A are the repeated constraint rules.
[0136] In this way, when it is determined that all constraint rules in the constraint rule set do not conflict, the constraint rule set is compared with the historical execution rule set to filter out the target constraint rules corresponding to the next selection operation that have not been executed before the next selection operation from the constraint rule set, and the rule pre-execution results are generated only based on the target constraint rules. This helps to accurately execute the target constraint rules that have changed compared to the historical execution rules, and avoid repeated execution of repeated constraint rules that are the same as the historical execution rules, thereby effectively reducing the constraint rule execution time, reducing resource consumption, and improving product selection efficiency.
[0137] Specifically, when generating the rule pre-execution result according to the at least one target constraint rule, for each target constraint rule, according to the dependency relationship indicated by the target constraint rule, it is determined that the dependent product corresponding to the target constraint rule is selected, or, according to the mutually exclusive relationship indicated by the target constraint rule, it is determined that the mutually exclusive product corresponding to the target constraint rule is banned; based on the selected dependent products and the banned mutually exclusive products, the rule pre-execution result is determined.
[0138] In this way, by selecting the dependent products corresponding to the target constraint rules and prohibiting the selection of the mutually exclusive products corresponding to the target constraint rules, it helps to accurately execute the product matching corresponding to the pre-selected product combination and helps to ensure the reliability of product matching.
[0139] In some possible implementations, the method further includes:
[0140] In the case where the product characteristic of the pre-selected product indicates that the pre-selected product does not co-exist with the dependent product corresponding to the target constraint rule, the dependent product is not selected.
[0141] For example, the target constraint rule is "selecting product A requires selecting product B", and the product characteristics of product A indicate that product A and product B cannot coexist, so product B cannot be selected.
[0142] In this way, the priority of setting product characteristics is higher than the priority of constraint rules. When product characteristics and target constraint rules indicate different product selection methods, product selection is performed according to product characteristics to ensure that the product selection results are consistent with the product characteristics, which helps to improve the accuracy of product selection.
[0143] S1034: When the same product exists between the dependent product combination and the mutually exclusive product combination, determine the conflict between the dependency relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set, and generate the pre-check failure result.
[0144] Among them, when the same product exists between the dependent product combination and the mutually exclusive product combination, there will be another product that has both the dependent relationship with the first pre-selected product and the mutually exclusive relationship with the second pre-selected product, so that it can be determined that there is a conflict between the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set.
[0145] Exemplarily, the first constraint rule is "when selecting product A and product E at the same time, product F must be selected", and the dependent product combination includes product F. The second constraint rule is "when selecting product D and product E at the same time, product F and product G are not allowed to be selected", and the mutually exclusive product combination includes product F and product G. In this way, both the dependent product combination and the mutually exclusive product combination include product F, and the conflict between the dependency relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set can be determined.
[0146] In this way, according to the association relationship indicated by each constraint rule, multiple constraint rules in the constraint rule set are divided into first constraint rules and second constraint rules. According to the dependent products corresponding to the first constraint rule and the mutually exclusive products corresponding to the second constraint rule, dependent product combinations and mutually exclusive product combinations are obtained. By comparing whether the dependent product combination and the mutually exclusive product combination have the same products, it is determined whether there is a conflict between the dependency relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set. This helps to ensure the comprehensiveness and accuracy of rule verification, thereby ensuring the effectiveness of constraint rule execution and avoiding invalid rule execution.
[0147] In some possible implementations, generating the pre-verification failure result includes:
[0148] Determine conflicting products in the constraint rule set and constraint rules associated with the conflicting products, wherein the conflicting products are other products that have the dependency relationship with the first pre-selected product in the constraint rule set and the mutually exclusive relationship with the second pre-selected product in the constraint rule set;
[0149] The pre-verification failure result is determined based on the conflicting product and the constraint rules associated with the conflicting product.
[0150] Exemplarily, the first constraint rule is "Product F must be selected when Product A and Product E are selected at the same time", and the dependent product combination includes Product F. The second constraint rule is "Product F and Product G are not allowed to be selected when Product D and Product E are selected at the same time", and the mutually exclusive product combination includes Product F and Product G. In this way, Product F has both a dependent relationship with Product A and Product E and a mutually exclusive relationship with Product D and Product E. Therefore, it can be determined that the conflicting product is Product F, and the constraint rules associated with Product F are "Product F must be selected when Product A and Product E are selected at the same time" and "Product F and Product G are not allowed to be selected when Product D and Product E are selected at the same time".
[0151] Following the above S103 and S104: in response to the user's selection operation, a target product carrying the constraint rule is determined from a plurality of preset products, wherein the target product includes the product selected in the current selection operation and the product selected in the history selection operation.
[0152] Here, the selection operation may be a selection operation, and the target product is a product carrying a constraint rule currently selected by the user among multiple preset products after the selection operation. It can be understood that the target product includes the product selected in this selection operation and the product selected in the historical selection operation.
[0153] Exemplarily, product A is selected in the historical selection operation, and product B is selected in the current selection operation. Then, after the current selection operation, the target products include product A and product B.
[0154] In which, in response to the selection operation, the number of products selected in this selection operation may be one.
[0155] Optionally, when the selection method of the selection operation is specifically checking, clicking, selecting from a drop-down list, etc., a new product can be selected in this selection operation.
[0156] S105: When the target product matches any of the pre-selected product combinations, execution is performed according to the pre-verification result of the target pre-selected product combination that matches the target product; when the pre-verification result includes the pre-verification failure result, the pre-verification failure result is fed back to the user, and any constraint rule is refused to be executed; when the pre-verification result includes the rule pre-execution result, product selection for this selection operation is performed according to the rule pre-execution result, and the product selection result is fed back to the user.
[0157] In this step, when the target product is identical to any of the preset products in the preset product combination, it can be determined that the target product matches the preset product combination, and the pre-selected product combination matching the target product is used as the target pre-selected product combination, thereby executing according to the pre-verification result of the target pre-selected product combination.
[0158] In the case where the pre-verification result includes a conflict with the pre-verification failure result, the verification failure result can be fed back to the user to prompt the user to adjust the selection of the target product, and any constraint rule in the constraint rule set corresponding to the current selection operation will not be executed, so as to avoid invalid rule execution, thereby helping to improve product selection efficiency.
[0159] In some possible implementations, feeding back the verification failure result to the user includes:
[0160] A verification failure interface is displayed, wherein the verification failure interface displays the conflicting product, the constraint rules associated with the conflicting product, and prompt information, wherein the prompt information is used to prompt the user to reselect the target product.
[0161] In this way, by displaying the verification failure interface, the conflicting products and the constraint rules associated with the conflicting products are fed back to the user, so that the user can quickly know the reason why the product selection operation failed to be performed, and the user is guided to reselect the target product to ensure the successful execution of the product selection.
[0162] For example, see also Figure 4 , Figure 4A schematic diagram of a verification failure interface provided by an embodiment of the present disclosure. The first constraint rule is "When selecting product A and product E at the same time, product F must be selected", and the dependent product combination includes product F. The second constraint rule is "When selecting product D and product E at the same time, product F and product G are not allowed to be selected", and the mutually exclusive product combination includes product F and product G. In this way, product F has both a dependent relationship with product A and product E and a mutually exclusive relationship with product D and product E, so that the conflicting product can be determined to be product F. The constraint rules associated with product F are "When selecting product A and product E at the same time, product F must be selected" and "When selecting product D and product E at the same time, product F and product G are not allowed to be selected".
[0163] like Figure 4 As shown in , the verification failure interface 400 displays "Conflicting product: Product F", "Constraint rules associated with the conflicting product: Product F must be selected when Product A and Product E are selected at the same time, and Product F and Product G are not allowed to be selected when Product D and Product E are selected at the same time", and the prompt message "Please reselect the product!".
[0164] In the case that the pre-verification result includes the rule pre-execution result, the product matching of this selection operation is performed according to the rule pre-execution result, and the product matching result is fed back to the user.
[0165] Optionally, after executing the product matching of this selection operation according to the rule pre-execution result, the target constraint rule may also be added to the historical execution rule set.
[0166] In this way, after completing the product selection of this selection operation according to the target constraint rules, for the next product selection, the target constraint rules corresponding to this selection operation are the historical execution rules. Therefore, adding the target constraint rules to the historical execution rule set will help ensure the real-time and accuracy of the historical execution rule set, thereby effectively improving the accuracy of subsequent product selection.
[0167] In some possible implementations, feeding back the product selection result to the user includes:
[0168] An execution result interface is displayed, wherein the execution result interface displays the products selected and the products prohibited in this selection operation.
[0169] In this way, after executing the product matching of this selection operation, the product matching result can be fed back to the user by displaying the execution result interface, so that the user can clearly know the products selected and the products prohibited in this selection operation, thereby improving the user experience.
[0170] For example, see also Figure 5 , Figure 5This is a schematic diagram of an execution result interface provided by an embodiment of the present disclosure. The target products include product A and product B. Product A carries two constraint rules, namely constraint rule 1: "If you choose product A, you must choose product B" and constraint rule 2: "If you choose product A, you are not allowed to choose product H". Product B carries one constraint rule, specifically constraint rule 3: "If you choose product B, you must choose product C". After executing the product selection for this selection operation according to the target constraint rules, Figure 5 As shown in , the execution result interface 500 shows that product A, product B, and product C are selected, product H is disabled, and other undisplayed products are neither selected nor disabled.
[0171] Optionally, if the target product does not match any of the pre-selected product combinations, the multiple constraint rules carried by the target product can be verified and executed according to the verification result. Here, the specific steps of verifying the multiple constraint rules carried by the target product are similar to the steps of pre-verifying the multiple constraint rules carried by the pre-selected product combination. For a specific description, please refer to the above embodiment, which will not be repeated here.
[0172] In the embodiment of the present disclosure, the selection operation is specifically a selection operation, and a new product is selected under the selection operation. In other embodiments, the selection operation may also be a deselection operation. Exemplarily, the historical selection operation selected product A and product B, and the current selection operation deselects product B. Then, after the current selection operation, the target products include product A. At this time, after the current selection operation, compared with before the current selection operation, no new selected product is added, but the historically selected product is deselected.
[0173] Specifically, based on the constraint rule set and the historical execution rule set, a target historical execution rule is filtered out from the historical execution rule set, wherein the target historical execution rule refers to a historical execution rule that has been executed before the current selection operation and does not correspond to the current selection operation; according to the association relationship indicated by the target historical execution rule, the product selection of the historical selection operation is canceled.
[0174] It can be understood that when a product is selected in a historical selection operation, the constraint rules carried by the product are executed. If the product is deselected in this selection operation, the constraint rules carried by the product are the target historical execution rules for this selection operation.
[0175] Exemplarily, the historical execution rule set includes the historical execution rule "If you select product A, you must select product B", while the constraint rule set does not include the constraint rule "If you select product A, you must select product B". Therefore, "If you select product A, you must select product B" can be determined as the target historical execution rule, and product B can be deselected according to the association relationship indicated by the target historical execution rule.
[0176] In this way, by comparing the constraint rule set and the historical execution rule set, the target historical execution rules that have become invalid for the current selection operation are filtered out from the historical execution rule set, and the product selection of the historical selection operation is canceled according to the association indicated by the target historical execution rules, which helps to ensure the accuracy and reliability of product selection.
[0177] Optionally, after canceling the product selection of the historical selection operation according to the association relationship indicated by the target historical execution rule, the target historical execution rule may also be deleted from the historical execution rule set.
[0178] In this way, after canceling the product selection of the historical selection operation according to the association indicated by the target historical execution rule, the target historical execution rule is no longer the historical execution rule for the next product selection. Therefore, deleting the target historical execution rule from the historical execution rule set will help ensure the real-time and accuracy of the historical execution rule set, thereby effectively improving the accuracy of subsequent product selection.
[0179] Optionally, the selection operation may also include a selection operation and a deselection operation. For example, the historical selection operation selected product A and product B, and the current selection operation selected product C and deselected product B. After the current selection operation, the target products include product A and product C. At this time, it is necessary to verify the multiple constraint rules carried by the target product and execute them according to the verification results, and it is also necessary to determine the target historical execution rules and cancel the corresponding products.
[0180] In other embodiments, if multiple products are newly selected under the selection operation, for example, when the selection operation is specifically a batch selection, multiple products can be selected under this selection operation. At this time, there is no target pre-selected product combination that matches the target product, and then the multiple constraint rules carried by the target product can be verified and executed according to the verification results.
[0181] In order to clearly demonstrate the process of product selection, you can also refer to Figure 6 , Figure 6 A schematic diagram of a product selection process provided by an embodiment of the present disclosure, such as Figure 6As shown in , first initialize the cache, specifically including cache R: used to store pre-verification results, cache H: used to store historical execution rule sets, cache M: used to store constraint rule sets, cache H1: used to store target constraint rules, cache H2: used to store target historical execution rules, cache P: used to store target products with constraint rules, cache T1: used to store dependent products corresponding to target constraint rules, cache T2: used to store mutually exclusive products corresponding to target constraint rules.
[0182] Here, when storing data in each cache, the object data type can be used to cache products or constraint rules. For example, the cache method is key: product ID or constraint rule ID, value: 1. Caching data through the object data type has a faster search speed than other data types, which helps to improve the efficiency of product selection.
[0183] For multiple preset products, add a tag hasRule to the preset products that carry constraint rules. For example, add a field with key: hasRule and value: 1 to the preset products that carry constraint rules. For example, refer to Figure 2 , take the preset products including product A, product B, product C, product D, product E, product F, product G and product H as an example. Product A carries two constraint rules, namely constraint rule 1: "If you choose product A, you must choose product B" and constraint rule 2: "If you choose product A, you are not allowed to choose product H"; product B carries a constraint rule, specifically constraint rule 3: "If you choose product B, you must choose product C"; product A and product E carry a constraint rule together, specifically constraint rule 4: "If you choose product A and product E at the same time, you must choose product F"; product D and product E carry a constraint rule together, specifically constraint rule 5: "If you choose product D and product E at the same time, you are not allowed to choose product F and product G". Therefore, product A, product B, product D, and product E are all added with the hasRule tag.
[0184] In response to the completion of product selection, the webworker function of the browser is used to start an independent thread for pre-verification. Determine from multiple preset products that the marked selected product is product A; based on the selected product, determine from multiple preset products that the marked unselected products include product B, product D and product E; combine the selected product with each unselected product to obtain a pre-selected product, and then you can get three pre-selected product combinations, namely pre-selected product combination 1, pre-selected product combination 2 and pre-selected product combination 3, wherein pre-selected product combination 1 includes product A and product B, pre-selected product combination 2 includes product A and product D, and pre-selected product combination 3 includes product A and product E. Put each pre-selected product combination into the corresponding cache P. Optionally, the product ID of the pre-selected product can be put into cache P.
[0185] For each pre-selected product combination, the corresponding constraint rule set is determined according to cache P and placed in the corresponding cache M. Taking pre-selected product combination 2 as an example, the cache P corresponding to pre-selected product combination 2 includes product A and product D. Constraint rules 1 and constraint rules 2 carried by pre-selected product combination 2 are determined, constraint rules 1 and constraint rules 2 are combined to obtain a constraint rule set, and the constraint rule set is placed in cache M.
[0186] For the constraint rules in cache M, determine whether the corresponding dependent products marked with a mark are in cache P. If not, take the dependent products as the pre-selected products and redetermine the constraint rule set. If they are, pre-check the constraint rule set to determine whether the dependency relationships and mutually exclusive relationships indicated by the various constraint rules in the constraint rule set conflict, and generate a pre-check result for the pre-selected product combination.
[0187] Taking the pre-selected product combination 2 as an example, at this time, product B does not exist in cache P, but product B carries constraint rule 3, and product B is put into cache P. Optionally, the product ID of product B can be put into cache P, and the constraint rule set is re-determined. At this time, the constraint rule set includes constraint rule 1, constraint rule 2, and constraint rule 3.
[0188] After pre-checking each constraint rule in the constraint rule set, if any constraint rule in the constraint rule set conflicts with other constraint rules, a pre-check failure result is generated; if all constraint rules in the constraint rule set do not conflict, a rule pre-execution result is generated.
[0189] Specifically, when generating the rule execution result, based on the constraint rule set and the historical execution rule set, the target constraint rule is screened out from the constraint rule set, and the target constraint rule is placed in cache H1. When the target constraint rule indicates a dependency relationship, the dependent products are placed in cache T1. Taking the pre-selected product combination 2 as an example, cache T1 includes product B and product C at this time. When the target constraint rule indicates a mutually exclusive relationship, the mutually exclusive products are placed in cache T2. At this time, cache T2 includes product H. For the target constraint rule in cache H1, it is determined that the dependent products corresponding to the target constraint rule (i.e., the dependent products in cache T1) product B and product C are selected, and it is determined that the mutually exclusive product corresponding to the target constraint rule (i.e., the mutually exclusive product in cache T2) product H is prohibited from selection.
[0190] According to the above method, the pre-verification failure results or rule pre-execution results (cache T1 and cache T2) corresponding to each pre-selected product combination are collected and put into cache R.
[0191] In response to the user's selection operation, determine the target product under the selection operation, determine a target pre-selected product combination consistent with the target product from multiple pre-selected product combinations, and determine a pre-verification failure result or a rule pre-execution result corresponding to the target pre-selected product combination from the cache R.
[0192] In the case where the pre-verification result includes the pre-verification failure result, the pre-verification failure result is fed back to the user and any constraint rule is refused to be executed; in the case where the pre-verification result includes the rule pre-execution result, the product selection for this selection operation is performed according to the rule pre-execution result, and the product selection result is fed back to the user.
[0193] Take the target products including product A and product D as an example. At this time, the target products match the preset product combination 2. According to the rule pre-execution result of the preset product combination 2, the dependent products corresponding to the target constraint rules (products B and C in cache T1) are selected, and the mutually exclusive products corresponding to the target constraint rules (product H in cache T2) are prohibited. Then the target constraint rules in cache H1 are added to the historical execution rule set in cache H.
[0194] If the selection operation includes a cancel operation, based on the constraint rule set and the historical execution rule set, a target historical execution rule is screened out from the historical execution rule set, and the target historical execution rule is put into the cache H2.
[0195] For the target historical execution rule in cache H2, according to the association relationship indicated by the target historical execution rule, cancel the product selection of the historical selection operation. Then delete the target historical execution rule in cache H2 from the historical execution rule set in cache H. Feedback the product selection result to the user.
[0196] Clear cache R, cache M, cache H1, cache H2, cache P, cache T1, cache T2, and keep cache H. This round of product selection is completed.
[0197] In response to the completion of the product selection, pre-checking is performed again. From the plurality of preset products, it is determined that the selected products marked with a mark are product A, product B, and product D, and the unselected products marked with a mark include product E. The selected products are combined with each unselected product to obtain a pre-selected product. At this time, a pre-selected product combination can be obtained, and the pre-selected product combination includes product A, product B, product D, and product E. The pre-selected product combination is placed in the corresponding cache P.
[0198] Repeat the above steps to pre-check the constraint rule set, and determine that constraint rule 4 and constraint rule 5 conflict. Product F has a dependency relationship with product A and product E, and a mutually exclusive relationship with product D and product E. Therefore, it can be determined that the conflicting product is product F. The constraint rules associated with product F are "Product F must be selected when product A and product E are selected at the same time" and "Product F and product G are not allowed to be selected when product D and product E are selected at the same time", generating a pre-check failure result.
[0199] In response to the user's selection operation, the target product under the selection operation is determined. At this time, the target products include product A, product B, product D, and product E, which match the above pre-selected product combination, and then the pre-verification failure result is fed back to the user, and any constraint rule is refused to be executed. The specific verification failure interface is as follows Figure 4 The description of the specific steps can be found in the above embodiments, which will not be repeated here.
[0200] The product selection method provided by the embodiment of the present disclosure determines a pre-selected product combination based on the selected products and the unselected products after the product selection is completed, and pre-checks the constraint rule set to obtain a pre-check result, that is, before the user makes a selection, the products that the user may select are pre-checked, so that after the user makes a selection operation, corresponding processing can be directly performed according to the pre-check result. When the pre-check fails (any constraint rule in the constraint rule set conflicts with other constraint rules), no constraint rule will be executed. When the check passes (that is, all constraint rules in the constraint rule set do not conflict), the pre-check will be performed according to the pre-check result. Compared with the traditional method of directly executing each constraint rule carried by the target product one by one, the rule pre-execution result executes the product selection for this selection operation. There will be no situation where when executing one of the constraint rules, it is found that there is a contradiction with the previously executed rule. In this way, there is no need to roll back the data based on the pre-copied product selection status to avoid invalid rule execution. At the same time, pre-verification is performed before the user selects, and after the user selects, it can be executed according to the pre-verification result, saving the time of rule verification and collecting rule execution results, reducing resource consumption and occupancy, and reducing the delay of response time, which helps to improve the efficiency of product selection.
[0201] In addition, each constraint rule in the constraint rule set is verified, so that it can be verified whether there are conflicts between the constraint rules carried by unselected products, and whether there are conflicts between the constraint rules carried by unselected products and the constraint rules carried by selected products, which helps to ensure the comprehensiveness and accuracy of rule verification.
[0202] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0203] Based on the same inventive concept, a product selection device corresponding to the product selection method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the product selection device in the embodiment of the present disclosure is similar to the above-mentioned product selection method in the embodiment of the present disclosure, the implementation of the product selection device can refer to the implementation of the product selection method, and the repeated parts will not be repeated.
[0204] See also Figure 7 , Figure 7 Schematic diagram of a product selection device provided by an embodiment of the present disclosure. Figure 7 As shown in , the product selection device 700 provided in the embodiment of the present disclosure includes:
[0205] The product determination module 710 is used to determine the selected products carrying the constraint rules and the unselected products carrying the constraint rules from the plurality of preset products in response to the completion of the product selection execution;
[0206] The rule combination module 720 is used to combine the unselected product with the selected product for each of the unselected products to obtain a pre-selected product combination; and for each pre-selected product combination, combine multiple constraint rules carried by each pre-selected product in the pre-selected product combination to obtain a constraint rule set; the constraint rule is used to indicate the association relationship between the pre-selected product and other products, and the association relationship includes a dependency relationship and / or a mutually exclusive relationship;
[0207] A rule pre-verification module 730 is used to pre-verify the constraint rule set, determine whether there is a conflict between the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set, and generate a pre-verification result for the pre-selected product combination; the pre-verification result includes a pre-verification failure result and a rule pre-execution result; if any constraint rule in the constraint rule set conflicts with other constraint rules, the pre-verification failure result is generated; if all constraint rules in the constraint rule set do not conflict, the rule pre-execution result is generated;
[0208] A product selection module 740 is used to determine a target product carrying a constraint rule from a plurality of preset products in response to a selection operation of the user, wherein the target product includes the product selected in the current selection operation and the product selected in the historical selection operation;
[0209] The result feedback module 750 is used to execute according to the pre-verification result of the target pre-selected product combination matching the target product when the target product matches any of the pre-selected product combinations; to feedback the pre-verification failure result to the user and refuse to execute any constraint rule when the pre-verification result includes the pre-verification failure result; and to perform product selection for this selection operation according to the pre-execution result of the rule when the pre-verification result includes the pre-execution result of the rule, and to feedback the product selection result to the user.
[0210] In an optional implementation manner, when the constraint rule indicates that the association relationship between the pre-selected product and other products is the dependent relationship, the other products associated with the pre-selected product are dependent products; when the constraint rule indicates that the association relationship between the pre-selected product and other products is the mutually exclusive relationship, the other products associated with the pre-selected product are mutually exclusive products;
[0211] The rule pre-checking module 730 is specifically used for:
[0212] Determine, in the constraint rule set, a first constraint rule indicating a dependency relationship and a second constraint rule indicating a mutually exclusive relationship;
[0213] Combining the dependent products corresponding to the first constraint rule to obtain various dependent product combinations, and combining the mutually exclusive products corresponding to the second constraint rule to obtain various mutually exclusive product combinations;
[0214] In the case that there are no identical products between the dependent product combination and the mutually exclusive product combination, determining that the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set do not conflict with each other, and generating the rule pre-execution result;
[0215] In the case that the same product exists between the dependent product combination and the mutually exclusive product combination, a conflict between the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set is determined, and the rule pre-execution result is generated.
[0216] In an optional implementation manner, the rule pre-checking module 730, when used to generate the rule pre-execution result, is specifically used to:
[0217] Based on the constraint rule set and the historical execution rule set, at least one target constraint rule is screened out from the constraint rule set; the historical execution rules in the historical execution rule set are constraint rules that have been executed before the next selection operation, and the target constraint rule refers to a constraint rule that has not been executed before the next selection operation and corresponds to the next selection operation;
[0218] The rule pre-execution result is generated according to the at least one target constraint rule.
[0219] In an optional implementation manner, when the rule pre-checking module 730 is used to generate the rule pre-execution result according to the at least one target constraint rule, it is specifically used to:
[0220] For each target constraint rule, according to the dependency relationship indicated by the target constraint rule, determine that the dependent product corresponding to the target constraint rule is selected, or, according to the mutually exclusive relationship indicated by the target constraint rule, determine that the mutually exclusive product corresponding to the target constraint rule is prohibited from selection;
[0221] The rule pre-execution result is determined based on the selected dependent products and the disabled mutually exclusive products.
[0222] In an optional implementation manner, the rule pre-checking module 730 is further used to:
[0223] The target constraint rule is added to the historical execution rule set.
[0224] In an optional implementation manner, the result feedback module 750 is further configured to:
[0225] In the case where the product characteristic of the pre-selected product indicates that the pre-selected product does not co-exist with the dependent product corresponding to the target constraint rule, the dependent product is not selected.
[0226] In an optional implementation manner, the rule combination module 720 is further configured to:
[0227] In the case where a dependent product corresponding to a constraint rule in the constraint rule set carries a constraint rule, the dependent product is used as the pre-selected product to redefine the constraint rule set.
[0228] In an optional implementation manner, the rule pre-checking module 730, when used to generate the pre-checking failure result, is specifically used to:
[0229] Determine conflicting products in the constraint rule set and constraint rules associated with the conflicting products, wherein the conflicting products are other products that have the dependency relationship with the first target product in the constraint rule set and the mutually exclusive relationship with the second target product in the constraint rule set;
[0230] The pre-verification failure result is determined based on the conflicting product and the constraint rules associated with the conflicting product.
[0231] In an optional implementation manner, when the result feedback module 750 is used to feed back the pre-verification failure result to the user, it is specifically used to:
[0232] A verification failure interface is displayed, wherein the verification failure interface displays the conflicting product, the constraint rules associated with the conflicting product, and prompt information, wherein the prompt information is used to prompt the user to reselect the target product.
[0233] In an optional implementation manner, when the result feedback module 750 is used to feed back the product selection result to the user, it is specifically used to:
[0234] An execution result interface is displayed, wherein the execution result interface displays the products selected and the products prohibited in this selection operation.
[0235] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0236] The product selection device provided by the embodiment of the present disclosure determines a pre-selected product combination based on the selected products and the unselected products after the product selection is completed, and pre-checks the constraint rule set to obtain a pre-check result, that is, before the user makes a selection, the product that the user may select is pre-checked, so that after the user makes a selection operation, the corresponding processing can be directly performed according to the pre-check result. When the pre-check fails (any constraint rule in the constraint rule set conflicts with other constraint rules), no constraint rule will be executed. When the check passes (that is, all constraint rules in the constraint rule set do not conflict), it will be executed according to the pre-check result. Compared with the traditional method of directly executing each constraint rule carried by the target product one by one, the rule pre-execution result executes the product selection for this selection operation. There will be no situation where when executing one of the constraint rules, it is found that there is a contradiction with the previously executed rule. In this way, there is no need to roll back the data based on the pre-copied product selection status to avoid invalid rule execution. At the same time, pre-verification is performed before the user selects, and after the user selects, it can be executed according to the pre-verification result, saving the time of rule verification and collecting rule execution results, reducing resource consumption and occupancy, and reducing the delay of response time, which helps to improve the efficiency of product selection.
[0237] In addition, each constraint rule in the constraint rule set is verified, so that it can be verified whether there are conflicts between the constraint rules carried by unselected products, and whether there are conflicts between the constraint rules carried by unselected products and the constraint rules carried by selected products, which helps to ensure the comprehensiveness and accuracy of rule verification.
[0238] Corresponds to Figure 1The product selection method in the present disclosure also provides an electronic device 800, such as Figure 8 As shown in FIG. 8 , it is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of the present disclosure, including:
[0239] Processor 810, memory 820, and bus 830. The memory 820 is used to store execution instructions, including internal memory 821 and external memory 822; the internal memory 821 is also called internal memory, which is used to temporarily store the operation data in the processor 810 and the data exchanged with the external memory 822 such as a hard disk. The processor 810 exchanges data with the external memory 822 through the internal memory 821.
[0240] In the embodiment of the present application, the memory 820 is specifically used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 810. That is, when the electronic device 800 is running, the processor 810 communicates with the memory 820 through the bus 830, so that the processor 810 executes the application code stored in the memory 820, and then executes the steps of the product selection method described in any of the above embodiments.
[0241] Among them, the memory 820 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0242] The processor 810 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0243] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 800. In other embodiments of the present application, the electronic device 800 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0244] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the product selection method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0245] The present disclosure also provides a computer program product, which includes computer instructions. When the computer instructions are executed by a processor, the steps of the product selection method described in the above method embodiment can be executed. For details, please refer to the above method embodiment, which will not be repeated here.
[0246] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0247] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment and devices can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0248] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0249] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0250] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0251] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A product selection method, characterized in that: The method comprises: In response to the completion of product selection, determining selected products carrying constraint rules and unselected products carrying constraint rules from a plurality of preset products; For each of the unselected products, the unselected products are combined with the selected products to obtain a preselected product combination; and for each preselected product combination, a plurality of constraint rules carried by each preselected product in the preselected product combination are combined to obtain a constraint rule set; the constraint rules are used to indicate the association relationship between the preselected product and other products, and the association relationship includes a dependency relationship and a mutually exclusive relationship; when the constraint rules indicate that the association relationship between the preselected product and other products is the dependency relationship, the other products associated with the preselected product are dependent products; when the constraint rules indicate that the association relationship between the preselected product and other products is the mutually exclusive relationship, the other products associated with the preselected product are mutually exclusive products; Pre-verify the constraint rule set to determine whether there is a conflict between the dependency relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set, and generate a pre-verification result for the pre-selected product combination; the pre-verification result includes a pre-verification failure result and a rule pre-execution result; if any constraint rule in the constraint rule set conflicts with other constraint rules, the pre-verification failure result is generated; if all constraint rules in the constraint rule set do not conflict, the rule pre-execution result is generated; In response to a selection operation of the user, a target product carrying a constraint rule is determined from a plurality of preset products, wherein the target product includes the product selected in the current selection operation and the product selected in the historical selection operation; In the case where the target product matches any of the pre-selected product combinations, the pre-check result of the target pre-selected product combination matching the target product is executed; in the case where the pre-check result includes the pre-check failure result, the pre-check failure result is fed back to the user, and any constraint rule is refused to be executed; in the case where the pre-check result includes the rule pre-execution result, the product selection for this selection operation is performed according to the rule pre-execution result, and the product selection result is fed back to the user; The pre-checking of the constraint rule set, determining whether the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set conflict with each other, and generating a pre-checking result for the pre-selected product combination, includes: Determine, in the constraint rule set, a first constraint rule indicating a dependency relationship and a second constraint rule indicating a mutually exclusive relationship; Combining the dependent products corresponding to the first constraint rule to obtain various dependent product combinations, and combining the mutually exclusive products corresponding to the second constraint rule to obtain various mutually exclusive product combinations; In the case that there are no identical products between the dependent product combination and the mutually exclusive product combination, determining that the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set do not conflict with each other, and generating the rule pre-execution result; In the case that the same product exists between the dependent product combination and the mutually exclusive product combination, a conflict between the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set is determined, and the pre-check failure result is generated.
2. The method according to claim 1, characterized in that The generating the rule pre-execution result includes: Based on the constraint rule set and the historical execution rule set, at least one target constraint rule is screened out from the constraint rule set; the historical execution rules in the historical execution rule set are constraint rules that have been executed before the next selection operation, and the target constraint rule refers to a constraint rule that has not been executed before the next selection operation and corresponds to the next selection operation; The rule pre-execution result is generated according to the at least one target constraint rule.
3. The method according to claim 2, characterized in that Generating the rule pre-execution result according to the at least one target constraint rule includes: For each target constraint rule, according to the dependency relationship indicated by the target constraint rule, determine that the dependent product corresponding to the target constraint rule is selected, or, according to the mutually exclusive relationship indicated by the target constraint rule, determine that the mutually exclusive product corresponding to the target constraint rule is prohibited from selection; The rule pre-execution result is determined based on the selected dependent products and the disabled mutually exclusive products.
4. The method according to claim 3, characterized in that After performing product matching for this selection operation according to the rule pre-execution result, the method further includes: The target constraint rule is added to the historical execution rule set.
5. The method according to claim 3, characterized in that: The method further comprises: In the case where the product characteristic of the pre-selected product indicates that the pre-selected product does not co-exist with the dependent product corresponding to the target constraint rule, the dependent product is not selected.
6. The method according to claim 1, characterized in that The method further comprises: In the case where a dependent product corresponding to a constraint rule in the constraint rule set carries a constraint rule, the dependent product is used as the pre-selected product to redefine the constraint rule set.
7. The method according to claim 1, characterized in that The generating the pre-check failure result includes: Determine conflicting products in the constraint rule set and constraint rules associated with the conflicting products, wherein the conflicting products are other products that have the dependency relationship with the first pre-selected product in the constraint rule set and the mutually exclusive relationship with the second pre-selected product in the constraint rule set; The pre-verification failure result is determined based on the conflicting product and the constraint rules associated with the conflicting product.
8. The method according to claim 7, characterized in that The feeding back the pre-verification failure result to the user includes: A verification failure interface is displayed, wherein the verification failure interface displays the conflicting product, the constraint rules associated with the conflicting product, and prompt information, wherein the prompt information is used to prompt the user to reselect the target product.
9. The method according to claim 1, characterized in that: The feeding back of the product selection result to the user includes: An execution result interface is displayed, wherein the execution result interface displays the products selected and the products prohibited in this selection operation.
10. A product selection device, characterized in that: The device comprises: A product determination module, configured to determine, in response to the completion of product selection, selected products carrying constraint rules and unselected products carrying constraint rules from a plurality of preset products; A rule combination module is used to combine the unselected product with the selected product for each of the unselected products to obtain a preselected product combination; and for each preselected product combination, combine multiple constraint rules carried by each preselected product in the preselected product combination to obtain a constraint rule set; the constraint rule is used to indicate the association relationship between the preselected product and other products, and the association relationship includes a dependent relationship and a mutually exclusive relationship; when the constraint rule indicates that the association relationship between the preselected product and other products is the dependent relationship, the other products associated with the preselected product are dependent products; when the constraint rule indicates that the association relationship between the preselected product and other products is the mutually exclusive relationship, the other products associated with the preselected product are mutually exclusive products; A rule pre-verification module is used to pre-verify the constraint rule set, determine whether there is a conflict between the dependency relationship and the mutual exclusion relationship indicated by each constraint rule in the constraint rule set, and generate a pre-verification result for the pre-selected product combination; the pre-verification result includes a pre-verification failure result and a rule pre-execution result; if any constraint rule in the constraint rule set conflicts with other constraint rules, the pre-verification failure result is generated; if all constraint rules in the constraint rule set do not conflict, the rule pre-execution result is generated; A product selection module, configured to determine, in response to a user's selection operation, a target product carrying a constraint rule from a plurality of preset products, wherein the target product includes the product selected in the current selection operation and the product selected in the historical selection operation; A result feedback module is used to, when the target product matches any of the pre-selected product combinations, execute according to the pre-verification result of the target pre-selected product combination that matches the target product; when the pre-verification result includes the pre-verification failure result, feedback the pre-verification failure result to the user and refuse to execute any constraint rule; when the pre-verification result includes the rule pre-execution result, perform product matching for this selection operation according to the rule pre-execution result, and feedback the product matching result to the user; The rule pre-checking module is specifically used for: Determine, in the constraint rule set, a first constraint rule indicating a dependency relationship and a second constraint rule indicating a mutually exclusive relationship; Combining the dependent products corresponding to the first constraint rule to obtain various dependent product combinations, and combining the mutually exclusive products corresponding to the second constraint rule to obtain various mutually exclusive product combinations; In the case that there are no identical products between the dependent product combination and the mutually exclusive product combination, determining that the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set do not conflict with each other, and generating the rule pre-execution result; In the case that the same product exists between the dependent product combination and the mutually exclusive product combination, a conflict between the dependent relationship and the mutually exclusive relationship indicated by each constraint rule in the constraint rule set is determined, and the pre-check failure result is generated.
11. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the product selection method as described in any one of claims 1 to 9 are performed.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the product selection method according to any one of claims 1 to 9 are executed.
