Variable deduction method and device and related equipment
By using the counterfactual solution method and leveraging variable constraint models and mapping relationships, the problem of low efficiency and high cost in forward traversal optimization is solved, achieving efficient and low-cost variable deduction.
Patent Information
- Application Number
- CN202410624563.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2025-11-18
AI Technical Summary
In existing technologies, variable deduction using forward traversal optimization methods suffers from low efficiency and high cost, especially when there are a large number of unknown variables.
The counterfactual approach is adopted to obtain variable constraints and variable mapping relationships, establish a variable constraint model, and use mathematical tools or artificial intelligence models to perform counterfactual solutions to determine the original variable value range for the target variable to satisfy the constraints.
It improves the efficiency of variable inference, reduces computational costs, and decreases the consumption of computational resources.
Smart Images

Figure CN120975217A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular, to a variable deduction method and device and related equipment. BACKGROUND
[0002] In actual application scenarios, it can be required to determine the values or value ranges of some variables according to the values (or value ranges) of other variables. Optionally, this process can be referred to as variable deduction. For example, in the field of enterprise management, the business objectives of an enterprise can be regarded as requirements for the values or value ranges of some variables (such as total profit, profit margin, etc.), and the variables corresponding to the business strategies in the business process of the enterprise (such as cost, pricing, etc.) can be regarded as variables with unknown values or value ranges, and then variable deduction can be performed to determine the business strategies that meet the business objectives.
[0003] Currently, variable deduction can be performed by a forward traversal optimization method. For example, all possible values of an unknown variable can be obtained in advance, and then it can be determined whether each possible value can meet the requirements, so as to determine the value range of the unknown variable. In this way, by traversing all possible values of the unknown variable, the value range of the unknown variable can be determined, and variable deduction can be completed.
[0004] However, the above-mentioned forward traversal optimization method needs to traverse all possible values, and each traversal needs to be calculated once. When the number of unknown variables is large, the number of calculations to be performed is large, and there is a problem of low efficiency and high cost. SUMMARY
[0005] Therefore, the present application provides a variable deduction method for realizing efficient variable deduction. The present application also provides corresponding devices, computing device clusters, computer readable storage media, and computer program products.
[0006] In a first aspect, the present application provides a variable deduction method. The method can be implemented by a variable deduction device to determine the value range of a suitable original variable through counterfactual reasoning. Specifically, during the variable deduction process, the variable constraint conditions and the variable mapping relationship in the variable deduction process can be obtained. The variable mapping relationship is used to indicate the mapping relationship from at least one original variable to a target variable, and the variable constraint condition is used to constrain the value of at least one target variable in the variable deduction process. That is, according to the variable mapping relationship, the target variable can be determined from the at least one original variable. After obtaining the variable constraint condition and the variable mapping relationship, counterfactual reasoning can be performed according to the variable mapping relationship and the variable constraint condition to determine the value range of each original variable that satisfies the variable constraint condition of the target variable through counterfactual reasoning. Compared with the traditional way of determining the value range through multiple forward deductions, through counterfactual reasoning, it is not necessary to perform multiple forward deductions based on different combinations of the values of each original variable, so as to determine the value range of the original variable, which has a faster processing speed and a smaller amount of dizziness. In this way, based on the variable mapping relationship between the target variable and the original variable, counterfactual reasoning can be performed to determine the value range of each original variable that satisfies the variable constraint condition of the target variable. In this way, the efficiency of variable deduction is improved, and the cost of variable deduction is reduced.
[0007] In some possible implementation ways, counterfactual reasoning can be performed by establishing a model. Specifically, after obtaining the variable constraint condition and the variable mapping relationship, a variable constraint model can be established according to the variable constraint condition and the variable mapping relationship, and then counterfactual reasoning can be performed on the variable constraint model to determine the value range of each original variable that satisfies the variable constraint condition of the target variable. In this way, after the variable constraint condition and the variable mapping relationship are abstractly described by a mathematical model, counterfactual reasoning can be performed using mathematical tools, thereby improving the efficiency and accuracy of counterfactual reasoning.
[0008] In some possible implementation ways, the variable constraint model includes a target variable error term used to describe the difference between the actual value of the target variable and the value of the target variable constrained by the variable constraint condition. Specifically, the target variable error term can be established according to the value or value range of the target variable constrained by the variable constraint condition and the variable mapping relationship. During the counterfactual reasoning process, the target variable error term represents the difference between the value or value range of the target variable calculated according to the original variable and the variable mapping relationship and the value or value range of the target variable constrained by the variable constraint condition. According to the target variable error term, the variable constraint model can be determined. In this way, during the counterfactual reasoning process, the value of the target variable can be controlled to match the variable constraint condition through the target variable error term, thereby providing a basis for counterfactual reasoning.
[0009] In some possible implementation manners, the variable constraint model can further include constraints on original variables. Specifically, the variable constraint condition can be further used to constrain the value or value range of at least one original variable. When the variable constraint model is established, an original variable error term can be established according to the value or value range of the original variable constrained by the variable constraint condition. The original variable error term indicates the difference between the value or value range of the original variable in the counterfactual solution process and the value or value range of the original variable constrained by the variable constraint condition. Accordingly, the variable constraint model can be obtained according to the target variable error term and the original variable error term. In this way, in the counterfactual solution process, the value range of the original variable can be limited by the original variable error term, so as to avoid the original variable exceeding the constraint of the variable constraint condition.
[0010] In some possible implementation manners, the historical fluctuation of the original variable can also be constrained. Specifically, the variable constraint model can be determined according to the target variable error term, the original variable error term, and an original variable fluctuation term. The original variable fluctuation term indicates the difference between the value of each original variable in the counterfactual solution process and the historical value of the original variable. Accordingly, the historical value of each original variable can be obtained first, and then the original variable fluctuation term can be established according to the historical value of the original variable. In this way, in the counterfactual solution process, the difference between the original variable and the historical value can be limited by the original variable fluctuation term, so as to avoid the difference between the original variable and the historical value being too large.
[0011] In some possible implementation manners, the counterfactual solution process can also be modified. Specifically, after the counterfactual solution, the value range obtained by the counterfactual solution can be displayed to the user, and feedback information given by the user for the value range can be obtained. According to the feedback information, the counterfactual solution process can be modified. In this way, the counterfactual solution process can be optimized and modified according to the feedback of the user, so as to improve the accuracy of the counterfactual solution.
[0012] In a second aspect, the present application provides a variable deduction device, which comprises: a constraint condition acquisition unit, configured to acquire a variable constraint condition, the variable constraint condition being used to constrain the value or value range of at least one target variable; a mapping relationship acquisition unit, configured to acquire a variable mapping relationship corresponding to each target variable, the variable mapping relationship being used to indicate the mapping relationship from at least one original variable to the target variable; and a counterfactual solution unit, configured to perform counterfactual solution according to the variable mapping relationship and the variable constraint condition, and determine the value range of each original variable that makes the target variable satisfy the variable constraint condition.
[0013] In some possible implementation manners, the counterfactual solution unit is specifically configured to establish a variable constraint model according to the variable constraint condition and the variable mapping relationship; and perform counterfactual solution on the variable constraint model.
[0014] In some possible implementation manners, the counterfactual solution unit is specifically configured to establish a target variable error term according to a value or a value range of the target variable constrained by the variable constraint condition and the variable mapping relationship, the target variable error term indicating a difference between a value or a value range of the target variable calculated according to the original variable in the counterfactual solution process and the value or the value range of the target variable constrained by the variable constraint condition; and determine the variable constraint model according to the target variable error term.
[0015] In some possible implementation manners, the variable constraint condition is further configured to constrain a value or a value range of at least one original variable; the counterfactual solution unit is specifically configured to establish an original variable error term according to a value or a value range of the at least one original variable constrained by the variable constraint condition, the original variable error term indicating a difference between a value or a value range of the at least one original variable in the counterfactual solution process and the value or the value range of the at least one original variable constrained by the variable constraint condition; and determine the variable constraint model according to the target variable error term and the original variable error term.
[0016] In some possible implementation manners, the counterfactual solution unit is specifically configured to obtain a historical value of each original variable; establish an original variable fluctuation term according to the historical value of each original variable, the original variable fluctuation term indicating a difference between a value of each original variable in the counterfactual solution process and the historical value; and determine the variable constraint model according to the target variable error term, the original variable error term and the original variable fluctuation term.
[0017] In some possible implementation manners, the apparatus further includes a correction unit; and the correction unit is configured to display a value range obtained by the counterfactual solution; obtain feedback information for the value range; and correct the counterfactual solution process according to the feedback information.
[0018] In a third aspect, the present application provides a computing device, comprising at least one processor and at least one memory; the at least one memory is configured to store instructions, and the at least one processor is configured to execute the instructions stored in the at least one memory, so that the computing device executes the method in the first aspect or any possible implementation manner of the first aspect. It should be noted that the memory can be integrated into the processor, or can be independent of the processor. The at least one computing device can further comprise a bus. The processor is connected to the memory through the bus. The memory can comprise a readable memory and a random access memory.
[0019] In a fourth aspect, the present application provides a computing device cluster, comprising at least one computing device, the at least one computing device comprising at least one processor and at least one memory; the at least one memory is configured to store instructions, and the at least one processor is configured to execute the instructions stored in the at least one memory, so that the computing device cluster executes the method in the first aspect or any possible implementation manner of the first aspect. It should be noted that the memory can be integrated into the processor, or can be independent of the processor. The at least one computing device can further comprise a bus. The processor is connected to the memory through the bus. The memory can comprise a readable memory and a random access memory.
[0020] In a fifth aspect, the present application provides a computer readable storage medium, which stores instructions, and when the instructions are executed on at least one computing device, the at least one computing device executes the method in the first aspect or any implementation manner of the first aspect.
[0021] In a sixth aspect, the present application provides a computer program product comprising instructions, and when the instructions are executed on at least one computing device, the at least one computing device executes the method in the first aspect or any implementation manner of the first aspect.
[0022] On the basis of the implementation manners of the above aspects, the present application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0024] Figure 1a A scene diagram of one application scenario of the variable deduction method provided by the embodiments of the present application;
[0025] Figure 1b A scenario diagram of another application scenario of the variable deduction method provided by the embodiments of the present application;
[0026] Figure 1c A scenario diagram of another application scenario of the variable deduction method provided by the embodiments of the present application;
[0027] Figure 2 A flow diagram of the variable deduction method provided by the present application;
[0028] Figure 3 A flow diagram of the method for counterfactual solution by establishing a mathematical model provided by the present application;
[0029] Figure 4 A structural diagram of the variable deduction device provided by the embodiments of the present application;
[0030] Figure 5 A structural diagram of the computing device provided by the embodiments of the present application;
[0031] Figure 6 A structural diagram of the computing device cluster provided by the embodiments of the present application;
[0032] Figure 7 An implementation diagram of the computing device cluster provided by the embodiments of the present application. DETAILED DESCRIPTION
[0033] The schemes in the embodiments provided by the present application will be described below with reference to the drawings in the present application.
[0034] The terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the terms thus used can be interchanged under appropriate circumstances, and this is only a distinguishing way adopted in the description of the embodiments of the present application to describe the objects with the same attributes.
[0035] First, some nouns related to the present application will be introduced.
[0036] Variable mapping relationship: The variable mapping relationship can also be referred to as a mapping relationship. The variable mapping relationship can be determined according to the association relationship between variables. According to the variable mapping relationship, the value (or value range) of some variables can be determined based on the value (or value range) of some other variables. Among them, the variable determined based on the variable mapping relationship can be referred to as a dependent variable, and the variable used to determine the dependent variable can be referred to as an independent variable. In some possible implementation manners, the independent variable can be referred to as an original variable, and the dependent variable can be referred to as a target variable. That is, the variable mapping relationship can indicate how the target variable is calculated according to which original variables. One variable mapping relationship can correspond to one target variable, or can correspond to multiple target variables.
[0037] Variable deduction: Variable deduction refers to deducing possible values or value ranges of some variables according to possible values or value ranges of some other variables. According to the variable mapping relationship, the variable deduction process can be divided into forward deduction and reverse deduction. The forward deduction refers to a process of determining the value (or value range) of the dependent variable based on the value (or value range) of the independent variable according to the variable mapping relationship. The reverse deduction refers to a process of determining the value (or value range) of the independent variable based on the value (or value range) of the dependent variable according to the variable mapping relationship. The variable deduction process involved below is related to reverse deduction.
[0038] Variable constraint condition: The variable constraint condition can also be referred to as a constraint condition, which refers to a limitation condition for the value (or value range) of the variable, and is a reference in the variable deduction process. Optionally, the variable constraint condition includes a constraint condition for the target variable. That is, in the process of deducing the value range of the original variable, the value range of the original variable that satisfies the constraint condition of the target variable can be determined according to the constraint condition of the target variable. Optionally, the variable constraint condition can also include a constraint condition for the original variable.
[0039] Counterfactual solution: Counterfactual solution, also known as counterfactual explanation. Counterfactual solution can take the target as a result that has occurred, and reversely deduce the condition that satisfies the result. Through counterfactual solution, the value range of the original variable that satisfies the variable constraint condition of the target variable can be determined. The counterfactual solution can be realized through artificial intelligence technology, or realized through a model solution technology that does not depend on artificial intelligence.
[0040] In some practical application scenarios, the variable constrained by the variable constraint condition can be a target variable in the variable constraint relationship. Therefore, the value range of the original variable needs to be determined by means of reverse deduction. For example, in the field of enterprise management, it is often necessary to determine the business strategy of an enterprise according to the business target of the enterprise. However, the value of the variable involved in the business target is often calculated according to the value of the variable involved in the business strategy. Therefore, the variable involved in the business target can be regarded as a target variable, and the variable involved in the business strategy can be regarded as an original variable, and the business strategy can be determined by means of variable deduction.
[0041] At present, reverse deduction can be performed by means of forward optimization. In the process of forward optimization, multiple forward deductions can be performed, and the value range of the original variable can be determined based on the result of the forward deduction. Specifically, in the process of each forward deduction, a set of values of the original variable can be preset, and then the value of the target variable under the set of values can be calculated based on the variable mapping relationship. Then, it can be judged whether the calculated value of the target variable meets the value condition of the target variable. If it meets, it is determined that the set of values of the original variable is in the value range of the original variable obtained by reverse deduction. If it does not meet, it is determined that the set of values of the original variable is not in the value range of the original variable obtained by reverse deduction. In this way, each forward deduction can determine whether a set of values of the original variable is in the value range, so multiple forward deductions can be performed to determine the value range of the original variable that makes the target variable meet the variable constraint condition.
[0042] For example, assuming that the variable mapping relationship is "gross profit = sales quantity * sales unit price - total cost", and the target of the enterprise is "the gross profit of the next quarter reaches A". Then when determining the business strategy, it is necessary to determine the value range of the original variable "sales quantity", the original variable "sales unit price" and the original variable "total cost" by means of reverse deduction based on the variable constraint condition of the target variable "gross profit" according to the variable mapping relationship.
[0043] Correspondingly, in the process of forward optimization, the value range of each original variable can be set first, and multiple sets of values of the original variable can be determined. For example, assuming that the value range of the original variable "sales quantity" is [a1, a2], the value range of the original variable "sales unit price" is [b1, b2], and the value range of the original variable "total cost" is [c1, c2], where a1 > a2, b1 > b2, and c1 > c2.
[0044] In each forward deduction process, a value can be selected from the value range [a1, a2] as the value of the original variable "sales quantity", a value can be selected from the value range [b1, b2] as the value of the original variable "sales unit price", a value can be selected from the value range [c1, c2] as the value of the original variable "total cost", the gross profit rate under the values is calculated based on the variable mapping relationship "sales quantity * sales unit price - total cost = gross profit", and it is judged whether the calculated gross profit rate is greater than A. If it is greater, it is determined that the selected value belongs to the value range that makes the target variable satisfy the variable constraint condition. If it is greater, it is determined that the selected value does not belong to the value range that makes the target variable satisfy the variable constraint condition. In this way, through multiple forward deductions, the value range of each original variable can be determined
[0045] Although the forward optimization method can determine the value range that makes the target variable satisfy the variable constraint condition, the essence of this method is to try and error through traversal, and the number of traversals depends on the number of values that the original variable can select, so it has high time complexity and low efficiency and high cost problems.
[0046] For example, if 8 values are selected for the original variable "sales quantity" in the value range [a1, a2], 9 values are selected for the original variable "sales unit price" in the value range [b1, b2], and 10 values are selected for the original variable "total cost" in the value range [c1, c2] in the forward optimization process, then there are 8*9*10=720 original variables in the forward optimization process, and 720 forward deductions need to be performed. Obviously, 720 forward deductions require a lot of time and have low efficiency. Also, a large number of calculations are required, which consumes a large amount of computing resources and has high cost.
[0047] Further, in some complex application scenarios, the number of original variables can be large, the number of target variables can also be large, and the variable mapping relationship between the original variables and the target variables can also be complex. If the forward optimization method is used for variable deduction, an abnormally large amount of calculation is required, and there are obvious disadvantages in timeliness and economy. For example, in the process of actual business management of an enterprise, dozens or even hundreds or thousands of financial indicators can be involved, and each financial indicator can be used as an original variable. Moreover, the cross-checking relationship between the financial indicators is quite complex. It is difficult to deduce the appropriate value range of the original variable by the forward optimization method.
[0048] Based on this, the application provides a variable deduction method. The method can be realized by a variable deduction device, and the value range of a suitable original variable is determined through counterfactual reasoning. Specifically, first, the variable constraint conditions can be obtained. The variable constraint conditions include the constraint conditions for the target variables, which are used to constrain the value or value range of at least one target variable. In addition, the variable mapping relationship corresponding to each target variable can also be obtained, which determines how each target variable is calculated according to which original variables. Then, counterfactual reasoning can be performed according to the variable mapping relationship and the variable constraint conditions, and the value range of each original variable that makes the target variable satisfy the variable constraint conditions is determined through counterfactual reasoning. That is, compared with the traditional way of determining the value range through multiple forward deductions, through the way of counterfactual reasoning, it is not necessary to perform multiple forward deductions based on different combinations of the values of each original variable, so as to determine the value range of the original variable, which has a faster processing speed and a smaller amount of dizziness. In this way, based on the variable mapping relationship between the target variable and the original variable, counterfactual reasoning can be performed to determine the value range of each original variable that makes the target variable satisfy the variable constraint conditions. In this way, the efficiency of variable deduction is improved, and the cost of variable deduction is reduced.
[0049] Next, various non-limiting specific embodiments of the variable deduction process are described in detail.
[0050] First, an exemplary application scenario is introduced. The variable deduction method provided by the application can be applied to a client or a server. The client can be a software or software module running on a terminal device. The terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, or a device such as a personal computer. The server can be a software or software module running on a server or a server cluster. Alternatively, the variable deduction method can also be realized by other entity devices or virtual devices with data processing capabilities. Here, no limitation is made. Next, some implementation manners of the variable deduction method realized based on the client are introduced, and some implementation manners of the variable deduction method realized based on the server are introduced. Figure 1a Some implementation manners of the variable deduction method realized based on the client are introduced, and some implementation manners of the variable deduction method realized based on the server are introduced. Figure 1b Some implementation manners of the variable deduction method realized based on the client are introduced, and some implementation manners of the variable deduction method realized based on the server are introduced.
[0051] Reference is made to Figure 1a , Figure 1a A scene schematic diagram of an application scenario of the variable deduction method provided by the application is shown. In the application scenario, the variable deduction method can be applied to a client or a server. Figure 1aIn the application scenario shown, the variable deduction apparatus 111 runs on the client 110. The user A can perform variable deduction through the variable deduction apparatus 111 running on the client 110. Specifically, the user A can input variable constraint conditions in the client 110. The constraint condition acquisition unit 1111 in the variable deduction apparatus 111 can acquire the variable constraint conditions input by the user A. In addition, the mapping relationship acquisition unit 1112 in the variable deduction apparatus 111 can also acquire the variable mapping relationship corresponding to each target variable. In Figure 1a In the implementation manner shown, the variable mapping relationship can be input by the user A on the client 110, and the variable mapping relationship acquired by the mapping relationship acquisition unit 1112 is the variable mapping relationship input by the user A. The variable deduction apparatus 111 further includes a counterfactual solution unit 1113. The counterfactual solution unit 1113 can perform counterfactual solution according to the variable constraint conditions acquired by the constraint condition acquisition unit 1111 and the variable mapping relationship acquired by the mapping relationship acquisition unit 1112, to determine the value range of each original variable that makes the target variable satisfy the variable constraint conditions. Moreover, the value range obtained by the counterfactual solution unit 1113 can be displayed to the user A through the client 110, or can be further processed. The counterfactual solution unit 1113 can perform counterfactual solution by calling the computing resources of the client 110 to perform operation, or can perform counterfactual solution by calling a model having counterfactual solution capability.
[0052] Referring to Figure 1b , Figure 1b Another application scenario of the variable deduction method provided in the present application is shown in a scenario diagram. In Figure 1b In the application scenario shown, the variable deduction apparatus 121 runs on the server 120. The user B can input variable constraint conditions through the client 130. The client 130 can send the variable constraint conditions to the server 120 through the network. The variable deduction apparatus 121 includes a constraint condition acquisition unit 1211, a mapping relationship acquisition unit 1212, and a counterfactual solution unit 1213. The constraint condition acquisition unit 1211 can acquire the variable constraint conditions received by the server 120. The mapping relationship acquisition unit 1212 can acquire the variable mapping relationship. In Figure 1bIn the application scenarios shown, the variable mapping relationship can be pre-stored in the data storage apparatus 140. After obtaining the variable constraint condition, the mapping relationship obtaining unit 1212 can obtain the relevant variable mapping relationship from the data storage apparatus 140. The counterfactual solving unit 1213 can perform counterfactual solving according to the variable constraint condition and the variable mapping relationship to obtain the value range of each original variable that makes the target variable satisfy the variable constraint condition. Optionally, the variable deduction apparatus 121 can send the value range obtained by the counterfactual solving unit 1213 to the client 130 through the network. Alternatively, the value range obtained by the counterfactual solving unit 1213 can also continue to be processed subsequently in the server 120.
[0053] The data storage apparatus 140 is software or hardware for storing data. Optionally, the data storage apparatus 140 can be implemented based on a database, for example, can be implemented based on a relational database or a vector database. Optionally, the data storage apparatus 140 and the server 120 can run on the same computing device or computing device cluster, or can run on different computing devices or computing device clusters.
[0054] It should be noted that the above two application scenarios are only examples, and the variable deduction method provided in the embodiments of the present application can be applied to any application scenario that needs to deduce original variables according to the constraint conditions of target variables.
[0055] The specific implementation of the variable deduction method will be described in detail below
[0056] Referring to Figure 2 , Figure 2 is a flowchart of the variable deduction method provided in the present application. The method can be applied to Figure 1a or Figure 1b application scenarios shown, or can also be applied to other applicable application scenarios.
[0057] Specifically, Figure 2 The variable deduction method shown can specifically include:
[0058] S201: Obtain a variable constraint condition.
[0059] In the variable deduction process, the variable constraint condition can be obtained first. The variable constraint condition represents the limitation on the value or value range of the variable in the variable deduction process. Specifically, the variable constraint condition can include a condition for constraining a target variable, and the condition for constraining the target variable is used to constrain the value or value range of at least one target variable. Optionally, the number of target variables involved in the variable deduction process can be one or multiple. If multiple target variables are involved, the variable constraint condition can include a constraint condition for each target variable.
[0060] Optionally, the variable constraint condition can be input by a user initiating the variable deduction. Specifically, the user can set the variable constraint condition according to the requirement of the variable deduction, and send it to the variable deduction device through the client.
[0061] In some possible implementation manners, the variable constraint condition only includes a condition related to the target variable, i.e., the variable constraint condition is only used to constrain the value or value range of the target variable. Alternatively, in some other possible implementation manners, it is also required to limit the value or value range of the original variable in the variable deduction process, and accordingly, the variable constraint condition can also include a condition related to the original variable, i.e., the variable constraint condition can be used to constrain the value or value range of the target variable, and can also be used to constrain the value or value range of the original variable.
[0062] For example, it is assumed that the method of variable deduction is used to determine the business strategy of a company in the field of business management, and the variable "gross profit", the variable "sales unit price", the variable "sales quantity" and the variable "total cost" are involved in the business process of the company. In the actual business management process of the company, due to the limitation of the scale of the company, when the business target is specified, it is required to not only ensure that the gross profit of the company reaches a certain standard, but also control the total cost of the company within a certain range. Thus, the variable constraint condition set by the user includes not only the constraint condition for the target variable "gross profit", but also the constraint condition for the original variable "total cost".
[0063] In some possible implementation manners, the variable constraint condition can be used to indicate the target variable. Optionally, the target variable in the variable deduction process can be marked in the variable constraint condition. If the variable constraint condition also includes the constraint condition for the original variable, the original variable in the variable deduction process can also be marked in the variable constraint condition. In this way, the original variable and the target variable in the variable deduction process can be determined according to the variable constraint condition. Optionally, the marking of the target variable can be completed by the user who sets the variable constraint condition.
[0064] Alternatively, if only one variable is constrained in the variable constraint condition, even if the target variable is not marked in the variable constraint condition, the variable that is constrained can be determined as the target variable.
[0065] It should be noted that although the dependent variable in the variable mapping relationship can be referred to as the target variable in the foregoing introduction of the terms. However, if the user specifies a certain variable as the target variable in the variable constraint condition, even if the variable is not the dependent variable in the variable mapping relationship, the variable can also be used as the target variable for variable deduction.
[0066] Alternatively, in some other possible implementations, the variable constraint condition can not be used to indicate the target variable. That is, the variable constraint condition is used to constrain one or more variables. The variable deduction apparatus can determine at least one target variable and at least one original variable from a plurality of variables involved in the variable deduction process according to the variable mapping relationship. Accordingly, the user who sets the variable constraint condition can not specify the target variable and the original variable. The process of determining the target variable according to the variable mapping relationship can be referred to below, and will not be described here.
[0067] S202: Obtain the variable mapping relationship corresponding to each target variable.
[0068] In order to perform variable deduction by means of counterfactual reasoning, in addition to the variable constraint condition, the variable deduction apparatus can also obtain the variable mapping relationship corresponding to the target variable, so as to perform counterfactual reasoning based on the variable mapping relationship. The variable mapping relationship is used to indicate the mapping relationship from at least one original variable to the target variable. That is, according to the variable mapping relationship, at least one original variable can be mapped to the target variable. Optionally, if the variable deduction process involves a plurality of target variables, the variable mapping relationship corresponding to each target variable can be obtained, that is, a plurality of variable mapping relationships are obtained.
[0069] Optionally, the variable mapping relationship that can be involved in the variable deduction process can be stored in the mapping relationship data storage apparatus in advance. After the variable constraint condition is obtained, the variable mapping relationship corresponding to the target variable can be obtained from the data storage apparatus. For example, if the variable deduction method is applied to the field of enterprise management, the interlocking relationship between various indicators in the financial field can be abstracted into mathematical formulas in advance, the mapping relationship between the variables in this field is obtained, and these mapping relationships are stored in the mapping relationship data storage apparatus. In this way, when variable deduction is needed, the mapping relationship corresponding to the target variable can be obtained from the mapping relationship data storage apparatus. In some scenarios, the mapping relationship corresponding to the target variable can not exist in the mapping relationship data storage apparatus. In this way, the variable deduction process can be ended, or a reminder can be sent to the user so that the user manually sets the variable mapping relationship corresponding to the target variable.
[0070] As introduced above, the variable constraint condition can indicate the target variable or can not indicate the target variable. This will be introduced below.
[0071] In the first implementation, the variable constraint condition indicates the target variable. Accordingly, the variable mapping relationship corresponding to the target variable can be obtained by querying according to the target variable indicated by the variable constraint condition. Optionally, if the target variable is marked by the variable constraint condition, the variable deduction device can take the target variable as a keyword to query the variable mapping relationship that can map other variables to the target variable from the mapping relationship data storage device.
[0072] In some possible implementations, there can be no mapping relationship that directly maps to the target variable in the mapping relationship data storage device. In this way, the variable deduction device can obtain the variable mapping relationship involving the target variable, for example, can obtain the variable mapping relationship taking the target variable as the independent variable, and then performs equivalent transformation on the variable mapping relationship involving the target variable, so as to obtain the variable mapping relationship for mapping the original variable to the target variable, that is, the mapping relationship corresponding to the target variable.
[0073] For example, it is assumed that the user explicitly indicates the target variable as the variable "sales unit price" in the variable constraint condition, and the variable mapping relationship of the design variable "sales unit price" in the mapping relationship data storage device only includes the variable mapping relationship "gross profit = sales quantity * sales unit price - total cost". When obtaining the variable mapping relationship corresponding to the target variable "sales unit price", the variable deduction device can obtain the variable mapping relationship "gross profit = sales quantity * sales unit price - total cost" according to the target variable "sales unit price", and then perform equivalent transformation on the variable mapping relationship to determine the variable mapping relationship taking the target variable "sales unit price" as the dependent variable, that is, the variable mapping relationship "sales unit price = (gross profit + total cost) / sales quantity".
[0074] In the second implementation, the variable constraint condition does not indicate the target variable. Accordingly, the variable mapping relationship can be obtained based on the variables involved in the variable constraint condition, and then the independent variable in the variable mapping relationship can be taken as the target variable.
[0075] Specifically, when obtaining the variable mapping relationship corresponding to the target variable, the variable deduction device can first determine at least one variable involved in the variable constraint condition according to the variable constraint condition. For each variable, the variable deduction device can query from the mapping relationship data storage device whether there is a variable mapping relationship that maps to the variable, that is, query whether there is a mapping relationship that takes the variable as the independent variable in the mapping relationship data storage device. If there is, the variable can be determined as the target variable, and the variable mapping relationship that maps to the target variable is obtained. If not, the variable can be determined as the original variable.
[0076] Since the target variable is obtained by other variables through the variable mapping relationship, the value of the non-target variable in the variable mapping relationship will affect the value of the target variable. Therefore, the non-target variable in the variable mapping relationship can be determined as the original variable. That is, after the variable mapping relationship corresponding to the target variable is determined, the variables involved in the variable mapping relationship except the target variable can be determined as the original variable. For example, the independent variable in the variable mapping relationship can be determined as the original variable.
[0077] S203: According to the variable mapping relationship and the variable constraint condition, counterfactual solution is performed to determine the value range of each original variable that makes the target variable satisfy the variable constraint condition.
[0078] After obtaining the variable constraint condition and the variable mapping relationship corresponding to the target variable, counterfactual solution can be performed based on the variable mapping relationship and the variable constraint condition, so as to determine the value range of each original variable that makes the target variable satisfy the variable constraint condition. In this way, the method of counterfactual solution is used instead of the traditional forward optimization method, and the traversal process based on the value of the original variable is cancelled, thereby improving the efficiency of variable deduction and reducing the cost of variable deduction.
[0079] Optionally, the variable deduction device can call a model with counterfactual solution capability to perform counterfactual solution. Specifically, some models, such as artificial intelligence (AI), may have the ability of counterfactual solution. The variable deduction device can use the counterfactual solution capability of these models to determine the value range of each original variable that makes the target variable satisfy the variable constraint condition according to the variable mapping relationship and the variable constraint condition.
[0080] Optionally, the variable deduction device can determine the value range of multiple groups of original variables. The value range of each group of original variables can make the target variable satisfy the constraint condition. Then, the variable deduction device can show the user the value range of the multiple groups of original variables, so that the user selects one or more groups of value ranges from the multiple groups of value ranges for subsequent processing.
[0081] For example, if the model with counterfactual solving capability is a Large Language Model (LLM), the variable inference device can generate prompts based on variable mapping relationships and variable constraints, and send these prompts to the LLM. The prompts instruct the LLM to perform counterfactual solving based on the variable mapping relationships and variable constraints, and return to the variable inference device the range of values for each original variable that satisfies the variable constraints. In this way, by invoking the model's counterfactual solving capability for variable inference, the variable inference device does not need to perform forward inference for each set of possible values for the original variables, improving the efficiency and reducing the cost of variable inference.
[0082] Optionally, the process can be as follows: Figure 1c As shown. In Figure 1b Based on the implementation shown, Figure 1c The implementation shown also includes a large language model 150. The counterfactual solving unit 1213 can generate prompt words and send them to the large language model 150. The large language model 150 can perform counterfactual solving based on the prompt words and return the results obtained from the counterfactual solving to the counterfactual solving unit 1213, thus completing variable inference.
[0083] Alternatively, the variable derivation device can also establish a mathematical model based on variable mapping relationships and variable constraints, and perform counterfactual solutions by solving the mathematical model to obtain the range of values for each original variable that makes the target variable satisfy the variable constraints. In this way, after abstractly describing the variable constraints and variable mapping relationships through a mathematical model, mathematical tools can be used for counterfactual solutions, improving the efficiency and accuracy of counterfactual solutions.
[0084] The following is combined with Figure 3 This paper introduces some implementation methods for counterfactual solutions by establishing mathematical models.
[0085] See Figure 3 , Figure 3 This is a flowchart illustrating a method for counterfactual problem solving using a mathematical model, as provided in this application. This method can be applied to... Figure 1a or Figure 1b The application scenarios shown can also be applied to other applicable application scenarios.
[0086] Specifically, Figure 3 The variable deduction method shown can specifically include:
[0087] S301: Get variable constraints.
[0088] To establish the mathematical model for counterfactual solving, the variable deduction apparatus can acquire variable constraint conditions. For details, refer to the foregoing description Figure 2 For corresponding implementations, details are not described herein.
[0089] In some implementations provided in the present application, the variable constraint condition can be used to constrain the value of the variable or the value range of the variable. For ease of introduction, in Figure 3 In corresponding implementations, taking the case where the variable constraint condition is used to constrain the value of the variable to be close to or equal to a certain value as an example.
[0090] According to the foregoing description, the variable constraint condition can be used to indicate the target variable or not. For example, the following describes the case where the variable constraint condition is not used to indicate the target variable.
[0091] S302: Acquire the variable mapping relationship corresponding to each target variable.
[0092] To establish the mathematical model for counterfactual solving, the variable deduction apparatus can also acquire variable constraint conditions. For details, refer to the foregoing description Figure 2 For corresponding implementations, details are not described herein.
[0093] If the variable constraint condition does not indicate the target variable, the variable deduction apparatus can determine the target variable and the original target variable according to the variable mapping relationship. For ease of introduction, the following describes the case where the number of target variables and the number of original variables are both greater than 1.
[0094] Specifically, if the variable constraint condition is used to constrain multiple variables, it can be determined one by one whether each variable is a target variable. When determining whether a certain variable constrained by the variable constraint condition is a target variable, it can be determined whether there is a variable mapping relationship in which the dependent variable is the variable to be constrained. If there is a variable mapping relationship in which the dependent variable is the variable to be constrained, the variable to be constrained can be determined as a target variable; if there is no variable mapping relationship in which the dependent variable is the variable to be constrained, the variable to be constrained can be determined as an original variable.
[0095] After the target variable is determined, the original variable can be further determined according to the target variable and the variable mapping relationship corresponding to the target variable. Specifically, the variable deduction apparatus can determine the other variables in the variable mapping relationship corresponding to the target variable as original variables, except for the target variable.
[0096] For ease of introduction, in Figure 3 In corresponding implementations, it is assumed that there are m target variables and n original variables, and y k represents the th target variable, and f represents the mapping relationshipk The variable mapping relationship corresponding to the kth target variable is represented by x i represents the ith original variable. Wherein, m and n are positive integers greater than 1, k is a positive integer less than m, and i is a positive integer less than n. And the vector represents a vector composed of original variables, and the vector represents a vector composed of target variables. That is, Correspondingly, the variable mapping relationship f k corresponding to the kth target variable can be represented as y k = f k (x1,x2,…,x n ).
[0097] S303: Establish a variable constraint model according to the variable constraint condition and the variable mapping relationship.
[0098] After obtaining the variable constraint condition and the variable mapping relationship, a mathematical model can be established according to the variable constraint condition and the variable mapping relationship to obtain the variable constraint model. Optionally, the variable constraint model can be a function related to a loss function (Loss Function). The loss function represents the difference between the actual value of the variable and the target value. In this way, by solving the variable constraint model, the value range of the variable that makes the difference between the actual value of the variable and the target value meet the preset condition can be determined, and the value range of each original variable that makes the target variable meet the variable constraint condition is obtained.
[0099] Optionally, the variable constraint model can include a target variable error term, which represents the difference between the value or value range of the target variable calculated in the counterfactual solving process and the value or value range of the target variable constrained by the variable constraint condition. Correspondingly, the target variable error term can be established for the value or value range of the target variable constrained by the variable constraint condition and the variable mapping relationship. Specifically, when determining the target variable error term, the target variable obtained according to the variable mapping relationship can be subtracted from the target variable constrained by the variable constraint condition, and the target variable error term can be determined according to the result of the subtraction. If the variable deduction process involves multiple target variables, subtraction can be performed for each target variable, and then the target variable error term can be determined according to the multiple subtraction results. In this way, in the counterfactual solving process, the value of the target variable can be controlled to match the variable constraint condition through the target variable error term, which provides a basis for counterfactual solving.
[0100] For example, in some implementations, the target variable error term L1 can be determined by the following formula (1).
[0101] Formula (1):
[0102] wherein, L1is a target variable error term; λ j is a hyper-parameter corresponding to the jth (j is a positive integer less than or equal to m) target variable, used for counterfactual solution; y ′ j is a value or a value range of the jth target variable (i.e. y j ) constrained by the variable constraint condition, in the counterfactual solution process, y ′ j can be treated as a fixed value; x1, x2, …, x n are n original variables involved in the variable deduction process, in the counterfactual solution process, the size of the original variable can change, i.e. the original variable can be treated as an independent variable. f j (x1, x2, …, x n ) is a variable mapping relationship from n original variables to the jth target variable, i.e. y j = f j (x1, x2, …, x n ). For example, for the target variable “gross profit”, the corresponding variable mapping relationship f (“sales unit price”, “sales quantity”, “total cost”) = sales unit price x sales quantity - total cost.
[0103] That is, for the constraint condition of each target variable in the variable constraint condition, the variable constraint relationship corresponding to the target variable can be subtracted from the value or value range constrained by the variable constraint condition, and the result obtained by the subtraction is multiplied by the hyper-parameter corresponding to the target variable. After summing the products of all target variables, the target variable error term is obtained. The target variable error term is obtained according to the error between the actual value of each target variable (i.e. the target variable calculated according to the mapping relationship) and the value or value range constrained by the variable constraint condition. By optimizing and solving the target variable error term, the value range of the original variable that can make the actual value of the target variable match the value or value range constrained by the variable constraint condition can be determined, thereby realizing counterfactual solution.
[0104] In some application scenarios, not only will there be requirements for the value or value range of the target variable in the variable deduction process, but also the value or value range of all or part of the original variables needs to be limited. For example, in the field of company management, not only will there be requirements for variables such as “gross profit”, but there may also be requirements for other indicators, such as controlling the variable “total cost” within a certain range. For these application scenarios, the variable constraint condition also includes constraint conditions for constraining original variables. Accordingly, when establishing the variable constraint model, the error between the original variable and the variable constraint condition can also be considered.
[0105] Specifically, the variable constraint model can include original variable error terms. These terms represent the difference between the value or range of the original variable during the counterfactual solution process and the value or range of the original variable constrained by the variable constraints. Accordingly, the original variable error terms can be determined based on the constraints related to the original variable within the variable constraints. Specifically, when determining the original variable error terms, the difference between the value or range of the original variable and the value or range of the original variable constrained by the variable constraints can be calculated, and the original variable error terms can be determined based on the result of this difference. If the variable derivation process involves multiple original variables, the difference can be calculated for each original variable, and the original variable error terms can be determined based on the multiple difference results. In this way, during the counterfactual solution process, the original variable error terms can limit the range of the original variable, preventing the original variable from exceeding the constraints of the variable constraints.
[0106] For example, in some implementations, the original variable error term L2 can be determined by the following formula (2).
[0107] Formula (2):
[0108] Where L2 is the original variable error term; λ j It is the hyperparameter corresponding to the i-th objective variable (i is a positive integer less than or equal to m), used for counterfactual solution; It is a vector consisting of n original variables. The values of each element in the solution can change during the counterfactual process.
[0109] Change; It is a vector The i-th original variable (i.e., x) i Replace x with the values or ranges of the original variables that are constrained; i ′ It is the value or range of values of the i-th original variable constrained by the variable constraint condition; It is a vector with vector The distance between them represents the distance between vectors. with vector The difference between them. That is, assuming n=4 and i=2, then
[0110] It is understandable that if the variable constraint does not constrain x... i Given the possible values or range of values of the original variable x, then... i Therefore, there is no difference between the values or ranges of values constrained by the original variable and the variable constraints, and thus, x can be set. i ′ =xi Thus, the vector is the same vector as the vector , the distance between the two is 0, i.e.
[0111] Thus, no matter what the value of the original variable x i is, it will not affect the original variable error term L2. Alternatively, the distance between the vector and the vector in the above formula (2) can be the Euclidean distance between the vector and the vector , i.e. the L1 regular distance between the vector and the vector . Or, the distance between the vector and the vector in the above formula (2) can be the Manhattan distance between the vector and the vector , i.e. the L2 regular distance between the vector
[0112] In some application scenarios, there can be requirements for the value or value range of the target variable and the value or value range of the original variable during the variable derivation process, and there can also be limitations on the fluctuation range of the original variable. For example, in the field of corporate management, there can be certain requirements for the fluctuation range of the variable. Assuming that the original variable includes the variable "sales unit price", and in the actual application scenario, although the sales unit price of the product can fluctuate, the fluctuation range is often limited. Therefore, during the variable derivation process, the fluctuation range of the original variable "sales unit price" can be displayed.
[0113] Accordingly, when establishing the variable constraint model, not only the error of the value or the value range of the target variable and the error of the value or the value range of the original variable can be considered, but also the fluctuation range of the original variable can be considered. Specifically, the variable constraint model can include a part for characterizing the fluctuation range of the original variable, which can be referred to as an original variable fluctuation term. When establishing the variable constraint model, the historical values of each original variable can be obtained, and then the original variable fluctuation term is established according to the historical values of the original variable, and then the variable constraint model is established according to the target variable error term, the original variable error term and the original variable fluctuation term. The original variable fluctuation term indicates the error between the value of each original variable in the counterfactual solution process and the historical value of the original variable. According to the original variable fluctuation term, the fluctuation range of the original variable can be controlled within a certain range in the counterfactual solution process. In this way, in the process of counterfactual solution, the difference between the original variable and the historical value can be limited by the original variable fluctuation term, so as to avoid that the difference between the original variable and the historical value is too large.
[0114] For example, in some implementations, the original variable fluctuation term L3 can be determined by the following formula (3).
[0115] Formula (3):
[0116] wherein L3 is the original variable fluctuation term; is the distance between the vector and the vector , which represents the difference between the vector and the vector , i.e. the fluctuation range of the original variable. The vector is a vector composed of original variables; is a vector composed of n original variables, each element of which can change in the counterfactual solution process; is a vector composed of the historical values of n original variables. That is, assuming n = 4, then wherein x1 h is the historical value of the original variable x1, x2 h is the historical value of the original variable x2, x3 h is the historical value of the original variable x3, and x4 h is the historical value of the original variable x4.
[0117] It should be noted that in some implementations introduced above, for example, in the implementation corresponding to formula (3), the variable constraint model can constrain the fluctuation range of each original variable. In some other possible implementations, the fluctuation range of part of the original variables can also be constrained. Here, no longer be described.
[0118] After the target variable error term, the original variable error term and the original variable fluctuation term are determined, the variable constraint model can be obtained accordingly. For example, the variable constraint model can be specifically as shown in the following formula (4) or formula (5).
[0119] Formula (4): L = L1 + L2 + L3
[0120] Formula (5):
[0121] The meanings of the elements in the formula (4) and the formula (5) can be referred to the above, and will not be repeated here.
[0122] S304: counterfactual solving is performed on the variable constraint model to obtain a value range of each original variable that makes the target variable satisfy the variable constraint condition.
[0123] After the variable constraint model is obtained, counterfactual solving can be performed on the variable constraint model, so as to obtain a value range of each original variable that makes the target variable satisfy the variable constraint condition. Specifically, if the variable constraint model is as shown in the above formula (4) or formula (5), gradient descent method can be used for counterfactual solving, so as to obtain the value range of the original variable.
[0124] In this embodiment, the variable constraint model is established according to the variable constraint condition and the variable mapping relationship, and counterfactual solving can be performed by solving the model. In this way, the complex counterfactual solving problem is abstracted into an optimization method based on a mathematical model, and the variable deduction process can be counterfactually solved by a mathematical method. Moreover, the variable constraint model can also include a constraint on the error and / or fluctuation range of the original variable, so as to not only control the error of the target variable, but also control the error and fluctuation range of the original variable, thereby improving the rationality of counterfactual solving.
[0125] As known from the foregoing, the variable deduction apparatus can obtain a plurality of value ranges of each original variable that makes the target variable satisfy the variable constraint condition by counterfactual solving, and the user can select one or more value ranges from the plurality of value ranges. Alternatively, the variable deduction apparatus can optimize the variable constraint condition according to the user's action of selecting the value range, thereby improving the accuracy of counterfactual solving. That is, the variable deduction apparatus can display the value range obtained by counterfactual solving, then obtain feedback information for the value range, and finally optimize and correct the counterfactual solving process according to the feedback information. In this way, the accuracy of the counterfactual solving process can be improved by optimizing the counterfactual solving process.
[0126] The following describes some implementation manners of the optimization of the counterfactual solution process, taking the variable constraint model shown in formula (5) as an example.
[0127] In a first possible implementation manner, the target variable error term can be optimized based on the feedback information. Specifically, the variable deduction apparatus can learn the feedback information, mine the constraint condition on the target variable implied in the feedback information, and update the constraint condition to the target variable error term of the variable constraint model.
[0128] In a second possible implementation manner, the original variable error term can be optimized based on the feedback information. Specifically, the variable deduction apparatus can learn the feedback information, mine the constraint condition on the original variable implied in the feedback information, and update the constraint condition to the original variable error of the variable constraint model.
[0129] In a third possible implementation manner, the original variable fluctuation term can be optimized based on the feedback information. Specifically, the variable deduction apparatus can determine the value range selected by the user and the value range not selected by the user according to the feedback information. Then, the variable deduction apparatus can calculate the variance of the value range of the selected original variable according to the value range of the selected original variable and the historical value of the original variable, and calculate the variance of the value range of the original variable not selected according to the value range of the original variable not selected and the historical value of the original variable. Then, the original variable fluctuation term is optimized according to the obtained variances. It should be noted that the "variance of the value range of the original variable" here refers to the variance between the value range of the original variable and the historical value of the original variable, rather than the variance of the value range of the original variable itself.
[0130] Optionally, the variable deduction apparatus can determine a target variance range according to the variance of the value range of the original variable not selected and the variance of the value range of the original variable selected. The target variance range is the range of the variance of the original variable deduced by the variable deduction apparatus. The value range of the original variable with the variance within the target variance range has the possibility of being selected by the user. The value range of the original variable with the variance outside the target variance range will not be selected by the user.
[0131] In formula (5), the original variable fluctuation term is the distance between the vector corresponding to the original variable and the vector corresponding to the value of the original variable. After the target variance range is determined, a correlation between the target variance range and the original variable fluctuation term can be established. According to the correlation, it can be determined that the value of the original variable fluctuation term below which can make the variance of the value range of the original variable in the target variance range. Accordingly, when counterfactual reasoning is performed according to the variable constraint model, the value range of the original variable can be controlled within a certain range, so as to control the variance of the value range of the original variable. Alternatively, after counterfactual reasoning is performed according to the variable constraint model and a plurality of value ranges of the original variable are obtained, the variable deduction device can calculate the variance of the value range of each group of original variables one by one, and then determine whether the variance is in the target variance range. If yes, the value range of the original variable is displayed. In this way, the accuracy of variable deduction can be improved by filtering the value range of the original variable according to the variance.
[0132] The application also provides a variable deduction device, wherein the variable deduction device can be applied to the variable deduction device in the implementation manners shown in Figure 1a 、 Figure 1b or Figure 1c to realize the functions of the variable deduction device in the implementation manners shown in Figure 2 or Figure 3 . Specifically, as shown in Figure 4 , the variable deduction device 400 includes:
[0133] a constraint condition acquisition unit 410 configured to acquire a variable constraint condition, the variable constraint condition being used to constrain the value or value range of at least one target variable;
[0134] a mapping relationship acquisition unit 420 configured to acquire a variable mapping relationship corresponding to each target variable, the variable mapping relationship being used to indicate the mapping relationship from at least one original variable to the target variable;
[0135] a counterfactual reasoning unit 430 configured to perform counterfactual reasoning according to the variable mapping relationship and the variable constraint condition to determine the value range of each original variable that makes the target variable satisfy the variable constraint condition.
[0136] The constraint condition acquisition unit 410, the mapping relationship acquisition unit 420 and the counterfactual reasoning unit 430 can be implemented by software or by hardware. For example, the implementation manner of the constraint condition acquisition unit 410 is described below. Similarly, the implementation manners of the mapping relationship acquisition unit 420 and the counterfactual reasoning unit 430 can refer to the implementation manner of the constraint condition acquisition unit 410.
[0137] As an example of a software functional unit, the constraint obtaining unit 410 can include code running on a computing instance. The computing instance can include at least one of a physical host (computing device), a virtual machine, a container. Further, the computing instance can be one or more. For example, the constraint obtaining unit 410 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code can be distributed in the same region, or in different regions. Further, the multiple hosts / virtual machines / containers for running the code can be distributed in the same availability zone (AZ), or in different AZs, each AZ including a data center or multiple data centers in close geographical proximity. Generally, a region can include multiple AZs.
[0138] Similarly, the multiple hosts / virtual machines / containers for running the code can be distributed in the same virtual private cloud (VPC), or in multiple VPCs. Generally, a VPC is set up within a region, and communication between two VPCs in the same region, or between VPCs in different regions, requires a communication gateway to be set up in each VPC, and the interconnection between VPCs is achieved through the communication gateway.
[0139] As an example of a hardware functional unit, the constraint obtaining unit 410 can include at least one computing device, such as a server or the like. Alternatively, the constraint obtaining unit 410 can also be a device implemented by a central processing unit (CPU), or implemented by an application-specific integrated circuit (ASIC), or implemented by a programmable logic device (PLD), and the like. Among them, the PLD can be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system on chip (SoC), an offload card, an acceleration card, or any combination thereof.
[0140] The plurality of computing devices included in the constraint obtaining unit 410 can be distributed in the same region, or can be distributed in different regions. The plurality of computing devices included in the constraint obtaining unit 410 can be distributed in the same AZ, or can be distributed in different AZs. Similarly, the plurality of computing devices included in the constraint obtaining unit 410 can be distributed in the same VPC, or can be distributed in multiple VPCs. Among them, the plurality of computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offload cards, acceleration cards, and the like.
[0141] It should be noted that in other embodiments, the constraint obtaining unit 410 can be used to perform any step in the variable deduction method, the mapping relationship obtaining unit 420 can be used to perform any step in the variable deduction method, and the counterfactual solution unit 430 can be used to perform any step in the variable deduction method. The steps responsible for implementation by the constraint obtaining unit 410, the mapping relationship obtaining unit 420, and the counterfactual solution unit 430 can be specified as needed, and the entire function of the variable deduction device can be implemented by the constraint obtaining unit 410, the mapping relationship obtaining unit 420, and the counterfactual solution unit 430 respectively implementing different steps in the variable deduction method.
[0142] The present application also provides a computing device 100. As shown in Figure 5 The computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate through the bus 102. The computing device 100 can be a server or a terminal device. It should be understood that the number of processors and memories in the computing device 100 is not limited.
[0143] The bus 102 can be a peripheral component interconnect Express (PCIe) bus or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. Among them, the unified bus is also called a smart bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one line is used in the figure, but it does not mean that there is only one bus or one type of bus. The bus 104 can include a path for transmitting information between various components of the computing device 100 (e.g., the memory 106, the processor 104, the communication interface 108). Among them, the unified bus can also be called a smart bus.
[0144] The processor 104 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), an ASIC, an FPGA, a CPLD, an NPU, a SoC, an offload card, an acceleration card, etc. in a computing device.
[0145] The memory 106 can include volatile memory, such as random access memory (RAM). The processor 104 can also include non-volatile memory, such as read-only memory (ROM), Flash memory, a hard disk drive (HDD), or a solid-state drive (SSD). In addition, the memory 106 can also be implemented by storage class memory (SCM), phase change memory (PCM), or other types of storage media.
[0146] It is worth noting that the same type of storage medium can be configured to implement the function of the memory 106 in the same computing device, or two or more types of storage media can be configured to implement the function of the memory 106, which is not limited in the present application.
[0147] The memory 106 stores executable program code, and the processor 104 executes the executable program code to respectively implement the functions of the aforementioned constraint obtaining unit 410, mapping relationship obtaining unit 420, and counterfactual solving unit 430, thereby implementing the variable deduction method. That is, the memory 106 stores instructions for executing the variable deduction method.
[0148] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card and a transceiver to implement communication between the computing device 100 and other devices or communication networks.
[0149] The embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a notebook computer, or a smart phone.
[0150] As shown in Figure 6 The computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster can store the same instructions for executing the variable deduction method.
[0151] In some possible implementation manners, the memory 106 of one or more of the computing devices 100 in the computing device cluster can also respectively store partial instructions for performing the variable deduction method. In other words, the combination of the one or more computing devices 100 can collectively perform the instructions for performing the variable deduction method.
[0152] It should be noted that the memories 106 in different computing devices 100 in the computing device cluster can store different instructions respectively for performing partial functions of the variable deduction apparatus. That is, the instructions stored in the memories 106 in different computing devices 100 can implement the functions of one or more of the constraint condition acquisition unit 410, the mapping relationship acquisition unit 420, and the counterfactual solution unit 430.
[0153] In some possible implementation manners, one or more of the computing devices in the computing device cluster can be connected through a network. The network can be a wide area network, a local area network, or the like. Figure 7 A possible implementation manner is shown. As shown in Figure 7 The two computing devices 100A and 100B are connected through a network. Specifically, the communication interfaces in the respective computing devices are connected to the network. In this type of possible implementation manner, the memory 106 in the computing device 100A stores instructions for performing the functions of the constraint condition acquisition unit 410 and the mapping relationship acquisition unit 420. Meanwhile, the memory 106 in the computing device 100B stores instructions for performing the function of the counterfactual solution unit 430.
[0154] Figure 7 The connection manner between the computing device cluster shown in
[0155] It should be understood that Figure 7 The functions of the computing device 100A shown in
[0156] The embodiments of the present application also provide another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to the connection manner of the computing device cluster Figure 4 and Figure 5 The computing device cluster. The difference is that the memory 106 in one or more of the computing devices 100 in the computing device cluster can store the same instructions for performing the variable deduction method.
[0157] In some possible implementations, partial instructions for performing the variable deduction method can also be respectively stored in the memory 106 of one or more computing devices 100 in the computing device cluster. In other words, the combination of one or more computing devices 100 can collectively execute the instructions for performing the variable deduction method.
[0158] The embodiments of the present application also provide a computer program product containing instructions. The computer program product can be a software or program product containing instructions, which can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to perform the variable deduction method.
[0159] The embodiments of the present application also provide a computer readable storage medium. The computer readable storage medium can be any available medium that the computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), etc. The computer readable storage medium contains instructions, which instruct the computing device to perform the variable deduction method.
[0160] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of variable resolution, characterized by, The method comprises: obtaining a variable constraint condition, the variable constraint condition being used for constraining a value or a value range of at least one target variable; obtaining a variable mapping relationship corresponding to each target variable, the variable mapping relationship being used for indicating a mapping relationship from at least one original variable to the target variable; performing counterfactual reasoning according to the variable mapping relationship and the variable constraint condition to determine a value range of each original variable that makes the target variable satisfy the variable constraint condition.
2. The method of claim 1, wherein, The counterfactual reasoning according to the variable mapping relationship and the variable constraint condition comprises: establishing a variable constraint model according to the variable constraint condition and the variable mapping relationship; performing counterfactual reasoning on the variable constraint model.
3. The method of claim 2, wherein, The establishment of the variable constraint model according to the variable constraint condition and the variable mapping relationship comprises: establishing a target variable error term according to a value or a value range of the target variable constrained by the variable constraint condition and the variable mapping relationship, the target variable error term indicating a difference between a value or a value range of the target variable calculated according to the original variable in the counterfactual reasoning process and the value or the value range of the target variable constrained by the variable constraint condition; determining the variable constraint model according to the target variable error term.
4. The method of claim 3, wherein, The variable constraint condition is also used for constraining a value or a value range of at least one original variable; The determination of the variable constraint model according to the target variable error term comprises: establishing an original variable error term according to a value or a value range of the at least one original variable constrained by the variable constraint condition, the original variable error term indicating a difference between a value or a value range of the at least one original variable in the counterfactual reasoning process and the value or the value range of the at least one original variable constrained by the variable constraint condition; determining the variable constraint model according to the target variable error term and the original variable error term.
5. The method of claim 4, wherein, The determination of the variable constraint model according to the target variable error term comprises: obtaining a historical value of each original variable; establishing an original variable fluctuation term according to the historical value of each original variable, the original variable fluctuation term indicating a difference between a value of each original variable in the counterfactual reasoning process and the historical value; determining the variable constraint model according to the target variable error term, the original variable error term and the original variable fluctuation term.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: displaying a value range obtained by the counterfactual reasoning; obtaining feedback information for the value range; correcting the counterfactual reasoning process according to the feedback information.
7. A variable derivation device characterized by comprising: The device comprises: a constraint condition obtaining unit, configured to obtain a variable constraint condition, the variable constraint condition being used for constraining a value or a value range of at least one target variable; a mapping relationship obtaining unit, configured to obtain a variable mapping relationship corresponding to each target variable, the variable mapping relationship being used for indicating a mapping relationship from at least one original variable to the target variable; The counterfactual solving unit is configured to perform counterfactual solving according to the variable mapping relationship and the variable constraint condition, and determine a value range of each original variable that makes the target variable satisfy the variable constraint condition.
8. The apparatus of claim 7, wherein, The counterfactual solving unit is specifically configured to establish a variable constraint model according to the variable constraint condition and the variable mapping relationship, and perform counterfactual solving on the variable constraint model.
9. The apparatus of claim 8, wherein, The counterfactual solving unit is specifically configured to establish a target variable error term according to a value or a value range of the target variable constrained by the variable constraint condition and the variable mapping relationship, the target variable error term indicating a difference between a value or a value range of the target variable calculated according to the original variable in the counterfactual solving process and the value or the value range of the target variable constrained by the variable constraint condition; and determine the variable constraint model according to the target variable error term. The variable constraint condition is further configured to constrain a value or a value range of at least one original variable; 10. The apparatus of claim 8, wherein, The counterfactual solving unit is specifically configured to establish an original variable error term according to a value or a value range of the at least one original variable constrained by the variable constraint condition, the original variable error term indicating a difference between a value or a value range of the at least one original variable in the counterfactual solving process and the value or the value range of the at least one original variable constrained by the variable constraint condition; and determine the variable constraint model according to the target variable error term and the original variable error term.
11. The apparatus of claim 10, wherein, The counterfactual solving unit is specifically configured to obtain a historical value of each original variable, and establish an original variable fluctuation term according to the historical value of each original variable, the original variable fluctuation term indicating a difference between a value of each original variable in the counterfactual solving process and the historical value; The counterfactual solving unit is specifically configured to determine the variable constraint model according to the target variable error term, the original variable error term, and the original variable fluctuation term. The apparatus further comprises a correction unit; 12. The device of any one of claims 7-11, wherein, The correction unit is configured to display the value range obtained by the counterfactual solving, obtain feedback information for the value range, and correct the counterfactual solving process according to the feedback information. The computing device comprises a processor and a memory; 13. A computing device, comprising: The processor is configured to execute instructions stored in the memory, so that the computing device performs the operation steps of the method of any one of claims 1 to 6. The computing device cluster comprises at least one computing device, and each computing device comprises a processor and a memory:
14. A cluster of computing devices, characterized in that, The memory is configured to store instructions; The processor is configured to execute the instructions, so that the computing device cluster performs the operation steps of the method of any one of claims 1 to 6. 15. A computer-readable storage medium, characterized in that, The computer readable storage medium has stored therein instructions which, when executed on a computing device, cause the computing device to perform the operational steps of the method of any of claims 1 to 6.
16. A computer program product comprising instructions which, when executed on a computing device, cause the computing device to perform the operational steps of the method of any of claims 1 to 6.